Class ProbeDirective
java.lang.Object
org.ek9lang.compiler.directives.ProbeDirective
- All Implemented Interfaces:
Directive
To be used in EK9 source code to assert that the Oracle query at a specific line
produces the expected JSON output. This validates the exact data an LLM would receive
when querying the compiler about a symbol via MCP or the ek9 -ai REPL.
@Probe: PRE_IR_CHECKS: `{"name":"Counter","genus":"CLASS"}`
The directive applies to the next line in the source — the line where the symbol
is declared. The listener resolves the symbol at that line using LocationResolver,
extracts symbol info via SymbolInfoExtractor, and compares the JSON output
line-by-line against the expected JSON.-
Constructor Summary
ConstructorsConstructorDescriptionProbeDirective(IToken token, CompilationPhase phase, String expectedJson, int lineNumber) A new probe directive for Oracle JSON validation. -
Method Summary
Modifier and TypeMethodDescriptionintWhich line number does this directive apply to.Provide a token from the source, by default if not possible supply synthetic.booleanisForPhase(CompilationPhase phase) Is it for the particular compiler phase.toString()type()What s the type of the directive.
-
Constructor Details
-
ProbeDirective
A new probe directive for Oracle JSON validation.
-
-
Method Details
-
type
Description copied from interface:DirectiveWhat s the type of the directive. -
isForPhase
Description copied from interface:DirectiveIs it for the particular compiler phase.- Specified by:
isForPhasein interfaceDirective
-
getExpectedJson
-
getDirectiveToken
Description copied from interface:DirectiveProvide a token from the source, by default if not possible supply synthetic.- Specified by:
getDirectiveTokenin interfaceDirective
-
getAppliesToLineNumber
public int getAppliesToLineNumber()Description copied from interface:DirectiveWhich line number does this directive apply to.- Specified by:
getAppliesToLineNumberin interfaceDirective
-
toString
-