From 71b149ad617a7cbca08a2a7cb8ca5e3b0d8143db Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 26 Oct 2010 19:25:07 -0400 Subject: Add torii to dimension. --- dimension/common.rules | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'dimension/common.rules') 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 ; -- cgit v1.2.3