compiler: Flesh Out CST Visitor Framework
As a use case, use it to implement text serialization of the CST. Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -22,15 +22,16 @@ extension P4Value: CST.Categories.Expression {}
|
||||
public struct CST {
|
||||
|
||||
public struct Categories {
|
||||
public protocol Expression {}
|
||||
public protocol Statement {}
|
||||
public protocol State {}
|
||||
public protocol LanguageElement {}
|
||||
public protocol Expression: Categories.LanguageElement {}
|
||||
public protocol Statement : Categories.LanguageElement {}
|
||||
public protocol State : Categories.LanguageElement {}
|
||||
public protocol Declaration: Categories.Statement {}
|
||||
}
|
||||
|
||||
struct Expression {}
|
||||
|
||||
public struct Statements {
|
||||
public struct Statements: Categories.Statement {
|
||||
public let statements: [Categories.Statement]
|
||||
|
||||
public init(_ s: [Categories.Statement]) {
|
||||
|
||||
Reference in New Issue
Block a user