Re: Columns in flex.

"Virendra K. Mehta" <c1veeru@watson.ibm.com>
Fri, 27 Jan 1995 04:03:55 GMT

          From comp.compilers

Related articles
Columns in flex. Regan.Russell@jcu.edu.au (Regan Russell) (1995-01-23)
Re: Columns in flex. C.A.Elliott@dcs.warwick.ac.uk (1995-01-27)
Re: Columns in flex. c1veeru@watson.ibm.com (Virendra K. Mehta) (1995-01-27)
Re: Columns in flex. robertsw@agcs.com (1995-01-27)
Re: Columns in flex. schrod@iti.informatik.th-darmstadt.de (1995-01-31)
Re: Columns in flex. flisakow@cs.wisc.edu (1995-01-28)
| List of all articles for this month |
Newsgroups: comp.compilers
From: "Virendra K. Mehta" <c1veeru@watson.ibm.com>
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
think).


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.


Veeru.
--
[ 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.
c1veeru@watson.ibm.com
--


Post a followup to this message

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