summaryrefslogtreecommitdiffstats
path: root/dimension/common.rules
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-08-15 00:22:47 -0600
committerTavian Barnes <tavianator@gmail.com>2010-08-15 00:22:47 -0600
commite0efc5ef27039f03be4783d593508ea7480aa4d0 (patch)
treeec3f69ad6d79ce1378fa6cdd7545d6b6901c2e3c /dimension/common.rules
parent8fed0cea862554f1d8316c2244e6d94f691abad6 (diff)
downloaddimension-e0efc5ef27039f03be4783d593508ea7480aa4d0.tar.xz
Add cylinder support to dimension.
Diffstat (limited to 'dimension/common.rules')
-rw-r--r--dimension/common.rules20
1 files changed, 20 insertions, 0 deletions
diff --git a/dimension/common.rules b/dimension/common.rules
index 89b7ab8..e5e6543 100644
--- a/dimension/common.rules
+++ b/dimension/common.rules
@@ -283,6 +283,7 @@ OBJECT: FINITE_SOLID_OBJECT
;
FINITE_SOLID_OBJECT: BOX
+ | CYLINDER
| SPHERE
;
@@ -296,6 +297,25 @@ BOX: "box" "{"
}
;
+CYLINDER: "cylinder" "{"
+ VECTOR "," VECTOR "," FLOAT
+ MAYBE_OPEN
+ OBJECT_MODIFIERS
+ "}"
+ {
+ dmnsn_astnode object
+ = dmnsn_new_astnode4(DMNSN_AST_CYLINDER, @$, $3, $5, $7, $8);
+ $$ = dmnsn_new_astnode2(DMNSN_AST_OBJECT, @$, object, $9);
+ }
+;
+
+MAYBE_OPEN: /* empty */ {
+ $$ = dmnsn_new_ast_integer(false);
+ }
+ | "open" {
+ $$ = dmnsn_new_ast_integer(true);
+ }
+
SPHERE: "sphere" "{"
VECTOR "," FLOAT
OBJECT_MODIFIERS