Package org.pkl.core.ast.type
Class TypeNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
org.pkl.core.ast.PklNode
org.pkl.core.ast.type.TypeNode
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface,Cloneable
- Direct Known Subclasses:
TypeNode.ConstrainedTypeNode,TypeNode.FrameSlotTypeNode,TypeNode.NothingTypeNode,TypeNode.TypeAliasTypeNode,TypeNode.WriteFrameSlotTypeNode
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic classstatic final classstatic final classstatic final classA non-open and non-abstract class type.static final classThe `module` type for a final module.static final classstatic classBase class for types whose `executeAndSet` method assigns values to slots with `frame.setXYZ(slot, value)`.static classstatic classstatic classstatic final classstatic final classstatic final classstatic classstatic final classstatic classstatic classstatic classstatic classstatic classstatic classAn `open` or `abstract` class type.static final classThe `module` type for an open module.static final classstatic final classThe `nothing` type.static classstatic final classstatic classstatic classstatic classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classThe `unknown` type.static classstatic classBase class for types whose `executeAndSet` method assigns values to slots with a `WriteFrameSlotNode`.Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children -
Field Summary
Fields inherited from class org.pkl.core.ast.PklNode
sourceSection -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTypeNode(com.oracle.truffle.api.source.SourceSection sourceSection) -
Method Summary
Modifier and TypeMethodDescriptioncreateDefaultValue(VmLanguage language, com.oracle.truffle.api.source.SourceSection headerSection, String qualifiedName) protected PTypedoExport()abstract voidChecks if `value` conforms to this type.abstract voidexecuteAndSet(com.oracle.truffle.api.frame.VirtualFrame frame, Object value) Checks if `value` conforms to this type.static PTypestatic TypeNodeabstract com.oracle.truffle.api.frame.FrameSlotKindstatic VmTypedstatic VmListgetMirrors(TypeNode[] nodes) abstract TypeNodeinitWriteSlotNode(int slot) Initializes this node's frame slot.booleanprotected final VmTypeMismatchExceptiontypeMismatch(Object actualValue, Object expectedType) Methods inherited from class org.pkl.core.ast.PklNode
exceptionBuilder, getShortName, getSourceSection, toStringMethods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize
-
Constructor Details
-
TypeNode
protected TypeNode(com.oracle.truffle.api.source.SourceSection sourceSection)
-
-
Method Details
-
isNoopTypeCheck
public boolean isNoopTypeCheck() -
getFrameSlotKind
public abstract com.oracle.truffle.api.frame.FrameSlotKind getFrameSlotKind() -
initWriteSlotNode
Initializes this node's frame slot. Called if this node is a function/method parameter type. Kept separate from constructor so thatTypeNode.TypeAliasTypeNodecan initialize frame slot of its cloned child node. -
execute
Checks if `value` conforms to this type. If so, returns normally. Otherwise, throws a `VmTypeMismatchException`. -
executeAndSet
Checks if `value` conforms to this type. If so, sets `slot` to `value`. Otherwise, throws a `VmTypeMismatchException`. -
createDefaultValue
@Nullable public @Nullable Object createDefaultValue(VmLanguage language, com.oracle.truffle.api.source.SourceSection headerSection, String qualifiedName) -
forClass
-
export
-
getMirror
-
getMirrors
-
doExport
-
getVmClass
-
getVmTypeAlias
-
getMirror
-
getTypeArgumentMirrors
-
typeMismatch
-