Instructions for running JavaCup

  1. Click this to get the javaCup tar file.
  2. Unzip the tar file using the following command:
     tar -xvf javaCup.tar
  3. To run your javaCup, in the directory that is one layer above java_cup,  type
     java java_cup.Main < yourCupFile 
    The above command will generate the parser. It needs to work together with a scanner. You can also look at the script files calc and calc2, to see the sequence of command to run the program. Note that JLex package should be also under your current directory. You can run those commands in sequence automatically. In Unix/Linux/Ubunto/OS X, type
    calc
    
    to run the sequence of command. Before the first time you run it, you need to change the access mode by typing
     chmod 755 calc
  4. In Windows command line, you need to save the file as calc.bati, then type
    calc
    
    without .bat.