403Webshell
Server IP : 217.160.0.143  /  Your IP : 216.73.217.84
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : u89353126 ( 3190106)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/share/doc/libparse-recdescent-perl/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/doc/libparse-recdescent-perl/examples/demo_delete.pl
#!/usr/bin/perl -sw

# DELETABLE PRODUCTIONS

use Parse::RecDescent;

$grammar =
q{
	commands :	command(s)

	command  :	directive
		 |	evaluation

	directive:	'only prefix'
			    { $thisparser->{deleted} = {infix=>1,postfix=>1} }
		 |	'not prefix'
			    { $thisparser->{deleted}{prefix} = 1 }

	evaluation:	<reject: $thisparser->{deleted}{prefix}> op var var
				{ print "prefix $item[3] $item[2] $item[4]\n" }

	          |	<reject: $thisparser->{deleted}{infix}> var op var
				{ print "infix $item[2] $item[3] $item[4]\n" }

	          |	<reject: $thisparser->{deleted}{postfix}> var var op
				{ print "postfix $item[2] $item[4] $item[3]\n" }

	op        :	'+' | '-'

	var	  :	/(?!\d)\w+/
};

$parse = new Parse::RecDescent ($grammar);

while (<DATA>)
{
	$parse->commands($_);
}

__DATA__
a + b
+ a b
a b +
not prefix
a + b
+ a b
a b +
only prefix
a + b
+ a b
a b +
not prefix
a + b
+ a b
a b +

Youez - 2016 - github.com/yon3zu
LinuXploit