Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/proc/self/root/proc/self/root/usr/share/doc/perl-Parse-RecDescent/demo/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/self/root/proc/self/root/usr/share/doc/perl-Parse-RecDescent/demo/demo_bad.pl
use v5.10;
use warnings;


# SHOWCASE VARIOUS ERROR MESSAGES WITH A VERY UNWELL GRAMMAR

use Parse::RecDescent;

open (Parse::RecDescent::ERROR, ">-") or die;

$grammar =
q{
    <warn:3>

	typedef : a ... ...! ... b
	typedef : a ...!...!...!...! b
		| /type/ ident /has/ field(s) /end type/
			{ $result = $item[2]; }
		| /type/ ident /is/ ident
			{ $result = $item[2]; }
		| quasit(s)
		| quasit(-1..3)
		| quasit(..0)
		| field(?) field end
		| <error> quasit "here" ...!/why/

	Extend: extend

	Replace: replace
		$%^@#

	field   : /field/ ident /is/ ident
		| field quasit
		| !quasit(s?)
		!| #NOTHING


	typedef : whatever

	package somewhereelse

	!ident   : /[A-Za-z]\w*???/
			{ $result = $item[1]; }

	quasit  : field
		| typedef
 };

new Parse::RecDescent ($grammar) || die "Bad grammar! No biscuit!\n";

Hry