Re: "Regular expressions" for stack automata?

"Quinn Tyler Jackson" <qjackson@wave.home.com>
4 Oct 1999 12:18:16 -0400

          From comp.compilers

Related articles
"Regular expressions" for stack automata? Marko.Makela@HUT.FI (Marko =?ISO-8859-1?Q?M=E4kel=E4?=) (1999-09-10)
Re: "Regular expressions" for stack automata? Marko.Makela@HUT.FI (Marko =?ISO-8859-1?Q?M=E4kel=E4?=) (1999-09-16)
Re: "Regular expressions" for stack automata? world!cfc@uunet.uu.net (Chris F Clark) (1999-09-20)
Re: "Regular expressions" for stack automata? ilya@math.ohio-state.edu (1999-09-24)
Re: "Regular expressions" for stack automata? qjackson@wave.home.com (Quinn Tyler Jackson) (1999-10-04)
| List of all articles for this month |

From: "Quinn Tyler Jackson" <qjackson@wave.home.com>
Newsgroups: comp.compilers
Date: 4 Oct 1999 12:18:16 -0400
Organization: Compilers Central
References: 99-09-030
Keywords: lex, parse

> enclosed by matching parentheses. For instance, if one wants to
> search for a call to function f() followed by a comma, the regular
> expression
>
> f([^()]*),
>
> will not match e.g. the string
>
> f(1 + (2 * 3)),
>
> since the argument contains parentheses.


I've had that particular thing crop up so often that I added a clause
type in LPM that does it like this:


        [&


Or you could also do this:


        ['begin';'end'&


which would match:


        begin
                // any amount of foo
                begin
                        // some nested quux
                end
        end


It's more or less a hack that breaks all the rules, however, intended
for shallow parsing of things like parameter lists in function calls.
It cannot catch things like this:


        (" )", a, b, c)


since it sees the closing parenthesis in the quoted string as the
balancing delimiter.
--
Quinn Tyler Jackson
http://www.qtj.net/~quinn/


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.