Example #1
0
 function testDumpLoad()
 {
     $m = ['d' => '[1-9][0-9]*', 'sp' => '\\s+', '+', '-', '*', '/', '(', ')'];
     $lexer = new Lexer($m);
     $d = $lexer->dump();
     $lexer = new Lexer();
     $lexer->load($d);
     $str = '(123+44)';
     $tokens = $lexer->getAllTokens($str);
     $this->assertCount(5, $tokens);
 }