extracted main
This commit is contained in:
parent
8752f4e153
commit
e0b407f8fb
3 changed files with 11 additions and 7 deletions
5
makefile
5
makefile
|
|
@ -5,7 +5,7 @@ FLEX = flex
|
|||
|
||||
TARGET = build/py2rb
|
||||
|
||||
$(TARGET): build/lexer.o build/parser.o build/ParserCtx.o
|
||||
$(TARGET): build/lexer.o build/parser.o build/ParserCtx.o build/main.o
|
||||
$(CXX) $^ -o $@
|
||||
|
||||
build/lexer.hpp build/lexer.cpp: src/lexer.l build/parser.hpp build
|
||||
|
|
@ -23,6 +23,9 @@ build/parser.o: build/parser.cpp build
|
|||
build/ParserCtx.o: src/ParserCtx.cpp build
|
||||
$(CXX) -c $(ARGS) $< -o $@
|
||||
|
||||
build/main.o: src/main.cpp build
|
||||
$(CXX) -c $(ARGS) $< -o $@
|
||||
|
||||
build:
|
||||
mkdir -p build
|
||||
|
||||
|
|
|
|||
7
src/main.cpp
Normal file
7
src/main.cpp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#include "../build/parser.hpp"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Elite::ParserCtx ctx;
|
||||
return ctx.parser->parse();
|
||||
}
|
||||
|
|
@ -74,12 +74,6 @@ program: FUNCTION;
|
|||
|
||||
%%
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Elite::ParserCtx ctx;
|
||||
return ctx.parser->parse();
|
||||
}
|
||||
|
||||
void yy::Parser::error(const yy::location& l, const std::string& m)
|
||||
{
|
||||
std::cerr << l << ": " << m << std::endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue