mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Instead of creating syntax nodes directly, modify the parser to invoke an abstract interface 'SyntaxParseActions' while it is parsing the source code. This decouples the act of parsing from the act of forming a syntax tree representation. 'SyntaxTreeCreator' is an implementation of SyntaxParseActions that handles the logic of creating a syntax tree. To enforce the layering separation of parsing and syntax tree creation, a static library swiftSyntaxParse is introduced to compose the two. This decoupling is important for introducing a syntax parser library for SwiftSyntax to directly access parsing.
17 lines
517 B
CMake
17 lines
517 B
CMake
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
|
|
set(SWIFT_GYB_FLAGS --line-directive "^\"#line %(line)d \\\"%(file)s\\\"^\"")
|
|
else()
|
|
set(SWIFT_GYB_FLAGS --line-directive "\'#line" "%(line)d" "\"%(file)s\"\'")
|
|
endif()
|
|
|
|
set(generated_include_sources
|
|
ParsedSyntaxBuilders.h.gyb
|
|
ParsedSyntaxNodes.h.gyb
|
|
ParsedSyntaxRecorder.h.gyb
|
|
)
|
|
|
|
add_gyb_target(swift-parse-syntax-generated-headers
|
|
"${generated_include_sources}")
|
|
set_property(TARGET swift-parse-syntax-generated-headers
|
|
PROPERTY FOLDER "Miscellaneous")
|