示例#1
0
文件: context.cs 项目: RenolY2/ssc
        sunCallableSymbol AddSystemBuiltin(string name)
        {
            var symbol = new sunBuiltinSymbol(name, SymbolTable.Count);

            SymbolTable.Add(symbol);
            return(symbol);
        }
示例#2
0
文件: context.cs 项目: RenolY2/ssc
        // callables
        public sunBuiltinSymbol DeclareBuiltin(sunBuiltinDeclaration node)
        {
            if (SymbolTable.Get <sunCallableSymbol>().Any(i => i.Name == node.Name.Value))
            {
                throw new sunRedeclaredBuiltinException(node);
            }
            var symbol = new sunBuiltinSymbol(node.Name.Value, node.Parameters.ParameterInfo, SymbolTable.Count);

            SymbolTable.Add(symbol);
            return(symbol);
        }