Esempio n. 1
0
 public AssNode(PrimaryNode p, ExprNode e) : base(NodeType.AssNode)
 {
     this.prim = p;
     this.expr = e;
     children  = new List <ExprNode>();
     children.Add(expr);
 }
Esempio n. 2
0
        private PrimaryNode parsePrimary(List <string> tokens)
        {
            //Console.WriteLine("Inside Parse Primary");
            //printList(tokens);
            PrimaryNode pn;

            if (tokenType.isRead(tokens[0]))
            {
                pn = new PrimaryNode(Convert.toRead(tokens[0]));
            }
            else
            {
                pn = new PrimaryNode(PrimaryType.Id);
                if (tokens.Count == 1)
                {
                    //Console.WriteLine("ITS OK");
                    pn.setId(tokens[0], null);
                }
                else
                {
                    pn.setId(tokens[0], parseTail(tokens.GetRange(1, tokens.Count - 1)));
                }
            }
            return(pn);
        }
Esempio n. 3
0
 public void setPrimary(string pref, PrimaryNode primary, TypeNode type)
 {
     if (pref != null)
     {
         prefix = pref;
     }
     if (type != null)
     {
         fields.Add("type", type);
     }
     fields.Add("primary", primary);
     children.Add(primary);
 }