Exemple #1
0
        /// <summary>
        /// Constructs a function scope with a parent <paramref name="namespaceScope"/>.
        /// </summary>
        internal FunctionScope(PathTable pathTable, StringTable stringTable, ISourceFile sourceFile, NamespaceScope namespaceScope)
            : this()
        {
            Contract.Requires(pathTable != null);
            Contract.Requires(stringTable != null);
            Contract.Requires(sourceFile != null);

            m_pathTable      = pathTable;
            m_stringTable    = stringTable;
            m_sourceFile     = sourceFile;
            m_namespaceScope = namespaceScope;
            m_sourceFilePath = sourceFile.GetAbsolutePath(pathTable);
        }
Exemple #2
0
        /// <nodoc />
        public NamespaceScope(List <SymbolAtom> fullName, ISymbolTable symbolTable, ISourceFile sourceFile, PathTable pathTable, StringTable stringTable, NamespaceScope parent = null)
        {
            Contract.Requires(symbolTable != null);
            Contract.Requires(sourceFile != null);
            Contract.Requires(stringTable != null);

            m_sourceFile  = sourceFile;
            m_stringTable = stringTable;
            m_parent      = parent;
            m_pathTable   = pathTable;
            FullName      = fullName;

            PopulateFromSymbolTable(symbolTable);
        }
Exemple #3
0
        private FunctionScope(PathTable pathTable, StringTable stringTable, ISourceFile sourceFile, FunctionScope parentScope)
        {
            Contract.Requires(stringTable != null);
            Contract.Requires(sourceFile != null);

            m_stringTable = stringTable;
            m_sourceFile  = sourceFile;
            m_pathTable   = pathTable;

            m_nextIndex       = parentScope.m_nextIndex;
            Captures          = m_nextIndex;
            m_scopedVarsStack = new Stack <BlockScope>();
            m_scopedVarsStack.Push(new BlockScope(this));
            m_parent         = parentScope;
            m_namespaceScope = null;
            m_sourceFilePath = sourceFile.GetAbsolutePath(pathTable);
        }