Skip to content

Commit

Permalink
fix: whitespace matcher and makefile
Browse files Browse the repository at this point in the history
\s literally matches "s" in flex regex, not the whitespace char class,
and do not emit a windows executable extension
  • Loading branch information
SantriptaSharma committed Oct 8, 2023
1 parent 5bbde42 commit 08fe105
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ lexer.c
*.fls
*.log
*.synctex*
*.zip

# redundant files
*_old.*
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ o=lexer
team=recursive-dissent
assignment=2

build: clean $(o).exe
build: clean $(o)

$(o).exe: $(o).c
$(CC) -o $(o).exe $^ $(team)_A$(assignment).c
$(o): $(o).c
$(CC) -o $(o) $^ $(team)_A$(assignment).c

$(o).c: $(team)_A$(assignment).l
$(l) -o$(o).c $^

clean:
rm -rf $(o).*

test: $(o).exe
./$(o).exe < $(team)_A$(assignment).nc
test: $(o)
./$(o) < $(team)_A$(assignment).nc

.PHONY: default clean test build
2 changes: 1 addition & 1 deletion recursive-dissent_A2.l
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ COMMENTMULTI \/\*([^\*]|\*[^\/])*\*\/

{COMMENTSINGLE}|{COMMENTMULTI} {return 1;}

[ \s\n\t]* {return 1;}
[ \n\t]* {return 1;}

. { return 0; }

Expand Down
3 changes: 3 additions & 0 deletions recursive-dissent_A2.nc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ int d = -00045; //invalid actually

int _valididentifier_ = +1;

swap
top

int *ptr = &d;
int *ptrptr = &ptr;
**ptr++;
Expand Down
Binary file added recursive-dissent_A2.pdf
Binary file not shown.

0 comments on commit 08fe105

Please sign in to comment.