Make parser create trees

This commit is contained in:
2019-05-20 11:12:53 -07:00
parent c1e4433011
commit f098f91455
4 changed files with 75 additions and 66 deletions

View File

@@ -7,6 +7,7 @@
#include <stack>
#include <cstdlib>
#include "tree.hpp"
#include "parser.hpp"
/*
@@ -44,8 +45,7 @@ std::stack<int> _indent_stack;
YYLTYPE loc;
#define PUSH_TOKEN(token, text) do { \
yylval = text ? new std::string(text) : NULL; \
loc.first_line = loc.last_line = yylineno; \
yylval.str = text ? new std::string(text) : NULL; \
int status = yypush_parse(pstate, token, &yylval, &loc); \
if (status != YYPUSH_MORE) { \
yypstate_delete(pstate); \