Beispiel #1
0
	public BinopExp(Exp l, Token op, Exp r)
	{
	    Left = l;
	    Right = r;
	    ExpType = typeof(int);
	    
	    switch(op.Type){
	    case TokenType.PLUS:
		Oper = Operator.ADD;
		break;
	    case TokenType.MINUS:
		Oper = Operator.SUB;
		break;
	    case TokenType.MUL:
		Oper = Operator.MUL;
		break;
	    case TokenType.DIVIDE:
		Oper = Operator.DIVIDE;
		break;
	    }
	}
Beispiel #2
0
	public DoVarDef(String n, Exp init, Exp it, int p)
	{
	    Name = n;
	    Init = init;
	    Iter = it;
	    Pos = p;
	}
Beispiel #3
0
	public DoCondExp(Exp c, Exp r)
	{
	    Cond = c;
	    Ret = r;
	}
Beispiel #4
0
	public ToIntExp(Exp v)
	{
	    Value = v;
	}
Beispiel #5
0
	public ToListExp(Exp v)
	{
	    Value = v;
	}
Beispiel #6
0
	public GlobalVarDef(String n, Exp v)
	{
	    Name = n;
	    Value = v;
	    ExpType = Value.ExpType;
	}
Beispiel #7
0
	public FunctionDef(String n, ArrayList p, Exp b)
	{
	    Name = n;
	    Params = p;
	    Body = b;
	    Count = Params.Count;
	    //ExpType = Body.ExpType;
	}
Beispiel #8
0
	public CallExp(String c, String f, Exp[] p, Type t)
	{
	    ClassName = c;
	    FunctionName = f;
	    Params = p;
	    System = true;
	    ExpType = t;
	}
Beispiel #9
0
	public IfExp(Exp e, Exp thene, Exp elsee)
	{
	    EvalExp = e;
	    ThenExp = thene;
	    ElseExp = elsee;
	}
Beispiel #10
0
	public SubstExp(Exp r, Exp f, Exp e)
	{
	    Replace = r;
	    Find = f;
	    Expr = e;
	}
Beispiel #11
0
	public CallExp(String c, String f, Exp[] p)
	{
	    ClassName = c;
	    FunctionName = f;
	    Params = p;
	    System = false;
	}
Beispiel #12
0
	public ConsExp(Exp l, Exp r)
	{
	    Left = l;
	    Right = r;
	}
Beispiel #13
0
	public CarExp(Exp l)
	{
	    Left = l;
	}
Beispiel #14
0
	public CdrExp(Exp l)
	{
	    Left = l;
	}
Beispiel #15
0
	public IsNullExp(Exp e)
	{
	    Expr = e;
	}
Beispiel #16
0
	public CompareExp(Exp l, Token op, Exp r)
	{
	    Left = l;
	    Right = r;
	    
	    switch(op.Type){
	    case TokenType.LT:
		Oper = Operator.LT;
		break;
	    case TokenType.GT:
		Oper = Operator.GT;
		break;
	    case TokenType.EQ:
		Oper = Operator.EQ;
		break;
	    case TokenType.LE:
		Oper = Operator.LE;
		break;
	    case TokenType.GE:
		Oper = Operator.GE;
		break;
	    }
	}