public Scope NextScope () { if (CurrentScope == null) CurrentScope = globalScope; CurrentScope = CurrentScope.NextScope; return CurrentScope; }
/// <summary> /// Leaves the scope. /// </summary> /// <returns>The scope.</returns> public Scope LeaveScope () { Scope old = CurrentScope; CurrentScope = old.ParentScope; CurrentScope.NextScope = old.NextScope; return CurrentScope; }
/// <summary> /// Begins a new scope. /// </summary> /// <param name="isLocalScope">If set to <c>true</c> is local scope.</param> public void BeginScope (bool isLocalScope = false) { if (isLocalScope) { currentLocalScope = new LocalScope (currentLocalScope); } Scope newScope = new Scope (CurrentScope); if (lastScope != null) { lastScope.NextScope = newScope; } else { globalScope.NextScope = newScope; } CurrentScope.AddScope (newScope); CurrentScope = newScope; lastScope = newScope; }
public void AddScope (Scope scope) { childScopes.Add (scope); }
public SymbolTable () { CurrentScope = globalScope; }
public Scope () { ParentScope = null; }
public Scope (Scope parent) { ParentScope = parent; }
/// <summary> /// Ends a scope. /// </summary> /// <param name="isLocalScope">If set to <c>true</c> is local scope.</param> public void EndScope (bool isLocalScope = false) { if (isLocalScope) { currentLocalScope = currentLocalScope.ParentScope; } CurrentScope = CurrentScope.ParentScope; }
public SymbolTable() { CurrentScope = globalScope; }
public void AddScope(Scope scope) { childScopes.Add(scope); }
public Scope(Scope parent) { ParentScope = parent; }
public Scope() { ParentScope = null; }