[antlr-interest] options and tokens

David Holroyd dave at badgers-in-foil.co.uk
Tue Jan 15 00:35:09 PST 2008


On Tue, Jan 15, 2008 at 02:10:29AM -0600, Shaun Bogan wrote:
> My grammar starts out something like this:
> 
> grammar fqs;
> 
> tokens {
>    IMAGINARY;
> }
> 
> options {
>   output=AST;
> }
> 
> However, I get a an error that options is unexpected.  How do I create
> imaginary tokens for my rewrites if I can't use both options and
> tokens?  If I flip the order, it always complains about the second
> one.  Am I missing something here?  This is my first time trying to
> use AST rewrite rules.

I have it working with,

  grammar G;
  options { ... }
  tokens { ... }

What error do you see with them ordered this way?


ta,
dave

-- 
http://david.holroyd.me.uk/


More information about the antlr-interest mailing list