diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-10-26 19:25:07 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-10-26 19:25:07 -0400 |
commit | 71b149ad617a7cbca08a2a7cb8ca5e3b0d8143db (patch) | |
tree | 9dc0ba264561066a9128292b8ba0d34be424232a /dimension/common.rules | |
parent | 3950b4f0d2483cadf006bf2a957aeb820402503a (diff) | |
download | dimension-71b149ad617a7cbca08a2a7cb8ca5e3b0d8143db.tar.xz |
Add torii to dimension.
Diffstat (limited to 'dimension/common.rules')
-rw-r--r-- | dimension/common.rules | 34 |
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 ; |