Example #1
0
 public ForStatement(StatementList Conditions, StatementList Body)
 {
     this.Initialize = Conditions[0];
     this.Condition = Conditions[1];
     this.Step = Conditions[2];
     this.Body = Body;
 }
Example #2
0
 public ForStatement(Statement Initialize, Statement Condition, Statement Step, StatementList Body)
 {
     this.Initialize = Initialize;
     this.Condition = Condition;
     this.Body = Body;
     this.Step = Step;
 }
Example #3
0
 public BinaryOperator(string op, Statement left, Statement right)
 {
     Operator = op;
     Left = left;
     Right = right;
 }
Example #4
0
 public WhileStatement(Statement Condition, StatementList Body)
 {
     this.Condition = Condition;
     this.Body = Body;
 }
Example #5
0
        private Statement ParseOperatorRHS(int precedence, Statement Left)
        {
            while (true)
            {
                int LeftPrec = GetTokenPrecedence();
                if (LeftPrec < precedence)
                    return Left;
                string Operator = CurToken.Value; ;
                GetNextToken(); //eat left

                Statement Right = ParsePrimary();
                int RightPrec = GetTokenPrecedence();
                if (LeftPrec < RightPrec)
                {
                    Right = ParseOperatorRHS(LeftPrec + 1, Right);
                }
                Left = new BinaryOperator(Operator, Left, Right);
            }
        }
Example #6
0
 public ReturnStatement(Statement returns)
 {
     returnStatement = returns;
 }