darioteixeira / lambdoc

Lambdoc is a library providing support for semantically complex documents in Ocsigen web applications
GNU General Public License v2.0
17 stars 1 forks source link

Use Menhir's new incremental API to simplify Lambtex and Lambwiki readers #31

Closed darioteixeira closed 8 years ago

darioteixeira commented 9 years ago

Menhir's new incremental API allows for greater control over the parsing process. In particular, we can now drive the parser externally, which potentially offers a much cleaner solution to the on-the-fly lexer switching problem that complicated enormously the design of the Lambtex and Lambwiki readers. Note that in the current design the Lambtex reader is not even reentrant, which somewhat limits its usefulness.

Bear in mind that the redesigned readers must somehow be able to inspect the current parser state, a feature which unfortunately Menhir does not yet offer. Nevertheless, this feature is acknowledged by Menhir's developers and is planned for the near future.

darioteixeira commented 8 years ago

A better solution using Menhir's parameterised parsers was implemented.