[Mono-list] Jay parser grammar

Miguel de Icaza miguel@ximian.com
10 May 2002 11:54:03 -0400

>   In javaCC, there is a More or special_token keyword that can associate a token with the token next to it. The comment in java code is declared as such.
>   How can I do similar stuff in Jay or Bison parser? Does jay or bison accept a regular expression defined token?

There are a couple of things you can do:

	* The "right" way would be to modify the grammar, but this could
	  be prohibitive.

	* The easy way is that whenever you see something you are
	  interested in (for example inline comments), you track those,
	  and keep them around in a variable in the tokenizer that you
 	  can later query from the parser, just like we do with the 
	  value of the token.