#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 66
#define LARGE_STATE_COUNT 2
#define SYMBOL_COUNT 53
#define ALIAS_COUNT 0
#define TOKEN_COUNT 31
#define EXTERNAL_TOKEN_COUNT 0
#define FIELD_COUNT 4
#define MAX_ALIAS_SEQUENCE_LENGTH 4
#define MAX_RESERVED_WORD_SET_SIZE 0
#define PRODUCTION_ID_COUNT 6
#define SUPERTYPE_COUNT 0
enum ts_symbol_identifiers {
anon_sym_LBRACK = 1,
anon_sym_request_definition = 2,
anon_sym_RBRACK = 3,
anon_sym_EQ = 4,
anon_sym_policy_definition = 5,
anon_sym_role_definition = 6,
anon_sym_policy_effect = 7,
anon_sym_matchers = 8,
sym_request_ptype = 9,
sym_policy_ptype = 10,
sym_role_ptype = 11,
sym_policy_effect_ptype = 12,
sym_matchers_ptype = 13,
anon_sym_COMMA = 14,
anon_sym_PIPE_PIPE = 15,
anon_sym_AMP_AMP = 16,
anon_sym_EQ_EQ = 17,
anon_sym_BANG_EQ = 18,
anon_sym_GT_EQ = 19,
anon_sym_LT_EQ = 20,
anon_sym_GT = 21,
anon_sym_LT = 22,
anon_sym_in = 23,
anon_sym_LPAREN = 24,
anon_sym_RPAREN = 25,
anon_sym_DOT = 26,
aux_sym_string_token1 = 27,
aux_sym_string_token2 = 28,
sym_number = 29,
sym_identifier = 30,
sym_source_file = 31,
sym_section = 32,
sym_request_section = 33,
sym_policy_section = 34,
sym_role_section = 35,
sym_policy_effect_section = 36,
sym_matchers_section = 37,
sym_expression_list = 38,
sym_expression = 39,
sym_binary_expression = 40,
sym_function_call = 41,
sym_member_expression = 42,
sym_parenthesized_expression = 43,
sym_string = 44,
sym_variable = 45,
aux_sym_source_file_repeat1 = 46,
aux_sym_request_section_repeat1 = 47,
aux_sym_policy_section_repeat1 = 48,
aux_sym_role_section_repeat1 = 49,
aux_sym_policy_effect_section_repeat1 = 50,
aux_sym_matchers_section_repeat1 = 51,
aux_sym_expression_list_repeat1 = 52,
};
static const char * const ts_symbol_names[] = {
[ts_builtin_sym_end] = "end",
[anon_sym_LBRACK] = "[",
[anon_sym_request_definition] = "request_definition",
[anon_sym_RBRACK] = "]",
[anon_sym_EQ] = "=",
[anon_sym_policy_definition] = "policy_definition",
[anon_sym_role_definition] = "role_definition",
[anon_sym_policy_effect] = "policy_effect",
[anon_sym_matchers] = "matchers",
[sym_request_ptype] = "request_ptype",
[sym_policy_ptype] = "policy_ptype",
[sym_role_ptype] = "role_ptype",
[sym_policy_effect_ptype] = "policy_effect_ptype",
[sym_matchers_ptype] = "matchers_ptype",
[anon_sym_COMMA] = ",",
[anon_sym_PIPE_PIPE] = "||",
[anon_sym_AMP_AMP] = "&&",
[anon_sym_EQ_EQ] = "==",
[anon_sym_BANG_EQ] = "!=",
[anon_sym_GT_EQ] = ">=",
[anon_sym_LT_EQ] = "<=",
[anon_sym_GT] = ">",
[anon_sym_LT] = "<",
[anon_sym_in] = "in",
[anon_sym_LPAREN] = "(",
[anon_sym_RPAREN] = ")",
[anon_sym_DOT] = ".",
[aux_sym_string_token1] = "string_token1",
[aux_sym_string_token2] = "string_token2",
[sym_number] = "number",
[sym_identifier] = "identifier",
[sym_source_file] = "source_file",
[sym_section] = "section",
[sym_request_section] = "request_section",
[sym_policy_section] = "policy_section",
[sym_role_section] = "role_section",
[sym_policy_effect_section] = "policy_effect_section",
[sym_matchers_section] = "matchers_section",
[sym_expression_list] = "expression_list",
[sym_expression] = "expression",
[sym_binary_expression] = "binary_expression",
[sym_function_call] = "function_call",
[sym_member_expression] = "member_expression",
[sym_parenthesized_expression] = "parenthesized_expression",
[sym_string] = "string",
[sym_variable] = "variable",
[aux_sym_source_file_repeat1] = "source_file_repeat1",
[aux_sym_request_section_repeat1] = "request_section_repeat1",
[aux_sym_policy_section_repeat1] = "policy_section_repeat1",
[aux_sym_role_section_repeat1] = "role_section_repeat1",
[aux_sym_policy_effect_section_repeat1] = "policy_effect_section_repeat1",
[aux_sym_matchers_section_repeat1] = "matchers_section_repeat1",
[aux_sym_expression_list_repeat1] = "expression_list_repeat1",
};
static const TSSymbol ts_symbol_map[] = {
[ts_builtin_sym_end] = ts_builtin_sym_end,
[anon_sym_LBRACK] = anon_sym_LBRACK,
[anon_sym_request_definition] = anon_sym_request_definition,
[anon_sym_RBRACK] = anon_sym_RBRACK,
[anon_sym_EQ] = anon_sym_EQ,
[anon_sym_policy_definition] = anon_sym_policy_definition,
[anon_sym_role_definition] = anon_sym_role_definition,
[anon_sym_policy_effect] = anon_sym_policy_effect,
[anon_sym_matchers] = anon_sym_matchers,
[sym_request_ptype] = sym_request_ptype,
[sym_policy_ptype] = sym_policy_ptype,
[sym_role_ptype] = sym_role_ptype,
[sym_policy_effect_ptype] = sym_policy_effect_ptype,
[sym_matchers_ptype] = sym_matchers_ptype,
[anon_sym_COMMA] = anon_sym_COMMA,
[anon_sym_PIPE_PIPE] = anon_sym_PIPE_PIPE,
[anon_sym_AMP_AMP] = anon_sym_AMP_AMP,
[anon_sym_EQ_EQ] = anon_sym_EQ_EQ,
[anon_sym_BANG_EQ] = anon_sym_BANG_EQ,
[anon_sym_GT_EQ] = anon_sym_GT_EQ,
[anon_sym_LT_EQ] = anon_sym_LT_EQ,
[anon_sym_GT] = anon_sym_GT,
[anon_sym_LT] = anon_sym_LT,
[anon_sym_in] = anon_sym_in,
[anon_sym_LPAREN] = anon_sym_LPAREN,
[anon_sym_RPAREN] = anon_sym_RPAREN,
[anon_sym_DOT] = anon_sym_DOT,
[aux_sym_string_token1] = aux_sym_string_token1,
[aux_sym_string_token2] = aux_sym_string_token2,
[sym_number] = sym_number,
[sym_identifier] = sym_identifier,
[sym_source_file] = sym_source_file,
[sym_section] = sym_section,
[sym_request_section] = sym_request_section,
[sym_policy_section] = sym_policy_section,
[sym_role_section] = sym_role_section,
[sym_policy_effect_section] = sym_policy_effect_section,
[sym_matchers_section] = sym_matchers_section,
[sym_expression_list] = sym_expression_list,
[sym_expression] = sym_expression,
[sym_binary_expression] = sym_binary_expression,
[sym_function_call] = sym_function_call,
[sym_member_expression] = sym_member_expression,
[sym_parenthesized_expression] = sym_parenthesized_expression,
[sym_string] = sym_string,
[sym_variable] = sym_variable,
[aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1,
[aux_sym_request_section_repeat1] = aux_sym_request_section_repeat1,
[aux_sym_policy_section_repeat1] = aux_sym_policy_section_repeat1,
[aux_sym_role_section_repeat1] = aux_sym_role_section_repeat1,
[aux_sym_policy_effect_section_repeat1] = aux_sym_policy_effect_section_repeat1,
[aux_sym_matchers_section_repeat1] = aux_sym_matchers_section_repeat1,
[aux_sym_expression_list_repeat1] = aux_sym_expression_list_repeat1,
};
static const TSSymbolMetadata ts_symbol_metadata[] = {
[ts_builtin_sym_end] = {
.visible = false,
.named = true,
},
[anon_sym_LBRACK] = {
.visible = true,
.named = false,
},
[anon_sym_request_definition] = {
.visible = true,
.named = false,
},
[anon_sym_RBRACK] = {
.visible = true,
.named = false,
},
[anon_sym_EQ] = {
.visible = true,
.named = false,
},
[anon_sym_policy_definition] = {
.visible = true,
.named = false,
},
[anon_sym_role_definition] = {
.visible = true,
.named = false,
},
[anon_sym_policy_effect] = {
.visible = true,
.named = false,
},
[anon_sym_matchers] = {
.visible = true,
.named = false,
},
[sym_request_ptype] = {
.visible = true,
.named = true,
},
[sym_policy_ptype] = {
.visible = true,
.named = true,
},
[sym_role_ptype] = {
.visible = true,
.named = true,
},
[sym_policy_effect_ptype] = {
.visible = true,
.named = true,
},
[sym_matchers_ptype] = {
.visible = true,
.named = true,
},
[anon_sym_COMMA] = {
.visible = true,
.named = false,
},
[anon_sym_PIPE_PIPE] = {
.visible = true,
.named = false,
},
[anon_sym_AMP_AMP] = {
.visible = true,
.named = false,
},
[anon_sym_EQ_EQ] = {
.visible = true,
.named = false,
},
[anon_sym_BANG_EQ] = {
.visible = true,
.named = false,
},
[anon_sym_GT_EQ] = {
.visible = true,
.named = false,
},
[anon_sym_LT_EQ] = {
.visible = true,
.named = false,
},
[anon_sym_GT] = {
.visible = true,
.named = false,
},
[anon_sym_LT] = {
.visible = true,
.named = false,
},
[anon_sym_in] = {
.visible = true,
.named = false,
},
[anon_sym_LPAREN] = {
.visible = true,
.named = false,
},
[anon_sym_RPAREN] = {
.visible = true,
.named = false,
},
[anon_sym_DOT] = {
.visible = true,
.named = false,
},
[aux_sym_string_token1] = {
.visible = false,
.named = false,
},
[aux_sym_string_token2] = {
.visible = false,
.named = false,
},
[sym_number] = {
.visible = true,
.named = true,
},
[sym_identifier] = {
.visible = true,
.named = true,
},
[sym_source_file] = {
.visible = true,
.named = true,
},
[sym_section] = {
.visible = true,
.named = true,
},
[sym_request_section] = {
.visible = true,
.named = true,
},
[sym_policy_section] = {
.visible = true,
.named = true,
},
[sym_role_section] = {
.visible = true,
.named = true,
},
[sym_policy_effect_section] = {
.visible = true,
.named = true,
},
[sym_matchers_section] = {
.visible = true,
.named = true,
},
[sym_expression_list] = {
.visible = true,
.named = true,
},
[sym_expression] = {
.visible = true,
.named = true,
},
[sym_binary_expression] = {
.visible = true,
.named = true,
},
[sym_function_call] = {
.visible = true,
.named = true,
},
[sym_member_expression] = {
.visible = true,
.named = true,
},
[sym_parenthesized_expression] = {
.visible = true,
.named = true,
},
[sym_string] = {
.visible = true,
.named = true,
},
[sym_variable] = {
.visible = true,
.named = true,
},
[aux_sym_source_file_repeat1] = {
.visible = false,
.named = false,
},
[aux_sym_request_section_repeat1] = {
.visible = false,
.named = false,
},
[aux_sym_policy_section_repeat1] = {
.visible = false,
.named = false,
},
[aux_sym_role_section_repeat1] = {
.visible = false,
.named = false,
},
[aux_sym_policy_effect_section_repeat1] = {
.visible = false,
.named = false,
},
[aux_sym_matchers_section_repeat1] = {
.visible = false,
.named = false,
},
[aux_sym_expression_list_repeat1] = {
.visible = false,
.named = false,
},
};
enum ts_field_identifiers {
field_function = 1,
field_property = 2,
field_ptype = 3,
field_value = 4,
};
static const char * const ts_field_names[] = {
[0] = NULL,
[field_function] = "function",
[field_property] = "property",
[field_ptype] = "ptype",
[field_value] = "value",
};
static const TSMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = {
[1] = {.index = 0, .length = 2},
[2] = {.index = 2, .length = 4},
[3] = {.index = 6, .length = 2},
[4] = {.index = 8, .length = 1},
[5] = {.index = 9, .length = 1},
};
static const TSFieldMapEntry ts_field_map_entries[] = {
[0] =
{field_ptype, 3, .inherited = true},
{field_value, 3, .inherited = true},
[2] =
{field_ptype, 0, .inherited = true},
{field_ptype, 1, .inherited = true},
{field_value, 0, .inherited = true},
{field_value, 1, .inherited = true},
[6] =
{field_ptype, 0},
{field_value, 2},
[8] =
{field_property, 2},
[9] =
{field_function, 0},
};
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] = 16,
[17] = 17,
[18] = 18,
[19] = 19,
[20] = 20,
[21] = 21,
[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] = 45,
[46] = 46,
[47] = 47,
[48] = 48,
[49] = 49,
[50] = 50,
[51] = 51,
[52] = 52,
[53] = 53,
[54] = 54,
[55] = 55,
[56] = 56,
[57] = 57,
[58] = 58,
[59] = 59,
[60] = 60,
[61] = 61,
[62] = 62,
[63] = 63,
[64] = 64,
[65] = 65,
};
static bool ts_lex(TSLexer *lexer, TSStateId state) {
START_LEXER();
eof = lexer->eof(lexer);
switch (state) {
case 0:
if (eof) ADVANCE(69);
ADVANCE_MAP(
'!', 5,
'"', 2,
'&', 3,
'\'', 4,
'(', 102,
')', 103,
',', 92,
'.', 104,
'<', 100,
'=', 74,
'>', 99,
'[', 70,
']', 72,
'e', 87,
'g', 85,
'i', 44,
'm', 89,
'p', 82,
'r', 79,
'|', 67,
);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
lookahead == ' ') SKIP(0);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(107);
END_STATE();
case 1:
ADVANCE_MAP(
'"', 2,
'\'', 4,
'(', 102,
')', 103,
'=', 73,
'e', 88,
'g', 86,
'm', 91,
'p', 84,
'r', 81,
);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
lookahead == ' ') SKIP(1);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(107);
if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(108);
END_STATE();
case 2:
if (lookahead == '"') ADVANCE(105);
if (lookahead != 0 &&
lookahead != '\n' &&
lookahead != '\r') ADVANCE(2);
END_STATE();
case 3:
if (lookahead == '&') ADVANCE(94);
END_STATE();
case 4:
if (lookahead == '\'') ADVANCE(106);
if (lookahead != 0 &&
lookahead != '\n' &&
lookahead != '\r') ADVANCE(4);
END_STATE();
case 5:
if (lookahead == '=') ADVANCE(96);
END_STATE();
case 6:
if (lookahead == '=') ADVANCE(95);
END_STATE();
case 7:
if (lookahead == '_') ADVANCE(14);
END_STATE();
case 8:
if (lookahead == '_') ADVANCE(15);
END_STATE();
case 9:
if (lookahead == '_') ADVANCE(16);
END_STATE();
case 10:
if (lookahead == 'a') ADVANCE(59);
END_STATE();
case 11:
if (lookahead == 'c') ADVANCE(30);
END_STATE();
case 12:
if (lookahead == 'c') ADVANCE(66);
END_STATE();
case 13:
if (lookahead == 'c') ADVANCE(60);
END_STATE();
case 14:
if (lookahead == 'd') ADVANCE(19);
END_STATE();
case 15:
if (lookahead == 'd') ADVANCE(23);
if (lookahead == 'e') ADVANCE(26);
END_STATE();
case 16:
if (lookahead == 'd') ADVANCE(24);
END_STATE();
case 17:
if (lookahead == 'e') ADVANCE(7);
END_STATE();
case 18:
if (lookahead == 'e') ADVANCE(56);
END_STATE();
case 19:
if (lookahead == 'e') ADVANCE(25);
END_STATE();
case 20:
if (lookahead == 'e') ADVANCE(55);
if (lookahead == 'o') ADVANCE(42);
END_STATE();
case 21:
if (lookahead == 'e') ADVANCE(58);
END_STATE();
case 22:
if (lookahead == 'e') ADVANCE(13);
END_STATE();
case 23:
if (lookahead == 'e') ADVANCE(28);
END_STATE();
case 24:
if (lookahead == 'e') ADVANCE(29);
END_STATE();
case 25:
if (lookahead == 'f') ADVANCE(32);
END_STATE();
case 26:
if (lookahead == 'f') ADVANCE(27);
END_STATE();
case 27:
if (lookahead == 'f') ADVANCE(22);
END_STATE();
case 28:
if (lookahead == 'f') ADVANCE(39);
END_STATE();
case 29:
if (lookahead == 'f') ADVANCE(40);
END_STATE();
case 30:
if (lookahead == 'h') ADVANCE(18);
END_STATE();
case 31:
if (lookahead == 'i') ADVANCE(52);
END_STATE();
case 32:
if (lookahead == 'i') ADVANCE(48);
END_STATE();
case 33:
if (lookahead == 'i') ADVANCE(61);
END_STATE();
case 34:
if (lookahead == 'i') ADVANCE(12);
END_STATE();
case 35:
if (lookahead == 'i') ADVANCE(53);
END_STATE();
case 36:
if (lookahead == 'i') ADVANCE(54);
END_STATE();
case 37:
if (lookahead == 'i') ADVANCE(62);
END_STATE();
case 38:
if (lookahead == 'i') ADVANCE(63);
END_STATE();
case 39:
if (lookahead == 'i') ADVANCE(49);
END_STATE();
case 40:
if (lookahead == 'i') ADVANCE(50);
END_STATE();
case 41:
if (lookahead == 'l') ADVANCE(34);
END_STATE();
case 42:
if (lookahead == 'l') ADVANCE(17);
END_STATE();
case 43:
if (lookahead == 'm') ADVANCE(10);
if (lookahead == 'p') ADVANCE(51);
if (lookahead == 'r') ADVANCE(20);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
lookahead == ' ') SKIP(43);
END_STATE();
case 44:
if (lookahead == 'n') ADVANCE(101);
END_STATE();
case 45:
if (lookahead == 'n') ADVANCE(76);
END_STATE();
case 46:
if (lookahead == 'n') ADVANCE(75);
END_STATE();
case 47:
if (lookahead == 'n') ADVANCE(71);
END_STATE();
case 48:
if (lookahead == 'n') ADVANCE(33);
END_STATE();
case 49:
if (lookahead == 'n') ADVANCE(37);
END_STATE();
case 50:
if (lookahead == 'n') ADVANCE(38);
END_STATE();
case 51:
if (lookahead == 'o') ADVANCE(41);
END_STATE();
case 52:
if (lookahead == 'o') ADVANCE(45);
END_STATE();
case 53:
if (lookahead == 'o') ADVANCE(46);
END_STATE();
case 54:
if (lookahead == 'o') ADVANCE(47);
END_STATE();
case 55:
if (lookahead == 'q') ADVANCE(65);
END_STATE();
case 56:
if (lookahead == 'r') ADVANCE(57);
END_STATE();
case 57:
if (lookahead == 's') ADVANCE(78);
END_STATE();
case 58:
if (lookahead == 's') ADVANCE(64);
END_STATE();
case 59:
if (lookahead == 't') ADVANCE(11);
END_STATE();
case 60:
if (lookahead == 't') ADVANCE(77);
END_STATE();
case 61:
if (lookahead == 't') ADVANCE(31);
END_STATE();
case 62:
if (lookahead == 't') ADVANCE(35);
END_STATE();
case 63:
if (lookahead == 't') ADVANCE(36);
END_STATE();
case 64:
if (lookahead == 't') ADVANCE(9);
END_STATE();
case 65:
if (lookahead == 'u') ADVANCE(21);
END_STATE();
case 66:
if (lookahead == 'y') ADVANCE(8);
END_STATE();
case 67:
if (lookahead == '|') ADVANCE(93);
END_STATE();
case 68:
if (eof) ADVANCE(69);
ADVANCE_MAP(
'!', 5,
'&', 3,
'(', 102,
')', 103,
',', 92,
'.', 104,
'<', 100,
'=', 6,
'>', 99,
'[', 70,
'e', 87,
'g', 85,
'i', 44,
'm', 90,
'p', 83,
'r', 80,
'|', 67,
);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
lookahead == ' ') SKIP(68);
END_STATE();
case 69:
ACCEPT_TOKEN(ts_builtin_sym_end);
END_STATE();
case 70:
ACCEPT_TOKEN(anon_sym_LBRACK);
END_STATE();
case 71:
ACCEPT_TOKEN(anon_sym_request_definition);
END_STATE();
case 72:
ACCEPT_TOKEN(anon_sym_RBRACK);
END_STATE();
case 73:
ACCEPT_TOKEN(anon_sym_EQ);
END_STATE();
case 74:
ACCEPT_TOKEN(anon_sym_EQ);
if (lookahead == '=') ADVANCE(95);
END_STATE();
case 75:
ACCEPT_TOKEN(anon_sym_policy_definition);
END_STATE();
case 76:
ACCEPT_TOKEN(anon_sym_role_definition);
END_STATE();
case 77:
ACCEPT_TOKEN(anon_sym_policy_effect);
END_STATE();
case 78:
ACCEPT_TOKEN(anon_sym_matchers);
END_STATE();
case 79:
ACCEPT_TOKEN(sym_request_ptype);
if (lookahead == 'o') ADVANCE(42);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(80);
END_STATE();
case 80:
ACCEPT_TOKEN(sym_request_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(80);
END_STATE();
case 81:
ACCEPT_TOKEN(sym_request_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(81);
if (lookahead == '-' ||
lookahead == '/' ||
('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(108);
END_STATE();
case 82:
ACCEPT_TOKEN(sym_policy_ptype);
if (lookahead == 'o') ADVANCE(41);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(83);
END_STATE();
case 83:
ACCEPT_TOKEN(sym_policy_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(83);
END_STATE();
case 84:
ACCEPT_TOKEN(sym_policy_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(84);
if (lookahead == '-' ||
lookahead == '/' ||
('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(108);
END_STATE();
case 85:
ACCEPT_TOKEN(sym_role_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(85);
END_STATE();
case 86:
ACCEPT_TOKEN(sym_role_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(86);
if (lookahead == '-' ||
lookahead == '/' ||
('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(108);
END_STATE();
case 87:
ACCEPT_TOKEN(sym_policy_effect_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(87);
END_STATE();
case 88:
ACCEPT_TOKEN(sym_policy_effect_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(88);
if (lookahead == '-' ||
lookahead == '/' ||
('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(108);
END_STATE();
case 89:
ACCEPT_TOKEN(sym_matchers_ptype);
if (lookahead == 'a') ADVANCE(59);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(90);
END_STATE();
case 90:
ACCEPT_TOKEN(sym_matchers_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(90);
END_STATE();
case 91:
ACCEPT_TOKEN(sym_matchers_ptype);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(91);
if (lookahead == '-' ||
lookahead == '/' ||
('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(108);
END_STATE();
case 92:
ACCEPT_TOKEN(anon_sym_COMMA);
END_STATE();
case 93:
ACCEPT_TOKEN(anon_sym_PIPE_PIPE);
END_STATE();
case 94:
ACCEPT_TOKEN(anon_sym_AMP_AMP);
END_STATE();
case 95:
ACCEPT_TOKEN(anon_sym_EQ_EQ);
END_STATE();
case 96:
ACCEPT_TOKEN(anon_sym_BANG_EQ);
END_STATE();
case 97:
ACCEPT_TOKEN(anon_sym_GT_EQ);
END_STATE();
case 98:
ACCEPT_TOKEN(anon_sym_LT_EQ);
END_STATE();
case 99:
ACCEPT_TOKEN(anon_sym_GT);
if (lookahead == '=') ADVANCE(97);
END_STATE();
case 100:
ACCEPT_TOKEN(anon_sym_LT);
if (lookahead == '=') ADVANCE(98);
END_STATE();
case 101:
ACCEPT_TOKEN(anon_sym_in);
END_STATE();
case 102:
ACCEPT_TOKEN(anon_sym_LPAREN);
END_STATE();
case 103:
ACCEPT_TOKEN(anon_sym_RPAREN);
END_STATE();
case 104:
ACCEPT_TOKEN(anon_sym_DOT);
END_STATE();
case 105:
ACCEPT_TOKEN(aux_sym_string_token1);
END_STATE();
case 106:
ACCEPT_TOKEN(aux_sym_string_token2);
END_STATE();
case 107:
ACCEPT_TOKEN(sym_number);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(107);
END_STATE();
case 108:
ACCEPT_TOKEN(sym_identifier);
if (lookahead == '-' ||
('/' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(108);
END_STATE();
default:
return false;
}
}
static const TSLexerMode ts_lex_modes[STATE_COUNT] = {
[0] = {.lex_state = 0},
[1] = {.lex_state = 0},
[2] = {.lex_state = 68},
[3] = {.lex_state = 68},
[4] = {.lex_state = 68},
[5] = {.lex_state = 68},
[6] = {.lex_state = 68},
[7] = {.lex_state = 68},
[8] = {.lex_state = 68},
[9] = {.lex_state = 68},
[10] = {.lex_state = 68},
[11] = {.lex_state = 68},
[12] = {.lex_state = 1},
[13] = {.lex_state = 68},
[14] = {.lex_state = 68},
[15] = {.lex_state = 68},
[16] = {.lex_state = 1},
[17] = {.lex_state = 1},
[18] = {.lex_state = 1},
[19] = {.lex_state = 1},
[20] = {.lex_state = 1},
[21] = {.lex_state = 1},
[22] = {.lex_state = 1},
[23] = {.lex_state = 1},
[24] = {.lex_state = 1},
[25] = {.lex_state = 1},
[26] = {.lex_state = 68},
[27] = {.lex_state = 68},
[28] = {.lex_state = 68},
[29] = {.lex_state = 0},
[30] = {.lex_state = 0},
[31] = {.lex_state = 1},
[32] = {.lex_state = 43},
[33] = {.lex_state = 68},
[34] = {.lex_state = 0},
[35] = {.lex_state = 0},
[36] = {.lex_state = 68},
[37] = {.lex_state = 68},
[38] = {.lex_state = 68},
[39] = {.lex_state = 0},
[40] = {.lex_state = 68},
[41] = {.lex_state = 68},
[42] = {.lex_state = 68},
[43] = {.lex_state = 68},
[44] = {.lex_state = 0},
[45] = {.lex_state = 68},
[46] = {.lex_state = 0},
[47] = {.lex_state = 0},
[48] = {.lex_state = 68},
[49] = {.lex_state = 68},
[50] = {.lex_state = 0},
[51] = {.lex_state = 0},
[52] = {.lex_state = 68},
[53] = {.lex_state = 0},
[54] = {.lex_state = 0},
[55] = {.lex_state = 0},
[56] = {.lex_state = 1},
[57] = {.lex_state = 1},
[58] = {.lex_state = 1},
[59] = {.lex_state = 0},
[60] = {.lex_state = 1},
[61] = {.lex_state = 0},
[62] = {.lex_state = 1},
[63] = {.lex_state = 0},
[64] = {.lex_state = 0},
[65] = {.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_EQ] = ACTIONS(1),
[anon_sym_policy_definition] = ACTIONS(1),
[anon_sym_role_definition] = ACTIONS(1),
[anon_sym_policy_effect] = ACTIONS(1),
[anon_sym_matchers] = ACTIONS(1),
[sym_request_ptype] = ACTIONS(1),
[sym_policy_ptype] = ACTIONS(1),
[sym_role_ptype] = ACTIONS(1),
[sym_policy_effect_ptype] = ACTIONS(1),
[sym_matchers_ptype] = ACTIONS(1),
[anon_sym_COMMA] = ACTIONS(1),
[anon_sym_PIPE_PIPE] = ACTIONS(1),
[anon_sym_AMP_AMP] = ACTIONS(1),
[anon_sym_EQ_EQ] = ACTIONS(1),
[anon_sym_BANG_EQ] = ACTIONS(1),
[anon_sym_GT_EQ] = ACTIONS(1),
[anon_sym_LT_EQ] = ACTIONS(1),
[anon_sym_GT] = ACTIONS(1),
[anon_sym_LT] = ACTIONS(1),
[anon_sym_in] = ACTIONS(1),
[anon_sym_LPAREN] = ACTIONS(1),
[anon_sym_RPAREN] = ACTIONS(1),
[anon_sym_DOT] = ACTIONS(1),
[aux_sym_string_token1] = ACTIONS(1),
[aux_sym_string_token2] = ACTIONS(1),
[sym_number] = ACTIONS(1),
},
[STATE(1)] = {
[sym_source_file] = STATE(59),
[sym_section] = STATE(29),
[sym_request_section] = STATE(53),
[sym_policy_section] = STATE(53),
[sym_role_section] = STATE(53),
[sym_policy_effect_section] = STATE(53),
[sym_matchers_section] = STATE(53),
[aux_sym_source_file_repeat1] = STATE(29),
[ts_builtin_sym_end] = ACTIONS(3),
[anon_sym_LBRACK] = ACTIONS(5),
},
};
static const uint16_t ts_small_parse_table[] = {
[0] = 2,
ACTIONS(9), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(7), 18,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
anon_sym_LPAREN,
anon_sym_RPAREN,
anon_sym_DOT,
[25] = 8,
ACTIONS(13), 1,
anon_sym_COMMA,
ACTIONS(15), 1,
anon_sym_PIPE_PIPE,
ACTIONS(17), 1,
anon_sym_AMP_AMP,
ACTIONS(23), 1,
anon_sym_DOT,
STATE(28), 1,
aux_sym_expression_list_repeat1,
ACTIONS(21), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(19), 5,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
ACTIONS(11), 8,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_RPAREN,
[62] = 3,
ACTIONS(29), 1,
anon_sym_LPAREN,
ACTIONS(27), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(25), 17,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
anon_sym_RPAREN,
anon_sym_DOT,
[89] = 3,
ACTIONS(23), 1,
anon_sym_DOT,
ACTIONS(33), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(31), 16,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
anon_sym_RPAREN,
[115] = 2,
ACTIONS(37), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(35), 17,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
anon_sym_RPAREN,
anon_sym_DOT,
[139] = 2,
ACTIONS(27), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(25), 17,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
anon_sym_RPAREN,
anon_sym_DOT,
[163] = 2,
ACTIONS(41), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(39), 17,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
anon_sym_RPAREN,
anon_sym_DOT,
[187] = 2,
ACTIONS(45), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(43), 17,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
anon_sym_RPAREN,
anon_sym_DOT,
[211] = 5,
ACTIONS(17), 1,
anon_sym_AMP_AMP,
ACTIONS(23), 1,
anon_sym_DOT,
ACTIONS(21), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(19), 5,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
ACTIONS(31), 10,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_RPAREN,
[241] = 6,
ACTIONS(15), 1,
anon_sym_PIPE_PIPE,
ACTIONS(17), 1,
anon_sym_AMP_AMP,
ACTIONS(23), 1,
anon_sym_DOT,
ACTIONS(21), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(19), 5,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
ACTIONS(47), 9,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_RPAREN,
[273] = 9,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(53), 1,
anon_sym_RPAREN,
ACTIONS(57), 1,
sym_number,
STATE(3), 1,
sym_expression,
STATE(4), 1,
sym_variable,
STATE(64), 1,
sym_expression_list,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[311] = 2,
ACTIONS(61), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(59), 17,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
anon_sym_RPAREN,
anon_sym_DOT,
[335] = 4,
ACTIONS(23), 1,
anon_sym_DOT,
ACTIONS(21), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(19), 5,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
ACTIONS(31), 11,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_RPAREN,
[363] = 2,
ACTIONS(65), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(63), 17,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_COMMA,
anon_sym_PIPE_PIPE,
anon_sym_AMP_AMP,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
anon_sym_RPAREN,
anon_sym_DOT,
[387] = 8,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(3), 1,
sym_expression,
STATE(4), 1,
sym_variable,
STATE(52), 1,
sym_expression_list,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[422] = 8,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(3), 1,
sym_expression,
STATE(4), 1,
sym_variable,
STATE(51), 1,
sym_expression_list,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[457] = 8,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(3), 1,
sym_expression,
STATE(4), 1,
sym_variable,
STATE(49), 1,
sym_expression_list,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[492] = 8,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(3), 1,
sym_expression,
STATE(4), 1,
sym_variable,
STATE(48), 1,
sym_expression_list,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[527] = 8,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(3), 1,
sym_expression,
STATE(4), 1,
sym_variable,
STATE(50), 1,
sym_expression_list,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[562] = 7,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(4), 1,
sym_variable,
STATE(10), 1,
sym_expression,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[594] = 7,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(4), 1,
sym_variable,
STATE(26), 1,
sym_expression,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[626] = 7,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(4), 1,
sym_variable,
STATE(11), 1,
sym_expression,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[658] = 7,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(4), 1,
sym_variable,
STATE(14), 1,
sym_expression,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[690] = 7,
ACTIONS(51), 1,
anon_sym_LPAREN,
ACTIONS(57), 1,
sym_number,
STATE(4), 1,
sym_variable,
STATE(5), 1,
sym_expression,
ACTIONS(55), 2,
aux_sym_string_token1,
aux_sym_string_token2,
STATE(7), 5,
sym_binary_expression,
sym_function_call,
sym_member_expression,
sym_parenthesized_expression,
sym_string,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[722] = 6,
ACTIONS(15), 1,
anon_sym_PIPE_PIPE,
ACTIONS(17), 1,
anon_sym_AMP_AMP,
ACTIONS(23), 1,
anon_sym_DOT,
ACTIONS(67), 1,
anon_sym_RPAREN,
ACTIONS(21), 2,
anon_sym_GT,
anon_sym_LT,
ACTIONS(19), 5,
anon_sym_EQ_EQ,
anon_sym_BANG_EQ,
anon_sym_GT_EQ,
anon_sym_LT_EQ,
anon_sym_in,
[746] = 3,
ACTIONS(69), 1,
anon_sym_COMMA,
STATE(27), 1,
aux_sym_expression_list_repeat1,
ACTIONS(47), 8,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_RPAREN,
[763] = 3,
ACTIONS(13), 1,
anon_sym_COMMA,
STATE(27), 1,
aux_sym_expression_list_repeat1,
ACTIONS(72), 8,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
anon_sym_RPAREN,
[780] = 4,
ACTIONS(5), 1,
anon_sym_LBRACK,
ACTIONS(74), 1,
ts_builtin_sym_end,
STATE(30), 2,
sym_section,
aux_sym_source_file_repeat1,
STATE(53), 5,
sym_request_section,
sym_policy_section,
sym_role_section,
sym_policy_effect_section,
sym_matchers_section,
[798] = 4,
ACTIONS(76), 1,
ts_builtin_sym_end,
ACTIONS(78), 1,
anon_sym_LBRACK,
STATE(30), 2,
sym_section,
aux_sym_source_file_repeat1,
STATE(53), 5,
sym_request_section,
sym_policy_section,
sym_role_section,
sym_policy_effect_section,
sym_matchers_section,
[816] = 2,
STATE(9), 1,
sym_variable,
ACTIONS(49), 6,
sym_request_ptype,
sym_policy_ptype,
sym_role_ptype,
sym_policy_effect_ptype,
sym_matchers_ptype,
sym_identifier,
[828] = 5,
ACTIONS(81), 1,
anon_sym_request_definition,
ACTIONS(83), 1,
anon_sym_policy_definition,
ACTIONS(85), 1,
anon_sym_role_definition,
ACTIONS(87), 1,
anon_sym_policy_effect,
ACTIONS(89), 1,
anon_sym_matchers,
[844] = 3,
ACTIONS(93), 1,
sym_matchers_ptype,
STATE(33), 1,
aux_sym_matchers_section_repeat1,
ACTIONS(91), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[855] = 3,
ACTIONS(98), 1,
sym_policy_effect_ptype,
STATE(34), 1,
aux_sym_policy_effect_section_repeat1,
ACTIONS(96), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[866] = 3,
ACTIONS(103), 1,
sym_role_ptype,
STATE(44), 1,
aux_sym_role_section_repeat1,
ACTIONS(101), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[877] = 3,
ACTIONS(107), 1,
sym_matchers_ptype,
STATE(45), 1,
aux_sym_matchers_section_repeat1,
ACTIONS(105), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[888] = 3,
ACTIONS(111), 1,
sym_request_ptype,
STATE(40), 1,
aux_sym_request_section_repeat1,
ACTIONS(109), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[899] = 3,
ACTIONS(115), 1,
sym_policy_ptype,
STATE(42), 1,
aux_sym_policy_section_repeat1,
ACTIONS(113), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[910] = 3,
ACTIONS(119), 1,
sym_policy_effect_ptype,
STATE(46), 1,
aux_sym_policy_effect_section_repeat1,
ACTIONS(117), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[921] = 3,
ACTIONS(111), 1,
sym_request_ptype,
STATE(43), 1,
aux_sym_request_section_repeat1,
ACTIONS(121), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[932] = 3,
ACTIONS(125), 1,
sym_policy_ptype,
STATE(41), 1,
aux_sym_policy_section_repeat1,
ACTIONS(123), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[943] = 3,
ACTIONS(115), 1,
sym_policy_ptype,
STATE(41), 1,
aux_sym_policy_section_repeat1,
ACTIONS(128), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[954] = 3,
ACTIONS(132), 1,
sym_request_ptype,
STATE(43), 1,
aux_sym_request_section_repeat1,
ACTIONS(130), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[965] = 3,
ACTIONS(103), 1,
sym_role_ptype,
STATE(47), 1,
aux_sym_role_section_repeat1,
ACTIONS(135), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[976] = 3,
ACTIONS(107), 1,
sym_matchers_ptype,
STATE(33), 1,
aux_sym_matchers_section_repeat1,
ACTIONS(137), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[987] = 3,
ACTIONS(119), 1,
sym_policy_effect_ptype,
STATE(34), 1,
aux_sym_policy_effect_section_repeat1,
ACTIONS(139), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[998] = 3,
ACTIONS(143), 1,
sym_role_ptype,
STATE(47), 1,
aux_sym_role_section_repeat1,
ACTIONS(141), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[1009] = 1,
ACTIONS(146), 3,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_request_ptype,
[1015] = 1,
ACTIONS(148), 3,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_policy_ptype,
[1021] = 1,
ACTIONS(150), 3,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_role_ptype,
[1027] = 1,
ACTIONS(152), 3,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_policy_effect_ptype,
[1033] = 1,
ACTIONS(154), 3,
ts_builtin_sym_end,
anon_sym_LBRACK,
sym_matchers_ptype,
[1039] = 1,
ACTIONS(156), 2,
ts_builtin_sym_end,
anon_sym_LBRACK,
[1044] = 1,
ACTIONS(158), 1,
anon_sym_RBRACK,
[1048] = 1,
ACTIONS(160), 1,
anon_sym_RBRACK,
[1052] = 1,
ACTIONS(162), 1,
anon_sym_EQ,
[1056] = 1,
ACTIONS(164), 1,
anon_sym_EQ,
[1060] = 1,
ACTIONS(166), 1,
anon_sym_EQ,
[1064] = 1,
ACTIONS(168), 1,
ts_builtin_sym_end,
[1068] = 1,
ACTIONS(170), 1,
anon_sym_EQ,
[1072] = 1,
ACTIONS(172), 1,
anon_sym_RBRACK,
[1076] = 1,
ACTIONS(174), 1,
anon_sym_EQ,
[1080] = 1,
ACTIONS(176), 1,
anon_sym_RBRACK,
[1084] = 1,
ACTIONS(178), 1,
anon_sym_RPAREN,
[1088] = 1,
ACTIONS(180), 1,
anon_sym_RBRACK,
};
static const uint32_t ts_small_parse_table_map[] = {
[SMALL_STATE(2)] = 0,
[SMALL_STATE(3)] = 25,
[SMALL_STATE(4)] = 62,
[SMALL_STATE(5)] = 89,
[SMALL_STATE(6)] = 115,
[SMALL_STATE(7)] = 139,
[SMALL_STATE(8)] = 163,
[SMALL_STATE(9)] = 187,
[SMALL_STATE(10)] = 211,
[SMALL_STATE(11)] = 241,
[SMALL_STATE(12)] = 273,
[SMALL_STATE(13)] = 311,
[SMALL_STATE(14)] = 335,
[SMALL_STATE(15)] = 363,
[SMALL_STATE(16)] = 387,
[SMALL_STATE(17)] = 422,
[SMALL_STATE(18)] = 457,
[SMALL_STATE(19)] = 492,
[SMALL_STATE(20)] = 527,
[SMALL_STATE(21)] = 562,
[SMALL_STATE(22)] = 594,
[SMALL_STATE(23)] = 626,
[SMALL_STATE(24)] = 658,
[SMALL_STATE(25)] = 690,
[SMALL_STATE(26)] = 722,
[SMALL_STATE(27)] = 746,
[SMALL_STATE(28)] = 763,
[SMALL_STATE(29)] = 780,
[SMALL_STATE(30)] = 798,
[SMALL_STATE(31)] = 816,
[SMALL_STATE(32)] = 828,
[SMALL_STATE(33)] = 844,
[SMALL_STATE(34)] = 855,
[SMALL_STATE(35)] = 866,
[SMALL_STATE(36)] = 877,
[SMALL_STATE(37)] = 888,
[SMALL_STATE(38)] = 899,
[SMALL_STATE(39)] = 910,
[SMALL_STATE(40)] = 921,
[SMALL_STATE(41)] = 932,
[SMALL_STATE(42)] = 943,
[SMALL_STATE(43)] = 954,
[SMALL_STATE(44)] = 965,
[SMALL_STATE(45)] = 976,
[SMALL_STATE(46)] = 987,
[SMALL_STATE(47)] = 998,
[SMALL_STATE(48)] = 1009,
[SMALL_STATE(49)] = 1015,
[SMALL_STATE(50)] = 1021,
[SMALL_STATE(51)] = 1027,
[SMALL_STATE(52)] = 1033,
[SMALL_STATE(53)] = 1039,
[SMALL_STATE(54)] = 1044,
[SMALL_STATE(55)] = 1048,
[SMALL_STATE(56)] = 1052,
[SMALL_STATE(57)] = 1056,
[SMALL_STATE(58)] = 1060,
[SMALL_STATE(59)] = 1064,
[SMALL_STATE(60)] = 1068,
[SMALL_STATE(61)] = 1072,
[SMALL_STATE(62)] = 1076,
[SMALL_STATE(63)] = 1080,
[SMALL_STATE(64)] = 1084,
[SMALL_STATE(65)] = 1088,
};
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 = true}}, SHIFT(32),
[7] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_variable, 1, 0, 0),
[9] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_variable, 1, 0, 0),
[11] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression_list, 1, 0, 0),
[13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23),
[15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21),
[17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24),
[19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25),
[21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25),
[23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31),
[25] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1, 0, 0),
[27] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1, 0, 0),
[29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12),
[31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binary_expression, 3, 0, 0),
[33] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_binary_expression, 3, 0, 0),
[35] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string, 1, 0, 0),
[37] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string, 1, 0, 0),
[39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 3, 0, 5),
[41] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 3, 0, 5),
[43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_member_expression, 3, 0, 4),
[45] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_member_expression, 3, 0, 4),
[47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_list_repeat1, 2, 0, 0),
[49] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2),
[51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22),
[53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8),
[55] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
[57] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),
[59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parenthesized_expression, 3, 0, 0),
[61] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_parenthesized_expression, 3, 0, 0),
[63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 4, 0, 5),
[65] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 4, 0, 5),
[67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13),
[69] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_expression_list_repeat1, 2, 0, 0), SHIFT_REPEAT(23),
[72] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression_list, 2, 0, 0),
[74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0),
[76] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0),
[78] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(32),
[81] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61),
[83] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63),
[85] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65),
[87] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55),
[89] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54),
[91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_matchers_section_repeat1, 2, 0, 2),
[93] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_matchers_section_repeat1, 2, 0, 2), SHIFT_REPEAT(57),
[96] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_policy_effect_section_repeat1, 2, 0, 2),
[98] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_policy_effect_section_repeat1, 2, 0, 2), SHIFT_REPEAT(62),
[101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_role_section, 3, 0, 0),
[103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60),
[105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_matchers_section, 3, 0, 0),
[107] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57),
[109] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_request_section, 3, 0, 0),
[111] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56),
[113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_policy_section, 3, 0, 0),
[115] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58),
[117] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_policy_effect_section, 3, 0, 0),
[119] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62),
[121] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_request_section, 4, 0, 1),
[123] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_policy_section_repeat1, 2, 0, 2),
[125] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_policy_section_repeat1, 2, 0, 2), SHIFT_REPEAT(58),
[128] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_policy_section, 4, 0, 1),
[130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_request_section_repeat1, 2, 0, 2),
[132] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_request_section_repeat1, 2, 0, 2), SHIFT_REPEAT(56),
[135] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_role_section, 4, 0, 1),
[137] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_matchers_section, 4, 0, 1),
[139] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_policy_effect_section, 4, 0, 1),
[141] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_role_section_repeat1, 2, 0, 2),
[143] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_role_section_repeat1, 2, 0, 2), SHIFT_REPEAT(60),
[146] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_request_section_repeat1, 3, 0, 3),
[148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_policy_section_repeat1, 3, 0, 3),
[150] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_role_section_repeat1, 3, 0, 3),
[152] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_policy_effect_section_repeat1, 3, 0, 3),
[154] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_matchers_section_repeat1, 3, 0, 3),
[156] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_section, 1, 0, 0),
[158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36),
[160] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39),
[162] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19),
[164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16),
[166] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
[168] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
[170] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
[172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37),
[174] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17),
[176] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38),
[178] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),
[180] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35),
};
#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_casbin(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 = "casbin",
.max_reserved_word_set_size = 0,
.metadata = {
.major_version = 0,
.minor_version = 1,
.patch_version = 0,
},
};
return &language;
}
#ifdef __cplusplus
}
#endif