From 8752f4e153ebe14ab5c52844e4bc27c0798b5528 Mon Sep 17 00:00:00 2001 From: bronku Date: Tue, 18 Nov 2025 15:39:35 +0100 Subject: [PATCH] some fixes --- makefile | 21 ++++++++++++++++----- src/parser.y | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 12c06fd..e7da31d 100644 --- a/makefile +++ b/makefile @@ -8,17 +8,28 @@ TARGET = build/py2rb $(TARGET): build/lexer.o build/parser.o build/ParserCtx.o $(CXX) $^ -o $@ -build/lexer.hpp build/lexer.cpp: src/lexer.l build/parser.hpp +build/lexer.hpp build/lexer.cpp: src/lexer.l build/parser.hpp build $(FLEX) --header-file=build/lexer.hpp -o build/lexer.cpp src/lexer.l -build/parser.hpp build/parser.cpp: src/parser.y +build/parser.hpp build/parser.cpp: src/parser.y build $(BISON) -d -v -o build/parser.cpp src/parser.y -build/lexer.o: build/lexer.cpp +build/lexer.o: build/lexer.cpp build $(CXX) -c $(ARGS) $< -o $@ -build/parser.o: build/parser.cpp +build/parser.o: build/parser.cpp build $(CXX) -c $(ARGS) $< -o $@ -build/ParserCtx.o: src/ParserCtx.cpp +build/ParserCtx.o: src/ParserCtx.cpp build $(CXX) -c $(ARGS) $< -o $@ + +build: + mkdir -p build + +clean: + rm -rf build + +run: $(TARGET) + $(TARGET) + +.PHONY: clean run diff --git a/src/parser.y b/src/parser.y index 898b71e..507b5e4 100644 --- a/src/parser.y +++ b/src/parser.y @@ -9,7 +9,7 @@ %defines /* namespace to enclose parser in */ -%name-prefix="yy" +%define api.prefix {yy} /* set the parser's class identifier */ %define api.parser.class {Parser}