SIF Version 2.0
SIF SFF LSIF SIF DSG

The SIF DSG Formal Syntax


Contents


Regular Expression Based Syntax Language Definition

This table provides a guideline as how to interpret the following two tables.

Syntax Description
| Or
* Zero or more
+ One or more
{} Grouping a subexpression
[] Optional subexpression
Comment Info Appear in italics
Tokens Appear in ALL CAPITALS
Key Words Appear in bold

SIF DSG Lexical Conventions and Tokens

SIF is an ASCII file format which is similar lexically to C code. SIF does not have a preprocessor, and it does not have any macro text facilities. Macro can be simulated using file inclusion. SIF is a static scoped language, like Pascal, and forward references are illegal.

Token Description
{" ", "\t", "\n"} White space is used as separators in SIF and then ignored
(* ... *) Multiline comments can be nested
# ... \n Single line comments can be used with multiline comments
( include "filename" ) Included files are sourced at the point of the include statement and appear to the interpreter as if the SIF description were one sequential file. Circular includes are not allowed.
INT positive or negative constant integer
ID C style identifier
( ) Delimit expression as in LISP
arc A piece of a circle
bezier2d A tensor product Bezier surface patch
body A set of fused lumps
boundary1d A single outer contour with zero or more inner contours
boundary2d A single outer shell with zero or more inner shells
bspline2d A tensor product BSpline surface patch
circle A circular contour
contour A sequential set of open 1D entities
coord_precision Sets how much accuracy of values should be trusted
def Define
e Exponential or Scientific notation for a value
f A planar facet bounded by a convex contour
face A planar face bounded by an outer contour with zero or more inner contours
inst Instantiate
lump A continuous solid bounded by a single outer shell and zero or more innner shells
lumpset A set of lumps
mo Mirror the orientation in place
mx Mirror along the X-axis through the YZ-plane
my Mirror along the Y-axis through the XZ-plane
mz Mirror along the Z-axis through the XY-plane
nested1d A set of contours which are strictly nested inside a single outer contour
nested2d A set of shells which are strictly nested inside a single outer shell
path A sequential set of open 1D entities
r Row
rv Rotate around the vector by an angle
rx Rotate around the X-axis by an angle
ry Rotate around the Y-axis by an angle
rz Rotate around the Z-axis by an angle
sa Scale all coordinates by the same value
shell A closed surface
sv Scale by the vector
sx Scale the X coordinate by the value
sy Scale the Y coordinate by the value
sz Scale the Z coordinate by the value
SIF_SFF Header stating that this is a SIF SFF type file
surface A set of 2D elements
t A triangle
tab Triangle Array Backward
tac Triangle Array Cross Hatched
taf Triangle Array Forwar
tf Triangle Fan
tm Triangle Mesh
tsb Triangle Strip Backward
tsf Triangle Strip Forward
tv Translate by the vector
tx Translate in X
ty Translate in Y
tz Translate in Z
units Sets the units for values within a scope
v A vertex

DSG Token Description
corner_radius The maximum allowable corner radius for a milled pocket
depth The depth of a flat bottomed pocket
hole A cylindrical hole feature
island Where not to cut in a pocket feature. It has an outer contour and a list of subfeatures
pocket A milling feature with a given bottom surface, an outer contour, a list of islands, and a list of subfeatures
refplane An oriented plane which describes an access direction. It has a list of transforms for orienting the XY-plane in space and a list of features.
taper_angle The angle to be applied to the side walls of a feature in making molds for injection molding
SIF_DSG Header stating that this a SIF DSG type file

SIF DSG Grammar

