AST without accent
unknown
json
5 months ago
62 kB
11
Indexable
in 7 months
{ "type": "compilation_unit", "start_byte": 0, "end_byte": 723, "text": "using System.Text.RegularExpressions;\n\nnamespace HUBLoader.Types;\n\n\npublic class TypeArret\n{\n private readonly string bits;\n\n public TypeArret(string rawBits)\n {\n if (rawBits.Length != 20)\n throw new ArgumentException($\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\");\n\n if (!Regex.IsMatch(rawBits, \"^[ON]{20}$\", RegexOptions.IgnoreCase))\n throw new ArgumentException(\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\");\n\n bits = rawBits.ToUpperInvariant();\n }\n\n public bool EstActif(TypeArretFlag flag)\n {\n return bits[(int)flag] == 'O';\n }\n\n public override string ToString()\n {\n return bits;\n }\n}\n", "children": [ { "type": "using_directive", "start_byte": 0, "end_byte": 37, "text": "using System.Text.RegularExpressions;", "children": [ { "type": "using", "start_byte": 0, "end_byte": 5, "text": "using", "children": [] }, { "type": "qualified_name", "start_byte": 6, "end_byte": 36, "text": "System.Text.RegularExpressions", "children": [ { "type": "qualified_name", "start_byte": 6, "end_byte": 17, "text": "System.Text", "children": [ { "type": "identifier", "start_byte": 6, "end_byte": 12, "text": "System", "children": [] }, { "type": ".", "start_byte": 12, "end_byte": 13, "text": ".", "children": [] }, { "type": "identifier", "start_byte": 13, "end_byte": 17, "text": "Text", "children": [] } ] }, { "type": ".", "start_byte": 17, "end_byte": 18, "text": ".", "children": [] }, { "type": "identifier", "start_byte": 18, "end_byte": 36, "text": "RegularExpressions", "children": [] } ] }, { "type": ";", "start_byte": 36, "end_byte": 37, "text": ";", "children": [] } ] }, { "type": "file_scoped_namespace_declaration", "start_byte": 39, "end_byte": 65, "text": "namespace HUBLoader.Types;", "children": [ { "type": "namespace", "start_byte": 39, "end_byte": 48, "text": "namespace", "children": [] }, { "type": "qualified_name", "start_byte": 49, "end_byte": 64, "text": "HUBLoader.Types", "children": [ { "type": "identifier", "start_byte": 49, "end_byte": 58, "text": "HUBLoader", "children": [] }, { "type": ".", "start_byte": 58, "end_byte": 59, "text": ".", "children": [] }, { "type": "identifier", "start_byte": 59, "end_byte": 64, "text": "Types", "children": [] } ] }, { "type": ";", "start_byte": 64, "end_byte": 65, "text": ";", "children": [] } ] }, { "type": "class_declaration", "start_byte": 68, "end_byte": 722, "text": "public class TypeArret\n{\n private readonly string bits;\n\n public TypeArret(string rawBits)\n {\n if (rawBits.Length != 20)\n throw new ArgumentException($\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\");\n\n if (!Regex.IsMatch(rawBits, \"^[ON]{20}$\", RegexOptions.IgnoreCase))\n throw new ArgumentException(\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\");\n\n bits = rawBits.ToUpperInvariant();\n }\n\n public bool EstActif(TypeArretFlag flag)\n {\n return bits[(int)flag] == 'O';\n }\n\n public override string ToString()\n {\n return bits;\n }\n}", "children": [ { "type": "modifier", "start_byte": 68, "end_byte": 74, "text": "public", "children": [ { "type": "public", "start_byte": 68, "end_byte": 74, "text": "public", "children": [] } ] }, { "type": "class", "start_byte": 75, "end_byte": 80, "text": "class", "children": [] }, { "type": "identifier", "start_byte": 81, "end_byte": 90, "text": "TypeArret", "children": [] }, { "type": "declaration_list", "start_byte": 91, "end_byte": 722, "text": "{\n private readonly string bits;\n\n public TypeArret(string rawBits)\n {\n if (rawBits.Length != 20)\n throw new ArgumentException($\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\");\n\n if (!Regex.IsMatch(rawBits, \"^[ON]{20}$\", RegexOptions.IgnoreCase))\n throw new ArgumentException(\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\");\n\n bits = rawBits.ToUpperInvariant();\n }\n\n public bool EstActif(TypeArretFlag flag)\n {\n return bits[(int)flag] == 'O';\n }\n\n public override string ToString()\n {\n return bits;\n }\n}", "children": [ { "type": "{", "start_byte": 91, "end_byte": 92, "text": "{", "children": [] }, { "type": "field_declaration", "start_byte": 97, "end_byte": 126, "text": "private readonly string bits;", "children": [ { "type": "modifier", "start_byte": 97, "end_byte": 104, "text": "private", "children": [ { "type": "private", "start_byte": 97, "end_byte": 104, "text": "private", "children": [] } ] }, { "type": "modifier", "start_byte": 105, "end_byte": 113, "text": "readonly", "children": [ { "type": "readonly", "start_byte": 105, "end_byte": 113, "text": "readonly", "children": [] } ] }, { "type": "variable_declaration", "start_byte": 114, "end_byte": 125, "text": "string bits", "children": [ { "type": "predefined_type", "start_byte": 114, "end_byte": 120, "text": "string", "children": [] }, { "type": "variable_declarator", "start_byte": 121, "end_byte": 125, "text": "bits", "children": [ { "type": "identifier", "start_byte": 121, "end_byte": 125, "text": "bits", "children": [] } ] } ] }, { "type": ";", "start_byte": 125, "end_byte": 126, "text": ";", "children": [] } ] }, { "type": "constructor_declaration", "start_byte": 132, "end_byte": 551, "text": "public TypeArret(string rawBits)\n {\n if (rawBits.Length != 20)\n throw new ArgumentException($\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\");\n\n if (!Regex.IsMatch(rawBits, \"^[ON]{20}$\", RegexOptions.IgnoreCase))\n throw new ArgumentException(\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\");\n\n bits = rawBits.ToUpperInvariant();\n }", "children": [ { "type": "modifier", "start_byte": 132, "end_byte": 138, "text": "public", "children": [ { "type": "public", "start_byte": 132, "end_byte": 138, "text": "public", "children": [] } ] }, { "type": "identifier", "start_byte": 139, "end_byte": 148, "text": "TypeArret", "children": [] }, { "type": "parameter_list", "start_byte": 148, "end_byte": 164, "text": "(string rawBits)", "children": [ { "type": "(", "start_byte": 148, "end_byte": 149, "text": "(", "children": [] }, { "type": "parameter", "start_byte": 149, "end_byte": 163, "text": "string rawBits", "children": [ { "type": "predefined_type", "start_byte": 149, "end_byte": 155, "text": "string", "children": [] }, { "type": "identifier", "start_byte": 156, "end_byte": 163, "text": "rawBits", "children": [] } ] }, { "type": ")", "start_byte": 163, "end_byte": 164, "text": ")", "children": [] } ] }, { "type": "block", "start_byte": 169, "end_byte": 551, "text": "{\n if (rawBits.Length != 20)\n throw new ArgumentException($\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\");\n\n if (!Regex.IsMatch(rawBits, \"^[ON]{20}$\", RegexOptions.IgnoreCase))\n throw new ArgumentException(\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\");\n\n bits = rawBits.ToUpperInvariant();\n }", "children": [ { "type": "{", "start_byte": 169, "end_byte": 170, "text": "{", "children": [] }, { "type": "if_statement", "start_byte": 179, "end_byte": 322, "text": "if (rawBits.Length != 20)\n throw new ArgumentException($\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\");", "children": [ { "type": "if", "start_byte": 179, "end_byte": 181, "text": "if", "children": [] }, { "type": "(", "start_byte": 182, "end_byte": 183, "text": "(", "children": [] }, { "type": "binary_expression", "start_byte": 183, "end_byte": 203, "text": "rawBits.Length != 20", "children": [ { "type": "member_access_expression", "start_byte": 183, "end_byte": 197, "text": "rawBits.Length", "children": [ { "type": "identifier", "start_byte": 183, "end_byte": 190, "text": "rawBits", "children": [] }, { "type": ".", "start_byte": 190, "end_byte": 191, "text": ".", "children": [] }, { "type": "identifier", "start_byte": 191, "end_byte": 197, "text": "Length", "children": [] } ] }, { "type": "!=", "start_byte": 198, "end_byte": 200, "text": "!=", "children": [] }, { "type": "integer_literal", "start_byte": 201, "end_byte": 203, "text": "20", "children": [] } ] }, { "type": ")", "start_byte": 203, "end_byte": 204, "text": ")", "children": [] }, { "type": "throw_statement", "start_byte": 217, "end_byte": 322, "text": "throw new ArgumentException($\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\");", "children": [ { "type": "throw", "start_byte": 217, "end_byte": 222, "text": "throw", "children": [] }, { "type": "object_creation_expression", "start_byte": 223, "end_byte": 321, "text": "new ArgumentException($\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\")", "children": [ { "type": "new", "start_byte": 223, "end_byte": 226, "text": "new", "children": [] }, { "type": "identifier", "start_byte": 227, "end_byte": 244, "text": "ArgumentException", "children": [] }, { "type": "argument_list", "start_byte": 244, "end_byte": 321, "text": "($\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\")", "children": [ { "type": "(", "start_byte": 244, "end_byte": 245, "text": "(", "children": [] }, { "type": "argument", "start_byte": 245, "end_byte": 320, "text": "$\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\"", "children": [ { "type": "interpolated_string_expression", "start_byte": 245, "end_byte": 320, "text": "$\"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})\"", "children": [ { "type": "interpolation_start", "start_byte": 245, "end_byte": 246, "text": "$", "children": [] }, { "type": "\"", "start_byte": 246, "end_byte": 247, "text": "\"", "children": [] }, { "type": "string_content", "start_byte": 247, "end_byte": 302, "text": "TypeArret doit contenir exactement 20 caracteres (recu ", "children": [] }, { "type": "interpolation", "start_byte": 302, "end_byte": 318, "text": "{rawBits.Length}", "children": [ { "type": "interpolation_brace", "start_byte": 302, "end_byte": 303, "text": "{", "children": [] }, { "type": "member_access_expression", "start_byte": 303, "end_byte": 317, "text": "rawBits.Length", "children": [ { "type": "identifier", "start_byte": 303, "end_byte": 310, "text": "rawBits", "children": [] }, { "type": ".", "start_byte": 310, "end_byte": 311, "text": ".", "children": [] }, { "type": "identifier", "start_byte": 311, "end_byte": 317, "text": "Length", "children": [] } ] }, { "type": "interpolation_brace", "start_byte": 317, "end_byte": 318, "text": "}", "children": [] } ] }, { "type": "string_content", "start_byte": 318, "end_byte": 319, "text": ")", "children": [] }, { "type": "\"", "start_byte": 319, "end_byte": 320, "text": "\"", "children": [] } ] } ] }, { "type": ")", "start_byte": 320, "end_byte": 321, "text": ")", "children": [] } ] } ] }, { "type": ";", "start_byte": 321, "end_byte": 322, "text": ";", "children": [] } ] } ] }, { "type": "if_statement", "start_byte": 332, "end_byte": 501, "text": "if (!Regex.IsMatch(rawBits, \"^[ON]{20}$\", RegexOptions.IgnoreCase))\n throw new ArgumentException(\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\");", "children": [ { "type": "if", "start_byte": 332, "end_byte": 334, "text": "if", "children": [] }, { "type": "(", "start_byte": 335, "end_byte": 336, "text": "(", "children": [] }, { "type": "prefix_unary_expression", "start_byte": 336, "end_byte": 398, "text": "!Regex.IsMatch(rawBits, \"^[ON]{20}$\", RegexOptions.IgnoreCase)", "children": [ { "type": "!", "start_byte": 336, "end_byte": 337, "text": "!", "children": [] }, { "type": "invocation_expression", "start_byte": 337, "end_byte": 398, "text": "Regex.IsMatch(rawBits, \"^[ON]{20}$\", RegexOptions.IgnoreCase)", "children": [ { "type": "member_access_expression", "start_byte": 337, "end_byte": 350, "text": "Regex.IsMatch", "children": [ { "type": "identifier", "start_byte": 337, "end_byte": 342, "text": "Regex", "children": [] }, { "type": ".", "start_byte": 342, "end_byte": 343, "text": ".", "children": [] }, { "type": "identifier", "start_byte": 343, "end_byte": 350, "text": "IsMatch", "children": [] } ] }, { "type": "argument_list", "start_byte": 350, "end_byte": 398, "text": "(rawBits, \"^[ON]{20}$\", RegexOptions.IgnoreCase)", "children": [ { "type": "(", "start_byte": 350, "end_byte": 351, "text": "(", "children": [] }, { "type": "argument", "start_byte": 351, "end_byte": 358, "text": "rawBits", "children": [ { "type": "identifier", "start_byte": 351, "end_byte": 358, "text": "rawBits", "children": [] } ] }, { "type": ",", "start_byte": 358, "end_byte": 359, "text": ",", "children": [] }, { "type": "argument", "start_byte": 360, "end_byte": 372, "text": "\"^[ON]{20}$\"", "children": [ { "type": "string_literal", "start_byte": 360, "end_byte": 372, "text": "\"^[ON]{20}$\"", "children": [ { "type": "\"", "start_byte": 360, "end_byte": 361, "text": "\"", "children": [] }, { "type": "string_literal_content", "start_byte": 361, "end_byte": 371, "text": "^[ON]{20}$", "children": [] }, { "type": "\"", "start_byte": 371, "end_byte": 372, "text": "\"", "children": [] } ] } ] }, { "type": ",", "start_byte": 372, "end_byte": 373, "text": ",", "children": [] }, { "type": "argument", "start_byte": 374, "end_byte": 397, "text": "RegexOptions.IgnoreCase", "children": [ { "type": "member_access_expression", "start_byte": 374, "end_byte": 397, "text": "RegexOptions.IgnoreCase", "children": [ { "type": "identifier", "start_byte": 374, "end_byte": 386, "text": "RegexOptions", "children": [] }, { "type": ".", "start_byte": 386, "end_byte": 387, "text": ".", "children": [] }, { "type": "identifier", "start_byte": 387, "end_byte": 397, "text": "IgnoreCase", "children": [] } ] } ] }, { "type": ")", "start_byte": 397, "end_byte": 398, "text": ")", "children": [] } ] } ] } ] }, { "type": ")", "start_byte": 398, "end_byte": 399, "text": ")", "children": [] }, { "type": "throw_statement", "start_byte": 412, "end_byte": 501, "text": "throw new ArgumentException(\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\");", "children": [ { "type": "throw", "start_byte": 412, "end_byte": 417, "text": "throw", "children": [] }, { "type": "object_creation_expression", "start_byte": 418, "end_byte": 500, "text": "new ArgumentException(\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\")", "children": [ { "type": "new", "start_byte": 418, "end_byte": 421, "text": "new", "children": [] }, { "type": "identifier", "start_byte": 422, "end_byte": 439, "text": "ArgumentException", "children": [] }, { "type": "argument_list", "start_byte": 439, "end_byte": 500, "text": "(\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\")", "children": [ { "type": "(", "start_byte": 439, "end_byte": 440, "text": "(", "children": [] }, { "type": "argument", "start_byte": 440, "end_byte": 499, "text": "\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\"", "children": [ { "type": "string_literal", "start_byte": 440, "end_byte": 499, "text": "\"TypeArret ne doit contenir que des caracteres 'O' ou 'N'.\"", "children": [ { "type": "\"", "start_byte": 440, "end_byte": 441, "text": "\"", "children": [] }, { "type": "string_literal_content", "start_byte": 441, "end_byte": 498, "text": "TypeArret ne doit contenir que des caracteres 'O' ou 'N'.", "children": [] }, { "type": "\"", "start_byte": 498, "end_byte": 499, "text": "\"", "children": [] } ] } ] }, { "type": ")", "start_byte": 499, "end_byte": 500, "text": ")", "children": [] } ] } ] }, { "type": ";", "start_byte": 500, "end_byte": 501, "text": ";", "children": [] } ] } ] }, { "type": "expression_statement", "start_byte": 511, "end_byte": 545, "text": "bits = rawBits.ToUpperInvariant();", "children": [ { "type": "assignment_expression", "start_byte": 511, "end_byte": 544, "text": "bits = rawBits.ToUpperInvariant()", "children": [ { "type": "identifier", "start_byte": 511, "end_byte": 515, "text": "bits", "children": [] }, { "type": "=", "start_byte": 516, "end_byte": 517, "text": "=", "children": [] }, { "type": "invocation_expression", "start_byte": 518, "end_byte": 544, "text": "rawBits.ToUpperInvariant()", "children": [ { "type": "member_access_expression", "start_byte": 518, "end_byte": 542, "text": "rawBits.ToUpperInvariant", "children": [ { "type": "identifier", "start_byte": 518, "end_byte": 525, "text": "rawBits", "children": [] }, { "type": ".", "start_byte": 525, "end_byte": 526, "text": ".", "children": [] }, { "type": "identifier", "start_byte": 526, "end_byte": 542, "text": "ToUpperInvariant", "children": [] } ] }, { "type": "argument_list", "start_byte": 542, "end_byte": 544, "text": "()", "children": [ { "type": "(", "start_byte": 542, "end_byte": 543, "text": "(", "children": [] }, { "type": ")", "start_byte": 543, "end_byte": 544, "text": ")", "children": [] } ] } ] } ] }, { "type": ";", "start_byte": 544, "end_byte": 545, "text": ";", "children": [] } ] }, { "type": "}", "start_byte": 550, "end_byte": 551, "text": "}", "children": [] } ] } ] }, { "type": "method_declaration", "start_byte": 557, "end_byte": 648, "text": "public bool EstActif(TypeArretFlag flag)\n {\n return bits[(int)flag] == 'O';\n }", "children": [ { "type": "modifier", "start_byte": 557, "end_byte": 563, "text": "public", "children": [ { "type": "public", "start_byte": 557, "end_byte": 563, "text": "public", "children": [] } ] }, { "type": "predefined_type", "start_byte": 564, "end_byte": 568, "text": "bool", "children": [] }, { "type": "identifier", "start_byte": 569, "end_byte": 577, "text": "EstActif", "children": [] }, { "type": "parameter_list", "start_byte": 577, "end_byte": 597, "text": "(TypeArretFlag flag)", "children": [ { "type": "(", "start_byte": 577, "end_byte": 578, "text": "(", "children": [] }, { "type": "parameter", "start_byte": 578, "end_byte": 596, "text": "TypeArretFlag flag", "children": [ { "type": "identifier", "start_byte": 578, "end_byte": 591, "text": "TypeArretFlag", "children": [] }, { "type": "identifier", "start_byte": 592, "end_byte": 596, "text": "flag", "children": [] } ] }, { "type": ")", "start_byte": 596, "end_byte": 597, "text": ")", "children": [] } ] }, { "type": "block", "start_byte": 602, "end_byte": 648, "text": "{\n return bits[(int)flag] == 'O';\n }", "children": [ { "type": "{", "start_byte": 602, "end_byte": 603, "text": "{", "children": [] }, { "type": "return_statement", "start_byte": 612, "end_byte": 642, "text": "return bits[(int)flag] == 'O';", "children": [ { "type": "return", "start_byte": 612, "end_byte": 618, "text": "return", "children": [] }, { "type": "binary_expression", "start_byte": 619, "end_byte": 641, "text": "bits[(int)flag] == 'O'", "children": [ { "type": "element_access_expression", "start_byte": 619, "end_byte": 634, "text": "bits[(int)flag]", "children": [ { "type": "identifier", "start_byte": 619, "end_byte": 623, "text": "bits", "children": [] }, { "type": "bracketed_argument_list", "start_byte": 623, "end_byte": 634, "text": "[(int)flag]", "children": [ { "type": "[", "start_byte": 623, "end_byte": 624, "text": "[", "children": [] }, { "type": "argument", "start_byte": 624, "end_byte": 633, "text": "(int)flag", "children": [ { "type": "cast_expression", "start_byte": 624, "end_byte": 633, "text": "(int)flag", "children": [ { "type": "(", "start_byte": 624, "end_byte": 625, "text": "(", "children": [] }, { "type": "predefined_type", "start_byte": 625, "end_byte": 628, "text": "int", "children": [] }, { "type": ")", "start_byte": 628, "end_byte": 629, "text": ")", "children": [] }, { "type": "identifier", "start_byte": 629, "end_byte": 633, "text": "flag", "children": [] } ] } ] }, { "type": "]", "start_byte": 633, "end_byte": 634, "text": "]", "children": [] } ] } ] }, { "type": "==", "start_byte": 635, "end_byte": 637, "text": "==", "children": [] }, { "type": "character_literal", "start_byte": 638, "end_byte": 641, "text": "'O'", "children": [ { "type": "'", "start_byte": 638, "end_byte": 639, "text": "'", "children": [] }, { "type": "character_literal_content", "start_byte": 639, "end_byte": 640, "text": "O", "children": [] }, { "type": "'", "start_byte": 640, "end_byte": 641, "text": "'", "children": [] } ] } ] }, { "type": ";", "start_byte": 641, "end_byte": 642, "text": ";", "children": [] } ] }, { "type": "}", "start_byte": 647, "end_byte": 648, "text": "}", "children": [] } ] } ] }, { "type": "method_declaration", "start_byte": 654, "end_byte": 720, "text": "public override string ToString()\n {\n return bits;\n }", "children": [ { "type": "modifier", "start_byte": 654, "end_byte": 660, "text": "public", "children": [ { "type": "public", "start_byte": 654, "end_byte": 660, "text": "public", "children": [] } ] }, { "type": "modifier", "start_byte": 661, "end_byte": 669, "text": "override", "children": [ { "type": "override", "start_byte": 661, "end_byte": 669, "text": "override", "children": [] } ] }, { "type": "predefined_type", "start_byte": 670, "end_byte": 676, "text": "string", "children": [] }, { "type": "identifier", "start_byte": 677, "end_byte": 685, "text": "ToString", "children": [] }, { "type": "parameter_list", "start_byte": 685, "end_byte": 687, "text": "()", "children": [ { "type": "(", "start_byte": 685, "end_byte": 686, "text": "(", "children": [] }, { "type": ")", "start_byte": 686, "end_byte": 687, "text": ")", "children": [] } ] }, { "type": "block", "start_byte": 692, "end_byte": 720, "text": "{\n return bits;\n }", "children": [ { "type": "{", "start_byte": 692, "end_byte": 693, "text": "{", "children": [] }, { "type": "return_statement", "start_byte": 702, "end_byte": 714, "text": "return bits;", "children": [ { "type": "return", "start_byte": 702, "end_byte": 708, "text": "return", "children": [] }, { "type": "identifier", "start_byte": 709, "end_byte": 713, "text": "bits", "children": [] }, { "type": ";", "start_byte": 713, "end_byte": 714, "text": ";", "children": [] } ] }, { "type": "}", "start_byte": 719, "end_byte": 720, "text": "}", "children": [] } ] } ] }, { "type": "}", "start_byte": 721, "end_byte": 722, "text": "}", "children": [] } ] } ] } ] }
Editor is loading...
Leave a Comment