ASW



Loading...
Searching...
No Matches
mkfun.php
Go to the documentation of this file.
1#!/usr/local/bin/php
2
3<?php
4
5$lines = file("new_fun.txt");
6
7$enumfile = "enum_fun.txt";
8$ef = fopen($enumfile, 'w') or die("can't open file");
9foreach ($lines as $line_num => $line) {
10
11 $line = trim($line);
12 fwrite($ef, " " . strtoupper($line) . ",\n");
13 echo " " . strtoupper($line) . ",\n";
14}
15fclose($ef);
16
17$enumfile = "fun.txt";
18$ff = fopen($enumfile, 'w') or die("can't open file");
19foreach ($lines as $line_num => $line) {
20
21 $line = trim($line);
22 fwrite($ff, " { \"" . $line . "(\",\t" . strtoupper($line) . " },\n");
23 echo " { \"" . $line . "(\",\t" . strtoupper($line) . " },\n";
24}
25fclose($ff);
26
27$enumfile = "argc.txt";
28$af = fopen($enumfile, 'w') or die("can't open file");
29foreach ($lines as $line_num => $line) {
30
31 $line = trim($line);
32 fwrite($af, " { \"" . $line . "(\",\t1 },\n");
33 echo " { \"" . $line . "(\",\t1 },\n";
34}
35fclose($af);
36
37$codefile = "fun_code.txt";
38$cf = fopen($codefile, 'w') or die("can't open file");
39foreach ($lines as $line_num => $line) {
40 $line = trim($line);
41 fwrite($cf," case " . strtoupper($line) . " :\n");
42 fwrite($cf," stack.back()->value = " . $line . "(stack.back()->value);\n");
43 fwrite($cf," break;\n");
44}
45fclose($cf);
46
47?>
48
$ff
Definition: mkfun.php:18
$af
Definition: mkfun.php:28
$lines
Definition: mkfun.php:5
$ef
Definition: mkfun.php:8
$codefile
Definition: mkfun.php:37
$cf
Definition: mkfun.php:38
$enumfile
Definition: mkfun.php:7