On Wed, 6 Aug 2003, Bertrand Delacretaz wrote:

> > ...I think the logical (and annoying) question now is: couldn't
> > chaperon be
> > used?
>
> Most probably, but after looking at (and doing some work on) the wiki
> grammar of Chaperon I have a feeling that Chaperon isn't ideal for
> semi-structured line-oriented stuff.
>
> Stephan did a great job with the Chaperon wiki grammar, but if you look
> at it closely there seems to be a fight between the structure that
> Chaperon expects from its input and the more free-form wiki input.

You're right, the Chaperon parser suffers on the fact that it expects
a well structured input, such like programming languages. Nevertheless,
it works in some cases of semi-structured input.

In the past I was asked sometimes for a better solution in cases
of semi structured text, when I recommended 'regular fragmentations'
(http://www.simonstl.com/projects/fragment/)

> The
> fact that fairly extensive XSLT postprocessing of Chaperon's output for
> wiki text is required also shows this "impedance mismatch" IMHO.

The postprocessing is in most cases a 1:1 projection if the output
structure has the same structure as the AST(Abstract Syntax Tree), like
wiki.

> I wasn't sure whether to add SlopGenerator in the scratchpad or as an
> unstable block, but as several blocks are clearly experimental I think
> it can't hurt, and our virtual Darwin should take care of if eventually.

I would be happier to see an implementation of 'regular fragmentations'.
This should also work in Slop's case, like

^([^:]+) : ([^:]+)$

<line>
 <name>\1</name>
 <value>\2</value>
</line>

I tried this with the PatternTransformer, but came not very far,

BTW, I working extremely on the Chaperon codebase, to
change the implementation to Tomita's algorithm, which should avoid
problems with parser conflict, inspired by following blog entry:
http://blogs.gotdotnet.com/emeijer/permalink.aspx/793d40fe-47b5-4ab7-a73c-53b50851a8ee

I also add error productions and error recovery algorithms etc. I also
plan to make the grammar format simpler.

But all this take time, and I'm not very fast.

Stephan

Reply via email to