private void addFactoryMethod(EclipseNode singletonClass, TypeDeclaration astNode, TypeReference typeReference, TypeDeclaration innerClass, FieldDeclaration field) { MethodDeclaration factoryMethod = new MethodDeclaration(astNode.compilationResult); factoryMethod.modifiers = AccStatic | ClassFileConstants.AccPublic; factoryMethod.returnType = typeReference; factoryMethod.sourceStart = astNode.sourceStart; factoryMethod.sourceEnd = astNode.sourceEnd; factoryMethod.selector = "getInstance".toCharArray(); factoryMethod.bits = ECLIPSE_DO_NOT_TOUCH_FLAG; long pS = factoryMethod.sourceStart; long pE = factoryMethod.sourceEnd; long p = (long) pS << 32 | pE; FieldReference ref = new FieldReference(field.name, p); ref.receiver = new SingleNameReference(innerClass.name, p); ReturnStatement statement = new ReturnStatement(ref, astNode.sourceStart, astNode.sourceEnd); factoryMethod.statements = new Statement[]{statement}; EclipseHandlerUtil.injectMethod(singletonClass, factoryMethod); }
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
protected void consumeStatementReturn() { // ReturnStatement ::= 'return' Expressionopt ';' // return pushs a position on this.intStack in case there is no expression if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) { pushOnAstStack( new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition) ); } else { pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() {
@Override public boolean visitReturn(lombok.ast.Return node) { return set(node, new ReturnStatement(toExpression(node.astValue()), start(node), end(node))); }
@Override public boolean visitReturn(lombok.ast.Return node) { return set(node, new ReturnStatement(toExpression(node.astValue()), start(node), end(node))); }
@Override public boolean visitReturn(lombok.ast.Return node) { return set(node, new ReturnStatement(toExpression(node.astValue()), start(node), end(node))); }
case K_INSIDE_RETURN_STATEMENT : if(info == this.bracketDepth) { ReturnStatement returnStatement = new ReturnStatement(expression, expression.sourceStart, expression.sourceEnd); parentNode = returnStatement; this.assistNodeParent = parentNode;
case K_INSIDE_RETURN_STATEMENT : if(info == this.bracketDepth) { ReturnStatement returnStatement = new ReturnStatement(expression, expression.sourceStart, expression.sourceEnd); parentNode = returnStatement; this.assistNodeParent = parentNode;
case K_INSIDE_RETURN_STATEMENT : if(info == this.bracketDepth) { ReturnStatement returnStatement = new ReturnStatement(expression, expression.sourceStart, expression.sourceEnd); parentNode = returnStatement; this.assistNodeParent = parentNode;
case K_INSIDE_RETURN_STATEMENT : if(info == this.bracketDepth) { ReturnStatement returnStatement = new ReturnStatement(expression, expression.sourceStart, expression.sourceEnd); parentNode = returnStatement; this.assistNodeParent = parentNode;
ReturnStatement returnStatement = new ReturnStatement(exp, exp.sourceStart, exp.sourceEnd); this.enclosingNode = returnStatement; this.currentElement = this.currentElement.add(returnStatement,0);