parseOGDLFromFile fname = do input <- readFile fname
                             return (runParser ogdl emptyState fname input)

-- // # 6. Level 2: Graph grammar

-- //     [19] anchor ::= '-' '{' word '}'

-- //     [20] reference ::= '+' '{' word '}'

-- //     [21] path_reference ::= '=' '{' path '}'

-- // Path syntax should be according to the OGDL Path reference.

-- // # 7. Character encoding

-- // OGDL streams must parse well without explicit encoding information
-- // for all ASCII transparent encodings.

-- // All special characters used in OGDL that define structure and
-- // delimit tokens are part of the US-ASCII (ISO646-US) set. It is
-- // specified that, in unidentified 8-bit streams without a
-- // [Unicode BOM](http://www.unicode.org/unicode/faq/utf_bom.html),
-- // there can be no ASCII values that don't map to ASCII characters,
-- // i.e, should be ASCII transparent. This guarantees that tools that
-- // support only single byte streams will work on any 8-bit fixed or
-- // variable length encoded stream, particularly
-- // [UTF-8](ftp://ftp.rfc-editor.org/in-notes/rfc2279.txt) and most
-- // ISO8859 variants.

-- // When a Unicode BOM is present, then the parser should interpret the
-- // stream as Unicode and choose the right UTF transform.

-- // # 8. Meta-information

-- // The '\#?' character combination used as a top level node (not
-- // necessarily the first one) is reserved for comunication between the
-- // OGDL stream and the parser. It is not mandatory and allows for
-- // future enhancements of the standard. For example, some optional
-- // behavior could be switched on. Normally meta-information will not
-- // be part of the in-memory graph. Meta-information is written in
-- // OGDL, as can be seen in the following examples.

-- //     #? ogdl 1.0

-- //     #? ( ogdl 1.0, encoding iso-8859-1 )

-- // The meta-information keys that are currently reserved are: ogdl,
-- // encoding and schema.

-- // # 9. Round-tripping

-- // OGDL streams are guaranted to round-trip in the presence of a
-- // capable parser and emitter, while maintaining a simple in-memory
-- // structure of nested nodes. Such a parser includes meta-information
-- // but not comments. Depending on the precision of the parser-emitter
-- // chain, the resulting stream may differ from the original in format
-- // or not.
parseOGDLFromFile fname = do input <- readFile fname
                             return (runParser ogdl emptyState fname input)

-- // # 6. Level 2: Graph grammar

-- //     [19] anchor ::= '-' '{' word '}'

-- //     [20] reference ::= '+' '{' word '}'

-- //     [21] path_reference ::= '=' '{' path '}'

-- // Path syntax should be according to the OGDL Path reference.

-- // # 7. Character encoding

-- // OGDL streams must parse well without explicit encoding information
-- // for all ASCII transparent encodings.

-- // All special characters used in OGDL that define structure and
-- // delimit tokens are part of the US-ASCII (ISO646-US) set. It is
-- // specified that, in unidentified 8-bit streams without a
-- // [Unicode BOM](http://www.unicode.org/unicode/faq/utf_bom.html),
-- // there can be no ASCII values that don't map to ASCII characters,
-- // i.e, should be ASCII transparent. This guarantees that tools that
-- // support only single byte streams will work on any 8-bit fixed or
-- // variable length encoded stream, particularly
-- // [UTF-8](ftp://ftp.rfc-editor.org/in-notes/rfc2279.txt) and most
-- // ISO8859 variants.

-- // When a Unicode BOM is present, then the parser should interpret the
-- // stream as Unicode and choose the right UTF transform.

-- // # 8. Meta-information

-- // The '\#?' character combination used as a top level node (not
-- // necessarily the first one) is reserved for comunication between the
-- // OGDL stream and the parser. It is not mandatory and allows for
-- // future enhancements of the standard. For example, some optional
-- // behavior could be switched on. Normally meta-information will not
-- // be part of the in-memory graph. Meta-information is written in
-- // OGDL, as can be seen in the following examples.

-- //     #? ogdl 1.0

-- //     #? ( ogdl 1.0, encoding iso-8859-1 )

-- // The meta-information keys that are currently reserved are: ogdl,
-- // encoding and schema.

-- // # 9. Round-tripping

-- // OGDL streams are guaranted to round-trip in the presence of a
-- // capable parser and emitter, while maintaining a simple in-memory
-- // structure of nested nodes. Such a parser includes meta-information
-- // but not comments. Depending on the precision of the parser-emitter
-- // chain, the resulting stream may differ from the original in format
-- // or not.
parseOGDLFromFile fname = do input <- readFile fname
                             return (runParser ogdl emptyState fname input)

-- // # 6. Level 2: Graph grammar

-- //     [19] anchor ::= '-' '{' word '}'

-- //     [20] reference ::= '+' '{' word '}'

-- //     [21] path_reference ::= '=' '{' path '}'

-- // Path syntax should be according to the OGDL Path reference.

-- // # 7. Character encoding

-- // OGDL streams must parse well without explicit encoding information
-- // for all ASCII transparent encodings.

-- // All special characters used in OGDL that define structure and
-- // delimit tokens are part of the US-ASCII (ISO646-US) set. It is
-- // specified that, in unidentified 8-bit streams without a
-- // [Unicode BOM](http://www.unicode.org/unicode/faq/utf_bom.html),
-- // there can be no ASCII values that don't map to ASCII characters,
-- // i.e, should be ASCII transparent. This guarantees that tools that
-- // support only single byte streams will work on any 8-bit fixed or
-- // variable length encoded stream, particularly
-- // [UTF-8](ftp://ftp.rfc-editor.org/in-notes/rfc2279.txt) and most
-- // ISO8859 variants.

-- // When a Unicode BOM is present, then the parser should interpret the
-- // stream as Unicode and choose the right UTF transform.

-- // # 8. Meta-information

-- // The '\#?' character combination used as a top level node (not
-- // necessarily the first one) is reserved for comunication between the
-- // OGDL stream and the parser. It is not mandatory and allows for
-- // future enhancements of the standard. For example, some optional
-- // behavior could be switched on. Normally meta-information will not
-- // be part of the in-memory graph. Meta-information is written in
-- // OGDL, as can be seen in the following examples.

-- //     #? ogdl 1.0

-- //     #? ( ogdl 1.0, encoding iso-8859-1 )

-- // The meta-information keys that are currently reserved are: ogdl,
-- // encoding and schema.

-- // # 9. Round-tripping

-- // OGDL streams are guaranted to round-trip in the presence of a
-- // capable parser and emitter, while maintaining a simple in-memory
-- // structure of nested nodes. Such a parser includes meta-information
-- // but not comments. Depending on the precision of the parser-emitter
-- // chain, the resulting stream may differ from the original in format
-- // or not.