The parser is built with yacc/bison and the lexer is flex. The Perl port uses
the same parser and lexer.
-This parrot version uses PGE to parse the grammar and generate and AST,
-The parrot toolchain allows automatic transforming the PAST (Parrot AST) into
+This parrot version uses PGE to parse the grammar and generate an AST,
+The parrot toolchain allows automatic transformation of the PAST (Parrot AST) into
POST and then PIR (parrot's high level assembly).
-When executed this code is translated into bytecode and it uses the functions
-defined in src/builtins/base.pir to operate.
+When executed this intermediate code is translated into bytecode and it uses
+the functions defined in src/builtins/base.pir to operate.
The runtime uses some global variables:
* the_cast contains a list of characters, each one a tuple
(value, stack, name, onstage flag)
* the_speaker refers the current speaker, so that the references "thou" and "me"
- are meaningful. Using objects wa another option but overkill.
-* the_condition is a boolean value that gets set from a statement
- ("is foo better than bar") and is later refered. Inlining of the
+ are meaningful. Using objects was another option.
+* the_condition is a boolean value that gets set from a 'question' statement
+ ("is foo better than bar?") and is refrenced later. Inlining of the
value would require a lot of work when building the AST, while the bytecode
compiler should have no problems doing it.
The list of valid words was originally generated from a list of wordlist files
with an AWK script I have lost track of. It's in the TODO list to fix it.
-Notice that since PGE doesn't do (yet) longest token matching a token like this
+Notice that since PGE doesn't do (yet) longest token matching a token like this
-would cause a failure to parse "an empty bottle". The words where I had test
-failures were reverted by hand, some may still cause failures.
+would cause a failure to parse "an empty bottle" because the token 'a'
+is matched and the token does not backtracks. The grammar goes on trying to
+match 'n' and thus fails.
+The cases words where I had test failures were hand fixed, some may still
-LANGUAGE EXTENSIONS FOR TESTING SUPPORT
Shakespeare did not originally support testing explicitly, but in the modern
world of software engineering this would have prohibited building large scale
If Romeo has an higher value than Juliet "ok 0" will be printed, and considered
as a test failure from the test harness.
+The grammar also ignores she-bang lines #!.
DIFFERENCES FROM OTHER IMPLEMENTATIONS