From 5064a7ebce75a26d0405c92040f1a40187fcc7e3 Mon Sep 17 00:00:00 2001 From: kartofen Date: Wed, 2 Jul 2025 22:55:08 +0300 Subject: turn clr into lalr and first steps for generating a parser --- build.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 464d86a..d7b6f33 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,13 @@ set -xe function cc { mkdir -p bin - gcc -Wall -Wextra -Wpedantic -g $2 $1.c -o bin/$(basename $1) + gcc -Wall -Wextra -Wpedantic -I. -g $2 $1.c -o bin/$(basename $1) +} + +function shared +{ + mkdir -p bin + gcc -Wall -Wextra -Wpedantic -I. -shared -fPIC $2 $1.c -o bin/$(basename $1).so } function leak @@ -19,8 +25,11 @@ function leak # cc util-tables -D_UTIL_TABLES_STANDALONE # cc slr-table -D_SLR_TABLE_STANDALONE # cc clr-table -D_CLR_TABLE_STANDALONE +# cc clr-table "-D_CLR_TABLE_STANDALONE -D_LAZY_LALR" # cc lr-parser -D_LR_PARSER_STANDALONE -cc fusion +# cc demos/instant-parser +cc demos/generate-parser +shared demos/sample-files/defs # leak lexer # leak recursive-ascent @@ -29,4 +38,5 @@ cc fusion # leak slr-table # leak clr-table # leak lr-parser -leak fusion +# leak instant-parser +leak "generate-parser bin/defs.so" -- cgit v1.2.3