|EBNF definition for RPG? PDackombe@transoft.com (Peter Dackombe) (2000-02-22)|
|Re: EBNF definition for RPG? email@example.com (2000-02-27)|
|Re: EBNF definition for RPG? firstname.lastname@example.org (Charles E. Bortle, Jr.) (2000-02-28)|
|Re: EBNF definition for RPG? email@example.com (2000-02-28)|
|Re: EBNF definition for RPG? firstname.lastname@example.org (Joachim Durchholz) (2000-03-06)|
|Re: EBNF definition for RPG? email@example.com (Jeremy Boden) (2000-03-06)|
|Re: EBNF definition for RPG? firstname.lastname@example.org (Charles E. Bortle, Jr.) (2000-03-06)|
|From:||Jeremy Boden <email@example.com>|
|Date:||6 Mar 2000 00:23:50 -0500|
|References:||00-02-113 00-02-143 00-02-161|
Charles E. Bortle, Jr. <firstname.lastname@example.org> writes
>Our moderator wrote:
>> [Oh, you can certainly write a lexer that turns column positions
>> into tokens. But the syntax of RPG is so simple that BNF seems like
>> overkill. -John]
>Yes. I have been planning to do a RPG II for a long time, and I would
>never consider a formal parser. If I were coding the compiler in
>Pascal I would use variant records, and use the RPG record type as a
>tag field. Just read a line at a time fromt he source into the
>record. Now, based on the RPG record type in the tag field, just
>access the fields directly....no need to scan/parse since the record
>type automatically parses it for us into appropriate "buckets" :-)
>Just do semantic processing on a record by record basis since the
>record automatically pre-parses the input.
>The generated code is really just a pre-designed fixed logic
>algorithm, with allowances for the record type and control indicators.
I think you may have particular trouble with the "I" specifications;
its format varies according to what columns are used. For example it
could be a multi-line file description, a constant definition, a
rename of a field, part of a data structure plus quite a few other
possibilities, some of them machine dependent.
Return to the
Search the comp.compilers archives again.