Package com.sonar.sslr.api
Class Grammar
java.lang.Object
com.sonar.sslr.api.Grammar
- Direct Known Subclasses:
AcuCobolExtension,CicsGrammar,Cobol400Extension,CobolGrammar,DB2Grammar,EnterpriseExtension,GcosExtension,HpExtension,IleCobolExtension,LexerlessGrammar,MicrofocusExtension
Use
LexerfulGrammarBuilder to create instances of this class.
This class is not intended to be instantiated or subclassed by clients.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllRuleFields(Class grammarClass) Find all direct and indirect rule fields declared in the given Grammar class.abstract RuleEach Grammar has always an entry point whose name is usually by convention the "Computation Unit".getRuleFields(Class grammarClass) Find all the direct rule fields declared in the given Grammar class.rule(GrammarRuleKey ruleKey) Allows to obtain an instance of grammar rule, which was constructed byLexerlessGrammarBuilderandLexerfulGrammarBuilder.
-
Constructor Details
-
Grammar
public Grammar()
-
-
Method Details
-
getRuleFields
Find all the direct rule fields declared in the given Grammar class. Inherited rule fields are not returned.- Parameters:
grammarClass- the class of the Grammar for which rule fields must be found- Returns:
- the rule fields declared in this class, excluding the inherited ones
- See Also:
-
getAllRuleFields
Find all direct and indirect rule fields declared in the given Grammar class. Inherited rule fields are also returned.- Parameters:
grammarClass- the class of the Grammar for which rule fields must be found- Returns:
- the rule fields declared in this class, as well as the inherited ones
- See Also:
-
rule
Allows to obtain an instance of grammar rule, which was constructed byLexerlessGrammarBuilderandLexerfulGrammarBuilder.- Since:
- 1.18
-
getRootRule
Each Grammar has always an entry point whose name is usually by convention the "Computation Unit".- Returns:
- the entry point of this Grammar
-