Re: EBNF definition for RPG?

Jeremy Boden <>
6 Mar 2000 00:23:50 -0500

          From comp.compilers

Related articles
EBNF definition for RPG? (Peter Dackombe) (2000-02-22)
Re: EBNF definition for RPG? (2000-02-27)
Re: EBNF definition for RPG? (Charles E. Bortle, Jr.) (2000-02-28)
Re: EBNF definition for RPG? (2000-02-28)
Re: EBNF definition for RPG? (Joachim Durchholz) (2000-03-06)
Re: EBNF definition for RPG? (Jeremy Boden) (2000-03-06)
Re: EBNF definition for RPG? (Charles E. Bortle, Jr.) (2000-03-06)
| List of all articles for this month |

From: Jeremy Boden <>
Newsgroups: comp.compilers
Date: 6 Mar 2000 00:23:50 -0500
Organization: Compilers Central
References: 00-02-113 00-02-143 00-02-161
Keywords: parse

Charles E. Bortle, Jr. <> 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 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.
Jeremy Boden

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.