Commit graph

4 commits

Author SHA1 Message Date
53a904e0b0 v2: Add public Interpret(string) with soft-error semantics and elapsed time
Implements developer-facing Interpret API that:

- Parses and executes input via generated Scanner/Parser and current interpreter state.
- Returns the numeric result (decimal) and updates NumericValue/StringValue.
- Emits soft errors: never throws; on error sets NumericValue=0 and StringValue to parser error format or exception message.
- Restores LastExecutionTime measurement for the previous interpretation.

This preserves the original nomenclature while aligning to v2’s FunctionValue model.
2025-08-19 04:31:53 -05:00
c5f35b9d34 v2: Wire InputInterpreter runtime APIs for v2 grammar
Add in-memory stores and APIs required by the v2 Coco/R grammar:

- Variables: AssignNumeric, AssignExpression, AssignNumericArray; TryGetNumeric, TryGetExpression, TryGetNumericArray.
- Mixed-arg function dispatch: ExecuteFunction(name, FunctionArgument[]), plus RegisterFunction.
- Expression evaluation for :=: EvaluateExpression(expressionText) via generated Scanner/Parser with a child interpreter sharing stores.
- Output handling preserved: ProduceOutput(FunctionValue) updates NumericValue/StringValue.

These changes allow the generated parser to compile and run against the v2 runtime, enforcing the numeric-first, strings-as-arguments-only model.
2025-08-19 03:51:05 -05:00
eb3bbcb69e Check in 2025-06-12 04:32:18 -05:00
5066257912 Initial commit
checkpoint only
2025-06-12 02:18:27 -05:00