|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GrammarRuleBuilder
This interface contains methods used to describe rule of grammar.
This interface is not intended to be implemented by clients.
LexerlessGrammarBuilder.rule(GrammarRuleKey),
LexerfulGrammarBuilder.rule(GrammarRuleKey)| Method Summary | |
|---|---|
GrammarRuleBuilder |
is(Object e)
Allows to provide definition of a grammar rule. |
GrammarRuleBuilder |
is(Object e,
Object... rest)
Convenience method equivalent to calling is(grammarBuilder.sequence(e, rest)). |
GrammarRuleBuilder |
override(Object e)
Allows to override definition of a grammar rule. |
GrammarRuleBuilder |
override(Object e,
Object... rest)
Convenience method equivalent to calling override(grammarBuilder.sequence(e, rest)). |
void |
recoveryRule()
Deprecated. in 1.19, no difference between usual grammar rule and "recovery rule" - both will be presented in AST and so can be handled via AST visitor. |
void |
skip()
Indicates that grammar rule should not lead to creation of AST node - its children should be attached directly to its parent. |
void |
skipIfOneChild()
Indicates that grammar rule should not lead to creation of AST node if it has exactly one child. |
| Method Detail |
|---|
GrammarRuleBuilder is(Object e)
Note: this method can be called only once for a rule. If it is called more than once, an GrammarException will be thrown.
e - expression of grammar
GrammarException - if definition has been already done
IllegalArgumentException - if given argument is not a parsing expression
GrammarRuleBuilder is(Object e,
Object... rest)
is(grammarBuilder.sequence(e, rest)).
e - expression of grammarrest - rest of expressions
GrammarException - if definition has been already done
IllegalArgumentException - if any of given arguments is not a parsing expressionis(Object)GrammarRuleBuilder override(Object e)
This method has the same effect as is(Object), except that it can be called more than once to redefine a rule from scratch.
e - expression of grammar
IllegalArgumentException - if given argument is not a parsing expression
GrammarRuleBuilder override(Object e,
Object... rest)
override(grammarBuilder.sequence(e, rest)).
e - expression of grammarrest - rest of expressions
IllegalArgumentException - if any of given arguments is not a parsing expressionoverride(Object)void skip()
void skipIfOneChild()
@Deprecated void recoveryRule()
UnsupportedOperationException - always
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||