lime/examples/error/error.class

154 lines
2.9 KiB
Plaintext

<?php
/*
*** DON'T EDIT THIS FILE! ***
*
* This file was automatically generated by the Lime parser generator.
* The real source code you should be looking at is in one or more
* grammar files in the Lime format.
*
* THE ONLY REASON TO LOOK AT THIS FILE is to see where in the grammar
* file that your error happened, because there are enough comments to
* help you debug your grammar.
* If you ignore this warning, you're shooting yourself in the brain,
* not the foot.
*/
class parser extends lime_parser {
public $qi = 0;
public $i = array(
array(
'slist' => 's 1',
'stmt' => 's 6',
'error' => 's 8',
'ZZ' => 's 4',
"'start'" => "a 'start'"
),
array(
'stmt' => 's 2',
'ZZ' => 's 4',
'#' => 'r 5'
),
array(
"';'" => 's 3'
),
array(
'ZZ' => 'r 0',
'#' => 'r 0'
),
array(
'ZZ' => 's 4',
'stmt' => 's 5',
"';'" => 'r 4'
),
array(
"';'" => 'r 3'
),
array(
"';'" => 's 7'
),
array(
'ZZ' => 'r 1',
'#' => 'r 1'
),
array(
"';'" => 's 9'
),
array(
'ZZ' => 'r 2',
'#' => 'r 2'
)
);
public $d = array(
);
public $errors = array();
function reduce_0_slist_1($tokens, &$result) {
// (0) slist := slist stmt ';'
$result = reset($tokens);
printf("slist stmt\n");
$result = array($tokens[0], $tokens[1]);
}
function reduce_1_slist_2($tokens, &$result) {
// (1) slist := stmt ';'
$result = reset($tokens);
printf("stmt\n");
$result = $tokens[0];
}
function reduce_2_slist_3($tokens, &$result) {
// (2) slist := error ';'
$result = reset($tokens);
printf("error\n");
$result = 'error';
}
function reduce_3_stmt_1($tokens, &$result) {
// (3) stmt := ZZ stmt
$result = reset($tokens);
printf("ZZ stmt\n");
$result = array($tokens[0], $tokens[1]);
}
function reduce_4_stmt_2($tokens, &$result) {
// (4) stmt := ZZ
$result = reset($tokens);
printf("ZZ\n");
$result = array($tokens[0]);
}
function reduce_5_start_1($tokens, &$result) {
// (5) 'start' := slist
$result = reset($tokens);
}
public $method = array(
'reduce_0_slist_1',
'reduce_1_slist_2',
'reduce_2_slist_3',
'reduce_3_stmt_1',
'reduce_4_stmt_2',
'reduce_5_start_1'
);
public $a = array(
array(
'symbol' => 'slist',
'len' => 3,
'replace' => true
),
array(
'symbol' => 'slist',
'len' => 2,
'replace' => true
),
array(
'symbol' => 'slist',
'len' => 2,
'replace' => true
),
array(
'symbol' => 'stmt',
'len' => 2,
'replace' => true
),
array(
'symbol' => 'stmt',
'len' => 1,
'replace' => true
),
array(
'symbol' => "'start'",
'len' => 1,
'replace' => true
)
);
}
// Time: 0.032855033874512 seconds
// Memory: 1516852 bytes