I had no problem getting your parser to recognize the "VAR" keyword. The problem is that the "a" is tokenized as a 'VALUE' token, while the parser expects an 'ID` token after the "VAR" keyword. (See input and output below.)
The rule for VALUE' has precedence over the rule for
ID` by virtue of being first. (See question 3.3 in the FAQ.)
What you probably should do is replace the rule you have now for VALUE
with the following rule.
void Value() : {} { <ID> | <NUMBER> }
Input:
VAR
a
Output:
Call: program
Call: varDeclarations
Current character : V (86) at line 1 column 1
Possible string literal matches : { "VAR" }
Current character : A (65) at line 1 column 2
Possible string literal matches : { "VAR" }
Current character : R (82) at line 1 column 3
No more string literal token matches are possible.
Currently matched the first 3 characters as a "VAR" token.
****** FOUND A "VAR" MATCH (VAR) ******
Consumed token: <"VAR" at line 1 column 1>
past VAR token
Skipping character : \n (10)
Current character : a (97) at line 2 column 1
No string literal matches possible.
Starting NFA to match one of : { <VALUE> }
Current character : a (97) at line 2 column 1
Currently matched the first 1 characters as a <VALUE> token.
Possible kinds of longer matches : { <VALUE>, <ID> }
Current character : \n (10) at line 2 column 2
Currently matched the first 1 characters as a <VALUE> token.
Putting back 1 characters into the input stream.
****** FOUND A <VALUE> MATCH (a) ******
Return: varDeclarations
Return: program
Exception in thread "main" tokenNotMatched.ParseException: Encountered " <VALUE> "a "" at line 2, column 1.
Was expecting:
<ID> ...