Skip to content

Commit 1c828c8

Browse files
committed
Squashed 'libs/EXTERNAL/libblifparse/' changes from 4bbe247..dcd0f72
dcd0f72 Add tests. Run with 'make && make test' 799f2ee Allow blank .attr and .param values when parsing EBLIF git-subtree-dir: libs/EXTERNAL/libblifparse git-subtree-split: dcd0f729fe44489c11a9ff4a62f33cc5b76482ca
1 parent 74bd10b commit 1c828c8

File tree

9 files changed

+29125
-2
lines changed

9 files changed

+29125
-2
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,11 @@ set_target_properties(libblifparse PROPERTIES PREFIX "") #Avoid extra 'lib' pref
4949
add_executable(blifparse_test src/main.cpp)
5050
target_link_libraries(blifparse_test libblifparse)
5151

52+
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
53+
#Add the tests if we are the root project
54+
enable_testing()
55+
add_test(NAME test_parse_blif
56+
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test/test_parser.sh ${CMAKE_CURRENT_SOURCE_DIR}/test/*/*.blif ${CMAKE_CURRENT_SOURCE_DIR}/test/*/*.eblif)
57+
endif()
58+
5259
install(TARGETS libblifparse blifparse_test DESTINATION bin)

src/blif_parser.y

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ string_list: /*empty*/ { $$ = std::vector<std::string>(); }
248248
conn: DOT_CONN STRING STRING { $$ = Conn(); $$.src = $2; $$.dst = $3; }
249249
cname: DOT_CNAME STRING { $$ = Cname(); $$.name = $2; }
250250
attr: DOT_ATTR STRING STRING { $$ = Attr(); $$.name = $2; $$.value = $3; }
251+
| DOT_ATTR STRING { $$ = Attr(); $$.name = $2; $$.value = ""; }
251252
param: DOT_PARAM STRING STRING { $$ = Param(); $$.name = $2; $$.value = $3; }
253+
| DOT_PARAM STRING { $$ = Param(); $$.name = $2; $$.value = ""; }
252254

253255
%%
254256

0 commit comments

Comments
 (0)