Beispiel #1
0
 function D(TokenStream $ts)
 {
     $cur = $ts->GetCurrentKind();
     if ($cur == Kind::digit_0 or $cur == Kind::digit_1 or $cur == Kind::digit_2 or $cur == Kind::digit_3 or $cur == Kind::digit_4 or $cur == Kind::digit_5 or $cur == Kind::digit_6 or $cur == Kind::digit_7 or $cur == Kind::digit_8 or $cur == Kind::digit_9) {
         $ts->MoveNext();
         return new OutValue($cur, $cur);
     } else {
         throw new Exception("Input is incorrect.");
     }
 }