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 void Put(Token t, bool b) { table.Add(t, b); //dump("Adding " + t.ToString()); }
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; }