X-Git-Url: http://nitlanguage.org diff --git a/lib/json/json_lexer.nit b/lib/json/json_lexer.nit index 162e529..32a82b2 100644 --- a/lib/json/json_lexer.nit +++ b/lib/json/json_lexer.nit @@ -1,55 +1,53 @@ # Lexer generated by nitcc for the grammar json -module json_lexer is no_warning "missing-doc" +module json_lexer is generated, no_warning "missing-doc" import nitcc_runtime import json_parser class Lexer_json super Lexer redef fun start_state do return dfastate_0 end -redef class Object - private fun dfastate_0: DFAState0 do return once new DFAState0 - private fun dfastate_1: DFAState1 do return once new DFAState1 - private fun dfastate_2: DFAState2 do return once new DFAState2 - private fun dfastate_3: DFAState3 do return once new DFAState3 - private fun dfastate_4: DFAState4 do return once new DFAState4 - private fun dfastate_5: DFAState5 do return once new DFAState5 - private fun dfastate_6: DFAState6 do return once new DFAState6 - private fun dfastate_7: DFAState7 do return once new DFAState7 - private fun dfastate_8: DFAState8 do return once new DFAState8 - private fun dfastate_9: DFAState9 do return once new DFAState9 - private fun dfastate_10: DFAState10 do return once new DFAState10 - private fun dfastate_11: DFAState11 do return once new DFAState11 - private fun dfastate_12: DFAState12 do return once new DFAState12 - private fun dfastate_13: DFAState13 do return once new DFAState13 - private fun dfastate_14: DFAState14 do return once new DFAState14 - private fun dfastate_15: DFAState15 do return once new DFAState15 - private fun dfastate_16: DFAState16 do return once new DFAState16 - private fun dfastate_17: DFAState17 do return once new DFAState17 - private fun dfastate_18: DFAState18 do return once new DFAState18 - private fun dfastate_19: DFAState19 do return once new DFAState19 - private fun dfastate_20: DFAState20 do return once new DFAState20 - private fun dfastate_21: DFAState21 do return once new DFAState21 - private fun dfastate_22: DFAState22 do return once new DFAState22 - private fun dfastate_23: DFAState23 do return once new DFAState23 - private fun dfastate_24: DFAState24 do return once new DFAState24 - private fun dfastate_25: DFAState25 do return once new DFAState25 - private fun dfastate_26: DFAState26 do return once new DFAState26 - private fun dfastate_27: DFAState27 do return once new DFAState27 - private fun dfastate_28: DFAState28 do return once new DFAState28 - private fun dfastate_29: DFAState29 do return once new DFAState29 - private fun dfastate_30: DFAState30 do return once new DFAState30 - private fun dfastate_31: DFAState31 do return once new DFAState31 - private fun dfastate_32: DFAState32 do return once new DFAState32 - private fun dfastate_33: DFAState33 do return once new DFAState33 - private fun dfastate_34: DFAState34 do return once new DFAState34 -end +private fun dfastate_0: DFAState0 do return once new DFAState0 +private fun dfastate_1: DFAState1 do return once new DFAState1 +private fun dfastate_2: DFAState2 do return once new DFAState2 +private fun dfastate_3: DFAState3 do return once new DFAState3 +private fun dfastate_4: DFAState4 do return once new DFAState4 +private fun dfastate_5: DFAState5 do return once new DFAState5 +private fun dfastate_6: DFAState6 do return once new DFAState6 +private fun dfastate_7: DFAState7 do return once new DFAState7 +private fun dfastate_8: DFAState8 do return once new DFAState8 +private fun dfastate_9: DFAState9 do return once new DFAState9 +private fun dfastate_10: DFAState10 do return once new DFAState10 +private fun dfastate_11: DFAState11 do return once new DFAState11 +private fun dfastate_12: DFAState12 do return once new DFAState12 +private fun dfastate_13: DFAState13 do return once new DFAState13 +private fun dfastate_14: DFAState14 do return once new DFAState14 +private fun dfastate_15: DFAState15 do return once new DFAState15 +private fun dfastate_16: DFAState16 do return once new DFAState16 +private fun dfastate_17: DFAState17 do return once new DFAState17 +private fun dfastate_18: DFAState18 do return once new DFAState18 +private fun dfastate_19: DFAState19 do return once new DFAState19 +private fun dfastate_20: DFAState20 do return once new DFAState20 +private fun dfastate_21: DFAState21 do return once new DFAState21 +private fun dfastate_22: DFAState22 do return once new DFAState22 +private fun dfastate_23: DFAState23 do return once new DFAState23 +private fun dfastate_24: DFAState24 do return once new DFAState24 +private fun dfastate_25: DFAState25 do return once new DFAState25 +private fun dfastate_26: DFAState26 do return once new DFAState26 +private fun dfastate_27: DFAState27 do return once new DFAState27 +private fun dfastate_28: DFAState28 do return once new DFAState28 +private fun dfastate_29: DFAState29 do return once new DFAState29 +private fun dfastate_30: DFAState30 do return once new DFAState30 +private fun dfastate_31: DFAState31 do return once new DFAState31 +private fun dfastate_32: DFAState32 do return once new DFAState32 +private fun dfastate_33: DFAState33 do return once new DFAState33 +private fun dfastate_34: DFAState34 do return once new DFAState34 class MyNToken super NToken end private class DFAState0 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 8 then return null if c <= 10 then return dfastate_1 if c <= 31 then return null @@ -82,11 +80,12 @@ end private class DFAState1 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun is_ignored do return true + redef fun make_token(position, source) do return null end redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 8 then return null if c <= 10 then return dfastate_1 if c <= 31 then return null @@ -97,28 +96,28 @@ end private class DFAState2 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point + if c > 92 then return dfastate_2 if c <= 33 then return dfastate_2 if c <= 34 then return dfastate_29 if c <= 91 then return dfastate_2 - if c <= 92 then return dfastate_30 - return dfastate_2 + return dfastate_30 end end private class DFAState3 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new N_39d_44d_39d + t.text = "," t.position = position - t.text = text return t end end private class DFAState4 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 47 then return null if c <= 57 then return dfastate_5 return null @@ -127,14 +126,14 @@ end private class DFAState5 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new Nnumber + t.text = position.extract(source) t.position = position - t.text = text return t end redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 45 then return null if c <= 46 then return dfastate_24 if c <= 47 then return null @@ -149,37 +148,37 @@ end private class DFAState6 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new N_39d_58d_39d + t.text = ":" t.position = position - t.text = text return t end end private class DFAState7 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new N_39d_91d_39d + t.text = "[" t.position = position - t.text = text return t end end private class DFAState8 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new N_39d_93d_39d + t.text = "]" t.position = position - t.text = text return t end end private class DFAState9 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 96 then return null if c <= 97 then return dfastate_20 return null @@ -188,7 +187,7 @@ end private class DFAState10 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 116 then return null if c <= 117 then return dfastate_17 return null @@ -197,7 +196,7 @@ end private class DFAState11 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 113 then return null if c <= 114 then return dfastate_14 return null @@ -206,27 +205,27 @@ end private class DFAState12 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new N_39d_123d_39d + t.text = "\{" t.position = position - t.text = text return t end end private class DFAState13 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new N_39d_125d_39d + t.text = "\}" t.position = position - t.text = text return t end end private class DFAState14 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 116 then return null if c <= 117 then return dfastate_15 return null @@ -235,7 +234,7 @@ end private class DFAState15 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 100 then return null if c <= 101 then return dfastate_16 return null @@ -244,17 +243,17 @@ end private class DFAState16 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new N_39dtrue_39d + t.text = "true" t.position = position - t.text = text return t end end private class DFAState17 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 107 then return null if c <= 108 then return dfastate_18 return null @@ -263,7 +262,7 @@ end private class DFAState18 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 107 then return null if c <= 108 then return dfastate_19 return null @@ -272,17 +271,17 @@ end private class DFAState19 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new N_39dnull_39d + t.text = "null" t.position = position - t.text = text return t end end private class DFAState20 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 107 then return null if c <= 108 then return dfastate_21 return null @@ -291,7 +290,7 @@ end private class DFAState21 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 114 then return null if c <= 115 then return dfastate_22 return null @@ -300,7 +299,7 @@ end private class DFAState22 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 100 then return null if c <= 101 then return dfastate_23 return null @@ -309,17 +308,17 @@ end private class DFAState23 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new N_39dfalse_39d + t.text = "false" t.position = position - t.text = text return t end end private class DFAState24 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 47 then return null if c <= 57 then return dfastate_28 return null @@ -328,7 +327,7 @@ end private class DFAState25 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 42 then return null if c <= 43 then return dfastate_26 if c <= 44 then return null @@ -341,7 +340,7 @@ end private class DFAState26 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 47 then return null if c <= 57 then return dfastate_27 return null @@ -350,14 +349,14 @@ end private class DFAState27 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new Nnumber + t.text = position.extract(source) t.position = position - t.text = text return t end redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 47 then return null if c <= 57 then return dfastate_27 return null @@ -366,14 +365,14 @@ end private class DFAState28 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new Nnumber + t.text = position.extract(source) t.position = position - t.text = text return t end redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 47 then return null if c <= 57 then return dfastate_28 if c <= 68 then return null @@ -386,17 +385,17 @@ end private class DFAState29 super DFAState redef fun is_accept do return true - redef fun make_token(position, text) do + redef fun make_token(position, source) do var t = new Nstring + t.text = position.extract(source) t.position = position - t.text = text return t end end private class DFAState30 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 33 then return null if c <= 34 then return dfastate_2 if c <= 46 then return null @@ -420,7 +419,7 @@ end private class DFAState31 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 47 then return null if c <= 57 then return dfastate_32 if c <= 64 then return null @@ -433,7 +432,7 @@ end private class DFAState32 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 47 then return null if c <= 57 then return dfastate_33 if c <= 64 then return null @@ -446,7 +445,7 @@ end private class DFAState33 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 47 then return null if c <= 57 then return dfastate_34 if c <= 64 then return null @@ -459,7 +458,7 @@ end private class DFAState34 super DFAState redef fun trans(char) do - var c = char.ascii + var c = char.code_point if c <= 47 then return null if c <= 57 then return dfastate_2 if c <= 64 then return null