> [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.