Package com.sonar.sslr.api
Interface Rule
- All Superinterfaces:
AstNodeType
- All Known Subinterfaces:
CompilableGrammarRule
- All Known Implementing Classes:
MutableParsingRule,RuleDefinition
This interface is not intended to be implemented by clients.
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.voidmock()Deprecated.in 1.18, useoverride(Object...)instead.Deprecated.in 1.19, useGrammarRuleBuilder.override(Object)instead.voidskip()Deprecated.in 1.19, useGrammarRuleBuilder.skip()instead.voidDeprecated.in 1.19, useGrammarRuleBuilder.skipIfOneChild()instead.
-
Method Details
-
is
Deprecated.in 1.19, useGrammarRuleBuilder.is(Object)instead.Allows to provide definition of a grammar rule.Note: this method can be called only once for a rule. If it is called more than once, an IllegalStateException will be thrown.
- Parameters:
e- expression of grammar that defines this rule- Returns:
- this (for method chaining)
- Throws:
IllegalStateException- if definition has been already doneIllegalArgumentException- if any of given arguments is not a parsing expression
-
override
Deprecated.in 1.19, useGrammarRuleBuilder.override(Object)instead.Allows to override definition of a grammar rule.This method has the same effect as
, except that it can be called more than once to redefine a rule from scratch.invalid reference
#is(Object)- Parameters:
e- expression of grammar that defines this rule- Returns:
- this (for method chaining)
- Throws:
IllegalArgumentException- if any of given arguments is not a parsing expression
-
skip
Deprecated.in 1.19, useGrammarRuleBuilder.skip()instead.Indicates that grammar rule should not lead to creation of AST node - its children should be attached directly to its parent. -
skipIfOneChild
Deprecated.in 1.19, useGrammarRuleBuilder.skipIfOneChild()instead.Indicates that grammar rule should not lead to creation of AST node if it has exactly one child. -
mock
Deprecated.in 1.18, useoverride(Object...)instead.Utility method used for unit testing in order to dynamically replace the definition of the rule to match as soon as a token whose value equals the name of the rule is encountered.
-
GrammarRuleBuilder.is(Object)instead.