Exemple #1
0
 public ForStatement(StatementList Conditions, StatementList Body)
 {
     this.Initialize = Conditions[0];
     this.Condition = Conditions[1];
     this.Step = Conditions[2];
     this.Body = Body;
 }
Exemple #2
0
 public ForStatement(Statement Initialize, Statement Condition, Statement Step, StatementList Body)
 {
     this.Initialize = Initialize;
     this.Condition = Condition;
     this.Body = Body;
     this.Step = Step;
 }
 public BinaryOperator(string op, Statement left, Statement right)
 {
     Operator = op;
     Left = left;
     Right = right;
 }
 public WhileStatement(Statement Condition, StatementList Body)
 {
     this.Condition = Condition;
     this.Body = Body;
 }
Exemple #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);
            }
        }
 public ReturnStatement(Statement returns)
 {
     returnStatement = returns;
 }