@@ -27,8 +27,14 @@ More L<documentation on grammars|/language/grammars> is available.
27
27
28
28
= head2 method parse
29
29
30
+ Defined as:
31
+
30
32
method parse($target, :$rule = 'TOP', Parcel :$args = (), Mu :$actions = Mu, *%opt) {
31
33
34
+ Usage:
35
+
36
+ GRAMMAR.parse(TARGET, RULE?, ARGS?, ACTIONS?, OPTIONS?)
37
+
32
38
Parses the C < $target > (which will be coerced to L < Str|/type/Str > if it isn't
33
39
one), using C < $rule > as the starting rule. Additional C < $args > will be given
34
40
to the starting rule if provided.
@@ -100,8 +106,14 @@ This outputs:
100
106
101
107
= head2 method subparse
102
108
109
+ Defined as:
110
+
103
111
method subparse($target, :$rule = 'TOP', Parcel :$args = (), Mu :$actions = Mu, *%opt) {
104
112
113
+ Usage:
114
+
115
+ GRAMMAR.subparse(TARGET, RULE?, ARGS?, ACTIONS?, OPTIONS?)
116
+
105
117
Does exactly the same as L < method parse|/routine/parse > , except that cursor
106
118
doesn't have to reach the end of the string to succeed. (That is, it doesn't
107
119
have to match the whole string).
@@ -115,8 +127,14 @@ have to match the whole string).
115
127
116
128
= head2 method parsefile
117
129
130
+ Defined as:
131
+
118
132
method parsefile(Str(Cool) $filename, :$enc, *%opts) {
119
133
134
+ Usage:
135
+
136
+ GRAMMAR.parsefile(FILE, OPTIONS?)
137
+
120
138
Reads file C < $filename > , and parses it. All named arguments are passed on to
121
139
L < method parse|/routine/parse > .
122
140
0 commit comments