Re: question

2005-08-14 Thread David Ja
Hi, Thank you guys very much. I noticed my mistakes as well. Forgetting to allocate memory is quite embrassing. Thank you very much again for helping me. I guess in a sense it is a pretty-printing function. The point however is not the print anything. I want to generate a bunch of strings bas

Re: help with an if rule!

2005-08-14 Thread Hans Aberg
On 14 Aug 2005, at 21:43, Roberto Mandall wrote: thx for the answer,but i still get errors, i guess i just do not undertsnad bison well enough. i have this now: %nonassoc ELSE %nonassoc THEN open_if_statement : IF boolean_expression {} THEN statement {/} |IF boolean_expression {

Re: help with an if rule!

2005-08-14 Thread Roberto Mandall
thx for the answer,but i still get errors, i guess i just do not undertsnad bison well enough. i have this now: %nonassoc ELSE %nonassoc THEN open_if_statement : IF boolean_expression {} THEN statement {/} |IF boolean_expression {} THEN closed_statement ELSE open_statement{} ;

Re: help with an if rule!

2005-08-14 Thread Hans Aberg
On 14 Aug 2005, at 18:53, Roberto Mandall wrote: open_if_statement : IF boolean_expression THEN statement |IF boolean_expression THEN closed_statement ELSE open_statement; closed_if_statement : IF boolean_expression THEN closed_statement ELSE closed_statement; i want to add

Re: question

2005-08-14 Thread Hans Aberg
On 14 Aug 2005, at 06:15, David Ja wrote: I been trying to adapted bison to my own purpose but after a month of trying I can't seem to figure out a way to make it work. All I wanted to do was to take advantage of bison's parser which generates the DFA, Bison does not generate a DFA, but

help with an if rule!

2005-08-14 Thread Roberto Mandall
hi there, i have these rules for a pascal comp: open_if_statement : IF boolean_expression THEN statement |IF boolean_expression THEN closed_statement ELSE open_statement; closed_if_statement : IF boolean_expression THEN closed_statement ELSE closed_statement; i want to add some

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

question

2005-08-14 Thread David Ja
Hi, My name is David Ja, an undergraduate student at university of pennsylvania. I am attempting to start a minor research project myself. I been trying to adapted bison to my own purpose but after a month of trying I can't seem to figure out a way to make it work. All I wanted to do was to ta