Module Mcfggram


module Mcfggram: sig  end
Stream parser for MCFG grammars. The BNF for this is as follows:

rule ::= ID "-->" rhs

rhs ::= STRING | ID rhs2

rhs2 ::= ID maps | maps

maps ::= "[" map "]" maps | /*empty*/

map ::= INT "," INT map2

map2 ::= ";" map | /*empty*/
Author(s): Daniel M. Albro
Version: $Revision$
Since 12/03/02 - [da]: Initial Creation.


val lexer : string -> Genlex.token Stream.t
String lexer.
Returns a lexical analyzer for parsing the string s

s : String to parse
val file_lexer : string -> Genlex.token Stream.t
Lexer that reads from a named file
Returns a lexical analyzer for parsing the file named by filename

filename : Name of file to parse
val parse_grammar : Grammar.grammar -> Genlex.token Stream.t -> unit
Parses an MCFG grammar
Returns nothing

g : Grammar object to fill out with the information being parsed, also provides information needed for parsing.
s : Stream (lexical analyzer) we're parsing
val parse_rule : Grammar.grammar -> Genlex.token Stream.t -> Grammar.rule
Parses an MCFG rule
Returns the rule we parsed.

g : Grammar object to fill out with the information being parsed, also provides information needed for parsing.
s : Stream of tokens (lexical analyzer) from an MCFG.