S Y N T A X   O F   S C H E M A
===============================


NOTATIONS:  
----------

   :=  
   :
   L      
   W 
   <...>             
   ...
   cluster  
   cluster-fragment
   string-expression

defined in syntax_of_notations_help


No L is allowed in schema
   except when explicity stated,
   except in string-expressions,
   except in an <arbitrary text>;



GENERAL STRUCTURE
-----------------

schema              :=  [<an arbitrary text without token "\\"> ]
                        \\ [schema-line]                      L
                        [   schema-line                       L ]           
                        [   schema-line                       L ]
                        ...
                        [   schema-line                       L ]
                        [   schema-line [ eos [<arbitrary text>]]


schema-line         :=  nest-pattern [W instruction]    |
                                      W instruction  

eos                 :=  W ( "|"   or  "|end"  )





PRINCIPAL CONSTRUCTS
--------------------

nest-pattern        :=  nest
nest                :=  state[,state][,state] ...
state               :   cannot start with digit and apostrophe;
                        cannot have comma or white_space inside
                        names starting with hypen "-" are reserved;
instruction         :=  event-pattern queue [W comment]
comment             :=  '[<arbitrary text text without L>]
                    :   starts with apostrophe
event-pattern       :=  event

event               :=  token.type.scope
                        all fragments of this cluster are optional, but
                        event-pattern cannot be empty cluster:
                        period or one of the fragemets is required;
                        only token can include variables;

queue               :=  [member][member] ...
                        where member := W ( normal-action | event-action | nest-action )  

event-action        :=  {+|*}   [event]
nest-action         :=  {>|=|<} [ <number>  | nest  |  <number>,nest ]
normal-action       :=  [:]     [text.control.statement.parameter]
                                all fragments of this cluster are optional;                       
                                only text and parameter can include variables;




GENERALIZATIONS
===============
                         any number of neutral-lines 
                         can be inserted in the schema:
neutral-line        :=  <empty line> | [W]comment


                        if queue ends with ":",
                        it can be continued on the following 
continuation-line   :=  queue 
 



IMMEDIATE ACTION    :=  |statement.parameter 
----------------        immediate action can be inserted anywere in schema except
                          comment 
                          program (between .begin_program and .end_program)
                        and must be terminated by soft character;
                        this cluster has the same effect as 
                        normal-action ..statement.parameter,
                        but executed at compile-schema time;




NAMING CONVENTIONS
==================

   Normal-actions, variables, disk-variables, event-types, states 
   belong different name-spaces.

   For example,
     event-name "=", event-type "=", action "=", control "=", operation "=", and state "="
   denote different entities without risk.


   Any names can be used in schema
   for states, internal-event types, and variables 
   except names restricted by syntax and except names listed below:


   VARIABLE NAME 
   -------------
     is described in variables_help.txt

   STATE NAME  
   ----------
     restrictions listed in state definition above;
     reserved state names listed in: 
       Schema\States\important_names.txt


   EVENT NAME
   ----------
     The third part, scope,  if not omitted, 
     can have only two predefined names: g,l.

     Programmer can create any names for type (without "."), 
     but be aware about reserved names listed in
       Schema\Events\important_types_help.txt


SCHEMA ALPHABET
===============

Escape characters in queue
--------------------------

=  nest, no shifts;
>  nest, shift up
<  nest, shift down
+  event, (early-event)
*  event, (late-event)
|  compile-time action
:  action, continuation
'  comment


Miscellaneous characters
------------------------
.  ClusterSeparator
,  ClusterSeparator for states in nest 
"  String-Expression Beginning and End 


Escape related characters in String-Expression
----------------------------------------------
Escaper               = "\"
Variable Escaper      = "$"
NestVariable Escaper  = "@"
Variable Name Limitor = " ", CR, LF, TAB, "