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"); }
public Parser(Tokenizer tokenizer) { this.tokenizer = tokenizer; currToken = this.tokenizer.nextToken(); }
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; }
public IdeNode(Token t, Env e) : base(t, e) { }
public AndNode(Token t) : base(t) { nodes = new List<Node>(); }
public Node(Token t, Env e = null) { this.token = t; this.env = e; }
public LetNode(Token t, IdeNode ide, Node definition, Node body, Env e) : base(t, e) { this.ide = ide; this.definition = definition; this.body = body; }
public void Put(Token t, bool b) { table.Add(t, b); //dump("Adding " + t.ToString()); }