The file format for grammar files is described informally as follows
(see parse.mly and lex.mll for a formal description), based on the follows
very simple example (sample.gra):

sample -> BNF format.
sample1 -> uses some of the EBNF features
sample2 -> uses more EBNF features - including nested elements

*********************More examples in gtr/tests***********************

----------------------------------------------------------------------
sample

Plus :  expr -> expr PLUS term 

Minus : expr -> expr MINUS term
Term :  expr -> term

Times : term -> term TIMES factor
Factor : term -> factor 

Int : factor -> POSINT
Var : factor -> VARIABLE
Expr : factor -> LPAREN expr RPAREN

POSINT = {{ ['0'-'9']+ }}
VARIABLE = {{ ['a'-'z' 'A'-'Z'] ['a'-'z' 'A'-'Z' '0'-'9' '\'' '_']* }}
PLUS = "+"
TIMES = "*"
MINUS = "-"
LPAREN="("
RPAREN=")"

{{ 
type extradata = int;;
let initial_data() = 0;;
}}
----------------------------------------------------------------------
sample1

(* basic EBNF grammar for exprs built from integers with right-associative plus,
   left-associative times. 

Plus : expr -> term { PLUS term }*
=======
--Support added for representation of 
	 0 or more: *  
    1 or more: + 
    for right associative.

{elements}* ==> {elements}(right,>=0)
{elements}+ ==> {elements}(right,>=1)
*)

Plus : expr -> term { PLUS term }*
Mult : term -> { factor TIMES }* factor
Int : factor -> INT
Expr : factor -> RPAREN expr LPAREN

INT={{['0'-'9']+}}
PLUS="+"
TIMES="*"
RPAREN="("
LPAREN=")" 

----------------------------------------------------------------------
sample2

(* basic EBNF grammar for exprs built from integers with right-associative plus,
   left-associative times. *)

Term : expr -> { factor TIMES }(left,>=0) factor { PLUS { factor TIMES }(left,>=0) factor }*
Int : factor -> INT
Expr : factor -> RPAREN expr LPAREN

INT = {{['0'-'9']+}}
PLUS = "+"
TIMES = "*"
RPAREN = "("
LPAREN = ")"
----------------------------------------------------------------------

1. "sample(1|2)" -- this is the name of the grammar.  It will be used to 
   prefix the names of all emitted files.

2. The productions come next.  For an example like the first listed
   above, "Plus" is the name of the OCaml constructor to use to build
   the abstract syntax tree.  Then the production is given next.
   The names of nonterminals should be given with lowercase letters,
   because they will compile to OCaml types.
		a. EBNF features have now been added to work with gt. This 
			allows the user to create grammars more quickly. The EBNF
			features are shown in "sample1" and "sample2". The EBNF
			statement can either allow repetition or it can be optional.
			
		b.	An example of an optional statement that will either accept
			an INT or nothing at all.
				Term : term -> [INT] 

		c.	Examples of repetition:

				These ones say that the information in between the
				curly brackets is to be repeated at least n times
				and it's abstract syntax tree is left|right associative.
					Factor : factor -> { factor TIMES }(left,>=n) factor   
					Term : term -> term { PLUS term }(right,<=n)

				Short Hand:
					Plus : expr -> term { PLUS term }* which is the same as 
					Plus : expr -> term { PLUS term }(right,<=0)

					Plus : expr -> term { PLUS term }+ which is the same as 
					Plus : expr -> term { PLUS term }(right,<=1)

3. The lexical classes come next (like for POSINT).  There are two
   formats.  If double quotes are used (as for PLUS), then that token
   will not be kept in the abstract syntax tree.  If double curly
   braces are used (as for POSINT), then the token will be kept in
   the abstract syntax tree.  If you are using a regular expresssion,
   you should use {{ }}.  Either way, the right hand side of the
   equation will be copied into the .mll file.

4. The final section after the lexical classes is the extra data
   section, between double curly braces.  You can associate arbitrary
   extra data with each abstract syntax tree node.  If you omit this
   section, the associated data is just of unit type.  
