What does the construct basename =
in the following rule?
tabname:
(ID'.')? basename = ID
;
There is this single occurrence of basename
in the grammar.
Using equals in that syntax creates a variable called basename
that can then be referenced in actions:
tabname:
(ID '.')? basename=ID {
if ($basename.equals("CAT"))
System.out.println("CAT found");
};