Nonterminal -> Production
part -> ( SIF_DSG ver:INT rel:INT setting_list body_decl_list body dsg_ref_plane_list )
dsg_ref_plane_list -> dsg_ref_plane*
dsg_ref_plane -> ( refplane transform_list setting_list open_2d_decl_list dsg_feature_list )
dsg_feature_list -> dsg_feature*
dsg_feature -> dsg_hole | dsg_pocket
dsg_hole -> ( hole setting_list open_2d_decl_list dsg_bottom circle open_2d_decl_list dsg_feature_list )
dsg_pocket -> ( pocket setting_list open_2d_decl_list dsg_bottom contour dsg_island_list dsg_feature_list )
dsg_island -> ( island setting_list open_2d_decl_list contour dsg_feature_list )
dsg_bottom -> dsg_depth | open_2d
dsg_depth -> ( depth value )
body_list -> body*
body -> body_inline | body_inst
body_inline -> ( body setting_list lump_decl_list lump lump_list )
body_def -> ( def body id setting_list lump_decl_list lump lump_list )
body_inst -> ( inst body id transform_list )
lump_set -> lump_set_inline | lump_set_inst
lump_set_inline -> ( lump_set setting_list lump_decl_list lump lump_list )
lump_set_def -> ( def lump_set id setting_list lump_decl_list lump lump_list )
lump_set_inst -> ( inst lump_set id transform_list )
lump_list -> lump*
lump -> lump_inline | lump_inst
lump_inline -> ( lump setting_list closed_2d_decl_list shell shell_list )
lump_def -> ( def lump id setting_list closed_2d_decl_list shell shell_list )
lump_inst -> ( inst lump id transform_list )
nested_2d_list -> { nested_2d | boundary_2d | shell }*
nested_2d -> nested_2d_inline | nested_2d_inst
nested_2d_inline -> ( nested_2d setting_list nested_2d_decl_list shell nested_2d_list )
nested_2d_def -> ( def nested_2d id setting_list nested_2d_decl_list shell nested_2d_list )
nested_2d_inst -> ( inst nested_2d id transform_list )
boundary_2d -> boundary_2d_inline | boundary_2d_inst
boundary_2d_inline -> ( boundary_2d setting_list closed_2d_decl_list shell shell_list )
boundary_2d_def -> ( def boundary_2d id setting_list closed_2d_decl_list shell shell_list )
boundary_2d_inst -> ( inst boundary_2d id transform_list )
shell_list -> shell*
shell -> shell_inline | shell_inst
shell_inline -> ( shell setting_list open_2d_decl_list open_2d open_2d_list )
shell_def -> ( def shell id setting_list open_2d_decl_list open_2d open_2d_list )
shell_inst -> ( inst shell id transform_list )
open_2d_list -> open_2d*
open_2d -> surface | bezier_2d | bspline_2d | face | facet | triangle
surface -> surface_inline | surface_inst
surface_inline -> ( surface setting_list open_2d_decl_list open_2d open_2d_list )
surface_def -> ( def surface id setting_list open_2d_decl_list open_2d open_2d_list )
surface_inst -> ( inst surface id transform_list )
bezier_2d -> ( bezier2d
u_order:INT v_order:INT
control_vertex_list
)
bspline_2d -> ( bspline2d
u_order:INT u_knots:INT knot_list
v_order:INT v_knots:INT knot_list
control_vertex_list
)
knot_list -> ( uniform ) | ( value+ )
control_vertex_list -> ( ( vertex+ )+ )
face -> ( face contour contour_list )
facet -> ( f id id id id* )
triangle -> ( t id id id )
nested_1d_list -> { nested_1d | boundary_1d | contour }*
nested_1d -> nested_1d_inline | nested_1d_inst
nested_1d_inline -> ( nested_1d setting_list nested_1d_decl_list contour nested_1d_list )
nested_1d_def -> ( def nested_1d id setting_list nested_1d_decl_list contour nested_1d_list )
nested_1d_inst -> ( inst nested_1d id transform_list )
boundary_1d -> boundary_1d_inline | boundary_1d_inst
boundary_1d_inline -> ( boundary_1d setting_list closed_1d_decl_list contour contour_list )
boundary_1d_def -> ( def boundary_1d id setting_list closed_1d_decl_list contour contour_list )
boundary_1d_inst -> ( inst boundary_1d id transform_list )
contour_list -> contour*
contour -> contour_inline | contour_inst
contour_inline -> ( contour setting_list open_1d_decl_list contour_segment_list )
contour_def -> ( def contour id setting_list open_1d_decl_list contour_segment_list )
contour_inst -> ( inst contour id transform_list )
circle -> ( circle center:id radius:value [ x=0:value y=0:value z=1:value ] )
path_def -> ( def path id setting_list open_1d_decl_list path_segment_list )
path_inst -> ( inst path id transform_list )
contour_segment_list -> { complete_segment [ incomplete_segment ] }+
path_segment_list -> { complete_segment [ incomplete_segment ] }* complete_segment
complete_segment -> path_inst
|
id
incomplete_segment -> ( arc [ x=0:value y=0:value z=1:value ] theta:value )
vertex -> ( v id x:value y:value [ z=0:value [ w=1:value ] ] )
body_decl_list -> body_decl*
body_decl -> lump_set_decl | body_def
lump_set_decl_list -> lump_set_decl*
lump_set_decl -> lump_decl | lump_set_def
lump_decl_list -> lump_decl*
lump_decl -> nested_2d_decl | lump_def
nested_2d_decl_list -> nested_2d_decl*
nested_2d_decl -> closed_2d_decl | boundary_2d_def | nested_2d_def
closed_2d_decl_list -> closed_2d_decl*
closed_2d_decl -> open_2d_decl | shell_def
open_2d_decl_list -> open_2d_decl*
open_2d_decl -> nested_1d_decl | surface_def
nested_1d_decl_list -> nested_1d_decl*
nested_1d_decl -> closed_1d_decl | boundary_1d_def | nested_1d_def
closed_1d_decl_list -> closed_1d_decl*
closed_1d_decl -> open_1d_decl | contour_def
open_1d_decl_list -> open_1d_decl*
open_1d_decl -> vertex | path_def
transform_list -> transform*
transform -> mirror | rotate | scale | translate
mirror -> ( mo )
|
( mx value )
|
( my value )
|
( mz value )
rotate -> ( rv x:value y:value z:value theta:value )
|
( rx value )
|
( ry value )
|
( rz value )
scale -> ( sv x:value y:value [ z=1:value ] )
|
( sa value )
|
( sx value )
|
( sy value )
|
( sz value )
translate -> ( tv x:value y:value [ z=0:value ] )
|
( tx value )
|
( ty value )
|
( tz value )
id -> ID
|
INT
setting_list -> setting*
setting -> ( units value )
|
( coord_precision value )
|
( desired_accuracy value )
|
( corner_radius value )
|
( taper_angle value )
value -> INT
|
REAL
|
( e mantissa:INT exponent:INT )

