Stefano,
You should recognize the entire comment in one lexical pass, and should NOT
return the '#' token. In other words, treat the '#' begun comment as
whitespace - do the same for it that you do for whitespace. Write a regular
expression for single-line comments that matches everything to
I think your rule for the grammar should use END in place of the '\n' in
endline. The problem is that the lexical analyzer sends an END, but the
grammar looks for a '\n', IMO.
Kelly
- Original Message
From: Dustin Robert Kick <[EMAIL PROTECTED]>
To: help-bison@gnu.org
Cc: Dustin Rober
Akim,
Pascal did exist on mainframes, and in fact, was quite
prevalent, at least in the insurance industry (where I
work). Much of the code I've worked on was passed
down from mainframe code (now on PCs, previously on
some sort of minis - I don't know which).
I'm pretty confident that there was
I don't see you allocating memory for myoutput
anywhere. Perhaps you could declare myoutput as
char[512] or something like that to begin with.
Otherwise, in your myoutput == NULL branch of the IF
statement, you need to allocate memory, rather than
just doing strcpy.
Kelly
--- David Ja <[EMAIL P
Frans,
If I understand you correctly, you want to know
whether comments were in the source, but you don't
care about the exact contents of the comments, right?
If this is the case, how much do you need to know
about the comments? Do you need, for instance, the
line number on which they appeared,
By the way, you might want to have a look at
http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
I don't know if it's different from what you are
working from, and I'm not sure how it does in Bison,
but it might be worth a try.
Kelly
--- Derek M Jones <[EMAIL PROTECTED]> wrote:
> All,
>
> The
> to
>
> add-expr:
> mul-expr|
> mult-expr '+' add-expr |
> mult-expr '-' add-expr ;
>
I don't think that's what you want if you're planning
on executing the code you generate from this...
This means that 3 - 4 + 4 = -5, rather