phpython Code
a python interpreter written in php
Status: Pre-Alpha
Brought to you by:
francescobianco
<?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 python extends lime_parser { var $qi = 0; var $i = array ( 0 => array ( 'simple_stmt' => 's 1', 'compound_stmt' => 's 2', 'small_stmt' => 's 3', 'cmd_stmt' => 's 6', 'for_stmt' => 's 9', 'NAME' => 's 7', 'FOR' => 's 10', '\'for_stmt\'7' => 's 25', 'stmt' => 's 27', '\'start\'' => 'a \'start\'', ), 1 => array ( '#' => 'r 0', ), 2 => array ( '#' => 'r 1', ), 3 => array ( 'NEWLINE' => 's 4', ), 4 => array ( 'small_stmt' => 's 3', 'simple_stmt' => 's 5', 'cmd_stmt' => 's 6', 'NAME' => 's 7', '#' => 'r 3', ), 5 => array ( '#' => 'r 2', ), 6 => array ( 'NEWLINE' => 'r 4', ), 7 => array ( 'DSTRING' => 's 8', ), 8 => array ( 'NEWLINE' => 'r 6', ), 9 => array ( '#' => 'r 5', ), 10 => array ( 'exprlist' => 's 11', 'NAME' => 's 24', ), 11 => array ( 'IN' => 's 12', ), 12 => array ( 'testlist' => 's 13', 'test' => 's 15', 'expr' => 's 16', 'NAME' => 's 17', ), 13 => array ( 'COLON' => 's 14', ), 14 => array ( 'suite' => 'r 7', ), 15 => array ( 'COLON' => 'r 10', ), 16 => array ( 'COLON' => 'r 11', ), 17 => array ( 'RBO' => 's 18', ), 18 => array ( 'argslist' => 's 19', 'NUMBER' => 's 21', ), 19 => array ( 'RBC' => 's 20', ), 20 => array ( 'COLON' => 'r 12', ), 21 => array ( 'COMMA' => 's 22', ), 22 => array ( 'NUMBER' => 's 23', ), 23 => array ( 'RBC' => 'r 13', ), 24 => array ( 'IN' => 'r 9', ), 25 => array ( 'suite' => 's 26', ), 26 => array ( '#' => 'r 8', ), 27 => array ( '#' => 'r 14', ), ); function reduce_0_stmt_1($tokens, &$result) { # # (0) stmt := simple_stmt # $result = reset($tokens); } function reduce_1_stmt_2($tokens, &$result) { # # (1) stmt := compound_stmt # $result = reset($tokens); } function reduce_2_simple_stmt_1($tokens, &$result) { # # (2) simple_stmt := small_stmt NEWLINE simple_stmt # $result = reset($tokens); } function reduce_3_simple_stmt_2($tokens, &$result) { # # (3) simple_stmt := small_stmt NEWLINE # $result = reset($tokens); } function reduce_4_small_stmt_1($tokens, &$result) { # # (4) small_stmt := cmd_stmt # $result = reset($tokens); } function reduce_5_compound_stmt_1($tokens, &$result) { # # (5) compound_stmt := for_stmt # $result = reset($tokens); } function reduce_6_cmd_stmt_1($tokens, &$result) { # # (6) cmd_stmt := NAME DSTRING # $result = reset($tokens); python_command($tokens[0],$tokens[1]); } function reduce_7_for_stmt7_1($tokens, &$result) { # # (7) 'for_stmt'7 := FOR exprlist IN testlist COLON # $result = reset($tokens); python_for(); } function reduce_8_for_stmt_1($tokens, &$result) { # # (8) for_stmt := 'for_stmt'7 suite # $result = reset($tokens); python_end_for(); } function reduce_9_exprlist_1($tokens, &$result) { # # (9) exprlist := NAME # $result = reset($tokens); } function reduce_10_testlist_1($tokens, &$result) { # # (10) testlist := test # $result = reset($tokens); } function reduce_11_test_1($tokens, &$result) { # # (11) test := expr # $result = reset($tokens); } function reduce_12_expr_1($tokens, &$result) { # # (12) expr := NAME RBO argslist RBC # $result = reset($tokens); } function reduce_13_argslist_1($tokens, &$result) { # # (13) argslist := NUMBER COMMA NUMBER # $result = reset($tokens); } function reduce_14_start_1($tokens, &$result) { # # (14) 'start' := stmt # $result = reset($tokens); } var $method = array ( 0 => 'reduce_0_stmt_1', 1 => 'reduce_1_stmt_2', 2 => 'reduce_2_simple_stmt_1', 3 => 'reduce_3_simple_stmt_2', 4 => 'reduce_4_small_stmt_1', 5 => 'reduce_5_compound_stmt_1', 6 => 'reduce_6_cmd_stmt_1', 7 => 'reduce_7_for_stmt7_1', 8 => 'reduce_8_for_stmt_1', 9 => 'reduce_9_exprlist_1', 10 => 'reduce_10_testlist_1', 11 => 'reduce_11_test_1', 12 => 'reduce_12_expr_1', 13 => 'reduce_13_argslist_1', 14 => 'reduce_14_start_1', ); var $a = array ( 0 => array ( 'symbol' => 'stmt', 'len' => 1, 'replace' => true, ), 1 => array ( 'symbol' => 'stmt', 'len' => 1, 'replace' => true, ), 2 => array ( 'symbol' => 'simple_stmt', 'len' => 3, 'replace' => true, ), 3 => array ( 'symbol' => 'simple_stmt', 'len' => 2, 'replace' => true, ), 4 => array ( 'symbol' => 'small_stmt', 'len' => 1, 'replace' => true, ), 5 => array ( 'symbol' => 'compound_stmt', 'len' => 1, 'replace' => true, ), 6 => array ( 'symbol' => 'cmd_stmt', 'len' => 2, 'replace' => true, ), 7 => array ( 'symbol' => '\'for_stmt\'7', 'len' => 5, 'replace' => false, ), 8 => array ( 'symbol' => 'for_stmt', 'len' => 7, 'replace' => true, ), 9 => array ( 'symbol' => 'exprlist', 'len' => 1, 'replace' => true, ), 10 => array ( 'symbol' => 'testlist', 'len' => 1, 'replace' => true, ), 11 => array ( 'symbol' => 'test', 'len' => 1, 'replace' => true, ), 12 => array ( 'symbol' => 'expr', 'len' => 4, 'replace' => true, ), 13 => array ( 'symbol' => 'argslist', 'len' => 3, 'replace' => true, ), 14 => array ( 'symbol' => '\'start\'', 'len' => 1, 'replace' => true, ), ); }