NAME

Parse::Token::Lite::Rule - Rule class

VERSION

version 0.200

ATTRIBUTES

name

A name of the rule object. It is called also as 'type' or 'tag'.

re

A regexp to match on text for extract token.

func

A callback function for beging executed after re matching.

sub{
	my ($parser, $token) = @_;
	...
	return @somevalues;
}

The return values are passed by Parse::Token::Lite::nextToken(), after token object.

state

Describe an array reference of chanined actions for changing a state of a parser. Actions are invoked when the rule which contains them is matched.

An action begins '+' or '-'. '+' means start(). '-' means end().

{ state=>['+INTAG'], ...} # start INTAG; push()
{ state=>['-INTAG'], ...} # end INTAG; pop()
{ state=>['+PROP','+PROP_NAME'], ...} # start PROP, start PROP_NAME; push()->push()
{ state=>['-INTAG','+CONTENT'], ...} # end INTAG, start CONTENT; pop()->push()

AUTHOR

khs <sng2nara@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by khs.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.