Class ScopeStack


  • public class ScopeStack
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ScopeStack()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void closeScope()  
      java.lang.String declareVariable​(java.lang.Object key, java.lang.String proposedName, boolean synthetic)  
      java.lang.String declareVariable​(java.lang.Object key, java.lang.String proposedName, boolean synthetic, boolean withUniqueName)
      provides and registers a fresh variable in the current scope.
      protected java.lang.String findNewName​(java.util.Set<java.lang.String> names, java.lang.String proposedName)  
      java.lang.Object get​(java.lang.String name)  
      java.lang.String getName​(java.lang.Object referenced)  
      void openScope​(boolean pseudoScope)  
      java.lang.String removeName​(java.lang.Object referenced)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScopeStack

        public ScopeStack()
    • Method Detail

      • openScope

        public void openScope​(boolean pseudoScope)
      • closeScope

        public void closeScope()
      • get

        public java.lang.Object get​(java.lang.String name)
      • getName

        public java.lang.String getName​(java.lang.Object referenced)
      • removeName

        public java.lang.String removeName​(java.lang.Object referenced)
                                    throws java.lang.IllegalStateException
        Throws:
        java.lang.IllegalStateException - if the referenced object does not have a name in the current scope.
      • declareVariable

        public java.lang.String declareVariable​(java.lang.Object key,
                                                java.lang.String proposedName,
                                                boolean synthetic)
      • declareVariable

        public java.lang.String declareVariable​(java.lang.Object key,
                                                java.lang.String proposedName,
                                                boolean synthetic,
                                                boolean withUniqueName)
        provides and registers a fresh variable in the current scope. It takes parent scopes into account and only reuses names of synthetic variables from parent scopes. Pseudo scopes are treated as if they were part of their parent scope.
        Parameters:
        withUniqueName - This is a workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=445949
      • findNewName

        protected java.lang.String findNewName​(java.util.Set<java.lang.String> names,
                                               java.lang.String proposedName)