problem with cup

"Xavier Didelot" <>
15 Jul 2002 23:45:31 -0400

          From comp.compilers

Related articles
problem with cup (Xavier Didelot) (2002-07-15)
Re: problem with cup (Roni Hursti) (2002-07-31)
| List of all articles for this month |

From: "Xavier Didelot" <>
Newsgroups: comp.compilers
Date: 15 Jul 2002 23:45:31 -0400
Organization: Club Web!
Keywords: Java, question
Posted-Date: 15 Jul 2002 23:45:29 EDT


I have a little problem using cup. I need to have my program for
example write something in a file in certain cases of the grammar. I
have a rule looking like this :

expr ::= true {: file.println("lol"); :}

but how to make the variable file accessible to this part of the code
? this line of code will be in the cup$parser$actions class, so that
it doesn't have access to anything... Or is there a way to give it a
member and initialize it in the cup file ? (of course it would be easy
to make it work by modifing the code generated by cup, but it's not my

Xavier Didelot

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.