Writing a parser


RE: Writing a parser
#9
(2020-02-20, 22:36)Michael Horvath Wrote: I'm starting to write my own parser that will convert an MPD file to JSON format.

Are the FILE, Name:, Author:, !LICENSE, ROTATION properties case-sensitive? Will they always be the same case as I typed them or should I ignore case?

Thanks.

There are some old files, either distributed with the AIOI or in OMR (can't remember where) where "0 file " is in lower case.
If you ignore the case while detecting file headers, then you will face trouble with headers, such as:

Code:
0 FILE File_cabinet.ldr
0 File cabinet for Miniland Figures
0 Name: File_cabinet.ldr
...

My proposed solution for handling this is to:

1) Detect if there is any "0 FILE" statement. If such a statement exist, then only accept proper UPPER CASE 0 FILE statements
2) Otherwise, accept all "0 fILE" case insensitive statements as if they were "0 FILE" statements.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Writing a parser - by Michael Horvath - 2020-02-20, 22:36
RE: Writing a parser - by Jarema - 2020-02-20, 22:40
RE: Writing a parser - by Orion Pobursky - 2020-02-20, 22:57
RE: Writing a parser - by Michael Horvath - 2020-02-20, 23:07
RE: Writing a parser - by Orion Pobursky - 2020-02-21, 0:33
RE: Writing a parser - by Michael Horvath - 2020-02-21, 3:02
RE: Writing a parser - by Orion Pobursky - 2020-02-21, 4:04
RE: Writing a parser - by Michael Horvath - 2020-02-21, 8:06
RE: Writing a parser - by Lasse Deleuran - 2020-02-21, 11:07
RE: Writing a parser - by Michael Horvath - 2020-02-22, 1:38
RE: Writing a parser - by Michael Horvath - 2021-04-21, 3:18
RE: Writing a parser - by Gerald Lasser - 2021-04-21, 6:40
RE: Writing a parser - by Michael Horvath - 2021-04-21, 12:49

Forum Jump:


Users browsing this thread: 2 Guest(s)