Search:

Menu

GPMachine

Download

Feedback/Contribution

RunningGPMachine

Running GPMachine

  1. Quick way: There are two scripts: run.sh (linux) and run.bat (windows). Just launch the script corresponding to your system (./run.sh or click it). (Warning: under linux, ensure that run.sh is executable (chmod u+x run.sh)).
  2. Hard way: Type "java -jar gpmachine.jar [options] filename" and use the options to fine-tune the execution (with/without user interface, with/without license display, ...).

Input Files Format

The input PCode must be stored in a file. This input PCode obeys Wilhelm and Maurer's definition. Have a look at the Requirements to check the exact syntax of the instructions. It has been modified as follows:

Additions: Below, char* and char+ stand for (respectively) 0-n characters and 1-n characters.

  • read : asks the user to input an integer. When completed, pushes this integer on top of stack.
  • prin : pops an integer from the stack and displays it on the output.
  • @define (char+) : "define foo" defines a label foo. Any jumping command (like ujp or fjp) referring to foo will make PC jumps to this line of PCode. When executed, this instruction has no effect on the Stack. Note that we replace Whilelm and Maurer's notation :
            lab: statement

by

            define lab
            statement
  • ;(char)* : defines a comment: this line will be ignored. The semicolon must be the first character of the line.
  • pop: pops the element on top of stack and throw it away.

Typical use

Running io.pm, with GUI, no license: java -jar gpmachine.jar -gui --nolicense io.pm

Running io.pm, using stdin/stdout, with verbose output: java -jar gpmachine.jar -v io.pm

Page last modified on September 17, 2008, at 11:58 AM

copyright (c) 2008 by Faculté d Informatique, FUNDP Namur