home *** CD-ROM | disk | FTP | other *** search
- ISL.BNF - Copyright (c) 1995 Grizzly Bear Labs, last modified 01-25-94
-
- This file describes the BNF for ISL, the Imagine Staging Language. BNF is
- Backus Naur Form, a formal method for describing the syntax of a language.
- It should be fairly clear from the BNF what is allowable and what is not.
- This is a non-trivial document - I suggest you use ISL.doc to get an idea
- of what ISL is and does and how it works, then play with the destage and
- restage programs, and only then attempt to grok the grammar.
-
- restage and islobjs both handle the entire grammar.
-
- Before diving into the BNF, here are some things which are not in the BNF
- which are true of the ISL grammar. Feel free to ignore the regular
- expressions and references to flex - they are included for the advanced
- user and should not be needed to understand the language.
-
- 1) Whitespace is optional. You may have an entire stage on one line, or
- may start a new line between any two keywords.
-
- 2) STRING is a set of characters which is delimited by double quotes.
- A legal string may contain 0 or more of any characters except for
- the double quotes, since it is delimited by double quotes.
-
- 3) U32 is a token which contains one or more digits. It may not have
- a decimal point nor a sign. {DIGIT}+ is the flex pattern used.
-
- 4) FLOAT is a token which contains an optional minus sign, one or more
- digits, a period, and zero or more digits. \-?{DIGIT}+\.{DIGIT}*
- is the flex pattern used.
-
- 5) I have not attempted to spell out the meaning of each U32, FLOAT, and
- STRING, on the theory that their meanings should be obvious based on
- their position in the grammar. For example, in camerahdr, defined
- as CAMERA STRING LAYER U32, you have one keyword (CAMERA), the name
- (STRING), and a second keyword (LAYER) with the layer number (U32).
- In this case, STRING would be the name of the CAMERA from the first
- column of the Action editor. A typical value for this clause would
- be CAMERA "CAMERA" LAYER 0.
-
- 6) : means definition, | provides alternates. Eh? Take the very first
- part of the BNF for an example. A stage may consist of a stagehdr
- OR a stagehdr followed by a camera followed by globals followed by
- objects. These, in turn, are defined individually.
-
- 7) Optional clauses contain an empty : clause followed by one or more
- | clauses. An example would be shadowflag which is either :
- (nothing) or SHADOW. The grammar is riddled with these, so make
- sure you get it. A stage may have zero or more objects, each of which
- may have one or more positions, one or more alignments, etc.
-
- 8) File paths are stripped from file names by starting at the end of the
- string, and scanning backwards until either a \ or a / has been found.
- There are two possible subtle problems with this. One, if you have a
- PC stage and a / in your file name or an Amiga stage and a \ in your
- file name, truncation will occur. Two, ISL will not properly handle
- files located in a root directory or symbolic link unless they have a
- / or a \ in their path. Effect file names are case insensitive.
-
- Finally, here's the BNF:
-
- stage
- : stagehdr
- | stagehdr camera globals objects
-
- stagehdr
- : STAGE MAXFRAMES U32 LOOP U32
-
- camera
- : camerahdr positions alignments sizes assocs effects
-
- camerahdr
- : CAMERA STRING LAYER U32
-
- globals
- : globalhdr globalchunks positions alignments sizes
-
- globalhdr
- : GLOBALS STRING LAYER U32
-
- globalchunks
- :
- | globalchunks globalchunk
-
- globalchunk
- : ACTOR frames
- BRUSH STRING U32
- BACKDROP STRING U32
- AMBIENT rgb HORIZON rgb +ZENITH rgb -ZENITH rgb
- FOG btl FOG rgb
- STARFIELD FLOAT TRANSITION U32
-
- objects
- :
- | objects object
-
- object
- : objecthdr fil3chunks positions alignments sizes assocs effects
- | lighthdr lit2chunks positions alignments sizes assocs
- | axishdr axischunks positions alignments sizes assocs
-
- objecthdr
- : OBJECT STRING LAYER U32 quickdrawflag
-
- lighthdr
- : LIGHT STRING LAYER U32 quickdrawflag
-
- axishdr
- : AXIS STRING LAYER U32 quickdrawflag
-
- positions
- :
- | positions pos2chunk
- | positions pth2chunk
-
- pos2chunk
- : POSITION frames xyz v0v1 splineflag knotflag
-
- pth2chunk
- : POSITION frames PATH STRING ACCEL U32 FLOAT DECEL U32 FLOAT
-
- alignments
- :
- | alignments aln2chunk
- | alignments palnchunk
- | alignments talnchunk
-
- aln2chunk
- : ALIGN frames xyz v0v1 splineflag knotflag
-
- palnchunk
- : ALIGN frames PATH yhorizontalflag gconformflag oconformflag
-
- talnchunk
- : ALIGN frames OBJECT STRING YROT FLOAT FLOAT
-
- sizes
- :
- | sizes osz2chunk
-
- osz2chunk
- : SIZE frames xyz v0v1 splineflag knotflag
-
- fil3chunks
- :
- | fil3chunks fil3chunk
-
- fil3chunk
- : ACTOR frames NAME STRING STATE STRING CYCLE FLOAT FLOAT reverseflag v0v1 splineflag knotflag
-
- lit2chunks
- :
- | lit2chunks lit2chunk
-
- lit2chunk
- : ACTOR frames ppshape rrshape shadowflag diminishflag rgb TRANSITION U32 flareflag
-
- axischunks
- :
- | axischunks axischunk
-
- axischunk
- : ACTOR frames
-
- assocs
- :
- | assocs asscchunk
-
- asscchunk
- : ASSOC frames OBJECT STRING
-
- effects
- :
- | effects effect
-
- effect
- : EFFECT U32 frames Baloon STRING
- radiustype FLOAT reverseflag returnflag
- | EFFECT U32 frames Boing20 STRING
- xyzaxis ucdsquash SHRINK FLOAT TIMES U32
- | EFFECT U32 frames Boing2 STRING
- xyzaxis ucdsquash SHRINK FLOAT TIMES U32
- | EFFECT U32 frames Explode STRING
- srlshape xyzaxis EXPLOSION FLOAT FLOAT SCALING FLOAT
- ROTATIONS FLOAT FLOAT SEED U32
- returnflag reverseflag
- | EFFECT U32 frames Firewrks STRING
- srlshape xyzaxis EXPLOSION FLOAT FLOAT SCALING FLOAT
- ROTATIONS FLOAT FLOAT EXPANSION FLOAT DISTANCE FLOAT SEED U32
- sparkleflag
- | EFFECT U32 frames Flash STRING
- ON U32 OFF U32 startflag
- | EFFECT U32 frames Grow STRING
- YROT FLOAT XSCALE FLOAT
- ZSCALE FLOAT XTRANS FLOAT ZTRANS FLOAT
- alignyflag keepxflag mirrorflag reverseflag sharpflag
- | EFFECT U32 frames Particle STRING
- dreflag bounceflag taperflag reverseflag returnflag
- TRAVEL FLOAT SCALING FLOAT FLOAT ROTATIONS FLOAT FLOAT HTIME FLOAT
- GRAVITY FLOAT SEED U32 ELASTICITY FLOAT ZTIME FLOAT ZGROUND FLOAT
- SPEED FLOAT ZANGLE FLOAT FLOAT XANGLE FLOAT FLOAT
- | EFFECT U32 frames Ripple STRING
- lrtoggle WAVELENGTH FLOAT ZAMP FLOAT TRAVEL FLOAT RIPPLES U32
- | EFFECT U32 frames Rotate20 STRING
- xyzaxis DEGREES FLOAT
- | EFFECT U32 frames Rotate2 STRING
- xyzaxis DEGREES FLOAT
- | EFFECT U32 frames Sway STRING
- rxyzflag restrictflag GYRATIONS FLOAT FLOAT ANGLES FLOAT FLOAT SEED U32
- | EFFECT U32 frames SPIKE STRING
- lcrflag DISTANCE FLOAT FLOAT CYCLES FLOAT FLOAT DISPERSION FLOAT SEED U32
- restrictflag reverseflag returnflag
- | EFFECT U32 frames Tumble STRING
- rzaxis ROTATIONS FLOAT FLOAT SEED U32
-
- frames
- : FRAMES U32 U32
-
- xyz
- : XYZ FLOAT FLOAT FLOAT
-
- rgb
- : RGB FLOAT FLOAT FLOAT
-
- btl
- : BTL FLOAT FLOAT FLOAT
-
- v0v1
- : VELOCITY FLOAT FLOAT
-
- xyzaxis
- : XAXIS
- | YAXIS
- | ZAXIS
-
- rzaxis
- : RANDOMAXIS
- | ZAXIS
-
- ucdsquash
- : +SQUASH
- | SQUASH
- | -SQUASH
-
- srlshape
- : SPHERICAL
- | RADIAL
- | LINEAR
-
- ppshape
- : POINT
- | PARALLEL
-
- rrshape
- :
- | ROUND
- | RECTANGULAR
-
- radiustype
- : INSCRIBE
- | OUTSCRIBE
- | AVERAGE
- | RADIUS
-
- sparkleflag
- :
- | SPARKLE
-
- startflag
- : STARTON
- | STARTOFF
-
- alignyflag
- :
- | ALIGNY
-
- keepxflag
- :
- | KEEPX
-
- mirrorflag
- :
- | MIRROR
-
- reverseflag
- :
- | REVERSE
-
- sharpflag
- :
- | SHARP
-
- returnflag
- :
- | RETURN
-
- lrtoggle
- : LINEAR
- | RADIAL
-
- shadowflag
- :
- | SHADOW
-
- diminishflag
- :
- | DIMINISH
- | FALLOFF
-
- yhorizontalflag
- :
- | YHORIZONTAL
-
- gconformflag
- :
- | GCONFORM
-
- oconformflag
- :
- | OCONFORM
-
- quickdrawflag
- :
- | QUICKDRAW
-
- splineflag
- :
- | SPLINE
-
- knotflag
- :
- | KNOT
-
- flareflag
- :
- | NOFLARE
-
- dreflag
- :
- | DELAYED
- | RAIN
- | EMISSION
-
- bounceflag
- :
- | BOUNCE
-
- taperflag
- :
- | TAPER
-
- lcrflag
- : LINEAR
- | CYLINDRICAL
- | RADIAL
-
- restrictflag
- :
- | RESTRICT
-
- rxyzflag
- : RANDOM
- | XAXIS
- | YAXIS
- | ZAXIS
-
-