|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. email@example.com (Virendra K. Mehta) (1995-01-27)|
|Re: Columns in flex. firstname.lastname@example.org (1995-01-27)|
|Re: Columns in flex. email@example.com (1995-01-31)|
|Re: Columns in flex. firstname.lastname@example.org (1995-01-28)|
|From:||email@example.com (Joachim Schrod)|
|Organization:||TH Darmstadt, FG Systemprogrammierung|
|Date:||Tue, 31 Jan 1995 19:02:38 GMT|
C.A.Elliott@dcs.warwick.ac.uk (Charles Elliott) writes:
> [Q: column sensitive scanning in flex? A: track them in the actions]
> In the Bison/Yacc part, simply have a semantic instruction that
> compares the value of the variable with the correct amount - obviously you will
> have to declare the variable as an extern to be able to use it in both modules.
> If there is a better way, please let me know!
Two small comments:
* Bison provides the `@N'-Feature to access line/column for
start/end of columns. Read the sections (info nodes) ``Textual
Positions of Tokens'' and ``Special Features for Use in Actions'' of
Bison's documentation for more information.
* In my experience, it's better to update the column information in
one of the flex supplied hooks, eg, in YY_USER_ACTION. You have to
pay attention to yyunput(), yyless(), and yymore(), 'though. But then,
they don't occur in every action, and it's more easy to maintain the
Joachim Schrod Email: firstname.lastname@example.org
Computer Science Department
Technical University of Darmstadt, Germany
Return to the
Search the comp.compilers archives again.