SFE.Compiler
Class Operator

java.lang.Object
  extended by SFE.Compiler.Operator
Direct Known Subclasses:
EqualOperator, GreaterEqualOperator, GreaterOperator, LessEqualOperator, LessOperator, NotEqualOperator, PlusOperator, PrimitiveOperator

public abstract class Operator
extends java.lang.Object

Abstract class for representing an operator in the program. All operators have a name (whose interpretation depends on the subclass), as well as abstract functions for defining the semantics of the particular operator subclass.


Constructor Summary
Operator()
           
 
Method Summary
abstract  int arity()
          Returns the arity of the operator 1 for unary ops; 2 for binary ops; 3 for ternary ops; 0 for constants
abstract  int priority()
          Returns an int theat represents the priority of the operator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Operator

public Operator()
Method Detail

arity

public abstract int arity()
Returns the arity of the operator 1 for unary ops; 2 for binary ops; 3 for ternary ops; 0 for constants

Returns:
the arity of the operator

priority

public abstract int priority()
Returns an int theat represents the priority of the operator

Returns:
an int theat represents the priority of the operator