Eprogram :=

  PROGRAM{

  CLASSES{
    class1{
      event1{...
      }event1
      ...
    }class1
    ...
  }CLASSES

  label1{
    ...
  }label1
  
  ...
  }PROGRAM

* Every statement on one line
* Blocks have matching close braces
* Object is always 1st argument

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Code Expression Types:

Obj        := game | me | it | keyboard | joystick | mouse

Op         := = | != | > | < | >= | <=

Exp        := {IfExp | MethodExp | CreateExp | 
	      MutateExp | BackgroundExp | GotoExp |
              (empty)}*

SimpleExp  := varExp | valueExp | obj.property | random(low,hi) | classname

ValueExp   := string | real

IfExp      := 	IF simpleExp op simpleExp{
  			Exp
		}ELSE{
  			Exp
		}IF

MethodExp  := MOVELEFT  obj [real]simpleExp | 
              MOVERIGHT obj [real]simpleExp |
              MOVEUP    obj [real]simpleExp |
              MOVEDOWN  obj [real]simpleExp |
              MOVE      obj [real]simpleExp |
              MOVEDEPTH obj [real]simpleExp |
              CHANGEDIRECTION obj [real]simpleExp |
              CHANGEPOSITION  obj ([real]simpleExp, [real]simpleExp) |
              SETPOSITION  obj ([real]simpleExp, [real]simpleExp) |
              SETDIRECTION obj [real]simpleExp |
              SETDEPTH     obj [real]simpleExp |
	      REBOUND      obj1     obj2       |
	      HIDE         obj                 |
              SHOW         obj                 |
              DESTROY obj                      |
	      UNMOVE  obj                      |
	      UNDESTROY obj                    |
              DESTROYALL

CreateExp  := CREATE class name-string graphic-string direction-real x-real y-real z-real

VarExp     := STRING$name |
              COUNTER$name

MutateExp  := SET    [STRING$name]varExp [string]simpleExp |
              SET    [COUNTER$name]varExp [real]simpleExp  |
              CHANGE [COUNTER$name]varExp [real]simpleExp 

BackgroundExp := SETBACKGROUND [graphic-string]simpleExp |
                 SETMAP        [map-string]simpleExp     |
                 SETMUSIC      [music-string]simpleExp

SETSTATE    := SETSTATE nextstate

StateExp   := name{
                  INITIALIZE{
                        exp
	          }INITIALIZE
                  LOOP{
                        exp
                  }LOOP
              }name

ClassExp   := name{
                  CREATE{
                        exp
                  }CREATE
                  NORMAL{
                        exp
                  }NORMAL
                  MAP{
                        exp
                  }MAP
                  COLLISION{
                        exp
                  }COLLISIOM
                  DESTROY{
                        exp
                  }DESTROY
              }name

ProgramExp := PROGRAM{
                     CLASSES{
                            classExp
                            ...
                     }CLASSES
                     STATES{
                            stateExp
                            ...
                     }STATES
              }PROGRAM



Mouse properties:
  x
  y
  left
  right

Game properties:
  music
  background
  map
  
Keyboard properties:
  up
  down
  left 
  right
  upright
  upleft
  downright
  downleft
  space
  enter
  a
  b
  c...

Joystick properties:  
  up
  down
  left 
  right
  upright
  upleft
  downright
  downleft
  firea
  fireb
  firec
  fired    

Sprite (class) properties:
  mapUnder 
  class 
  x
  y
  direction
  graphic
  depth
  name
  clicked
  visible


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

State :=
  <CounterEvt
   StringEvt
   MePointer
   ItPointer
   KeyboardPointer
   JoystickPointer
   GamePointer
   Stack>
