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:
@@ -52,7 +52,7 @@ public struct Declaration: P4Type {
|
||||
return self
|
||||
}
|
||||
public var description: String {
|
||||
return "Extern \(self.identifier)"
|
||||
return self.extern ? "Extern " : "" + "\(self.identifier)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,3 +130,15 @@ public struct FunctionDeclaration: P4Type, P4DataValue {
|
||||
self.body = body
|
||||
}
|
||||
}
|
||||
|
||||
public struct Instantiation {
|
||||
public let name: Identifier
|
||||
public let tipe: P4Type
|
||||
public let arguments: ArgumentList
|
||||
|
||||
public init(named name: Identifier, ofType tipe: P4Type, withArguments arguments: ArgumentList) {
|
||||
self.name = name
|
||||
self.tipe = tipe
|
||||
self.arguments = arguments
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user