summaryrefslogtreecommitdiff
path: root/parser.y
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-06-21 06:53:46 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-06-21 06:53:46 (GMT)
commit1c2472067c3843342f56b5833c284106ab349417 (patch)
treefd6f914e8cf19337a14b9663b6bda4a6642b8a70 /parser.y
parente416017c5e0ef689e9fbc43b520632cde7927c26 (diff)
Clifford Wolf:
Improved backend data structures Added dump feature to backend data git-svn-id: http://svn.clifford.at/openscad/trunk@4 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y17
1 files changed, 15 insertions, 2 deletions
diff --git a/parser.y b/parser.y
index 241bf17..b23b0d4 100644
--- a/parser.y
+++ b/parser.y
@@ -21,15 +21,16 @@
%{
#include "openscad.h"
-#include <stdio.h>
-extern int parserdebug;
int parserlex(void);
void yyerror(char const *s);
int lexerget_lineno(void);
int lexerlex(void);
+QVector<Module*> module_stack;
+Module *module;
+
%}
%union {
@@ -117,3 +118,15 @@ void yyerror (char const *s)
exit(1);
}
+AbstractModule *parse(FILE *f, int debug)
+{
+ module_stack.clear();
+ module = new Module();
+ module_stack.append(module);
+
+ parserdebug = debug;
+ parserparse();
+
+ return module;
+}
+
contact: Jan Huwald // Impressum