Yan LR: Consider token file for code generation
@@ -32,6 +32,7 @@ if (DEPENDENCY_PHASE)
set (GRAMMAR_NAME YAML)
set (GRAMMAR_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${GRAMMAR_NAME}.g4)
+ set (TOKEN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${GRAMMAR_NAME}.tokens)
set (GENERATED_SOURCE_FILES_NAMES BaseListener Listener)
foreach (file ${GENERATED_SOURCE_FILES_NAMES} "")
set (filepath ${CMAKE_CURRENT_BINARY_DIR}/${GRAMMAR_NAME}${file}.cpp)
@@ -54,6 +55,7 @@ if (DEPENDENCY_PHASE)
add_custom_command (OUTPUT ${GENERATED_SOURCE_FILES}
COMMAND ${ANTLR_EXECUTABLE} -Werror -Dlanguage=Cpp -o ${CMAKE_CURRENT_BINARY_DIR} -package antlr ${GRAMMAR_FILE}
DEPENDS ${GRAMMAR_FILE}
+ ${TOKEN_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif (DEPENDENCY_PHASE)
