Package com.google.minijoe.compiler.ast

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


    writeOp(JsFunction.OP_DROP);
    return expression;
  }

  public Expression visit(IncrementExpression expression) throws CompilerException {
    Expression savePendingAssignment = pendingAssignment;
    pendingAssignment = expression;
    expression.subExpression.visitExpression(this);
    if (pendingAssignment != null) {
      throw new RuntimeException("Pending assignment was not resolved");
    }
View Full Code Here


    pendingAssignment = savePendingAssignment;
    return expression;
  }

  public Expression visit(PropertyExpression expression) throws CompilerException {
    Expression pa = pendingAssignment;
    pendingAssignment = null;

    if (pa == null) {
      expression.leftExpression.visitExpression(this);
      expression.rightExpression.visitExpression(this);
View Full Code Here

  public Statement visit(VariableStatement variableStatement) throws CompilerException {
    Vector statements = new Vector(0);

    for (int i = 0; i < variableStatement.declarations.length; i++) {
      Expression expression = visitExpression(variableStatement.declarations[i]);

      if (expression != null) {
        Statement statement = new ExpressionStatement(expression);
        statement.setLineNumber(variableStatement.getLineNumber());
        statements.addElement(statement);
View Full Code Here

      return new BlockStatement(Util.vectorToStatementArray(statements));
    }
  }

  public Expression visit(VariableExpression variableExpression) throws CompilerException {
    Expression result = null;

    for (int i = 0; i < variableExpression.declarations.length; i++) {
      Expression expression = visitExpression(variableExpression.declarations[i]);

      if (expression != null) {
        if (result == null) {
          result = expression;
        } else {
View Full Code Here

    return result;
  }

  public Expression visit(VariableDeclaration declaration) throws CompilerException {
    Identifier identifier = visitIdentifier(declaration.identifier);
    Expression initializer = visitExpression(declaration.initializer);
    Expression result = null;

    if (variableVector != null) {
      addVariable(identifier);
    }
View Full Code Here

TOP

Related Classes of com.google.minijoe.compiler.ast.Expression

Copyright © 2018 www.massapicom. 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.