home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 57 / af057sub.adf / ISL_2_0.lha / ISL.BNF < prev    next >
Text File  |  1993-10-18  |  6KB  |  286 lines

  1. ISL.BNF - Copyright (c) 1993 Grizzly Bear Labs, last modified 10-18-93
  2.  
  3. This file describes the BNF for ISL, the Imagine Staging Language.  BNF is
  4. Backus Naur Form, a formal method for describing the syntax of a language.
  5. It should be fairly clear from the BNF what is allowable and what is not.
  6. This is a non-trivial document - I suggest you use ISL.doc to get an idea
  7. of what ISL is and does and how it works, then play with the destage and
  8. restage programs, and only then attempt to grok the grammar.
  9.  
  10. restage and islobjs both handle the entire grammar.
  11.  
  12. Before diving into the BNF, here are some things which are not in the BNF
  13. which are true of the ISL grammar.  Feel free to ignore the regular
  14. expressions and references to flex - they are included for the advanced
  15. user and should not be needed to understand the language.
  16.  
  17. 1)  Whitespace is optional.  You may have an entire stage on one line, or
  18.     may start a new line between any two keywords.  
  19.  
  20. 2)  STRING is a set of characters which is delimited by double quotes.
  21.     A legal string may contain 0 or more of any characters except for
  22.     the double quotes, since it is delimited by double quotes.
  23.  
  24. 3)  U32 is a token which contains one or more digits.  It may not have
  25.     a decimal point nor a sign.  {DIGIT}+ is the flex pattern used.
  26.  
  27. 4)  FLOAT is a token which contains an optional minus sign, one or more
  28.     digits, a period, and zero or more digits.  \-?{DIGIT}+\.{DIGIT}*
  29.     is the flex pattern used.  
  30.  
  31. 5)  I have not attempted to spell out the meaning of each U32, FLOAT, and
  32.     STRING, on the theory that their meanings should be obvious based on
  33.     their position in the grammar.  For example, in camerahdr, defined
  34.     as CAMERA STRING, you have one keyword (CAMERA) and the name (STRING).
  35.     In this case, STRING would be the name of the CAMERA from the first
  36.     column of the Action editor.  A typical value for this clause would
  37.     be CAMERA "CAMERA".
  38.  
  39. 6)  : means definition, | provides alternates.  Eh?  Take the very first
  40.     part of the BNF for an example.  A stage may consist of a stagehdr
  41.     OR a stagehdr followed by a camera followed by globals followed by
  42.     objects.  These, in turn, are defined individually.
  43.  
  44. 7)  Optional clauses contain an empty : clause followed by one or more
  45.     | clauses.  An example would be genlockflag which is either :
  46.     (nothing) or GENLOCK.  The grammar is riddled with these, so make
  47.     sure you get it.  A stage may have zero or more objects, each of which
  48.     may have one or more positions, one or more alignments, etc.
  49.  
  50. 8)  File paths are stripped from file names by starting at the end of the
  51.     string, and scanning backwards until either a \ or a / has been found.
  52.     There are two possible subtle problems with this.  One, if you have a
  53.     PC stage and a / in your file name or an Amiga stage and a \ in your
  54.     file name, truncation will occur.  Two, ISL will not properly handle
  55.     files located in a root directory or symbolic link unless they have a
  56.     / or a \ in their path.
  57.  
  58. Finally, here's the BNF:
  59.  
  60. stage
  61.     : stagehdr
  62.     | stagehdr camera globals objects
  63.  
  64. stagehdr
  65.     : STAGE MAXFRAMES U32
  66.  
  67. camera
  68.     : camerahdr positions alignments sizes hinges effects
  69.  
  70. camerahdr
  71.     : CAMERA STRING
  72.  
  73. globals
  74.     : globalhdr globalchunks positions alignments sizes
  75.  
  76. globalhdr
  77.     : GLOBALS STRING
  78.  
  79. globalchunks
  80.     :
  81.     | globalchunks globalchunk
  82.  
  83. globalchunk
  84.     : ACTOR frames
  85.       BRUSH STRING U32
  86.       BACKDROP STRING U32
  87.       AMBIENT rgb HORIZON rgb +ZENITH rgb -ZENITH rgb
  88.       FOG btl FOG rgb
  89.       STARFIELD FLOAT TRANSITION U32 SKYBLEND U32 genlockflag
  90.  
  91. objects
  92.     :
  93.     | objects object
  94.  
  95. object
  96.     : objecthdr filechunks positions alignments sizes hinges effects
  97.     | lighthdr litechunks positions alignments sizes hinges
  98.     | axishdr axischunks positions alignments sizes hinges
  99.  
  100. objecthdr
  101.     : OBJECT STRING quickdrawflag
  102.  
  103. lighthdr
  104.     : LIGHT STRING
  105.  
  106. axishdr
  107.     : AXIS STRING quickdrawflag
  108.  
  109. positions
  110.     :
  111.     | positions posnchunk
  112.     | positions pth2chunk
  113.  
  114. posnchunk
  115.     : POSITION frames xyz
  116.  
  117. pth2chunk
  118.     : POSITION frames PATH STRING ACCEL U32 FLOAT DECEL U32 FLOAT
  119.  
  120. alignments
  121.     :
  122.     | alignments algnchunk
  123.     | alignments palnchunk
  124.     | alignments talnchunk
  125.  
  126. algnchunk
  127.     : ALIGN frames xyz
  128.  
  129. palnchunk
  130.     : ALIGN frames PATH yhorizontalflag
  131.  
  132. talnchunk
  133.     : ALIGN frames OBJECT STRING YROT FLOAT FLOAT
  134.  
  135. sizes
  136.     :
  137.     | sizes osizchunk
  138.  
  139. osizchunk
  140.     : SIZE frames xyz
  141.  
  142. filechunks
  143.     :
  144.     | filechunks filechunk
  145.  
  146. filechunk
  147.     : ACTOR frames NAME STRING CYCLE FLOAT FLOAT reverseflag TRANSITION U32
  148.  
  149. litechunks
  150.     :
  151.     | litechunks litechunk
  152.  
  153. litechunk
  154.     : ACTOR frames sccshape shadowflag diminishflag rgb TRANSITION U32
  155.  
  156. axischunks
  157.     :
  158.     | axischunks axischunk
  159.  
  160. axischunk
  161.     : ACTOR frames
  162.  
  163. hinges
  164.     :
  165.     | hinges hingchunk
  166.  
  167. hingchunk
  168.     : HINGE frames OBJECT STRING
  169.  
  170. effects
  171.     :
  172.     | effects effect
  173.  
  174. effect
  175.     : EFFECT U32 frames Boing2.0 STRING
  176.       xyzaxis ucdsquash SHRINK FLOAT TIMES U32
  177.     | EFFECT U32 frames Explode STRING
  178.       srlshape xyzaxis EXPLOSION FLOAT FLOAT SCALING FLOAT
  179.       ROTATIONS FLOAT FLOAT SEED U32
  180.       returnflag reverseflag
  181.     | EFFECT U32 frames Fireworks STRING
  182.       srlshape xyzaxis EXPLOSION FLOAT FLOAT SCALING FLOAT
  183.       ROTATIONS FLOAT FLOAT EXPANSION FLOAT DISTANCE FLOAT SEED U32
  184.       sparkleflag
  185.     | EFFECT U32 frames Flash STRING
  186.       ON U32 OFF U32 startflag
  187.     | EFFECT U32 frames Grow STRING
  188.       YROT FLOAT XSCALE FLOAT
  189.       ZSCALE FLOAT XTRANS FLOAT ZTRANS FLOAT
  190.       alignyflag keepxflag mirrorflag reverseflag
  191.     | EFFECT U32 frames Ripple STRING
  192.       lrtoggle WAVELENGTH FLOAT ZAMP FLOAT TRAVEL FLOAT RIPPLES U32
  193.     | EFFECT U32 frames Rotate2.0 STRING
  194.       xyzaxis DEGREES FLOAT
  195.     | EFFECT U32 frames Tumble STRING
  196.       rzaxis ROTATIONS FLOAT FLOAT SEED U32
  197.  
  198. frames
  199.     : FRAMES U32 U32
  200.  
  201. xyz
  202.     : XYZ FLOAT FLOAT FLOAT
  203.  
  204. rgb
  205.     : RGB FLOAT FLOAT FLOAT
  206.  
  207. btl
  208.     : BTL FLOAT FLOAT FLOAT
  209.  
  210. xyzaxis
  211.     : XAXIS
  212.     | YAXIS
  213.     | ZAXIS
  214.  
  215. rzaxis
  216.     : RANDOMAXIS
  217.     | ZAXIS
  218.  
  219. ucdsquash
  220.     : +SQUASH
  221.     | SQUASH
  222.     | -SQUASH
  223.  
  224. srlshape
  225.     : SPHERICAL
  226.     | RADIAL
  227.     | LINEAR
  228.  
  229. sccshape
  230.     : SPHERICAL
  231.     | CYLINDRICAL
  232.     | CONICAL
  233.  
  234. sparkleflag
  235.     :
  236.     | SPARKLE
  237.  
  238. startflag
  239.     : STARTON
  240.     | STARTOFF
  241.  
  242. alignyflag
  243.     :
  244.     | ALIGNY
  245.  
  246. keepxflag
  247.     :
  248.     | KEEPX
  249.  
  250. mirrorflag
  251.     :
  252.     | MIRROR
  253.  
  254. reverseflag
  255.     :
  256.     | REVERSE
  257.  
  258. returnflag
  259.     :
  260.     | RETURN
  261.  
  262. lrtoggle
  263.     : LINEAR
  264.     | RADIAL
  265.  
  266. shadowflag
  267.     :
  268.     | SHADOW
  269.  
  270. diminishflag
  271.     :
  272.     | DIMINISH
  273.  
  274. genlockflag
  275.     :
  276.     | GENLOCK
  277.  
  278. yhorizontalflag
  279.     :
  280.     | YHORIZONTAL
  281.  
  282. quickdrawflag
  283.     :
  284.     | QUICKDRAW
  285.  
  286.