
Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
>> Hi all!
>>
[quoted text clipped - 24 lines]
>
> Am I wrong?
The OP may, for example, be trying to write an IDE that is aware of both
HTML and PHP, and does syntax highlighting, autocompletion and other
Eclipse-like features. This IDE doesn't need to actually run the PHP code,
but merely to parse it, so it can display it in pretty colours. An IDE is
another place where it would be reasonable to want to handle "broken code",
since the programmer might be in the middle of typing a statement and
doesn't want a thousand errors to suddenly pop up after every new character
inserted.
- Oliver
Monique Y. Mudama - 25 Oct 2005 22:39 GMT
> The OP may, for example, be trying to write an IDE that is aware
> of both HTML and PHP, and does syntax highlighting,
[quoted text clipped - 5 lines]
> doesn't want a thousand errors to suddenly pop up after every
> new character inserted.
Oh. My bad. I thought this was a question about displaying/rendering
HTML in java, not colorizing the code.

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Roedy Green - 26 Oct 2005 01:53 GMT
>An IDE is
>another place where it would be reasonable to want to handle "broken code",
>since the programmer might be in the middle of typing a statement and
>doesn't want a thousand errors to suddenly pop up after every new character
>inserted.
A parser to colourise code is a quite different animal than one to
parse it to run it. I have written a number of colorouriser parsers
that work on fragments. Mine work more like the way a human does,
looking at just the immediate context looking for clues. You can't
count on there being a matching declaration.
You can see the results all over my website. Happily, getting a colour
slightly off is not fatal.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Yes.
I actually need for HTML and PHP parsing to make highlighting in my
editor.
Or the way to create this stuff.
Oliver Wong - 26 Oct 2005 15:27 GMT
> Yes.
> I actually need for HTML and PHP parsing to make highlighting in my
> editor.
> Or the way to create this stuff.
If you're going to integrate this into your own code, you might want to
try the comp.compilers group. The regulars there probably have a treasure
chest of tools for dealing with problems like these.
- Oliver