Camelia

class Grammar

src
    class Grammar is Cursor { }

 
Grammar is the superclass that classes automatically get when they are declared with the grammar keyword instead of class .

Methods

parse

    method parse(Grammar:D: $str, :$rule = 'TOP', :$actions) returns Match:D

 
Matches the grammar against $str , using $rule as start rule, optionally applying $actions as actions object. Returns the resulting L<Match> object, and also sets the caller's $/ variable to the result Match object.

parsefile

    method parsefile(Grammar:D: $filename, :$rule = 'TOP', :$actions) returns Match:D

 
Matches the grammar against the contents of file $fielname , using $rule as start rule, optionally applying $actions as actions object. Returns the resulting L<Match> object, and also sets the caller's $/ variable to the result Match object.

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.
Email:
Name: