use of org.eclipse.xtext.AbstractElement in project xtext-core by eclipse.
the class AbstractAntlrGrammarGenerator method _ebnf2.
protected String _ebnf2(final Alternatives it, final AntlrOptions options, final boolean supportActions) {
StringConcatenation _builder = new StringConcatenation();
{
EList<AbstractElement> _elements = it.getElements();
boolean _hasElements = false;
for (final AbstractElement element : _elements) {
if (!_hasElements) {
_hasElements = true;
} else {
_builder.appendImmediate("\n |", "");
}
String _ebnf = this.ebnf(element, options, supportActions);
_builder.append(_ebnf);
}
}
_builder.newLineIfNotEmpty();
return _builder.toString();
}
use of org.eclipse.xtext.AbstractElement in project xtext-core by eclipse.
the class AbstractAntlrGrammarGenerator method _ebnf2.
protected String _ebnf2(final Group it, final AntlrOptions options, final boolean supportActions) {
StringConcatenation _builder = new StringConcatenation();
{
EList<AbstractElement> _elements = it.getElements();
for (final AbstractElement element : _elements) {
String _ebnf = this.ebnf(element, options, supportActions);
_builder.append(_ebnf);
}
}
_builder.newLineIfNotEmpty();
return _builder.toString();
}
use of org.eclipse.xtext.AbstractElement in project xtext-core by eclipse.
the class AbstractAntlrGrammarGenerator method _assignmentEbnf.
protected String _assignmentEbnf(final Alternatives it, final Assignment assignment, final AntlrOptions options, final boolean supportActions) {
StringConcatenation _builder = new StringConcatenation();
{
EList<AbstractElement> _elements = it.getElements();
boolean _hasElements = false;
for (final AbstractElement element : _elements) {
if (!_hasElements) {
_hasElements = true;
} else {
_builder.appendImmediate("\n |", "");
}
String _assignmentEbnf = this.assignmentEbnf(element, assignment, options, supportActions);
_builder.append(_assignmentEbnf);
}
}
_builder.newLineIfNotEmpty();
return _builder.toString();
}
use of org.eclipse.xtext.AbstractElement in project xtext-core by eclipse.
the class AbstractAntlrGrammarGenerator method dataTypeEbnfPredicate.
protected String dataTypeEbnfPredicate(final AbstractElement it) {
StringConcatenation _builder = new StringConcatenation();
{
if ((this._grammarAccessExtensions.predicated(it) || it.isFirstSetPredicated())) {
_builder.append("(");
{
boolean _predicated = this._grammarAccessExtensions.predicated(it);
if (_predicated) {
String _dataTypeEbnf2 = this.dataTypeEbnf2(this._grammarAccessExtensions.predicatedElement(it), false);
_builder.append(_dataTypeEbnf2);
} else {
{
List<AbstractElement> _firstSet = AntlrGrammarGenUtil.getFirstSet(it);
boolean _hasElements = false;
for (final AbstractElement e : _firstSet) {
if (!_hasElements) {
_hasElements = true;
} else {
_builder.appendImmediate(" | ", "");
}
String _dataTypeEbnf2_1 = this.dataTypeEbnf2(e, false);
_builder.append(_dataTypeEbnf2_1);
}
}
}
}
_builder.append(")=>");
}
}
_builder.newLineIfNotEmpty();
return _builder.toString();
}
use of org.eclipse.xtext.AbstractElement in project xtext-core by eclipse.
the class AbstractAntlrGrammarGenerator method _ebnf2.
protected String _ebnf2(final UnorderedGroup it, final AntlrOptions options, final boolean supportActions) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("(");
{
EList<AbstractElement> _elements = it.getElements();
boolean _hasElements = false;
for (final AbstractElement element : _elements) {
if (!_hasElements) {
_hasElements = true;
} else {
_builder.appendImmediate("\n |", "");
}
String _ebnf = this.ebnf(element, options, supportActions);
_builder.append(_ebnf);
}
}
_builder.append(")*");
_builder.newLineIfNotEmpty();
return _builder.toString();
}
Aggregations