[xtext.xtext.generator] moved of a generated comment in 'AbstractAntlrGrammarGenerator'

should now be in line with the former template in 'ParameterizedLexerGrammar.xpt'

Signed-off-by: Christian Schneider <christian.schneider@typefox.io>
This commit is contained in:
Christian Schneider 2016-10-17 20:53:42 +02:00
parent 7bf4f2ee7b
commit 08db089455
2 changed files with 12 additions and 5 deletions

View file

@ -94,8 +94,6 @@ abstract class AbstractAntlrGrammarGenerator {
«compileTokens(options)»
«compileLexerHeader(options)»
«compileKeywordRules(options)»
// Rules duplicated to allow inter-rule references
«compileTerminalRules(options)»
'''
@ -231,6 +229,10 @@ abstract class AbstractAntlrGrammarGenerator {
}
protected def compileTerminalRules(Grammar it, AntlrOptions options) '''
«IF options.isBacktrackLexer»
// Rules duplicated to allow inter-rule references
«ENDIF»
«FOR rule:allTerminalRules»
«rule.compileRule(it, options)»

View file

@ -184,9 +184,6 @@ public abstract class AbstractAntlrGrammarGenerator {
CharSequence _compileKeywordRules = this.compileKeywordRules(it, options);
_builder.append(_compileKeywordRules, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("// Rules duplicated to allow inter-rule references");
_builder.newLine();
CharSequence _compileTerminalRules = this.compileTerminalRules(it, options);
_builder.append(_compileTerminalRules, "");
_builder.newLineIfNotEmpty();
@ -533,6 +530,14 @@ public abstract class AbstractAntlrGrammarGenerator {
protected CharSequence compileTerminalRules(final Grammar it, final AntlrOptions options) {
StringConcatenation _builder = new StringConcatenation();
{
boolean _isBacktrackLexer = options.isBacktrackLexer();
if (_isBacktrackLexer) {
_builder.newLine();
_builder.append("// Rules duplicated to allow inter-rule references");
_builder.newLine();
}
}
{
List<TerminalRule> _allTerminalRules = GrammarUtil.allTerminalRules(it);
for(final TerminalRule rule : _allTerminalRules) {