Esempio n. 1
0
 public void setFor(string id, IterNode iterator, BodyNode body)
 {
     this.id = id;
     fields.Add("iter", iterator);
     fields.Add("body", body);
     children.Add(iterator);
     //children.Add(body);
 }
Esempio n. 2
0
        private IterNode parseIter(List <string> tokens)
        {
            int ind = findToken(tokens, (string s) => (s == "dots_t"), 0);

            if (ind == -1)
            {
                throw new SyntaxError("Syntax Error");
            }
            else
            {
                var it = new IterNode(
                    parseExpression(tokens.GetRange(0, ind)),
                    parseExpression(tokens.GetRange(ind + 1, tokens.Count - ind - 1))
                    );
                return(it);
            }
        }