Re: Lexer patch question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Lexer patch question
Date: 2005-06-15 17:39:02
Message-ID: 4515.1118857142@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Oh, I didn't realize lexers would choose the longer token when given
> multiple options.

See lines 95-100 in scan.l:

* OK, here is a short description of lex/flex rules behavior.
* The longest pattern which matches an input string is always chosen.
* For equal-length patterns, the first occurring in the rules list is chosen.
* INITIAL is the starting state, to which all non-conditional rules apply.
* Exclusive states change parsing rules while the state is active. When in
* an exclusive state, only those rules defined for that state apply.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2005-06-15 18:32:32 Re: Add PG version number to NLS files
Previous Message Bruce Momjian 2005-06-15 17:36:22 Re: Lexer patch question