Exemplo n.º 1
0
 Symbol AddPredef(string name, PredefScopes pscope, PredefKinds pkind, DataTypes datatype = DataTypes.Unknown)
 {
     return(Add(name, new Symbol {
         Atom = Atoms.IDENT,
         Kind = SymKinds.PREDEF,
         PredefScope = pscope,
         PredefKind = pkind,
         DataType = datatype,
     }));
 }
Exemplo n.º 2
0
        // Add a specific set of methods into a new scope
        // Pop the scope but keep a pointer to it in a look up table
        private void AddBuiltinMethods(PredefScopes predefscope, Type codetype, Type deftype, PredefKinds kind)
        {
            var scope = CurrentScope.Push();

            PredefScopeDict[predefscope] = new BuiltinScopeInfo {
                Predef   = predefscope,
                CodeType = codetype,
                DefType  = deftype,
                Scope    = scope,
                Kind     = kind,
            };
            foreach (var binfo in CallInfo.GetBuiltinInfo(codetype))
            {
                AddMethod(binfo.Name, binfo, predefscope);
            }
            scope.Pop();
        }
Exemplo n.º 3
0
 internal Symbol Find(string name, PredefKinds kind)
 {
     return(CurrentScope.FindAny(name, s => s.PredefKind == kind));
 }