Ejemplo n.º 1
0
        public bool get(Token t)
        {
            //dump("Searching " + t.ToString());
            for (Env e = this; e != null; e = e.prev)
            {
                if (e.table.Contains(t))
                    return (bool)e.table[t];
            }

            dump("Error: bind for " + t.ToString() + " not found");
            throw new BindNotFoundException("Error: bind for " + t.ToString() + " not found");
        }
Ejemplo n.º 2
0
 public Parser(Tokenizer tokenizer)
 {
     this.tokenizer = tokenizer;
     currToken = this.tokenizer.nextToken();
 }
Ejemplo n.º 3
0
        Token match(TokenType type)
        {
            Token tmp = currToken;
            if (currToken.Type == type)
                currToken = tokenizer.nextToken();
            else
                Error("Error: excepted " + type.ToString() + ", read " + (currToken.Type).ToString() + ".");

            return tmp;
        }
Ejemplo n.º 4
0
 public IdeNode(Token t, Env e)
     : base(t, e)
 {
 }
Ejemplo n.º 5
0
 public AndNode(Token t)
     : base(t)
 {
     nodes = new List<Node>();
 }
Ejemplo n.º 6
0
 public Node(Token t, Env e = null)
 {
     this.token = t;
     this.env = e;
 }
Ejemplo n.º 7
0
 public LetNode(Token t, IdeNode ide, Node definition, Node body, Env e)
     : base(t, e)
 {
     this.ide = ide;
     this.definition = definition;
     this.body = body;
 }
Ejemplo n.º 8
0
 public void Put(Token t, bool b)
 {
     table.Add(t, b);
     //dump("Adding " + t.ToString());
 }