compiler, runtime: Begin Runtime Refactor
Continuous Integration / Grammar Tests (push) Failing after 39s
Continuous Integration / Library Format Tests (push) Successful in 1m46s
Continuous Integration / Library Tests (push) Successful in 4m38s

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:
Will Hawkins
2026-05-29 08:41:49 -04:00
parent 18461a9215
commit 44e93e4cda
30 changed files with 1264 additions and 854 deletions
+10 -10
View File
@@ -18,9 +18,9 @@
import Common
public struct KeysetExpression {
public let key: EvaluatableExpression
public let key: P4Expression
public init(_ key: EvaluatableExpression) {
public init(_ key: P4Expression) {
self.key = key
}
@@ -65,11 +65,11 @@ public struct SelectCaseExpression {
}
public struct SelectExpression {
public let selector: EvaluatableExpression
public let selector: P4Expression
public let case_expressions: [SelectCaseExpression]
public init(
withSelector selector: EvaluatableExpression,
withSelector selector: P4Expression,
withSelectCaseExpressions sces: [SelectCaseExpression]
) {
self.selector = selector
@@ -105,13 +105,13 @@ public struct BinaryOperatorExpression {
}
public struct ArrayAccessExpression {
public let indexor: EvaluatableExpression
public let name: EvaluatableExpression
public let indexor: P4Expression
public let name: P4Expression
public let type: P4Array
public init(
withName name: EvaluatableExpression, withType type: P4Array,
withIndexor indexor: EvaluatableExpression
withName name: P4Expression, withType type: P4Array,
withIndexor indexor: P4Expression
) {
self.name = name
self.type = type
@@ -121,9 +121,9 @@ public struct ArrayAccessExpression {
public struct FieldAccessExpression {
public let field: P4StructFieldIdentifier
public let strct: EvaluatableExpression
public let strct: P4Expression
public init(withStruct strct: EvaluatableExpression, withField field: P4StructFieldIdentifier) {
public init(withStruct strct: P4Expression, withField field: P4StructFieldIdentifier) {
self.strct = strct
self.field = field
}