cvs: php-lang / genoplist.php

From: Date: Tue, 21 Nov 2000 21:50:27 +0000
Subject: cvs: php-lang / genoplist.php
Groups: php.lang 
Request: Send a blank email to php-lang+get-73@lists.php.net to get a copy of this message
sas Tue Nov 21 13:50:27 2000 EDT Added files: /php-lang genoplist.php Log: Script for generating a list of rules for standard operators Index: php-lang/genoplist.php +++ php-lang/genoplist.php <? # Generate a cascade of rules for operators # Higher rules have precedence # $Id: genoplist.php,v 1.1 2000/11/21 21:50:27 sas Exp $ $a = array( "multiplicative", "*,/,%", "additive", "+,-", "shift", "<<,>>", "relational", "<,>,<=,>=", "identical", "===,!==", "equality", "==,!=", "and", "&", "exclusive-or", "^", "inclusive-or", "|", "logical-and", "&&", "logical-or", "||" ); $last = "cast"; for ($i = 0; $i < count($a); $i += 2) { $key = $a[$i]; $ops = $a[$i+1]; print "$key-expression:\n"; print " $last-expression\n"; foreach (explode(",", $ops) as $op) { print " $key-expression '$op' $last-expression\n"; } print "\n"; $last = $key; }

« previous php.lang (#73) next »