Class AbstractAntlrGrammarGenerator
- java.lang.Object
-
- org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGrammarGenerator
-
- Direct Known Subclasses:
AbstractAntlrGrammarWithActionsGenerator
,AntlrDebugGrammarGenerator
public abstract class AbstractAntlrGrammarGenerator extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected GrammarAccessExtensions
_grammarAccessExtensions
protected SyntheticTerminalDetector
_syntheticTerminalDetector
protected XtextGeneratorNaming
_xtextGeneratorNaming
protected KeywordHelper
keywordHelper
-
Constructor Summary
Constructors Constructor Description AbstractAntlrGrammarGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
_assignmentEbnf(org.eclipse.xtext.AbstractElement it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
protected java.lang.String
_assignmentEbnf(org.eclipse.xtext.Action it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
protected java.lang.String
_assignmentEbnf(org.eclipse.xtext.Alternatives it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
protected java.lang.String
_assignmentEbnf(org.eclipse.xtext.Assignment it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
protected java.lang.String
_assignmentEbnf(org.eclipse.xtext.CrossReference it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
protected java.lang.String
_assignmentEbnf(org.eclipse.xtext.Group it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
protected java.lang.String
_assignmentEbnf(org.eclipse.xtext.RuleCall it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
protected java.lang.CharSequence
_compileRule(java.lang.String keyword, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
protected java.lang.CharSequence
_compileRule(org.eclipse.xtext.EnumRule it, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
protected java.lang.CharSequence
_compileRule(org.eclipse.xtext.ParserRule it, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
protected java.lang.CharSequence
_compileRule(org.eclipse.xtext.TerminalRule it, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
protected java.lang.String
_crossrefEbnf(org.eclipse.xtext.AbstractElement it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
protected java.lang.String
_crossrefEbnf(org.eclipse.xtext.Alternatives it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
protected java.lang.String
_crossrefEbnf(org.eclipse.xtext.Keyword it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
protected java.lang.String
_crossrefEbnf(org.eclipse.xtext.RuleCall it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
protected java.lang.String
_dataTypeEbnf2(org.eclipse.xtext.AbstractElement it, boolean supportActions)
protected java.lang.String
_dataTypeEbnf2(org.eclipse.xtext.Alternatives it, boolean supportActions)
protected java.lang.String
_dataTypeEbnf2(org.eclipse.xtext.Group it, boolean supportActions)
protected java.lang.String
_dataTypeEbnf2(org.eclipse.xtext.Keyword it, boolean supportActions)
protected java.lang.String
_dataTypeEbnf2(org.eclipse.xtext.RuleCall it, boolean supportActions)
protected java.lang.String
_dataTypeEbnf2(org.eclipse.xtext.UnorderedGroup it, boolean supportActions)
protected java.lang.String
_ebnf2(org.eclipse.xtext.AbstractElement it, AntlrOptions options, boolean supportActions)
protected java.lang.String
_ebnf2(org.eclipse.xtext.Action it, AntlrOptions options, boolean supportActions)
protected java.lang.String
_ebnf2(org.eclipse.xtext.Alternatives it, AntlrOptions options, boolean supportActions)
protected java.lang.String
_ebnf2(org.eclipse.xtext.Assignment it, AntlrOptions options, boolean supportActions)
protected java.lang.String
_ebnf2(org.eclipse.xtext.EnumLiteralDeclaration it, AntlrOptions options, boolean supportActions)
protected java.lang.String
_ebnf2(org.eclipse.xtext.Group it, AntlrOptions options, boolean supportActions)
protected java.lang.String
_ebnf2(org.eclipse.xtext.Keyword it, AntlrOptions options, boolean supportActions)
protected java.lang.String
_ebnf2(org.eclipse.xtext.RuleCall it, AntlrOptions options, boolean supportActions)
protected java.lang.String
_ebnf2(org.eclipse.xtext.UnorderedGroup it, AntlrOptions options, boolean supportActions)
protected boolean
_mustBeParenthesized(org.eclipse.xtext.AbstractElement it)
protected boolean
_mustBeParenthesized(org.eclipse.xtext.Alternatives it)
protected boolean
_mustBeParenthesized(org.eclipse.xtext.Assignment it)
protected boolean
_mustBeParenthesized(org.eclipse.xtext.Group it)
protected java.lang.String
assignmentEbnf(org.eclipse.xtext.AbstractElement it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
protected java.lang.String
compileEBNF(org.eclipse.xtext.AbstractRule it, AntlrOptions options)
protected java.lang.String
compileFinally(org.eclipse.xtext.AbstractRule it, AntlrOptions options)
protected java.lang.String
compileInit(org.eclipse.xtext.AbstractRule it, AntlrOptions options)
protected java.lang.CharSequence
compileKeywordRules(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileLexer(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileLexerHeader(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileLexerImports(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileLexerOptions(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileParser(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileParserHeader(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.String
compileParserImports(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.String
compileParserMembers(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileParserOptions(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileRule(java.lang.Object it, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
protected java.lang.String
compileRuleCatch(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileRules(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileTerminalRules(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.CharSequence
compileTokens(org.eclipse.xtext.Grammar it, AntlrOptions options)
protected java.lang.String
crossrefEbnf(org.eclipse.xtext.AbstractElement it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
protected java.lang.String
crossrefEbnf(org.eclipse.xtext.AbstractRule it, org.eclipse.xtext.RuleCall call, org.eclipse.xtext.CrossReference ref, boolean supportActions)
protected java.lang.String
dataTypeEbnf(org.eclipse.xtext.AbstractElement it, boolean supportActions)
protected java.lang.String
dataTypeEbnf2(org.eclipse.xtext.AbstractElement it, boolean supportActions)
protected java.lang.String
dataTypeEbnfPredicate(org.eclipse.xtext.AbstractElement it)
protected java.lang.String
ebnf(org.eclipse.xtext.AbstractElement it, AntlrOptions options, boolean supportActions)
protected java.lang.String
ebnf(org.eclipse.xtext.Keyword it)
protected java.lang.String
ebnf2(org.eclipse.xtext.AbstractElement it, AntlrOptions options, boolean supportActions)
protected java.lang.String
ebnfPredicate(org.eclipse.xtext.AbstractElement it, AntlrOptions options)
void
generate(org.eclipse.xtext.Grammar it, AntlrOptions options, IXtextGeneratorFileSystemAccess fsa)
protected abstract GrammarNaming
getGrammarNaming()
protected boolean
isCombinedGrammar()
protected boolean
isParserBackTracking(org.eclipse.xtext.Grammar it, AntlrOptions options)
boolean
mustBeParenthesized(org.eclipse.xtext.AbstractElement it)
protected boolean
shouldBeSkipped(org.eclipse.xtext.TerminalRule it, org.eclipse.xtext.Grammar grammar)
protected java.lang.String
toAntlrKeywordRule(java.lang.String keyword, AntlrOptions options)
-
-
-
Field Detail
-
_xtextGeneratorNaming
@Inject @Extension protected XtextGeneratorNaming _xtextGeneratorNaming
-
_grammarAccessExtensions
@Inject @Extension protected GrammarAccessExtensions _grammarAccessExtensions
-
_syntheticTerminalDetector
@Inject @Extension protected SyntheticTerminalDetector _syntheticTerminalDetector
-
keywordHelper
protected KeywordHelper keywordHelper
-
-
Method Detail
-
generate
public void generate(org.eclipse.xtext.Grammar it, AntlrOptions options, IXtextGeneratorFileSystemAccess fsa)
-
isCombinedGrammar
protected boolean isCombinedGrammar()
-
getGrammarNaming
protected abstract GrammarNaming getGrammarNaming()
-
compileParser
protected java.lang.CharSequence compileParser(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileLexer
protected java.lang.CharSequence compileLexer(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileParserOptions
protected java.lang.CharSequence compileParserOptions(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
isParserBackTracking
protected boolean isParserBackTracking(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileLexerOptions
protected java.lang.CharSequence compileLexerOptions(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileTokens
protected java.lang.CharSequence compileTokens(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileLexerHeader
protected java.lang.CharSequence compileLexerHeader(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileLexerImports
protected java.lang.CharSequence compileLexerImports(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileParserHeader
protected java.lang.CharSequence compileParserHeader(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileParserImports
protected java.lang.String compileParserImports(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileParserMembers
protected java.lang.String compileParserMembers(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileRuleCatch
protected java.lang.String compileRuleCatch(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileRules
protected java.lang.CharSequence compileRules(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileKeywordRules
protected java.lang.CharSequence compileKeywordRules(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
compileTerminalRules
protected java.lang.CharSequence compileTerminalRules(org.eclipse.xtext.Grammar it, AntlrOptions options)
-
_compileRule
protected java.lang.CharSequence _compileRule(org.eclipse.xtext.EnumRule it, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
-
_compileRule
protected java.lang.CharSequence _compileRule(org.eclipse.xtext.ParserRule it, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
-
_compileRule
protected java.lang.CharSequence _compileRule(org.eclipse.xtext.TerminalRule it, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
-
_compileRule
protected java.lang.CharSequence _compileRule(java.lang.String keyword, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
-
toAntlrKeywordRule
protected java.lang.String toAntlrKeywordRule(java.lang.String keyword, AntlrOptions options)
-
shouldBeSkipped
protected boolean shouldBeSkipped(org.eclipse.xtext.TerminalRule it, org.eclipse.xtext.Grammar grammar)
-
compileEBNF
protected java.lang.String compileEBNF(org.eclipse.xtext.AbstractRule it, AntlrOptions options)
-
compileInit
protected java.lang.String compileInit(org.eclipse.xtext.AbstractRule it, AntlrOptions options)
-
compileFinally
protected java.lang.String compileFinally(org.eclipse.xtext.AbstractRule it, AntlrOptions options)
-
ebnf
protected java.lang.String ebnf(org.eclipse.xtext.AbstractElement it, AntlrOptions options, boolean supportActions)
-
ebnfPredicate
protected java.lang.String ebnfPredicate(org.eclipse.xtext.AbstractElement it, AntlrOptions options)
-
dataTypeEbnf
protected java.lang.String dataTypeEbnf(org.eclipse.xtext.AbstractElement it, boolean supportActions)
-
dataTypeEbnfPredicate
protected java.lang.String dataTypeEbnfPredicate(org.eclipse.xtext.AbstractElement it)
-
_dataTypeEbnf2
protected java.lang.String _dataTypeEbnf2(org.eclipse.xtext.AbstractElement it, boolean supportActions)
-
_dataTypeEbnf2
protected java.lang.String _dataTypeEbnf2(org.eclipse.xtext.Alternatives it, boolean supportActions)
-
_dataTypeEbnf2
protected java.lang.String _dataTypeEbnf2(org.eclipse.xtext.Group it, boolean supportActions)
-
_dataTypeEbnf2
protected java.lang.String _dataTypeEbnf2(org.eclipse.xtext.UnorderedGroup it, boolean supportActions)
-
_dataTypeEbnf2
protected java.lang.String _dataTypeEbnf2(org.eclipse.xtext.Keyword it, boolean supportActions)
-
_dataTypeEbnf2
protected java.lang.String _dataTypeEbnf2(org.eclipse.xtext.RuleCall it, boolean supportActions)
-
_ebnf2
protected java.lang.String _ebnf2(org.eclipse.xtext.AbstractElement it, AntlrOptions options, boolean supportActions)
-
_ebnf2
protected java.lang.String _ebnf2(org.eclipse.xtext.Alternatives it, AntlrOptions options, boolean supportActions)
-
_ebnf2
protected java.lang.String _ebnf2(org.eclipse.xtext.Group it, AntlrOptions options, boolean supportActions)
-
_ebnf2
protected java.lang.String _ebnf2(org.eclipse.xtext.UnorderedGroup it, AntlrOptions options, boolean supportActions)
-
_ebnf2
protected java.lang.String _ebnf2(org.eclipse.xtext.Assignment it, AntlrOptions options, boolean supportActions)
-
_ebnf2
protected java.lang.String _ebnf2(org.eclipse.xtext.Action it, AntlrOptions options, boolean supportActions)
-
ebnf
protected java.lang.String ebnf(org.eclipse.xtext.Keyword it)
-
_ebnf2
protected java.lang.String _ebnf2(org.eclipse.xtext.Keyword it, AntlrOptions options, boolean supportActions)
-
_ebnf2
protected java.lang.String _ebnf2(org.eclipse.xtext.RuleCall it, AntlrOptions options, boolean supportActions)
-
_ebnf2
protected java.lang.String _ebnf2(org.eclipse.xtext.EnumLiteralDeclaration it, AntlrOptions options, boolean supportActions)
-
_crossrefEbnf
protected java.lang.String _crossrefEbnf(org.eclipse.xtext.AbstractElement it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
-
_crossrefEbnf
protected java.lang.String _crossrefEbnf(org.eclipse.xtext.Alternatives it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
-
_crossrefEbnf
protected java.lang.String _crossrefEbnf(org.eclipse.xtext.RuleCall it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
-
_crossrefEbnf
protected java.lang.String _crossrefEbnf(org.eclipse.xtext.Keyword it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
-
crossrefEbnf
protected java.lang.String crossrefEbnf(org.eclipse.xtext.AbstractRule it, org.eclipse.xtext.RuleCall call, org.eclipse.xtext.CrossReference ref, boolean supportActions)
-
_assignmentEbnf
protected java.lang.String _assignmentEbnf(org.eclipse.xtext.Group it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
-
_assignmentEbnf
protected java.lang.String _assignmentEbnf(org.eclipse.xtext.Assignment it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
-
_assignmentEbnf
protected java.lang.String _assignmentEbnf(org.eclipse.xtext.Action it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
-
_assignmentEbnf
protected java.lang.String _assignmentEbnf(org.eclipse.xtext.Alternatives it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
-
_assignmentEbnf
protected java.lang.String _assignmentEbnf(org.eclipse.xtext.RuleCall it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
-
_assignmentEbnf
protected java.lang.String _assignmentEbnf(org.eclipse.xtext.CrossReference it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
-
_assignmentEbnf
protected java.lang.String _assignmentEbnf(org.eclipse.xtext.AbstractElement it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
-
_mustBeParenthesized
protected boolean _mustBeParenthesized(org.eclipse.xtext.AbstractElement it)
-
_mustBeParenthesized
protected boolean _mustBeParenthesized(org.eclipse.xtext.Group it)
-
_mustBeParenthesized
protected boolean _mustBeParenthesized(org.eclipse.xtext.Assignment it)
-
_mustBeParenthesized
protected boolean _mustBeParenthesized(org.eclipse.xtext.Alternatives it)
-
compileRule
protected java.lang.CharSequence compileRule(java.lang.Object it, org.eclipse.xtext.Grammar grammar, AntlrOptions options)
-
dataTypeEbnf2
protected java.lang.String dataTypeEbnf2(org.eclipse.xtext.AbstractElement it, boolean supportActions)
-
ebnf2
protected java.lang.String ebnf2(org.eclipse.xtext.AbstractElement it, AntlrOptions options, boolean supportActions)
-
crossrefEbnf
protected java.lang.String crossrefEbnf(org.eclipse.xtext.AbstractElement it, org.eclipse.xtext.CrossReference ref, boolean supportActions)
-
assignmentEbnf
protected java.lang.String assignmentEbnf(org.eclipse.xtext.AbstractElement it, org.eclipse.xtext.Assignment assignment, AntlrOptions options, boolean supportActions)
-
mustBeParenthesized
public boolean mustBeParenthesized(org.eclipse.xtext.AbstractElement it)
-
-