UNPKG

sign-in-with-ethereum-parser

Version:

Parse Messages that conform to EIP-4361: Sign In with Ethereum (SIWE)

915 lines (831 loc) 58.5 kB
// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br> // license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br> // // Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js) export function grammar(){ // ``` // SUMMARY // rules = 81 // udts = 0 // opcodes = 461 // --- ABNF original opcodes // ALT = 26 // CAT = 63 // REP = 63 // RNM = 159 // TLS = 41 // TBS = 64 // TRG = 41 // --- SABNF superset opcodes // UDT = 0 // AND = 0 // NOT = 4 // BKA = 0 // BKN = 0 // BKR = 0 // ABG = 0 // AEN = 0 // characters = [10 - 126] // ``` /* OBJECT IDENTIFIER (for internal parser use) */ this.grammarObject = 'grammarObject'; /* RULES */ this.rules = []; this.rules[0] = { name: 'sign-in-with-ethereum', lower: 'sign-in-with-ethereum', index: 0, isBkr: false }; this.rules[1] = { name: 'ex-title', lower: 'ex-title', index: 1, isBkr: false }; this.rules[2] = { name: 'nb-title', lower: 'nb-title', index: 2, isBkr: false }; this.rules[3] = { name: 'ri-title', lower: 'ri-title', index: 3, isBkr: false }; this.rules[4] = { name: 're-title', lower: 're-title', index: 4, isBkr: false }; this.rules[5] = { name: 'oscheme', lower: 'oscheme', index: 5, isBkr: false }; this.rules[6] = { name: 'domain', lower: 'domain', index: 6, isBkr: false }; this.rules[7] = { name: 'address', lower: 'address', index: 7, isBkr: false }; this.rules[8] = { name: 'statement', lower: 'statement', index: 8, isBkr: false }; this.rules[9] = { name: 'empty-statement', lower: 'empty-statement', index: 9, isBkr: false }; this.rules[10] = { name: 'version', lower: 'version', index: 10, isBkr: false }; this.rules[11] = { name: 'nonce', lower: 'nonce', index: 11, isBkr: false }; this.rules[12] = { name: 'issued-at', lower: 'issued-at', index: 12, isBkr: false }; this.rules[13] = { name: 'expiration-time', lower: 'expiration-time', index: 13, isBkr: false }; this.rules[14] = { name: 'not-before', lower: 'not-before', index: 14, isBkr: false }; this.rules[15] = { name: 'request-id', lower: 'request-id', index: 15, isBkr: false }; this.rules[16] = { name: 'chain-id', lower: 'chain-id', index: 16, isBkr: false }; this.rules[17] = { name: 'resources', lower: 'resources', index: 17, isBkr: false }; this.rules[18] = { name: 'resource', lower: 'resource', index: 18, isBkr: false }; this.rules[19] = { name: 'URI', lower: 'uri', index: 19, isBkr: false }; this.rules[20] = { name: 'hier-part', lower: 'hier-part', index: 20, isBkr: false }; this.rules[21] = { name: 'scheme', lower: 'scheme', index: 21, isBkr: false }; this.rules[22] = { name: 'authority', lower: 'authority', index: 22, isBkr: false }; this.rules[23] = { name: 'path-abempty', lower: 'path-abempty', index: 23, isBkr: false }; this.rules[24] = { name: 'path-absolute', lower: 'path-absolute', index: 24, isBkr: false }; this.rules[25] = { name: 'path-rootless', lower: 'path-rootless', index: 25, isBkr: false }; this.rules[26] = { name: 'path-empty', lower: 'path-empty', index: 26, isBkr: false }; this.rules[27] = { name: 'userinfo-at', lower: 'userinfo-at', index: 27, isBkr: false }; this.rules[28] = { name: 'userinfo', lower: 'userinfo', index: 28, isBkr: false }; this.rules[29] = { name: 'host', lower: 'host', index: 29, isBkr: false }; this.rules[30] = { name: 'IP-literal', lower: 'ip-literal', index: 30, isBkr: false }; this.rules[31] = { name: 'IPvFuture', lower: 'ipvfuture', index: 31, isBkr: false }; this.rules[32] = { name: 'IPv6address', lower: 'ipv6address', index: 32, isBkr: false }; this.rules[33] = { name: 'nodcolon', lower: 'nodcolon', index: 33, isBkr: false }; this.rules[34] = { name: 'dcolon', lower: 'dcolon', index: 34, isBkr: false }; this.rules[35] = { name: 'h16', lower: 'h16', index: 35, isBkr: false }; this.rules[36] = { name: 'h16c', lower: 'h16c', index: 36, isBkr: false }; this.rules[37] = { name: 'h16n', lower: 'h16n', index: 37, isBkr: false }; this.rules[38] = { name: 'h16cn', lower: 'h16cn', index: 38, isBkr: false }; this.rules[39] = { name: 'IPv4address', lower: 'ipv4address', index: 39, isBkr: false }; this.rules[40] = { name: 'dec-octet', lower: 'dec-octet', index: 40, isBkr: false }; this.rules[41] = { name: 'dec-digit', lower: 'dec-digit', index: 41, isBkr: false }; this.rules[42] = { name: 'reg-name', lower: 'reg-name', index: 42, isBkr: false }; this.rules[43] = { name: 'reg-name-char', lower: 'reg-name-char', index: 43, isBkr: false }; this.rules[44] = { name: 'port', lower: 'port', index: 44, isBkr: false }; this.rules[45] = { name: 'query', lower: 'query', index: 45, isBkr: false }; this.rules[46] = { name: 'fragment', lower: 'fragment', index: 46, isBkr: false }; this.rules[47] = { name: 'URI-r', lower: 'uri-r', index: 47, isBkr: false }; this.rules[48] = { name: 'hier-part-r', lower: 'hier-part-r', index: 48, isBkr: false }; this.rules[49] = { name: 'scheme-r', lower: 'scheme-r', index: 49, isBkr: false }; this.rules[50] = { name: 'query-r', lower: 'query-r', index: 50, isBkr: false }; this.rules[51] = { name: 'fragment-r', lower: 'fragment-r', index: 51, isBkr: false }; this.rules[52] = { name: 'authority-d', lower: 'authority-d', index: 52, isBkr: false }; this.rules[53] = { name: 'userinfo-d', lower: 'userinfo-d', index: 53, isBkr: false }; this.rules[54] = { name: 'host-d', lower: 'host-d', index: 54, isBkr: false }; this.rules[55] = { name: 'port-d', lower: 'port-d', index: 55, isBkr: false }; this.rules[56] = { name: 'path-abempty-r', lower: 'path-abempty-r', index: 56, isBkr: false }; this.rules[57] = { name: 'path-absolute-r', lower: 'path-absolute-r', index: 57, isBkr: false }; this.rules[58] = { name: 'path-rootless-r', lower: 'path-rootless-r', index: 58, isBkr: false }; this.rules[59] = { name: 'path-empty-r', lower: 'path-empty-r', index: 59, isBkr: false }; this.rules[60] = { name: 'segment', lower: 'segment', index: 60, isBkr: false }; this.rules[61] = { name: 'segment-nz', lower: 'segment-nz', index: 61, isBkr: false }; this.rules[62] = { name: 'pchar', lower: 'pchar', index: 62, isBkr: false }; this.rules[63] = { name: 'pct-encoded', lower: 'pct-encoded', index: 63, isBkr: false }; this.rules[64] = { name: 'date-fullyear', lower: 'date-fullyear', index: 64, isBkr: false }; this.rules[65] = { name: 'date-month', lower: 'date-month', index: 65, isBkr: false }; this.rules[66] = { name: 'date-mday', lower: 'date-mday', index: 66, isBkr: false }; this.rules[67] = { name: 'time-hour', lower: 'time-hour', index: 67, isBkr: false }; this.rules[68] = { name: 'time-minute', lower: 'time-minute', index: 68, isBkr: false }; this.rules[69] = { name: 'time-second', lower: 'time-second', index: 69, isBkr: false }; this.rules[70] = { name: 'time-secfrac', lower: 'time-secfrac', index: 70, isBkr: false }; this.rules[71] = { name: 'time-numoffset', lower: 'time-numoffset', index: 71, isBkr: false }; this.rules[72] = { name: 'time-offset', lower: 'time-offset', index: 72, isBkr: false }; this.rules[73] = { name: 'partial-time', lower: 'partial-time', index: 73, isBkr: false }; this.rules[74] = { name: 'full-date', lower: 'full-date', index: 74, isBkr: false }; this.rules[75] = { name: 'full-time', lower: 'full-time', index: 75, isBkr: false }; this.rules[76] = { name: 'date-time', lower: 'date-time', index: 76, isBkr: false }; this.rules[77] = { name: 'ALPHA', lower: 'alpha', index: 77, isBkr: false }; this.rules[78] = { name: 'LF', lower: 'lf', index: 78, isBkr: false }; this.rules[79] = { name: 'DIGIT', lower: 'digit', index: 79, isBkr: false }; this.rules[80] = { name: 'HEXDIG', lower: 'hexdig', index: 80, isBkr: false }; /* UDTS */ this.udts = []; /* OPCODES */ /* sign-in-with-ethereum */ this.rules[0].opcodes = []; this.rules[0].opcodes[0] = { type: 2, children: [1,2,3,4,5,6,7,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,36,41,46] };// CAT this.rules[0].opcodes[1] = { type: 4, index: 5 };// RNM(oscheme) this.rules[0].opcodes[2] = { type: 4, index: 6 };// RNM(domain) this.rules[0].opcodes[3] = { type: 6, string: [32,119,97,110,116,115,32,121,111,117,32,116,111,32,115,105,103,110,32,105,110,32,119,105,116,104,32,121,111,117,114,32,69,116,104,101,114,101,117,109,32,97,99,99,111,117,110,116,58] };// TBS this.rules[0].opcodes[4] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[5] = { type: 4, index: 7 };// RNM(address) this.rules[0].opcodes[6] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[7] = { type: 1, children: [8,13,14] };// ALT this.rules[0].opcodes[8] = { type: 2, children: [9,10,11,12] };// CAT this.rules[0].opcodes[9] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[10] = { type: 4, index: 8 };// RNM(statement) this.rules[0].opcodes[11] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[12] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[13] = { type: 4, index: 9 };// RNM(empty-statement) this.rules[0].opcodes[14] = { type: 2, children: [15,16] };// CAT this.rules[0].opcodes[15] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[16] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[17] = { type: 6, string: [85,82,73,58,32] };// TBS this.rules[0].opcodes[18] = { type: 4, index: 19 };// RNM(URI) this.rules[0].opcodes[19] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[20] = { type: 6, string: [86,101,114,115,105,111,110,58,32] };// TBS this.rules[0].opcodes[21] = { type: 4, index: 10 };// RNM(version) this.rules[0].opcodes[22] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[23] = { type: 6, string: [67,104,97,105,110,32,73,68,58,32] };// TBS this.rules[0].opcodes[24] = { type: 4, index: 16 };// RNM(chain-id) this.rules[0].opcodes[25] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[26] = { type: 6, string: [78,111,110,99,101,58,32] };// TBS this.rules[0].opcodes[27] = { type: 4, index: 11 };// RNM(nonce) this.rules[0].opcodes[28] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[29] = { type: 6, string: [73,115,115,117,101,100,32,65,116,58,32] };// TBS this.rules[0].opcodes[30] = { type: 4, index: 12 };// RNM(issued-at) this.rules[0].opcodes[31] = { type: 3, min: 0, max: 1 };// REP this.rules[0].opcodes[32] = { type: 2, children: [33,34,35] };// CAT this.rules[0].opcodes[33] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[34] = { type: 4, index: 1 };// RNM(ex-title) this.rules[0].opcodes[35] = { type: 4, index: 13 };// RNM(expiration-time) this.rules[0].opcodes[36] = { type: 3, min: 0, max: 1 };// REP this.rules[0].opcodes[37] = { type: 2, children: [38,39,40] };// CAT this.rules[0].opcodes[38] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[39] = { type: 4, index: 2 };// RNM(nb-title) this.rules[0].opcodes[40] = { type: 4, index: 14 };// RNM(not-before) this.rules[0].opcodes[41] = { type: 3, min: 0, max: 1 };// REP this.rules[0].opcodes[42] = { type: 2, children: [43,44,45] };// CAT this.rules[0].opcodes[43] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[44] = { type: 4, index: 3 };// RNM(ri-title) this.rules[0].opcodes[45] = { type: 4, index: 15 };// RNM(request-id) this.rules[0].opcodes[46] = { type: 3, min: 0, max: 1 };// REP this.rules[0].opcodes[47] = { type: 2, children: [48,49,50] };// CAT this.rules[0].opcodes[48] = { type: 4, index: 78 };// RNM(LF) this.rules[0].opcodes[49] = { type: 4, index: 4 };// RNM(re-title) this.rules[0].opcodes[50] = { type: 4, index: 17 };// RNM(resources) /* ex-title */ this.rules[1].opcodes = []; this.rules[1].opcodes[0] = { type: 6, string: [69,120,112,105,114,97,116,105,111,110,32,84,105,109,101,58,32] };// TBS /* nb-title */ this.rules[2].opcodes = []; this.rules[2].opcodes[0] = { type: 6, string: [78,111,116,32,66,101,102,111,114,101,58,32] };// TBS /* ri-title */ this.rules[3].opcodes = []; this.rules[3].opcodes[0] = { type: 6, string: [82,101,113,117,101,115,116,32,73,68,58,32] };// TBS /* re-title */ this.rules[4].opcodes = []; this.rules[4].opcodes[0] = { type: 6, string: [82,101,115,111,117,114,99,101,115,58] };// TBS /* oscheme */ this.rules[5].opcodes = []; this.rules[5].opcodes[0] = { type: 3, min: 0, max: 1 };// REP this.rules[5].opcodes[1] = { type: 2, children: [2,3,9] };// CAT this.rules[5].opcodes[2] = { type: 4, index: 77 };// RNM(ALPHA) this.rules[5].opcodes[3] = { type: 3, min: 0, max: Infinity };// REP this.rules[5].opcodes[4] = { type: 1, children: [5,6,7,8] };// ALT this.rules[5].opcodes[5] = { type: 4, index: 77 };// RNM(ALPHA) this.rules[5].opcodes[6] = { type: 4, index: 79 };// RNM(DIGIT) this.rules[5].opcodes[7] = { type: 6, string: [43] };// TBS this.rules[5].opcodes[8] = { type: 5, min: 45, max: 46 };// TRG this.rules[5].opcodes[9] = { type: 7, string: [58,47,47] };// TLS /* domain */ this.rules[6].opcodes = []; this.rules[6].opcodes[0] = { type: 4, index: 52 };// RNM(authority-d) /* address */ this.rules[7].opcodes = []; this.rules[7].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[7].opcodes[1] = { type: 7, string: [48,120] };// TLS this.rules[7].opcodes[2] = { type: 3, min: 40, max: 40 };// REP this.rules[7].opcodes[3] = { type: 4, index: 80 };// RNM(HEXDIG) /* statement */ this.rules[8].opcodes = []; this.rules[8].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP this.rules[8].opcodes[1] = { type: 1, children: [2,3,4,5,6,7,8,9,10,11,12,13] };// ALT this.rules[8].opcodes[2] = { type: 5, min: 97, max: 122 };// TRG this.rules[8].opcodes[3] = { type: 5, min: 65, max: 90 };// TRG this.rules[8].opcodes[4] = { type: 5, min: 48, max: 57 };// TRG this.rules[8].opcodes[5] = { type: 5, min: 32, max: 33 };// TRG this.rules[8].opcodes[6] = { type: 5, min: 35, max: 36 };// TRG this.rules[8].opcodes[7] = { type: 5, min: 38, max: 59 };// TRG this.rules[8].opcodes[8] = { type: 6, string: [61] };// TBS this.rules[8].opcodes[9] = { type: 5, min: 63, max: 64 };// TRG this.rules[8].opcodes[10] = { type: 6, string: [91] };// TBS this.rules[8].opcodes[11] = { type: 6, string: [93] };// TBS this.rules[8].opcodes[12] = { type: 6, string: [95] };// TBS this.rules[8].opcodes[13] = { type: 6, string: [126] };// TBS /* empty-statement */ this.rules[9].opcodes = []; this.rules[9].opcodes[0] = { type: 2, children: [1,2,3] };// CAT this.rules[9].opcodes[1] = { type: 4, index: 78 };// RNM(LF) this.rules[9].opcodes[2] = { type: 4, index: 78 };// RNM(LF) this.rules[9].opcodes[3] = { type: 4, index: 78 };// RNM(LF) /* version */ this.rules[10].opcodes = []; this.rules[10].opcodes[0] = { type: 7, string: [49] };// TLS /* nonce */ this.rules[11].opcodes = []; this.rules[11].opcodes[0] = { type: 3, min: 8, max: Infinity };// REP this.rules[11].opcodes[1] = { type: 1, children: [2,3] };// ALT this.rules[11].opcodes[2] = { type: 4, index: 77 };// RNM(ALPHA) this.rules[11].opcodes[3] = { type: 4, index: 79 };// RNM(DIGIT) /* issued-at */ this.rules[12].opcodes = []; this.rules[12].opcodes[0] = { type: 4, index: 76 };// RNM(date-time) /* expiration-time */ this.rules[13].opcodes = []; this.rules[13].opcodes[0] = { type: 4, index: 76 };// RNM(date-time) /* not-before */ this.rules[14].opcodes = []; this.rules[14].opcodes[0] = { type: 4, index: 76 };// RNM(date-time) /* request-id */ this.rules[15].opcodes = []; this.rules[15].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[15].opcodes[1] = { type: 4, index: 62 };// RNM(pchar) /* chain-id */ this.rules[16].opcodes = []; this.rules[16].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP this.rules[16].opcodes[1] = { type: 4, index: 79 };// RNM(DIGIT) /* resources */ this.rules[17].opcodes = []; this.rules[17].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[17].opcodes[1] = { type: 2, children: [2,3] };// CAT this.rules[17].opcodes[2] = { type: 4, index: 78 };// RNM(LF) this.rules[17].opcodes[3] = { type: 4, index: 18 };// RNM(resource) /* resource */ this.rules[18].opcodes = []; this.rules[18].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[18].opcodes[1] = { type: 7, string: [45,32] };// TLS this.rules[18].opcodes[2] = { type: 4, index: 47 };// RNM(URI-r) /* URI */ this.rules[19].opcodes = []; this.rules[19].opcodes[0] = { type: 2, children: [1,2,3,4,8] };// CAT this.rules[19].opcodes[1] = { type: 4, index: 21 };// RNM(scheme) this.rules[19].opcodes[2] = { type: 7, string: [58] };// TLS this.rules[19].opcodes[3] = { type: 4, index: 20 };// RNM(hier-part) this.rules[19].opcodes[4] = { type: 3, min: 0, max: 1 };// REP this.rules[19].opcodes[5] = { type: 2, children: [6,7] };// CAT this.rules[19].opcodes[6] = { type: 7, string: [63] };// TLS this.rules[19].opcodes[7] = { type: 4, index: 45 };// RNM(query) this.rules[19].opcodes[8] = { type: 3, min: 0, max: 1 };// REP this.rules[19].opcodes[9] = { type: 2, children: [10,11] };// CAT this.rules[19].opcodes[10] = { type: 7, string: [35] };// TLS this.rules[19].opcodes[11] = { type: 4, index: 46 };// RNM(fragment) /* hier-part */ this.rules[20].opcodes = []; this.rules[20].opcodes[0] = { type: 1, children: [1,5,6,7] };// ALT this.rules[20].opcodes[1] = { type: 2, children: [2,3,4] };// CAT this.rules[20].opcodes[2] = { type: 7, string: [47,47] };// TLS this.rules[20].opcodes[3] = { type: 4, index: 22 };// RNM(authority) this.rules[20].opcodes[4] = { type: 4, index: 23 };// RNM(path-abempty) this.rules[20].opcodes[5] = { type: 4, index: 24 };// RNM(path-absolute) this.rules[20].opcodes[6] = { type: 4, index: 25 };// RNM(path-rootless) this.rules[20].opcodes[7] = { type: 4, index: 26 };// RNM(path-empty) /* scheme */ this.rules[21].opcodes = []; this.rules[21].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[21].opcodes[1] = { type: 4, index: 77 };// RNM(ALPHA) this.rules[21].opcodes[2] = { type: 3, min: 0, max: Infinity };// REP this.rules[21].opcodes[3] = { type: 1, children: [4,5,6,7] };// ALT this.rules[21].opcodes[4] = { type: 4, index: 77 };// RNM(ALPHA) this.rules[21].opcodes[5] = { type: 4, index: 79 };// RNM(DIGIT) this.rules[21].opcodes[6] = { type: 6, string: [43] };// TBS this.rules[21].opcodes[7] = { type: 5, min: 45, max: 46 };// TRG /* authority */ this.rules[22].opcodes = []; this.rules[22].opcodes[0] = { type: 2, children: [1,3,4] };// CAT this.rules[22].opcodes[1] = { type: 3, min: 0, max: 1 };// REP this.rules[22].opcodes[2] = { type: 4, index: 27 };// RNM(userinfo-at) this.rules[22].opcodes[3] = { type: 4, index: 29 };// RNM(host) this.rules[22].opcodes[4] = { type: 3, min: 0, max: 1 };// REP this.rules[22].opcodes[5] = { type: 2, children: [6,7] };// CAT this.rules[22].opcodes[6] = { type: 7, string: [58] };// TLS this.rules[22].opcodes[7] = { type: 4, index: 44 };// RNM(port) /* path-abempty */ this.rules[23].opcodes = []; this.rules[23].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[23].opcodes[1] = { type: 2, children: [2,3] };// CAT this.rules[23].opcodes[2] = { type: 7, string: [47] };// TLS this.rules[23].opcodes[3] = { type: 4, index: 60 };// RNM(segment) /* path-absolute */ this.rules[24].opcodes = []; this.rules[24].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[24].opcodes[1] = { type: 7, string: [47] };// TLS this.rules[24].opcodes[2] = { type: 3, min: 0, max: 1 };// REP this.rules[24].opcodes[3] = { type: 2, children: [4,5] };// CAT this.rules[24].opcodes[4] = { type: 4, index: 61 };// RNM(segment-nz) this.rules[24].opcodes[5] = { type: 3, min: 0, max: Infinity };// REP this.rules[24].opcodes[6] = { type: 2, children: [7,8] };// CAT this.rules[24].opcodes[7] = { type: 7, string: [47] };// TLS this.rules[24].opcodes[8] = { type: 4, index: 60 };// RNM(segment) /* path-rootless */ this.rules[25].opcodes = []; this.rules[25].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[25].opcodes[1] = { type: 4, index: 61 };// RNM(segment-nz) this.rules[25].opcodes[2] = { type: 3, min: 0, max: Infinity };// REP this.rules[25].opcodes[3] = { type: 2, children: [4,5] };// CAT this.rules[25].opcodes[4] = { type: 7, string: [47] };// TLS this.rules[25].opcodes[5] = { type: 4, index: 60 };// RNM(segment) /* path-empty */ this.rules[26].opcodes = []; this.rules[26].opcodes[0] = { type: 7, string: [] };// TLS /* userinfo-at */ this.rules[27].opcodes = []; this.rules[27].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[27].opcodes[1] = { type: 4, index: 28 };// RNM(userinfo) this.rules[27].opcodes[2] = { type: 6, string: [64] };// TBS /* userinfo */ this.rules[28].opcodes = []; this.rules[28].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[28].opcodes[1] = { type: 1, children: [2,3,4,5,6,7,8,9,10,11,12] };// ALT this.rules[28].opcodes[2] = { type: 5, min: 97, max: 122 };// TRG this.rules[28].opcodes[3] = { type: 5, min: 65, max: 90 };// TRG this.rules[28].opcodes[4] = { type: 5, min: 48, max: 57 };// TRG this.rules[28].opcodes[5] = { type: 4, index: 63 };// RNM(pct-encoded) this.rules[28].opcodes[6] = { type: 6, string: [33] };// TBS this.rules[28].opcodes[7] = { type: 6, string: [36] };// TBS this.rules[28].opcodes[8] = { type: 5, min: 38, max: 46 };// TRG this.rules[28].opcodes[9] = { type: 5, min: 58, max: 59 };// TRG this.rules[28].opcodes[10] = { type: 6, string: [61] };// TBS this.rules[28].opcodes[11] = { type: 6, string: [95] };// TBS this.rules[28].opcodes[12] = { type: 6, string: [126] };// TBS /* host */ this.rules[29].opcodes = []; this.rules[29].opcodes[0] = { type: 1, children: [1,2,6] };// ALT this.rules[29].opcodes[1] = { type: 4, index: 30 };// RNM(IP-literal) this.rules[29].opcodes[2] = { type: 2, children: [3,4] };// CAT this.rules[29].opcodes[3] = { type: 4, index: 39 };// RNM(IPv4address) this.rules[29].opcodes[4] = { type: 13 };// NOT this.rules[29].opcodes[5] = { type: 4, index: 43 };// RNM(reg-name-char) this.rules[29].opcodes[6] = { type: 4, index: 42 };// RNM(reg-name) /* IP-literal */ this.rules[30].opcodes = []; this.rules[30].opcodes[0] = { type: 2, children: [1,2,5] };// CAT this.rules[30].opcodes[1] = { type: 7, string: [91] };// TLS this.rules[30].opcodes[2] = { type: 1, children: [3,4] };// ALT this.rules[30].opcodes[3] = { type: 4, index: 32 };// RNM(IPv6address) this.rules[30].opcodes[4] = { type: 4, index: 31 };// RNM(IPvFuture) this.rules[30].opcodes[5] = { type: 7, string: [93] };// TLS /* IPvFuture */ this.rules[31].opcodes = []; this.rules[31].opcodes[0] = { type: 2, children: [1,2,4,5] };// CAT this.rules[31].opcodes[1] = { type: 7, string: [118] };// TLS this.rules[31].opcodes[2] = { type: 3, min: 1, max: Infinity };// REP this.rules[31].opcodes[3] = { type: 4, index: 80 };// RNM(HEXDIG) this.rules[31].opcodes[4] = { type: 7, string: [46] };// TLS this.rules[31].opcodes[5] = { type: 3, min: 1, max: Infinity };// REP this.rules[31].opcodes[6] = { type: 1, children: [7,8,9,10,11,12,13,14,15,16] };// ALT this.rules[31].opcodes[7] = { type: 5, min: 97, max: 122 };// TRG this.rules[31].opcodes[8] = { type: 5, min: 65, max: 90 };// TRG this.rules[31].opcodes[9] = { type: 5, min: 48, max: 57 };// TRG this.rules[31].opcodes[10] = { type: 6, string: [33] };// TBS this.rules[31].opcodes[11] = { type: 6, string: [36] };// TBS this.rules[31].opcodes[12] = { type: 5, min: 38, max: 46 };// TRG this.rules[31].opcodes[13] = { type: 5, min: 58, max: 59 };// TRG this.rules[31].opcodes[14] = { type: 6, string: [61] };// TBS this.rules[31].opcodes[15] = { type: 6, string: [95] };// TBS this.rules[31].opcodes[16] = { type: 6, string: [126] };// TBS /* IPv6address */ this.rules[32].opcodes = []; this.rules[32].opcodes[0] = { type: 1, children: [1,2] };// ALT this.rules[32].opcodes[1] = { type: 4, index: 33 };// RNM(nodcolon) this.rules[32].opcodes[2] = { type: 4, index: 34 };// RNM(dcolon) /* nodcolon */ this.rules[33].opcodes = []; this.rules[33].opcodes[0] = { type: 2, children: [1,5] };// CAT this.rules[33].opcodes[1] = { type: 2, children: [2,3] };// CAT this.rules[33].opcodes[2] = { type: 4, index: 37 };// RNM(h16n) this.rules[33].opcodes[3] = { type: 3, min: 0, max: Infinity };// REP this.rules[33].opcodes[4] = { type: 4, index: 38 };// RNM(h16cn) this.rules[33].opcodes[5] = { type: 3, min: 0, max: 1 };// REP this.rules[33].opcodes[6] = { type: 2, children: [7,8] };// CAT this.rules[33].opcodes[7] = { type: 6, string: [58] };// TBS this.rules[33].opcodes[8] = { type: 4, index: 39 };// RNM(IPv4address) /* dcolon */ this.rules[34].opcodes = []; this.rules[34].opcodes[0] = { type: 2, children: [1,6,7] };// CAT this.rules[34].opcodes[1] = { type: 3, min: 0, max: 1 };// REP this.rules[34].opcodes[2] = { type: 2, children: [3,4] };// CAT this.rules[34].opcodes[3] = { type: 4, index: 35 };// RNM(h16) this.rules[34].opcodes[4] = { type: 3, min: 0, max: Infinity };// REP this.rules[34].opcodes[5] = { type: 4, index: 36 };// RNM(h16c) this.rules[34].opcodes[6] = { type: 6, string: [58,58] };// TBS this.rules[34].opcodes[7] = { type: 1, children: [8,17] };// ALT this.rules[34].opcodes[8] = { type: 2, children: [9,13] };// CAT this.rules[34].opcodes[9] = { type: 2, children: [10,11] };// CAT this.rules[34].opcodes[10] = { type: 4, index: 37 };// RNM(h16n) this.rules[34].opcodes[11] = { type: 3, min: 0, max: Infinity };// REP this.rules[34].opcodes[12] = { type: 4, index: 38 };// RNM(h16cn) this.rules[34].opcodes[13] = { type: 3, min: 0, max: 1 };// REP this.rules[34].opcodes[14] = { type: 2, children: [15,16] };// CAT this.rules[34].opcodes[15] = { type: 6, string: [58] };// TBS this.rules[34].opcodes[16] = { type: 4, index: 39 };// RNM(IPv4address) this.rules[34].opcodes[17] = { type: 3, min: 0, max: 1 };// REP this.rules[34].opcodes[18] = { type: 4, index: 39 };// RNM(IPv4address) /* h16 */ this.rules[35].opcodes = []; this.rules[35].opcodes[0] = { type: 3, min: 1, max: 4 };// REP this.rules[35].opcodes[1] = { type: 4, index: 80 };// RNM(HEXDIG) /* h16c */ this.rules[36].opcodes = []; this.rules[36].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[36].opcodes[1] = { type: 6, string: [58] };// TBS this.rules[36].opcodes[2] = { type: 3, min: 1, max: 4 };// REP this.rules[36].opcodes[3] = { type: 4, index: 80 };// RNM(HEXDIG) /* h16n */ this.rules[37].opcodes = []; this.rules[37].opcodes[0] = { type: 2, children: [1,3] };// CAT this.rules[37].opcodes[1] = { type: 3, min: 1, max: 4 };// REP this.rules[37].opcodes[2] = { type: 4, index: 80 };// RNM(HEXDIG) this.rules[37].opcodes[3] = { type: 13 };// NOT this.rules[37].opcodes[4] = { type: 6, string: [46] };// TBS /* h16cn */ this.rules[38].opcodes = []; this.rules[38].opcodes[0] = { type: 2, children: [1,2,4] };// CAT this.rules[38].opcodes[1] = { type: 6, string: [58] };// TBS this.rules[38].opcodes[2] = { type: 3, min: 1, max: 4 };// REP this.rules[38].opcodes[3] = { type: 4, index: 80 };// RNM(HEXDIG) this.rules[38].opcodes[4] = { type: 13 };// NOT this.rules[38].opcodes[5] = { type: 6, string: [46] };// TBS /* IPv4address */ this.rules[39].opcodes = []; this.rules[39].opcodes[0] = { type: 2, children: [1,2,3,4,5,6,7] };// CAT this.rules[39].opcodes[1] = { type: 4, index: 40 };// RNM(dec-octet) this.rules[39].opcodes[2] = { type: 7, string: [46] };// TLS this.rules[39].opcodes[3] = { type: 4, index: 40 };// RNM(dec-octet) this.rules[39].opcodes[4] = { type: 7, string: [46] };// TLS this.rules[39].opcodes[5] = { type: 4, index: 40 };// RNM(dec-octet) this.rules[39].opcodes[6] = { type: 7, string: [46] };// TLS this.rules[39].opcodes[7] = { type: 4, index: 40 };// RNM(dec-octet) /* dec-octet */ this.rules[40].opcodes = []; this.rules[40].opcodes[0] = { type: 3, min: 1, max: 3 };// REP this.rules[40].opcodes[1] = { type: 4, index: 41 };// RNM(dec-digit) /* dec-digit */ this.rules[41].opcodes = []; this.rules[41].opcodes[0] = { type: 5, min: 48, max: 57 };// TRG /* reg-name */ this.rules[42].opcodes = []; this.rules[42].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[42].opcodes[1] = { type: 4, index: 43 };// RNM(reg-name-char) /* reg-name-char */ this.rules[43].opcodes = []; this.rules[43].opcodes[0] = { type: 1, children: [1,2,3,4,5,6,7,8,9,10,11] };// ALT this.rules[43].opcodes[1] = { type: 5, min: 97, max: 122 };// TRG this.rules[43].opcodes[2] = { type: 5, min: 65, max: 90 };// TRG this.rules[43].opcodes[3] = { type: 5, min: 48, max: 57 };// TRG this.rules[43].opcodes[4] = { type: 4, index: 63 };// RNM(pct-encoded) this.rules[43].opcodes[5] = { type: 6, string: [33] };// TBS this.rules[43].opcodes[6] = { type: 6, string: [36] };// TBS this.rules[43].opcodes[7] = { type: 5, min: 38, max: 46 };// TRG this.rules[43].opcodes[8] = { type: 6, string: [59] };// TBS this.rules[43].opcodes[9] = { type: 6, string: [61] };// TBS this.rules[43].opcodes[10] = { type: 6, string: [95] };// TBS this.rules[43].opcodes[11] = { type: 6, string: [126] };// TBS /* port */ this.rules[44].opcodes = []; this.rules[44].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[44].opcodes[1] = { type: 4, index: 79 };// RNM(DIGIT) /* query */ this.rules[45].opcodes = []; this.rules[45].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[45].opcodes[1] = { type: 1, children: [2,3,4] };// ALT this.rules[45].opcodes[2] = { type: 4, index: 62 };// RNM(pchar) this.rules[45].opcodes[3] = { type: 6, string: [47] };// TBS this.rules[45].opcodes[4] = { type: 6, string: [63] };// TBS /* fragment */ this.rules[46].opcodes = []; this.rules[46].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[46].opcodes[1] = { type: 1, children: [2,3,4] };// ALT this.rules[46].opcodes[2] = { type: 4, index: 62 };// RNM(pchar) this.rules[46].opcodes[3] = { type: 6, string: [47] };// TBS this.rules[46].opcodes[4] = { type: 6, string: [63] };// TBS /* URI-r */ this.rules[47].opcodes = []; this.rules[47].opcodes[0] = { type: 2, children: [1,2,3,4,8] };// CAT this.rules[47].opcodes[1] = { type: 4, index: 49 };// RNM(scheme-r) this.rules[47].opcodes[2] = { type: 7, string: [58] };// TLS this.rules[47].opcodes[3] = { type: 4, index: 48 };// RNM(hier-part-r) this.rules[47].opcodes[4] = { type: 3, min: 0, max: 1 };// REP this.rules[47].opcodes[5] = { type: 2, children: [6,7] };// CAT this.rules[47].opcodes[6] = { type: 7, string: [63] };// TLS this.rules[47].opcodes[7] = { type: 4, index: 50 };// RNM(query-r) this.rules[47].opcodes[8] = { type: 3, min: 0, max: 1 };// REP this.rules[47].opcodes[9] = { type: 2, children: [10,11] };// CAT this.rules[47].opcodes[10] = { type: 7, string: [35] };// TLS this.rules[47].opcodes[11] = { type: 4, index: 51 };// RNM(fragment-r) /* hier-part-r */ this.rules[48].opcodes = []; this.rules[48].opcodes[0] = { type: 1, children: [1,5,6,7] };// ALT this.rules[48].opcodes[1] = { type: 2, children: [2,3,4] };// CAT this.rules[48].opcodes[2] = { type: 7, string: [47,47] };// TLS this.rules[48].opcodes[3] = { type: 4, index: 52 };// RNM(authority-d) this.rules[48].opcodes[4] = { type: 4, index: 56 };// RNM(path-abempty-r) this.rules[48].opcodes[5] = { type: 4, index: 57 };// RNM(path-absolute-r) this.rules[48].opcodes[6] = { type: 4, index: 58 };// RNM(path-rootless-r) this.rules[48].opcodes[7] = { type: 4, index: 59 };// RNM(path-empty-r) /* scheme-r */ this.rules[49].opcodes = []; this.rules[49].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[49].opcodes[1] = { type: 4, index: 77 };// RNM(ALPHA) this.rules[49].opcodes[2] = { type: 3, min: 0, max: Infinity };// REP this.rules[49].opcodes[3] = { type: 1, children: [4,5,6,7] };// ALT this.rules[49].opcodes[4] = { type: 4, index: 77 };// RNM(ALPHA) this.rules[49].opcodes[5] = { type: 4, index: 79 };// RNM(DIGIT) this.rules[49].opcodes[6] = { type: 6, string: [43] };// TBS this.rules[49].opcodes[7] = { type: 5, min: 45, max: 46 };// TRG /* query-r */ this.rules[50].opcodes = []; this.rules[50].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[50].opcodes[1] = { type: 1, children: [2,3,4] };// ALT this.rules[50].opcodes[2] = { type: 4, index: 62 };// RNM(pchar) this.rules[50].opcodes[3] = { type: 6, string: [47] };// TBS this.rules[50].opcodes[4] = { type: 6, string: [63] };// TBS /* fragment-r */ this.rules[51].opcodes = []; this.rules[51].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[51].opcodes[1] = { type: 1, children: [2,3,4] };// ALT this.rules[51].opcodes[2] = { type: 4, index: 62 };// RNM(pchar) this.rules[51].opcodes[3] = { type: 6, string: [47] };// TBS this.rules[51].opcodes[4] = { type: 6, string: [63] };// TBS /* authority-d */ this.rules[52].opcodes = []; this.rules[52].opcodes[0] = { type: 2, children: [1,5,6] };// CAT this.rules[52].opcodes[1] = { type: 3, min: 0, max: 1 };// REP this.rules[52].opcodes[2] = { type: 2, children: [3,4] };// CAT this.rules[52].opcodes[3] = { type: 4, index: 53 };// RNM(userinfo-d) this.rules[52].opcodes[4] = { type: 6, string: [64] };// TBS this.rules[52].opcodes[5] = { type: 4, index: 54 };// RNM(host-d) this.rules[52].opcodes[6] = { type: 3, min: 0, max: 1 };// REP this.rules[52].opcodes[7] = { type: 2, children: [8,9] };// CAT this.rules[52].opcodes[8] = { type: 7, string: [58] };// TLS this.rules[52].opcodes[9] = { type: 4, index: 55 };// RNM(port-d) /* userinfo-d */ this.rules[53].opcodes = []; this.rules[53].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[53].opcodes[1] = { type: 1, children: [2,3,4,5,6,7,8,9,10,11,12] };// ALT this.rules[53].opcodes[2] = { type: 5, min: 97, max: 122 };// TRG this.rules[53].opcodes[3] = { type: 5, min: 65, max: 90 };// TRG this.rules[53].opcodes[4] = { type: 5, min: 48, max: 57 };// TRG this.rules[53].opcodes[5] = { type: 4, index: 63 };// RNM(pct-encoded) this.rules[53].opcodes[6] = { type: 6, string: [33] };// TBS this.rules[53].opcodes[7] = { type: 6, string: [36] };// TBS this.rules[53].opcodes[8] = { type: 5, min: 38, max: 46 };// TRG this.rules[53].opcodes[9] = { type: 5, min: 58, max: 59 };// TRG this.rules[53].opcodes[10] = { type: 6, string: [61] };// TBS this.rules[53].opcodes[11] = { type: 6, string: [95] };// TBS this.rules[53].opcodes[12] = { type: 6, string: [126] };// TBS /* host-d */ this.rules[54].opcodes = []; this.rules[54].opcodes[0] = { type: 1, children: [1,2,6] };// ALT this.rules[54].opcodes[1] = { type: 4, index: 30 };// RNM(IP-literal) this.rules[54].opcodes[2] = { type: 2, children: [3,4] };// CAT this.rules[54].opcodes[3] = { type: 4, index: 39 };// RNM(IPv4address) this.rules[54].opcodes[4] = { type: 13 };// NOT this.rules[54].opcodes[5] = { type: 4, index: 43 };// RNM(reg-name-char) this.rules[54].opcodes[6] = { type: 4, index: 42 };// RNM(reg-name) /* port-d */ this.rules[55].opcodes = []; this.rules[55].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[55].opcodes[1] = { type: 4, index: 79 };// RNM(DIGIT) /* path-abempty-r */ this.rules[56].opcodes = []; this.rules[56].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[56].opcodes[1] = { type: 2, children: [2,3] };// CAT this.rules[56].opcodes[2] = { type: 7, string: [47] };// TLS this.rules[56].opcodes[3] = { type: 4, index: 60 };// RNM(segment) /* path-absolute-r */ this.rules[57].opcodes = []; this.rules[57].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[57].opcodes[1] = { type: 7, string: [47] };// TLS this.rules[57].opcodes[2] = { type: 3, min: 0, max: 1 };// REP this.rules[57].opcodes[3] = { type: 2, children: [4,5] };// CAT this.rules[57].opcodes[4] = { type: 4, index: 61 };// RNM(segment-nz) this.rules[57].opcodes[5] = { type: 3, min: 0, max: Infinity };// REP this.rules[57].opcodes[6] = { type: 2, children: [7,8] };// CAT this.rules[57].opcodes[7] = { type: 7, string: [47] };// TLS this.rules[57].opcodes[8] = { type: 4, index: 60 };// RNM(segment) /* path-rootless-r */ this.rules[58].opcodes = []; this.rules[58].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[58].opcodes[1] = { type: 4, index: 61 };// RNM(segment-nz) this.rules[58].opcodes[2] = { type: 3, min: 0, max: Infinity };// REP this.rules[58].opcodes[3] = { type: 2, children: [4,5] };// CAT this.rules[58].opcodes[4] = { type: 7, string: [47] };// TLS this.rules[58].opcodes[5] = { type: 4, index: 60 };// RNM(segment) /* path-empty-r */ this.rules[59].opcodes = []; this.rules[59].opcodes[0] = { type: 7, string: [] };// TLS /* segment */ this.rules[60].opcodes = []; this.rules[60].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP this.rules[60].opcodes[1] = { type: 4, index: 62 };// RNM(pchar) /* segment-nz */ this.rules[61].opcodes = []; this.rules[61].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP this.rules[61].opcodes[1] = { type: 4, index: 62 };// RNM(pchar) /* pchar */ this.rules[62].opcodes = []; this.rules[62].opcodes[0] = { type: 1, children: [1,2,3,4,5,6,7,8,9,10,11,12] };// ALT this.rules[62].opcodes[1] = { type: 5, min: 97, max: 122 };// TRG this.rules[62].opcodes[2] = { type: 5, min: 65, max: 90 };// TRG this.rules[62].opcodes[3] = { type: 5, min: 48, max: 57 };// TRG this.rules[62].opcodes[4] = { type: 4, index: 63 };// RNM(pct-encoded) this.rules[62].opcodes[5] = { type: 6, string: [33] };// TBS this.rules[62].opcodes[6] = { type: 6, string: [36] };// TBS this.rules[62].opcodes[7] = { type: 5, min: 38, max: 46 };// TRG this.rules[62].opcodes[8] = { type: 5, min: 58, max: 59 };// TRG this.rules[62].opcodes[9] = { type: 6, string: [61] };// TBS this.rules[62].opcodes[10] = { type: 6, string: [64] };// TBS this.rules[62].opcodes[11] = { type: 6, string: [95] };// TBS this.rules[62].opcodes[12] = { type: 6, string: [126] };// TBS /* pct-encoded */ this.rules[63].opcodes = []; this.rules[63].opcodes[0] = { type: 2, children: [1,2,3] };// CAT this.rules[63].opcodes[1] = { type: 6, string: [37] };// TBS this.rules[63].opcodes[2] = { type: 4, index: 80 };// RNM(HEXDIG) this.rules[63].opcodes[3] = { type: 4, index: 80 };// RNM(HEXDIG) /* date-fullyear */ this.rules[64].opcodes = []; this.rules[64].opcodes[0] = { type: 3, min: 4, max: 4 };// REP this.rules[64].opcodes[1] = { type: 4, index: 79 };// RNM(DIGIT) /* date-month */ this.rules[65].opcodes = []; this.rules[65].opcodes[0] = { type: 3, min: 2, max: 2 };// REP this.rules[65].opcodes[1] = { type: 4, index: 79 };// RNM(DIGIT) /* date-mday */ this.rules[66].opcodes = []; this.rules[66].opcodes[0] = { type: 3, min: 2, max: 2 };// REP this.rules[66].opcodes[1] = { type: 4, index: 79 };// RNM(DIGIT) /* time-hour */ this.rules[67].opcodes = []; this.rules[67].opcodes[0] = { type: 3, min: 2, max: 2 };// REP this.rules[67].opcodes[1] = { type: 4, index: 79 };// RNM(DIGIT) /* time-minute */ this.rules[68].opcodes = []; this.rules[68].opcodes[0] = { type: 3, min: 2, max: 2 };// REP this.rules[68].opcodes[1] = { type: 4, index: 79 };// RNM(DIGIT) /* time-second */ this.rules[69].opcodes = []; this.rules[69].opcodes[0] = { type: 3, min: 2, max: 2 };// REP this.rules[69].opcodes[1] = { type: 4, index: 79 };// RNM(DIGIT) /* time-secfrac */ this.rules[70].opcodes = []; this.rules[70].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[70].opcodes[1] = { type: 7, string: [46] };// TLS this.rules[70].opcodes[2] = { type: 3, min: 1, max: Infinity };// REP this.rules[70].opcodes[3] = { type: 4, index: 79 };// RNM(DIGIT) /* time-numoffset */ this.rules[71].opcodes = []; this.rules[71].opcodes[0] = { type: 2, children: [1,4,5,6] };// CAT this.rules[71].opcodes[1] = { type: 1, children: [2,3] };// ALT this.rules[71].opcodes[2] = { type: 7, string: [43] };// TLS this.rules[71].opcodes[3] = { type: 7, string: [45] };// TLS this.rules[71].opcodes[4] = { type: 4, index: 67 };// RNM(time-hour) this.rules[71].opcodes[5] = { type: 7, string: [58] };// TLS this.rules[71].opcodes[6] = { type: 4, index: 68 };// RNM(time-minute) /* time-offset */ this.rules[72].opcodes = []; this.rules[72].opcodes[0] = { type: 1, children: [1,2] };// ALT this.rules[72].opcodes[1] = { type: 7, string: [122] };// TLS this.rules[72].opcodes[2] = { type: 4, index: 71 };// RNM(time-numoffset) /* partial-time */ this.rules[73].opcodes = []; this.rules[73].opcodes[0] = { type: 2, children: [1,2,3,4,5,6] };// CAT this.rules[73].opcodes[1] = { type: 4, index: 67 };// RNM(time-hour) this.rules[73].opcodes[2] = { type: 7, string: [58] };// TLS this.rules[73].opcodes[3] = { type: 4, index: 68 };// RNM(time-minute) this.rules[73].opcodes[4] = { type: 7, string: [58] };// TLS this.rules[73].opcodes[5] = { type: 4, index: 69 };// RNM(time-second) this.rules[73].opcodes[6] = { type: 3, min: 0, max: 1 };// REP this.rules[73].opcodes[7] = { type: 4, index: 70 };// RNM(time-secfrac) /* full-date */ this.rules[74].opcodes = []; this.rules[74].opcodes[0] = { type: 2, children: [1,2,3,4,5] };// CAT this.rules[74].opcodes[1] = { type: 4, index: 64 };// RNM(date-fullyear) this.rules[74].opcodes[2] = { type: 7, string: [45] };// TLS this.rules[74].opcodes[3] = { type: 4, index: 65 };// RNM(date-month) this.rules[74].opcodes[4] = { type: 7, string: [45] };// TLS this.rules[74].opcodes[5] = { type: 4, index: 66 };// RNM(date-mday) /* full-time */ this.rules[75].opcodes = []; this.rules[75].opcodes[0] = { type: 2, children: [1,2] };// CAT this.rules[75].opcodes[1] = { type: 4, index: 73 };// RNM(partial-time) this.rules[75].opcodes[2] = { type: 4, index: 72 };// RNM(time-offset) /* date-time */ this.rules[76].opcodes = []; this.rules[76].opcodes[0] = { type: 2, children: [1,2,3] };// CAT this.rules[76].opcodes[1] = { type: 4, index: 74 };// RNM(full-date) this.rules[76].opcodes[2] = { type: 7, string: [116] };// TLS this.rules[76].opcodes[3] = { type: 4, index: 75 };// RNM(full-time) /* ALPHA */ this.rules[77].opcodes = []; this.rules[77].opcodes[0] = { type: 1, children: [1,2] };// ALT this.rules[77].opcodes[1] = { type: 5, min: 65, max: 90 };// TRG this.rules[77].opcodes[2] = { type: 5, min: 97, max: 122 };// TRG /* LF */ this.rules[78].opcodes = []; this.rules[78].opcodes[0] = { type: 6, string: [10] };// TBS /* DIGIT */ this.rules[79].opcodes = []; this.rules[79].opcodes[0] = { type: 5, min: 48, max: 57 };// TRG /* HEXDIG */ this.rules[80].opcodes = []; this.rules[80].opcodes[0] = { type: 1, children: [1,2,3] };// ALT this.rules[80].opcodes[1] = { type: 5, min: 48, max: 57 };// TRG this.rules[80].opcodes[2] = { type: 5, min: 65, max: 70 };// TRG this.rules[80].opcodes[3] = { type: 5, min: 97, max: 102 };// TRG // The `toString()` function will display the original grammar file(s) that produced these opcodes. this.toString = function toString(){ let str = ""; str += "; LDT 05/06/2024 \r\n"; str += "; modified in several significant ways\r\n"; str += "; 1) Literal strings are replaced with numbers and ranges (%d32 & %d32-126, etc.) when possible.\r\n"; str += "; TRB and especially TRG operators are much more efficient than TLS operators.\r\n"; str += "; 2) Two rules, authority and URI, are used multiple times in different contexts. These rules will be reproduced and renamed\r\n"; str += "; in order to a) recognize the context and b) remove unneccary callback functions for certain contexts.\r\n"; str += "; This will simiplify recognizing contexts AND remove unneccesary callbacks\r\n"; str += "; 2.a) domain is defined as authority-d which is identical to authority except that there will be no\r\n"; str += "; callback functions defined on authority-d or any of its *-d components.\r\n"; str += "; 2.b) The resource URI is defined as URI-r and its components defined as *-r.\r\n"; str += "; In this way, callback functions can be defined on URI and is components while\r\n"; str += "; leaving URI-r to be parsed identically with no unnecessary callback functions to slow it down.\r\n"; str += "; 3) IPv6address does not work because of APG's \"first-success disambiguation\" and \"greedy\" repetitions.\r\n"; str += "; IPv6address redefined and validations moved to callback functions (semantic vs syntactic validation)\r\n"; str += "; Redefinition requires negative look-ahead operators, https://en.wikipedia.org/wiki/Syntactic_predicate\r\n"; str += "; That is SABNF instead of simple ABNF.\r\n"; str += "; 4) IPv4address fails because of \"first-success disambiguation\".\r\n"; str += "; This could be fixed with rearrangement of the alternative terms. However, it would still not\r\n"; str += "; accept zero-padded (leading zeros) decimal octets.\r\n"; str += "; Therefore, IPv4address is also done with callback functions and semantic validation.\r\n"; str += "; 5) The negative look-ahead operator is also needed in the definition of host to\r\n"; str += "; prevent failure with a reg-name that begins with an IPv4 address.\r\n"; str += "; 6) NOTE: host = 1.1.1.256 is a valid host name even though it is an invalid IPv4address.\r\n"; str += "; The IPv4address alternative fails but the reg-name alternative succeeds.\r\n"; str += "; 7) The Ethereum spec (https://eips.ethereum.org/EIPS/eip-4361) message format ABNF\r\n"; str += "; allows for empty statements. Because of the \"first success disambiguation\" of APG\r\n"; str += "; the an explicit \"empty-statement\" rule is required to match the spec's intent.\r\n"; str += "\r\n"; str += "\r\n"; str += "sign-in-with-ethereum =\r\n"; str += " oscheme domain %s\" wants you to sign in with your Ethereum account:\" LF\r\n"; str += " address LF\r\n"; str += " ((LF statement LF LF) / empty-statement / (LF LF))\r\n"; str += " %s\"URI: \" URI LF\r\n"; str += " %s\"Version: \" version LF\r\n"; str += " %s\"Chain ID: \" chain-id LF\r\n"; str += " %s\"Nonce: \" nonce LF\r\n"; str += " %s\"Issued At: \" issued-at\r\n"; str += " [ LF ex-title expiration-time ]\r\n"; str += " [ LF nb-title not-before ]\r\n"; str += " [ LF ri-title request-id ]\r\n"; str += " [ LF re-title resources ]\r\n"; str += "ex-title = %s\"Expiration Time: \"\r\n"; str += "nb-title = %s\"Not Before: \"\r\n"; str += "ri-title = %s\"Request ID: \"\r\n"; str += "re-title = %s\"Resources:\"\r\n"; str += "oscheme = [ ALPHA *( ALPHA / DIGIT / %d43 / %d45-46 ) \"://\" ]\r\n"; str += "domain = authority-d\r\n"; str += "address = \"0x\" 40*40HEXDIG\r\n"; str += " ; Must also conform to captilization\r\n"; str += " ; checksum encoding specified in EIP-55\r\n"; str += " ; where applicable (EOAs).\r\n"; str += "\r\n"; str += "statement = 1*( %d97-122 / %d65-90 / %d48-57 / %d32-33 / %d35-36 / %d38-59 / %d61 / %d63-64 / %d91 / %d93 / %d95 / %d126)\r\n"; str += " ; The purpose is to exclude LF (line breaks).\r\n"; str += " ; LDT 10/04/2023: Do you mean %d32-126? All printing characters\r\n"; str += "empty-statement = LF LF LF\r\n"; str += "version = \"1\"\r\n"; str += "nonce = 8*( ALPHA / DIGIT )\r\n"; str += "issued-at = date-time\r\n"; str += "expiration-time = date-time\r\n"; str += "not-before = date-time\r\n"; str += "request-id = *pchar\r\n"; str += "chain-id = 1*DIGIT\r\n"; str += " ; See EIP-155 for valid CHAIN_IDs.\r\n"; str += "resources = *( LF resource )\r\n"; str += "resource = \"- \" URI-r\r\n"; str += "\r\n"; str += "; ------------------------------------------------------------------------------\r\n"; str += "; RFC 3986\r\n"; str += "\r\n"; str += "URI = scheme \":\" hier-part [ \"?\" query ] [ \"#\" fragment ]\r\n"; str += "hier-part = \"//\" authority path-abempty\r\n"; str += " / path-absolute\r\n"; str += " / path-rootless\r\n"; str += " / path-empty\r\n"; str += "scheme = ALPHA *( ALPHA / DIGIT / %d43 / %d45-46 )\r\n"; str += "authority = [ userinfo-at ] host [ \":\" port ]\r\n"; str += "path-abempty = *( \"/\" segment )\r\n"; str += "path-absolute = \"/\" [ segment-nz *( \"/\" segment ) ]\r\n"; str += "path-rootless = segment-nz *( \"/\" segment )\r\n"; str += "path-empty = \"\"\r\n"; str += "userinfo-at = userinfo %d64\r\n"; str += " ; userinfo redefined to include the \"@\" so that it will fail without it\r\n"; str += " ; otherwise userinfo can match host and then the parser will backtrack\r\n"; str += " ; incorrectly keeping the captured userinfo phrase\r\n"; str += "userinfo = *(%d97-122 / %d65-90 / %d48-57 / pct-encoded / %d33 / %d36 / %d38-46 / %d58-59 / %d61 / %d95 / %d126)\r\n"; str