55
66package com .adacore .lkql_jit .nodes .expressions .operators ;
77
8- import com .adacore .libadalang .Libadalang ;
9- import com .adacore .lkql_jit .exception .LKQLRuntimeException ;
108import com .adacore .lkql_jit .nodes .expressions .Expr ;
119import com .adacore .lkql_jit .nodes .patterns .BasePattern ;
12- import com .adacore .lkql_jit .utils .LKQLTypesHelper ;
13- import com .oracle .truffle .api .dsl .Fallback ;
1410import com .oracle .truffle .api .dsl .NodeChild ;
1511import com .oracle .truffle .api .dsl .Specialization ;
1612import com .oracle .truffle .api .frame .VirtualFrame ;
@@ -47,26 +43,14 @@ protected IsClause(SourceSection location, BasePattern pattern) {
4743 // ----- Execution methods -----
4844
4945 /**
50- * Execute the is clause when the expression is a node .
46+ * Execute the "is" clause on the provided value .
5147 *
52- * @param frame The frame to execute the pattern in.
53- * @param node The node to verify.
54- * @return The result of the pattern execution.
48+ * @param object The value to match against the "is" clause pattern.
49+ * @return A boolean, representing whether the given value has been validated by the pattern.
5550 */
5651 @ Specialization
57- protected boolean executeNode (VirtualFrame frame , Libadalang .AdaNode node ) {
58- return this .pattern .executeValue (frame , node );
59- }
60-
61- /**
62- * Fallback method if the left operand is not a node.
63- *
64- * @param notNode The object that is not a node.
65- */
66- @ Fallback
67- protected void notNode (Object notNode ) {
68- throw LKQLRuntimeException .wrongType (
69- LKQLTypesHelper .ADA_NODE , LKQLTypesHelper .fromJava (notNode ), this .getNodeExpr ());
52+ protected boolean executeValue (VirtualFrame frame , Object object ) {
53+ return this .pattern .executeValue (frame , object );
7054 }
7155
7256 // ----- Override methods -----
@@ -78,6 +62,4 @@ protected void notNode(Object notNode) {
7862 public String toString (int indentLevel ) {
7963 return this .nodeRepresentation (indentLevel );
8064 }
81-
82- public abstract Expr getNodeExpr ();
8365}
0 commit comments