cppast
Class Scope

java.lang.Object
  extended by cppast.Scope

public final class Scope
extends java.lang.Object

Represents a scope.

Author:
Mathieu Champlon

Constructor Summary
Scope()
          Creates an unnamed empty scope.
 
Method Summary
 Scope close()
          Close the scope.
 Scope createScope(java.lang.String name)
          Create a sub-scope to the scope.
 void extend(Scope scope)
          Extend the scope with another one.
 Scope getScope(java.lang.String name)
          Retrieve the scope of a given name.
 java.lang.String resolve(java.lang.String name)
          Resolve a name into the scope.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Scope

public Scope()
Creates an unnamed empty scope.

Method Detail

createScope

public Scope createScope(java.lang.String name)
Create a sub-scope to the scope.

Parameters:
name - the name of the sub-scope
Returns:
the new sub-scope

extend

public void extend(Scope scope)
Extend the scope with another one.

Types from the given scope are added to the extended scope.

Parameters:
scope - the scope to merge into the current scope

getScope

public Scope getScope(java.lang.String name)
Retrieve the scope of a given name.

Parameters:
name - the name of the scope
Returns:
the matching scope

close

public Scope close()
Close the scope.

Returns:
the parent scope

resolve

public java.lang.String resolve(java.lang.String name)
Resolve a name into the scope.

Parameters:
name - the name
Returns:
the fully scoped name

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2006-2007 null. All Rights Reserved.