/* Automatically @generated by tree-sitter */ #include "tree_sitter/parser.h" #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif #define LANGUAGE_VERSION 15 #define STATE_COUNT 50 #define LARGE_STATE_COUNT 2 #define SYMBOL_COUNT 49 #define ALIAS_COUNT 0 #define TOKEN_COUNT 30 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 13 #define MAX_ALIAS_SEQUENCE_LENGTH 5 #define MAX_RESERVED_WORD_SET_SIZE 0 #define PRODUCTION_ID_COUNT 11 #define SUPERTYPE_COUNT 0 enum ts_symbol_identifiers { anon_sym_LBRACK = 1, anon_sym_RBRACK = 2, anon_sym_COMMA = 3, anon_sym_LPAREN = 4, anon_sym_RPAREN = 5, anon_sym_DASH_DASH = 6, anon_sym_DASH_GT = 7, anon_sym_PLUS = 8, anon_sym_DASH = 9, sym_component_label = 10, sym_text = 11, aux_sym_real_number_token1 = 12, aux_sym_real_number_token2 = 13, aux_sym_real_number_token3 = 14, aux_sym_stage_number_token1 = 15, aux_sym_stage_number_token2 = 16, aux_sym_stage_number_token3 = 17, aux_sym_stage_number_token4 = 18, aux_sym_shape_label_token1 = 19, aux_sym_shape_label_token2 = 20, aux_sym_shape_label_token3 = 21, aux_sym_shape_label_token4 = 22, sym__note_keyword = 23, sym__group_keyword = 24, sym__inertia_keyword = 25, sym__evolution_keyword = 26, anon_sym_LF = 27, anon_sym_CR_LF = 28, anon_sym_CR = 29, sym_source_file = 30, sym_entity = 31, sym_component = 32, sym_dependency = 33, sym_note = 34, sym_stage = 35, sym_group = 36, sym_inertia = 37, sym_evolution = 38, sym_position = 39, sym_shape = 40, sym_dependency_type = 41, sym_sign = 42, sym_real_number = 43, sym_stage_number = 44, sym_shape_label = 45, sym__line_ending = 46, aux_sym_source_file_repeat1 = 47, aux_sym_group_repeat1 = 48, }; static const char * const ts_symbol_names[] = { [ts_builtin_sym_end] = "end", [anon_sym_LBRACK] = "[", [anon_sym_RBRACK] = "]", [anon_sym_COMMA] = ",", [anon_sym_LPAREN] = "(", [anon_sym_RPAREN] = ")", [anon_sym_DASH_DASH] = "--", [anon_sym_DASH_GT] = "->", [anon_sym_PLUS] = "+", [anon_sym_DASH] = "-", [sym_component_label] = "component_label", [sym_text] = "text", [aux_sym_real_number_token1] = "real_number_token1", [aux_sym_real_number_token2] = "real_number_token2", [aux_sym_real_number_token3] = "real_number_token3", [aux_sym_stage_number_token1] = "stage_number_token1", [aux_sym_stage_number_token2] = "stage_number_token2", [aux_sym_stage_number_token3] = "stage_number_token3", [aux_sym_stage_number_token4] = "stage_number_token4", [aux_sym_shape_label_token1] = "shape_label_token1", [aux_sym_shape_label_token2] = "shape_label_token2", [aux_sym_shape_label_token3] = "shape_label_token3", [aux_sym_shape_label_token4] = "shape_label_token4", [sym__note_keyword] = "keyword", [sym__group_keyword] = "keyword", [sym__inertia_keyword] = "keyword", [sym__evolution_keyword] = "keyword", [anon_sym_LF] = "\n", [anon_sym_CR_LF] = "\r\n", [anon_sym_CR] = "\r", [sym_source_file] = "source_file", [sym_entity] = "entity", [sym_component] = "component", [sym_dependency] = "dependency", [sym_note] = "note", [sym_stage] = "stage", [sym_group] = "group", [sym_inertia] = "inertia", [sym_evolution] = "evolution", [sym_position] = "position", [sym_shape] = "shape", [sym_dependency_type] = "dependency_type", [sym_sign] = "sign", [sym_real_number] = "real_number", [sym_stage_number] = "stage_number", [sym_shape_label] = "shape_label", [sym__line_ending] = "_line_ending", [aux_sym_source_file_repeat1] = "source_file_repeat1", [aux_sym_group_repeat1] = "group_repeat1", }; static const TSSymbol ts_symbol_map[] = { [ts_builtin_sym_end] = ts_builtin_sym_end, [anon_sym_LBRACK] = anon_sym_LBRACK, [anon_sym_RBRACK] = anon_sym_RBRACK, [anon_sym_COMMA] = anon_sym_COMMA, [anon_sym_LPAREN] = anon_sym_LPAREN, [anon_sym_RPAREN] = anon_sym_RPAREN, [anon_sym_DASH_DASH] = anon_sym_DASH_DASH, [anon_sym_DASH_GT] = anon_sym_DASH_GT, [anon_sym_PLUS] = anon_sym_PLUS, [anon_sym_DASH] = anon_sym_DASH, [sym_component_label] = sym_component_label, [sym_text] = sym_text, [aux_sym_real_number_token1] = aux_sym_real_number_token1, [aux_sym_real_number_token2] = aux_sym_real_number_token2, [aux_sym_real_number_token3] = aux_sym_real_number_token3, [aux_sym_stage_number_token1] = aux_sym_stage_number_token1, [aux_sym_stage_number_token2] = aux_sym_stage_number_token2, [aux_sym_stage_number_token3] = aux_sym_stage_number_token3, [aux_sym_stage_number_token4] = aux_sym_stage_number_token4, [aux_sym_shape_label_token1] = aux_sym_shape_label_token1, [aux_sym_shape_label_token2] = aux_sym_shape_label_token2, [aux_sym_shape_label_token3] = aux_sym_shape_label_token3, [aux_sym_shape_label_token4] = aux_sym_shape_label_token4, [sym__note_keyword] = sym__note_keyword, [sym__group_keyword] = sym__note_keyword, [sym__inertia_keyword] = sym__note_keyword, [sym__evolution_keyword] = sym__note_keyword, [anon_sym_LF] = anon_sym_LF, [anon_sym_CR_LF] = anon_sym_CR_LF, [anon_sym_CR] = anon_sym_CR, [sym_source_file] = sym_source_file, [sym_entity] = sym_entity, [sym_component] = sym_component, [sym_dependency] = sym_dependency, [sym_note] = sym_note, [sym_stage] = sym_stage, [sym_group] = sym_group, [sym_inertia] = sym_inertia, [sym_evolution] = sym_evolution, [sym_position] = sym_position, [sym_shape] = sym_shape, [sym_dependency_type] = sym_dependency_type, [sym_sign] = sym_sign, [sym_real_number] = sym_real_number, [sym_stage_number] = sym_stage_number, [sym_shape_label] = sym_shape_label, [sym__line_ending] = sym__line_ending, [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, [aux_sym_group_repeat1] = aux_sym_group_repeat1, }; static const TSSymbolMetadata ts_symbol_metadata[] = { [ts_builtin_sym_end] = { .visible = false, .named = true, }, [anon_sym_LBRACK] = { .visible = true, .named = false, }, [anon_sym_RBRACK] = { .visible = true, .named = false, }, [anon_sym_COMMA] = { .visible = true, .named = false, }, [anon_sym_LPAREN] = { .visible = true, .named = false, }, [anon_sym_RPAREN] = { .visible = true, .named = false, }, [anon_sym_DASH_DASH] = { .visible = true, .named = false, }, [anon_sym_DASH_GT] = { .visible = true, .named = false, }, [anon_sym_PLUS] = { .visible = true, .named = false, }, [anon_sym_DASH] = { .visible = true, .named = false, }, [sym_component_label] = { .visible = true, .named = true, }, [sym_text] = { .visible = true, .named = true, }, [aux_sym_real_number_token1] = { .visible = false, .named = false, }, [aux_sym_real_number_token2] = { .visible = false, .named = false, }, [aux_sym_real_number_token3] = { .visible = false, .named = false, }, [aux_sym_stage_number_token1] = { .visible = false, .named = false, }, [aux_sym_stage_number_token2] = { .visible = false, .named = false, }, [aux_sym_stage_number_token3] = { .visible = false, .named = false, }, [aux_sym_stage_number_token4] = { .visible = false, .named = false, }, [aux_sym_shape_label_token1] = { .visible = false, .named = false, }, [aux_sym_shape_label_token2] = { .visible = false, .named = false, }, [aux_sym_shape_label_token3] = { .visible = false, .named = false, }, [aux_sym_shape_label_token4] = { .visible = false, .named = false, }, [sym__note_keyword] = { .visible = true, .named = false, }, [sym__group_keyword] = { .visible = true, .named = false, }, [sym__inertia_keyword] = { .visible = true, .named = false, }, [sym__evolution_keyword] = { .visible = true, .named = false, }, [anon_sym_LF] = { .visible = true, .named = false, }, [anon_sym_CR_LF] = { .visible = true, .named = false, }, [anon_sym_CR] = { .visible = true, .named = false, }, [sym_source_file] = { .visible = true, .named = true, }, [sym_entity] = { .visible = true, .named = true, }, [sym_component] = { .visible = true, .named = true, }, [sym_dependency] = { .visible = true, .named = true, }, [sym_note] = { .visible = true, .named = true, }, [sym_stage] = { .visible = true, .named = true, }, [sym_group] = { .visible = true, .named = true, }, [sym_inertia] = { .visible = true, .named = true, }, [sym_evolution] = { .visible = true, .named = true, }, [sym_position] = { .visible = true, .named = true, }, [sym_shape] = { .visible = true, .named = true, }, [sym_dependency_type] = { .visible = true, .named = true, }, [sym_sign] = { .visible = true, .named = true, }, [sym_real_number] = { .visible = true, .named = true, }, [sym_stage_number] = { .visible = true, .named = true, }, [sym_shape_label] = { .visible = true, .named = true, }, [sym__line_ending] = { .visible = false, .named = true, }, [aux_sym_source_file_repeat1] = { .visible = false, .named = false, }, [aux_sym_group_repeat1] = { .visible = false, .named = false, }, }; enum ts_field_identifiers { field_component = 1, field_from = 2, field_label = 3, field_number = 4, field_position = 5, field_shape = 6, field_sign = 7, field_text = 8, field_to = 9, field_type = 10, field_value = 11, field_x = 12, field_y = 13, }; static const char * const ts_field_names[] = { [0] = NULL, [field_component] = "component", [field_from] = "from", [field_label] = "label", [field_number] = "number", [field_position] = "position", [field_shape] = "shape", [field_sign] = "sign", [field_text] = "text", [field_to] = "to", [field_type] = "type", [field_value] = "value", [field_x] = "x", [field_y] = "y", }; static const TSMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [1] = {.index = 0, .length = 2}, [2] = {.index = 2, .length = 1}, [3] = {.index = 3, .length = 3}, [4] = {.index = 6, .length = 3}, [5] = {.index = 9, .length = 2}, [6] = {.index = 11, .length = 2}, [7] = {.index = 13, .length = 2}, [8] = {.index = 15, .length = 2}, [9] = {.index = 17, .length = 3}, [10] = {.index = 20, .length = 2}, }; static const TSFieldMapEntry ts_field_map_entries[] = { [0] = {field_label, 0}, {field_position, 1}, [2] = {field_component, 1}, [3] = {field_label, 0}, {field_position, 1}, {field_shape, 2}, [6] = {field_from, 0}, {field_to, 2}, {field_type, 1}, [9] = {field_position, 1}, {field_text, 2}, [11] = {field_component, 1}, {field_component, 2, .inherited = true}, [13] = {field_number, 1}, {field_value, 3}, [15] = {field_component, 0, .inherited = true}, {field_component, 1, .inherited = true}, [17] = {field_component, 1}, {field_sign, 2}, {field_value, 3}, [20] = {field_x, 1}, {field_y, 3}, }; static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { [0] = {0}, }; static const uint16_t ts_non_terminal_alias_map[] = { 0, }; static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7, [8] = 8, [9] = 9, [10] = 10, [11] = 11, [12] = 12, [13] = 13, [14] = 14, [15] = 15, [16] = 14, [17] = 17, [18] = 18, [19] = 19, [20] = 20, [21] = 18, [22] = 22, [23] = 23, [24] = 24, [25] = 25, [26] = 26, [27] = 27, [28] = 28, [29] = 29, [30] = 30, [31] = 31, [32] = 32, [33] = 33, [34] = 34, [35] = 35, [36] = 36, [37] = 37, [38] = 38, [39] = 39, [40] = 40, [41] = 41, [42] = 42, [43] = 43, [44] = 44, [45] = 20, [46] = 44, [47] = 47, [48] = 33, [49] = 49, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { START_LEXER(); eof = lexer->eof(lexer); switch (state) { case 0: if (eof) ADVANCE(49); ADVANCE_MAP( '\n', 80, '\r', 82, '(', 54, ')', 55, '+', 58, ',', 53, '-', 60, '.', 47, '[', 51, ']', 52, ); if (lookahead == '\t' || lookahead == ' ') SKIP(0); if (lookahead == 'C' || lookahead == 'c') ADVANCE(20); if (lookahead == 'I' || lookahead == 'i') ADVANCE(71); if (lookahead == 'S' || lookahead == 's') ADVANCE(34); if (lookahead == 'T' || lookahead == 't') ADVANCE(36); if (lookahead == 'X' || lookahead == 'x') ADVANCE(72); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(66); END_STATE(); case 1: if (lookahead == '\n') ADVANCE(80); if (lookahead == '\r') ADVANCE(82); if (lookahead == '(') ADVANCE(54); if (lookahead == '-') ADVANCE(3); if (lookahead == '[') ADVANCE(50); if (lookahead == '\t' || lookahead == ' ') SKIP(1); END_STATE(); case 2: if (lookahead == '+') ADVANCE(58); if (lookahead == '-') ADVANCE(59); if (lookahead == '\t' || lookahead == ' ') SKIP(2); END_STATE(); case 3: if (lookahead == '-') ADVANCE(56); if (lookahead == '>') ADVANCE(57); END_STATE(); case 4: if (lookahead == ']') ADVANCE(76); END_STATE(); case 5: if (lookahead == ']') ADVANCE(77); END_STATE(); case 6: if (lookahead == ']') ADVANCE(78); END_STATE(); case 7: if (lookahead == ']') ADVANCE(79); END_STATE(); case 8: if (lookahead == '\t' || lookahead == ' ') ADVANCE(63); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && lookahead != '\r') ADVANCE(64); END_STATE(); case 9: if (lookahead == 'A' || lookahead == 'a') ADVANCE(27); END_STATE(); case 10: if (lookahead == 'A' || lookahead == 'a') ADVANCE(6); END_STATE(); case 11: if (lookahead == 'A' || lookahead == 'a') ADVANCE(39); END_STATE(); case 12: if (lookahead == 'C' || lookahead == 'c') ADVANCE(24); END_STATE(); case 13: if (lookahead == 'E' || lookahead == 'e') ADVANCE(4); END_STATE(); case 14: if (lookahead == 'E' || lookahead == 'e') ADVANCE(75); END_STATE(); case 15: if (lookahead == 'E' || lookahead == 'e') ADVANCE(73); END_STATE(); case 16: if (lookahead == 'E' || lookahead == 'e') ADVANCE(74); END_STATE(); case 17: if (lookahead == 'E' || lookahead == 'e') ADVANCE(37); END_STATE(); case 18: if (lookahead == 'G' || lookahead == 'g') ADVANCE(25); END_STATE(); case 19: if (lookahead == 'I' || lookahead == 'i') ADVANCE(9); END_STATE(); case 20: if (lookahead == 'I' || lookahead == 'i') ADVANCE(35); END_STATE(); case 21: if (lookahead == 'I' || lookahead == 'i') ADVANCE(10); END_STATE(); case 22: if (lookahead == 'I' || lookahead == 'i') ADVANCE(32); END_STATE(); case 23: if (lookahead == 'L' || lookahead == 'l') ADVANCE(45); END_STATE(); case 24: if (lookahead == 'L' || lookahead == 'l') ADVANCE(14); END_STATE(); case 25: if (lookahead == 'L' || lookahead == 'l') ADVANCE(16); END_STATE(); case 26: if (lookahead == 'N' || lookahead == 'n') ADVANCE(17); END_STATE(); case 27: if (lookahead == 'N' || lookahead == 'n') ADVANCE(18); END_STATE(); case 28: if (lookahead == 'N' || lookahead == 'n') ADVANCE(7); END_STATE(); case 29: if (lookahead == 'O' || lookahead == 'o') ADVANCE(40); END_STATE(); case 30: if (lookahead == 'O' || lookahead == 'o') ADVANCE(23); END_STATE(); case 31: if (lookahead == 'O' || lookahead == 'o') ADVANCE(44); END_STATE(); case 32: if (lookahead == 'O' || lookahead == 'o') ADVANCE(28); END_STATE(); case 33: if (lookahead == 'P' || lookahead == 'p') ADVANCE(5); END_STATE(); case 34: if (lookahead == 'Q' || lookahead == 'q') ADVANCE(43); END_STATE(); case 35: if (lookahead == 'R' || lookahead == 'r') ADVANCE(12); END_STATE(); case 36: if (lookahead == 'R' || lookahead == 'r') ADVANCE(19); END_STATE(); case 37: if (lookahead == 'R' || lookahead == 'r') ADVANCE(42); END_STATE(); case 38: if (lookahead == 'R' || lookahead == 'r') ADVANCE(31); END_STATE(); case 39: if (lookahead == 'R' || lookahead == 'r') ADVANCE(15); END_STATE(); case 40: if (lookahead == 'T' || lookahead == 't') ADVANCE(13); END_STATE(); case 41: if (lookahead == 'T' || lookahead == 't') ADVANCE(22); END_STATE(); case 42: if (lookahead == 'T' || lookahead == 't') ADVANCE(21); END_STATE(); case 43: if (lookahead == 'U' || lookahead == 'u') ADVANCE(11); END_STATE(); case 44: if (lookahead == 'U' || lookahead == 'u') ADVANCE(33); END_STATE(); case 45: if (lookahead == 'U' || lookahead == 'u') ADVANCE(41); END_STATE(); case 46: if (lookahead == 'V' || lookahead == 'v') ADVANCE(30); END_STATE(); case 47: if (('0' <= lookahead && lookahead <= '9')) ADVANCE(67); END_STATE(); case 48: if (eof) ADVANCE(49); if (lookahead == '\n') ADVANCE(80); if (lookahead == '\r') ADVANCE(82); if (lookahead == '[') ADVANCE(51); if (lookahead == '\t' || lookahead == ' ') ADVANCE(61); if (lookahead != 0 && lookahead != '(' && lookahead != ')' && (lookahead < '+' || '-' < lookahead) && lookahead != ']') ADVANCE(62); END_STATE(); case 49: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 50: ACCEPT_TOKEN(anon_sym_LBRACK); END_STATE(); case 51: ACCEPT_TOKEN(anon_sym_LBRACK); ADVANCE_MAP( 'E', 46, 'e', 46, 'G', 38, 'g', 38, 'I', 26, 'i', 26, 'N', 29, 'n', 29, ); END_STATE(); case 52: ACCEPT_TOKEN(anon_sym_RBRACK); END_STATE(); case 53: ACCEPT_TOKEN(anon_sym_COMMA); END_STATE(); case 54: ACCEPT_TOKEN(anon_sym_LPAREN); END_STATE(); case 55: ACCEPT_TOKEN(anon_sym_RPAREN); END_STATE(); case 56: ACCEPT_TOKEN(anon_sym_DASH_DASH); END_STATE(); case 57: ACCEPT_TOKEN(anon_sym_DASH_GT); END_STATE(); case 58: ACCEPT_TOKEN(anon_sym_PLUS); END_STATE(); case 59: ACCEPT_TOKEN(anon_sym_DASH); END_STATE(); case 60: ACCEPT_TOKEN(anon_sym_DASH); if (lookahead == '-') ADVANCE(56); if (lookahead == '>') ADVANCE(57); END_STATE(); case 61: ACCEPT_TOKEN(sym_component_label); if (lookahead == '\t' || lookahead == ' ') ADVANCE(61); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && lookahead != '\r' && lookahead != '(' && lookahead != ')' && (lookahead < '+' || '-' < lookahead) && lookahead != '[' && lookahead != ']') ADVANCE(62); END_STATE(); case 62: ACCEPT_TOKEN(sym_component_label); if (lookahead != 0 && lookahead != '\n' && lookahead != '\r' && lookahead != '(' && lookahead != ')' && (lookahead < '+' || '-' < lookahead) && lookahead != '[' && lookahead != ']') ADVANCE(62); END_STATE(); case 63: ACCEPT_TOKEN(sym_text); if (lookahead == '\t' || lookahead == ' ') ADVANCE(63); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && lookahead != '\r') ADVANCE(64); END_STATE(); case 64: ACCEPT_TOKEN(sym_text); if (lookahead != 0 && lookahead != '\n' && lookahead != '\r') ADVANCE(64); END_STATE(); case 65: ACCEPT_TOKEN(aux_sym_real_number_token1); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(65); END_STATE(); case 66: ACCEPT_TOKEN(aux_sym_real_number_token2); if (lookahead == '.') ADVANCE(65); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(66); END_STATE(); case 67: ACCEPT_TOKEN(aux_sym_real_number_token3); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(67); END_STATE(); case 68: ACCEPT_TOKEN(aux_sym_stage_number_token1); END_STATE(); case 69: ACCEPT_TOKEN(aux_sym_stage_number_token2); END_STATE(); case 70: ACCEPT_TOKEN(aux_sym_stage_number_token3); if (lookahead == 'I' || lookahead == 'i') ADVANCE(69); END_STATE(); case 71: ACCEPT_TOKEN(aux_sym_stage_number_token4); if (lookahead == 'I' || lookahead == 'i') ADVANCE(70); if (lookahead == 'V' || lookahead == 'v') ADVANCE(68); END_STATE(); case 72: ACCEPT_TOKEN(aux_sym_shape_label_token1); END_STATE(); case 73: ACCEPT_TOKEN(aux_sym_shape_label_token2); END_STATE(); case 74: ACCEPT_TOKEN(aux_sym_shape_label_token3); END_STATE(); case 75: ACCEPT_TOKEN(aux_sym_shape_label_token4); END_STATE(); case 76: ACCEPT_TOKEN(sym__note_keyword); END_STATE(); case 77: ACCEPT_TOKEN(sym__group_keyword); END_STATE(); case 78: ACCEPT_TOKEN(sym__inertia_keyword); END_STATE(); case 79: ACCEPT_TOKEN(sym__evolution_keyword); END_STATE(); case 80: ACCEPT_TOKEN(anon_sym_LF); END_STATE(); case 81: ACCEPT_TOKEN(anon_sym_CR_LF); END_STATE(); case 82: ACCEPT_TOKEN(anon_sym_CR); if (lookahead == '\n') ADVANCE(81); END_STATE(); default: return false; } } static const TSLexerMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, [1] = {.lex_state = 48}, [2] = {.lex_state = 48}, [3] = {.lex_state = 48}, [4] = {.lex_state = 48}, [5] = {.lex_state = 0}, [6] = {.lex_state = 0}, [7] = {.lex_state = 1}, [8] = {.lex_state = 1}, [9] = {.lex_state = 0}, [10] = {.lex_state = 0}, [11] = {.lex_state = 0}, [12] = {.lex_state = 0}, [13] = {.lex_state = 0}, [14] = {.lex_state = 0}, [15] = {.lex_state = 0}, [16] = {.lex_state = 0}, [17] = {.lex_state = 0}, [18] = {.lex_state = 0}, [19] = {.lex_state = 0}, [20] = {.lex_state = 1}, [21] = {.lex_state = 0}, [22] = {.lex_state = 0}, [23] = {.lex_state = 0}, [24] = {.lex_state = 0}, [25] = {.lex_state = 0}, [26] = {.lex_state = 0}, [27] = {.lex_state = 0}, [28] = {.lex_state = 0}, [29] = {.lex_state = 2}, [30] = {.lex_state = 0}, [31] = {.lex_state = 0}, [32] = {.lex_state = 0}, [33] = {.lex_state = 0}, [34] = {.lex_state = 48}, [35] = {.lex_state = 48}, [36] = {.lex_state = 0}, [37] = {.lex_state = 48}, [38] = {.lex_state = 8}, [39] = {.lex_state = 48}, [40] = {.lex_state = 0}, [41] = {.lex_state = 48}, [42] = {.lex_state = 0}, [43] = {.lex_state = 0}, [44] = {.lex_state = 0}, [45] = {.lex_state = 8}, [46] = {.lex_state = 0}, [47] = {.lex_state = 48}, [48] = {.lex_state = 0}, [49] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [STATE(0)] = { [ts_builtin_sym_end] = ACTIONS(1), [anon_sym_LBRACK] = ACTIONS(1), [anon_sym_RBRACK] = ACTIONS(1), [anon_sym_COMMA] = ACTIONS(1), [anon_sym_LPAREN] = ACTIONS(1), [anon_sym_RPAREN] = ACTIONS(1), [anon_sym_DASH_DASH] = ACTIONS(1), [anon_sym_DASH_GT] = ACTIONS(1), [anon_sym_PLUS] = ACTIONS(1), [anon_sym_DASH] = ACTIONS(1), [aux_sym_real_number_token1] = ACTIONS(1), [aux_sym_real_number_token2] = ACTIONS(1), [aux_sym_real_number_token3] = ACTIONS(1), [aux_sym_stage_number_token1] = ACTIONS(1), [aux_sym_stage_number_token2] = ACTIONS(1), [aux_sym_stage_number_token3] = ACTIONS(1), [aux_sym_stage_number_token4] = ACTIONS(1), [aux_sym_shape_label_token1] = ACTIONS(1), [aux_sym_shape_label_token2] = ACTIONS(1), [aux_sym_shape_label_token3] = ACTIONS(1), [aux_sym_shape_label_token4] = ACTIONS(1), [sym__note_keyword] = ACTIONS(1), [sym__group_keyword] = ACTIONS(1), [sym__inertia_keyword] = ACTIONS(1), [sym__evolution_keyword] = ACTIONS(1), [anon_sym_LF] = ACTIONS(1), [anon_sym_CR_LF] = ACTIONS(1), [anon_sym_CR] = ACTIONS(1), }, [STATE(1)] = { [sym_source_file] = STATE(49), [sym_entity] = STATE(15), [sym_component] = STATE(25), [sym_dependency] = STATE(25), [sym_note] = STATE(25), [sym_stage] = STATE(25), [sym_group] = STATE(25), [sym_inertia] = STATE(25), [sym_evolution] = STATE(25), [sym__line_ending] = STATE(2), [aux_sym_source_file_repeat1] = STATE(2), [ts_builtin_sym_end] = ACTIONS(3), [anon_sym_LBRACK] = ACTIONS(5), [sym_component_label] = ACTIONS(7), [sym__note_keyword] = ACTIONS(9), [sym__group_keyword] = ACTIONS(11), [sym__inertia_keyword] = ACTIONS(13), [sym__evolution_keyword] = ACTIONS(15), [anon_sym_LF] = ACTIONS(17), [anon_sym_CR_LF] = ACTIONS(17), [anon_sym_CR] = ACTIONS(17), }, }; static const uint16_t ts_small_parse_table[] = { [0] = 11, ACTIONS(5), 1, anon_sym_LBRACK, ACTIONS(7), 1, sym_component_label, ACTIONS(9), 1, sym__note_keyword, ACTIONS(11), 1, sym__group_keyword, ACTIONS(13), 1, sym__inertia_keyword, ACTIONS(15), 1, sym__evolution_keyword, ACTIONS(19), 1, ts_builtin_sym_end, STATE(15), 1, sym_entity, STATE(3), 2, sym__line_ending, aux_sym_source_file_repeat1, ACTIONS(21), 3, anon_sym_LF, anon_sym_CR_LF, anon_sym_CR, STATE(25), 7, sym_component, sym_dependency, sym_note, sym_stage, sym_group, sym_inertia, sym_evolution, [43] = 11, ACTIONS(23), 1, ts_builtin_sym_end, ACTIONS(25), 1, anon_sym_LBRACK, ACTIONS(28), 1, sym_component_label, ACTIONS(31), 1, sym__note_keyword, ACTIONS(34), 1, sym__group_keyword, ACTIONS(37), 1, sym__inertia_keyword, ACTIONS(40), 1, sym__evolution_keyword, STATE(15), 1, sym_entity, STATE(3), 2, sym__line_ending, aux_sym_source_file_repeat1, ACTIONS(43), 3, anon_sym_LF, anon_sym_CR_LF, anon_sym_CR, STATE(25), 7, sym_component, sym_dependency, sym_note, sym_stage, sym_group, sym_inertia, sym_evolution, [86] = 2, ACTIONS(23), 2, ts_builtin_sym_end, sym_component_label, ACTIONS(46), 8, anon_sym_LBRACK, sym__note_keyword, sym__group_keyword, sym__inertia_keyword, sym__evolution_keyword, anon_sym_LF, anon_sym_CR_LF, anon_sym_CR, [101] = 4, ACTIONS(48), 1, anon_sym_COMMA, ACTIONS(52), 1, anon_sym_CR, STATE(11), 1, aux_sym_group_repeat1, ACTIONS(50), 2, anon_sym_LF, anon_sym_CR_LF, [115] = 3, STATE(43), 1, sym_stage_number, ACTIONS(54), 2, aux_sym_stage_number_token1, aux_sym_stage_number_token2, ACTIONS(56), 2, aux_sym_stage_number_token3, aux_sym_stage_number_token4, [127] = 4, ACTIONS(58), 1, anon_sym_LBRACK, ACTIONS(62), 1, anon_sym_CR, STATE(27), 1, sym_shape, ACTIONS(60), 2, anon_sym_LF, anon_sym_CR_LF, [141] = 4, ACTIONS(64), 1, anon_sym_LPAREN, STATE(7), 1, sym_position, STATE(34), 1, sym_dependency_type, ACTIONS(66), 2, anon_sym_DASH_DASH, anon_sym_DASH_GT, [155] = 2, ACTIONS(70), 1, anon_sym_CR, ACTIONS(68), 4, anon_sym_COMMA, anon_sym_RPAREN, anon_sym_LF, anon_sym_CR_LF, [165] = 2, STATE(40), 1, sym_shape_label, ACTIONS(72), 4, aux_sym_shape_label_token1, aux_sym_shape_label_token2, aux_sym_shape_label_token3, aux_sym_shape_label_token4, [175] = 4, ACTIONS(48), 1, anon_sym_COMMA, ACTIONS(76), 1, anon_sym_CR, STATE(12), 1, aux_sym_group_repeat1, ACTIONS(74), 2, anon_sym_LF, anon_sym_CR_LF, [189] = 4, ACTIONS(78), 1, anon_sym_COMMA, ACTIONS(83), 1, anon_sym_CR, STATE(12), 1, aux_sym_group_repeat1, ACTIONS(81), 2, anon_sym_LF, anon_sym_CR_LF, [203] = 3, ACTIONS(87), 1, aux_sym_real_number_token2, STATE(23), 1, sym_real_number, ACTIONS(85), 2, aux_sym_real_number_token1, aux_sym_real_number_token3, [214] = 3, ACTIONS(87), 1, aux_sym_real_number_token2, STATE(48), 1, sym_real_number, ACTIONS(85), 2, aux_sym_real_number_token1, aux_sym_real_number_token3, [225] = 3, ACTIONS(91), 1, anon_sym_CR, STATE(4), 1, sym__line_ending, ACTIONS(89), 2, anon_sym_LF, anon_sym_CR_LF, [236] = 3, ACTIONS(87), 1, aux_sym_real_number_token2, STATE(33), 1, sym_real_number, ACTIONS(85), 2, aux_sym_real_number_token1, aux_sym_real_number_token3, [247] = 3, ACTIONS(87), 1, aux_sym_real_number_token2, STATE(28), 1, sym_real_number, ACTIONS(85), 2, aux_sym_real_number_token1, aux_sym_real_number_token3, [258] = 3, ACTIONS(87), 1, aux_sym_real_number_token2, STATE(44), 1, sym_real_number, ACTIONS(85), 2, aux_sym_real_number_token1, aux_sym_real_number_token3, [269] = 2, ACTIONS(95), 1, anon_sym_CR, ACTIONS(93), 3, anon_sym_COMMA, anon_sym_LF, anon_sym_CR_LF, [278] = 2, ACTIONS(99), 1, anon_sym_CR, ACTIONS(97), 3, anon_sym_LBRACK, anon_sym_LF, anon_sym_CR_LF, [287] = 3, ACTIONS(87), 1, aux_sym_real_number_token2, STATE(46), 1, sym_real_number, ACTIONS(85), 2, aux_sym_real_number_token1, aux_sym_real_number_token3, [298] = 2, ACTIONS(103), 1, anon_sym_CR, ACTIONS(101), 2, anon_sym_LF, anon_sym_CR_LF, [306] = 2, ACTIONS(107), 1, anon_sym_CR, ACTIONS(105), 2, anon_sym_LF, anon_sym_CR_LF, [314] = 2, ACTIONS(111), 1, aux_sym_real_number_token2, ACTIONS(109), 2, aux_sym_real_number_token1, aux_sym_real_number_token3, [322] = 2, ACTIONS(115), 1, anon_sym_CR, ACTIONS(113), 2, anon_sym_LF, anon_sym_CR_LF, [330] = 2, ACTIONS(119), 1, anon_sym_CR, ACTIONS(117), 2, anon_sym_LF, anon_sym_CR_LF, [338] = 2, ACTIONS(123), 1, anon_sym_CR, ACTIONS(121), 2, anon_sym_LF, anon_sym_CR_LF, [346] = 2, ACTIONS(127), 1, anon_sym_CR, ACTIONS(125), 2, anon_sym_LF, anon_sym_CR_LF, [354] = 2, STATE(17), 1, sym_sign, ACTIONS(129), 2, anon_sym_PLUS, anon_sym_DASH, [362] = 2, ACTIONS(133), 1, anon_sym_CR, ACTIONS(131), 2, anon_sym_LF, anon_sym_CR_LF, [370] = 2, ACTIONS(137), 1, anon_sym_CR, ACTIONS(135), 2, anon_sym_LF, anon_sym_CR_LF, [378] = 2, ACTIONS(139), 1, anon_sym_LPAREN, STATE(38), 1, sym_position, [385] = 1, ACTIONS(141), 1, anon_sym_COMMA, [389] = 1, ACTIONS(143), 1, sym_component_label, [393] = 1, ACTIONS(145), 1, sym_component_label, [397] = 1, ACTIONS(147), 1, anon_sym_RBRACK, [401] = 1, ACTIONS(149), 1, sym_component_label, [405] = 1, ACTIONS(151), 1, sym_text, [409] = 1, ACTIONS(153), 1, sym_component_label, [413] = 1, ACTIONS(155), 1, anon_sym_RBRACK, [417] = 1, ACTIONS(157), 1, sym_component_label, [421] = 1, ACTIONS(159), 1, anon_sym_RBRACK, [425] = 1, ACTIONS(161), 1, anon_sym_RBRACK, [429] = 1, ACTIONS(163), 1, anon_sym_RPAREN, [433] = 1, ACTIONS(97), 1, sym_text, [437] = 1, ACTIONS(165), 1, anon_sym_RPAREN, [441] = 1, ACTIONS(167), 1, sym_component_label, [445] = 1, ACTIONS(169), 1, anon_sym_COMMA, [449] = 1, ACTIONS(171), 1, ts_builtin_sym_end, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(2)] = 0, [SMALL_STATE(3)] = 43, [SMALL_STATE(4)] = 86, [SMALL_STATE(5)] = 101, [SMALL_STATE(6)] = 115, [SMALL_STATE(7)] = 127, [SMALL_STATE(8)] = 141, [SMALL_STATE(9)] = 155, [SMALL_STATE(10)] = 165, [SMALL_STATE(11)] = 175, [SMALL_STATE(12)] = 189, [SMALL_STATE(13)] = 203, [SMALL_STATE(14)] = 214, [SMALL_STATE(15)] = 225, [SMALL_STATE(16)] = 236, [SMALL_STATE(17)] = 247, [SMALL_STATE(18)] = 258, [SMALL_STATE(19)] = 269, [SMALL_STATE(20)] = 278, [SMALL_STATE(21)] = 287, [SMALL_STATE(22)] = 298, [SMALL_STATE(23)] = 306, [SMALL_STATE(24)] = 314, [SMALL_STATE(25)] = 322, [SMALL_STATE(26)] = 330, [SMALL_STATE(27)] = 338, [SMALL_STATE(28)] = 346, [SMALL_STATE(29)] = 354, [SMALL_STATE(30)] = 362, [SMALL_STATE(31)] = 370, [SMALL_STATE(32)] = 378, [SMALL_STATE(33)] = 385, [SMALL_STATE(34)] = 389, [SMALL_STATE(35)] = 393, [SMALL_STATE(36)] = 397, [SMALL_STATE(37)] = 401, [SMALL_STATE(38)] = 405, [SMALL_STATE(39)] = 409, [SMALL_STATE(40)] = 413, [SMALL_STATE(41)] = 417, [SMALL_STATE(42)] = 421, [SMALL_STATE(43)] = 425, [SMALL_STATE(44)] = 429, [SMALL_STATE(45)] = 433, [SMALL_STATE(46)] = 437, [SMALL_STATE(47)] = 441, [SMALL_STATE(48)] = 445, [SMALL_STATE(49)] = 449, }; static const TSParseActionEntry ts_parse_actions[] = { [0] = {.entry = {.count = 0, .reusable = false}}, [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0), [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(37), [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(41), [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2), [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(3), [23] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), [25] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(6), [28] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(8), [31] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(32), [34] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(37), [37] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(41), [40] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(47), [43] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(3), [46] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), [48] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), [50] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group, 2, 0, 2), [52] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_group, 2, 0, 2), [54] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), [56] = {.entry = {.count = 1, .reusable = false}}, SHIFT(36), [58] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_component, 2, 0, 1), [62] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_component, 2, 0, 1), [64] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), [66] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), [68] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_real_number, 1, 0, 0), [70] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_real_number, 1, 0, 0), [72] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), [74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group, 3, 0, 6), [76] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_group, 3, 0, 6), [78] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 8), SHIFT_REPEAT(35), [81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 8), [83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_group_repeat1, 2, 0, 8), [85] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), [87] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), [89] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), [91] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4), [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 2), [95] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_group_repeat1, 2, 0, 2), [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_position, 5, 0, 10), [99] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_position, 5, 0, 10), [101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_note, 3, 0, 5), [103] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_note, 3, 0, 5), [105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_stage, 4, 0, 7), [107] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_stage, 4, 0, 7), [109] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sign, 1, 0, 0), [111] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sign, 1, 0, 0), [113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_entity, 1, 0, 0), [115] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_entity, 1, 0, 0), [117] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dependency, 3, 0, 4), [119] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_dependency, 3, 0, 4), [121] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_component, 3, 0, 3), [123] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_component, 3, 0, 3), [125] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_evolution, 4, 0, 9), [127] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_evolution, 4, 0, 9), [129] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), [131] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_inertia, 2, 0, 2), [133] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_inertia, 2, 0, 2), [135] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_shape, 3, 0, 0), [137] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape, 3, 0, 0), [139] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), [141] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), [143] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), [145] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), [147] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_stage_number, 1, 0, 0), [149] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), [151] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), [153] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dependency_type, 1, 0, 0), [155] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), [157] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), [159] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_shape_label, 1, 0, 0), [161] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), [163] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), [165] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), [167] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), [169] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), [171] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), }; #ifdef __cplusplus extern "C" { #endif #ifdef TREE_SITTER_HIDE_SYMBOLS #define TS_PUBLIC #elif defined(_WIN32) #define TS_PUBLIC __declspec(dllexport) #else #define TS_PUBLIC __attribute__((visibility("default"))) #endif TS_PUBLIC const TSLanguage *tree_sitter_wmap(void) { static const TSLanguage language = { .abi_version = LANGUAGE_VERSION, .symbol_count = SYMBOL_COUNT, .alias_count = ALIAS_COUNT, .token_count = TOKEN_COUNT, .external_token_count = EXTERNAL_TOKEN_COUNT, .state_count = STATE_COUNT, .large_state_count = LARGE_STATE_COUNT, .production_id_count = PRODUCTION_ID_COUNT, .supertype_count = SUPERTYPE_COUNT, .field_count = FIELD_COUNT, .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, .parse_table = &ts_parse_table[0][0], .small_parse_table = ts_small_parse_table, .small_parse_table_map = ts_small_parse_table_map, .parse_actions = ts_parse_actions, .symbol_names = ts_symbol_names, .field_names = ts_field_names, .field_map_slices = ts_field_map_slices, .field_map_entries = ts_field_map_entries, .symbol_metadata = ts_symbol_metadata, .public_symbol_map = ts_symbol_map, .alias_map = ts_non_terminal_alias_map, .alias_sequences = &ts_alias_sequences[0][0], .lex_modes = (const void*)ts_lex_modes, .lex_fn = ts_lex, .primary_state_ids = ts_primary_state_ids, .name = "wmap", .max_reserved_word_set_size = 0, .metadata = { .major_version = 1, .minor_version = 0, .patch_version = 0, }, }; return &language; } #ifdef __cplusplus } #endif