On 7/30/07, David Teller <[EMAIL PROTECTED]> wrote: > > Hi, > I'm currently exploring the code, as a preliminary to writing a static > analysis tool. At the moment, I'm stuck in the lexer, where I have two > questions. > > Firstly, embedded comments seem to be forbidden. That is, a block such > as > /* bla /* more bla */ even more bla*/ > will be passed to the parser as > even more bla */ > Is that normal ?
Yes. > Is that desired ? It's Traditional, at least. Most languages don't seem to care about nested comments. Standard ML and Modula-3 are the only ones that come to mind right now. > Secondly, regular expressions. From what I gather, a regular expression > containing a "x" anywhere can be multiline. Is that it ? It sounds too > strange to be true. No, a regular expression that is trailed by an 'x' flag can be multiline, eg /a*b c*d/x This introduces an interesting problem for the lexer because it can't know whether the x flag is present until it's lexed the regular expression. The rule is that it must assume the x flag is present, and, coming to the end and finding it not there after all, must throw a syntax error. --lars > > Thanks, > David > > -- > David Teller ------------------------------------------ > Security of Distributed Systems ----------------------- > -- http://www.univ-orleans.fr/lifo/Members/David.Teller > ----- Laboratoire d'Informatique Fondamentale d'Orleans > > _______________________________________________ > Es4-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es4-discuss > _______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss
