public static final class PGrammar.Builder extends Object
PGrammar, where rules can be
added incrementally, and which takes care of collecting
problem reports along the wayaddRule(PGrammarRule)| Modifier and Type | Field and Description |
|---|---|
Reporter |
reporter
Problems reported when building this grammar
|
| Constructor and Description |
|---|
Builder(List<Option> options,
List<Located<String>> imports,
Extent header,
Extent footer)
Returns a new builder with the given options, imports, header and footer
|
| Modifier and Type | Method and Description |
|---|---|
PGrammar.Builder |
addRule(PGrammarRule rule) |
PGrammar.Builder |
addToken(TokenDecl decl) |
PGrammar |
build() |
public final Reporter reporter
public PGrammar.Builder addToken(TokenDecl decl)
decl - public PGrammar.Builder addRule(PGrammarRule rule)
rule - rule added to the set of rulespublic PGrammar build()
PGrammar.IllFormedException - if the described grammar
is not well-formed