|parrotcode: implementation of PGE match objects|
|Contents | Compilers|
PGE::Match - implementation of PGE match objects
This file implements match objects returned by the Parrot Grammar Engine.
new(PMC src, [ PMC adverbs :slurpy :named ])
src. If the
grammaradverb is specified, then the new Match object is of the given grammar class, otherwise if
srcis an instance of
Match(or a subclass) then that class is used to create the object, otherwise it uses the class of the invocant.
cadverbs specify where the match object should begin. If no starting position is given, the current position of
srcis used if it has one, otherwise the start position is at offset zero. The
fromadverb can be used to initialize the Match's
$.fromattribute to a value other than the starting position.
rwadverb causes the invocant to be modified and returned instead of creating a new Match object.
newmethod returns several values to the caller: the initialized match object, the target the object is matching against, a reference to its $.from attribute, a reference to its $.pos attribute, the value of
pos/p/continue/cused to initialize the object, and whether or not a continue flag is set or implied.
find_key([ key1, key2, ... ])
key2, etc. in the current Match object, and return it. Returns '' if none of the specified keys are found. If no keys are specified, then simply return the first key found.
Patrick Michaud (firstname.lastname@example.org) is the author and maintainer. Patches and suggestions should be sent to the Perl 6 compiler list (email@example.com).