Class DSLCompiler
java.lang.Object
org.episteme.natural.computing.compiler.DSLCompiler
- All Implemented Interfaces:
Parser.ASTVisitor
A simple DSL compiler that interprets an AST.
Provides basic expression evaluation with variable support and extensible function definitions.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(Parser.ASTNode node) Evaluates an AST.Compiles and executes source code.getVariable(String name) Gets a variable value.voidRegisters a custom function.voidsetVariable(String name, Object value) Sets a variable value.visitCall(Parser.CallNode node)
-
Constructor Details
-
DSLCompiler
public DSLCompiler()
-
-
Method Details
-
registerFunction
-
setVariable
-
getVariable
-
execute
-
evaluate
Evaluates an AST. -
visitProgram
- Specified by:
visitProgramin interfaceParser.ASTVisitor
-
visitExpression
- Specified by:
visitExpressionin interfaceParser.ASTVisitor
-
visitStatement
- Specified by:
visitStatementin interfaceParser.ASTVisitor
-
visitLiteral
- Specified by:
visitLiteralin interfaceParser.ASTVisitor
-
visitIdentifier
- Specified by:
visitIdentifierin interfaceParser.ASTVisitor
-
visitBinaryOp
- Specified by:
visitBinaryOpin interfaceParser.ASTVisitor
-
visitUnaryOp
- Specified by:
visitUnaryOpin interfaceParser.ASTVisitor
-
visitCall
- Specified by:
visitCallin interfaceParser.ASTVisitor
-