Re: Columns in flex.

"Virendra K. Mehta" <>
Fri, 27 Jan 1995 04:03:55 GMT

          From comp.compilers

Related articles
Columns in flex. (Regan Russell) (1995-01-23)
Re: Columns in flex. (1995-01-27)
Re: Columns in flex. (Virendra K. Mehta) (1995-01-27)
Re: Columns in flex. (1995-01-27)
Re: Columns in flex. (1995-01-31)
Re: Columns in flex. (1995-01-28)
| List of all articles for this month |

Newsgroups: comp.compilers
From: "Virendra K. Mehta" <>
Keywords: flex, Cobol
Organization: Compilers Central
References: 95-01-051
Date: Fri, 27 Jan 1995 04:03:55 GMT

I had written a COBOL parser once for a language translator (which I can't put
in public domain as it is the property of my company). However I came across
the same problem as you did, that of fixed format and column sensitive
characters like '*', '/', '+' which come in the 7th column or the optional
numbers that come in cols 1-6, and the comments that come after column 72 (I

The solution was pretty simple. Since most COBOL implementations allow for
macros (mine was VS-COBOL II for ES/9000), I had to write a preprocessor
anyway. I took care of all these things there, and then generated a free
format output which could be used by the parser.

Later I integrated all that into the main parser itself, but this did seem a
simple and modular approach on the whole.

[ Regan Russell penned : ]
|o| Q: How do I do column sensitive scanning in flex ?
|o| Q: Or should I write my own scanner ?

Virendra K Mehta Wipro Systems Ltd.

Post a followup to this message

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