Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 134f0a3e6cf3182d61d0f4bdeef756b7 > files > 72

perl-Parse-RecDescent-1.967.9-3.mga4.noarch.rpm

#!/usr/bin/perl -w

use Parse::RecDescent;
use Data::Dumper;

my $lexer = new Parse::RecDescent q
{
	lex:	token(s)

  	token:	/(I|you|he)\b/i	<token:PRON>
 	     |	/(is|are)\b/	<token:VERB>
	     |	'dumbest'	<token:ADJ>
	     |	'Bill-loving'	<token:ADJ>
	     |	'clearly'	<token:ADJ>
	     |	/the\b|a\b/	<token:ARTICLE>
	     |	/\w+/		<token:WORD>
	     |  /\S+/		<token:PUNCT,OTHER>
};

my $tokens = $lexer->lex(join "", <DATA>);

print  Data::Dumper->Dump($tokens);

__DATA__

You are clearly the dumbest, Bill-loving script-kiddie I have ever seen!