Hi,

I am trying to use ANTLR for the first time, and am getting an error when
trying to run the grammar shown below; I would be grateful for any help in
identifying what the issue is.

The test input I am using is:

package test;

I am using the Eclipse ANTLR IDE plugin and when I try to interpret above, I
get:
MimatchedTokenException: Line 1:7 mismatched input '' expecting '\u0006'

Below is the grammar I am using:

----------------------------------

grammar Problematic;

options {
  language = Java;
}

compilationUnit
    :   packageDeclaration
    ;

packageDeclaration
    :   PACKAGE qualifiedName SEMI
    ;

qualifiedName
    :   IDENTIFIER (DOT IDENTIFIER)*
    ;

WS
    :   (
             ' '
        |    '\r'
        |    '\t'
        |    '\u000C'
        |    '\n'
        )
            {
                skip();
            }
    ;

PACKAGE
    :   'package'
    ;

SEMI
    :   ';'
    ;

DOT
    :   '.'
    ;

IDENTIFIER
    :   ('a'..'z'|'A'..'Z'|'_'|'$') ('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'$')*
    ;

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/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