/// <summary> /// Ends the scope. /// </summary> /// <param name="scope">The scope.</param> public void EndScope(ParseScope scope) { if (scope != this.Scope) { throw new NotSupportedException(); } scopeStack.Pop(); }
/// <summary> /// Initializes a new instance of the <see cref="ParseScope"/> class. /// </summary> /// <param name="parent">The parent scope.</param> public ParseScope(ParseScope parent) { this.parent = parent; }
/// <summary> /// Begins a new scope. /// </summary> /// <param name="isChild">if set to <c>true</c> the scope is a child.</param> /// <returns>A new scope.</returns> public ParseScope BeginScope(bool isChild) { ParseScope result; if (isChild) { result = new ParseScope(this.Scope); } else { result = new ParseScope(); } scopeStack.Push(result); return result; }