The following special constructs can be uses in Java actions. Other analogous C action features are currently unavailable for Java.
Use %define throws
to specify any uncaught exceptions from parser
actions, and initial actions specified by %initial-action
.
The semantic value for the nth component of the current rule. This may not be assigned to. See Java Semantic Values.
The semantic value for the grouping made by the current rule. As a value, this is in the base type (
Object
or as specified by%define stype
) as in not cast to the declared subtype because casts are not allowed on the left-hand side of Java assignments. Use an explicit Java cast if the correct subtype is needed. See Java Semantic Values.
Same as
$$
since Java always allow assigning to the base type. Perhaps we should use this and$<>$
for the value and$$
for setting the value but there is currently no easy way to distinguish these constructs. See Java Semantic Values.
The location information of the nth component of the current rule. This may not be assigned to. See Java Location Values.
The location information of the grouping made by the current rule. See Java Location Values.
Return immediately from the parser, indicating failure. See Java Parser Interface.
Return immediately from the parser, indicating success. See Java Parser Interface.
Start error recovery without printing an error message. See Error Recovery.
Return whether error recovery is being done. In this state, the parser reads token until it reaches a known state, and then restarts normal operation. See Error Recovery.