/// <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); }
/// <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); }