[antlr-interest] 3.1b1 throwing RewriteEmptyStreamExceptions

Cameron Skinner camerons at microsoft.com
Sat Jul 5 16:07:17 PDT 2008


I think it might have something to do with the fact that you have the plus operator on the INT token in the rewrite rule, but not in the parser rule itself?

-----Original Message-----
From: André van der Merwe <AndrevdM at pyrogenesis.co.za>
Sent: Friday, July 04, 2008 5:38 AM
To: antlr-interest at antlr.org <antlr-interest at antlr.org>
Subject: [antlr-interest] 3.1b1 throwing RewriteEmptyStreamExceptions


Hi,

I can't get ANTLR 3.1b1 to generate ASTs using C#. Am I doing something wrong or is the beta not generating valid C# yet?


Here is the very simplistic grammar I use. Parsing "1+1" will break with a RewriteEmptyStreamExceptions

   grammar Simple;

   options
   {
      output=AST;
      ASTLabelType=CommonTree;
      language=CSharp2;
   }

   expr : INT '+' INT -> ^('+' INT+);
   INT : ('0'..'9')+;
   WS : (' '|'\t'|'\u000C'|'\r'|'\n') {Skip();};



Any ideas?



Thanks

Andre



More information about the antlr-interest mailing list