Package org.pkl.core.ast.builder
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 java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.oracle.truffle.api.frame.FrameDescriptorbuildFrameDescriptor()intgetConstDepth()Returns the lexical depth from the current scope to the top-most scope that is const.ConstLevelgetConstLevel()java.util.Deque<Identifier>getForGeneratorVariables()SymbolTable.ScopegetLexicalScope()IdentifiergetName()@Nullable IdentifiergetNameOrNull()@Nullable SymbolTable.ScopegetParent()java.lang.StringgetQualifiedName()@Nullable TypeParametergetTypeParameter(java.lang.String name)booleanisClassMemberScope()booleanisClassScope()booleanisCustomThisScope()booleanisLambdaScope()booleanisLexicalScope()booleanisModuleScope()voidpopForGeneratorVariable()intpushForGeneratorVariableContext(PklParser.ParameterContext ctx)Adds the for generator variable to the frame descriptor.SymbolTable.ScopeskipLambdaScopes()
-
-
-
Method Detail
-
getParent
public final @Nullable SymbolTable.Scope getParent()
-
getName
public final Identifier getName()
-
getNameOrNull
public final @Nullable Identifier getNameOrNull()
-
getQualifiedName
public final java.lang.String getQualifiedName()
-
buildFrameDescriptor
public com.oracle.truffle.api.frame.FrameDescriptor buildFrameDescriptor()
-
getTypeParameter
public @Nullable TypeParameter getTypeParameter(java.lang.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
-1if a for-generator variable already exists with this name.
-
popForGeneratorVariable
public void popForGeneratorVariable()
-
getForGeneratorVariables
public java.util.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()
-
-