From: Tom Lane <tgl@sss.pgh.pa.us>
To: Wen Yi <896634148@qq.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: [Beginner Question]A question about yacc & lex
Date: Fri, 02 Jun 2023 08:07:12 -0400
Message-ID: <49210.1685707632@sss.pgh.pa.us> (raw)
In-Reply-To: <tencent_303FE91897A1BA9E5511D30648B8B826B707@qq.com>
References: <tencent_303FE91897A1BA9E5511D30648B8B826B707@qq.com>
"=?ISO-8859-1?B?V2VuIFlp?=" <896634148@qq.com> writes:
> I don't know why are there many extra spaces in the output, and why the error message 'syntax error' is showed.
You didn't say exactly what you typed at it, but:
Your flex lexer lacks actions for many possible input characters,
notably spaces. I seem to recall that the default action in
such cases is to print the character on stdout.
The grammar lacks any way to deal with any input after the
first newline. Anything except EOF will draw a syntax error.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, 896634148@qq.com
Subject: Re: [Beginner Question]A question about yacc & lex
In-Reply-To: <49210.1685707632@sss.pgh.pa.us>
References: <tencent_303FE91897A1BA9E5511D30648B8B826B707@qq.com> <49210.1685707632@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox