[antlr-interest] How to have strings enclosed in " and/or "
Akhilesh Mritunjai
virtualaspirin at yahoo.com
Thu Dec 9 10:04:51 PST 2004
Matthew
Though it has been quite some time for me, I think
your problem is lot simpler.
A HTML string in any tag can't start/end with
""". However, in HTML text, """ is supposed
to be used instead of literal double quotes. So the
two don't clash.
I suggest you write a preprocessor that "cleans" up
the code using a lexer grammar to clean up all the
special marks outside tags into their respective
symbolic representation, and then use the standard
grammar to parse/lex various language entities in the
cleaned-up HTML.
So something like
<font size="+1">Hello "tom & susie"</font>
should be cleaned into
<font size="+1">Hello "tom &
susie"</font>
which is more convenient to write grammar for.
- akhilesh
--- matthew ford <Matthew.Ford at forward.com.au> wrote:
>
> Hi all,
> I am having trouble in the lexer handling strings
> that start and end with "
> or "
> (might start with " and end with ")
> Some html editors kindly replace " with " when
> you load the file.
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list