use of org.eclipse.xtext.xtext.generator.parser.antlr.CombinedGrammarMarker in project xtext-core by eclipse.
the class XtextAntlrGeneratorFragment2 method doGenerate.
@Override
protected void doGenerate() {
Grammar _grammar = this.getGrammar();
boolean _isIgnoreCase = this.getOptions().isIgnoreCase();
new KeywordHelper(_grammar, _isIgnoreCase, this.grammarUtil);
boolean _isCombinedGrammar = this.isCombinedGrammar();
new CombinedGrammarMarker(_isCombinedGrammar).attachToEmfObject(this.getGrammar());
if (this.debugGrammar) {
this.generateDebugGrammar();
}
this.generateProductionGrammar();
IXtextGeneratorFileSystemAccess _srcGen = this.getProjectConfig().getGenericIde().getSrcGen();
boolean _tripleNotEquals = (_srcGen != null);
if (_tripleNotEquals) {
this.generateContentAssistGrammar();
this.addIdeBindingsAndImports();
}
this.generateProductionParser().writeTo(this.getProjectConfig().getRuntime().getSrcGen());
this.generateAntlrTokenFileProvider().writeTo(this.getProjectConfig().getRuntime().getSrcGen());
this.generateContentAssistParser().writeTo(this.getProjectConfig().getGenericIde().getSrcGen());
boolean _hasSyntheticTerminalRule = this.hasSyntheticTerminalRule();
if (_hasSyntheticTerminalRule) {
this.generateProductionTokenSource().writeTo(this.getProjectConfig().getRuntime().getSrc());
this.generateContentAssistTokenSource().writeTo(this.getProjectConfig().getGenericIde().getSrc());
}
this.addRuntimeBindingsAndImports();
this.addIdeBindingsAndImports();
this.addUiBindingsAndImports();
}
use of org.eclipse.xtext.xtext.generator.parser.antlr.CombinedGrammarMarker in project xtext-core by eclipse.
the class AbstractAntlrGrammarGenerator method generate.
public void generate(final Grammar it, final AntlrOptions options, final IXtextGeneratorFileSystemAccess fsa) {
this.keywordHelper = KeywordHelper.getHelper(it);
this.originalGrammar = it;
final RuleFilter filter = new RuleFilter();
filter.setDiscardUnreachableRules(options.isSkipUnusedRules());
final RuleNames ruleNames = RuleNames.getRuleNames(it, true);
final Grammar flattened = new FlattenedGrammarAccess(ruleNames, filter).getFlattenedGrammar();
boolean _isCombinedGrammar = this.isCombinedGrammar();
new CombinedGrammarMarker(_isCombinedGrammar).attachToEmfObject(flattened);
fsa.generateFile(this.getGrammarNaming().getParserGrammar(it).getGrammarFileName(), this.compileParser(flattened, options));
boolean _isCombinedGrammar_1 = this.isCombinedGrammar();
boolean _not = (!_isCombinedGrammar_1);
if (_not) {
fsa.generateFile(this.getGrammarNaming().getLexerGrammar(it).getGrammarFileName(), this.compileLexer(flattened, options));
}
}
Aggregations