Examples of ExpressionStatement


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

    }

    StatementExpressionContext statementExpressionContext =
        getChild(context, StatementExpressionContext.class);
    if (statementExpressionContext != null) {
      ExpressionStatement expressionStatement =
          createNode(statementExpressionContext, ExpressionStatement.class);

      ExpressionContext expressionContext =
          getChild(statementExpressionContext, ExpressionContext.class);
      if (expressionContext != null) {
        expressionStatement.setExpression(
            getAdapter(ExpressionAdapter.class).adapt(expressionContext));
      }

      return expressionStatement;
    }
View Full Code Here

Examples of com.google.minijoe.compiler.ast.ExpressionStatement

    if (expression instanceof Identifier && nextToken == Token.OPERATOR_COLON) {
      readToken(Token.OPERATOR_COLON);
      return new LabelledStatement((Identifier) expression, parseStatement());
    } else {
      readTokenSemicolon();
      return new ExpressionStatement(expression);
    }
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ExpressionStatement

    pushBuilder(new ExpressionBuilder(parent));
  }

  @Override
  public void beginExpressionStatement() {
    ExpressionStatement statement = new ExpressionStatement();
    parent.addChild(statement);
    pushBuilder(new ExpressionBuilder(statement));
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ExpressionStatement

  }

  public void testFunctionCall() throws Exception {
    TranslationUnit unit = parse("void foo(int) {} void bar(int) { foo(5); }");
    FunctionDefinition functionBar = unit.getChild(1);
    ExpressionStatement expressionStatement = functionBar.getChild(0);
    FunctionInvocation callFoo = expressionStatement.getExpression(0);
    assertEquals("foo", callFoo.getName());
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ExpressionStatement

        "class A { public: void foo() {} };     " +
        "A bar() { A a; return a; }             " +
        "void main() { bar().foo(); }           ");
    FunctionDefinition functionMain = unit.getChild(2);
    assertEquals("main", functionMain.getName());
    ExpressionStatement expressionStatement = functionMain.getChild(0);
    FunctionInvocation callBar = expressionStatement.getExpression(0);
    assertEquals("bar", callBar.getName());
    FunctionInvocation callFoo = callBar.getChild(0);
    assertEquals("foo", callFoo.getName());
    assertEquals(0, callFoo.getChildren().size());
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ExpressionStatement

    FunctionDefinition functionMain = unit.getChild(0);
    VariableDeclaration variableA = functionMain.getChild(0);
    assertEquals("a", variableA.getName());
    VariableDeclaration variableB = functionMain.getChild(1);
    assertEquals("b", variableB.getName());
    ExpressionStatement statement = functionMain.getChild(2);
    Expression expression = statement.getExpression(0);
    assertTrue(expression instanceof AssignmentExpression);
    AssignmentExpression assignment = (AssignmentExpression) expression;
    Name leftSide = assignment.getExpression(0);
    Name rightSide = assignment.getExpression(1);
    assertEquals("a", leftSide.getIdentifier());
View Full Code Here

Examples of eu.admire.dispel.statements.ExpressionStatement

        ci.setInitialValue(p.getLeft());
        p.getRight().setChild(literal);

        //Wrap the ci in a temporary expression statement so we can add it
        //to the package
        ExpressionStatement exp = wrapCI(ci);         
       
        return new Pair
            <ExpressionStatement, ConnectionInitialization>(exp, ci);
    }
View Full Code Here

Examples of lombok.ast.ExpressionStatement

    if (dot != null) source.registerStructure(result, dot);
    return posify(result);
  }
 
  public Node createExpressionStatement(Node expression) {
    return posify(new ExpressionStatement().rawExpression(expression));
  }
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.ast.ExpressionStatement

        data.addExecutableLine(lineNr);
        block.addChildBefore(newInstrumentationNode(lineNr), elseIfStatement);
    }

    private AstNode newInstrumentationNode(final int lineNr) {
        final ExpressionStatement instrumentationNode = new ExpressionStatement();
        final UnaryExpression inc = new UnaryExpression();

        inc.setIsPostfix(true);
        inc.setOperator(Token.INC);

        final ElementGet outer = new ElementGet();
        final ElementGet inner = new ElementGet();

        outer.setTarget(inner);

        final Name covDataVar = new Name();
        covDataVar.setIdentifier(ScriptInstrumenter.COVERAGE_VARIABLE_NAME);

        inner.setTarget(covDataVar);

        final StringLiteral fileName = new StringLiteral();
        fileName.setValue(data.getSourceUriAsString());
        fileName.setQuoteCharacter('\'');

        inner.setElement(fileName);

        final NumberLiteral index = new NumberLiteral();
        index.setNumber(lineNr);
        index.setValue(Integer.toString(lineNr));

        outer.setElement(index);

        inc.setOperand(outer);

        instrumentationNode.setExpression(inc);
        instrumentationNode.setHasResult();

        return instrumentationNode;
    }
View Full Code Here

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

            public boolean isSatisfiedBy(Statement statement) {
                if (!(statement instanceof ExpressionStatement)) {
                    return false;
                }

                ExpressionStatement expressionStatement = (ExpressionStatement) statement;
                if (!(expressionStatement.getExpression() instanceof MethodCallExpression)) {
                    return false;
                }

                MethodCallExpression methodCall = (MethodCallExpression) expressionStatement.getExpression();
                if (!isMethodOnThis(methodCall, getScriptMethodName())) {
                    return false;
                }

                if (!(methodCall.getArguments() instanceof ArgumentListExpression)) {
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.