-
Notifications
You must be signed in to change notification settings - Fork 293
/
Grammar.pod
33 lines (20 loc) · 906 Bytes
/
Grammar.pod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
=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