Skip to content

Commit

Permalink
Merge pull request #4345 from Yuehan-Lin/parser
Browse files Browse the repository at this point in the history
Rewrote parser in tril
  • Loading branch information
Leonardo2718 authored Oct 25, 2019
2 parents 6744312 + 393044a commit 7caf559
Show file tree
Hide file tree
Showing 4 changed files with 537 additions and 272 deletions.
17 changes: 1 addition & 16 deletions fvtest/tril/tril/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/modules"
${CMAKE_MODULE_PATH})

include(OmrUtility)
include(FindYACC)
include(FindLEX)

find_package(YACC REQUIRED)
find_package(LEX REQUIRED)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)

list(APPEND TRIL_FLEX_FLAGS)

# There is no unistd.h on Windows, so if win_flex.exe is in use,
# the --wincompat option must be added.
Expand All @@ -43,20 +37,11 @@ if(OMR_HOST_OS STREQUAL "win")
)
endif()

omr_stringify(TRIL_FLEX_OPTIONS ${TRIL_FLEX_FLAGS})
YACC_TARGET(tril_parser tril.y ${CMAKE_CURRENT_BINARY_DIR}/tril.parser.c
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/tril.parser.h)
LEX_TARGET(tril_scanner tril.l ${CMAKE_CURRENT_BINARY_DIR}/tril.scanner.c
COMPILE_FLAGS ${TRIL_FLEX_OPTIONS}
)
ADD_LEX_YACC_DEPENDENCY(tril_scanner tril_parser)

set(TRIL_BACKEND_LIB testcompiler)

add_library(tril STATIC
${YACC_tril_parser_OUTPUTS}
${LEX_tril_scanner_OUTPUTS}
ast.cpp
parser.cpp
ilgen.cpp
simple_compiler.cpp
)
Expand Down
Loading

0 comments on commit 7caf559

Please sign in to comment.