コード例 #1
0
 protected CharSequence _generateDeserializationStatementForType(
     final ResponseBlock response, final IntrinsicType type) {
   StringConcatenation _builder = new StringConcatenation();
   this.imports.addImport("com.robotoworks.mechanoid.util.Streams");
   _builder.newLineIfNotEmpty();
   CharSequence _generateDeserializationStatementHeader =
       this.generateDeserializationStatementHeader(false);
   _builder.append(_generateDeserializationStatementHeader, "");
   _builder.newLineIfNotEmpty();
   _builder.append("\t\t");
   _builder.append("String source = Streams.readAllText(inStream);");
   _builder.newLine();
   _builder.append("\t\t");
   _builder.newLine();
   _builder.append("\t\t");
   _builder.append("this.value = ");
   String _boxedTypeSignature = ModelExtensions.getBoxedTypeSignature(type);
   _builder.append(_boxedTypeSignature, "\t\t");
   _builder.append(".valueOf(source);");
   _builder.newLineIfNotEmpty();
   CharSequence _generateDeserializationStatementFooter =
       this.generateDeserializationStatementFooter(false);
   _builder.append(_generateDeserializationStatementFooter, "");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #2
0
 protected CharSequence compileEntryInit(final ParserRule it, final AntlrOptions options) {
   StringConcatenation _builder = new StringConcatenation();
   {
     boolean _or = false;
     boolean _isDefinesHiddenTokens = it.isDefinesHiddenTokens();
     if (_isDefinesHiddenTokens) {
       _or = true;
     } else {
       boolean _definesUnorderedGroups =
           this._grammarAccessExtensions.definesUnorderedGroups(it, options);
       _or = _definesUnorderedGroups;
     }
     if (_or) {
       _builder.append("@init {");
       _builder.newLine();
       _builder.append("\t");
       CharSequence _compileInitHiddenTokens = this.compileInitHiddenTokens(it, options);
       _builder.append(_compileInitHiddenTokens, "\t");
       _builder.newLineIfNotEmpty();
       _builder.append("\t");
       CharSequence _compileInitUnorderedGroups = this.compileInitUnorderedGroups(it, options);
       _builder.append(_compileInitUnorderedGroups, "\t");
       _builder.newLineIfNotEmpty();
       _builder.append("}");
     }
   }
   return _builder;
 }
コード例 #3
0
 public CharSequence doGenerate(final HttpMethod method, final Model model, final Client client) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("package ");
   String _packageName = model.getPackageName();
   _builder.append(_packageName, "");
   _builder.append(";");
   _builder.newLineIfNotEmpty();
   _builder.newLine();
   CharSequence classDecl = this.generateResponseClass(method, model, client);
   _builder.newLineIfNotEmpty();
   _builder.newLine();
   _builder.append("import com.robotoworks.mechanoid.net.JsonEntityReaderProvider;");
   _builder.newLine();
   _builder.append("import java.io.IOException;");
   _builder.newLine();
   _builder.append("import com.robotoworks.mechanoid.net.ServiceResult;");
   _builder.newLine();
   _builder.append("import java.io.InputStream;");
   _builder.newLine();
   _builder.append("import com.robotoworks.mechanoid.util.Closeables;");
   _builder.newLine();
   StringConcatenation _printAndClear = this.imports.printAndClear();
   _builder.append(_printAndClear, "");
   _builder.newLineIfNotEmpty();
   _builder.newLine();
   _builder.append(classDecl, "");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #4
0
 protected CharSequence _generateDeserializationStatementForUserType(
     final ResponseBlock response, final UserType type, final EnumTypeDeclaration declaration) {
   StringConcatenation _builder = new StringConcatenation();
   this.imports.addImport("com.robotoworks.mechanoid.util.Streams");
   _builder.newLineIfNotEmpty();
   CharSequence _generateDeserializationStatementHeader =
       this.generateDeserializationStatementHeader(false);
   _builder.append(_generateDeserializationStatementHeader, "");
   _builder.newLineIfNotEmpty();
   _builder.append("\t\t");
   _builder.append("String source = Streams.readAllText(inStream);");
   _builder.newLine();
   _builder.append("\t\t");
   _builder.append("this.");
   String _signature = ModelExtensions.signature(type);
   String _camelize = Strings.camelize(_signature);
   _builder.append(_camelize, "\t\t");
   _builder.append(" = ");
   String _signature_1 = ModelExtensions.signature(type);
   _builder.append(_signature_1, "\t\t");
   _builder.append(".fromValue(source);");
   _builder.newLineIfNotEmpty();
   CharSequence _generateDeserializationStatementFooter =
       this.generateDeserializationStatementFooter(false);
   _builder.append(_generateDeserializationStatementFooter, "");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #5
0
 public CharSequence generateStub(final Model model, final SqliteDatabaseSnapshot snapshot) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("/*");
   _builder.newLine();
   _builder.append(" ");
   _builder.append("* Generated by Robotoworks Mechanoid");
   _builder.newLine();
   _builder.append(" ");
   _builder.append("*/");
   _builder.newLine();
   _builder.append("package ");
   String _packageName = model.getPackageName();
   _builder.append(_packageName, "");
   _builder.append(";");
   _builder.newLineIfNotEmpty();
   _builder.newLine();
   _builder.append("import android.content.Context;");
   _builder.newLine();
   _builder.append("import ");
   String _packageName_1 = model.getPackageName();
   _builder.append(_packageName_1, "");
   _builder.append(".Abstract");
   DatabaseBlock _database = model.getDatabase();
   String _name = _database.getName();
   String _pascalize = Strings.pascalize(_name);
   _builder.append(_pascalize, "");
   _builder.append("OpenHelper;");
   _builder.newLineIfNotEmpty();
   _builder.newLine();
   _builder.newLine();
   _builder.append("public class ");
   DatabaseBlock _database_1 = model.getDatabase();
   String _name_1 = _database_1.getName();
   String _pascalize_1 = Strings.pascalize(_name_1);
   _builder.append(_pascalize_1, "");
   _builder.append("OpenHelper extends Abstract");
   DatabaseBlock _database_2 = model.getDatabase();
   String _name_2 = _database_2.getName();
   String _pascalize_2 = Strings.pascalize(_name_2);
   _builder.append(_pascalize_2, "");
   _builder.append("OpenHelper {");
   _builder.newLineIfNotEmpty();
   _builder.append("\t");
   _builder.append("public ");
   DatabaseBlock _database_3 = model.getDatabase();
   String _name_3 = _database_3.getName();
   String _pascalize_3 = Strings.pascalize(_name_3);
   _builder.append(_pascalize_3, "\t");
   _builder.append("OpenHelper(Context context) {");
   _builder.newLineIfNotEmpty();
   _builder.append("\t\t");
   _builder.append("super(context);");
   _builder.newLine();
   _builder.append("\t");
   _builder.append("}");
   _builder.newLine();
   _builder.append("}");
   _builder.newLine();
   return _builder;
 }
コード例 #6
0
 protected CharSequence _generateFieldForType(final GenericListType type) {
   StringConcatenation _builder = new StringConcatenation();
   {
     Type _elementType = type.getElementType();
     if ((_elementType instanceof IntrinsicType)) {
       _builder.append("private ");
       String _signature = ModelExtensions.signature(type);
       _builder.append(_signature, "");
       _builder.append(" values;");
       _builder.newLineIfNotEmpty();
     } else {
       _builder.append("private ");
       String _signature_1 = ModelExtensions.signature(type);
       _builder.append(_signature_1, "");
       _builder.append(" ");
       String _innerSignature = ModelExtensions.innerSignature(type);
       String _camelize = Strings.camelize(_innerSignature);
       String _pluralize = Strings.pluralize(_camelize);
       _builder.append(_pluralize, "");
       _builder.append(";");
       _builder.newLineIfNotEmpty();
     }
   }
   return _builder;
 }
コード例 #7
0
 public CharSequence generateDeserializationStatementHeader(final boolean withReader) {
   StringConcatenation _builder = new StringConcatenation();
   {
     if (withReader) {
       this.imports.addImport("com.robotoworks.mechanoid.internal.util.JsonReader");
       _builder.newLineIfNotEmpty();
       this.imports.addImport("java.io.InputStreamReader");
       _builder.newLineIfNotEmpty();
       this.imports.addImport("java.io.BufferedReader");
       _builder.newLineIfNotEmpty();
       this.imports.addImport("java.nio.charset.Charset");
       _builder.newLineIfNotEmpty();
       _builder.append("\t");
       _builder.append("JsonReader reader = null;");
       _builder.newLine();
     }
   }
   _builder.append("\t");
   _builder.append("try {");
   _builder.newLine();
   _builder.append("\t\t");
   _builder.append("if(inStream != null) {");
   _builder.newLine();
   {
     if (withReader) {
       _builder.append("\t\t\t");
       _builder.append(
           "reader = new JsonReader(new BufferedReader(new InputStreamReader(inStream, Charset.defaultCharset())));");
       _builder.newLine();
     }
   }
   return _builder;
 }
コード例 #8
0
 protected CharSequence _generateDeserializationStatementForUserType(
     final ResponseBlock response, final UserType type, final ComplexTypeDeclaration declaration) {
   StringConcatenation _builder = new StringConcatenation();
   CharSequence _generateDeserializationStatementHeader =
       this.generateDeserializationStatementHeader(true);
   _builder.append(_generateDeserializationStatementHeader, "");
   _builder.newLineIfNotEmpty();
   _builder.append("\t\t");
   _builder.append("this.");
   String _signature = ModelExtensions.signature(type);
   String _camelize = Strings.camelize(_signature);
   _builder.append(_camelize, "\t\t");
   _builder.append(" = new ");
   String _signature_1 = ModelExtensions.signature(type);
   _builder.append(_signature_1, "\t\t");
   _builder.append("();");
   _builder.newLineIfNotEmpty();
   _builder.append("\t\t");
   _builder.append("provider.get(");
   String _signature_2 = ModelExtensions.signature(type);
   _builder.append(_signature_2, "\t\t");
   _builder.append(".class).read(reader, this.");
   String _signature_3 = ModelExtensions.signature(type);
   String _camelize_1 = Strings.camelize(_signature_3);
   _builder.append(_camelize_1, "\t\t");
   _builder.append(");");
   _builder.newLineIfNotEmpty();
   CharSequence _generateDeserializationStatementFooter =
       this.generateDeserializationStatementFooter(true);
   _builder.append(_generateDeserializationStatementFooter, "");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #9
0
 protected CharSequence pre(final EObject eObject, final String lang) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("<pre class=\"prettyprint ");
   _builder.append(lang, "");
   _builder.append(" linenums\">");
   _builder.newLineIfNotEmpty();
   String _serialize = this.serialize(eObject);
   String _codeToHtml = this.codeToHtml(_serialize);
   _builder.append(_codeToHtml, "");
   _builder.newLineIfNotEmpty();
   _builder.append("</pre>");
   _builder.newLine();
   return _builder;
 }
コード例 #10
0
ファイル: LineModel.java プロジェクト: NiciaB/xtext
 public String toString() {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("rootIndentLenght=");
   int _rootIndentLenght = this.getRootIndentLenght();
   _builder.append(_rootIndentLenght, "");
   _builder.newLineIfNotEmpty();
   String _leadingText = this.getLeadingText();
   _builder.append(_leadingText, "");
   List<Line> _lines = this.getLines();
   String _join = IterableExtensions.join(_lines);
   _builder.append(_join, "");
   _builder.newLineIfNotEmpty();
   return _builder.toString();
 }
 public static CharSequence test4() {
   CharSequence _xblockexpression = null;
   {
     final String className = CodeBuilder.classname();
     StringConcatenation _builder = new StringConcatenation();
     _builder.append("public ");
     _builder.append(className, "");
     _builder.append("(Browser browser, ToolBar toolbar){");
     _builder.newLineIfNotEmpty();
     _builder.append("\t");
     _builder.append("ToolItem itemBack = new ToolItem(toolbar, SWT.PUSH);");
     _builder.newLine();
     _builder.append("\t");
     _builder.append("itemBack.setText(\"Back\");");
     _builder.newLine();
     _builder.append("\t");
     _builder.append("ToolItem itemForward = new ToolItem(toolbar, SWT.PUSH);");
     _builder.newLine();
     _builder.append("\t");
     _builder.append("itemForward.setText(\"Forward\");");
     _builder.newLine();
     _builder.newLine();
     _builder.append("\t");
     _builder.append("itemBack.setEnabled(browser.isBackEnabled());");
     _builder.newLine();
     _builder.append("\t");
     _builder.append("itemForward.setEnabled(browser.isForwardEnabled());");
     _builder.newLine();
     _builder.append("}");
     _builder.newLine();
     CharSequence _classbody = CodeBuilder.classbody(className, _builder);
     _xblockexpression = (_classbody);
   }
   return _xblockexpression;
 }
コード例 #12
0
 protected CharSequence _generateGetter(final SkipMember member) {
   StringConcatenation _builder = new StringConcatenation();
   ComplexTypeLiteral _literal = member.getLiteral();
   Object _generateGetterForType = this.generateGetterForType(_literal);
   _builder.append(_generateGetterForType, "");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #13
0
 protected CharSequence _generateGetterForType(final ComplexTypeLiteral type) {
   StringConcatenation _builder = new StringConcatenation();
   EList<Member> _members = type.getMembers();
   CharSequence _generateGettersForMemberList = this.generateGettersForMemberList(_members);
   _builder.append(_generateGettersForMemberList, "");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #14
0
 /** override */
 public String subroutineTemplate() {
   StringConcatenation _builder = new StringConcatenation();
   _builder.newLine();
   _builder.append("subroutine ");
   _builder.append(this.subroutineName, "");
   _builder.append("(");
   _builder.append(this.paramGridComp, "");
   _builder.append(", ");
   _builder.append(this.paramImport, "");
   _builder.append(", ");
   _builder.append(this.paramExport, "");
   _builder.append(", ");
   _builder.append(this.paramClock, "");
   _builder.append(", ");
   _builder.append(this.paramRC, "");
   _builder.append(")");
   _builder.newLineIfNotEmpty();
   _builder.append("    ");
   _builder.append("type(ESMF_GridComp)  :: ");
   _builder.append(this.paramGridComp, "    ");
   _builder.newLineIfNotEmpty();
   _builder.append("    ");
   _builder.append("type(ESMF_State)     :: ");
   _builder.append(this.paramImport, "    ");
   _builder.append(", ");
   _builder.append(this.paramExport, "    ");
   _builder.newLineIfNotEmpty();
   _builder.append("    ");
   _builder.append("type(ESMF_Clock)     :: ");
   _builder.append(this.paramClock, "    ");
   _builder.newLineIfNotEmpty();
   _builder.append("    ");
   _builder.append("integer, intent(out) :: ");
   _builder.append(this.paramRC, "    ");
   _builder.newLineIfNotEmpty();
   _builder.append("    ");
   _builder.newLine();
   _builder.append("    ");
   _builder.append("rc = ESMF_SUCCESS");
   _builder.newLine();
   _builder.append("    ");
   _builder.newLine();
   _builder.append("end subroutine");
   _builder.newLine();
   return _builder.toString();
 }
コード例 #15
0
 protected CharSequence _generateBaseAccessor(final TypedMember member) {
   StringConcatenation _builder = new StringConcatenation();
   {
     Type _type = member.getType();
     if ((_type instanceof GenericListType)) {
       this.imports.addImport("java.util.List");
     }
   }
   _builder.newLineIfNotEmpty();
   _builder.append("public ");
   Type _type_1 = member.getType();
   String _signature = ModelExtensions.signature(_type_1);
   _builder.append(_signature, "");
   _builder.append(" ");
   String _getMethodName = ModelExtensions.toGetMethodName(member);
   _builder.append(_getMethodName, "");
   _builder.append("(){");
   _builder.newLineIfNotEmpty();
   _builder.append("\t");
   _builder.append("return base.");
   String _getMethodName_1 = ModelExtensions.toGetMethodName(member);
   _builder.append(_getMethodName_1, "\t");
   _builder.append("();");
   _builder.newLineIfNotEmpty();
   _builder.append("}");
   _builder.newLine();
   _builder.append("public void ");
   String _setMethodName = ModelExtensions.toSetMethodName(member);
   _builder.append(_setMethodName, "");
   _builder.append("(");
   Type _type_2 = member.getType();
   String _signature_1 = ModelExtensions.signature(_type_2);
   _builder.append(_signature_1, "");
   _builder.append(" value){");
   _builder.newLineIfNotEmpty();
   _builder.append("\t");
   _builder.append("base.");
   String _setMethodName_1 = ModelExtensions.toSetMethodName(member);
   _builder.append(_setMethodName_1, "\t");
   _builder.append("(value);");
   _builder.newLineIfNotEmpty();
   _builder.append("}");
   _builder.newLine();
   return _builder;
 }
コード例 #16
0
 protected CharSequence _generateBaseAccessor(final SkipMember member) {
   StringConcatenation _builder = new StringConcatenation();
   ComplexTypeLiteral _literal = member.getLiteral();
   EList<Member> _members = _literal.getMembers();
   Object _generateBaseAccessors = this.generateBaseAccessors(_members);
   _builder.append(_generateBaseAccessors, "");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #17
0
 protected CharSequence _generateFieldForType(final IntrinsicType type) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("private ");
   String _signature = ModelExtensions.signature(type);
   _builder.append(_signature, "");
   _builder.append(" value;\t");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #18
0
ファイル: HtmlExtensions.java プロジェクト: dschulten/xtext
 protected CharSequence _toHtml(final Anchor it) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("<a name=\"");
   String _name = it.getName();
   String _quote = this.quote(_name);
   _builder.append(_quote, "");
   _builder.append("\"/>\t");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #19
0
ファイル: HtmlExtensions.java プロジェクト: dschulten/xtext
 protected CharSequence _toHtml(final TableData it) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("<td>");
   EList<TextOrMarkup> _contents = it.getContents();
   CharSequence _html = this.toHtml(_contents);
   _builder.append(_html, "");
   _builder.append("</td>");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #20
0
ファイル: HtmlExtensions.java プロジェクト: dschulten/xtext
 protected CharSequence _toHtml(final TableRow it) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("<tr>");
   EList<TableData> _data = it.getData();
   CharSequence _html = this.toHtml(_data);
   _builder.append(_html, "");
   _builder.append("</tr>");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #21
0
 public CharSequence generateFieldsForMemberList(final EList<Member> members) {
   StringConcatenation _builder = new StringConcatenation();
   {
     for (final Member member : members) {
       CharSequence _generateFieldForMember = this.generateFieldForMember(member);
       _builder.append(_generateFieldForMember, "");
       _builder.newLineIfNotEmpty();
     }
   }
   return _builder;
 }
コード例 #22
0
 public CharSequence generateBaseAccessors(final Iterable<Member> members) {
   StringConcatenation _builder = new StringConcatenation();
   {
     for (final Member member : members) {
       CharSequence _generateBaseAccessor = this.generateBaseAccessor(member);
       _builder.append(_generateBaseAccessor, "");
       _builder.newLineIfNotEmpty();
     }
   }
   return _builder;
 }
コード例 #23
0
 public String createProposalValue(final MobaIndex index, final MobaIndexEntry entry) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("index://");
   String _id = index.getId();
   _builder.append(_id, "");
   _builder.append(":");
   String _templateId = entry.getTemplateId();
   _builder.append(_templateId, "");
   _builder.newLineIfNotEmpty();
   return _builder.toString();
 }
コード例 #24
0
ファイル: HtmlExtensions.java プロジェクト: dschulten/xtext
 public CharSequence toHtmlParagraph(final List<? extends EObject> it) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("<p>");
   _builder.newLine();
   CharSequence _internalToHtmlParagraph = this.internalToHtmlParagraph(it);
   _builder.append(_internalToHtmlParagraph, "");
   _builder.newLineIfNotEmpty();
   _builder.append("</p>");
   _builder.newLine();
   return _builder;
 }
コード例 #25
0
 public CharSequence subClassDispatcherRule(final EClass it) {
   StringConcatenation _builder = new StringConcatenation();
   {
     boolean _needsDispatcherRule = Ecore2XtextExtensions.needsDispatcherRule(it);
     if (_needsDispatcherRule) {
       String _uniqueName = UniqueNameUtil.uniqueName(it);
       _builder.append(_uniqueName, "");
       _builder.append(" returns ");
       String _fqn = Ecore2XtextExtensions.fqn(it);
       _builder.append(_fqn, "");
       _builder.append(":");
       _builder.newLineIfNotEmpty();
       _builder.append("\t");
       String _subClassAlternatives = this.subClassAlternatives(it);
       _builder.append(_subClassAlternatives, "\t");
       _builder.append(";");
       _builder.newLineIfNotEmpty();
     }
   }
   return _builder;
 }
コード例 #26
0
 protected CharSequence _generateFieldForType(final ComplexTypeLiteral type) {
   StringConcatenation _builder = new StringConcatenation();
   {
     EList<Member> _members = type.getMembers();
     for (final Member member : _members) {
       CharSequence _generateFieldForMember = this.generateFieldForMember(member);
       _builder.append(_generateFieldForMember, "");
       _builder.newLineIfNotEmpty();
     }
   }
   return _builder;
 }
コード例 #27
0
 protected CharSequence _generateGetterForType(final GenericListType type) {
   StringConcatenation _builder = new StringConcatenation();
   {
     Type _elementType = type.getElementType();
     if ((_elementType instanceof IntrinsicType)) {
       _builder.append("public ");
       String _signature = ModelExtensions.signature(type);
       _builder.append(_signature, "");
       _builder.append(" getValues(){");
       _builder.newLineIfNotEmpty();
       _builder.append("\t");
       _builder.append("return this.values;");
       _builder.newLine();
       _builder.append("}");
       _builder.newLine();
     } else {
       _builder.append("public ");
       String _signature_1 = ModelExtensions.signature(type);
       _builder.append(_signature_1, "");
       _builder.append(" get");
       String _innerSignature = ModelExtensions.innerSignature(type);
       String _pascalize = Strings.pascalize(_innerSignature);
       String _pluralize = Strings.pluralize(_pascalize);
       _builder.append(_pluralize, "");
       _builder.append("(){");
       _builder.newLineIfNotEmpty();
       _builder.append("\t");
       _builder.append("return this.");
       String _innerSignature_1 = ModelExtensions.innerSignature(type);
       String _camelize = Strings.camelize(_innerSignature_1);
       String _pluralize_1 = Strings.pluralize(_camelize);
       _builder.append(_pluralize_1, "\t");
       _builder.append(";");
       _builder.newLineIfNotEmpty();
       _builder.append("}");
       _builder.newLine();
     }
   }
   return _builder;
 }
コード例 #28
0
 public CharSequence genGetUnassignedRuleCallTokens(final JavaFile file) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("@Override");
   _builder.newLine();
   _builder.append(
       "protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {");
   _builder.newLine();
   _builder.append("\t");
   int i = 0;
   _builder.newLineIfNotEmpty();
   {
     List<AbstractRule> _unassignedCalledTokenRules = this.unassignedCalledTokenRules();
     for (final AbstractRule rule : _unassignedCalledTokenRules) {
       _builder.append("\t");
       {
         if (((i = (i + 1)) > 1)) {
           _builder.append("else ");
         }
       }
       _builder.append("if(ruleCall.getRule() == grammarAccess.");
       String _gaAccessor = this.grammarAccess.gaAccessor(rule);
       _builder.append(_gaAccessor, "\t");
       _builder.append(")");
       _builder.newLineIfNotEmpty();
       _builder.append("\t");
       _builder.append("\t");
       _builder.append("return ");
       CharSequence _unassignedCalledTokenRuleName = this.unassignedCalledTokenRuleName(rule);
       _builder.append(_unassignedCalledTokenRuleName, "\t\t");
       _builder.append("(semanticObject, ruleCall, node);");
       _builder.newLineIfNotEmpty();
     }
   }
   _builder.append("\t");
   _builder.append("return \"\";");
   _builder.newLine();
   _builder.append("}");
   _builder.newLine();
   return _builder;
 }
コード例 #29
0
 protected CharSequence _generateFieldForMember(final TypedMember member) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("private ");
   Type _type = member.getType();
   String _signature = ModelExtensions.signature(_type);
   _builder.append(_signature, "");
   _builder.append(" ");
   String _identifier = ModelExtensions.toIdentifier(member);
   _builder.append(_identifier, "");
   _builder.append(";");
   _builder.newLineIfNotEmpty();
   return _builder;
 }
