Author: allison
Date: Mon Nov 7 08:13:19 2005
New Revision: 9818
Modified:
trunk/ (props changed)
trunk/config/gen/makefiles/punie.in
trunk/languages/punie/PunieGrammar.pir
trunk/languages/punie/punie.pir
Log:
Will Coleda's patch for makefile and deprecation issues in Punie (with
some modifications). Ticket #37619.
Modified: trunk/config/gen/makefiles/punie.in
==============================================================================
--- trunk/config/gen/makefiles/punie.in (original)
+++ trunk/config/gen/makefiles/punie.in Mon Nov 7 08:13:19 2005
@@ -10,7 +10,7 @@ CP = ${cp}
# the default target
all: punie.pbc
-punie.pbc: PunieGrammar.pir
+punie.pbc: PunieGrammar.pir punie.pir
$(PARROT) -o punie.pbc --output-pbc punie.pir
# This is a listing of all targets, that are meant to be called by users
Modified: trunk/languages/punie/PunieGrammar.pir
==============================================================================
--- trunk/languages/punie/PunieGrammar.pir (original)
+++ trunk/languages/punie/PunieGrammar.pir Mon Nov 7 08:13:19 2005
@@ -4,17 +4,17 @@ PunieGrammar -- A grammar for parsing Pe
=head1 SYNOPSYS
- .sub _main @MAIN
- load_bytecode "PunieGrammar.pir"
+ .sub _main :main
+ load_bytecode 'PunieGrammar.pir'
.local pmc line
.local pmc match
.local string source
# Perl 1 source code
- source = "print 1;"
+ source = 'print 1;'
# Retrieve the start rule
- line = find_global "PunieGrammar", "line"
+ line = find_global 'PunieGrammar', 'line'
# Parse the source and return a match object
match = line(source)
@@ -31,26 +31,26 @@ of the PGE::Rule class. It parses a stri
its hierarchy of rules and returns a PGE::Match object (a parse tree).
Currently, all it can parse is a single statement printing a single
-digit, in the form of "print 1;".
+digit, in the form of 'print 1;'.
=cut
-.namespace [ "PunieGrammar" ]
+.namespace [ 'PunieGrammar' ]
-.sub _load @LOAD
- load_bytecode "../../runtime/parrot/library/PGE.pbc"
+.sub _load :load
+ load_bytecode 'PGE.pbc'
- $P0 = getclass "PGE::Rule"
- $P1 = subclass $P0, "PunieGrammar"
+ $P0 = getclass 'PGE::Rule'
+ $P1 = subclass $P0, 'PunieGrammar'
# Construct the grammar
.local pmc p6rule
- find_global p6rule, "PGE", "p6rule"
+ find_global p6rule, 'PGE', 'p6rule'
- p6rule("\d", "PunieGrammar", "term")
- p6rule("print \s* <PunieGrammar::expr>", "PunieGrammar", "gprint")
- p6rule("<PunieGrammar::gprint> | <PunieGrammar::term>", "PunieGrammar",
"expr")
- p6rule("<PunieGrammar::expr>;", "PunieGrammar", "line")
+ p6rule('\d', 'PunieGrammar', 'term')
+ p6rule('print \s* <PunieGrammar::expr>', 'PunieGrammar', 'gprint')
+ p6rule('<PunieGrammar::gprint> | <PunieGrammar::term>', 'PunieGrammar',
'expr')
+ p6rule('<PunieGrammar::expr>;', 'PunieGrammar', 'line')
.end
=head1 LICENSE
Modified: trunk/languages/punie/punie.pir
==============================================================================
--- trunk/languages/punie/punie.pir (original)
+++ trunk/languages/punie/punie.pir Mon Nov 7 08:13:19 2005
@@ -23,7 +23,7 @@ single digit, in the form of:
=cut
-.sub _main @MAIN
+.sub _main :main
.param pmc argv
load_bytecode "languages/punie/PunieGrammar.pir"
@@ -41,6 +41,7 @@ single digit, in the form of:
$I0 = match.__get_bool()
unless $I0 goto match_fail # if match fails stop
# print "parse succeeded\n"
+# load_bytecode "PGE/Dumper.pbc"
# match.dump()
# "Traverse" the parse tree (currently a hack)