Class SymbolTable.Scope

java.lang.Object
org.pkl.core.ast.builder.SymbolTable.Scope
Direct Known Subclasses:
SymbolTable.AnnotationScope, SymbolTable.CustomThisScope, SymbolTable.EntryScope, SymbolTable.LambdaScope, SymbolTable.ModuleScope, SymbolTable.ObjectScope, SymbolTable.PropertyScope, SymbolTable.TypeParameterizableScope
Enclosing class:
SymbolTable

public abstract static class SymbolTable.Scope extends Object
  • Method Details

    • getParent

      @Nullable public final @Nullable SymbolTable.Scope getParent()
    • getName

      public final Identifier getName()
    • getNameOrNull

      @Nullable public final @Nullable Identifier getNameOrNull()
    • getQualifiedName

      public final String getQualifiedName()
    • buildFrameDescriptor

      public com.oracle.truffle.api.frame.FrameDescriptor buildFrameDescriptor()
    • getTypeParameter

      @Nullable public @Nullable TypeParameter getTypeParameter(String name)
    • getLexicalScope

      public final SymbolTable.Scope getLexicalScope()
    • getConstDepth

      public int getConstDepth()
      Returns the lexical depth from the current scope to the top-most scope that is const. Depth is 0-indexed, and -1 means that the scope is not a const scope.

      A const scope is a lexical scope on the right-hand side of a const property.

      
       const foo = new {
         bar {
           baz // <-- depth == 1
         }
       }
       
    • pushForGeneratorVariableContext

      public int pushForGeneratorVariableContext(PklParser.ParameterContext ctx)
      Adds the for generator variable to the frame descriptor.

      Returns -1 if a for-generator variable already exists with this name.

    • popForGeneratorVariable

      public void popForGeneratorVariable()
    • getForGeneratorVariables

      public Deque<Identifier> getForGeneratorVariables()
    • skipLambdaScopes

      public final SymbolTable.Scope skipLambdaScopes()
    • isModuleScope

      public final boolean isModuleScope()
    • isClassScope

      public final boolean isClassScope()
    • isClassMemberScope

      public final boolean isClassMemberScope()
    • isLambdaScope

      public final boolean isLambdaScope()
    • isCustomThisScope

      public final boolean isCustomThisScope()
    • isLexicalScope

      public final boolean isLexicalScope()
    • getConstLevel

      public ConstLevel getConstLevel()