pratt: add parser
This is based on C's operator precedence rules
This commit is contained in:
commit
83c75de773
5 changed files with 372 additions and 0 deletions
22
Makefile
Normal file
22
Makefile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
CC = gcc
|
||||
CPPFLAGS = -Isrc/ -D_POSIX_C_SOURCE=200809L
|
||||
VPATH = src/
|
||||
CFLAGS = -Wall -Wextra -pedantic -Werror -std=c99
|
||||
USE_CLIMBING = 1
|
||||
|
||||
SRC = \
|
||||
src/eval.c \
|
||||
|
||||
BIN = pratt
|
||||
OBJ = $(SRC:.c=.o)
|
||||
|
||||
.PHONY: all
|
||||
all: $(BIN)
|
||||
|
||||
$(BIN):
|
||||
$(BIN): $(OBJ) src/pratt.o
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) $(OBJ) # remove object files
|
||||
$(RM) $(BIN) # remove main program
|
||||
Loading…
Add table
Add a link
Reference in a new issue