Author: fperrad
Date: Wed Oct 3 23:36:03 2007
New Revision: 21813
Modified:
trunk/compilers/pge/PGE/P6Regex.pir
trunk/compilers/pge/PGE/Perl6Regex.pir
trunk/runtime/parrot/library/PGE/Dumper.pir
trunk/runtime/parrot/library/PGE/P6Grammar.pir
trunk/runtime/parrot/library/PGE/Perl6Grammar.pir
Log:
[PGE]
- minor POD improvements
Modified: trunk/compilers/pge/PGE/P6Regex.pir
==============================================================================
--- trunk/compilers/pge/PGE/P6Regex.pir (original)
+++ trunk/compilers/pge/PGE/P6Regex.pir Wed Oct 3 23:36:03 2007
@@ -124,9 +124,9 @@
=item C<regex(PMC mob, PMC adverbs :slurpy :named)>
-Parses a regex according to Perl 6 regex syntax, and returns
-the corresponding parse tree. This is installed as a C<< <regex> >>
-rule in C<PGE::Grammar>, so one can call it from another regex to
+Parses a regex according to Perl 6 regex syntax, and returns
+the corresponding parse tree. This is installed as a C<< <regex> >>
+rule in C<PGE::Grammar>, so one can call it from another regex to
parse valid Perl 6 regular expressions.
=cut
@@ -272,7 +272,7 @@
=item C<parse_term(PMC mob [, PMC adverbs :slurpy :named])>
-Parses literal strings and whitespace.
+Parses literal strings and whitespace.
Return a failed match if the stoptoken is found.
=cut
@@ -319,7 +319,7 @@
$I0 = index "ABCDEFGHIJKLMNOPQRSTUVWXYZ", $S0
if $I0 < 0 goto term_backslash_1
$S0 = substr "abcdefghijklmnopqrstuvwxyz", $I0, 1
- term_backslash_1:
+ term_backslash_1:
if $S0 == 'x' goto term_backslash_x # \x.. \X..
if $S0 == 'o' goto term_backslash_o # \o.. \O..
$P0 = get_global '%esclist'
@@ -431,7 +431,7 @@
(mob, target, mfrom, mpos) = mob.newfrom(0, 'PGE::Exp::WS')
pos = mfrom
lastpos = length target
-
+
term_ws_loop:
## scan for the next non-whitespace character
pos = find_not_cclass .CCLASS_WHITESPACE, target, pos, lastpos
@@ -483,7 +483,7 @@
# The postfix:<::> operator may bring us here when it's really a
# term:<::> term. So, we check for that here and fail this match
- # if we really have a cut term.
+ # if we really have a cut term.
if key != ':' goto quant
$S0 = substr target, pos, 1
if $S0 == ':' goto end
@@ -550,14 +550,14 @@
mob['max'] = max
mpos = pos
end:
- .return (mob)
+ .return (mob)
err_closure:
parse_error(mob, pos, "Error in closure quantifier")
.end
-=item parse_quant_error(mob)
+=item C<parse_quant_error(mob)>
Throw an exception for quantifiers in term position.
@@ -772,19 +772,19 @@
op = mob['KEY']
## handle the case of <[, <+[, <-[, and <![ as the token
- ## by converting to <, <+, <-, or <!
+ ## by converting to <, <+, <-, or <!
$S0 = substr op, -1, 1
if $S0 != '[' goto parse_loop
chopn op, 1
goto enum
- parse_loop:
+ parse_loop:
pos = find_not_cclass .CCLASS_WHITESPACE, target, pos, lastpos
if pos >= lastpos goto err_close
$S0 = substr target, pos, 1
if $S0 != '[' goto subrule
inc pos
-
+
enum:
.local string charlist
.local int isrange
@@ -1278,7 +1278,7 @@
.namespace [ 'PGE::Exp::WS' ]
-.sub 'p6exp' :method
+.sub 'p6exp' :method
.param pmc pad
$I0 = pad['sigspace']
@@ -1355,7 +1355,7 @@
exp1 = self[1]
## If we're aliasing a capture group or a quantified capture
- ## group, then we just move the alias name to that group.
+ ## group, then we just move the alias name to that group.
## Otherwise, we need to create a capture group for this
## alias and return that.
Modified: trunk/compilers/pge/PGE/Perl6Regex.pir
==============================================================================
--- trunk/compilers/pge/PGE/Perl6Regex.pir (original)
+++ trunk/compilers/pge/PGE/Perl6Regex.pir Wed Oct 3 23:36:03 2007
@@ -124,8 +124,8 @@
=item C<regex(PMC mob, PMC adverbs :slurpy :named)>
-Parses a regex according to Perl 6 regex syntax, and returns
-the corresponding parse tree.
+Parses a regex according to Perl 6 regex syntax, and returns
+the corresponding parse tree.
=cut
@@ -281,7 +281,7 @@
=item C<parse_term(PMC mob [, PMC adverbs :slurpy :named])>
-Parses literal strings and whitespace.
+Parses literal strings and whitespace.
Return a failed match if the stoptoken is found.
=cut
@@ -439,7 +439,7 @@
err_negated_brackets:
parse_error(mob, pos, 'Cannot use comma in \\X[...] or \\O[...]')
.end
-
+
=item C<parse_term_ws(PMC mob)>
@@ -455,7 +455,7 @@
(mob, target, mfrom, mpos) = mob.newfrom(0, 'PGE::Exp::WS')
pos = mfrom
lastpos = length target
-
+
term_ws_loop:
## scan for the next non-whitespace character
pos = find_not_cclass .CCLASS_WHITESPACE, target, pos, lastpos
@@ -507,7 +507,7 @@
# The postfix:<::> operator may bring us here when it's really a
# term:<::> term. So, we check for that here and fail this match
- # if we really have a cut term.
+ # if we really have a cut term.
if key != ':' goto quant
$S0 = substr target, pos, 1
if $S0 == ':' goto end
@@ -574,14 +574,14 @@
mob['max'] = max
mpos = pos
end:
- .return (mob)
+ .return (mob)
err_closure:
parse_error(mob, pos, "Error in closure quantifier")
.end
-=item parse_quant_error(mob)
+=item C<parse_quant_error(mob)>
Throw an exception for quantifiers in term position.
@@ -807,19 +807,19 @@
op = mob['KEY']
## handle the case of <[, <+[, <-[, and <![ as the token
- ## by converting to <, <+, <-, or <!
+ ## by converting to <, <+, <-, or <!
$S0 = substr op, -1, 1
if $S0 != '[' goto parse_loop
chopn op, 1
goto enum
- parse_loop:
+ parse_loop:
pos = find_not_cclass .CCLASS_WHITESPACE, target, pos, lastpos
if pos >= lastpos goto err_close
$S0 = substr target, pos, 1
if $S0 != '[' goto subrule
inc pos
-
+
enum:
.local string charlist
.local int isrange
@@ -1086,7 +1086,7 @@
mob.'to'(pos)
.return (mob)
.end
-
+
.sub 'parse_error'
.param pmc mob
@@ -1332,7 +1332,7 @@
.namespace [ 'PGE::Exp::WS' ]
-.sub 'perl6exp' :method
+.sub 'perl6exp' :method
.param pmc pad
$I0 = pad['sigspace']
@@ -1409,7 +1409,7 @@
exp1 = self[1]
## If we're aliasing a capture group or a quantified capture
- ## group, then we just move the alias name to that group.
+ ## group, then we just move the alias name to that group.
## Otherwise, we need to create a capture group for this
## alias and return that.
Modified: trunk/runtime/parrot/library/PGE/Dumper.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Dumper.pir (original)
+++ trunk/runtime/parrot/library/PGE/Dumper.pir Wed Oct 3 23:36:03 2007
@@ -328,7 +328,7 @@
print "CharClass "
$S0 = self["charmatch"]
print $S0
- print " <<"
+ print " <<"
$S0 = self["charclass"]
print $S0
print ">> "
@@ -437,7 +437,7 @@
print " cscope"
dump_3:
print "\n"
- exp = self["exp1"]
+ exp = self["exp1"]
indent += 4
exp."dump"(indent)
.return ()
@@ -495,6 +495,8 @@
=back
+=cut
+
# Local Variables:
# mode: pir
# fill-column: 100
Modified: trunk/runtime/parrot/library/PGE/P6Grammar.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/P6Grammar.pir (original)
+++ trunk/runtime/parrot/library/PGE/P6Grammar.pir Wed Oct 3 23:36:03 2007
@@ -9,6 +9,7 @@
parrot P6Grammar.pir [options] file ...
From PIR:
+
.local string grammar_source
.local pmc pgc
@@ -25,7 +26,7 @@
This program takes a set of parser rules (i.e., a parser grammar)
specified in the input C<FILE>s, and compiles it into the PIR code
needed to execute the grammar. This PIR code is then suitable for
-inclusion or compilation into other larger programs.
+inclusion or compilation into other larger programs.
=head2 Options
@@ -102,7 +103,7 @@
$S0 = <<' STMT_PARSE'
$<cmd>:=(grammar) $<name>:=<arg> ;?
- | $<cmd>:=(regex|token|rule)
+ | $<cmd>:=(regex|token|rule)
$<name>:=<arg>
$<optable>:=(is optable)?
[ \{<regex>\} | <?PGE::Util::die: unable to parse regex> ]
@@ -138,7 +139,7 @@
nstable[''] = $P0
# get our initial match object
- .local pmc match
+ .local pmc match
$P0 = get_hll_global ['PGE::Match'], 'newfrom'
match = $P0(source, 0, 'PGE::P6Grammar')
Modified: trunk/runtime/parrot/library/PGE/Perl6Grammar.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Perl6Grammar.pir (original)
+++ trunk/runtime/parrot/library/PGE/Perl6Grammar.pir Wed Oct 3 23:36:03 2007
@@ -9,6 +9,7 @@
parrot Perl6Grammar.pir [options] file ...
From PIR:
+
.local string grammar_source
.local pmc pgc
@@ -25,7 +26,7 @@
This program takes a set of parser rules (i.e., a parser grammar)
specified in the input C<FILE>s, and compiles it into the PIR code
needed to execute the grammar. This PIR code is then suitable for
-inclusion or compilation into other larger programs.
+inclusion or compilation into other larger programs.
=head2 Options
@@ -108,7 +109,7 @@
$S0 = <<' STMT_PARSE'
$<cmd>:=(grammar) <name> [ 'is' $<inherit>:=<name> ]? ';'?
- | $<cmd>:=(regex|token|rule)
+ | $<cmd>:=(regex|token|rule)
$<name>:=<arg>
$<optable>:=(is optable)?
[ \{<regex>\} | <?PGE::Util::die: unable to parse regex> ]
@@ -144,7 +145,7 @@
nstable[''] = $P0
# get our initial match object
- .local pmc match
+ .local pmc match
$P0 = get_hll_global ['PGE::Match'], 'newfrom'
match = $P0(source, 0, 'PGE::Perl6Grammar')