parse-siwe
Version:
Standalone, high-performance, validating 'ERC-4361: Sign in with Ethereum' Parser
924 lines (838 loc) • 53.9 kB
JavaScript
// 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 default function grammar(){
// ```
// SUMMARY
// rules = 83
// udts = 0
// opcodes = 447
// --- ABNF original opcodes
// ALT = 43
// CAT = 48
// REP = 63
// RNM = 94
// TLS = 7
// TBS = 94
// TRG = 95
// --- SABNF superset opcodes
// UDT = 0
// AND = 0
// NOT = 3
// characters = [0 - 127]
// ```
/* OBJECT IDENTIFIER (for internal parser use) */
this.grammarObject = 'grammarObject';
/* RULES */
this.rules = [];
this.rules[0] = { name: 'siwe-first-pass', lower: 'siwe-first-pass', index: 0, isBkr: false };
this.rules[1] = { name: 'pre-uri', lower: 'pre-uri', index: 1, isBkr: false };
this.rules[2] = { name: 'pre-version', lower: 'pre-version', index: 2, isBkr: false };
this.rules[3] = { name: 'pre-chain-id', lower: 'pre-chain-id', index: 3, isBkr: false };
this.rules[4] = { name: 'pre-nonce', lower: 'pre-nonce', index: 4, isBkr: false };
this.rules[5] = { name: 'pre-issued-at', lower: 'pre-issued-at', index: 5, isBkr: false };
this.rules[6] = { name: 'ffscheme', lower: 'ffscheme', index: 6, isBkr: false };
this.rules[7] = { name: 'fdomain', lower: 'fdomain', index: 7, isBkr: false };
this.rules[8] = { name: 'fissued-at', lower: 'fissued-at', index: 8, isBkr: false };
this.rules[9] = { name: 'fexpiration-time', lower: 'fexpiration-time', index: 9, isBkr: false };
this.rules[10] = { name: 'fnot-before', lower: 'fnot-before', index: 10, isBkr: false };
this.rules[11] = { name: 'furi', lower: 'furi', index: 11, isBkr: false };
this.rules[12] = { name: 'fscheme', lower: 'fscheme', index: 12, isBkr: false };
this.rules[13] = { name: 'faddress', lower: 'faddress', index: 13, isBkr: false };
this.rules[14] = { name: 'fstatement', lower: 'fstatement', index: 14, isBkr: false };
this.rules[15] = { name: 'fversion', lower: 'fversion', index: 15, isBkr: false };
this.rules[16] = { name: 'fchain-id', lower: 'fchain-id', index: 16, isBkr: false };
this.rules[17] = { name: 'fnonce', lower: 'fnonce', index: 17, isBkr: false };
this.rules[18] = { name: 'frequest-id', lower: 'frequest-id', index: 18, isBkr: false };
this.rules[19] = { name: 'fresources', lower: 'fresources', index: 19, isBkr: false };
this.rules[20] = { name: 'fresource', lower: 'fresource', index: 20, isBkr: false };
this.rules[21] = { name: 'no-statement', lower: 'no-statement', index: 21, isBkr: false };
this.rules[22] = { name: 'empty-statement', lower: 'empty-statement', index: 22, isBkr: false };
this.rules[23] = { name: 'actual-statement', lower: 'actual-statement', index: 23, isBkr: false };
this.rules[24] = { name: 'domain', lower: 'domain', index: 24, isBkr: false };
this.rules[25] = { name: 'address', lower: 'address', index: 25, isBkr: false };
this.rules[26] = { name: 'statement', lower: 'statement', index: 26, isBkr: false };
this.rules[27] = { name: 'version', lower: 'version', index: 27, isBkr: false };
this.rules[28] = { name: 'chain-id', lower: 'chain-id', index: 28, isBkr: false };
this.rules[29] = { name: 'nonce', lower: 'nonce', index: 29, isBkr: false };
this.rules[30] = { name: 'issued-at', lower: 'issued-at', index: 30, isBkr: false };
this.rules[31] = { name: 'expiration-time', lower: 'expiration-time', index: 31, isBkr: false };
this.rules[32] = { name: 'not-before', lower: 'not-before', index: 32, isBkr: false };
this.rules[33] = { name: 'request-id', lower: 'request-id', index: 33, isBkr: false };
this.rules[34] = { name: 'resources', lower: 'resources', index: 34, isBkr: false };
this.rules[35] = { name: 'resource', lower: 'resource', index: 35, isBkr: false };
this.rules[36] = { name: 'date-fullyear', lower: 'date-fullyear', index: 36, isBkr: false };
this.rules[37] = { name: 'date-month', lower: 'date-month', index: 37, isBkr: false };
this.rules[38] = { name: 'date-mday', lower: 'date-mday', index: 38, isBkr: false };
this.rules[39] = { name: 'time-hour', lower: 'time-hour', index: 39, isBkr: false };
this.rules[40] = { name: 'time-minute', lower: 'time-minute', index: 40, isBkr: false };
this.rules[41] = { name: 'time-second', lower: 'time-second', index: 41, isBkr: false };
this.rules[42] = { name: 'time-secfrac', lower: 'time-secfrac', index: 42, isBkr: false };
this.rules[43] = { name: 'time-numoffset', lower: 'time-numoffset', index: 43, isBkr: false };
this.rules[44] = { name: 'time-offset', lower: 'time-offset', index: 44, isBkr: false };
this.rules[45] = { name: 'partial-time', lower: 'partial-time', index: 45, isBkr: false };
this.rules[46] = { name: 'full-date', lower: 'full-date', index: 46, isBkr: false };
this.rules[47] = { name: 'full-time', lower: 'full-time', index: 47, isBkr: false };
this.rules[48] = { name: 'date-time', lower: 'date-time', index: 48, isBkr: false };
this.rules[49] = { name: 'URI', lower: 'uri', index: 49, isBkr: false };
this.rules[50] = { name: 'hier-part', lower: 'hier-part', index: 50, isBkr: false };
this.rules[51] = { name: 'authority', lower: 'authority', index: 51, isBkr: false };
this.rules[52] = { name: 'path-abempty', lower: 'path-abempty', index: 52, isBkr: false };
this.rules[53] = { name: 'path-absolute', lower: 'path-absolute', index: 53, isBkr: false };
this.rules[54] = { name: 'path-rootless', lower: 'path-rootless', index: 54, isBkr: false };
this.rules[55] = { name: 'path-empty', lower: 'path-empty', index: 55, isBkr: false };
this.rules[56] = { name: 'userinfo-at', lower: 'userinfo-at', index: 56, isBkr: false };
this.rules[57] = { name: 'userinfo', lower: 'userinfo', index: 57, isBkr: false };
this.rules[58] = { name: 'host', lower: 'host', index: 58, isBkr: false };
this.rules[59] = { name: 'IP-literal', lower: 'ip-literal', index: 59, isBkr: false };
this.rules[60] = { name: 'IPvFuture', lower: 'ipvfuture', index: 60, isBkr: false };
this.rules[61] = { name: 'IPv6address', lower: 'ipv6address', index: 61, isBkr: false };
this.rules[62] = { name: 'nodcolon', lower: 'nodcolon', index: 62, isBkr: false };
this.rules[63] = { name: 'dcolon', lower: 'dcolon', index: 63, isBkr: false };
this.rules[64] = { name: 'h16', lower: 'h16', index: 64, isBkr: false };
this.rules[65] = { name: 'h16c', lower: 'h16c', index: 65, isBkr: false };
this.rules[66] = { name: 'h16n', lower: 'h16n', index: 66, isBkr: false };
this.rules[67] = { name: 'h16cn', lower: 'h16cn', index: 67, isBkr: false };
this.rules[68] = { name: 'IPv4address', lower: 'ipv4address', index: 68, isBkr: false };
this.rules[69] = { name: 'dec-octet', lower: 'dec-octet', index: 69, isBkr: false };
this.rules[70] = { name: 'dec-digit', lower: 'dec-digit', index: 70, isBkr: false };
this.rules[71] = { name: 'reg-name', lower: 'reg-name', index: 71, isBkr: false };
this.rules[72] = { name: 'reg-name-char', lower: 'reg-name-char', index: 72, isBkr: false };
this.rules[73] = { name: 'port', lower: 'port', index: 73, isBkr: false };
this.rules[74] = { name: 'query', lower: 'query', index: 74, isBkr: false };
this.rules[75] = { name: 'fragment', lower: 'fragment', index: 75, isBkr: false };
this.rules[76] = { name: 'segment', lower: 'segment', index: 76, isBkr: false };
this.rules[77] = { name: 'segment-nz', lower: 'segment-nz', index: 77, isBkr: false };
this.rules[78] = { name: 'scheme', lower: 'scheme', index: 78, isBkr: false };
this.rules[79] = { name: 'pchar', lower: 'pchar', index: 79, isBkr: false };
this.rules[80] = { name: 'pct-encoded', lower: 'pct-encoded', index: 80, isBkr: false };
this.rules[81] = { name: 'unreserved', lower: 'unreserved', index: 81, isBkr: false };
this.rules[82] = { name: 'reserved', lower: 'reserved', index: 82, isBkr: false };
/* UDTS */
this.udts = [];
/* OPCODES */
/* siwe-first-pass */
this.rules[0].opcodes = [];
this.rules[0].opcodes[0] = { type: 2, children: [1,3,4,5,6,7,8,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,31,36,41] };// CAT
this.rules[0].opcodes[1] = { type: 3, min: 0, max: 1 };// REP
this.rules[0].opcodes[2] = { type: 4, index: 6 };// RNM(ffscheme)
this.rules[0].opcodes[3] = { type: 4, index: 7 };// RNM(fdomain)
this.rules[0].opcodes[4] = { 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[5] = { type: 6, string: [10] };// TBS
this.rules[0].opcodes[6] = { type: 4, index: 13 };// RNM(faddress)
this.rules[0].opcodes[7] = { type: 6, string: [10] };// TBS
this.rules[0].opcodes[8] = { type: 1, children: [9,10,11] };// ALT
this.rules[0].opcodes[9] = { type: 4, index: 22 };// RNM(empty-statement)
this.rules[0].opcodes[10] = { type: 4, index: 21 };// RNM(no-statement)
this.rules[0].opcodes[11] = { type: 4, index: 23 };// RNM(actual-statement)
this.rules[0].opcodes[12] = { type: 4, index: 1 };// RNM(pre-uri)
this.rules[0].opcodes[13] = { type: 4, index: 11 };// RNM(furi)
this.rules[0].opcodes[14] = { type: 6, string: [10] };// TBS
this.rules[0].opcodes[15] = { type: 4, index: 2 };// RNM(pre-version)
this.rules[0].opcodes[16] = { type: 4, index: 15 };// RNM(fversion)
this.rules[0].opcodes[17] = { type: 6, string: [10] };// TBS
this.rules[0].opcodes[18] = { type: 4, index: 3 };// RNM(pre-chain-id)
this.rules[0].opcodes[19] = { type: 4, index: 16 };// RNM(fchain-id)
this.rules[0].opcodes[20] = { type: 6, string: [10] };// TBS
this.rules[0].opcodes[21] = { type: 4, index: 4 };// RNM(pre-nonce)
this.rules[0].opcodes[22] = { type: 4, index: 17 };// RNM(fnonce)
this.rules[0].opcodes[23] = { type: 6, string: [10] };// TBS
this.rules[0].opcodes[24] = { type: 4, index: 5 };// RNM(pre-issued-at)
this.rules[0].opcodes[25] = { type: 4, index: 8 };// RNM(fissued-at)
this.rules[0].opcodes[26] = { type: 3, min: 0, max: 1 };// REP
this.rules[0].opcodes[27] = { type: 2, children: [28,29,30] };// CAT
this.rules[0].opcodes[28] = { type: 6, string: [10] };// TBS
this.rules[0].opcodes[29] = { type: 6, string: [69,120,112,105,114,97,116,105,111,110,32,84,105,109,101,58,32] };// TBS
this.rules[0].opcodes[30] = { type: 4, index: 9 };// RNM(fexpiration-time)
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: 6, string: [10] };// TBS
this.rules[0].opcodes[34] = { type: 6, string: [78,111,116,32,66,101,102,111,114,101,58,32] };// TBS
this.rules[0].opcodes[35] = { type: 4, index: 10 };// RNM(fnot-before)
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: 6, string: [10] };// TBS
this.rules[0].opcodes[39] = { type: 6, string: [82,101,113,117,101,115,116,32,73,68,58,32] };// TBS
this.rules[0].opcodes[40] = { type: 4, index: 18 };// RNM(frequest-id)
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: 6, string: [10] };// TBS
this.rules[0].opcodes[44] = { type: 6, string: [82,101,115,111,117,114,99,101,115,58] };// TBS
this.rules[0].opcodes[45] = { type: 4, index: 19 };// RNM(fresources)
/* pre-uri */
this.rules[1].opcodes = [];
this.rules[1].opcodes[0] = { type: 6, string: [85,82,73,58,32] };// TBS
/* pre-version */
this.rules[2].opcodes = [];
this.rules[2].opcodes[0] = { type: 6, string: [86,101,114,115,105,111,110,58,32] };// TBS
/* pre-chain-id */
this.rules[3].opcodes = [];
this.rules[3].opcodes[0] = { type: 6, string: [67,104,97,105,110,32,73,68,58,32] };// TBS
/* pre-nonce */
this.rules[4].opcodes = [];
this.rules[4].opcodes[0] = { type: 6, string: [78,111,110,99,101,58,32] };// TBS
/* pre-issued-at */
this.rules[5].opcodes = [];
this.rules[5].opcodes[0] = { type: 6, string: [73,115,115,117,101,100,32,65,116,58,32] };// TBS
/* ffscheme */
this.rules[6].opcodes = [];
this.rules[6].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[6].opcodes[1] = { type: 4, index: 12 };// RNM(fscheme)
this.rules[6].opcodes[2] = { type: 6, string: [58,47,47] };// TBS
/* fdomain */
this.rules[7].opcodes = [];
this.rules[7].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[7].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[7].opcodes[2] = { type: 5, min: 0, max: 31 };// TRG
this.rules[7].opcodes[3] = { type: 5, min: 33, max: 127 };// TRG
/* fissued-at */
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] };// ALT
this.rules[8].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[8].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* fexpiration-time */
this.rules[9].opcodes = [];
this.rules[9].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[9].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[9].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[9].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* fnot-before */
this.rules[10].opcodes = [];
this.rules[10].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[10].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[10].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[10].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* furi */
this.rules[11].opcodes = [];
this.rules[11].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[11].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[11].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[11].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* fscheme */
this.rules[12].opcodes = [];
this.rules[12].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[12].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[12].opcodes[2] = { type: 5, min: 0, max: 57 };// TRG
this.rules[12].opcodes[3] = { type: 5, min: 59, max: 127 };// TRG
/* faddress */
this.rules[13].opcodes = [];
this.rules[13].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[13].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[13].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[13].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* fstatement */
this.rules[14].opcodes = [];
this.rules[14].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[14].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[14].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[14].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* fversion */
this.rules[15].opcodes = [];
this.rules[15].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[15].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[15].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[15].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* fchain-id */
this.rules[16].opcodes = [];
this.rules[16].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[16].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[16].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[16].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* fnonce */
this.rules[17].opcodes = [];
this.rules[17].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[17].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[17].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[17].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* frequest-id */
this.rules[18].opcodes = [];
this.rules[18].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[18].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[18].opcodes[2] = { type: 5, min: 0, max: 9 };// TRG
this.rules[18].opcodes[3] = { type: 5, min: 11, max: 127 };// TRG
/* fresources */
this.rules[19].opcodes = [];
this.rules[19].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[19].opcodes[1] = { type: 2, children: [2,3] };// CAT
this.rules[19].opcodes[2] = { type: 6, string: [10] };// TBS
this.rules[19].opcodes[3] = { type: 4, index: 20 };// RNM(fresource)
/* fresource */
this.rules[20].opcodes = [];
this.rules[20].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[20].opcodes[1] = { type: 7, string: [45,32] };// TLS
this.rules[20].opcodes[2] = { type: 3, min: 1, max: Infinity };// REP
this.rules[20].opcodes[3] = { type: 1, children: [4,5] };// ALT
this.rules[20].opcodes[4] = { type: 5, min: 0, max: 9 };// TRG
this.rules[20].opcodes[5] = { type: 5, min: 11, max: 127 };// TRG
/* no-statement */
this.rules[21].opcodes = [];
this.rules[21].opcodes[0] = { type: 6, string: [10,10] };// TBS
/* empty-statement */
this.rules[22].opcodes = [];
this.rules[22].opcodes[0] = { type: 6, string: [10,10,10] };// TBS
/* actual-statement */
this.rules[23].opcodes = [];
this.rules[23].opcodes[0] = { type: 2, children: [1,2,3] };// CAT
this.rules[23].opcodes[1] = { type: 6, string: [10] };// TBS
this.rules[23].opcodes[2] = { type: 4, index: 14 };// RNM(fstatement)
this.rules[23].opcodes[3] = { type: 6, string: [10,10] };// TBS
/* domain */
this.rules[24].opcodes = [];
this.rules[24].opcodes[0] = { type: 4, index: 51 };// RNM(authority)
/* address */
this.rules[25].opcodes = [];
this.rules[25].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[25].opcodes[1] = { type: 6, string: [48,120] };// TBS
this.rules[25].opcodes[2] = { type: 3, min: 40, max: 40 };// REP
this.rules[25].opcodes[3] = { type: 1, children: [4,5,6] };// ALT
this.rules[25].opcodes[4] = { type: 5, min: 48, max: 57 };// TRG
this.rules[25].opcodes[5] = { type: 5, min: 65, max: 70 };// TRG
this.rules[25].opcodes[6] = { type: 5, min: 97, max: 102 };// TRG
/* statement */
this.rules[26].opcodes = [];
this.rules[26].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[26].opcodes[1] = { type: 1, children: [2,3,4] };// ALT
this.rules[26].opcodes[2] = { type: 4, index: 82 };// RNM(reserved)
this.rules[26].opcodes[3] = { type: 4, index: 81 };// RNM(unreserved)
this.rules[26].opcodes[4] = { type: 7, string: [32] };// TLS
/* version */
this.rules[27].opcodes = [];
this.rules[27].opcodes[0] = { type: 6, string: [49] };// TBS
/* chain-id */
this.rules[28].opcodes = [];
this.rules[28].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[28].opcodes[1] = { type: 5, min: 48, max: 57 };// TRG
/* nonce */
this.rules[29].opcodes = [];
this.rules[29].opcodes[0] = { type: 3, min: 8, max: Infinity };// REP
this.rules[29].opcodes[1] = { type: 1, children: [2,5] };// ALT
this.rules[29].opcodes[2] = { type: 1, children: [3,4] };// ALT
this.rules[29].opcodes[3] = { type: 5, min: 97, max: 122 };// TRG
this.rules[29].opcodes[4] = { type: 5, min: 65, max: 90 };// TRG
this.rules[29].opcodes[5] = { type: 5, min: 48, max: 57 };// TRG
/* issued-at */
this.rules[30].opcodes = [];
this.rules[30].opcodes[0] = { type: 4, index: 48 };// RNM(date-time)
/* expiration-time */
this.rules[31].opcodes = [];
this.rules[31].opcodes[0] = { type: 4, index: 48 };// RNM(date-time)
/* not-before */
this.rules[32].opcodes = [];
this.rules[32].opcodes[0] = { type: 4, index: 48 };// RNM(date-time)
/* request-id */
this.rules[33].opcodes = [];
this.rules[33].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[33].opcodes[1] = { type: 4, index: 79 };// RNM(pchar)
/* resources */
this.rules[34].opcodes = [];
this.rules[34].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[34].opcodes[1] = { type: 2, children: [2,3] };// CAT
this.rules[34].opcodes[2] = { type: 6, string: [10] };// TBS
this.rules[34].opcodes[3] = { type: 4, index: 35 };// RNM(resource)
/* resource */
this.rules[35].opcodes = [];
this.rules[35].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[35].opcodes[1] = { type: 6, string: [45,32] };// TBS
this.rules[35].opcodes[2] = { type: 4, index: 49 };// RNM(URI)
/* date-fullyear */
this.rules[36].opcodes = [];
this.rules[36].opcodes[0] = { type: 3, min: 4, max: 4 };// REP
this.rules[36].opcodes[1] = { type: 5, min: 48, max: 57 };// TRG
/* date-month */
this.rules[37].opcodes = [];
this.rules[37].opcodes[0] = { type: 3, min: 2, max: 2 };// REP
this.rules[37].opcodes[1] = { type: 5, min: 48, max: 57 };// TRG
/* date-mday */
this.rules[38].opcodes = [];
this.rules[38].opcodes[0] = { type: 3, min: 2, max: 2 };// REP
this.rules[38].opcodes[1] = { type: 5, min: 48, max: 57 };// TRG
/* time-hour */
this.rules[39].opcodes = [];
this.rules[39].opcodes[0] = { type: 3, min: 2, max: 2 };// REP
this.rules[39].opcodes[1] = { type: 5, min: 48, max: 57 };// TRG
/* time-minute */
this.rules[40].opcodes = [];
this.rules[40].opcodes[0] = { type: 3, min: 2, max: 2 };// REP
this.rules[40].opcodes[1] = { type: 5, min: 48, max: 57 };// TRG
/* time-second */
this.rules[41].opcodes = [];
this.rules[41].opcodes[0] = { type: 3, min: 2, max: 2 };// REP
this.rules[41].opcodes[1] = { type: 5, min: 48, max: 57 };// TRG
/* time-secfrac */
this.rules[42].opcodes = [];
this.rules[42].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[42].opcodes[1] = { type: 6, string: [46] };// TBS
this.rules[42].opcodes[2] = { type: 3, min: 1, max: Infinity };// REP
this.rules[42].opcodes[3] = { type: 5, min: 48, max: 57 };// TRG
/* time-numoffset */
this.rules[43].opcodes = [];
this.rules[43].opcodes[0] = { type: 2, children: [1,4,5,6] };// CAT
this.rules[43].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[43].opcodes[2] = { type: 6, string: [43] };// TBS
this.rules[43].opcodes[3] = { type: 6, string: [45] };// TBS
this.rules[43].opcodes[4] = { type: 4, index: 39 };// RNM(time-hour)
this.rules[43].opcodes[5] = { type: 6, string: [58] };// TBS
this.rules[43].opcodes[6] = { type: 4, index: 40 };// RNM(time-minute)
/* time-offset */
this.rules[44].opcodes = [];
this.rules[44].opcodes[0] = { type: 1, children: [1,2] };// ALT
this.rules[44].opcodes[1] = { type: 7, string: [122] };// TLS
this.rules[44].opcodes[2] = { type: 4, index: 43 };// RNM(time-numoffset)
/* partial-time */
this.rules[45].opcodes = [];
this.rules[45].opcodes[0] = { type: 2, children: [1,2,3,4,5,6] };// CAT
this.rules[45].opcodes[1] = { type: 4, index: 39 };// RNM(time-hour)
this.rules[45].opcodes[2] = { type: 6, string: [58] };// TBS
this.rules[45].opcodes[3] = { type: 4, index: 40 };// RNM(time-minute)
this.rules[45].opcodes[4] = { type: 6, string: [58] };// TBS
this.rules[45].opcodes[5] = { type: 4, index: 41 };// RNM(time-second)
this.rules[45].opcodes[6] = { type: 3, min: 0, max: 1 };// REP
this.rules[45].opcodes[7] = { type: 4, index: 42 };// RNM(time-secfrac)
/* full-date */
this.rules[46].opcodes = [];
this.rules[46].opcodes[0] = { type: 2, children: [1,2,3,4,5] };// CAT
this.rules[46].opcodes[1] = { type: 4, index: 36 };// RNM(date-fullyear)
this.rules[46].opcodes[2] = { type: 6, string: [45] };// TBS
this.rules[46].opcodes[3] = { type: 4, index: 37 };// RNM(date-month)
this.rules[46].opcodes[4] = { type: 6, string: [45] };// TBS
this.rules[46].opcodes[5] = { type: 4, index: 38 };// RNM(date-mday)
/* full-time */
this.rules[47].opcodes = [];
this.rules[47].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[47].opcodes[1] = { type: 4, index: 45 };// RNM(partial-time)
this.rules[47].opcodes[2] = { type: 4, index: 44 };// RNM(time-offset)
/* date-time */
this.rules[48].opcodes = [];
this.rules[48].opcodes[0] = { type: 2, children: [1,2,3] };// CAT
this.rules[48].opcodes[1] = { type: 4, index: 46 };// RNM(full-date)
this.rules[48].opcodes[2] = { type: 7, string: [116] };// TLS
this.rules[48].opcodes[3] = { type: 4, index: 47 };// RNM(full-time)
/* URI */
this.rules[49].opcodes = [];
this.rules[49].opcodes[0] = { type: 2, children: [1,2,3,4,8] };// CAT
this.rules[49].opcodes[1] = { type: 4, index: 78 };// RNM(scheme)
this.rules[49].opcodes[2] = { type: 6, string: [58] };// TBS
this.rules[49].opcodes[3] = { type: 4, index: 50 };// RNM(hier-part)
this.rules[49].opcodes[4] = { type: 3, min: 0, max: 1 };// REP
this.rules[49].opcodes[5] = { type: 2, children: [6,7] };// CAT
this.rules[49].opcodes[6] = { type: 6, string: [63] };// TBS
this.rules[49].opcodes[7] = { type: 4, index: 74 };// RNM(query)
this.rules[49].opcodes[8] = { type: 3, min: 0, max: 1 };// REP
this.rules[49].opcodes[9] = { type: 2, children: [10,11] };// CAT
this.rules[49].opcodes[10] = { type: 6, string: [35] };// TBS
this.rules[49].opcodes[11] = { type: 4, index: 75 };// RNM(fragment)
/* hier-part */
this.rules[50].opcodes = [];
this.rules[50].opcodes[0] = { type: 1, children: [1,5,6,7] };// ALT
this.rules[50].opcodes[1] = { type: 2, children: [2,3,4] };// CAT
this.rules[50].opcodes[2] = { type: 6, string: [47,47] };// TBS
this.rules[50].opcodes[3] = { type: 4, index: 51 };// RNM(authority)
this.rules[50].opcodes[4] = { type: 4, index: 52 };// RNM(path-abempty)
this.rules[50].opcodes[5] = { type: 4, index: 53 };// RNM(path-absolute)
this.rules[50].opcodes[6] = { type: 4, index: 54 };// RNM(path-rootless)
this.rules[50].opcodes[7] = { type: 4, index: 55 };// RNM(path-empty)
/* authority */
this.rules[51].opcodes = [];
this.rules[51].opcodes[0] = { type: 2, children: [1,3,4] };// CAT
this.rules[51].opcodes[1] = { type: 3, min: 0, max: 1 };// REP
this.rules[51].opcodes[2] = { type: 4, index: 56 };// RNM(userinfo-at)
this.rules[51].opcodes[3] = { type: 4, index: 58 };// RNM(host)
this.rules[51].opcodes[4] = { type: 3, min: 0, max: 1 };// REP
this.rules[51].opcodes[5] = { type: 2, children: [6,7] };// CAT
this.rules[51].opcodes[6] = { type: 6, string: [58] };// TBS
this.rules[51].opcodes[7] = { type: 4, index: 73 };// RNM(port)
/* path-abempty */
this.rules[52].opcodes = [];
this.rules[52].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[52].opcodes[1] = { type: 2, children: [2,3] };// CAT
this.rules[52].opcodes[2] = { type: 6, string: [47] };// TBS
this.rules[52].opcodes[3] = { type: 4, index: 76 };// RNM(segment)
/* path-absolute */
this.rules[53].opcodes = [];
this.rules[53].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[53].opcodes[1] = { type: 6, string: [47] };// TBS
this.rules[53].opcodes[2] = { type: 3, min: 0, max: 1 };// REP
this.rules[53].opcodes[3] = { type: 2, children: [4,5] };// CAT
this.rules[53].opcodes[4] = { type: 4, index: 77 };// RNM(segment-nz)
this.rules[53].opcodes[5] = { type: 3, min: 0, max: Infinity };// REP
this.rules[53].opcodes[6] = { type: 2, children: [7,8] };// CAT
this.rules[53].opcodes[7] = { type: 6, string: [47] };// TBS
this.rules[53].opcodes[8] = { type: 4, index: 76 };// RNM(segment)
/* path-rootless */
this.rules[54].opcodes = [];
this.rules[54].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[54].opcodes[1] = { type: 4, index: 77 };// RNM(segment-nz)
this.rules[54].opcodes[2] = { type: 3, min: 0, max: Infinity };// REP
this.rules[54].opcodes[3] = { type: 2, children: [4,5] };// CAT
this.rules[54].opcodes[4] = { type: 6, string: [47] };// TBS
this.rules[54].opcodes[5] = { type: 4, index: 76 };// RNM(segment)
/* path-empty */
this.rules[55].opcodes = [];
this.rules[55].opcodes[0] = { type: 7, string: [] };// TLS
/* userinfo-at */
this.rules[56].opcodes = [];
this.rules[56].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[56].opcodes[1] = { type: 4, index: 57 };// RNM(userinfo)
this.rules[56].opcodes[2] = { type: 6, string: [64] };// TBS
/* userinfo */
this.rules[57].opcodes = [];
this.rules[57].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[57].opcodes[1] = { type: 1, children: [2,3,4,5,6,7,8,9,10,11,12] };// ALT
this.rules[57].opcodes[2] = { type: 5, min: 97, max: 122 };// TRG
this.rules[57].opcodes[3] = { type: 5, min: 65, max: 90 };// TRG
this.rules[57].opcodes[4] = { type: 5, min: 48, max: 57 };// TRG
this.rules[57].opcodes[5] = { type: 4, index: 80 };// RNM(pct-encoded)
this.rules[57].opcodes[6] = { type: 6, string: [33] };// TBS
this.rules[57].opcodes[7] = { type: 6, string: [36] };// TBS
this.rules[57].opcodes[8] = { type: 5, min: 38, max: 46 };// TRG
this.rules[57].opcodes[9] = { type: 5, min: 58, max: 59 };// TRG
this.rules[57].opcodes[10] = { type: 6, string: [61] };// TBS
this.rules[57].opcodes[11] = { type: 6, string: [95] };// TBS
this.rules[57].opcodes[12] = { type: 6, string: [126] };// TBS
/* host */
this.rules[58].opcodes = [];
this.rules[58].opcodes[0] = { type: 1, children: [1,2,6] };// ALT
this.rules[58].opcodes[1] = { type: 4, index: 59 };// RNM(IP-literal)
this.rules[58].opcodes[2] = { type: 2, children: [3,4] };// CAT
this.rules[58].opcodes[3] = { type: 4, index: 68 };// RNM(IPv4address)
this.rules[58].opcodes[4] = { type: 13 };// NOT
this.rules[58].opcodes[5] = { type: 4, index: 72 };// RNM(reg-name-char)
this.rules[58].opcodes[6] = { type: 4, index: 71 };// RNM(reg-name)
/* IP-literal */
this.rules[59].opcodes = [];
this.rules[59].opcodes[0] = { type: 2, children: [1,2,5] };// CAT
this.rules[59].opcodes[1] = { type: 6, string: [91] };// TBS
this.rules[59].opcodes[2] = { type: 1, children: [3,4] };// ALT
this.rules[59].opcodes[3] = { type: 4, index: 61 };// RNM(IPv6address)
this.rules[59].opcodes[4] = { type: 4, index: 60 };// RNM(IPvFuture)
this.rules[59].opcodes[5] = { type: 6, string: [93] };// TBS
/* IPvFuture */
this.rules[60].opcodes = [];
this.rules[60].opcodes[0] = { type: 2, children: [1,2,7,8] };// CAT
this.rules[60].opcodes[1] = { type: 7, string: [118] };// TLS
this.rules[60].opcodes[2] = { type: 3, min: 1, max: Infinity };// REP
this.rules[60].opcodes[3] = { type: 1, children: [4,5,6] };// ALT
this.rules[60].opcodes[4] = { type: 5, min: 48, max: 57 };// TRG
this.rules[60].opcodes[5] = { type: 5, min: 65, max: 70 };// TRG
this.rules[60].opcodes[6] = { type: 5, min: 97, max: 102 };// TRG
this.rules[60].opcodes[7] = { type: 7, string: [46] };// TLS
this.rules[60].opcodes[8] = { type: 3, min: 1, max: Infinity };// REP
this.rules[60].opcodes[9] = { type: 1, children: [10,11,12,13,14,15,16,17,18,19] };// ALT
this.rules[60].opcodes[10] = { type: 5, min: 97, max: 122 };// TRG
this.rules[60].opcodes[11] = { type: 5, min: 65, max: 90 };// TRG
this.rules[60].opcodes[12] = { type: 5, min: 48, max: 57 };// TRG
this.rules[60].opcodes[13] = { type: 6, string: [33] };// TBS
this.rules[60].opcodes[14] = { type: 6, string: [36] };// TBS
this.rules[60].opcodes[15] = { type: 5, min: 38, max: 46 };// TRG
this.rules[60].opcodes[16] = { type: 5, min: 58, max: 59 };// TRG
this.rules[60].opcodes[17] = { type: 6, string: [61] };// TBS
this.rules[60].opcodes[18] = { type: 6, string: [95] };// TBS
this.rules[60].opcodes[19] = { type: 6, string: [126] };// TBS
/* IPv6address */
this.rules[61].opcodes = [];
this.rules[61].opcodes[0] = { type: 1, children: [1,2] };// ALT
this.rules[61].opcodes[1] = { type: 4, index: 62 };// RNM(nodcolon)
this.rules[61].opcodes[2] = { type: 4, index: 63 };// RNM(dcolon)
/* nodcolon */
this.rules[62].opcodes = [];
this.rules[62].opcodes[0] = { type: 2, children: [1,5] };// CAT
this.rules[62].opcodes[1] = { type: 2, children: [2,3] };// CAT
this.rules[62].opcodes[2] = { type: 4, index: 66 };// RNM(h16n)
this.rules[62].opcodes[3] = { type: 3, min: 0, max: Infinity };// REP
this.rules[62].opcodes[4] = { type: 4, index: 67 };// RNM(h16cn)
this.rules[62].opcodes[5] = { type: 3, min: 0, max: 1 };// REP
this.rules[62].opcodes[6] = { type: 2, children: [7,8] };// CAT
this.rules[62].opcodes[7] = { type: 6, string: [58] };// TBS
this.rules[62].opcodes[8] = { type: 4, index: 68 };// RNM(IPv4address)
/* dcolon */
this.rules[63].opcodes = [];
this.rules[63].opcodes[0] = { type: 2, children: [1,6,7] };// CAT
this.rules[63].opcodes[1] = { type: 3, min: 0, max: 1 };// REP
this.rules[63].opcodes[2] = { type: 2, children: [3,4] };// CAT
this.rules[63].opcodes[3] = { type: 4, index: 64 };// RNM(h16)
this.rules[63].opcodes[4] = { type: 3, min: 0, max: Infinity };// REP
this.rules[63].opcodes[5] = { type: 4, index: 65 };// RNM(h16c)
this.rules[63].opcodes[6] = { type: 6, string: [58,58] };// TBS
this.rules[63].opcodes[7] = { type: 1, children: [8,17] };// ALT
this.rules[63].opcodes[8] = { type: 2, children: [9,13] };// CAT
this.rules[63].opcodes[9] = { type: 2, children: [10,11] };// CAT
this.rules[63].opcodes[10] = { type: 4, index: 66 };// RNM(h16n)
this.rules[63].opcodes[11] = { type: 3, min: 0, max: Infinity };// REP
this.rules[63].opcodes[12] = { type: 4, index: 67 };// RNM(h16cn)
this.rules[63].opcodes[13] = { type: 3, min: 0, max: 1 };// REP
this.rules[63].opcodes[14] = { type: 2, children: [15,16] };// CAT
this.rules[63].opcodes[15] = { type: 6, string: [58] };// TBS
this.rules[63].opcodes[16] = { type: 4, index: 68 };// RNM(IPv4address)
this.rules[63].opcodes[17] = { type: 3, min: 0, max: 1 };// REP
this.rules[63].opcodes[18] = { type: 4, index: 68 };// RNM(IPv4address)
/* h16 */
this.rules[64].opcodes = [];
this.rules[64].opcodes[0] = { type: 3, min: 1, max: 4 };// REP
this.rules[64].opcodes[1] = { type: 1, children: [2,3,4] };// ALT
this.rules[64].opcodes[2] = { type: 5, min: 48, max: 57 };// TRG
this.rules[64].opcodes[3] = { type: 5, min: 65, max: 70 };// TRG
this.rules[64].opcodes[4] = { type: 5, min: 97, max: 102 };// TRG
/* h16c */
this.rules[65].opcodes = [];
this.rules[65].opcodes[0] = { type: 2, children: [1,2] };// CAT
this.rules[65].opcodes[1] = { type: 6, string: [58] };// TBS
this.rules[65].opcodes[2] = { type: 3, min: 1, max: 4 };// REP
this.rules[65].opcodes[3] = { type: 1, children: [4,5,6] };// ALT
this.rules[65].opcodes[4] = { type: 5, min: 48, max: 57 };// TRG
this.rules[65].opcodes[5] = { type: 5, min: 65, max: 70 };// TRG
this.rules[65].opcodes[6] = { type: 5, min: 97, max: 102 };// TRG
/* h16n */
this.rules[66].opcodes = [];
this.rules[66].opcodes[0] = { type: 2, children: [1,6] };// CAT
this.rules[66].opcodes[1] = { type: 3, min: 1, max: 4 };// REP
this.rules[66].opcodes[2] = { type: 1, children: [3,4,5] };// ALT
this.rules[66].opcodes[3] = { type: 5, min: 48, max: 57 };// TRG
this.rules[66].opcodes[4] = { type: 5, min: 65, max: 70 };// TRG
this.rules[66].opcodes[5] = { type: 5, min: 97, max: 102 };// TRG
this.rules[66].opcodes[6] = { type: 13 };// NOT
this.rules[66].opcodes[7] = { type: 6, string: [46] };// TBS
/* h16cn */
this.rules[67].opcodes = [];
this.rules[67].opcodes[0] = { type: 2, children: [1,2,7] };// CAT
this.rules[67].opcodes[1] = { type: 6, string: [58] };// TBS
this.rules[67].opcodes[2] = { type: 3, min: 1, max: 4 };// REP
this.rules[67].opcodes[3] = { type: 1, children: [4,5,6] };// ALT
this.rules[67].opcodes[4] = { type: 5, min: 48, max: 57 };// TRG
this.rules[67].opcodes[5] = { type: 5, min: 65, max: 70 };// TRG
this.rules[67].opcodes[6] = { type: 5, min: 97, max: 102 };// TRG
this.rules[67].opcodes[7] = { type: 13 };// NOT
this.rules[67].opcodes[8] = { type: 6, string: [46] };// TBS
/* IPv4address */
this.rules[68].opcodes = [];
this.rules[68].opcodes[0] = { type: 2, children: [1,2,3,4,5,6,7] };// CAT
this.rules[68].opcodes[1] = { type: 4, index: 69 };// RNM(dec-octet)
this.rules[68].opcodes[2] = { type: 6, string: [46] };// TBS
this.rules[68].opcodes[3] = { type: 4, index: 69 };// RNM(dec-octet)
this.rules[68].opcodes[4] = { type: 6, string: [46] };// TBS
this.rules[68].opcodes[5] = { type: 4, index: 69 };// RNM(dec-octet)
this.rules[68].opcodes[6] = { type: 6, string: [46] };// TBS
this.rules[68].opcodes[7] = { type: 4, index: 69 };// RNM(dec-octet)
/* dec-octet */
this.rules[69].opcodes = [];
this.rules[69].opcodes[0] = { type: 3, min: 0, max: 3 };// REP
this.rules[69].opcodes[1] = { type: 4, index: 70 };// RNM(dec-digit)
/* dec-digit */
this.rules[70].opcodes = [];
this.rules[70].opcodes[0] = { type: 5, min: 48, max: 57 };// TRG
/* reg-name */
this.rules[71].opcodes = [];
this.rules[71].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[71].opcodes[1] = { type: 4, index: 72 };// RNM(reg-name-char)
/* reg-name-char */
this.rules[72].opcodes = [];
this.rules[72].opcodes[0] = { type: 1, children: [1,2,3,4,5,6,7,8,9,10,11] };// ALT
this.rules[72].opcodes[1] = { type: 5, min: 97, max: 122 };// TRG
this.rules[72].opcodes[2] = { type: 5, min: 65, max: 90 };// TRG
this.rules[72].opcodes[3] = { type: 5, min: 48, max: 57 };// TRG
this.rules[72].opcodes[4] = { type: 4, index: 80 };// RNM(pct-encoded)
this.rules[72].opcodes[5] = { type: 6, string: [33] };// TBS
this.rules[72].opcodes[6] = { type: 6, string: [36] };// TBS
this.rules[72].opcodes[7] = { type: 5, min: 38, max: 46 };// TRG
this.rules[72].opcodes[8] = { type: 6, string: [59] };// TBS
this.rules[72].opcodes[9] = { type: 6, string: [61] };// TBS
this.rules[72].opcodes[10] = { type: 6, string: [95] };// TBS
this.rules[72].opcodes[11] = { type: 6, string: [126] };// TBS
/* port */
this.rules[73].opcodes = [];
this.rules[73].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[73].opcodes[1] = { type: 5, min: 48, max: 57 };// TRG
/* query */
this.rules[74].opcodes = [];
this.rules[74].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[74].opcodes[1] = { type: 1, children: [2,3,4] };// ALT
this.rules[74].opcodes[2] = { type: 4, index: 79 };// RNM(pchar)
this.rules[74].opcodes[3] = { type: 6, string: [47] };// TBS
this.rules[74].opcodes[4] = { type: 6, string: [63] };// TBS
/* fragment */
this.rules[75].opcodes = [];
this.rules[75].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[75].opcodes[1] = { type: 1, children: [2,3,4] };// ALT
this.rules[75].opcodes[2] = { type: 4, index: 79 };// RNM(pchar)
this.rules[75].opcodes[3] = { type: 6, string: [47] };// TBS
this.rules[75].opcodes[4] = { type: 6, string: [63] };// TBS
/* segment */
this.rules[76].opcodes = [];
this.rules[76].opcodes[0] = { type: 3, min: 0, max: Infinity };// REP
this.rules[76].opcodes[1] = { type: 4, index: 79 };// RNM(pchar)
/* segment-nz */
this.rules[77].opcodes = [];
this.rules[77].opcodes[0] = { type: 3, min: 1, max: Infinity };// REP
this.rules[77].opcodes[1] = { type: 4, index: 79 };// RNM(pchar)
/* scheme */
this.rules[78].opcodes = [];
this.rules[78].opcodes[0] = { type: 2, children: [1,4] };// CAT
this.rules[78].opcodes[1] = { type: 1, children: [2,3] };// ALT
this.rules[78].opcodes[2] = { type: 5, min: 97, max: 122 };// TRG
this.rules[78].opcodes[3] = { type: 5, min: 65, max: 90 };// TRG
this.rules[78].opcodes[4] = { type: 3, min: 0, max: Infinity };// REP
this.rules[78].opcodes[5] = { type: 1, children: [6,9,10,11] };// ALT
this.rules[78].opcodes[6] = { type: 1, children: [7,8] };// ALT
this.rules[78].opcodes[7] = { type: 5, min: 97, max: 122 };// TRG
this.rules[78].opcodes[8] = { type: 5, min: 65, max: 90 };// TRG
this.rules[78].opcodes[9] = { type: 5, min: 48, max: 57 };// TRG
this.rules[78].opcodes[10] = { type: 6, string: [43] };// TBS
this.rules[78].opcodes[11] = { type: 5, min: 45, max: 46 };// TRG
/* pchar */
this.rules[79].opcodes = [];
this.rules[79].opcodes[0] = { type: 1, children: [1,2,3,4,5,6,7,8,9,10] };// ALT
this.rules[79].opcodes[1] = { type: 5, min: 97, max: 122 };// TRG
this.rules[79].opcodes[2] = { type: 5, min: 64, max: 90 };// TRG
this.rules[79].opcodes[3] = { type: 5, min: 48, max: 59 };// TRG
this.rules[79].opcodes[4] = { type: 6, string: [33] };// TBS
this.rules[79].opcodes[5] = { type: 6, string: [36] };// TBS
this.rules[79].opcodes[6] = { type: 5, min: 38, max: 46 };// TRG
this.rules[79].opcodes[7] = { type: 6, string: [61] };// TBS
this.rules[79].opcodes[8] = { type: 6, string: [95] };// TBS
this.rules[79].opcodes[9] = { type: 6, string: [126] };// TBS
this.rules[79].opcodes[10] = { type: 4, index: 80 };// RNM(pct-encoded)
/* pct-encoded */
this.rules[80].opcodes = [];
this.rules[80].opcodes[0] = { type: 2, children: [1,2,6] };// CAT
this.rules[80].opcodes[1] = { type: 6, string: [37] };// TBS
this.rules[80].opcodes[2] = { type: 1, children: [3,4,5] };// ALT
this.rules[80].opcodes[3] = { type: 5, min: 48, max: 57 };// TRG
this.rules[80].opcodes[4] = { type: 5, min: 65, max: 70 };// TRG
this.rules[80].opcodes[5] = { type: 5, min: 97, max: 102 };// TRG
this.rules[80].opcodes[6] = { type: 1, children: [7,8,9] };// ALT
this.rules[80].opcodes[7] = { type: 5, min: 48, max: 57 };// TRG
this.rules[80].opcodes[8] = { type: 5, min: 65, max: 70 };// TRG
this.rules[80].opcodes[9] = { type: 5, min: 97, max: 102 };// TRG
/* unreserved */
this.rules[81].opcodes = [];
this.rules[81].opcodes[0] = { type: 1, children: [1,2,3,4,5,6] };// ALT
this.rules[81].opcodes[1] = { type: 5, min: 97, max: 122 };// TRG
this.rules[81].opcodes[2] = { type: 5, min: 65, max: 90 };// TRG
this.rules[81].opcodes[3] = { type: 5, min: 48, max: 57 };// TRG
this.rules[81].opcodes[4] = { type: 5, min: 45, max: 46 };// TRG
this.rules[81].opcodes[5] = { type: 6, string: [95] };// TBS
this.rules[81].opcodes[6] = { type: 6, string: [126] };// TBS
/* reserved */
this.rules[82].opcodes = [];
this.rules[82].opcodes[0] = { type: 1, children: [1,2,3,4,5,6,7,8,9] };// ALT
this.rules[82].opcodes[1] = { type: 6, string: [33] };// TBS
this.rules[82].opcodes[2] = { type: 5, min: 35, max: 36 };// TRG
this.rules[82].opcodes[3] = { type: 5, min: 38, max: 44 };// TRG
this.rules[82].opcodes[4] = { type: 6, string: [47] };// TBS
this.rules[82].opcodes[5] = { type: 5, min: 58, max: 59 };// TRG
this.rules[82].opcodes[6] = { type: 6, string: [61] };// TBS
this.rules[82].opcodes[7] = { type: 5, min: 63, max: 64 };// TRG
this.rules[82].opcodes[8] = { type: 6, string: [91] };// TBS
this.rules[82].opcodes[9] = { type: 6, string: [93] };// TBS
// The `toString()` function will display the original grammar file(s) that produced these opcodes.
this.toString = function toString(){
let str = "";
str += ";\n";
str += "; LDT 12/15/2024 \n";
str += "; The ERC-4361 (https://eips.ethereum.org/EIPS/eip-4361) ABNF format has been modified in several significant ways.\n";
str += "; 1) Literal strings are replaced with numbers and ranges (%d32 & %d32-126, etc.) when possible.\n";
str += "; TRB and especially TRG operators are much more efficient than TLS operators.\n";
str += "; 2) The message items (scheme, etc.) are first defined as general strings of any characters.\n";
str += "; On a second pass, these item are validated against the ERC_4361 format individually.\n";
str += "; 3) IPv6address does not work because of APG's \"first-success disambiguation\" and \"greedy\" repetitions.\n";
str += "; IPv6address is redefined and validations moved to callback functions (semantic vs syntactic validation).\n";
str += "; Redefinition requires negative look-ahead operators, https://en.wikipedia.org/wiki/Syntactic_predicate.\n";
str += "; That is, SABNF instead of simple ABNF.\n";
str += "; 4) IPv4address fails because of \"first-success disambiguation\".\n";
str += "; This could be fixed with rearrangement of the alternative terms.\n";
str += "; However, it would still not accept zero-padded (leading zeros) decimal octets.\n";
str += "; Therefore, IPv4address is also done with callback functions and semantic validation.\n";
str += "; 5) The negative look-ahead operator is also needed in the definition of host to\n";
str += "; prevent failure with a reg-name that begins with an IPv4 address.\n";
str += "; 6) NOTE: host = 1.1.1.256 is a valid host name even though it is an invalid IPv4address.\n";
str += "; The IPv4address alternative fails but the reg-name alternative succeeds.\n";
str += "; 7) The ERC-4361 message format ABNF allows for empty statements.\n";
str += "; Because of the \"first success disambiguation\" of APG\n";
str += "; the an explicit \"empty-statement\" rule is required to match the spec's intent.\n";
str += "; 8) Basics LF, ALPHA, DIGIT and HEXDIG have been expanded in place to reduce the number of rule name operations.\n";
str += ";\n";
str += "siwe-first-pass =\n";
str += " [ ffscheme ] fdomain %s\" wants you to sign in with your Ethereum account:\" %d10\n";
str += " faddress %d10\n";
str += " (empty-statement / no-statement / actual-statement)\n";
str += " pre-uri furi %d10\n";
str += " pre-version fversion %d10\n";
str += " pre-chain-id fchain-id %d10\n";
str += " pre-nonce fnonce %d10\n";
str += " pre-issued-at fissued-at\n";
str += " [ %d10 %s\"Expiration Time: \" fexpiration-time ]\n";
str += " [ %d10 %s\"Not Before: \" fnot-before ]\n";
str += " [ %d10 %s\"Request ID: \" frequest-id ]\n";
str += " [ %d10 %s\"Resources:\" fresources]\n";
str += "\n";
str += "pre-uri = %s\"URI: \"\n";
str += "pre-version = %s\"Version: \"\n";
str += "pre-chain-id = %s\"Chain ID: \"\n";
str += "pre-nonce = %s\"Nonce: \"\n";
str += "pre-issued-at = %s\"Issued At: \"\n";
str += "ffscheme = fscheme %s\"://\"\n";
str += "fdomain = 1*(%d0-31 / %d33-127) ; all characters but space\n";
str += "fissued-at = 1*(%d0-9 / %d11-127) ; all characters but linefeed\n";
str += "fexpiration-time = 1*(%d0-9 / %d11-127)\n";
str += "fnot-before = 1*(%d0-9 / %d11-127)\n";
str += "furi = 1*(%d0-9 / %d11-127)\n";
str += "fscheme = 1*(%d0-57 / %d59-127) ; any character but colon(:)\n";
str += "faddress = 1*(%d0-9 / %d11-127)\n";
str += "fstatement = 1*(%d0-9 / %d11-127)\n";
str += "fversion = 1*(%d0-9 / %d11-127)\n";
str += "fchain-id = 1*(%d0-9 / %d11-127)\n";
str += "fnonce = 1*(%d0-9 / %d11-127)\n";
str += "frequest-id = *(%d0-9 / %d11-127)\n";
str += "fresources = *( %d10 fresource )\n";
str += "fresource = \"- \" 1*(%d0-9 / %d11-127)\n";
str += "no-statement = %d10.10\n";
str += "empty-statement = %d10.10.10\n";
str += "actual-statement = %d10 fstatement %d10.10\n";
str += "\n";
str += "domain = authority\n";
str += " ; From RFC 3986:\n";
str += "address = %s\"0x\" 40*40(%d48-57 / %d65-70 / %d97-102)\n";
str += " ; Optionally must also conform to capitalization\n";
str += " ; checksum encoding specified in EIP-55\n";
str += "statement = 1*( reserved / unreserved / \" \" )\n";
str += " ; See RFC 3986 for the definition\n";
str += " ; of \"reserved\" and \"unreserved\".\n";
str += " ; The purpose is to exclude %d10 (line break).\n";
str += "version = %s\"1\"\n";
str += "chain-id = 1*%d48-57\n";
str += " ; See EIP-155 for valid CHAIN_IDs.\n";
str += "nonce = 8*( (%d97-122 / %d65-90) / %d48-57 )\n";
str += "issued-at = date-time\n";
str += "expiration-time = date-time\n";
str += "not-before = date-time\n";
str += " ; See RFC 3339 (ISO 8601) for the\n";
str += " ; definition of \"date-time\".\n";
str += "request-id = *pchar\n";
str += " ; See RFC 3986 for the definition of \"pchar\".\n";
str += "resources = *( %d10 resource )\n";
str += "resource = %s\"- \" URI\n";
str += "\n";
str += "; RFC 3339 - Date and Time on the Internet: Timestamps\n";
str += "date-fullyear = 4%d48-57\n";
str += "date-month = 2%d48-57 ; 01-12\n";
str += "date-mday = 2%d48-57 ; 01-28, 01-29, 01-30, 01-31 based on\n";
str += " ; month/year\n";
str += "time-hour = 2%d48-57 ; 00-23\n";
str += "time-minute = 2%d48-57 ; 00-59\n";
str += "time-second = 2%d48-57 ; 00-58, 00-59, 00-60 based on leap second\n";
str += " ; rules\n";
str += "time-secfrac = %s\".\" 1*%d48-57\n";
str += "time-numoffset = (%s\"+\" / %s\"-\") time-hour %s\":\" time-minute\n";
str += "time-offset = \"Z\" / time-numoffset\n";
str += "partial-time = time-hour %s\":\" time-minute %s\":\" time-second\n";
str += " [time-secfrac]\n";
str += "full-date = date-fullyear %s\"-\" date-month %s\"-\" date-mday\n";
str += "full-time = partial-time time-offset\n";
str += "date-time = full-date \"T\" full-time\n";
str += "\n";
str += "; RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax\n";
str += "; Modified to improve APG parsing and callback functions.\n";
str += "URI = scheme %s\":\" hier-part [ %s\"?\" query ] [ %s\"#\" fragment ]\n";
str += "hier-part = %s\"//\" authority path-abempty\n";
str += " / path