예제 #1
0
        public void Visit(VariableDeclareStatement vardecl)
        {
            if (vardecl.init == null)
            {
                EvaluationStack.Push(new StackValue(ValType.Null, null));
            }
            else
            {
                vardecl.init.Accept(this);
            }

            vardecl.ident.Accept(this);
            EvaluationStack.Push(StackValue.CreateStackValue(new Token(TokenType.VAR)));
        }
예제 #2
0
 public void Visit(Assignment ass)
 {
     ass.expression.Accept(this);
     ass.ident.Accept(this);
     EvaluationStack.Push(StackValue.CreateStackValue(new Token(TokenType.ASSIGN, "=")));
 }
예제 #3
0
 public void Visit(UnaryOperation unop)
 {
     unop.operand.Accept(this);
     EvaluationStack.Push(StackValue.CreateStackValue(unop.op));
 }
예제 #4
0
        public void Visit(Operand op)
        {
            var tttt = StackValue.CreateStackValue(op.token);

            EvaluationStack.Push(tttt);
        }
예제 #5
0
 public void Visit(BinaryOperation binop)
 {
     binop.leftnode.Accept(this);
     binop.rightnode.Accept(this);
     EvaluationStack.Push(StackValue.CreateStackValue(binop.op));
 }