All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.jangaroo.jooc.ast.InfixOpExpr Maven / Gradle / Ivy

There is a newer version: 4.1.17
Show newest version
package net.jangaroo.jooc.ast;

import net.jangaroo.jooc.JooSymbol;
import net.jangaroo.jooc.Scope;

import java.io.IOException;

/**
 * A BinaryOpExpr for AS3 infix operators that are not supported directly in JS.
 * For JS, the operand is generated as a function receiving the two arguments.
 *
 * @author Frank Wienberg
 */
public class InfixOpExpr extends BinaryOpExpr {
  private Scope scope;

  protected InfixOpExpr(Expr arg1, JooSymbol op, Expr arg2) {
    super(arg1, op, arg2);
  }

  @Override
  public void scope(Scope scope) {
    super.scope(scope);
    this.scope = scope;
  }

  @Override
  public void analyze(AstNode parentNode) {
    super.analyze(parentNode);
    scope.getCompilationUnit().addBuiltInIdentifierUsage(getOp().getText());
  }

  @Override
  public void visit(AstVisitor visitor) throws IOException {
    visitor.visitInfixOpExpr(this);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy