-{REGEXP} {c(); return m(T_REGEXP);BEGIN(INITIAL);}
-}
-
-\xef\xbb\xbf {/* utf 8 bom */}
-{S} {c();}
-
-{NUMBER} {c();return m(T_NUMBER);BEGIN(INITIAL);}
-[>][=] {return m(T_GE);}
-[<][=] {return m(T_LE);}
-[-][-] {return m(T_MINUSMINUS);BEGIN(INITIAL);}
-[+][+] {return m(T_PLUSPLUS);BEGIN(INITIAL);}
-== {return m(T_EQEQ);BEGIN(REGEXPOK);}
-\.\. {return m(T_DOTDOT);}
-\. {return m('.');}
-:: {return m(T_COLONCOLON);}
-: {return m(':');}
-implements {return m(T_IMPLEMENTS);}
-interface {return m(T_INTERFACE);}
-namespace {return m(T_NAMESPACE);}
-protected {return m(T_PROTECTED);}
-override {return m(T_OVERRIDE);}
-internal {return m(T_INTERNAL);}
-function {return m(T_FUNCTION);}
-package {return m(T_PACKAGE);}
-private {return m(T_PRIVATE);}
-Boolean {return m(T_BOOLEAN);}
-dynamic {return m(T_DYNAMIC);}
-extends {return m(T_EXTENDS);}
-public {return m(T_PUBLIC);}
-native {return m(T_NATIVE);}
-static {return m(T_STATIC);}
-import {return m(T_IMPORT);}
-number {return m(T_NUMBER);}
-class {return m(T_CLASS);}
-const {return m(T_CONST);}
-final {return m(T_FINAL);}
-False {return m(T_FALSE);}
-True {return m(T_TRUE);}
-uint {return m(T_UINT);}
-null {return m(T_NULL);}
-use {return m(T_USE);}
-int {return m(T_INT);}
-new {return m(T_NEW);}
-get {return m(T_GET);}
-for {return m(T_FOR);}
-set {return m(T_SET);}
-var {return m(T_VAR);}
-is {return m(T_IS) ;}
-as {return m(T_AS);}
-{NAME} {c();BEGIN(INITIAL);return m(T_IDENTIFIER);}
-
-[+-\/*^~@$!%&\(=\[\]\{\}|?:;,.<>] {c();BEGIN(REGEXPOK);return m(yytext[0]);}
-[\)\]] {c();BEGIN(INITIAL);return m(yytext[0]);}
-
-. {char c1=yytext[0];
- char buf[128];
- buf[0] = yytext[0];
- int t;
- for(t=1;t<128;t++) {
- char c = buf[t]=input();
- if(c=='\n' || c==EOF) {
- buf[t] = 0;
- break;
- }
- }
- if(c1>='0' && c1<='9')
- syntaxerror("syntax error: %s (identifiers must not start with a digit)");
- else
- syntaxerror("syntax error: %s", buf);
- printf("\n");
- exit(1);
- yyterminate();
- }
-<<EOF>> {c();
+{REGEXP} {c(); BEGIN(DEFAULT);return handleregexp();}
+{HEXWITHSIGN}/{_} {c(); BEGIN(DEFAULT);return handlehex();}
+{HEXFLOATWITHSIGN}/{_} {c(); BEGIN(DEFAULT);return handlehexfloat();}
+{INTWITHSIGN}/{_} {c(); BEGIN(DEFAULT);return handleint();}
+{FLOATWITHSIGN}/{_} {c(); BEGIN(DEFAULT);return handlefloat();}
+}
+
+<REGEXPOK>[\{] {c(); BEGIN(REGEXPOK);return m(T_DICTSTART);}
+[\{] {c(); BEGIN(DEFAULT); return m('{');}
+
+\xef\xbb\xbf {/* utf 8 bom (0xfeff) */}
+{S} {l();}
+
+{HEXINT}/{_} {c(); BEGIN(DEFAULT);return handlehex();}
+{HEXFLOAT}/{_} {c(); BEGIN(DEFAULT);return handlehexfloat();}
+{INT}/{_} {c(); BEGIN(DEFAULT);return handleint();}
+{FLOAT}/{_} {c(); BEGIN(DEFAULT);return handlefloat();}
+NaN {c(); BEGIN(DEFAULT);return m(KW_NAN);}
+
+3rr0r {/* for debugging: generates a tokenizer-level error */
+ syntaxerror("3rr0r");}
+
+{NAME}{S}*:{S}*for/{_} {l();BEGIN(DEFAULT);handleLabel(yytext, yyleng-3);return T_FOR;}
+{NAME}{S}*:{S}*do/{_} {l();BEGIN(DEFAULT);handleLabel(yytext, yyleng-2);return T_DO;}
+{NAME}{S}*:{S}*while/{_} {l();BEGIN(DEFAULT);handleLabel(yytext, yyleng-5);return T_WHILE;}
+{NAME}{S}*:{S}*switch/{_} {l();BEGIN(DEFAULT);handleLabel(yytext, yyleng-6);return T_SWITCH;}
+default{S}xml {l();BEGIN(DEFAULT);return m(KW_DEFAULT_XML);}
+for {c();BEGIN(DEFAULT);a3_lval.id="";return T_FOR;}
+do {c();BEGIN(DEFAULT);a3_lval.id="";return T_DO;}
+while {c();BEGIN(DEFAULT);a3_lval.id="";return T_WHILE;}
+switch {c();BEGIN(DEFAULT);a3_lval.id="";return T_SWITCH;}
+
+[&][&] {c();BEGIN(REGEXPOK);return m(T_ANDAND);}
+[|][|] {c();BEGIN(REGEXPOK);return m(T_OROR);}
+[!][=] {c();BEGIN(REGEXPOK);return m(T_NE);}
+[!][=][=] {c();BEGIN(REGEXPOK);return m(T_NEE);}
+[=][=][=] {c();BEGIN(REGEXPOK);return m(T_EQEQEQ);}
+[=][=] {c();BEGIN(REGEXPOK);return m(T_EQEQ);}
+[>][=] {c();BEGIN(REGEXPOK);return m(T_GE);}
+[<][=] {c();BEGIN(REGEXPOK);return m(T_LE);}
+[-][-] {c();BEGIN(DEFAULT);return m(T_MINUSMINUS);}
+[+][+] {c();BEGIN(DEFAULT);return m(T_PLUSPLUS);}
+[+][=] {c();BEGIN(REGEXPOK);return m(T_PLUSBY);}
+[\^][=] {c();BEGIN(REGEXPOK);return m(T_XORBY);}
+[-][=] {c();BEGIN(REGEXPOK);return m(T_MINUSBY);}
+[/][=] {c();BEGIN(REGEXPOK);return m(T_DIVBY);}
+[%][=] {c();BEGIN(REGEXPOK);return m(T_MODBY);}
+[*][=] {c();BEGIN(REGEXPOK);return m(T_MULBY);}
+[|][=] {c();BEGIN(REGEXPOK);return m(T_ORBY);}
+[&][=] {c();BEGIN(REGEXPOK);return m(T_ANDBY);}
+[>][>][=] {c();BEGIN(REGEXPOK);return m(T_SHRBY);}
+[<][<][=] {c();BEGIN(REGEXPOK);return m(T_SHLBY);}
+[>][>][>][=] {c();BEGIN(REGEXPOK);return m(T_USHRBY);}
+[<][<] {c();BEGIN(REGEXPOK);return m(T_SHL);}
+[>][>][>] {c();BEGIN(REGEXPOK);return m(T_USHR);}
+[>][>] {c();BEGIN(REGEXPOK);return m(T_SHR);}
+\.\.\. {c();BEGIN(REGEXPOK);return m(T_DOTDOTDOT);}
+\.\. {c();BEGIN(REGEXPOK);return m(T_DOTDOT);}
+\. {c();BEGIN(REGEXPOK);return m('.');}
+:: {c();BEGIN(REGEXPOK);return m(T_COLONCOLON);}
+: {c();BEGIN(REGEXPOK);return m(':');}
+instanceof {c();BEGIN(REGEXPOK);return m(KW_INSTANCEOF);}
+implements {c();BEGIN(REGEXPOK);return m(KW_IMPLEMENTS);}
+interface {c();BEGIN(DEFAULT);return m(KW_INTERFACE);}
+protected {c();BEGIN(DEFAULT);return m(KW_PROTECTED);}
+namespace {c();BEGIN(DEFAULT);return m(KW_NAMESPACE);}
+undefined {c();BEGIN(DEFAULT);return m(KW_UNDEFINED);}
+arguments {c();BEGIN(DEFAULT);return m(KW_ARGUMENTS);}
+continue {c();BEGIN(DEFAULT);return m(KW_CONTINUE);}
+override {c();BEGIN(DEFAULT);return m(KW_OVERRIDE);}
+internal {c();BEGIN(DEFAULT);return m(KW_INTERNAL);}
+function {c();BEGIN(DEFAULT);return m(KW_FUNCTION);}
+finally {c();BEGIN(DEFAULT);return m(KW_FINALLY);}
+default {c();BEGIN(DEFAULT);return m(KW_DEFAULT);}
+package {c();BEGIN(DEFAULT);return m(KW_PACKAGE);}
+private {c();BEGIN(DEFAULT);return m(KW_PRIVATE);}
+dynamic {c();BEGIN(DEFAULT);return m(KW_DYNAMIC);}
+extends {c();BEGIN(DEFAULT);return m(KW_EXTENDS);}
+delete {c();BEGIN(REGEXPOK);return m(KW_DELETE);}
+return {c();BEGIN(REGEXPOK);return m(KW_RETURN);}
+public {c();BEGIN(DEFAULT);return m(KW_PUBLIC);}
+native {c();BEGIN(DEFAULT);return m(KW_NATIVE);}
+static {c();BEGIN(DEFAULT);return m(KW_STATIC);}
+import {c();BEGIN(REGEXPOK);return m(KW_IMPORT);}
+typeof {c();BEGIN(REGEXPOK);return m(KW_TYPEOF);}
+throw {c();BEGIN(REGEXPOK);return m(KW_THROW);}
+class {c();BEGIN(DEFAULT);return m(KW_CLASS);}
+const {c();BEGIN(DEFAULT);return m(KW_CONST);}
+catch {c();BEGIN(DEFAULT);return m(KW_CATCH);}
+final {c();BEGIN(DEFAULT);return m(KW_FINAL);}
+false {c();BEGIN(DEFAULT);return m(KW_FALSE);}
+break {c();BEGIN(DEFAULT);return m(KW_BREAK);}
+super {c();BEGIN(DEFAULT);return m(KW_SUPER);}
+each {c();BEGIN(DEFAULT);return m(KW_EACH);}
+void {c();BEGIN(DEFAULT);return m(KW_VOID);}
+true {c();BEGIN(DEFAULT);return m(KW_TRUE);}
+null {c();BEGIN(DEFAULT);return m(KW_NULL);}
+else {c();BEGIN(DEFAULT);return m(KW_ELSE);}
+case {c();BEGIN(REGEXPOK);return m(KW_CASE);}
+with {c();BEGIN(REGEXPOK);return m(KW_WITH);}
+use {c();BEGIN(REGEXPOK);return m(KW_USE);}
+new {c();BEGIN(REGEXPOK);return m(KW_NEW);}
+get {c();BEGIN(DEFAULT);return m(KW_GET);}
+set {c();BEGIN(DEFAULT);return m(KW_SET);}
+var {c();BEGIN(DEFAULT);return m(KW_VAR);}
+try {c();BEGIN(DEFAULT);return m(KW_TRY);}
+is {c();BEGIN(REGEXPOK);return m(KW_IS) ;}
+in {c();BEGIN(REGEXPOK);return m(KW_IN) ;}
+if {c();BEGIN(DEFAULT);return m(KW_IF) ;}
+as {c();BEGIN(REGEXPOK);return m(KW_AS);}
+$?{NAME} {c();BEGIN(DEFAULT);return handleIdentifier();}
+
+[\]\}*] {c();BEGIN(DEFAULT);return m(yytext[0]);}
+[+-\/^~@$!%&\(=\[|?:;,<>] {c();BEGIN(REGEXPOK);return m(yytext[0]);}
+[\)\]] {c();BEGIN(DEFAULT);return m(yytext[0]);}
+
+<DEFAULT,BEGINNING,REGEXPOK,XML,XMLTEXT>{
+. {tokenerror();}
+}
+<<EOF>> {l();