Re: Language with comments

2007-05-08 Thread Kelly Leahy
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

Re: Help with a simple grammar I can't get to work, please

2006-09-26 Thread Kelly Leahy
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

Re: Google summer of code

2006-05-10 Thread Kelly Leahy
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

Re: question

2005-08-14 Thread Kelly Leahy
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

Re: "Eating" comments: not with Flex but with Bison

2005-06-14 Thread Kelly Leahy
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,

Re: x + (y) + z

2005-03-03 Thread Kelly Leahy
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

Re: x + (y) + z

2005-03-03 Thread Kelly Leahy
> 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