| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> |
| Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: [PATCHES] dollar quoting |
| Date: | 2004-02-17 02:54:52 |
| Message-ID: | 6259.1076986492@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers pgsql-patches |
Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2004-02-17 03:16:01 | Re: [HACKERS] dollar quoting |
| Previous Message | Christopher Kings-Lynne | 2004-02-17 02:42:22 | Re: [PATCHES] dollar quoting |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Neil Conway | 2004-02-17 03:00:49 | fix oid casting inconsistency |
| Previous Message | Christopher Kings-Lynne | 2004-02-17 02:42:22 | Re: [PATCHES] dollar quoting |