
PEP EXAMPLES

 This folder contains some example scripts in the pep script language. Scripts
 have the file extension ".pss". These examples can be run using the 
 interpreter and debugger ("pep") or by translating to java, c, go, python,
 ruby etc and then (compiling and) running
 
 The interpreter is implemented in c at /books/pars/object/pep.c The main
 documentation file is "here" http://bumble.sf.net/books/pars/pars-book.txt 

 * examples can be run with the interpreter by typing
 >> pep -f eg/script.pss input-file 
 * or 
 >> pep -f eg/script.pss -i <input-text>

 Examples can be translated into java,tcl,ruby,python,c,go by running
 the translation script

 * translate into go, compile and run
 ---
   pep -f tr/translate.go.pss eg/script.pss > eg/golang/script.go
   cd eg/golang/; go build script.go
   echo "<input>" | ./script

 This folder to contains examples of the capabilities of the pattern parsing
 machine.
 
DONE

  Add powers ^ to the exp.tolisp.pss script. Also add decimal numbers
  and negative numbers and expressions. Make a numbers only version
  and test the output with clisp.
 * 
TODO

  
  Make a "table of contents" parser: that is, extract headings from some
  document and format and accumulate them in a tape cell (probably the 
  first tape cell). Also parse and translate the rest of the document
  at the same time. This involves making sure that multiple 
  "pop;" statements do not move the tape pointer back to the 1st 
  tape cell. One solution is to use mark/go to realign the tape pointer

  -----
    begin { ++; mark "top"; }  
    # .... more code
    "token*token*" {
      clear; add "new.token*"; push;
      go "top";  
    }
  ,,,,

  
  * A tiny basic interpreter/translator.

  * A "logo" parser/interpreter with turtle drawing.
  The logo parser has an extra challenge... namely that it is necessary
  to know the signature of a user defined function in order to
  parse it. eg
    >> p1 p2 10 20
  This could be parsed as "p1 (p2 10) 20" or as "p1 (p2 10 20)"

  * or invent a new drawing/animation/gaming language (getting 
    ambitious which has a slightly more sensible syntax that "logo"

SOME EXAMPLES

  * eg/exp.tolisp.pss
    converts basic arithmetic expressions to a lisp format 

  * eg/json.check.pss
    checks json text input for grammatical correctness

  * eg/natural.language.pss
    implements an extremely limited natural language parser.

 [[ img/screenshot.png "caption or "title" >> ]]

