summaryrefslogtreecommitdiffstats
path: root/dimension/common.rules
diff options
context:
space:
mode:
Diffstat (limited to 'dimension/common.rules')
-rw-r--r--dimension/common.rules34
1 files changed, 34 insertions, 0 deletions
diff --git a/dimension/common.rules b/dimension/common.rules
index 040f4a6..dc8d0b3 100644
--- a/dimension/common.rules
+++ b/dimension/common.rules
@@ -286,6 +286,7 @@ FINITE_SOLID_OBJECT: BOX
| CONE
| CYLINDER
| SPHERE
+ | TORUS
;
BOX: "box" "{"
@@ -328,6 +329,7 @@ MAYBE_OPEN: /* empty */ {
| "open" {
$$ = dmnsn_new_ast_integer(true);
}
+;
SPHERE: "sphere" "{"
VECTOR "," FLOAT
@@ -339,6 +341,38 @@ SPHERE: "sphere" "{"
}
;
+TORUS: "torus" "{"
+ FLOAT "," FLOAT
+ TORUS_MODIFIERS
+ "}"
+ {
+ dmnsn_astnode object = dmnsn_new_astnode2(DMNSN_AST_TORUS, @$, $3, $5);
+ $$ = dmnsn_new_astnode2(DMNSN_AST_OBJECT, @$, object, $6);
+ }
+;
+
+TORUS_MODIFIERS: /* empty */ {
+ $$ = dmnsn_new_astnode(DMNSN_AST_OBJECT_MODIFIERS, @$);
+ }
+ | TORUS_MODIFIERS OBJECT_MODIFIER {
+ $$ = $1;
+ dmnsn_array_push($$.children, &$2);
+ }
+ | TORUS_MODIFIERS "sturm" {
+ dmnsn_diagnostic(@2,
+ "WARNING: Dimension does not use 'sturm';"
+ " ignored.");
+ $$ = $1;
+ }
+ | TORUS_MODIFIERS "sturm" FLOAT {
+ dmnsn_diagnostic(@2,
+ "WARNING: Dimension does not use 'sturm';"
+ " ignored.");
+ dmnsn_delete_astnode($3);
+ $$ = $1;
+ }
+;
+
INFINITE_SOLID_OBJECT: PLANE
;