Example #1
0
 public static function compile($bytes)
 {
     $tokens = new Tokenizer($bytes);
     $parser = new Parser();
     foreach ($tokens->getAll() as $token) {
         if ($token[0] == -1) {
             continue;
         }
         $parser->line = $token[2];
         $parser->doParse($token[0], $token[1]);
     }
     $parser->doParse(0, 0);
     return new Runtime($parser->body);
 }
Example #2
0
 /**
  * Output debug information to output (php://output stream)
  */
 static function PrintTrace()
 {
     self::$yyTraceFILE = fopen('php://output', 'w');
     self::$yyTracePrompt = '';
 }