diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0230394 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +.PHONY: test + +#main: +# bake main_generator.c +# # im such a fucking genius +# ./main_generator.out 2>&1 | perl -pe "s/(\[.{1,4}\] = 128)/\x1b[90m\1\x1b[0m/g" +# +# +#test: +# ./main_generator.out > generated.h 2> /dev/null +# bake main.c +# ./main.out + +main: + flex --debug -o scanner_scanner.c source/scanner_scanner.l + g++ -D SCANNER_MAIN -o scanner_scanner.out scanner_scanner.c + ./scanner_scanner.out source/scanner_scanner.l diff --git a/documentation/notes.md b/documentation/notes.md new file mode 100644 index 0000000..78e97c4 --- /dev/null +++ b/documentation/notes.md @@ -0,0 +1,52 @@ +# Rationale +now, as it turns out BF + Flex is unholy. +bf ']' requires moving backwards one way or another. + +flex can in fact not do that in any documented way, + theoretically it should be possible to fuck with + the internal pointers using macros and constantly + emptying the buffers, but that does not sound fun. + +What does sound fun however, is writting a mini-flex + which has only the most surface level features, + BUT is fully hackable, embeded friedly with + minimal memory requirements and a somewhat proper subset of flex. + +Another usage could be to scan unconventional info, + for example command line arguments (without UB). + +# CLI +[ ] --debug (dump tables) +[X] --trace +[ ] --table=[static|switch] + +# Syntax + +```lex + // definition section +%% + // rule section +%% + // code section +``` + +## Definitions +``` +%option