2010-08-30 10:30, Jan Paul Posma skrev:
I saw the demo of the sentence level editor and
it looks really cool,
but I don't think that you should expect any miracles regarding the
parser performance.
Yeah, well, let's see how the final version with PHP integration
performs. I just hope it'll be better than the current parser :-)
However, as it is much easier to have a multitude
of renderers, I would
suggest to write a special renderer for the sentence level editor to
label each sentence with an identifier. Then you could introduce a
"save sentence" operation that saves the page, but only reparses the
particular sentence.
Yeah, this was my initial approach, but the problem is that there're
dependencies across the page (i.e. references). Perhaps I can include a check to decide
whether to update the whole page or only a part of it. For now though, updating the whole
page seems like the most robust approach.
Anyway, what are your plans for PHP integration?
The antlr runtime support reading
input from a utf-8, utf-16 or utf-32
encoded buffer, so I guess that on the input side the integration
should be trivial. The documentation on
php.net is very limited, but
I guess that one of those encodings are used?
On the ouput side there are two approaches:
1. Implement a listener that outputs html code to a php readable
buffer.
2. Export the listener api to php.
1. is fast and 2. is flexible, so it would probably be a good idea to
do both.
It would be really nice to be able to include hooks
after the lexer, but before actual parsing.
That could be done, but I would not recommend it. What application do
you have in mind?
/Andreas