1DateTime::Format::BuildUesre:r:PCaornsterri:bD:uagtteeendTeirPmieecr:(l:3F)Doorcmuamte:n:tBautiilodner::Parser::generic(3)
2
3
4

NAME

6       DateTime::Format::Builder::Parser::generic - Useful routines
7

VERSION

9       version 0.81
10

METHODS

12   Useful
13       new
14
15       Standard constructor. Returns a blessed hash; any arguments are placed
16       in the hash. This is useful for storing information between methods.
17
18       generic_parser
19
20       This is a method provided solely for the benefit of "Parser"
21       implementations. It semi-neatly abstracts a lot of the work involved.
22
23       Basically, it takes parameters matching the assorted callbacks from the
24       parser declarations and makes a coderef out of it all.
25
26       Currently recognized callbacks are:
27
28       ·   on_match
29
30       ·   on_fail
31
32       ·   preprocess
33
34       ·   postprocess
35
36   Methods for subclassing
37       These are methods you should define when writing your own subclass.
38
39       Note: these methods do not exist in this class. There is no point
40       trying to call "$self->SUPER::do_match( ... )".
41
42       do_match
43
44       "do_match" is the first phase. Arguments are the date and @args.
45       "self", "label", "args". Return value must be defined if you match
46       successfully.
47
48       post_match
49
50       "post_match" is called after the appropriate callback out of
51       "on_match"/"on_fail" is done. It's passed the date, the return value
52       from "do_match" and the parsing hash.
53
54       Its return value is used as the "post" argument to the "postprocess"
55       callback, and as the second argument to "make".
56
57       make
58
59       "make" takes the original input, the return value from "post_match" and
60       the parsing hash and should return a "DateTime" object or undefined.
61
62   Delegations
63       For use of "Parser", this module also delegates "valid_params" and
64       "params". This is just convenience to save typing the following:
65
66           DateTime::Format::Builder::Parser->valid_params( blah )
67
68       Instead we get to type:
69
70           $self->valid_params( blah );
71           __PACKAGE__->valid_params( blah );
72

WRITING A SUBCLASS

74       Rather than attempt to explain how it all works, I think it's best if
75       you take a look at Regex.pm and Strptime.pm as examples and work from
76       there.
77

SUPPORT

79       See DateTime::Format::Builder for details.
80

SEE ALSO

82       "datetime@perl.org" mailing list.
83
84       http://datetime.perl.org/
85
86       perl, DateTime, DateTime::Format::Builder,
87       DateTime::Format::Builder::Parser.
88

AUTHORS

90       ·   Dave Rolsky <autarch@urth.org>
91
92       ·   Iain Truskett
93
95       This software is Copyright (c) 2013 by Dave Rolsky.
96
97       This is free software, licensed under:
98
99         The Artistic License 2.0 (GPL Compatible)
100
101
102
103perl v5.28.0                     D2a0t1e8T-i0m7e-:1:4Format::Builder::Parser::generic(3)
Impressum