@Override public void closeScope() { this.delegate.closeScope(); }
protected ITreeAppendable _generateMember(final JvmDeclaredType it, final ITreeAppendable appendable, final GeneratorConfig config) { ITreeAppendable _xblockexpression = null; { appendable.newLine(); appendable.openScope(); this.assignThisAndSuper(appendable, it, config); ITreeAppendable _xtrycatchfinallyexpression = null; try { _xtrycatchfinallyexpression = this.generateBody(it, appendable, config); } finally { appendable.closeScope(); } _xblockexpression = _xtrycatchfinallyexpression; } return _xblockexpression; }
protected void compileAnonymousClassBody(AnonymousClass anonymousClass, JvmDeclaredType type, ITreeAppendable b) { ITreeAppendable appendable = b.trace(anonymousClass, true); appendable.append(" "); appendable.openScope(); GeneratorConfig config = generatorConfigProvider.get(anonymousClass); jvmModelGenerator.assignThisAndSuper(appendable, type, config); jvmModelGenerator.generateMembersInBody(type, appendable, config); appendable.closeScope(); }
protected ITreeAppendable appendCloseIfStatement(XCasePart casePart, ITreeAppendable caseAppendable, XSwitchExpressionCompilationState state) { // close surrounding if statements if (state.caseNeedsIfNotMatchedCheck()) { if (casePart.getCase() != null) { caseAppendable.decreaseIndentation().newLine().append("}"); } if (casePart.getTypeGuard() != null) { caseAppendable.decreaseIndentation().newLine().append("}"); caseAppendable.closeScope(); } } else if (casePart.getCase() != null && casePart.getTypeGuard() != null) { caseAppendable.decreaseIndentation().newLine().append("}"); caseAppendable.closeScope(); } else if (casePart.getTypeGuard() != null) { caseAppendable.closeScope(); } state.finishProcessingCase(); return caseAppendable; }
b.closeScope(); b.decreaseIndentation().newLine().append("}");
closeBlock(b); } finally { b.closeScope();
public ITreeAppendable generateMembersInBody(final JvmDeclaredType it, final ITreeAppendable appendable, final GeneratorConfig config) { ITreeAppendable _xblockexpression = null; { appendable.append("{").increaseIndentation(); final Procedure1<LoopParams> _function = (LoopParams it_1) -> { final Function1<ITreeAppendable, ITreeAppendable> _function_1 = (ITreeAppendable it_2) -> { return it_2.newLine(); }; it_1.setSeparator(_function_1); }; final Procedure1<JvmMember> _function_1 = (JvmMember it_1) -> { final ITreeAppendable memberAppendable = this._treeAppendableUtil.traceWithComments(appendable, it_1); memberAppendable.openScope(); this.generateMember(it_1, memberAppendable, config); memberAppendable.closeScope(); }; this._loopExtensions.<JvmMember>forEach(appendable, this.getMembersToBeCompiled(it), _function, _function_1); _xblockexpression = appendable.decreaseIndentation().newLine().append("}"); } return _xblockexpression; }
closeBlock(b); } finally { b.closeScope();
loopAppendable.closeScope();
public void generateAnnotationMethod(final JvmOperation it, final ITreeAppendable appendable, final GeneratorConfig config) { appendable.increaseIndentation().newLine(); appendable.openScope(); this.generateJavaDoc(it, appendable, config); final ITreeAppendable tracedAppendable = appendable.trace(it); this.generateAnnotations(it.getAnnotations(), tracedAppendable, true, config); this.generateModifier(it, tracedAppendable, config); this._errorSafeExtensions.serializeSafely(it.getReturnType(), "Object", tracedAppendable); tracedAppendable.append(" "); this._treeAppendableUtil.traceSignificant(tracedAppendable, it).append(this.makeJavaIdentifier(it.getSimpleName())); tracedAppendable.append("()"); this.generateDefaultExpression(it, tracedAppendable, config); tracedAppendable.append(";"); appendable.decreaseIndentation(); appendable.closeScope(); }
protected ITreeAppendable _generateMember(final JvmConstructor it, final ITreeAppendable appendable, final GeneratorConfig config) { ITreeAppendable _xblockexpression = null; { appendable.newLine(); appendable.openScope(); this.generateJavaDoc(it, appendable, config); final ITreeAppendable tracedAppendable = appendable.trace(it); this.generateAnnotations(it.getAnnotations(), tracedAppendable, true, config); this.generateModifier(it, tracedAppendable, config); this.generateTypeParameterDeclaration(it, tracedAppendable, config); this._treeAppendableUtil.traceSignificant(tracedAppendable, it).append(this.makeJavaIdentifier(it.getSimpleName())); tracedAppendable.append("("); this.generateParameters(it, tracedAppendable, config); tracedAppendable.append(")"); this.generateThrowsClause(it, tracedAppendable, config); tracedAppendable.append(" "); this.generateExecutableBody(it, tracedAppendable, config); appendable.closeScope(); _xblockexpression = appendable; } return _xblockexpression; }
loopAppendable.closeScope(); loopAppendable.decreaseIndentation().newLine().append("}"); loopAppendable.closeScope(); loopAppendable.decreaseIndentation().newLine().append("}");
generateExecutableBody(it, tracedAppendable, config); appendable.closeScope(); return appendable;
protected void _toJavaStatement(final XSynchronizedExpression synchronizedExpression, final ITreeAppendable b, boolean isReferenced) { if (isReferenced) { declareSyntheticVariable(synchronizedExpression, b); } ITreeAppendable synchronizedAppendable = b.trace(synchronizedExpression, true); XExpression param = synchronizedExpression.getParam(); if (!canCompileToJavaExpression(param, b)) internalToJavaStatement(param, synchronizedAppendable, isReferenced); synchronizedAppendable.newLine().append("synchronized ("); internalToJavaExpression(param, synchronizedAppendable); synchronizedAppendable.append(") {").increaseIndentation(); synchronizedAppendable.openPseudoScope(); XExpression expression = synchronizedExpression.getExpression(); internalToJavaStatement(expression, b, isReferenced); if (isReferenced) { b.newLine().append(getVarName(synchronizedExpression, synchronizedAppendable)).append(" = "); internalToConvertedExpression(expression, b, getLightweightType(synchronizedExpression)); b.append(";"); } synchronizedAppendable.closeScope(); synchronizedAppendable.decreaseIndentation().newLine().append("}"); }
RichStringPrepareCompiler compiler = new RichStringPrepareCompiler(b, variableName, richString); richStringProcessor.process(richString, compiler, indentationHandler.get()); b.closeScope(); b.decreaseIndentation().newLine().append("}").decreaseIndentation().newLine().append("};"); } else {
this.generateExecutableBody(it, tracedAppendable, config); appendable.closeScope(); _xblockexpression = appendable;
b.append(";"); b.closeScope(); b.decreaseIndentation().newLine().append("}");
defaultAppendable.openPseudoScope(); executeThenPart(expr, switchResultName, expr.getDefault(), defaultAppendable, isReferenced); defaultAppendable.closeScope();