- Constructor and Initialization
MarpaX::Languages::SVG::Parser::Actions - A nested SVG parser, using XML::SAX and Marpa::R2
Specifially, calls to functions are triggered by items in the input stream matching elements of the current grammar (and Marpa does the calling).
Each action function returns a hashref, which Marpa gathers. The calling code MarpaX::Languages::SVG::Parser::SAXHandler decodes the result and puts the hashrefs into a stack, described in the "FAQ" in MarpaX::Languages::SVG::Parser.
This class has no constructor. Marpa::R2 fabricates an instance, but won't let us get access to it.
So, we use a global variable,
$logger, initialized in MarpaX::Languages::SVG::Parser::SAXHandler, in case we need logging. Details:
- o logger => aLog::HandlerObject
By default, an object of type Log::Handler is created which prints to STDOUT, but given the default, nothing is actually printed unless the
maxlevelattribute of this object is changed in MarpaX::Languages::SVG::Parser.
Also, each new parse is preceeded by a call to the "init()" function, to reset some counters global to this file.
Returns a hashref identifying the boolean $t1.
Returns a hashref identifying the command $t1 and its parameters in @t2.
Returns a hashref identifying the float $t1.
Resets some counters global to the file. This must be called at the start of each new parse.
Returns a hashref identifying the integer $t1.
Calls $logger -> log($level => $s) if ($logger).
Returns a hashref identifying the string $t1.
MarpaX::Languages::SVG::Parser was written by Ron Savage <email@example.com> in 2013.
Home page: http://savage.net.au/.
Australian copyright (c) 2013, Ron Savage.
All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License 2.0, a copy of which is available at: http://www.opensource.org/licenses/index.html