Re: Lexer patch question - Mailing list pgsql-patches

From Tom Lane
Subject Re: Lexer patch question
Date
Msg-id 4515.1118857142@sss.pgh.pa.us
Whole thread Raw
In response to Re: Lexer patch question  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Lexer patch question
Next
From: Peter Eisentraut
Date:
Subject: Re: Add PG version number to NLS files