How to use the Pascal-S compiler


  1. expand the tar.gz file.
    [ex]
    % tar zxvf Pascal-S.tar.gz
    (or % gzip -cd Pascal-S.tar.gz | tar xvf )
    

  2. move to Pascal-S directory and then execute sablecc and compile the sources.
    [ex]
    % cd Pascal-S
    % sablecc pascal.grammar
    % javac pascal/Main.java
    

  3. compile a Pascal-S source with the Pascal-S compiler.
    [ex]
    % java pascal.Main sample.p
    

  4. then you can get a P4 code in a file named "prr". So you can run P4 interpreter as follows.
    [ex]
    % mv prr prd
    % pint < /dev/null   (or pint < input)