The SIF_SFF 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 SFF 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. SIF is a static scoped language, like Pascal.

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
INT positive or negative constant integer
REAL positive or negative number in decimal notation of the form [-]mmm.ddd
( ) Delimit expression as in LISP
color A volume or surface property
constellation A group of solids whose positions relative to each other should be maintained.
desired_accuracy The accuracy with which the designer wants the part manufactured.
difference A boolean difference operation
e Exponential or Scientific notation for a value
inches Sets units to inches
intersection A boolean intersection operation
mm Sets units to millimeters
rgb Specification of color as an rgb triple
shell A closed surface
SIF_SFF Header stating that this is a SIF SFF type file
solid A set of shells enclosing volume(s)
surface A set of 2D elements
triangles A list of triangles (possibly contained in surfaces)
t A triangle
union A boolean union operation
units Sets the units for the file
vertices A list of vertices
v A vertex

SIF SFF Grammar

Nonterminal -> Production
part -> ( SIF_SFF version:INT release:INT units accuracy solid_list )
units -> ( units units_setting )
units_setting -> mm | inches
accuracy -> [ ( desired_accuracy value ) ]
solid_list -> { constellation | solid } +
constellation -> ( constellation solid+ )
solid -> ( solid volume_property* shell_set+ )
shell_set -> boolean | shell
shell -> ( shell vertex_array open_2d_list )
boolean -> intersection | union | difference
union -> ( union shell_set+ )
intersection -> ( intersection shell_set+ )
difference -> ( difference shell_set+ )
surface -> ( surface surface_property* open_2d+ )
open_2d_list -> ( triangles number:INT open_2d+ )
open_2d -> surface | triangle
triangle -> ( t vertex index:INT vertex index:INT vertex index:INT )
vertex_array -> ( vertices number:INT vertex+ )
vertex -> ( v x:value y:value [ z=0:value [ w=1:value ] ] )
surface_property -> ( color color_setting )
|
(user extension)
volume_property -> ( color color_setting )
|
(user extension)
color_setting -> ( rgb R:value G:value B:value )
value -> INT
|
REAL
|
( e mantissa:INT exponent:INT )

Alphabetic Index of Grammar Nonterminals

accuracy , boolean , color_setting , difference , intersection , open_2d_list , open_2d , part , shell_set , shell , solid , solid_list , surface_property , surface , triangle , union , units_setting , units , value , vertex_array , vertex , volume_property




This page is maintained by Sara McMains
E-mail: sara@cs.berkeley.edu
Last modified: 12/20/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.