/* Generated by re2swift */
// re2swift $INPUT -o $OUTPUT -i

enum Result { case ok, fail }




func lex(_ yyinput: UnsafePointer<UInt8>) -> Result {
  var yycursor = 0, yymarker = 0
  
  var yych: UInt8 = 0
  var yyaccept: UInt = 0
  var yystate: UInt = 0
  yyl: while true {
    switch yystate {
      case 0:
        yych = yyinput[yycursor]
        yycursor += 1
        switch yych {
          case 0x2E:
            yystate = 3
            continue yyl
          case 0x30:
            yystate = 4
            continue yyl
          case 0x31...0x39:
            yystate = 5
            continue yyl
          default:
            yystate = 1
            continue yyl
        }
      case 1:
        yystate = 2
        continue yyl
      case 2: return .fail
      case 3:
        yych = yyinput[yycursor]
        switch yych {
          case 0x30...0x39:
            yycursor += 1
            yystate = 7
            continue yyl
          default:
            yystate = 2
            continue yyl
        }
      case 4:
        yyaccept = 0
        yymarker = yycursor
        yych = yyinput[yycursor]
        switch yych {
          case 0x2E:
            yycursor += 1
            yystate = 7
            continue yyl
          case 0x30...0x39:
            yycursor += 1
            yystate = 9
            continue yyl
          case 0x45:
            fallthrough
          case 0x65:
            yycursor += 1
            yystate = 11
            continue yyl
          default:
            yystate = 2
            continue yyl
        }
      case 5:
        yyaccept = 1
        yymarker = yycursor
        yych = yyinput[yycursor]
        switch yych {
          case 0x2E:
            yycursor += 1
            yystate = 7
            continue yyl
          case 0x30...0x39:
            yycursor += 1
            yystate = 5
            continue yyl
          case 0x45:
            fallthrough
          case 0x65:
            yycursor += 1
            yystate = 11
            continue yyl
          default:
            yystate = 6
            continue yyl
        }
      case 6: return .ok
      case 7:
        yyaccept = 2
        yymarker = yycursor
        yych = yyinput[yycursor]
        switch yych {
          case 0x30...0x39:
            yycursor += 1
            yystate = 7
            continue yyl
          case 0x45:
            fallthrough
          case 0x65:
            yycursor += 1
            yystate = 11
            continue yyl
          default:
            yystate = 8
            continue yyl
        }
      case 8: return .ok
      case 9:
        yych = yyinput[yycursor]
        switch yych {
          case 0x2E:
            yycursor += 1
            yystate = 7
            continue yyl
          case 0x30...0x39:
            yycursor += 1
            yystate = 9
            continue yyl
          case 0x45:
            fallthrough
          case 0x65:
            yycursor += 1
            yystate = 11
            continue yyl
          default:
            yystate = 10
            continue yyl
        }
      case 10:
        yycursor = yymarker
        switch yyaccept {
          case 0:
            yystate = 2
            continue yyl
          case 1:
            yystate = 6
            continue yyl
          default:
            yystate = 8
            continue yyl
        }
      case 11:
        yych = yyinput[yycursor]
        switch yych {
          case 0x2B:
            fallthrough
          case 0x2D:
            yycursor += 1
            yystate = 12
            continue yyl
          case 0x30...0x39:
            yycursor += 1
            yystate = 13
            continue yyl
          default:
            yystate = 10
            continue yyl
        }
      case 12:
        yych = yyinput[yycursor]
        switch yych {
          case 0x30...0x39:
            yycursor += 1
            yystate = 13
            continue yyl
          default:
            yystate = 10
            continue yyl
        }
      case 13:
        yych = yyinput[yycursor]
        switch yych {
          case 0x30...0x39:
            yycursor += 1
            yystate = 13
            continue yyl
          default:
            yystate = 8
            continue yyl
        }
      default: fatalError("internal lexer error")
    }
  }

}

assert(lex("123") == .ok)
assert(lex("123.4567") == .ok)
