Ejemplo n.º 1
0
		public Scope NextScope ()
		{
			if (CurrentScope == null)
				CurrentScope = globalScope;
			CurrentScope = CurrentScope.NextScope;
			return CurrentScope;
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Leaves the scope.
		/// </summary>
		/// <returns>The scope.</returns>
		public Scope LeaveScope ()
		{
			Scope old = CurrentScope;
			CurrentScope = old.ParentScope;
			CurrentScope.NextScope = old.NextScope;
			return CurrentScope;
		}
Ejemplo n.º 3
0
		/// <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;
		}
Ejemplo n.º 4
0
		public void AddScope (Scope scope)
		{
			childScopes.Add (scope);
		}
Ejemplo n.º 5
0
		public SymbolTable ()
		{
			CurrentScope = globalScope;
		}
Ejemplo n.º 6
0
		public Scope ()
		{
			ParentScope = null;
		}
Ejemplo n.º 7
0
		public Scope (Scope parent)
		{
			ParentScope = parent;
		}
Ejemplo n.º 8
0
		/// <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;
		}
Ejemplo n.º 9
0
 public SymbolTable()
 {
     CurrentScope = globalScope;
 }
Ejemplo n.º 10
0
 public void AddScope(Scope scope)
 {
     childScopes.Add(scope);
 }
Ejemplo n.º 11
0
 public Scope(Scope parent)
 {
     ParentScope = parent;
 }
Ejemplo n.º 12
0
 public Scope()
 {
     ParentScope = null;
 }