Hi Roger,

There's currently no support for this. But, how about creating an empty production where the name of the production encodes the version:

...
Productions
  program = version ...;
  version = v10;
  v10 = ;

Of course, you would need to devise an encoding that conforms to SableCC's identifier syntax.

Have fun!

Etienne

I need to be able to track the revision number of my syntax, so that a user can know what version they are using. I would like be able to somehow define a string that would automatically be inserted in the AST of my tree and be able to return that string. (Basically, I want a node that returns a token to always appear in the tree, regardless of whether that token *actually* occurs in the input file that I am parsing) Is there a good way to do this? I can generate the node in the AST without any problem, but feeding it the desired string is what I dont see how to do....


--
Etienne M. Gagnon, Ph.D.
SableCC:                                            http://sablecc.org

_______________________________________________
SableCC-Discussion mailing list
[email protected]
http://lists.sablecc.org/listinfo/sablecc-discussion

Reply via email to