Unix Programming - Re: Writing a Parser

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > July 2004 > Re: Writing a Parser





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Writing a Parser
john

2004-07-01, 5:58 pm

"Cesar A. K. Grossmann" <cakgguard-usenet2004@yahoo.com.br> wrote in message
news:<2kih35F2ojoiU1@uni-berlin.de>...
>Jens.Toerring@physik.fu-berlin.de wrote:
>
>I received you PVT message, but the response I send was refused. The
>SMTP refuses messages from the SMTP server from yahoo.com.br...
>
> From what I can see, you understand it right:
>
>
>That summarizes it pretty well.
>
>
>My error. The example I provided is wrong (I made it from memory, I
>haven't Internet at home, and I'm working in this project at home). My
>fault. Sorry about that.
>
>
>How you write rules for (f)lex to identify correctly identifiers from
>strings?
>
>I had:
>
>[[:alpha:]][[:alnum:]_]* return IDENTIFIER;
>\"[^\"]+\" return STRING;
>
>It didn't worked (but the error can be in the bison rules, as the error
>is a "parse error").
>


Bison trace facilty could be of some help. Put a '#define YYDEBUG 1'
in C declarations section, and add a line 'int yydebug = 1;' somewhere
in the code. The parser will then print each token received from yylex,
the rule used to shift a token etc.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com