Mercurial > lbo > hg > ylisp
changeset 46:e753d447a3e6
gen/lex: Recognize ID vs. atom
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Thu, 22 Aug 2019 10:50:15 +0200 |
parents | 828d3b58f2cf |
children | ff71c61a3cf9 |
files | gen/CMakeLists.txt gen/y.lex |
diffstat | 2 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/CMakeLists.txt Thu Aug 22 10:49:49 2019 +0200 +++ b/gen/CMakeLists.txt Thu Aug 22 10:50:15 2019 +0200 @@ -9,4 +9,5 @@ ADD_EXECUTABLE(debug_parser debug_parser.c ${FLEX_lexer_OUTPUTS} ${BISON_parser_OUTPUTS}) ADD_EXECUTABLE(debug_lexer debug_lexer.c ${FLEX_lexer_OUTPUTS}) +TARGET_LINK_LIBRARIES(debug_lexer core base) TARGET_LINK_LIBRARIES(debug_parser core base)
--- a/gen/y.lex Thu Aug 22 10:49:49 2019 +0200 +++ b/gen/y.lex Thu Aug 22 10:50:15 2019 +0200 @@ -18,7 +18,8 @@ LEFTP "(" RIGHTP ")" NUMBER -?[1-9][0-9]* -ATOM [a-z+*/-][a-z0-9]* +ATOM '[a-z+*/-][a-z0-9]* +ID [a-z+*/-][a-z0-9]* STRING_LIT \"[[:alnum:][:blank:][:punct:]]*\" %% @@ -28,6 +29,7 @@ {RIGHTP} { return TOK_RIGHTP; } {NUMBER} { yylval->number = atoll(yytext); return TOK_NUMBER_LITERAL; } {ATOM} { yylval->atom = strdup(yytext); return TOK_ATOM; } +{ID} { yylval->ref = yref_new_c(yytext); return TOK_ID; } {STRING_LIT} { yylval->string = strdup(yytext); return TOK_STRING_LITERAL; } %%