Permalink
Browse files

document Grammar

  • Loading branch information...
1 parent ee7934d commit 8a04f291f3fc41aeeeb9dd0d5c48e6e0aff4d2bb @moritz moritz committed Jul 31, 2012
Showing with 33 additions and 0 deletions.
  1. +33 −0 lib/Grammar.pod
View
@@ -0,0 +1,33 @@
+=begin pod
+
+=TITLE class Grammar
+
+ class Grammar is Cursor { }
+
+C<Grammar> is the superclass that classes automatically get when they are
+declared with the C<grammar> keyword instead of C<class>.
+
+=head1 Methods
+
+=head2 parse
+
+ method parse(Grammar:D: $str, :$rule = 'TOP', :$actions) returns Match:D
+
+Matches the grammar against C<$str>, using C<$rule> as start rule,
+optionally applying C<$actions> as actions object.
+
+Returns the resulting L<Match> object, and also sets the caller's C<$/>
+variable to the result Match object.
+
+=head2 parsefile
+
+ method parsefile(Grammar:D: $filename, :$rule = 'TOP', :$actions) returns Match:D
+
+Matches the grammar against the contents of file C<$fielname>,
+using C<$rule> as start rule,
+optionally applying C<$actions> as actions object.
+
+Returns the resulting L<Match> object, and also sets the caller's C<$/>
+variable to the result Match object.
+=end pod
+

0 comments on commit 8a04f29

Please sign in to comment.