Re: [Beginner Question]A question about yacc & lex

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Wen Yi <896634148(at)qq(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: [Beginner Question]A question about yacc & lex
Date: 2023-06-02 12:07:12
Message-ID: 49210.1685707632@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"=?ISO-8859-1?B?V2VuIFlp?=" <896634148(at)qq(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan S. Katz 2023-06-02 12:14:45 Re: Pg 16: will pg_dump & pg_restore be faster?
Previous Message Wen Yi 2023-06-02 00:47:17 [Beginner Question]A question about yacc & lex