public static bool IsArray(Symbol sym) { return sym.Size is int[]; }
private string GetSymbolType(AstExpression expr, Symbol s, string id) { if (s == null) { var name = (s is CallableSymbol) ? " method" : " identifier"; var e = new SymbolNotFoundException("'" + id + "' " + name +" not found."); e.Expr = expr; e.Id = id; throw e; } return s.Type; }
public void EnterSymbol(string name, string type, object size) { if (table.ContainsKey(name)) { throw new SymbolAlreadyDefinedException(name); } Symbol s = new Symbol(name, type, size); table[name] = s; }