Alphabetic Index of Grammar Nonterminals

body , body_decl , body_decl_list , body_def , body_inst , body_inline , body_list , boundary_1d , boundary_1d_def , boundary_1d_inline , boundary_1d_inst , boundary_2d , boundary_2d_def , boundary_2d_inline , boundary_2d_inst , bspline_2d , circle , closed_1d_decl , closed_1d_decl_list , closed_2d_decl , closed_2d_decl_list , complete_segment , contour , contour_def , contour_inline , contour_inst , contour_list , contour_segment_list , face , facet , id , incomplete_segment , lump , lump_decl , lump_decl_list , lump_def , lump_inline , lump_inst , lump_list , lump_set , lump_set_decl , lump_set_decl_list , lump_set_def , lump_set_inline , lump_set_inst , mirror , nested_1d , nested_1d_decl , nested_1d_decl_list , nested_1d_def , nested_1d_inline , nested_1d_inst , nested_1d_list , nested_2d , nested_2d_decl , nested_2d_decl_list , nested_2d_def , nested_2d_inline , nested_2d_inst , nested_2d_list , open_1d_decl , open_1d_decl_list , open_2d , open_2d_decl , open_2d_decl_list , open_2d_list , part , path_def , path_inst , path_segment_list , rotate , scale , setting , setting_list , shell , shell_def , shell_inline , shell_inst , shell_list , surface , surface_def , surface_inline , surface_inst , transform , transform_list , translate , triangle , value , vertex


DSG Additions

dsg_bottom , dsg_depth , dsg_feature , dsg_feature_list , dsg_hole , dsg_island , dsg_pocket , dsg_ref_plane , dsg_ref_plane_list




This page is maintained by Jordan Smith
E-mail: jordans@cs.berkeley.edu
Last modified: 1/11/99

This page was designed and tested under Netscape using common HTML constructs. No browsers are blocked from viewing this page. Please send mail to the maintainer of this page if you find any broken links or errors in the page construction.