[Top]
Parser
Parser.LR
Parser.LR.Rule
|
Class Parser.LR.Rule
- Description
-
This object is used to represent a BNF-rule in the LR parser.
- Variable
nonterminal
-
int nonterminal
- Description
-
Non-terminal this rule reduces to.
- Variable
symbols
-
array(string|int) symbols
- Description
-
The actual rule
- Variable
action
-
function|string action
- Description
-
Action to do when reducing this rule.
function - call this function.
string - call this function by name in the object given to the parser.
The function is called with arguments corresponding to the values of
the elements of the rule. The return value of the function will be
the value of this non-terminal. The default rule is to return the first
argument.
- Variable
has_tokens
-
int has_tokens
- Description
-
This rule contains tokens
- Variable
num_nonnullables
-
int num_nonnullables
- Description
-
This rule has this many non-nullable symbols at the moment.
- Variable
number
-
int number
- Description
-
Sequence number of this rule (used for conflict resolving)
Also used to identify the rule.
- Variable
pri
-
Priority pri
- Description
-
Priority and associativity of this rule.
|