A
Afanasiy
What's the best method for coloring simple markup?
<xyz att="val" att="val">
You can assume it is not HTML or XML or valid anything
except markup which happens to look somewhat like them.
You can assume xyz < > = and " always exist for each tag.
What methods are usually employed?
I am not exactly looking for a boxed or roundabout solution using a big
3rd party package. I am curious and want something simple and/or clever.
I would like to know what the common methods for doing this might be.
If re supported some sort of nesting/recursion I think I could do it, but
it seems it does not, so I am currently using a bunch of re expressions,
and it's not exactly fun. I am considering a straight parser with finite
state machine instead... but I thought I'd ask... What other methods?
( p.s. The coloring aspect is not exactly important, as long as
whatever the method is would allow me to color it, ie. parse it )
<xyz att="val" att="val">
You can assume it is not HTML or XML or valid anything
except markup which happens to look somewhat like them.
You can assume xyz < > = and " always exist for each tag.
What methods are usually employed?
I am not exactly looking for a boxed or roundabout solution using a big
3rd party package. I am curious and want something simple and/or clever.
I would like to know what the common methods for doing this might be.
If re supported some sort of nesting/recursion I think I could do it, but
it seems it does not, so I am currently using a bunch of re expressions,
and it's not exactly fun. I am considering a straight parser with finite
state machine instead... but I thought I'd ask... What other methods?
( p.s. The coloring aspect is not exactly important, as long as
whatever the method is would allow me to color it, ie. parse it )