Re: EBNF definition for RPG?

"Charles E. Bortle, Jr." <cbrtjr@ix.netcom.com>
28 Feb 2000 03:03:54 -0500

          From comp.compilers

Related articles
EBNF definition for RPG? PDackombe@transoft.com (Peter Dackombe) (2000-02-22)
Re: EBNF definition for RPG? rkrayhawk@aol.com (2000-02-27)
Re: EBNF definition for RPG? cbrtjr@ix.netcom.com (Charles E. Bortle, Jr.) (2000-02-28)
Re: EBNF definition for RPG? rkrayhawk@aol.com (2000-02-28)
Re: EBNF definition for RPG? joachim.durchholz@halstenbach.com.or.de (Joachim Durchholz) (2000-03-06)
Re: EBNF definition for RPG? jeremy@jboden.demon.co.uk (Jeremy Boden) (2000-03-06)
Re: EBNF definition for RPG? cbrtjr@ix.netcom.com (Charles E. Bortle, Jr.) (2000-03-06)
| List of all articles for this month |
From: "Charles E. Bortle, Jr." <cbrtjr@ix.netcom.com>
Newsgroups: comp.compilers
Date: 28 Feb 2000 03:03:54 -0500
Organization: MindSpring Enterprises
References: 00-02-113 00-02-143
Keywords: syntax

Hello,


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.
--
Charles cbrtjr@ix.netcom.com
* http://pw2.netcom.com/~cbrtjr/wrdthing.html *


Post a followup to this message

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