I'm having an issue with what seems to be very simple grammar...

The CREATECOMMAND is parsing correctly...

Here is what I use for validation...

create jar named "alex.jar"

I get a NoViableAltException for the TYPE definition

The grammar file is below...


//////// alex.g ////////

grammar alex;

tokens {
        BUILD='build';
        FROM='from';
        TO='to';
        CREATE='create';
        NAMED='named';
}

COMMAND         :       BUILDCOMMAND CREATECOMMAND;

BUILDCOMMAND    :       BUILD (SOURCE | DESTINATION)+;
CREATECOMMAND   :       CREATE TYPE (NAME | SOURCE | DESTINATION)+;

SOURCE          :       FROM FILE;
DESTINATION     :       TO FILE;

TYPE            :       ('jar' | 'war');

NAME            :       NAMED FILE;

FILE            :       '"' FILENAME '"';
FILENAME        :       ('a'..'z'|'A'..'Z'|'0'..'9'|'.')+;

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


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to