From f3e3e3e354b87f4ce27bd74bf14cec05d06974b6 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 30 Nov 2022 12:23:17 +0100 Subject: Lots of cleanup and stuff --- 2015/23/Makefile | 10 ++-------- 2015/23/puzzles.l | 23 +++++++++++------------ 2 files changed, 13 insertions(+), 20 deletions(-) (limited to '2015/23') diff --git a/2015/23/Makefile b/2015/23/Makefile index 8779ec0..b65503c 100644 --- a/2015/23/Makefile +++ b/2015/23/Makefile @@ -1,9 +1,3 @@ -all: - flex -f -DYY_NO_INPUT --nounput puzzles.l - ${CC} ${CFLAGS} -lfl -DPROGLEN=`wc -l #include #include @@ -38,17 +37,17 @@ unsigned long long registers[2]; %% -hlf { program[i].type = HLF; BEGIN(ARGS); } -inc { program[i].type = INC; BEGIN(ARGS); } -jie { program[i].type = JIE; BEGIN(ARGS); } -jio { program[i].type = JIO; BEGIN(ARGS); } -jmp { program[i].type = JMP; BEGIN(ARGS); } -tpl { program[i].type = TPL; BEGIN(ARGS); } - -[ab] { program[i].reg = *yytext - 'a'; } -[+\-][0-9]+ { program[i].imm = atoi(yytext); } -[ ,]+ { ; } -\n { i++; BEGIN(INITIAL); } +hlf { program[i].type = HLF; BEGIN(ARGS); } +inc { program[i].type = INC; BEGIN(ARGS); } +jie { program[i].type = JIE; BEGIN(ARGS); } +jio { program[i].type = JIO; BEGIN(ARGS); } +jmp { program[i].type = JMP; BEGIN(ARGS); } +tpl { program[i].type = TPL; BEGIN(ARGS); } + +[ab] { program[i].reg = *yytext - 'a'; } +[+\-][0-9]+ { program[i].imm = atoi(yytext); } +[ ,]+ { ; } +\n { i++; BEGIN(INITIAL); } %% -- cgit v1.2.3