public final class PGrammar extends Object
The rules use a set of terminals which are provided before the header section in the source file. Each terminal can optionally be associated to a value of some Java type at run-time.
Rule names are identifiers which start with a lower-case letter. Terminal names are identifiers all in upper case.
Modifier and Type | Class and Description |
---|---|
static class |
PGrammar.Builder
A builder class for
PGrammar , where rules can be
added incrementally, and which takes care of collecting
problem reports along the way |
static class |
PGrammar.IllFormedException
Exception raised by the grammar builder class
when trying to construct an ill-formed grammar description.
|
Modifier and Type | Field and Description |
---|---|
Extent |
footer
The extent of this parser class' footer
|
Extent |
header
The extent of this parser class' header
|
List<Located<String>> |
imports
The Java imports to be added to the generated parser
|
List<Option> |
options
The configuration options specified in this grammar
|
Map<String,PGrammarRule> |
rules
The map of all grammar rules in the parser, indexed by their name
|
List<TokenDecl> |
tokenDecls
The declarations for all terminals of this grammar
|
public final List<Located<String>> imports
public final List<TokenDecl> tokenDecls
public final Extent header
public final Map<String,PGrammarRule> rules
public final Extent footer
public PGrammarRule rule(String name)
name
- name
in this grammarIllegalArgumentException
- if no such rule exists