1. riffraff
  2. shakespeare-parrot

Commits

gabriele renzi  committed dd8c905

start work on fibonacci

  • Participants
  • Parent commits 9c0478b
  • Branches default

Comments (0)

Files changed (6)

File example/fibonacci2.spl

View file
  • Ignore whitespace
+By Björn Stenberg and Linus Nielsen Feltzing 2001-08-31
+Should thee wish to bring thyselves to our attention doeth as below,
+Pointeth thy postal delivery appliance unto
+bjorn(at)haxx(dot)se or linus(at)haxx(dot)se
+
+The Fibonacci drama.
+
+Hamlet, a beacon of truth in a world of dark confusion.
+Juliet, a poor girl starting at the bottom and working her way up.
+Romeo, a messenger between Hamlet and Juliet.
+Ophelia, a fine woman bringing our heroes to new levels.
+Macbeth, a poor insulted lady making but a small appearance.
+
+
+
+                    Scene I: The taunting of Macbeth.
+
+[Enter Hamlet and Macbeth]
+
+Macbeth:
+ Thou art nothing. Open your heart!
+
+Hamlet:
+ Thou art as rotten as a disgusting dusty evil fat-kidneyed fatherless foul
+ hairy horrible infected lying pig.
+
+Macbeth:
+ Thou art as vile as the difference between nothing and the sum of a
+ snotty stinking half-witted hog and a small toad!
+ Speak your mind!
+
+Hamlet:
+ Thou art as half-witted as the cube of the difference between nothing and yourself.
+
+[Exit Macbeth]
+
+[Enter Ophelia]
+
+Hamlet:
+ Thou art as noble as myself!
+
+[Exit Ophelia]
+
+[Enter Romeo]
+
+Hamlet:
+ Thou art a hero! Open your heart.
+
+Romeo:
+ Speak your mind.
+
+                    Scene II: Tension is building.
+
+Romeo:
+ Thou art as villainous as the sum of myself and Juliet.
+ Is Macbeth worse than you? If so, we must proceed to Scene V.
+ Open your heart!
+
+[Exit Hamlet]
+
+                    Scene III: New levels of courage.
+
+[Enter Ophelia]
+
+Romeo:
+ Speak your mind!
+
+[Exeunt ophelia and romeo]
+
+                    Scene IV: Juliet has second thoughts.
+
+[Enter Juliet and Hamlet]
+
+Hamlet:
+ Thou art as fine as Romeo!
+
+[Exit Hamlet]
+
+[Enter Romeo]
+
+Juliet:
+ Thou art as cunning as Hamlet.
+
+[Exit Juliet]
+
+[Enter Hamlet]
+
+Hamlet:
+ Let us return to scene II.
+
+                    Scene V: Fin.
+
+[Exeunt]
+

File example/sum2.sp

  • Ignore whitespace
-
-Romeo, A character to store the sum.
-Juliet, An admirer who helps to calculate the sum.
-
-
-  Scene I: Juliet's conversation with Romeo.
-
-[Enter Romeo and Juliet]
-
-Juliet: Listen to your heart!
-
-Romeo:  You are as beautiful as a sweet red rose. 
-  Listen to your heart.
-
-Juliet: You are as brave as the sum of me and thyself.
-  Open your heart!
-
-[Exeunt]
-
-

File example/sum2.spl

View file
  • Ignore whitespace
+
+Romeo, A character to store the sum.
+Juliet, An admirer who helps to calculate the sum.
+
+
+  Scene I: Juliet's conversation with Romeo.
+
+[Enter Romeo and Juliet]
+
+Juliet: Listen to your heart!
+
+Romeo:  You are as beautiful as a sweet red rose. 
+  Listen to your heart.
+
+Juliet: You are as brave as the sum of me and thyself.
+  Open your heart!
+
+[Exeunt]
+
+

File src/builtins/say.pir

View file
  • Ignore whitespace
     .return ($P0)
 .end
 
+.sub 'worse'
+    .param int a
+    .param int b
+    $P0 =  'better'(a,b)
+    $P0 = not $P0
+    set_global 'the_condition', $P0
+    .return ($P0)
+.end
+
+
 
 .sub 'open_heart'
     $P0 = 'find_other'()

File src/parser/grammar.pg

View file
  • Ignore whitespace
 
 rule question {
   | <be> <value> 'better' 'than' <value>{*} #= better
+  | <be> <value> 'worse' 'than' <value>{*} #= better
   | 'is' <value> 'as' <adjective> 'as' <value>{*} #= equal
 }
 rule test {
 |<second_person_reflexive> {*} #= you_ref
 |<second_person> {*} #= you_ref
 |<first_person> {*} #= self_ref
-|<first_person> {*} #= self_ref
+|<first_person_reflexive> {*} #= self_ref
 |<character> {*} #= named_ref
 }
 

File t/11-references.t

View file
  • Ignore whitespace
 
 othello: you are the sum of me and a rose. Proove YOURself!
 
+add myself