Re: Cup (Xenophon Fenderson the Carbondated)
17 Nov 2000 23:55:26 -0500

          From comp.compilers

Related articles
Cup (Odd-R. Hogstad) (2000-10-10)
Re: Cup (2000-11-17)
| List of all articles for this month |

From: (Xenophon Fenderson the Carbondated)
Newsgroups: comp.compilers
Date: 17 Nov 2000 23:55:26 -0500
References: 00-10-065
Keywords: Java, tools
Posted-Date: 17 Nov 2000 23:55:26 EST

>>>>> "Odd-R" == Odd-R Hogstad <> writes:

        Odd-R> Does anyone know where I can find a larger example of a
        Odd-R> parser written in Cup?

Andrew Appel's _Modern Compiler Implementation_ uses CUP in the Java
version of the book. I have made the compiler my classmates and
myself wrote available at
It may not compile nor run under modern versions of Java, JLex, or
Java_CUP, but it may be still be useful as an example.

Here is my BibTeX entry for [Appel 1998]. There is probably a newer
edition available. The "annote" entry is the Library of Congress
call number.

    author = {Andrew W. Appel},
    title = {Modern compiler implementation in Java},
    publisher = {Press Syndicate of the University of Cambridge},
    year = 1998,
    address = {The Pitt Building, Trumpington Street, Cambridge CB2
                                    1RP, UK},
    note = {Java (Computer program language); Compilers (Computer programs)},
    annote = {QA76.73.J38 A65 1998}

You will probably also want to take a look at the source code and
errata for the text, which was available at

While my former classmates and the instructor (Dr. Claude Anderson at
Rose-Hulman Institute of Technology) have allowed me to post the code
on the Internet for the edification of other students, they have not
granted anyone license to use the code in question. So be careful of
incorporating more than a few lines of our code into your program.
I'd imagine 10 lines or so could be justified as "fair use" akin to
using example code from a book, but I'm no lawyer, so I don't really
know how much of our code you can use under copyright law.

If you need help understanding how the compiler works, feel free to
send me email.

Kind regards and good luck!

Post a followup to this message

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