help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with error in Bison


From: Jorge Oliveira
Subject: Help with error in Bison
Date: 01 Jan 2003 21:31:29 +0000

Hello!

For a project at college i am working in a "look like C language"
grammar in a Flex/Bison environment 

I'm having one problem.

It goes like this:

        After compiling with no errors i try a small phrase like 
int x;
        This phrase is correct and is accepted by the parser.
        If I write another phrase like that its generated the following parser
error 

int x;

int y;
parse error, unexpected V_INT, expecting $
parse error, unexpected ID, expecting V_INT
parse error, unexpected ';', expecting V_INT

        An odd thing is that if i do not put the ";" at the end of the first
phrase the parser does not generate any error and the error at the
second phrase is like this 

int x

int y
parse error, unexpected V_INT, expecting ';' or ','
parse error, unexpected ID, expecting V_INT

This should be a problem of communication between Flex and Bison but I
cant see what.

I'm including the Flex and the Bison sources as well as the script I use
to compile them. These are not the complete sources but can well
illustrate the problem I described.

Thanks in advance for any help 

JotaO (Jorge Oliveira)
Braga-Portugal

Attachment: tpf3-help.flex
Description: Text document

Attachment: tpf3-help.y
Description: Text document

Attachment: g
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]