summaryrefslogtreecommitdiff
path: root/parser.y
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-01 09:48:25 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-01 09:48:25 (GMT)
commit82fad98cb63d6e27e7c156d4c5e4c9a9847abfd1 (patch)
treed70ff76ec4f5138706df5cb11fd034e60d927f4d /parser.y
parent27ecd0b1d0bf0114b465beeb4db482f0f1f87c52 (diff)
Clifford Wolf:
Yet another redesign of the evaluation path git-svn-id: http://svn.clifford.at/openscad/trunk@44 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y28
1 files changed, 17 insertions, 11 deletions
diff --git a/parser.y b/parser.y
index 8006c6a..50cef6e 100644
--- a/parser.y
+++ b/parser.y
@@ -68,13 +68,15 @@ public:
%token LE GE EQ NE AND OR
-%left '+' '-'
+%left '[' ']'
+%left '!' '+' '-'
%left '*' '/' '%'
%left '.'
%left '<' LE GE '>'
%left EQ NE
%left AND
%left OR
+%right '?' ':'
%type <expr> expr
%type <value> vector_const
@@ -165,17 +167,20 @@ single_module_instantciation:
free($1);
delete $3;
} |
- TOK_ID ':' TOK_ID '(' arguments_call ')' {
- $$ = new ModuleInstanciation();
+ TOK_ID ':' single_module_instantciation {
+ $$ = $3;
$$->label = QString($1);
- $$->modname = QString($3);
- $$->argnames = $5->argnames;
- $$->argexpr = $5->argexpr;
free($1);
- free($3);
- delete $5;
- } ;
-
+ } |
+ '!' single_module_instantciation {
+ $$ = $2;
+ $$->tag_root = true;
+ } |
+ '#' single_module_instantciation {
+ $$ = $2;
+ $$->tag_highlight = true;
+ };
+
expr:
TOK_TRUE {
$$ = new Expression();
@@ -365,10 +370,11 @@ expr:
} ;
vector_const:
- TOK_NUMBER {
+ TOK_NUMBER TOK_NUMBER {
$$ = new Value();
$$->type = Value::VECTOR;
$$->vec.append(new Value($1));
+ $$->vec.append(new Value($2));
} |
vector_const TOK_NUMBER {
$$ = $1;
contact: Jan Huwald // Impressum