Пример #1
0
 public static bool IsArray(Symbol sym)
 {
     return sym.Size is int[];
 }
Пример #2
0
        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;
        }
Пример #3
0
        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;
        }