private Statement HandleAnimationCall(ValueEvaluator ids)
 {
     if (Accept(TokenType.ParenthesisLeft))
     {
         Queue <ArithmExprEvaluator> args = new Queue <ArithmExprEvaluator>();
         if (Accept(TokenType.ParenthesisRight))
         {
             return(new AnimationCallStatement(ids, args));
         }
         while (!Accept(TokenType.ParenthesisRight))
         {
             if (args.Count != 0)
             {
                 NextToken();
             }
             var arg = GetArithmExpr();
             args.Enqueue(arg);
             if (currentToken.token != TokenType.ParenthesisRight && currentToken.token != TokenType.Comma)
             {
                 throw new SyntaxException("Bad animation call in line " + currentToken.line);
             }
         }
         Expect(TokenType.Semicolon, "Expected semicolon at the end of line " + currentToken.line);
         return(new AnimationCallStatement(ids, args));
     }
     return(null);
 }
 private Statement HandleAssignment(ValueEvaluator lvalue)
 {
     if (Accept(TokenType.AssignmentOperator))
     {
         var expr = GetArithmExpr();
         Expect(TokenType.Semicolon, "Expected semicolon at the end of line " + currentToken.line);
         return(new AssignmentStatement(lvalue, expr));
     }
     return(null);
 }
 public AssignmentStatement(ValueEvaluator idd, ArithmExprEvaluator arguments)
 {
     ids = idd;
     arithmeticExpression = arguments;
 }
 public AnimationCallStatement(ValueEvaluator idd, Queue <ArithmExprEvaluator> queue)
 {
     ids  = idd;
     args = queue;
 }
 public ForEachStatement(string idv, ValueEvaluator idc, Queue <Statement> list)
 {
     iterator_id   = idv;
     collection_id = idc;
     statements    = list;
 }
Ejemplo n.º 6
0
 public ArithmValueEvaluator(ValueEvaluator val)
 {
     simpleVal = val;
     arithmVal = null;
 }