« Return to Thread: Fwd: Re: nested lists in SableCC 3

How to get line#?

by Dehua Zhang :: Rate this Message:

Reply to Author | View in Thread


Hi guys,

I had transformed my CST to AST.

but for most situations, I did not keep Tokens in the AST, for example,

...
exp =
  {l_value} l_value
| {eq} [lhs]:exp [rhs]:exp
| {lt} [lhs]:exp [rhs]:exp
| {gt} [lhs]:exp [rhs]:exp
...

however, when traversing the AST by extends the DepthFirstAdapter, I can not get the line# of an exp.

How to solve it?

--
Dehua (Andy) Zhang
Sable Research Group, McGill University
Montréal, Québec, Canada
http://www.cs.mcgill.ca/~dzhang25

_______________________________________________
SableCC-Discussion mailing list
SableCC-Discussion@...
http://lists.sablecc.org/listinfo/sablecc-discussion

 « Return to Thread: Fwd: Re: nested lists in SableCC 3

LightInTheBox - Buy quality products at wholesale price!