ponderToolkit.compiler.semantics.expressions
Class Operator

java.lang.Object
  |
  +--ponderToolkit.compiler.semantics.expressions.Operator
Direct Known Subclasses:
AddOp, CompEventOp, ConcOp, DomainSetOp, DomainUnaryOp, DotOp, LogicOp, MARKER, MethodOp, MultiplyOp, RelOp, StarEventOp, TimeEventOp, UnaryOp

public abstract class Operator
extends java.lang.Object

Function: Models an Operator - it is used both for expression operators and Domain Scope Expression operators


Field Summary
static int AND
           
static int AT_DOMAIN
           
static int CONCURRENCY_AND
           
static int CONCURRENCY_OR
           
static int CONCURRENCY_PARALLEL
           
static int CONCURRENCY_SEQUENTIAL
           
static int DIV
           
static int DOT
           
static int EQUALS
           
static int EVENT_OP_AMPER
           
static int EVENT_OP_ARROW
           
static int EVENT_OP_BAR
           
static int EVENT_OP_NO_INTERLEAVE
           
static int EVENT_OP_STAR
           
static int EVENT_OP_TIME
           
static int GREATER_THAN
           
static int GREATER_THAN_EQUALS
           
static int IMPLIES
           
static int LESS_THAN
           
static int LESS_THAN_EQUALS
           
static int METHOD
           
static int MINUS
           
static int MULT
           
static int NOT
           
static int NOT_EQUALS
           
protected  int op
           
protected  java.lang.String opStr
          Fields
static int OR
           
static int PLUS
           
protected  TokenPosition pos
           
protected  int precedence
           
static int SET_DIFFERENCE
           
static int SET_INTERSECTION
           
static int SET_UNION
           
static int STAR_DOMAIN
           
static int XOR
           
 
Constructor Summary
Operator()
          Constructor with no parameters
Operator(java.lang.String newOpStr, int newOp, TokenPosition newPos)
          Constructor which accepts the string representation of the operator the operator code, and the TokenPosition of the operator in the specification
 
Method Summary
 ExprValue evaluate(ExprValue val)
          Evaluates: OP val and returns the result Must be overwritten
 ExprValue evaluate(ExprValue val1, ExprValue val2)
          Calculates the result of val1 OP val2 and returns a Value Must be overwritten
 int getOpCode()
          Returns the Operator Code
 java.lang.String getOpStr()
          Returns the OpStr - The string representing the operator.
 TokenPosition getPos()
          Returns the TokenPosition of this operator
 int getPrecedence()
          Returns the Precedence value of the operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLUS

public static final int PLUS

MINUS

public static final int MINUS

MULT

public static final int MULT

DIV

public static final int DIV

EQUALS

public static final int EQUALS

NOT_EQUALS

public static final int NOT_EQUALS

LESS_THAN

public static final int LESS_THAN

LESS_THAN_EQUALS

public static final int LESS_THAN_EQUALS

GREATER_THAN

public static final int GREATER_THAN

GREATER_THAN_EQUALS

public static final int GREATER_THAN_EQUALS

AND

public static final int AND

OR

public static final int OR

XOR

public static final int XOR

IMPLIES

public static final int IMPLIES

NOT

public static final int NOT

METHOD

public static final int METHOD

AT_DOMAIN

public static final int AT_DOMAIN

STAR_DOMAIN

public static final int STAR_DOMAIN

SET_UNION

public static final int SET_UNION

SET_DIFFERENCE

public static final int SET_DIFFERENCE

SET_INTERSECTION

public static final int SET_INTERSECTION

CONCURRENCY_SEQUENTIAL

public static final int CONCURRENCY_SEQUENTIAL

CONCURRENCY_OR

public static final int CONCURRENCY_OR

CONCURRENCY_PARALLEL

public static final int CONCURRENCY_PARALLEL

CONCURRENCY_AND

public static final int CONCURRENCY_AND

EVENT_OP_TIME

public static final int EVENT_OP_TIME

EVENT_OP_STAR

public static final int EVENT_OP_STAR

EVENT_OP_AMPER

public static final int EVENT_OP_AMPER

EVENT_OP_BAR

public static final int EVENT_OP_BAR

EVENT_OP_ARROW

public static final int EVENT_OP_ARROW

EVENT_OP_NO_INTERLEAVE

public static final int EVENT_OP_NO_INTERLEAVE

DOT

public static final int DOT

opStr

protected java.lang.String opStr
Fields

op

protected int op

pos

protected TokenPosition pos

precedence

protected int precedence
Constructor Detail

Operator

public Operator(java.lang.String newOpStr,
                int newOp,
                TokenPosition newPos)
Constructor which accepts the string representation of the operator the operator code, and the TokenPosition of the operator in the specification

Operator

public Operator()
Constructor with no parameters
Method Detail

getOpCode

public int getOpCode()
Returns the Operator Code

getPrecedence

public int getPrecedence()
Returns the Precedence value of the operator.

getOpStr

public java.lang.String getOpStr()
Returns the OpStr - The string representing the operator.

evaluate

public ExprValue evaluate(ExprValue val1,
                          ExprValue val2)
Calculates the result of val1 OP val2 and returns a Value Must be overwritten

evaluate

public ExprValue evaluate(ExprValue val)
Evaluates: OP val and returns the result Must be overwritten

getPos

public TokenPosition getPos()
Returns the TokenPosition of this operator