Refactor Type System

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-02-06 07:46:18 -05:00
parent bc700509c1
commit c3fdfb62e8
11 changed files with 395 additions and 199 deletions
+9 -1
View File
@@ -20,7 +20,7 @@ public protocol EvaluatableExpression {
/// - Parameters
/// - execution: The execution context in which to evaluate the expression
/// - Returns: The value of expression
func evaluate(execution: ProgramExecution) -> ValueType
func evaluate(execution: ProgramExecution) -> P4Value
}
public protocol EvaluatableParserStatement {
@@ -31,3 +31,11 @@ public protocol EvaluatableParserStatement {
func evaluate(execution: ProgramExecution) -> ProgramExecution
}
public protocol P4Type {
static func create() -> P4Type
}
public protocol P4Value {
func type() -> P4Type
func eq(rhs: P4Value) -> Bool
}