HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/doc/libparse-recdescent-perl/examples/demo_tokens.pl
#!/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!