Re: [PATCHES] dollar quoting - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] dollar quoting
Date
Msg-id 6259.1076986492@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] dollar quoting  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>> Parsing is a whole nother ball of wax besides lexing.

> Forgive my lameness, but I've never truly figured out where parsing ends 
> and lexing begins.  Anyone care to illuminate me on the difference?

The theoretical answer is that you can do lexing with a finite-state
machine, but parsing generally requires a stack, because it supports
nested constructs.  Lexers don't have any way to describe nested
constructs --- a series of tokens is the only level of abstraction there
is.

The practical answer is that you do one with flex and the other with
bison ;-).  If you can do it with flex, and not cheat by implementing
your own state stack, it's lexing.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: [PATCHES] dollar quoting
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] dollar quoting