@Override public void openScope() { this.delegate.openScope(); }
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(); }
/** Generate a static constructor from the given Jvm constructor. * * @param it the container of the code. * @param appendable the output. * @param config the generation configuration. * @return the appendable. */ protected ITreeAppendable generateStaticConstructor(JvmOperation it, ITreeAppendable appendable, GeneratorConfig config) { appendable.newLine(); appendable.openScope(); generateJavaDoc(it, appendable, config); final ITreeAppendable tracedAppendable = appendable.trace(it); tracedAppendable.append("static "); //$NON-NLS-1$ generateExecutableBody(it, tracedAppendable, config); return appendable; }
b.increaseIndentation(); try { b.openScope(); String selfVariable = null; if (needSyntheticSelfVariable(closure, type)) {
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; }
appendable.increaseIndentation(); try { appendable.openScope(); reassignThisInClosure(appendable, operation.getDeclaringType()); if (!(operation.getReturnType().getType() instanceof JvmVoid))
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; }
String selfVariable = null; try { appendable.openScope(); if (needSyntheticSelfVariable(closure, type)) { appendable.newLine().append("final "); //$NON-NLS-1$
appendable.openScope(); generateJavaDoc(it, appendable, config); final ITreeAppendable tracedAppendable = appendable.trace(it);
appendable.openScope(); try { reassignThisInClosure(appendable, findKnownTopLevelType(Object.class, assertExpression));
closure.getExpression(), closureParams, true, appendable); try { appendable.openScope();
final Procedure1<JvmField> _function_2 = (JvmField it_1) -> { final ITreeAppendable memberAppendable = this._treeAppendableUtil.traceWithComments(appendable, it_1); memberAppendable.openScope(); appendable.newLine(); final ITreeAppendable tracedAppendable = appendable.trace(it_1); final Procedure1<JvmMember> _function_4 = (JvmMember it_1) -> { final ITreeAppendable memberAppendable = this._treeAppendableUtil.traceWithComments(appendable, it_1); memberAppendable.openScope(); this.generateMember(it_1, memberAppendable, config); memberAppendable.closeScope();
b.append(actualType); b.append("() {"); b.openScope(); reassignThisInClosure(b, actualType.getType()); b.increaseIndentation().newLine();
appendable.openScope(); this.generateJavaDoc(it, appendable, config); final ITreeAppendable tracedAppendable = appendable.trace(it);
boolean needsToBeWrapped = earlyExit || needsSneakyThrow || !canCompileToJavaExpression(obj, appendable); if (needsToBeWrapped) { appendable.openScope(); try { if (appendable.hasObject("this")) {
final Procedure1<JvmMember> _function_3 = (JvmMember it_1) -> { final ITreeAppendable memberAppendable = this._treeAppendableUtil.traceWithComments(childAppendable, it_1); memberAppendable.openScope(); if ((it_1 instanceof JvmOperation)) { final ITreeAppendable tracedAppendable = childAppendable.trace(it_1);