Пример #1
0
        /// <summary>
        /// Creates new <see cref="FunctionScope"/> for with a given <paramref name="symbolTable"/>.
        /// </summary>
        public FunctionScope NewFunctionScope(ISymbolTable symbolTable)
        {
            Contract.Requires(symbolTable != null);

            var scope = new FunctionScope(m_pathTable, m_stringTable, m_sourceFile, this);

            scope.PopulateFromSymbolTable(symbolTable);

            return(scope);
        }
Пример #2
0
        /// <summary>
        /// Creates a nested function scope with a given <paramref name="symbolTable"/>.
        /// </summary>
        public FunctionScope CreateNestedScope(ISymbolTable symbolTable)
        {
            Contract.Requires(symbolTable != null);

            Contract.Assert(m_stringTable != null, "Are you tring to create a nested scope from an empty function scope?");
            Contract.Assert(m_sourceFile != null, "Are you tring to create a nested scope from an empty function scope?");

            var result = new FunctionScope(m_pathTable, m_stringTable, m_sourceFile, this);

            result.PopulateFromSymbolTable(symbolTable);

            return(result);
        }