compiler, runtime: Begin Runtime Refactor
Ultimately, the goal is to completely separate the compilation from the runtime to make it possible to have the interpreter/evaluator be "just another" entity that can perform meaningful work when given a parsed GP4 program. Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -91,10 +91,14 @@ extension Control: LibraryCallable {
|
||||
}
|
||||
}
|
||||
|
||||
extension Action: EvaluatableStatement {
|
||||
extension Action: P4Statement {
|
||||
public func effect(context: Common.CompilerContext) -> Common.CompilerContext {
|
||||
return context
|
||||
}
|
||||
|
||||
public func evaluate(
|
||||
execution: Common.ProgramExecution
|
||||
) -> (Common.ControlFlow, Common.ProgramExecution) {
|
||||
) -> (ControlFlow, Common.ProgramExecution) {
|
||||
if let body = self.body {
|
||||
return body.evaluate(execution: execution)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user