예제 #1
0
        public BSYMMGR()
        {
            this.tableGlobal = new SYMTBL();
            _symFactory      = new SymFactory(this.tableGlobal);

            this.tableTypeArrays = new Dictionary <TypeArrayKey, TypeArray>();
            _rootNS = _symFactory.CreateNamespace(NameManager.Lookup(""), null);

            ////////////////////////////////////////////////////////////////////////////////
            // Build the data structures needed to make FPreLoad fast. Make sure the
            // namespaces are created. Compute and sort hashes of the NamespaceSymbol * value and type
            // name (sans arity indicator).

            for (int i = 0; i < (int)PredefinedType.PT_COUNT; ++i)
            {
                NamespaceSymbol ns    = GetRootNS();
                string          name  = PredefinedTypeFacts.GetName((PredefinedType)i);
                int             start = 0;
                while (start < name.Length)
                {
                    int iDot = name.IndexOf('.', start);
                    if (iDot == -1)
                    {
                        break;
                    }
                    string sub = (iDot > start) ? name.Substring(start, iDot - start) : name.Substring(start);
                    Name   nm  = NameManager.Add(sub);
                    ns     = LookupGlobalSymCore(nm, ns, symbmask_t.MASK_NamespaceSymbol) as NamespaceSymbol ?? _symFactory.CreateNamespace(nm, ns);
                    start += sub.Length + 1;
                }
            }
        }
예제 #2
0
        public BSYMMGR(NameManager nameMgr)
        {
            this.m_nameTable = nameMgr;
            this.tableGlobal = new SYMTBL();
            _symFactory      = new SymFactory(this.tableGlobal);
            _miscSymFactory  = new MiscSymFactory(this.tableGlobal);

            this.tableTypeArrays = new Dictionary <TypeArrayKey, TypeArray>();
            _rootNS = _symFactory.CreateNamespace(m_nameTable.Lookup(""), null);
            GetNsAid(_rootNS);
        }
예제 #3
0
        public BSYMMGR(NameManager nameMgr, TypeManager typeManager)
        {
            this.m_nameTable = nameMgr;
            this.tableGlobal = new SYMTBL();
            _symFactory      = new SymFactory(this.tableGlobal, this.m_nameTable);
            _miscSymFactory  = new MiscSymFactory(this.tableGlobal);

            this.ssetAssembly = new List <AidContainer>();

            _infileUnres          = new InputFile();
            _infileUnres.isSource = false;
            _infileUnres.SetAssemblyID(KAID.kaidUnresolved);

            this.ssetAssembly.Add(new AidContainer(_infileUnres));
            this.bsetGlobalAssemblies = new HashSet <KAID>();
            this.bsetGlobalAssemblies.Add(KAID.kaidThisAssembly);
            this.tableTypeArrays = new Dictionary <TypeArrayKey, TypeArray>();
            _rootNS = _symFactory.CreateNamespace(m_nameTable.Add(""), null);
            GetNsAid(_rootNS, KAID.kaidGlobal);
        }
예제 #4
0
        /////////////////////////////////////////////////////////////////////////////////

        internal SymbolTable(
            SYMTBL symTable,
            SymFactory symFactory,
            NameManager nameManager,
            TypeManager typeManager,
            BSYMMGR bsymmgr,
            CSemanticChecker semanticChecker,

            InputFile infile)
        {
            _symbolTable = symTable;
            _symFactory = symFactory;
            _nameManager = nameManager;
            _typeManager = typeManager;
            _bsymmgr = bsymmgr;
            _semanticChecker = semanticChecker;

            _infile = infile;

            ClearCache();
        }