public final class Symbol extends Object implements Comparable<Symbol>
NativeArguments
objects and parameters stored in Object[]
parameter to variable-arity functions. Those use the #getFieldIndex()
property to refer
to their location.Modifier and Type | Field and Description |
---|---|
static int |
HAS_BEEN_DECLARED
Is this symbol seen a declaration? Used for block scoped LET and CONST symbols only.
|
static int |
IS_ARGUMENTS
Is this symbol the function 'arguments' binding?
|
static int |
IS_BLOCK_FUNCTION_DECLARATION
Is this symbol a block function declaration?
|
static int |
IS_CATCH_PARAMETER
Is this symbol a catch parameter binding?
|
static int |
IS_CLOSED_OVER
Is this symbol closed over by an inner function closure?
|
static int |
IS_CONST
Is this a const binding
|
static int |
IS_DECLARED_IN_SWITCH_BLOCK
Is this symbol declared in an unprotected switch case context?
|
static int |
IS_FUNCTION_SELF
Is this a function self-reference symbol
|
static int |
IS_GLOBAL
Is this a global binding
|
static int |
IS_HOISTABLE_DECLARATION
Is this a hoistable var declaration?
|
static int |
IS_HOISTED_BLOCK_FUNCTION
Is this symbol a block function declaration hoisted into the body scope.
|
static int |
IS_IMPORT_BINDING
Is this symbol an indirect import binding of a module environment?
|
static int |
IS_INTERNAL
Is this an internal symbol, never represented explicitly in source code
|
static int |
IS_LET
Is this a let binding
|
static int |
IS_NEW_TARGET
Is this the
new.target . |
static int |
IS_PARAM
Is this a parameter
|
static int |
IS_PRIVATE_NAME
Is this symbol a private name?
|
static int |
IS_PRIVATE_NAME_ACCESSOR
Is this symbol a private name associated with an accessor?
|
static int |
IS_PRIVATE_NAME_METHOD
Is this symbol a private name associated with a method?
|
static int |
IS_PRIVATE_NAME_STATIC
Is this symbol a private name associated with a static member?
|
static int |
IS_PROGRAM_LEVEL
Is this a program level symbol?
|
static int |
IS_SUPER
Is this the home object, used by super property accesses.
|
static int |
IS_THIS
Is this a this symbol
|
static int |
IS_USED
Is this symbol used?
|
static int |
IS_USED_IN_INNER_SCOPE
Is this symbol used by an inner scope within the same function?
|
static int |
IS_VAR
Is this a var binding
|
static int |
IS_VAR_REDECLARED_HERE
Is this symbol a var declaration binding that needs to be initialized with the value of the
parent's scope's binding with the same name? Used for parameter bindings that are replicated
in the body's VariableEnvironment.
|
static int |
KINDMASK
Mask for kind flags
|
Constructor and Description |
---|
Symbol(com.oracle.truffle.api.strings.TruffleString name,
int flags)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Symbol other) |
int |
getFlags()
Get the symbol flags
|
String |
getName()
Get the name of this symbol
|
com.oracle.truffle.api.strings.TruffleString |
getNameTS() |
boolean |
hasBeenDeclared()
Has this symbol been declared
|
boolean |
isArguments()
Is this symbol the function 'arguments' binding.
|
boolean |
isBlockFunctionDeclaration()
Is this symbol a block function declaration.
|
boolean |
isBlockScoped()
Is this a block scoped symbol
|
boolean |
isCatchParameter() |
boolean |
isClosedOver()
Is this symbol captured by a closure.
|
boolean |
isConst()
Check if this symbol is a constant
|
boolean |
isDeclaredInSwitchBlock()
Has this symbol been declared
|
boolean |
isFunctionSelf()
Flag this symbol as a function's self-referencing symbol.
|
boolean |
isGlobal()
Check if this symbol is a global (undeclared) variable
|
boolean |
isHoistableDeclaration()
Check if this symbol is a hoistable var declaration.
|
boolean |
isHoistedBlockFunctionDeclaration()
Is this symbol a hoisted block function declaration.
|
boolean |
isImportBinding() |
boolean |
isInternal()
Check if this is an internal symbol, without an explicit JavaScript source code equivalent
|
boolean |
isLet()
Check if this symbol is a let
|
boolean |
isNewTarget()
Check if this symbol represents
new.target |
boolean |
isParam()
Check if this symbol is a function parameter
|
boolean |
isPrivateAccessor()
Is this symbol a private name associated with an accessor.
|
boolean |
isPrivateField()
Is this symbol a private name associated with a field.
|
boolean |
isPrivateMethod()
Is this symbol a private name associated with a method.
|
boolean |
isPrivateName()
Is this symbol a private name.
|
boolean |
isPrivateNameStatic()
Is this symbol a private name associated with a static member.
|
boolean |
isProgramLevel()
Check if this is a program (script) level definition
|
boolean |
isSuper()
Check if this symbol represents
super |
boolean |
isThis()
Check if this symbol represents
this |
boolean |
isUsed()
Is this symbol used.
|
boolean |
isUsedInInnerScope()
Is this symbol captured by an inner scope.
|
boolean |
isVar()
Check if this symbol is a variable
|
boolean |
isVarRedeclaredHere() |
void |
setClosedOver()
Mark this symbol as captured by a closure.
|
void |
setHasBeenDeclared()
Mark this symbol as declared
|
void |
setHasBeenDeclared(boolean declared)
Mark this symbol as declared/undeclared
|
void |
setHoistedBlockFunctionDeclaration()
Mark this symbol as a hoisted block function declaration.
|
void |
setUsed()
Mark this symbol as used.
|
void |
setUsedInInnerScope()
Mark this symbol as captured by an inner scope.
|
String |
toString() |
public static final int IS_LET
public static final int IS_CONST
public static final int IS_VAR
public static final int KINDMASK
public static final int IS_GLOBAL
public static final int IS_PARAM
public static final int IS_THIS
public static final int IS_INTERNAL
public static final int IS_FUNCTION_SELF
public static final int IS_HOISTABLE_DECLARATION
public static final int IS_PROGRAM_LEVEL
public static final int HAS_BEEN_DECLARED
public static final int IS_HOISTED_BLOCK_FUNCTION
public static final int IS_VAR_REDECLARED_HERE
public static final int IS_DECLARED_IN_SWITCH_BLOCK
public static final int IS_IMPORT_BINDING
public static final int IS_CATCH_PARAMETER
public static final int IS_BLOCK_FUNCTION_DECLARATION
public static final int IS_PRIVATE_NAME
public static final int IS_PRIVATE_NAME_STATIC
public static final int IS_PRIVATE_NAME_METHOD
public static final int IS_PRIVATE_NAME_ACCESSOR
public static final int IS_ARGUMENTS
public static final int IS_USED
public static final int IS_CLOSED_OVER
public static final int IS_USED_IN_INNER_SCOPE
public static final int IS_SUPER
public static final int IS_NEW_TARGET
new.target
.public Symbol(com.oracle.truffle.api.strings.TruffleString name, int flags)
name
- name of symbolflags
- symbol flagspublic int compareTo(Symbol other)
compareTo
in interface Comparable<Symbol>
public boolean isHoistableDeclaration()
VarNode.isHoistableDeclaration()
public boolean isVar()
public boolean isGlobal()
public boolean isParam()
public boolean isProgramLevel()
public boolean isConst()
public boolean isInternal()
public boolean isThis()
this
public boolean isSuper()
super
public boolean isNewTarget()
new.target
new.target
public boolean isLet()
public boolean isFunctionSelf()
public boolean isBlockScoped()
public boolean hasBeenDeclared()
public void setHasBeenDeclared()
public void setHasBeenDeclared(boolean declared)
public int getFlags()
public String getName()
public com.oracle.truffle.api.strings.TruffleString getNameTS()
public boolean isDeclaredInSwitchBlock()
public boolean isImportBinding()
Symbol.IS_IMPORT_BINDING
public boolean isCatchParameter()
Symbol.IS_CATCH_PARAMETER
public boolean isVarRedeclaredHere()
public boolean isHoistedBlockFunctionDeclaration()
public void setHoistedBlockFunctionDeclaration()
public boolean isBlockFunctionDeclaration()
public boolean isPrivateName()
public boolean isPrivateNameStatic()
public boolean isPrivateField()
public boolean isPrivateMethod()
public boolean isPrivateAccessor()
public boolean isArguments()
public boolean isUsed()
public void setUsed()
public boolean isClosedOver()
public void setClosedOver()
public boolean isUsedInInnerScope()
public void setUsedInInnerScope()