Hi,

I'm playing with ANTLRWorks 1.2.1. When I try to debug my grammar, the result 
is a compile error, unreachable statement. Any hints on how to correct this?

Please find the grammar and the console error message included at the bottom.


Thanks,
  András

--- unreachable.g --------------------
grammar unreachable;

ID  :   ('a'..'z'|'A'..'Z')+ ;
DEFINES : '::=' ;
WS  :   (' '|'\t')+ {skip();} ;

prog:   stat+ ;
                
stat:   assignment;

assignment    :    leftValue WS* DEFINES WS* rightValue 
{System.out.println($leftValue.value + "=" + $rightValue.value);};

leftValue returns [String value]:    ID {return $ID.text;};
rightValue returns [String value]:    ID {return $ID.text;}| sequence {return 
$sequence.value;};

sequence returns [String value]:    'SEQUENCE' WS* '{' WS* e=rightValue 
{$value=$e.value;} (WS* ',' WS* e=rightValue {$value += $e.value;})* WS* '}' 
{return $value;};


--- console tab --------------------
[00:10:23] C:\Documents and Settings\iar\My 
Documents\output\unreachableParser.java:419: unreachable statement
[00:10:23]                     break;
[00:10:23]                     ^
[00:10:23] C:\Documents and Settings\iar\My 
Documents\output\unreachableParser.java:435: unreachable statement
[00:10:23]                     break;
[00:10:23]                     ^
[00:10:23] 2 errors

--- end of info ---

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address

Reply via email to