Examples of SynchronizedStatement


Examples of anvil.script.statements.SynchronizedStatement

  Token t;
    t = jj_consume_token(SYNCHRONIZED);
    jj_consume_token(OPEN);
    Expression();
    jj_consume_token(CLOSE);
      flowPushChild(new SynchronizedStatement(
        flowPeek(), toLocation(t), (Expression)pop()));
    Statement();
      flowPop();
  }
View Full Code Here

Examples of com.bacoder.parser.java.api.SynchronizedStatement

    return switchStatement;
  }

  protected SynchronizedStatement processSynchronizedStatement(StatementContext context) {
    SynchronizedStatement synchronizedStatement = createNode(context, SynchronizedStatement.class);

    ParExpressionContext parExpressionContext = getChild(context, ParExpressionContext.class);
    synchronizedStatement.setExpression(processParExpression(parExpressionContext));

    BlockContext blockContext = getChild(context, BlockContext.class);
    if (blockContext != null) {
      synchronizedStatement.setBody(getAdapter(BlockAdapter.class).adapt(blockContext));
    }

    return synchronizedStatement;
  }
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.SynchronizedStatement

        if (parent instanceof MethodNode) {
            MethodNode mNode = (MethodNode) parent;
            ClassNode cNode = mNode.getDeclaringClass();
            String lockExpr = determineLock(value, cNode, mNode.isStatic());
            Statement origCode = mNode.getCode();
            Statement newCode = new SynchronizedStatement(new VariableExpression(lockExpr), origCode);
            mNode.setCode(newCode);
        }
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.SynchronizedStatement

        if (parent instanceof MethodNode) {
            MethodNode mNode = (MethodNode) parent;
            ClassNode cNode = mNode.getDeclaringClass();
            String lockExpr = determineLock(value, cNode, mNode.isStatic());
            Statement origCode = mNode.getCode();
            Statement newCode = new SynchronizedStatement(new VariableExpression(lockExpr), origCode);
            mNode.setCode(newCode);
        }
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.SynchronizedStatement

        final VariableExpression localVar = varX(fieldNode.getName() + "_local");
        body.addStatement(declS(localVar, fieldExpr));
        body.addStatement(ifElseS(
                notNullX(localVar),
                returnS(localVar),
                new SynchronizedStatement(
                        syncTarget(fieldNode),
                        ifElseS(
                                notNullX(fieldExpr),
                                returnS(fieldExpr),
                                returnS(assignX(fieldExpr, initExpr))
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.SynchronizedStatement

        if (fieldNode.isVolatile()) {
            body.addStatement(ifElseS(
                    notNullX(resExpr),
                    stmt(resExpr),
                    new SynchronizedStatement(syncTarget(fieldNode), block(
                            assignS(resExpr, callExpression),
                            mainIf)
                    )
            ));
        } else {
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.SynchronizedStatement

            }
            ClassNode cNode = mNode.getDeclaringClass();
            String lockExpr = determineLock(value, cNode, mNode);
            if (lockExpr == null) return;
            Statement origCode = mNode.getCode();
            Statement newCode = new SynchronizedStatement(varX(lockExpr), origCode);
            mNode.setCode(newCode);
        }
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.SynchronizedStatement

    private Statement lazyBody(ClassNode classNode, FieldNode fieldNode) {
        final Expression instanceExpression = varX(fieldNode);
        return ifElseS(
                notNullX(instanceExpression),
                returnS(instanceExpression),
                new SynchronizedStatement(
                        classX(classNode),
                        ifElseS(
                                notNullX(instanceExpression),
                                returnS(instanceExpression),
                                returnS(assignX(instanceExpression, ctorX(classNode)))
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement

  if (this.astLengthStack[this.astLengthPtr] == 0) {
    this.astLengthStack[this.astLengthPtr] = 1;
    this.expressionLengthPtr--;
    this.astStack[++this.astPtr] =
      new SynchronizedStatement(
        this.expressionStack[this.expressionPtr--],
        null,
        this.intStack[this.intPtr--],
        this.endStatementPosition);
  } else {
    this.expressionLengthPtr--;
    this.astStack[this.astPtr] =
      new SynchronizedStatement(
        this.expressionStack[this.expressionPtr--],
        (Block) this.astStack[this.astPtr],
        this.intStack[this.intPtr--],
        this.endStatementPosition);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.