"=?ISO-8859-1?B?V2VuIFlp?=" <896634148@xxxxxx> 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