Re: Precedence Rules for '$' and '^'

Joachim Durchholz <jo@durchholz.org>
Thu, 13 Sep 2007 07:52:30 +0200

          From comp.compilers

Related articles
Precedence Rules for '$' and '^' jamin.hanson@googlemail.com (2007-09-12)
Re: Precedence Rules for '$' and '^' jo@durchholz.org (Joachim Durchholz) (2007-09-13)
Re: Precedence Rules for '$' and '^' jo@durchholz.org (Joachim Durchholz) (2007-09-13)
Re: Precedence Rules for '$' and '^' jamin.hanson@googlemail.com (2007-09-14)
Re: Precedence Rules for '$' and '^' rsc@swtch.com (Russ Cox) (2007-09-14)
Re: Precedence Rules for '$' and '^' jo@durchholz.org (Joachim Durchholz) (2007-09-15)
Re: Precedence Rules for '$' and '^' cfc@shell01.TheWorld.com (Chris F Clark) (2007-09-17)
Re: Precedence Rules for '$' and '^' jamin.hanson@googlemail.com (2007-09-17)
| List of all articles for this month |

From: Joachim Durchholz <jo@durchholz.org>
Newsgroups: comp.compilers
Date: Thu, 13 Sep 2007 07:52:30 +0200
Organization: 1&1 Internet AG
References: 07-09-035
Keywords: lex, comment
Posted-Date: 13 Sep 2007 13:28:30 EDT

jamin.hanson@googlemail.com schrieb:
> Hi there,
>
> I am author of lexertl (http://www.benhanson.net/lexertl.html), a
> lexer generator library, and I have recently added support for '^' and
> '$'. As position matching in regex is not described in any books I
> have looked at, does anyone know what the precedence rules should be?


I think Perl regexes are what people expect, so I'd stick with the
precedences that PCRE uses.


> If an earlier rule starts with '$', does that mean that a subsequent
> rule starting with '^' has the '^' ignored?


I didn't understand that. A concrete example might help.


Regards,
Jo
[I don't understand it either. My understanding of typical REs is
that they special case ^ at the beginning of a pattern or chunk
that could match at the beginning, and $ at the end. -John]


Post a followup to this message

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