Class IdentNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Expression
com.oracle.js.parser.ir.IdentNode
- All Implemented Interfaces:
FunctionCall, PropertyKey, Cloneable
IR representation for an identifier.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionIdentNode(long token, int finish, com.oracle.truffle.api.strings.TruffleString name) Constructor -
Method Summary
Modifier and TypeMethodDescriptionaccept(NodeVisitor<? extends LexicalContext> visitor) Assist in IR navigation.<R> Raccept(TranslatorNodeVisitor<? extends LexicalContext, R> visitor) Provides a means to navigate the IR.getName()Get the name of the identifiercom.oracle.truffle.api.strings.TruffleStringGet the property name.com.oracle.truffle.api.strings.TruffleStringReturn the Symbol the compiler has assigned to this identifier.booleanbooleanbooleanbooleanIs this IdentNode declared here?booleanbooleanReturns true if the value of this expression will be treated as a function and immediately invoked.booleanbooleanbooleanHelper function for local def analysis.booleanIs this an internal symbol, i.e.booleanbooleanbooleanbooleanbooleanCheck if this IdentNode is a property namebooleanbooleanisSuper()booleanisThis()Flag this IdentNode as being declared here.Flag IdentNode to be initialized on creationFlag this IdentNode as a property namevoidtoString(StringBuilder sb, boolean printType) Print logic that decides whether to show the optimistic type or not - for example it should not be printed after just parse, when it hasn't been computed, or has been set to a trivially provable valueMethods inherited from class Expression
getFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isAlwaysFalse, isAlwaysTrue, isParenthesized, isSelfModifying, makeParenthesizedMethods inherited from class Node
clone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Constructor Details
-
IdentNode
public IdentNode(long token, int finish, com.oracle.truffle.api.strings.TruffleString name) Constructor- Parameters:
token- tokenfinish- finish positionname- name of identifier
-
-
Method Details
-
accept
Assist in IR navigation. -
accept
Description copied from class:NodeProvides a means to navigate the IR. -
toString
Description copied from class:NodePrint logic that decides whether to show the optimistic type or not - for example it should not be printed after just parse, when it hasn't been computed, or has been set to a trivially provable value -
getName
-
getNameTS
public com.oracle.truffle.api.strings.TruffleString getNameTS() -
getPropertyName
Description copied from interface:PropertyKeyGet the property name.- Specified by:
getPropertyNamein interfacePropertyKey- Returns:
- the property name
-
getPropertyNameTS
public com.oracle.truffle.api.strings.TruffleString getPropertyNameTS()- Specified by:
getPropertyNameTSin interfacePropertyKey
-
getSymbol
Return the Symbol the compiler has assigned to this identifier. The symbol is a description of the storage location for the identifier.- Returns:
- the symbol
-
isPropertyName
public boolean isPropertyName()Check if this IdentNode is a property name- Returns:
- true if this is a property name
-
setIsPropertyName
Flag this IdentNode as a property name- Returns:
- a node equivalent to this one except for the requested change.
-
isInitializedHere
public boolean isInitializedHere()Helper function for local def analysis.- Returns:
- true if IdentNode is initialized on creation
-
setIsInitializedHere
Flag IdentNode to be initialized on creation- Returns:
- a node equivalent to this one except for the requested change.
-
isDeclaredHere
public boolean isDeclaredHere()Is this IdentNode declared here?- Returns:
- true if identifier is declared here
-
setIsDeclaredHere
Flag this IdentNode as being declared here.- Returns:
- a new IdentNode equivalent to this but marked as declared here.
-
isFunction
public boolean isFunction()Description copied from interface:FunctionCallReturns true if the value of this expression will be treated as a function and immediately invoked.- Specified by:
isFunctionin interfaceFunctionCall
-
isInternal
public boolean isInternal()Is this an internal symbol, i.e. one that starts with ':'. Those can never be optimistic.- Returns:
- true if internal symbol
-
isThis
public boolean isThis() -
setIsThis
-
isSuper
public boolean isSuper() -
setIsSuper
-
isDirectSuper
public boolean isDirectSuper() -
setIsDirectSuper
-
isRestParameter
public boolean isRestParameter() -
setIsRestParameter
-
isCatchParameter
public boolean isCatchParameter() -
setIsCatchParameter
-
isNewTarget
public boolean isNewTarget() -
setIsNewTarget
-
isImportMeta
public boolean isImportMeta() -
setIsImportMeta
-
isMetaProperty
public boolean isMetaProperty() -
setIsArguments
-
isArguments
public boolean isArguments() -
setIsApplyArguments
-
isApplyArguments
public boolean isApplyArguments() -
setIsPrivate
-
isPrivate
public boolean isPrivate() -
setIsPrivateInCheck
-
isPrivateInCheck
public boolean isPrivateInCheck() -
setIsIgnoredParameter
-
isIgnoredParameter
public boolean isIgnoredParameter()
-