コード例 #30
0
 protected CharSequence _generateGetter(final TypedMember member) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("public ");
   Type _type = member.getType();
   String _signature = ModelExtensions.signature(_type);
   _builder.append(_signature, "");
   _builder.append(" ");
   String _getMethodName = ModelExtensions.toGetMethodName(member);
   _builder.append(_getMethodName, "");
   _builder.append("(){");
   _builder.newLineIfNotEmpty();
   _builder.append("\t");
   _builder.append("return this.");
   String _identifier = ModelExtensions.toIdentifier(member);
   _builder.append(_identifier, "\t");
   _builder.append(";");
   _builder.newLineIfNotEmpty();
   _builder.append("}");
   _builder.newLine();
   _builder.append("public void ");
   String _setMethodName = ModelExtensions.toSetMethodName(member);
   _builder.append(_setMethodName, "");
   _builder.append("(");
   Type _type_1 = member.getType();
   String _signature_1 = ModelExtensions.signature(_type_1);
   _builder.append(_signature_1, "");
   _builder.append(" value){");
   _builder.newLineIfNotEmpty();
   _builder.append("\t");
   _builder.append("this.");
   String _identifier_1 = ModelExtensions.toIdentifier(member);
   _builder.append(_identifier_1, "\t");
   _builder.append(" = value;");
   _builder.newLineIfNotEmpty();
   _builder.append("}");
   _builder.newLine();
   return _builder;
 }