Package com.sonar.sslr.api
Interface Rule
-
- All Superinterfaces:
AstNodeType
- All Known Subinterfaces:
CompilableGrammarRule
- All Known Implementing Classes:
MutableParsingRule,RuleDefinition
public interface Rule extends AstNodeType
This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Ruleis(Object... e)Deprecated.in 1.19, useGrammarRuleBuilder.is(Object)instead.voidmock()Deprecated.in 1.18, useoverride(Object...)instead.Ruleoverride(Object... e)Deprecated.in 1.19, useGrammarRuleBuilder.override(Object)instead.voidskip()Deprecated.in 1.19, useGrammarRuleBuilder.skip()instead.voidskipIfOneChild()Deprecated.in 1.19, useGrammarRuleBuilder.skipIfOneChild()instead.
-
-
-
Method Detail
-
is
@Deprecated Rule is(Object... e)
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 Rule override(Object... e)
Deprecated.in 1.19, useGrammarRuleBuilder.override(Object)instead.Allows to override definition of a grammar rule.This method has the same effect as
#is(Object), except that it can be called more than once to redefine a rule from scratch.- 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 void 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 void 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 void 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.
-
-