gabriele renzi  committed 0ee7ce9

add manual.txt

  • Participants
  • Parent commits 2e54acf
  • Branches default

Comments (0)

Files changed (2)

 SPL is a language designed to allow usage of the beatiful shakespear wording 
 while writing executable code. 
-The reference implementation is at [1] and the official Wiki is at [2]
+The reference implementation is at [1] and you can see some more info in the page for the shakespeare frontend for GCC [2]
 Quoting from the original project:
 How Reductive! SPL is a great achievement in unifying art and code, a noble
 goal which must not be underestimated.
+So, to try to learn a bit about Parrot[3], I did this. 
 If you are reading this you must have obtained the shakespeare-parrot 
 such as --target=(parse|pir) to see the parse three and the PIR output.
 The original SPL project generates C code that con be compiled and linked with
 libspl to generate executables, through SPLC.
-The parser is built with yacc/bison and the lexer is flex. The Perl port[3] uses
+The parser is built with yacc/bison and the lexer is flex. The Perl port[4] uses
 the same parser and lexer.
 This parrot version uses PGE to parse the grammar and generate an AST, 
 dramatic-software projects. 
 Thus, I've added two new instructions to the language to minimally support the
-Test Anything Protocol (TAP)[4]
+Test Anything Protocol (TAP)[5]
  * plan an evil thing!
    will print "1..2". Every valid value can be used after the word 'plan'.
-   Suggestions for improving are welcome.
+   Suggestions for improving are welcome, I'm thinking of using 
+   [othello plans an evil thing]
  * proove yourself!
    will print "ok x" where x is the value of the spoken character. 
    Every valid value can be used after the word 'proove'
 To verify that everything works you can run "make fulltest" which will execute
 both the standard test suite and the examples' test suite. 
+The language is pretty simple:
+ #! an optional she bang line
+ a title, terminated by a dot, that may span multiple lines.
+ charname, a valid name with ignored descr.
+ other, a valid shakespeare char.
+ Act I: contains scenes, a description.
+ Scene I: contains events, is a label.
+ [enter char and char]
+ [enter char]
+ char: sentence. sentence! sentence?
+ other: sentence!
+ [exit foo]
+ [exeunt]
+ [exeunt foo and foo]
+sentences may be:
+* proove <value> # prints "ok <value>"
+* plan <value> # prints "plan <value>"
+* remember <value> # push <value> in the spoken person stack
+* let us proceed|return to scene <label> # goto
+* <be> <value> better|worse|as good as <value> # sets condition flag
+* if so|not, <sentence> # if|unless stmt checking the flag
+* input 
+** open your mind, # read a char
+** listen to your heart # read a number
+* output
+** open your heart # print the number
+** speak your mind # print the char
+* you are <value> # assign a value
+* recall <a string> # pop the value in the stack
+A value is either a 
+* constant expressed as
+ positive|neutral name  = 1
+ negative name = -1
+ nothing|zero = 0
+that is dobuled by the adjectives in front of it
+a pretty king = 2
+an ugly pig = -2
+* computation
+ the sum of <v> and <v>
+ the difference between <v> and <v>
+ the square of <v>
+ twice <v>
+* a reference to another character's value
+ othello, you, me
+Notice that programs develop through usage of 
+first_persons and second_persons, so for example
+juliet: you are nothing #assigns 0 to the spoken person
+romeo: you are as good as me # assign 0 to juliet
+Characters have both a main value (assigned) and a 
+stack value where values are pushed with "remember".
+When the "recall" statement gets in the current value of 
+the character is replaced by that obtained by pushing the 
+juliet: you are nothing #assigns 0 to the spoken person
+romeo: You are a pig! # -1
+       Remember me.    # 0 in stack, -1 stays as value
+       Recall your ancestry! # empty stack, 0 as value
+Please see the test suite and the examples/* files for 
+further information.
+The file src/parsers/ is the reference for 
+the available statements, while src/parser/ 
+shows what is considered good or bad, what are the valid 
+characters and what are the valid adjectives, articles and pronouns.