From 7b345bfff0ce87d9f2266cb5516959b04df23ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?= Date: Thu, 31 Jan 2013 23:26:28 +0100 Subject: [PATCH] Add URI and NameAddrHeader classes --- LICENSE | 2 +- grunt.js | 2 + package.json | 4 +- src/Message.js | 8 +- src/NameAddrHeader.js | 86 + src/Parser.js | 6 +- src/Registrator.js | 14 +- src/SIPMessage.js | 9 +- src/SanityCheck.js | 2 +- src/Session.js | 8 +- src/Transport.js | 9 + src/UA.js | 12 +- src/URI.js | 173 + src/constants.js | 3 + src/grammar/dist/grammar.js | 12056 ------------------------------ src/grammar/dist/grammar.min.js | 148 - src/grammar/src/grammar.pegjs | 221 +- src/head.js | 2 +- src/utils.js | 65 +- 19 files changed, 466 insertions(+), 12364 deletions(-) create mode 100644 src/NameAddrHeader.js create mode 100644 src/URI.js delete mode 100644 src/grammar/dist/grammar.js delete mode 100644 src/grammar/dist/grammar.min.js diff --git a/LICENSE b/LICENSE index 62d854357..9dc64f7a8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Name: JsSIP Maintainer: José Luis Millán -Copyright (c) 2012-2013 José Luis Millán +Copyright (c) 2012-2013 José Luis Millán - Versatica License: The MIT License diff --git a/grunt.js b/grunt.js index 49ad363bc..59c4aca82 100644 --- a/grunt.js +++ b/grunt.js @@ -22,6 +22,8 @@ module.exports = function(grunt) { "src/Transport.js", "src/Parser.js", "src/SIPMessage.js", + "src/URI.js", + "src/NameAddrHeader.js", "src/Transactions.js", "src/Dialogs.js", "src/RequestSender.js", diff --git a/package.json b/package.json index 43eea8fdd..36486bb9e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jssip", "title": "JsSIP", "description": "Javascript SIP WebSocket library", - "version": "0.2.1", + "version": "devel", "homepage": "http://jssip.net", "author": "José Luis Millán ", "contributors": [ @@ -21,7 +21,7 @@ "library" ], "devDependencies": { - "grunt": "0.3.12" + "grunt": "0.3.17" }, "license": "MIT" } diff --git a/src/Message.js b/src/Message.js index 0a54709e4..54900a865 100644 --- a/src/Message.js +++ b/src/Message.js @@ -41,14 +41,14 @@ JsSIP.Message.prototype.send = function(target, body, contentType, options) { } // Check target validity - target = JsSIP.utils.normalizeUri(target, this.ua.configuration.domain); + target = JsSIP.utils.normalizeURI(target, this.ua.configuration.domain); if (!target) { throw new JsSIP.exceptions.InvalidTargetError(); } // Message parameter initialization this.direction = 'outgoing'; - this.local_identity = this.ua.configuration.user; + this.local_identity = this.ua.configuration.from_uri; this.remote_identity = target; this.closed = false; @@ -164,8 +164,8 @@ JsSIP.Message.prototype.init_incoming = function(request) { this.direction = 'incoming'; this.request = request; - this.local_identity = request.s('to').uri; - this.remote_identity = request.s('from').uri; + this.local_identity = request.s('to').uri.toAor(); + this.remote_identity = request.s('from').uri.toAor(); if (contentType && (contentType.match(/^text\/plain(\s*;\s*.+)*$/i) || contentType.match(/^text\/html(\s*;\s*.+)*$/i))) { this.ua.emit('newMessage', this.ua, { diff --git a/src/NameAddrHeader.js b/src/NameAddrHeader.js new file mode 100644 index 000000000..9e8e57540 --- /dev/null +++ b/src/NameAddrHeader.js @@ -0,0 +1,86 @@ +/** + * @augments JsSIP + * @class Class creating a Name Address SIP header. + * + * @param {JsSIP.URI} uri + * @param {String} [display_name] + * @param {Object} [parameters] + * + */ +JsSIP.NameAddrHeader = function(uri, display_name, parameters) { + var param; + + // Checks + if(!uri || !uri instanceof JsSIP.URI) { + console.warn('Missing or invalid "uri" in NameAddrHeader'); + throw new JsSIP.exceptions.InvalidValueError(); + } + + // Initialize parameters + this.uri = uri; + this.parameters = {}; + + for (param in parameters) { + this.setParam(param, parameters[param]); + } + + Object.defineProperties(this, { + display_name: { + get: function() { return display_name; }, + set: function(value) { + display_name = value; + } + } + }); +}; +JsSIP.NameAddrHeader.prototype = { + setParam: function(key, value) { + if (key) { + this.parameters[key.toLowerCase()] = (typeof value === 'undefined' || value === null)? null : value.toString(); + } + }, + + getParam: function(key) { + if(key) { + return this.parameters[key.toLowerCase()]; + } + }, + + hasParam: function(key) { + if(key) { + return this.parameters.hasOwnProperty(key.toLowerCase()) && true || false; + } + }, + + deleteParam: function(parameter) { + parameter = parameter.toLowerCase(); + if (this.parameters.hasOwnProperty(parameter)) { + delete this.parameters[parameter]; + } + }, + + clearParams: function() { + this.parameters = {}; + }, + + clone: function() { + return new JsSIP.NameAddrHeader( + this.uri.clone(), + this.display_name, + window.JSON.parse(window.JSON.stringify(this.parameters))); + }, + + toString: function() { + var body, parameter; + + body = (this.display_name) ? '"' + this.display_name + '" ' : ''; + body += (this.display_name) ? '<' + this.uri.toString() + '>' : this.uri.toString(); + + + for (parameter in this.parameters) { + body += ';' + parameter; + body += (this.parameters[parameter] === null)? '' : '=' + this.parameters[parameter]; + } + return body; + } +}; \ No newline at end of file diff --git a/src/Parser.js b/src/Parser.js index 20dee422b..4bec1219b 100644 --- a/src/Parser.js +++ b/src/Parser.js @@ -73,7 +73,7 @@ JsSIP.Parser = { parsed = message.parseHeader('from'); if(parsed) { message.from = parsed; - message.from_tag = parsed.tag; + message.from_tag = parsed.getParam('tag'); } break; case 'to': @@ -82,7 +82,7 @@ JsSIP.Parser = { parsed = message.parseHeader('to'); if(parsed) { message.to = parsed; - message.to_tag = parsed.tag; + message.to_tag = parsed.getParam('tag'); } break; case 'record-route': @@ -191,7 +191,7 @@ JsSIP.Parser = { } else if(!parsed.status_code) { message = new JsSIP.IncomingRequest(); message.method = parsed.method; - message.ruri = parsed; + message.ruri = parsed.uri; } else { message = new JsSIP.IncomingResponse(); message.status_code = parsed.status_code; diff --git a/src/Registrator.js b/src/Registrator.js index 0bdf164cd..368a4bf1e 100644 --- a/src/Registrator.js +++ b/src/Registrator.js @@ -94,7 +94,7 @@ JsSIP.Registrator.prototype = { while(contacts--) { contact = response.parseHeader('contact', contacts); if(contact.uri === this.ua.contact.uri) { - expires = contact.params.expires; + expires = contact.getParam('expires'); break; } } @@ -106,10 +106,6 @@ JsSIP.Registrator.prototype = { if(!expires) { expires = this.expires; - } else if(expires < this.min_expires) { - // Set the expires value to min_expires in case it is slower - console.log(JsSIP.c.LOG_REGISTRATOR +'Received expires value: ' + expires + ' is smaller than the minimum expires time: ' + this.min_expires); - expires = this.min_expires; } // Re-Register before the expiration interval has elapsed. @@ -119,11 +115,11 @@ JsSIP.Registrator.prototype = { }, (expires * 1000) - 3000); //Save gruu values - if (contact.params['temp-gruu']) { - this.ua.contact.temp_gruu = contact.params['temp-gruu'].replace(/"/g,''); + if (contact.hasParam('temp-gruu')) { + this.ua.contact.temp_gruu = contact.getParam('temp-gruu').replace(/"/g,''); } - if (contact.params['pub-gruu']) { - this.ua.contact.pub_gruu = contact.params['pub-gruu'].replace(/"/g,''); + if (contact.hasParam('pub-gruu')) { + this.ua.contact.pub_gruu = contact.getParam('pub-gruu').replace(/"/g,''); } this.registered = true; diff --git a/src/SIPMessage.js b/src/SIPMessage.js index 2fd449bec..8ba6b709a 100644 --- a/src/SIPMessage.js +++ b/src/SIPMessage.js @@ -378,7 +378,7 @@ JsSIP.IncomingRequest.prototype.reply = function(code, reason, extraHeaders, bod if(!this.to_tag) { to += ';tag=' + JsSIP.utils.newTag(); - } else if(this.to_tag && !this.s('to').tag) { + } else if(this.to_tag && !this.s('to').hasParam('tag')) { to += ';tag=' + this.to_tag; } @@ -398,7 +398,7 @@ JsSIP.IncomingRequest.prototype.reply = function(code, reason, extraHeaders, bod response += 'Content-Length: ' + length + '\r\n\r\n'; response += body; } else { - response += '\r\n'; + response += 'Content-Length: ' + 0 + '\r\n\r\n'; } this.server_transaction.receiveResponse(code, response, onSuccess, onFailure); @@ -435,14 +435,15 @@ JsSIP.IncomingRequest.prototype.reply_sl = function(code, reason) { if(!this.to_tag) { to += ';tag=' + JsSIP.utils.newTag(); - } else if(this.to_tag && !this.s('to').tag) { + } else if(this.to_tag && !this.s('to').hasParam('tag')) { to += ';tag=' + this.to_tag; } response += 'To: ' + to + '\r\n'; response += 'From: ' + this.getHeader('From') + '\r\n'; response += 'Call-ID: ' + this.call_id + '\r\n'; - response += 'CSeq: ' + this.cseq + ' ' + this.method + '\r\n\r\n'; + response += 'CSeq: ' + this.cseq + ' ' + this.method + '\r\n'; + response += 'Content-Length: ' + 0 + '\r\n\r\n'; this.transport.send(response); }; diff --git a/src/SanityCheck.js b/src/SanityCheck.js index 365932185..dd0fc1b85 100644 --- a/src/SanityCheck.js +++ b/src/SanityCheck.js @@ -36,7 +36,7 @@ JsSIP.sanityCheck = (function() { // Sanity Check functions for requests function rfc3261_8_2_2_1() { - if(message.s('to').scheme !== 'sip') { + if(message.s('to').uri.scheme !== 'sip') { reply(416); return false; } diff --git a/src/Session.js b/src/Session.js index 0ab9df67c..e2b4d8f91 100644 --- a/src/Session.js +++ b/src/Session.js @@ -103,7 +103,7 @@ JsSIP.Session.prototype.connect = function(target, options) { } // Check target validity - target = JsSIP.utils.normalizeUri(target, this.ua.configuration.domain); + target = JsSIP.utils.normalizeURI(target, this.ua.configuration.domain); if (!target) { throw new JsSIP.exceptions.InvalidTargetError(); } @@ -746,10 +746,10 @@ JsSIP.Session.prototype.newSession = function(originator, request, target) { session.direction = (originator === 'local') ? 'outgoing' : 'incoming'; if (originator === 'remote') { - session.local_identity = request.s('to').uri; - session.remote_identity = request.s('from').uri; + session.local_identity = request.s('to').uri.toAor(); + session.remote_identity = request.s('from').uri.toAor(); } else if (originator === 'local'){ - session.local_identity = session.ua.configuration.user; + session.local_identity = session.ua.configuration.from_uri; session.remote_identity = target; } diff --git a/src/Transport.js b/src/Transport.js index 5bac408c1..545f7e69e 100644 --- a/src/Transport.js +++ b/src/Transport.js @@ -20,6 +20,7 @@ JsSIP.Transport = function(ua, server) { this.closed = false; this.connected = false; this.reconnectTimer = null; + this.lastTransportError = {}; this.ua.transport = this; @@ -127,6 +128,8 @@ JsSIP.Transport.prototype = { var connected_before = this.connected; this.connected = false; + this.lastTransportError.code = e.code; + this.lastTransportError.reason = e.reason; console.warn(JsSIP.c.LOG_TRANSPORT +'WebSocket disconnected: code=' + e.code + (e.reason? ', reason=' + e.reason : '')); if(e.wasClean === false) { @@ -140,6 +143,12 @@ JsSIP.Transport.prototype = { // Reset reconnection_attempts this.reconnection_attempts = 0; this.reConnect(); + } else { + this.ua.emit('disconnected', this.ua, { + transport: this, + code: this.lastTransportError.code, + reason: this.lastTransportError.reason + }); } } else { // This is the first connection attempt diff --git a/src/UA.js b/src/UA.js index b9282ccb7..e177dfd7e 100644 --- a/src/UA.js +++ b/src/UA.js @@ -301,6 +301,12 @@ JsSIP.UA.prototype.onTransportError = function(transport) { transport.server.status = JsSIP.c.WS_SERVER_ERROR; console.log(JsSIP.c.LOG_UA +'connection status set to: '+ JsSIP.c.WS_SERVER_ERROR); + this.emit('disconnected', this, { + transport: transport, + code: transport.lastTransportError.code, + reason: transport.lastTransportError.reason + }); + server = this.getNextWsServer(); if(server) { @@ -310,9 +316,7 @@ JsSIP.UA.prototype.onTransportError = function(transport) { if (!this.error || this.error !== JsSIP.c.UA_NETWORK_ERROR) { this.status = JsSIP.c.UA_STATUS_NOT_READY; this.error = JsSIP.c.UA_NETWORK_ERROR; - this.emit('disconnected'); } - // Transport Recovery process this.recoverTransport(); } @@ -339,7 +343,9 @@ JsSIP.UA.prototype.onTransportConnected = function(transport) { this.status = JsSIP.c.UA_STATUS_READY; this.error = null; - this.emit('connected', this); + this.emit('connected', this, { + transport: transport + }); if(this.configuration.register) { if(this.registrator) { diff --git a/src/URI.js b/src/URI.js new file mode 100644 index 000000000..5b90febd7 --- /dev/null +++ b/src/URI.js @@ -0,0 +1,173 @@ +/** + * @augments JsSIP + * @class Class creating a SIP URI. + * + * @param {String} [scheme] + * @param {String} [user] + * @param {String} [host] + * @param {String} [port] + * @param {Object} [parameters] + * + */ +JsSIP.URI = function(scheme, user, host, port, parameters, headers) { + var param, header; + + // Checks + if(!host) { + console.warn('Missing "host" in URI'); + throw new JsSIP.exceptions.InvalidValueError(); + } + + // Initialize parameters + this.parameters = {}; + this.headers = {}; + + for (param in parameters) { + this.setParam(param, parameters[param]); + } + + for (header in headers) { + this.setHeader(header, headers[header]); + } + + Object.defineProperties(this, { + scheme: { + get: function(){ return scheme; }, + set: function(value){ + scheme = value.toLowerCase(); + } + }, + + user: { + get: function(){ return user; }, + set: function(value){ + user = value; + } + }, + + host: { + get: function(){ return host; }, + set: function(value){ + host = value.toLowerCase(); + } + }, + port: { + get: function(){ return port; }, + set: function(value){ + port = parseInt(value,10); + } + } + }); +}; +JsSIP.URI.prototype = { + setParam: function(key, value) { + if(key) { + this.parameters[key.toLowerCase()] = (typeof value === 'undefined' || value === null)? null : value.toString(); + } + }, + + getParam: function(key) { + if(key) { + return this.parameters[key.toLowerCase()]; + } + }, + + hasParam: function(key) { + if(key) { + return this.parameters.hasOwnProperty(key.toLowerCase()) && true || false; + } + }, + + deleteParam: function(parameter) { + parameter = parameter.toLowerCase(); + if (this.parameters.hasOwnProperty(parameter)) { + delete this.parameters[parameter]; + } + }, + + clearParams: function() { + this.parameters = {}; + }, + + setHeader: function(name, value) { + this.headers[JsSIP.utils.headerize(name)] = (value instanceof Array) ? value : [value]; + }, + + getHeader: function(name) { + if(name) { + return this.headers[JsSIP.utils.headerize(name)]; + } + }, + + hasHeader: function(name) { + if(name) { + return this.headers.hasOwnProperty(name.toLowerCase()) && true || false; + } + }, + + deleteHeader: function(header) { + header = JsSIP.utils.headerize(header); + if(this.headers.hasOwnProperty(header)) { + delete this.headers[header]; + } + }, + + clearHeaders: function() { + this.headers = {}; + return this.headers; + }, + + clone: function() { + return new JsSIP.URI( + this.scheme, + this.user, + this.host, + this.port, + window.JSON.parse(window.JSON.stringify(this.parameters)), + window.JSON.parse(window.JSON.stringify(this.headers))); + }, + + toString: function(){ + var header, parameter, idx, + headers = [], + uri = ''; + + if(!this.host) { + console.warn(JsSIP.c.LOG_UA +'No domain specified'); + return; + } + + uri = this.scheme || JsSIP.c.SIP; + uri += ':'; + uri += this.user ? window.encodeURIComponent(this.user) + '@' : ''; + uri += this.host; + uri += this.port ? ':' + this.port : ''; + + for (parameter in this.parameters) { + uri += ';'+ parameter.toLowerCase(); + uri += (this.parameters[parameter] === null )? '' : '=' + this.parameters[parameter]; + } + + for(header in this.headers) { + for(idx in this.headers[header]) { + headers.push(header + '=' + this.headers[header][idx]); + } + } + + if (headers.length > 0) { + uri += '?' + headers.join('&'); + } + + return uri; + }, + toAor: function(){ + var aor = ''; + + aor += this.scheme || JsSIP.c.SIP; + aor += ':'; + aor += this.user ? window.encodeURIComponent(this.user) + '@' : ''; + aor += this.host; + + return aor; + } +}; \ No newline at end of file diff --git a/src/constants.js b/src/constants.js index 0d2c6ef48..5208e8572 100644 --- a/src/constants.js +++ b/src/constants.js @@ -39,6 +39,9 @@ JsSIP.c = { LOG_MESSAGE_SUMMARY: JsSIP.name() +' | '+ 'MESSAGE_SUMMARY' +' | ', + // SIP schemes + SIP: 'sip', + // Transaction states TRANSACTION_TRYING: 1, TRANSACTION_PROCEEDING: 2, diff --git a/src/grammar/dist/grammar.js b/src/grammar/dist/grammar.js deleted file mode 100644 index 7f16dc793..000000000 --- a/src/grammar/dist/grammar.js +++ /dev/null @@ -1,12056 +0,0 @@ -JsSIP.grammar = (function(){ - /* - * Generated by PEG.js 0.7.0. - * - * http://pegjs.majda.cz/ - */ - - function quote(s) { - /* - * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a - * string literal except for the closing quote character, backslash, - * carriage return, line separator, paragraph separator, and line feed. - * Any character may appear in the form of an escape sequence. - * - * For portability, we also escape escape all control and non-ASCII - * characters. Note that "\0" and "\v" escape sequences are not used - * because JSHint does not like the first and IE the second. - */ - return '"' + s - .replace(/\\/g, '\\\\') // backslash - .replace(/"/g, '\\"') // closing quote character - .replace(/\x08/g, '\\b') // backspace - .replace(/\t/g, '\\t') // horizontal tab - .replace(/\n/g, '\\n') // line feed - .replace(/\f/g, '\\f') // form feed - .replace(/\r/g, '\\r') // carriage return - .replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g, escape) - + '"'; - } - - var result = { - /* - * Parses the input with a generated parser. If the parsing is successfull, - * returns a value explicitly or implicitly specified by the grammar from - * which the parser was generated (see |PEG.buildParser|). If the parsing is - * unsuccessful, throws |PEG.parser.SyntaxError| describing the error. - */ - parse: function(input, startRule) { - var parseFunctions = { - "CRLF": parse_CRLF, - "DIGIT": parse_DIGIT, - "ALPHA": parse_ALPHA, - "HEXDIG": parse_HEXDIG, - "WSP": parse_WSP, - "OCTET": parse_OCTET, - "DQUOTE": parse_DQUOTE, - "SP": parse_SP, - "HTAB": parse_HTAB, - "alphanum": parse_alphanum, - "reserved": parse_reserved, - "unreserved": parse_unreserved, - "mark": parse_mark, - "escaped": parse_escaped, - "LWS": parse_LWS, - "SWS": parse_SWS, - "HCOLON": parse_HCOLON, - "TEXT_UTF8_TRIM": parse_TEXT_UTF8_TRIM, - "TEXT_UTF8char": parse_TEXT_UTF8char, - "UTF8_NONASCII": parse_UTF8_NONASCII, - "UTF8_CONT": parse_UTF8_CONT, - "LHEX": parse_LHEX, - "token": parse_token, - "token_nodot": parse_token_nodot, - "separators": parse_separators, - "word": parse_word, - "STAR": parse_STAR, - "SLASH": parse_SLASH, - "EQUAL": parse_EQUAL, - "LPAREN": parse_LPAREN, - "RPAREN": parse_RPAREN, - "RAQUOT": parse_RAQUOT, - "LAQUOT": parse_LAQUOT, - "COMMA": parse_COMMA, - "SEMI": parse_SEMI, - "COLON": parse_COLON, - "LDQUOT": parse_LDQUOT, - "RDQUOT": parse_RDQUOT, - "comment": parse_comment, - "ctext": parse_ctext, - "quoted_string": parse_quoted_string, - "qdtext": parse_qdtext, - "quoted_pair": parse_quoted_pair, - "SIP_URI_simple": parse_SIP_URI_simple, - "SIP_URI": parse_SIP_URI, - "uri_scheme": parse_uri_scheme, - "userinfo": parse_userinfo, - "user": parse_user, - "user_unreserved": parse_user_unreserved, - "password": parse_password, - "hostport": parse_hostport, - "host": parse_host, - "hostname": parse_hostname, - "domainlabel": parse_domainlabel, - "toplabel": parse_toplabel, - "IPv6reference": parse_IPv6reference, - "IPv6address": parse_IPv6address, - "h16": parse_h16, - "ls32": parse_ls32, - "IPv4address": parse_IPv4address, - "dec_octet": parse_dec_octet, - "port": parse_port, - "uri_parameters": parse_uri_parameters, - "uri_parameter": parse_uri_parameter, - "transport_param": parse_transport_param, - "user_param": parse_user_param, - "method_param": parse_method_param, - "ttl_param": parse_ttl_param, - "maddr_param": parse_maddr_param, - "lr_param": parse_lr_param, - "other_param": parse_other_param, - "pname": parse_pname, - "pvalue": parse_pvalue, - "paramchar": parse_paramchar, - "param_unreserved": parse_param_unreserved, - "headers": parse_headers, - "header": parse_header, - "hname": parse_hname, - "hvalue": parse_hvalue, - "hnv_unreserved": parse_hnv_unreserved, - "Request_Response": parse_Request_Response, - "Request_Line": parse_Request_Line, - "Request_URI": parse_Request_URI, - "absoluteURI": parse_absoluteURI, - "hier_part": parse_hier_part, - "net_path": parse_net_path, - "abs_path": parse_abs_path, - "opaque_part": parse_opaque_part, - "uric": parse_uric, - "uric_no_slash": parse_uric_no_slash, - "path_segments": parse_path_segments, - "segment": parse_segment, - "param": parse_param, - "pchar": parse_pchar, - "scheme": parse_scheme, - "authority": parse_authority, - "srvr": parse_srvr, - "reg_name": parse_reg_name, - "query": parse_query, - "SIP_Version": parse_SIP_Version, - "INVITEm": parse_INVITEm, - "ACKm": parse_ACKm, - "OPTIONSm": parse_OPTIONSm, - "BYEm": parse_BYEm, - "CANCELm": parse_CANCELm, - "REGISTERm": parse_REGISTERm, - "SUBSCRIBEm": parse_SUBSCRIBEm, - "NOTIFYm": parse_NOTIFYm, - "Method": parse_Method, - "Status_Line": parse_Status_Line, - "Status_Code": parse_Status_Code, - "extension_code": parse_extension_code, - "Reason_Phrase": parse_Reason_Phrase, - "Allow_Events": parse_Allow_Events, - "Call_ID": parse_Call_ID, - "Contact": parse_Contact, - "contact_param": parse_contact_param, - "name_addr": parse_name_addr, - "addr_spec": parse_addr_spec, - "addr_spec_simple": parse_addr_spec_simple, - "display_name": parse_display_name, - "contact_params": parse_contact_params, - "c_p_q": parse_c_p_q, - "c_p_expires": parse_c_p_expires, - "contact_extension": parse_contact_extension, - "delta_seconds": parse_delta_seconds, - "qvalue": parse_qvalue, - "generic_param": parse_generic_param, - "gen_value": parse_gen_value, - "Content_Disposition": parse_Content_Disposition, - "disp_type": parse_disp_type, - "disp_param": parse_disp_param, - "handling_param": parse_handling_param, - "Content_Encoding": parse_Content_Encoding, - "Content_Length": parse_Content_Length, - "Content_Type": parse_Content_Type, - "media_type": parse_media_type, - "m_type": parse_m_type, - "discrete_type": parse_discrete_type, - "composite_type": parse_composite_type, - "extension_token": parse_extension_token, - "x_token": parse_x_token, - "m_subtype": parse_m_subtype, - "m_parameter": parse_m_parameter, - "m_value": parse_m_value, - "CSeq": parse_CSeq, - "CSeq_value": parse_CSeq_value, - "Expires": parse_Expires, - "Event": parse_Event, - "event_type": parse_event_type, - "event_param": parse_event_param, - "From": parse_From, - "from_param": parse_from_param, - "tag_param": parse_tag_param, - "Max_Forwards": parse_Max_Forwards, - "Min_Expires": parse_Min_Expires, - "Proxy_Authenticate": parse_Proxy_Authenticate, - "challenge": parse_challenge, - "other_challenge": parse_other_challenge, - "auth_param": parse_auth_param, - "digest_cln": parse_digest_cln, - "realm": parse_realm, - "realm_value": parse_realm_value, - "domain": parse_domain, - "URI": parse_URI, - "nonce": parse_nonce, - "nonce_value": parse_nonce_value, - "opaque": parse_opaque, - "stale": parse_stale, - "algorithm": parse_algorithm, - "qop_options": parse_qop_options, - "qop_value": parse_qop_value, - "Proxy_Require": parse_Proxy_Require, - "Record_Route": parse_Record_Route, - "rec_route": parse_rec_route, - "Require": parse_Require, - "Route": parse_Route, - "route_param": parse_route_param, - "Subscription_State": parse_Subscription_State, - "substate_value": parse_substate_value, - "subexp_params": parse_subexp_params, - "event_reason_value": parse_event_reason_value, - "Subject": parse_Subject, - "Supported": parse_Supported, - "To": parse_To, - "to_param": parse_to_param, - "Via": parse_Via, - "via_parm": parse_via_parm, - "via_params": parse_via_params, - "via_ttl": parse_via_ttl, - "via_maddr": parse_via_maddr, - "via_received": parse_via_received, - "via_branch": parse_via_branch, - "response_port": parse_response_port, - "sent_protocol": parse_sent_protocol, - "protocol_name": parse_protocol_name, - "transport": parse_transport, - "sent_by": parse_sent_by, - "via_host": parse_via_host, - "via_port": parse_via_port, - "ttl": parse_ttl, - "WWW_Authenticate": parse_WWW_Authenticate, - "extension_header": parse_extension_header, - "header_value": parse_header_value, - "message_body": parse_message_body, - "stun_URI": parse_stun_URI, - "stun_scheme": parse_stun_scheme, - "stun_host_port": parse_stun_host_port, - "stun_host": parse_stun_host, - "reg_name": parse_reg_name, - "stun_unreserved": parse_stun_unreserved, - "sub_delims": parse_sub_delims, - "turn_URI": parse_turn_URI, - "turn_scheme": parse_turn_scheme, - "turn_transport": parse_turn_transport, - "lazy_uri": parse_lazy_uri - }; - - if (startRule !== undefined) { - if (parseFunctions[startRule] === undefined) { - throw new Error("Invalid rule name: " + quote(startRule) + "."); - } - } else { - startRule = "CRLF"; - } - - var pos = 0; - var reportFailures = 0; - var rightmostFailuresPos = 0; - var rightmostFailuresExpected = []; - - function padLeft(input, padding, length) { - var result = input; - - var padLength = length - input.length; - for (var i = 0; i < padLength; i++) { - result = padding + result; - } - - return result; - } - - function escape(ch) { - var charCode = ch.charCodeAt(0); - var escapeChar; - var length; - - if (charCode <= 0xFF) { - escapeChar = 'x'; - length = 2; - } else { - escapeChar = 'u'; - length = 4; - } - - return '\\' + escapeChar + padLeft(charCode.toString(16).toUpperCase(), '0', length); - } - - function matchFailed(failure) { - if (pos < rightmostFailuresPos) { - return; - } - - if (pos > rightmostFailuresPos) { - rightmostFailuresPos = pos; - rightmostFailuresExpected = []; - } - - rightmostFailuresExpected.push(failure); - } - - function parse_CRLF() { - var result0; - - if (input.substr(pos, 2) === "\r\n") { - result0 = "\r\n"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"\\r\\n\""); - } - } - return result0; - } - - function parse_DIGIT() { - var result0; - - if (/^[0-9]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[0-9]"); - } - } - return result0; - } - - function parse_ALPHA() { - var result0; - - if (/^[a-zA-Z]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[a-zA-Z]"); - } - } - return result0; - } - - function parse_HEXDIG() { - var result0; - - if (/^[0-9a-fA-F]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[0-9a-fA-F]"); - } - } - return result0; - } - - function parse_WSP() { - var result0; - - result0 = parse_SP(); - if (result0 === null) { - result0 = parse_HTAB(); - } - return result0; - } - - function parse_OCTET() { - var result0; - - if (/^[\0-\xFF]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[\\0-\\xFF]"); - } - } - return result0; - } - - function parse_DQUOTE() { - var result0; - - if (/^["]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[\"]"); - } - } - return result0; - } - - function parse_SP() { - var result0; - - if (input.charCodeAt(pos) === 32) { - result0 = " "; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\" \""); - } - } - return result0; - } - - function parse_HTAB() { - var result0; - - if (input.charCodeAt(pos) === 9) { - result0 = "\t"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"\\t\""); - } - } - return result0; - } - - function parse_alphanum() { - var result0; - - if (/^[a-zA-Z0-9]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[a-zA-Z0-9]"); - } - } - return result0; - } - - function parse_reserved() { - var result0; - - if (input.charCodeAt(pos) === 59) { - result0 = ";"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 47) { - result0 = "/"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 63) { - result0 = "?"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"?\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 58) { - result0 = ":"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 64) { - result0 = "@"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 38) { - result0 = "&"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 61) { - result0 = "="; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 43) { - result0 = "+"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 36) { - result0 = "$"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 44) { - result0 = ","; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - } - } - } - } - } - } - } - } - } - return result0; - } - - function parse_unreserved() { - var result0; - - result0 = parse_alphanum(); - if (result0 === null) { - result0 = parse_mark(); - } - return result0; - } - - function parse_mark() { - var result0; - - if (input.charCodeAt(pos) === 45) { - result0 = "-"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 95) { - result0 = "_"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"_\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 46) { - result0 = "."; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 33) { - result0 = "!"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"!\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 126) { - result0 = "~"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"~\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 42) { - result0 = "*"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"*\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 39) { - result0 = "'"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"'\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 40) { - result0 = "("; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"(\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 41) { - result0 = ")"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\")\""); - } - } - } - } - } - } - } - } - } - } - return result0; - } - - function parse_escaped() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - if (input.charCodeAt(pos) === 37) { - result0 = "%"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"%\""); - } - } - if (result0 !== null) { - result1 = parse_HEXDIG(); - if (result1 !== null) { - result2 = parse_HEXDIG(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_LWS() { - var result0, result1, result2; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - pos2 = pos; - result0 = []; - result1 = parse_WSP(); - while (result1 !== null) { - result0.push(result1); - result1 = parse_WSP(); - } - if (result0 !== null) { - result1 = parse_CRLF(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos2; - } - } else { - result0 = null; - pos = pos2; - } - result0 = result0 !== null ? result0 : ""; - if (result0 !== null) { - result2 = parse_WSP(); - if (result2 !== null) { - result1 = []; - while (result2 !== null) { - result1.push(result2); - result2 = parse_WSP(); - } - } else { - result1 = null; - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return " "; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_SWS() { - var result0; - - result0 = parse_LWS(); - result0 = result0 !== null ? result0 : ""; - return result0; - } - - function parse_HCOLON() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = []; - result1 = parse_SP(); - if (result1 === null) { - result1 = parse_HTAB(); - } - while (result1 !== null) { - result0.push(result1); - result1 = parse_SP(); - if (result1 === null) { - result1 = parse_HTAB(); - } - } - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_SWS(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return ':'; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_TEXT_UTF8_TRIM() { - var result0, result1, result2, result3; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - result1 = parse_TEXT_UTF8char(); - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_TEXT_UTF8char(); - } - } else { - result0 = null; - } - if (result0 !== null) { - result1 = []; - pos2 = pos; - result2 = []; - result3 = parse_LWS(); - while (result3 !== null) { - result2.push(result3); - result3 = parse_LWS(); - } - if (result2 !== null) { - result3 = parse_TEXT_UTF8char(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - while (result2 !== null) { - result1.push(result2); - pos2 = pos; - result2 = []; - result3 = parse_LWS(); - while (result3 !== null) { - result2.push(result3); - result3 = parse_LWS(); - } - if (result2 !== null) { - result3 = parse_TEXT_UTF8char(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - return input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_TEXT_UTF8char() { - var result0; - - if (/^[!-~]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[!-~]"); - } - } - if (result0 === null) { - result0 = parse_UTF8_NONASCII(); - } - return result0; - } - - function parse_UTF8_NONASCII() { - var result0; - - if (/^[\x80-\uFFFF]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[\\x80-\\uFFFF]"); - } - } - return result0; - } - - function parse_UTF8_CONT() { - var result0; - - if (/^[\x80-\xBF]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[\\x80-\\xBF]"); - } - } - return result0; - } - - function parse_LHEX() { - var result0; - - result0 = parse_DIGIT(); - if (result0 === null) { - if (/^[a-f]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[a-f]"); - } - } - } - return result0; - } - - function parse_token() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_alphanum(); - if (result1 === null) { - if (input.charCodeAt(pos) === 45) { - result1 = "-"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 46) { - result1 = "."; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 33) { - result1 = "!"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"!\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 37) { - result1 = "%"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"%\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 42) { - result1 = "*"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"*\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 95) { - result1 = "_"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"_\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 96) { - result1 = "`"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"`\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 39) { - result1 = "'"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"'\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 126) { - result1 = "~"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"~\""); - } - } - } - } - } - } - } - } - } - } - } - } - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_alphanum(); - if (result1 === null) { - if (input.charCodeAt(pos) === 45) { - result1 = "-"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 46) { - result1 = "."; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 33) { - result1 = "!"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"!\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 37) { - result1 = "%"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"%\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 42) { - result1 = "*"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"*\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 95) { - result1 = "_"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"_\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 96) { - result1 = "`"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"`\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 39) { - result1 = "'"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"'\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 126) { - result1 = "~"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"~\""); - } - } - } - } - } - } - } - } - } - } - } - } - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset) { - return input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_token_nodot() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_alphanum(); - if (result1 === null) { - if (input.charCodeAt(pos) === 45) { - result1 = "-"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 33) { - result1 = "!"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"!\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 37) { - result1 = "%"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"%\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 42) { - result1 = "*"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"*\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 95) { - result1 = "_"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"_\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 96) { - result1 = "`"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"`\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 39) { - result1 = "'"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"'\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 126) { - result1 = "~"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"~\""); - } - } - } - } - } - } - } - } - } - } - } - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_alphanum(); - if (result1 === null) { - if (input.charCodeAt(pos) === 45) { - result1 = "-"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 33) { - result1 = "!"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"!\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 37) { - result1 = "%"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"%\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 42) { - result1 = "*"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"*\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 95) { - result1 = "_"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"_\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 96) { - result1 = "`"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"`\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 39) { - result1 = "'"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"'\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 126) { - result1 = "~"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"~\""); - } - } - } - } - } - } - } - } - } - } - } - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset) { - return input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_separators() { - var result0; - - if (input.charCodeAt(pos) === 40) { - result0 = "("; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"(\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 41) { - result0 = ")"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\")\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 60) { - result0 = "<"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"<\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 62) { - result0 = ">"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\">\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 64) { - result0 = "@"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 44) { - result0 = ","; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 59) { - result0 = ";"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 58) { - result0 = ":"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 92) { - result0 = "\\"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"\\\\\""); - } - } - if (result0 === null) { - result0 = parse_DQUOTE(); - if (result0 === null) { - if (input.charCodeAt(pos) === 47) { - result0 = "/"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 91) { - result0 = "["; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"[\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 93) { - result0 = "]"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"]\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 63) { - result0 = "?"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"?\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 61) { - result0 = "="; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 123) { - result0 = "{"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"{\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 125) { - result0 = "}"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"}\""); - } - } - if (result0 === null) { - result0 = parse_SP(); - if (result0 === null) { - result0 = parse_HTAB(); - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return result0; - } - - function parse_word() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_alphanum(); - if (result1 === null) { - if (input.charCodeAt(pos) === 45) { - result1 = "-"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 46) { - result1 = "."; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 33) { - result1 = "!"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"!\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 37) { - result1 = "%"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"%\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 42) { - result1 = "*"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"*\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 95) { - result1 = "_"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"_\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 96) { - result1 = "`"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"`\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 39) { - result1 = "'"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"'\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 126) { - result1 = "~"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"~\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 40) { - result1 = "("; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"(\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 41) { - result1 = ")"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\")\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 60) { - result1 = "<"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"<\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 62) { - result1 = ">"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\">\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 92) { - result1 = "\\"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"\\\\\""); - } - } - if (result1 === null) { - result1 = parse_DQUOTE(); - if (result1 === null) { - if (input.charCodeAt(pos) === 47) { - result1 = "/"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 91) { - result1 = "["; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"[\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 93) { - result1 = "]"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"]\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 63) { - result1 = "?"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"?\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 123) { - result1 = "{"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"{\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 125) { - result1 = "}"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"}\""); - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_alphanum(); - if (result1 === null) { - if (input.charCodeAt(pos) === 45) { - result1 = "-"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 46) { - result1 = "."; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 33) { - result1 = "!"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"!\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 37) { - result1 = "%"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"%\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 42) { - result1 = "*"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"*\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 95) { - result1 = "_"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"_\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 96) { - result1 = "`"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"`\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 39) { - result1 = "'"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"'\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 126) { - result1 = "~"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"~\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 40) { - result1 = "("; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"(\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 41) { - result1 = ")"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\")\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 60) { - result1 = "<"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"<\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 62) { - result1 = ">"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\">\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 92) { - result1 = "\\"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"\\\\\""); - } - } - if (result1 === null) { - result1 = parse_DQUOTE(); - if (result1 === null) { - if (input.charCodeAt(pos) === 47) { - result1 = "/"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 91) { - result1 = "["; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"[\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 93) { - result1 = "]"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"]\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 63) { - result1 = "?"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"?\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 123) { - result1 = "{"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"{\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 125) { - result1 = "}"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"}\""); - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset) { - return input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_STAR() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 42) { - result1 = "*"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"*\""); - } - } - if (result1 !== null) { - result2 = parse_SWS(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return "*"; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_SLASH() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 47) { - result1 = "/"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result1 !== null) { - result2 = parse_SWS(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return "/"; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_EQUAL() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 61) { - result1 = "="; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result1 !== null) { - result2 = parse_SWS(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return "="; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_LPAREN() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 40) { - result1 = "("; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"(\""); - } - } - if (result1 !== null) { - result2 = parse_SWS(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return "("; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_RPAREN() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 41) { - result1 = ")"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\")\""); - } - } - if (result1 !== null) { - result2 = parse_SWS(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return ")"; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_RAQUOT() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.charCodeAt(pos) === 62) { - result0 = ">"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\">\""); - } - } - if (result0 !== null) { - result1 = parse_SWS(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return ">"; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_LAQUOT() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 60) { - result1 = "<"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"<\""); - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return "<"; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_COMMA() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 44) { - result1 = ","; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - if (result1 !== null) { - result2 = parse_SWS(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return ","; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_SEMI() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 59) { - result1 = ";"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result1 !== null) { - result2 = parse_SWS(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return ";"; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_COLON() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_SWS(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return ":"; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_LDQUOT() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - result1 = parse_DQUOTE(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return "\""; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_RDQUOT() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_DQUOTE(); - if (result0 !== null) { - result1 = parse_SWS(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) {return "\""; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_comment() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_LPAREN(); - if (result0 !== null) { - result1 = []; - result2 = parse_ctext(); - if (result2 === null) { - result2 = parse_quoted_pair(); - if (result2 === null) { - result2 = parse_comment(); - } - } - while (result2 !== null) { - result1.push(result2); - result2 = parse_ctext(); - if (result2 === null) { - result2 = parse_quoted_pair(); - if (result2 === null) { - result2 = parse_comment(); - } - } - } - if (result1 !== null) { - result2 = parse_RPAREN(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_ctext() { - var result0; - - if (/^[!-']/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[!-']"); - } - } - if (result0 === null) { - if (/^[*-[]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[*-[]"); - } - } - if (result0 === null) { - if (/^[\]-~]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[\\]-~]"); - } - } - if (result0 === null) { - result0 = parse_UTF8_NONASCII(); - if (result0 === null) { - result0 = parse_LWS(); - } - } - } - } - return result0; - } - - function parse_quoted_string() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_SWS(); - if (result0 !== null) { - result1 = parse_DQUOTE(); - if (result1 !== null) { - result2 = []; - result3 = parse_qdtext(); - if (result3 === null) { - result3 = parse_quoted_pair(); - } - while (result3 !== null) { - result2.push(result3); - result3 = parse_qdtext(); - if (result3 === null) { - result3 = parse_quoted_pair(); - } - } - if (result2 !== null) { - result3 = parse_DQUOTE(); - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - return input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_qdtext() { - var result0; - - result0 = parse_LWS(); - if (result0 === null) { - if (input.charCodeAt(pos) === 33) { - result0 = "!"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"!\""); - } - } - if (result0 === null) { - if (/^[#-[]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[#-[]"); - } - } - if (result0 === null) { - if (/^[\]-~]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[\\]-~]"); - } - } - if (result0 === null) { - result0 = parse_UTF8_NONASCII(); - } - } - } - } - return result0; - } - - function parse_quoted_pair() { - var result0, result1; - var pos0; - - pos0 = pos; - if (input.charCodeAt(pos) === 92) { - result0 = "\\"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"\\\\\""); - } - } - if (result0 !== null) { - if (/^[\0-\t]/.test(input.charAt(pos))) { - result1 = input.charAt(pos); - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("[\\0-\\t]"); - } - } - if (result1 === null) { - if (/^[\x0B-\f]/.test(input.charAt(pos))) { - result1 = input.charAt(pos); - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("[\\x0B-\\f]"); - } - } - if (result1 === null) { - if (/^[\x0E-]/.test(input.charAt(pos))) { - result1 = input.charAt(pos); - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("[\\x0E-]"); - } - } - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_SIP_URI_simple() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_uri_scheme(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_userinfo(); - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result3 = parse_hostport(); - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - data.uri = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_SIP_URI() { - var result0, result1, result2, result3, result4, result5; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_uri_scheme(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_userinfo(); - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result3 = parse_hostport(); - if (result3 !== null) { - result4 = parse_uri_parameters(); - if (result4 !== null) { - result5 = parse_headers(); - result5 = result5 !== null ? result5 : ""; - if (result5 !== null) { - result0 = [result0, result1, result2, result3, result4, result5]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - data.uri = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_uri_scheme() { - var result0; - var pos0; - - pos0 = pos; - if (input.substr(pos, 3) === "sip") { - result0 = "sip"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"sip\""); - } - } - if (result0 !== null) { - result0 = (function(offset, uri_scheme) { - data.scheme = uri_scheme; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_userinfo() { - var result0, result1; - var pos0; - - pos0 = pos; - result0 = parse_user(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 64) { - result1 = "@"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_user() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - result1 = parse_user_unreserved(); - } - } - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - result1 = parse_user_unreserved(); - } - } - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset) { - data.user = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_user_unreserved() { - var result0; - - if (input.charCodeAt(pos) === 38) { - result0 = "&"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 61) { - result0 = "="; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 43) { - result0 = "+"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 36) { - result0 = "$"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 44) { - result0 = ","; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 59) { - result0 = ";"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 63) { - result0 = "?"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"?\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 47) { - result0 = "/"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - } - } - } - } - } - } - } - return result0; - } - - function parse_password() { - var result0, result1; - - result0 = []; - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - if (input.charCodeAt(pos) === 38) { - result1 = "&"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 61) { - result1 = "="; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 36) { - result1 = "$"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 44) { - result1 = ","; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - } - } - } - } - } - } - while (result1 !== null) { - result0.push(result1); - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - if (input.charCodeAt(pos) === 38) { - result1 = "&"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 61) { - result1 = "="; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 36) { - result1 = "$"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 44) { - result1 = ","; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - } - } - } - } - } - } - } - return result0; - } - - function parse_hostport() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - result0 = parse_host(); - if (result0 !== null) { - pos1 = pos; - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_port(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos1; - } - } else { - result1 = null; - pos = pos1; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_host() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_hostname(); - if (result0 === null) { - result0 = parse_IPv4address(); - if (result0 === null) { - result0 = parse_IPv6reference(); - } - } - if (result0 !== null) { - result0 = (function(offset) { - data.host = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_hostname() { - var result0, result1, result2; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - result0 = []; - pos2 = pos; - result1 = parse_domainlabel(); - if (result1 !== null) { - if (input.charCodeAt(pos) === 46) { - result2 = "."; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - while (result1 !== null) { - result0.push(result1); - pos2 = pos; - result1 = parse_domainlabel(); - if (result1 !== null) { - if (input.charCodeAt(pos) === 46) { - result2 = "."; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - } - if (result0 !== null) { - result1 = parse_toplabel(); - if (result1 !== null) { - if (input.charCodeAt(pos) === 46) { - result2 = "."; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - data.host_type = 'domain'; - return input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_domainlabel() { - var result0, result1; - - if (/^[a-zA-Z0-9_\-]/.test(input.charAt(pos))) { - result1 = input.charAt(pos); - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("[a-zA-Z0-9_\\-]"); - } - } - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - if (/^[a-zA-Z0-9_\-]/.test(input.charAt(pos))) { - result1 = input.charAt(pos); - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("[a-zA-Z0-9_\\-]"); - } - } - } - } else { - result0 = null; - } - return result0; - } - - function parse_toplabel() { - var result0, result1; - - if (/^[a-zA-Z_\-]/.test(input.charAt(pos))) { - result1 = input.charAt(pos); - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("[a-zA-Z_\\-]"); - } - } - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - if (/^[a-zA-Z_\-]/.test(input.charAt(pos))) { - result1 = input.charAt(pos); - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("[a-zA-Z_\\-]"); - } - } - } - } else { - result0 = null; - } - return result0; - } - - function parse_IPv6reference() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.charCodeAt(pos) === 91) { - result0 = "["; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"[\""); - } - } - if (result0 !== null) { - result1 = parse_IPv6address(); - if (result1 !== null) { - if (input.charCodeAt(pos) === 93) { - result2 = "]"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"]\""); - } - } - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - data.host_type = 'IPv6'; - return input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_IPv6address() { - var result0, result1, result2, result3, result4, result5, result6, result7, result8, result9, result10, result11, result12; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - result0 = parse_h16(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_h16(); - if (result2 !== null) { - if (input.charCodeAt(pos) === 58) { - result3 = ":"; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - result4 = parse_h16(); - if (result4 !== null) { - if (input.charCodeAt(pos) === 58) { - result5 = ":"; - pos++; - } else { - result5 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result5 !== null) { - result6 = parse_h16(); - if (result6 !== null) { - if (input.charCodeAt(pos) === 58) { - result7 = ":"; - pos++; - } else { - result7 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - result8 = parse_h16(); - if (result8 !== null) { - if (input.charCodeAt(pos) === 58) { - result9 = ":"; - pos++; - } else { - result9 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result9 !== null) { - result10 = parse_h16(); - if (result10 !== null) { - if (input.charCodeAt(pos) === 58) { - result11 = ":"; - pos++; - } else { - result11 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result11 !== null) { - result12 = parse_ls32(); - if (result12 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7, result8, result9, result10, result11, result12]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - if (input.substr(pos, 2) === "::") { - result0 = "::"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result0 !== null) { - result1 = parse_h16(); - if (result1 !== null) { - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - if (input.charCodeAt(pos) === 58) { - result4 = ":"; - pos++; - } else { - result4 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - result5 = parse_h16(); - if (result5 !== null) { - if (input.charCodeAt(pos) === 58) { - result6 = ":"; - pos++; - } else { - result6 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result6 !== null) { - result7 = parse_h16(); - if (result7 !== null) { - if (input.charCodeAt(pos) === 58) { - result8 = ":"; - pos++; - } else { - result8 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result8 !== null) { - result9 = parse_h16(); - if (result9 !== null) { - if (input.charCodeAt(pos) === 58) { - result10 = ":"; - pos++; - } else { - result10 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result10 !== null) { - result11 = parse_ls32(); - if (result11 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7, result8, result9, result10, result11]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - if (input.substr(pos, 2) === "::") { - result0 = "::"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result0 !== null) { - result1 = parse_h16(); - if (result1 !== null) { - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - if (input.charCodeAt(pos) === 58) { - result4 = ":"; - pos++; - } else { - result4 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - result5 = parse_h16(); - if (result5 !== null) { - if (input.charCodeAt(pos) === 58) { - result6 = ":"; - pos++; - } else { - result6 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result6 !== null) { - result7 = parse_h16(); - if (result7 !== null) { - if (input.charCodeAt(pos) === 58) { - result8 = ":"; - pos++; - } else { - result8 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result8 !== null) { - result9 = parse_ls32(); - if (result9 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - if (input.substr(pos, 2) === "::") { - result0 = "::"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result0 !== null) { - result1 = parse_h16(); - if (result1 !== null) { - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - if (input.charCodeAt(pos) === 58) { - result4 = ":"; - pos++; - } else { - result4 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - result5 = parse_h16(); - if (result5 !== null) { - if (input.charCodeAt(pos) === 58) { - result6 = ":"; - pos++; - } else { - result6 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result6 !== null) { - result7 = parse_ls32(); - if (result7 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - if (input.substr(pos, 2) === "::") { - result0 = "::"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result0 !== null) { - result1 = parse_h16(); - if (result1 !== null) { - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - if (input.charCodeAt(pos) === 58) { - result4 = ":"; - pos++; - } else { - result4 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - result5 = parse_ls32(); - if (result5 !== null) { - result0 = [result0, result1, result2, result3, result4, result5]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - if (input.substr(pos, 2) === "::") { - result0 = "::"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result0 !== null) { - result1 = parse_h16(); - if (result1 !== null) { - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_ls32(); - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - if (input.substr(pos, 2) === "::") { - result0 = "::"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result0 !== null) { - result1 = parse_ls32(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - if (input.substr(pos, 2) === "::") { - result0 = "::"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result0 !== null) { - result1 = parse_h16(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - result0 = parse_h16(); - if (result0 !== null) { - if (input.substr(pos, 2) === "::") { - result1 = "::"; - pos += 2; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result1 !== null) { - result2 = parse_h16(); - if (result2 !== null) { - if (input.charCodeAt(pos) === 58) { - result3 = ":"; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - result4 = parse_h16(); - if (result4 !== null) { - if (input.charCodeAt(pos) === 58) { - result5 = ":"; - pos++; - } else { - result5 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result5 !== null) { - result6 = parse_h16(); - if (result6 !== null) { - if (input.charCodeAt(pos) === 58) { - result7 = ":"; - pos++; - } else { - result7 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - result8 = parse_h16(); - if (result8 !== null) { - if (input.charCodeAt(pos) === 58) { - result9 = ":"; - pos++; - } else { - result9 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result9 !== null) { - result10 = parse_ls32(); - if (result10 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7, result8, result9, result10]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - result0 = parse_h16(); - if (result0 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_h16(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - if (input.substr(pos, 2) === "::") { - result2 = "::"; - pos += 2; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - if (input.charCodeAt(pos) === 58) { - result4 = ":"; - pos++; - } else { - result4 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - result5 = parse_h16(); - if (result5 !== null) { - if (input.charCodeAt(pos) === 58) { - result6 = ":"; - pos++; - } else { - result6 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result6 !== null) { - result7 = parse_h16(); - if (result7 !== null) { - if (input.charCodeAt(pos) === 58) { - result8 = ":"; - pos++; - } else { - result8 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result8 !== null) { - result9 = parse_ls32(); - if (result9 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - result0 = parse_h16(); - if (result0 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_h16(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - if (input.substr(pos, 2) === "::") { - result3 = "::"; - pos += 2; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result3 !== null) { - result4 = parse_h16(); - if (result4 !== null) { - if (input.charCodeAt(pos) === 58) { - result5 = ":"; - pos++; - } else { - result5 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result5 !== null) { - result6 = parse_h16(); - if (result6 !== null) { - if (input.charCodeAt(pos) === 58) { - result7 = ":"; - pos++; - } else { - result7 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - result8 = parse_ls32(); - if (result8 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7, result8]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - result0 = parse_h16(); - if (result0 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_h16(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result3 = ":"; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - result4 = parse_h16(); - if (result4 !== null) { - result3 = [result3, result4]; - } else { - result3 = null; - pos = pos2; - } - } else { - result3 = null; - pos = pos2; - } - result3 = result3 !== null ? result3 : ""; - if (result3 !== null) { - if (input.substr(pos, 2) === "::") { - result4 = "::"; - pos += 2; - } else { - result4 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result4 !== null) { - result5 = parse_h16(); - if (result5 !== null) { - if (input.charCodeAt(pos) === 58) { - result6 = ":"; - pos++; - } else { - result6 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result6 !== null) { - result7 = parse_ls32(); - if (result7 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - result0 = parse_h16(); - if (result0 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_h16(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result3 = ":"; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - result4 = parse_h16(); - if (result4 !== null) { - result3 = [result3, result4]; - } else { - result3 = null; - pos = pos2; - } - } else { - result3 = null; - pos = pos2; - } - result3 = result3 !== null ? result3 : ""; - if (result3 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result4 = ":"; - pos++; - } else { - result4 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - result5 = parse_h16(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos2; - } - } else { - result4 = null; - pos = pos2; - } - result4 = result4 !== null ? result4 : ""; - if (result4 !== null) { - if (input.substr(pos, 2) === "::") { - result5 = "::"; - pos += 2; - } else { - result5 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result5 !== null) { - result6 = parse_ls32(); - if (result6 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - result0 = parse_h16(); - if (result0 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_h16(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result3 = ":"; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - result4 = parse_h16(); - if (result4 !== null) { - result3 = [result3, result4]; - } else { - result3 = null; - pos = pos2; - } - } else { - result3 = null; - pos = pos2; - } - result3 = result3 !== null ? result3 : ""; - if (result3 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result4 = ":"; - pos++; - } else { - result4 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - result5 = parse_h16(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos2; - } - } else { - result4 = null; - pos = pos2; - } - result4 = result4 !== null ? result4 : ""; - if (result4 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result5 = ":"; - pos++; - } else { - result5 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result5 !== null) { - result6 = parse_h16(); - if (result6 !== null) { - result5 = [result5, result6]; - } else { - result5 = null; - pos = pos2; - } - } else { - result5 = null; - pos = pos2; - } - result5 = result5 !== null ? result5 : ""; - if (result5 !== null) { - if (input.substr(pos, 2) === "::") { - result6 = "::"; - pos += 2; - } else { - result6 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result6 !== null) { - result7 = parse_h16(); - if (result7 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - pos1 = pos; - result0 = parse_h16(); - if (result0 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_h16(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result2 = ":"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - result3 = parse_h16(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result3 = ":"; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - result4 = parse_h16(); - if (result4 !== null) { - result3 = [result3, result4]; - } else { - result3 = null; - pos = pos2; - } - } else { - result3 = null; - pos = pos2; - } - result3 = result3 !== null ? result3 : ""; - if (result3 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result4 = ":"; - pos++; - } else { - result4 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - result5 = parse_h16(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos2; - } - } else { - result4 = null; - pos = pos2; - } - result4 = result4 !== null ? result4 : ""; - if (result4 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result5 = ":"; - pos++; - } else { - result5 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result5 !== null) { - result6 = parse_h16(); - if (result6 !== null) { - result5 = [result5, result6]; - } else { - result5 = null; - pos = pos2; - } - } else { - result5 = null; - pos = pos2; - } - result5 = result5 !== null ? result5 : ""; - if (result5 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 58) { - result6 = ":"; - pos++; - } else { - result6 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result6 !== null) { - result7 = parse_h16(); - if (result7 !== null) { - result6 = [result6, result7]; - } else { - result6 = null; - pos = pos2; - } - } else { - result6 = null; - pos = pos2; - } - result6 = result6 !== null ? result6 : ""; - if (result6 !== null) { - if (input.substr(pos, 2) === "::") { - result7 = "::"; - pos += 2; - } else { - result7 = null; - if (reportFailures === 0) { - matchFailed("\"::\""); - } - } - if (result7 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6, result7]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - if (result0 !== null) { - result0 = (function(offset) { - data.host_type = 'IPv6'; - return input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_h16() { - var result0, result1, result2, result3; - var pos0; - - pos0 = pos; - result0 = parse_HEXDIG(); - if (result0 !== null) { - result1 = parse_HEXDIG(); - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result2 = parse_HEXDIG(); - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result3 = parse_HEXDIG(); - result3 = result3 !== null ? result3 : ""; - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_ls32() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_h16(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_h16(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - if (result0 === null) { - result0 = parse_IPv4address(); - } - return result0; - } - - function parse_IPv4address() { - var result0, result1, result2, result3, result4, result5, result6; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_dec_octet(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 46) { - result1 = "."; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result1 !== null) { - result2 = parse_dec_octet(); - if (result2 !== null) { - if (input.charCodeAt(pos) === 46) { - result3 = "."; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result3 !== null) { - result4 = parse_dec_octet(); - if (result4 !== null) { - if (input.charCodeAt(pos) === 46) { - result5 = "."; - pos++; - } else { - result5 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result5 !== null) { - result6 = parse_dec_octet(); - if (result6 !== null) { - result0 = [result0, result1, result2, result3, result4, result5, result6]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - data.host_type = 'IPv4'; - return input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_dec_octet() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - if (input.substr(pos, 2) === "25") { - result0 = "25"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"25\""); - } - } - if (result0 !== null) { - if (/^[0-5]/.test(input.charAt(pos))) { - result1 = input.charAt(pos); - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("[0-5]"); - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - if (result0 === null) { - pos0 = pos; - if (input.charCodeAt(pos) === 50) { - result0 = "2"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"2\""); - } - } - if (result0 !== null) { - if (/^[0-4]/.test(input.charAt(pos))) { - result1 = input.charAt(pos); - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("[0-4]"); - } - } - if (result1 !== null) { - result2 = parse_DIGIT(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - if (result0 === null) { - pos0 = pos; - if (input.charCodeAt(pos) === 49) { - result0 = "1"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"1\""); - } - } - if (result0 !== null) { - result1 = parse_DIGIT(); - if (result1 !== null) { - result2 = parse_DIGIT(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - if (result0 === null) { - pos0 = pos; - if (/^[1-9]/.test(input.charAt(pos))) { - result0 = input.charAt(pos); - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("[1-9]"); - } - } - if (result0 !== null) { - result1 = parse_DIGIT(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - if (result0 === null) { - result0 = parse_DIGIT(); - } - } - } - } - return result0; - } - - function parse_port() { - var result0, result1, result2, result3, result4; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_DIGIT(); - result0 = result0 !== null ? result0 : ""; - if (result0 !== null) { - result1 = parse_DIGIT(); - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result2 = parse_DIGIT(); - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result3 = parse_DIGIT(); - result3 = result3 !== null ? result3 : ""; - if (result3 !== null) { - result4 = parse_DIGIT(); - result4 = result4 !== null ? result4 : ""; - if (result4 !== null) { - result0 = [result0, result1, result2, result3, result4]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, port) { - port = parseInt(port.join("")); - data.port = port; - return port; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_uri_parameters() { - var result0, result1, result2; - var pos0; - - result0 = []; - pos0 = pos; - if (input.charCodeAt(pos) === 59) { - result1 = ";"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result1 !== null) { - result2 = parse_uri_parameter(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos0; - } - } else { - result1 = null; - pos = pos0; - } - while (result1 !== null) { - result0.push(result1); - pos0 = pos; - if (input.charCodeAt(pos) === 59) { - result1 = ";"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result1 !== null) { - result2 = parse_uri_parameter(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos0; - } - } else { - result1 = null; - pos = pos0; - } - } - return result0; - } - - function parse_uri_parameter() { - var result0; - - result0 = parse_transport_param(); - if (result0 === null) { - result0 = parse_user_param(); - if (result0 === null) { - result0 = parse_method_param(); - if (result0 === null) { - result0 = parse_ttl_param(); - if (result0 === null) { - result0 = parse_maddr_param(); - if (result0 === null) { - result0 = parse_lr_param(); - if (result0 === null) { - result0 = parse_other_param(); - } - } - } - } - } - } - return result0; - } - - function parse_transport_param() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 10) === "transport=") { - result0 = "transport="; - pos += 10; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"transport=\""); - } - } - if (result0 !== null) { - if (input.substr(pos, 3) === "udp") { - result1 = "udp"; - pos += 3; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"udp\""); - } - } - if (result1 === null) { - if (input.substr(pos, 3) === "tcp") { - result1 = "tcp"; - pos += 3; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"tcp\""); - } - } - if (result1 === null) { - if (input.substr(pos, 4) === "sctp") { - result1 = "sctp"; - pos += 4; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"sctp\""); - } - } - if (result1 === null) { - if (input.substr(pos, 3) === "tls") { - result1 = "tls"; - pos += 3; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"tls\""); - } - } - if (result1 === null) { - result1 = parse_token(); - } - } - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, transport) { - if(!data.params) data.params={}; - data.params['transport'] = transport; })(pos0, result0[1]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_user_param() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 5) === "user=") { - result0 = "user="; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"user=\""); - } - } - if (result0 !== null) { - if (input.substr(pos, 5) === "phone") { - result1 = "phone"; - pos += 5; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"phone\""); - } - } - if (result1 === null) { - if (input.substr(pos, 2) === "ip") { - result1 = "ip"; - pos += 2; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"ip\""); - } - } - if (result1 === null) { - result1 = parse_token(); - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, user) { - if(!data.params) data.params={}; - data.params['user'] = user; })(pos0, result0[1]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_method_param() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 7) === "method=") { - result0 = "method="; - pos += 7; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"method=\""); - } - } - if (result0 !== null) { - result1 = parse_Method(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, method) { - if(!data.params) data.params={}; - data.params['method'] = method; })(pos0, result0[1]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_ttl_param() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 4) === "ttl=") { - result0 = "ttl="; - pos += 4; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"ttl=\""); - } - } - if (result0 !== null) { - result1 = parse_ttl(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, ttl) { - if(!data.params) data.params={}; - data.params['ttl'] = ttl; })(pos0, result0[1]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_maddr_param() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 6) === "maddr=") { - result0 = "maddr="; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"maddr=\""); - } - } - if (result0 !== null) { - result1 = parse_host(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, maddr) { - if(!data.params) data.params={}; - data.params['maddr'] = maddr; })(pos0, result0[1]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_lr_param() { - var result0; - var pos0; - - pos0 = pos; - if (input.substr(pos, 2) === "lr") { - result0 = "lr"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"lr\""); - } - } - if (result0 !== null) { - result0 = (function(offset, lr) { - if(!data.params) data.params={}; - data.params['lr'] = true; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_other_param() { - var result0, result1, result2; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - result0 = parse_pname(); - if (result0 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 61) { - result1 = "="; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result1 !== null) { - result2 = parse_pvalue(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, param_name) { - if(!data.params) data.params={}; - if(param_name.length === (pos - offset)) { - data.params[param_name] = true; - } - else { - data.params[param_name] = input.substring(pos, offset+param_name.length+1); - }; })(pos0, result0[0]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_pname() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_paramchar(); - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_paramchar(); - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset, pname) {return pname.join(""); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_pvalue() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_paramchar(); - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_paramchar(); - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset, pvalue) {return pvalue.join(""); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_paramchar() { - var result0; - - result0 = parse_param_unreserved(); - if (result0 === null) { - result0 = parse_unreserved(); - if (result0 === null) { - result0 = parse_escaped(); - } - } - return result0; - } - - function parse_param_unreserved() { - var result0; - - if (input.charCodeAt(pos) === 91) { - result0 = "["; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"[\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 93) { - result0 = "]"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"]\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 47) { - result0 = "/"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 58) { - result0 = ":"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 38) { - result0 = "&"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 43) { - result0 = "+"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 36) { - result0 = "$"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - } - } - } - } - } - } - return result0; - } - - function parse_headers() { - var result0, result1, result2, result3, result4; - var pos0, pos1; - - pos0 = pos; - if (input.charCodeAt(pos) === 63) { - result0 = "?"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"?\""); - } - } - if (result0 !== null) { - result1 = parse_header(); - if (result1 !== null) { - result2 = []; - pos1 = pos; - if (input.charCodeAt(pos) === 38) { - result3 = "&"; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result3 !== null) { - result4 = parse_header(); - if (result4 !== null) { - result3 = [result3, result4]; - } else { - result3 = null; - pos = pos1; - } - } else { - result3 = null; - pos = pos1; - } - while (result3 !== null) { - result2.push(result3); - pos1 = pos; - if (input.charCodeAt(pos) === 38) { - result3 = "&"; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result3 !== null) { - result4 = parse_header(); - if (result4 !== null) { - result3 = [result3, result4]; - } else { - result3 = null; - pos = pos1; - } - } else { - result3 = null; - pos = pos1; - } - } - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_header() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_hname(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 61) { - result1 = "="; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result1 !== null) { - result2 = parse_hvalue(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_hname() { - var result0, result1; - - result1 = parse_hnv_unreserved(); - if (result1 === null) { - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - } - } - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_hnv_unreserved(); - if (result1 === null) { - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - } - } - } - } else { - result0 = null; - } - return result0; - } - - function parse_hvalue() { - var result0, result1; - - result0 = []; - result1 = parse_hnv_unreserved(); - if (result1 === null) { - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - } - } - while (result1 !== null) { - result0.push(result1); - result1 = parse_hnv_unreserved(); - if (result1 === null) { - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - } - } - } - return result0; - } - - function parse_hnv_unreserved() { - var result0; - - if (input.charCodeAt(pos) === 91) { - result0 = "["; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"[\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 93) { - result0 = "]"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"]\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 47) { - result0 = "/"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 63) { - result0 = "?"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"?\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 58) { - result0 = ":"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 43) { - result0 = "+"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 36) { - result0 = "$"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - } - } - } - } - } - } - return result0; - } - - function parse_Request_Response() { - var result0; - - result0 = parse_Status_Line(); - if (result0 === null) { - result0 = parse_Request_Line(); - } - return result0; - } - - function parse_Request_Line() { - var result0, result1, result2, result3, result4; - var pos0; - - pos0 = pos; - result0 = parse_Method(); - if (result0 !== null) { - result1 = parse_SP(); - if (result1 !== null) { - result2 = parse_Request_URI(); - if (result2 !== null) { - result3 = parse_SP(); - if (result3 !== null) { - result4 = parse_SIP_Version(); - if (result4 !== null) { - result0 = [result0, result1, result2, result3, result4]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Request_URI() { - var result0; - - result0 = parse_SIP_URI(); - if (result0 === null) { - result0 = parse_absoluteURI(); - } - return result0; - } - - function parse_absoluteURI() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_scheme(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_hier_part(); - if (result2 === null) { - result2 = parse_opaque_part(); - } - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_hier_part() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - result0 = parse_net_path(); - if (result0 === null) { - result0 = parse_abs_path(); - } - if (result0 !== null) { - pos1 = pos; - if (input.charCodeAt(pos) === 63) { - result1 = "?"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"?\""); - } - } - if (result1 !== null) { - result2 = parse_query(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos1; - } - } else { - result1 = null; - pos = pos1; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_net_path() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - if (input.substr(pos, 2) === "//") { - result0 = "//"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"//\""); - } - } - if (result0 !== null) { - result1 = parse_authority(); - if (result1 !== null) { - result2 = parse_abs_path(); - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_abs_path() { - var result0, result1; - var pos0; - - pos0 = pos; - if (input.charCodeAt(pos) === 47) { - result0 = "/"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result0 !== null) { - result1 = parse_path_segments(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_opaque_part() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_uric_no_slash(); - if (result0 !== null) { - result1 = []; - result2 = parse_uric(); - while (result2 !== null) { - result1.push(result2); - result2 = parse_uric(); - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_uric() { - var result0; - - result0 = parse_reserved(); - if (result0 === null) { - result0 = parse_unreserved(); - if (result0 === null) { - result0 = parse_escaped(); - } - } - return result0; - } - - function parse_uric_no_slash() { - var result0; - - result0 = parse_unreserved(); - if (result0 === null) { - result0 = parse_escaped(); - if (result0 === null) { - if (input.charCodeAt(pos) === 59) { - result0 = ";"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 63) { - result0 = "?"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"?\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 58) { - result0 = ":"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 64) { - result0 = "@"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 38) { - result0 = "&"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 61) { - result0 = "="; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 43) { - result0 = "+"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 36) { - result0 = "$"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 44) { - result0 = ","; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - } - } - } - } - } - } - } - } - } - } - return result0; - } - - function parse_path_segments() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_segment(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - if (input.charCodeAt(pos) === 47) { - result2 = "/"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result2 !== null) { - result3 = parse_segment(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - if (input.charCodeAt(pos) === 47) { - result2 = "/"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result2 !== null) { - result3 = parse_segment(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_segment() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = []; - result1 = parse_pchar(); - while (result1 !== null) { - result0.push(result1); - result1 = parse_pchar(); - } - if (result0 !== null) { - result1 = []; - pos1 = pos; - if (input.charCodeAt(pos) === 59) { - result2 = ";"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - result3 = parse_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - if (input.charCodeAt(pos) === 59) { - result2 = ";"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - result3 = parse_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_param() { - var result0, result1; - - result0 = []; - result1 = parse_pchar(); - while (result1 !== null) { - result0.push(result1); - result1 = parse_pchar(); - } - return result0; - } - - function parse_pchar() { - var result0; - - result0 = parse_unreserved(); - if (result0 === null) { - result0 = parse_escaped(); - if (result0 === null) { - if (input.charCodeAt(pos) === 58) { - result0 = ":"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 64) { - result0 = "@"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 38) { - result0 = "&"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 61) { - result0 = "="; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 43) { - result0 = "+"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 36) { - result0 = "$"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 44) { - result0 = ","; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - } - } - } - } - } - } - } - } - return result0; - } - - function parse_scheme() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_ALPHA(); - if (result0 !== null) { - result1 = []; - result2 = parse_ALPHA(); - if (result2 === null) { - result2 = parse_DIGIT(); - if (result2 === null) { - if (input.charCodeAt(pos) === 43) { - result2 = "+"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result2 === null) { - if (input.charCodeAt(pos) === 45) { - result2 = "-"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result2 === null) { - if (input.charCodeAt(pos) === 46) { - result2 = "."; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - } - } - } - } - while (result2 !== null) { - result1.push(result2); - result2 = parse_ALPHA(); - if (result2 === null) { - result2 = parse_DIGIT(); - if (result2 === null) { - if (input.charCodeAt(pos) === 43) { - result2 = "+"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result2 === null) { - if (input.charCodeAt(pos) === 45) { - result2 = "-"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result2 === null) { - if (input.charCodeAt(pos) === 46) { - result2 = "."; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - } - } - } - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - data.scheme= input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_authority() { - var result0; - - result0 = parse_srvr(); - if (result0 === null) { - result0 = parse_reg_name(); - } - return result0; - } - - function parse_srvr() { - var result0, result1; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_userinfo(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 64) { - result1 = "@"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - result0 = result0 !== null ? result0 : ""; - if (result0 !== null) { - result1 = parse_hostport(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - result0 = result0 !== null ? result0 : ""; - return result0; - } - - function parse_reg_name() { - var result0, result1; - - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - if (input.charCodeAt(pos) === 36) { - result1 = "$"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 44) { - result1 = ","; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 59) { - result1 = ";"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 64) { - result1 = "@"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 38) { - result1 = "&"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 61) { - result1 = "="; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - } - } - } - } - } - } - } - } - } - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - if (input.charCodeAt(pos) === 36) { - result1 = "$"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 44) { - result1 = ","; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 59) { - result1 = ";"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 64) { - result1 = "@"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 38) { - result1 = "&"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 61) { - result1 = "="; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - if (result1 === null) { - if (input.charCodeAt(pos) === 43) { - result1 = "+"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - } - } - } - } - } - } - } - } - } - } - } else { - result0 = null; - } - return result0; - } - - function parse_query() { - var result0, result1; - - result0 = []; - result1 = parse_uric(); - while (result1 !== null) { - result0.push(result1); - result1 = parse_uric(); - } - return result0; - } - - function parse_SIP_Version() { - var result0, result1, result2, result3, result4, result5; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 3) === "SIP") { - result0 = "SIP"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"SIP\""); - } - } - if (result0 !== null) { - if (input.charCodeAt(pos) === 47) { - result1 = "/"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"/\""); - } - } - if (result1 !== null) { - result3 = parse_DIGIT(); - if (result3 !== null) { - result2 = []; - while (result3 !== null) { - result2.push(result3); - result3 = parse_DIGIT(); - } - } else { - result2 = null; - } - if (result2 !== null) { - if (input.charCodeAt(pos) === 46) { - result3 = "."; - pos++; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result3 !== null) { - result5 = parse_DIGIT(); - if (result5 !== null) { - result4 = []; - while (result5 !== null) { - result4.push(result5); - result5 = parse_DIGIT(); - } - } else { - result4 = null; - } - if (result4 !== null) { - result0 = [result0, result1, result2, result3, result4]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - data.sip_version = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_INVITEm() { - var result0; - - if (input.substr(pos, 6) === "INVITE") { - result0 = "INVITE"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"INVITE\""); - } - } - return result0; - } - - function parse_ACKm() { - var result0; - - if (input.substr(pos, 3) === "ACK") { - result0 = "ACK"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"ACK\""); - } - } - return result0; - } - - function parse_OPTIONSm() { - var result0; - - if (input.substr(pos, 7) === "OPTIONS") { - result0 = "OPTIONS"; - pos += 7; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"OPTIONS\""); - } - } - return result0; - } - - function parse_BYEm() { - var result0; - - if (input.substr(pos, 3) === "BYE") { - result0 = "BYE"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"BYE\""); - } - } - return result0; - } - - function parse_CANCELm() { - var result0; - - if (input.substr(pos, 6) === "CANCEL") { - result0 = "CANCEL"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"CANCEL\""); - } - } - return result0; - } - - function parse_REGISTERm() { - var result0; - - if (input.substr(pos, 8) === "REGISTER") { - result0 = "REGISTER"; - pos += 8; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"REGISTER\""); - } - } - return result0; - } - - function parse_SUBSCRIBEm() { - var result0; - - if (input.substr(pos, 9) === "SUBSCRIBE") { - result0 = "SUBSCRIBE"; - pos += 9; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"SUBSCRIBE\""); - } - } - return result0; - } - - function parse_NOTIFYm() { - var result0; - - if (input.substr(pos, 6) === "NOTIFY") { - result0 = "NOTIFY"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"NOTIFY\""); - } - } - return result0; - } - - function parse_Method() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_INVITEm(); - if (result0 === null) { - result0 = parse_ACKm(); - if (result0 === null) { - result0 = parse_OPTIONSm(); - if (result0 === null) { - result0 = parse_BYEm(); - if (result0 === null) { - result0 = parse_CANCELm(); - if (result0 === null) { - result0 = parse_REGISTERm(); - if (result0 === null) { - result0 = parse_SUBSCRIBEm(); - if (result0 === null) { - result0 = parse_NOTIFYm(); - if (result0 === null) { - result0 = parse_token(); - } - } - } - } - } - } - } - } - if (result0 !== null) { - result0 = (function(offset) { - data.method = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_Status_Line() { - var result0, result1, result2, result3, result4; - var pos0; - - pos0 = pos; - result0 = parse_SIP_Version(); - if (result0 !== null) { - result1 = parse_SP(); - if (result1 !== null) { - result2 = parse_Status_Code(); - if (result2 !== null) { - result3 = parse_SP(); - if (result3 !== null) { - result4 = parse_Reason_Phrase(); - if (result4 !== null) { - result0 = [result0, result1, result2, result3, result4]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Status_Code() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_extension_code(); - if (result0 !== null) { - result0 = (function(offset, status_code) { - data.status_code = parseInt(status_code.join("")); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_extension_code() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_DIGIT(); - if (result0 !== null) { - result1 = parse_DIGIT(); - if (result1 !== null) { - result2 = parse_DIGIT(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Reason_Phrase() { - var result0, result1; - var pos0; - - pos0 = pos; - result0 = []; - result1 = parse_reserved(); - if (result1 === null) { - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - result1 = parse_UTF8_NONASCII(); - if (result1 === null) { - result1 = parse_UTF8_CONT(); - if (result1 === null) { - result1 = parse_SP(); - if (result1 === null) { - result1 = parse_HTAB(); - } - } - } - } - } - } - while (result1 !== null) { - result0.push(result1); - result1 = parse_reserved(); - if (result1 === null) { - result1 = parse_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - result1 = parse_UTF8_NONASCII(); - if (result1 === null) { - result1 = parse_UTF8_CONT(); - if (result1 === null) { - result1 = parse_SP(); - if (result1 === null) { - result1 = parse_HTAB(); - } - } - } - } - } - } - } - if (result0 !== null) { - result0 = (function(offset) { - data.reason_phrase = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_Allow_Events() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_event_type(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_event_type(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_event_type(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Call_ID() { - var result0, result1, result2; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - result0 = parse_word(); - if (result0 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 64) { - result1 = "@"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result1 !== null) { - result2 = parse_word(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - data = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_Contact() { - var result0, result1, result2, result3; - var pos0, pos1; - - result0 = parse_STAR(); - if (result0 === null) { - pos0 = pos; - result0 = parse_contact_param(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_contact_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_contact_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } - return result0; - } - - function parse_contact_param() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_addr_spec(); - if (result0 === null) { - result0 = parse_name_addr(); - } - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_contact_params(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_contact_params(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_name_addr() { - var result0, result1, result2, result3; - var pos0; - - pos0 = pos; - result0 = parse_display_name(); - result0 = result0 !== null ? result0 : ""; - if (result0 !== null) { - result1 = parse_LAQUOT(); - if (result1 !== null) { - result2 = parse_addr_spec(); - if (result2 !== null) { - result3 = parse_RAQUOT(); - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_addr_spec() { - var result0; - - result0 = parse_SIP_URI(); - if (result0 === null) { - result0 = parse_absoluteURI(); - } - return result0; - } - - function parse_addr_spec_simple() { - var result0; - - result0 = parse_SIP_URI_simple(); - if (result0 === null) { - result0 = parse_absoluteURI(); - } - return result0; - } - - function parse_display_name() { - var result0, result1, result2, result3; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - result0 = parse_token(); - if (result0 !== null) { - result1 = []; - pos2 = pos; - result2 = parse_LWS(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - while (result2 !== null) { - result1.push(result2); - pos2 = pos; - result2 = parse_LWS(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 === null) { - result0 = parse_quoted_string(); - } - if (result0 !== null) { - result0 = (function(offset, display_name) { - data.display_name = display_name; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_contact_params() { - var result0; - - result0 = parse_c_p_q(); - if (result0 === null) { - result0 = parse_c_p_expires(); - if (result0 === null) { - result0 = parse_contact_extension(); - } - } - return result0; - } - - function parse_c_p_q() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.charCodeAt(pos) === 113) { - result0 = "q"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"q\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_qvalue(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, q) { - if(!data.params) data.params = {}; - data.params['q'] = q; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_c_p_expires() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 7) === "expires") { - result0 = "expires"; - pos += 7; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"expires\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_delta_seconds(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, expires) { - if(!data.params) data.params = {}; - data.params['expires'] = expires; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_contact_extension() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_generic_param(); - if (result0 !== null) { - result0 = (function(offset, c_e) { - if(!data.params) data.params = {}; - if(c_e[1]) { - data.params[c_e[0]] = c_e[1]; - } - else { - data.params[c_e[0]] = true; - }; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_delta_seconds() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_DIGIT(); - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_DIGIT(); - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset, delta_seconds) { - return parseInt(delta_seconds.join("")); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_qvalue() { - var result0, result1, result2, result3, result4; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - if (input.charCodeAt(pos) === 48) { - result0 = "0"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"0\""); - } - } - if (result0 !== null) { - pos2 = pos; - if (input.charCodeAt(pos) === 46) { - result1 = "."; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result1 !== null) { - result2 = parse_DIGIT(); - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result3 = parse_DIGIT(); - result3 = result3 !== null ? result3 : ""; - if (result3 !== null) { - result4 = parse_DIGIT(); - result4 = result4 !== null ? result4 : ""; - if (result4 !== null) { - result1 = [result1, result2, result3, result4]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - return parseFloat(input.substring(pos, offset)); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_generic_param() { - var result0, result1, result2; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - result0 = parse_token(); - if (result0 !== null) { - pos2 = pos; - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_gen_value(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, param, value) { - if(typeof value === 'undefined') - var value = null; - else - value = value[1]; - return [ param, value ]; })(pos0, result0[0], result0[1]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_gen_value() { - var result0; - - result0 = parse_token(); - if (result0 === null) { - result0 = parse_host(); - if (result0 === null) { - result0 = parse_quoted_string(); - } - } - return result0; - } - - function parse_Content_Disposition() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_disp_type(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_disp_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_disp_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_disp_type() { - var result0; - - if (input.substr(pos, 6) === "render") { - result0 = "render"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"render\""); - } - } - if (result0 === null) { - if (input.substr(pos, 7) === "session") { - result0 = "session"; - pos += 7; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"session\""); - } - } - if (result0 === null) { - if (input.substr(pos, 4) === "icon") { - result0 = "icon"; - pos += 4; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"icon\""); - } - } - if (result0 === null) { - if (input.substr(pos, 5) === "alert") { - result0 = "alert"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"alert\""); - } - } - if (result0 === null) { - result0 = parse_token(); - } - } - } - } - return result0; - } - - function parse_disp_param() { - var result0; - - result0 = parse_handling_param(); - if (result0 === null) { - result0 = parse_generic_param(); - } - return result0; - } - - function parse_handling_param() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - if (input.substr(pos, 8) === "handling") { - result0 = "handling"; - pos += 8; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"handling\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - if (input.substr(pos, 8) === "optional") { - result2 = "optional"; - pos += 8; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"optional\""); - } - } - if (result2 === null) { - if (input.substr(pos, 8) === "required") { - result2 = "required"; - pos += 8; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"required\""); - } - } - if (result2 === null) { - result2 = parse_token(); - } - } - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Content_Encoding() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_token(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Content_Length() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_DIGIT(); - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_DIGIT(); - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset, length) { - data = parseInt(length.join('')); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_Content_Type() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_media_type(); - if (result0 !== null) { - result0 = (function(offset) { - data = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_media_type() { - var result0, result1, result2, result3, result4, result5; - var pos0, pos1; - - pos0 = pos; - result0 = parse_m_type(); - if (result0 !== null) { - result1 = parse_SLASH(); - if (result1 !== null) { - result2 = parse_m_subtype(); - if (result2 !== null) { - result3 = []; - pos1 = pos; - result4 = parse_SEMI(); - if (result4 !== null) { - result5 = parse_m_parameter(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos1; - } - } else { - result4 = null; - pos = pos1; - } - while (result4 !== null) { - result3.push(result4); - pos1 = pos; - result4 = parse_SEMI(); - if (result4 !== null) { - result5 = parse_m_parameter(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos1; - } - } else { - result4 = null; - pos = pos1; - } - } - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_m_type() { - var result0; - - result0 = parse_discrete_type(); - if (result0 === null) { - result0 = parse_composite_type(); - } - return result0; - } - - function parse_discrete_type() { - var result0; - - if (input.substr(pos, 4) === "text") { - result0 = "text"; - pos += 4; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"text\""); - } - } - if (result0 === null) { - if (input.substr(pos, 5) === "image") { - result0 = "image"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"image\""); - } - } - if (result0 === null) { - if (input.substr(pos, 5) === "audio") { - result0 = "audio"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"audio\""); - } - } - if (result0 === null) { - if (input.substr(pos, 5) === "video") { - result0 = "video"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"video\""); - } - } - if (result0 === null) { - if (input.substr(pos, 11) === "application") { - result0 = "application"; - pos += 11; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"application\""); - } - } - if (result0 === null) { - result0 = parse_extension_token(); - } - } - } - } - } - return result0; - } - - function parse_composite_type() { - var result0; - - if (input.substr(pos, 7) === "message") { - result0 = "message"; - pos += 7; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"message\""); - } - } - if (result0 === null) { - if (input.substr(pos, 9) === "multipart") { - result0 = "multipart"; - pos += 9; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"multipart\""); - } - } - if (result0 === null) { - result0 = parse_extension_token(); - } - } - return result0; - } - - function parse_extension_token() { - var result0; - - result0 = parse_token(); - if (result0 === null) { - result0 = parse_x_token(); - } - return result0; - } - - function parse_x_token() { - var result0, result1; - var pos0; - - pos0 = pos; - if (input.substr(pos, 2) === "x-") { - result0 = "x-"; - pos += 2; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"x-\""); - } - } - if (result0 !== null) { - result1 = parse_token(); - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_m_subtype() { - var result0; - - result0 = parse_extension_token(); - if (result0 === null) { - result0 = parse_token(); - } - return result0; - } - - function parse_m_parameter() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_token(); - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_m_value(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_m_value() { - var result0; - - result0 = parse_token(); - if (result0 === null) { - result0 = parse_quoted_string(); - } - return result0; - } - - function parse_CSeq() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_CSeq_value(); - if (result0 !== null) { - result1 = parse_LWS(); - if (result1 !== null) { - result2 = parse_Method(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_CSeq_value() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_DIGIT(); - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_DIGIT(); - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset, cseq_value) { - data.value=parseInt(cseq_value.join("")); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_Expires() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_delta_seconds(); - if (result0 !== null) { - result0 = (function(offset, expires) {data = expires; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_Event() { - var result0, result1, result2, result3; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - result0 = parse_event_type(); - if (result0 !== null) { - result1 = []; - pos2 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_event_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - while (result2 !== null) { - result1.push(result2); - pos2 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_event_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos2; - } - } else { - result2 = null; - pos = pos2; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, event_type) { - data.event = event_type.join(''); })(pos0, result0[0]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_event_type() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_token_nodot(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - if (input.charCodeAt(pos) === 46) { - result2 = "."; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result2 !== null) { - result3 = parse_token_nodot(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - if (input.charCodeAt(pos) === 46) { - result2 = "."; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result2 !== null) { - result3 = parse_token_nodot(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_event_param() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_generic_param(); - if (result0 !== null) { - result0 = (function(offset, e_v) { - if(!data.params) data.params = {}; - if(e_v[1]) { - data.params[e_v[0]] = e_v[1]; - } - else { - data.params[e_v[0]] = true; - }; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_From() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_addr_spec_simple(); - if (result0 === null) { - result0 = parse_name_addr(); - } - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_from_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_from_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_from_param() { - var result0; - - result0 = parse_tag_param(); - if (result0 === null) { - result0 = parse_generic_param(); - } - return result0; - } - - function parse_tag_param() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 3) === "tag") { - result0 = "tag"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"tag\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_token(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, tag) {data.tag = tag; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_Max_Forwards() { - var result0, result1; - var pos0; - - pos0 = pos; - result1 = parse_DIGIT(); - if (result1 !== null) { - result0 = []; - while (result1 !== null) { - result0.push(result1); - result1 = parse_DIGIT(); - } - } else { - result0 = null; - } - if (result0 !== null) { - result0 = (function(offset, forwards) { - data = parseInt(forwards.join("")); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_Min_Expires() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_delta_seconds(); - if (result0 !== null) { - result0 = (function(offset, min_expires) {data = min_expires; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_Proxy_Authenticate() { - var result0; - - result0 = parse_challenge(); - return result0; - } - - function parse_challenge() { - var result0, result1, result2, result3, result4, result5; - var pos0, pos1; - - pos0 = pos; - if (input.substr(pos, 6) === "Digest") { - result0 = "Digest"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"Digest\""); - } - } - if (result0 !== null) { - result1 = parse_LWS(); - if (result1 !== null) { - result2 = parse_digest_cln(); - if (result2 !== null) { - result3 = []; - pos1 = pos; - result4 = parse_COMMA(); - if (result4 !== null) { - result5 = parse_digest_cln(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos1; - } - } else { - result4 = null; - pos = pos1; - } - while (result4 !== null) { - result3.push(result4); - pos1 = pos; - result4 = parse_COMMA(); - if (result4 !== null) { - result5 = parse_digest_cln(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos1; - } - } else { - result4 = null; - pos = pos1; - } - } - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - if (result0 === null) { - result0 = parse_other_challenge(); - } - return result0; - } - - function parse_other_challenge() { - var result0, result1, result2, result3, result4, result5; - var pos0, pos1; - - pos0 = pos; - result0 = parse_token(); - if (result0 !== null) { - result1 = parse_LWS(); - if (result1 !== null) { - result2 = parse_auth_param(); - if (result2 !== null) { - result3 = []; - pos1 = pos; - result4 = parse_COMMA(); - if (result4 !== null) { - result5 = parse_auth_param(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos1; - } - } else { - result4 = null; - pos = pos1; - } - while (result4 !== null) { - result3.push(result4); - pos1 = pos; - result4 = parse_COMMA(); - if (result4 !== null) { - result5 = parse_auth_param(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos1; - } - } else { - result4 = null; - pos = pos1; - } - } - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_auth_param() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_token(); - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_token(); - if (result2 === null) { - result2 = parse_quoted_string(); - } - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_digest_cln() { - var result0; - - result0 = parse_realm(); - if (result0 === null) { - result0 = parse_domain(); - if (result0 === null) { - result0 = parse_nonce(); - if (result0 === null) { - result0 = parse_opaque(); - if (result0 === null) { - result0 = parse_stale(); - if (result0 === null) { - result0 = parse_algorithm(); - if (result0 === null) { - result0 = parse_qop_options(); - if (result0 === null) { - result0 = parse_auth_param(); - } - } - } - } - } - } - } - return result0; - } - - function parse_realm() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - if (input.substr(pos, 5) === "realm") { - result0 = "realm"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"realm\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_realm_value(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_realm_value() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_quoted_string(); - if (result0 !== null) { - result0 = (function(offset, realm) {data.realm = realm; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_domain() { - var result0, result1, result2, result3, result4, result5, result6; - var pos0, pos1; - - pos0 = pos; - if (input.substr(pos, 6) === "domain") { - result0 = "domain"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"domain\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_LDQUOT(); - if (result2 !== null) { - result3 = parse_URI(); - if (result3 !== null) { - result4 = []; - pos1 = pos; - result6 = parse_SP(); - if (result6 !== null) { - result5 = []; - while (result6 !== null) { - result5.push(result6); - result6 = parse_SP(); - } - } else { - result5 = null; - } - if (result5 !== null) { - result6 = parse_URI(); - if (result6 !== null) { - result5 = [result5, result6]; - } else { - result5 = null; - pos = pos1; - } - } else { - result5 = null; - pos = pos1; - } - while (result5 !== null) { - result4.push(result5); - pos1 = pos; - result6 = parse_SP(); - if (result6 !== null) { - result5 = []; - while (result6 !== null) { - result5.push(result6); - result6 = parse_SP(); - } - } else { - result5 = null; - } - if (result5 !== null) { - result6 = parse_URI(); - if (result6 !== null) { - result5 = [result5, result6]; - } else { - result5 = null; - pos = pos1; - } - } else { - result5 = null; - pos = pos1; - } - } - if (result4 !== null) { - result5 = parse_RDQUOT(); - if (result5 !== null) { - result0 = [result0, result1, result2, result3, result4, result5]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_URI() { - var result0; - - result0 = parse_absoluteURI(); - if (result0 === null) { - result0 = parse_abs_path(); - } - return result0; - } - - function parse_nonce() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - if (input.substr(pos, 5) === "nonce") { - result0 = "nonce"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"nonce\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_nonce_value(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_nonce_value() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_quoted_string(); - if (result0 !== null) { - result0 = (function(offset, nonce) {data.nonce=nonce; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_opaque() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 6) === "opaque") { - result0 = "opaque"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"opaque\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_quoted_string(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, opaque) { - data.opaque=opaque; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_stale() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 5) === "stale") { - result0 = "stale"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"stale\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - if (input.substr(pos, 4) === "true") { - result2 = "true"; - pos += 4; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"true\""); - } - } - if (result2 === null) { - if (input.substr(pos, 5) === "false") { - result2 = "false"; - pos += 5; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"false\""); - } - } - } - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, stale) { - data.stale=stale; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_algorithm() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 9) === "algorithm") { - result0 = "algorithm"; - pos += 9; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"algorithm\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - if (input.substr(pos, 3) === "MD5") { - result2 = "MD5"; - pos += 3; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"MD5\""); - } - } - if (result2 === null) { - if (input.substr(pos, 8) === "MD5-sess") { - result2 = "MD5-sess"; - pos += 8; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"MD5-sess\""); - } - } - if (result2 === null) { - result2 = parse_token(); - } - } - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, algorithm) { - data.algorithm=algorithm; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_qop_options() { - var result0, result1, result2, result3, result4, result5, result6; - var pos0, pos1, pos2, pos3; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 3) === "qop") { - result0 = "qop"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"qop\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_LDQUOT(); - if (result2 !== null) { - pos2 = pos; - result3 = parse_qop_value(); - if (result3 !== null) { - result4 = []; - pos3 = pos; - if (input.charCodeAt(pos) === 44) { - result5 = ","; - pos++; - } else { - result5 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - if (result5 !== null) { - result6 = parse_qop_value(); - if (result6 !== null) { - result5 = [result5, result6]; - } else { - result5 = null; - pos = pos3; - } - } else { - result5 = null; - pos = pos3; - } - while (result5 !== null) { - result4.push(result5); - pos3 = pos; - if (input.charCodeAt(pos) === 44) { - result5 = ","; - pos++; - } else { - result5 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - if (result5 !== null) { - result6 = parse_qop_value(); - if (result6 !== null) { - result5 = [result5, result6]; - } else { - result5 = null; - pos = pos3; - } - } else { - result5 = null; - pos = pos3; - } - } - if (result4 !== null) { - result3 = [result3, result4]; - } else { - result3 = null; - pos = pos2; - } - } else { - result3 = null; - pos = pos2; - } - if (result3 !== null) { - result4 = parse_RDQUOT(); - if (result4 !== null) { - result0 = [result0, result1, result2, result3, result4]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, qop) { - data.qop= input.substring(pos-1, offset+5); })(pos0, result0[3]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_qop_value() { - var result0; - - if (input.substr(pos, 8) === "auth-int") { - result0 = "auth-int"; - pos += 8; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"auth-int\""); - } - } - if (result0 === null) { - if (input.substr(pos, 4) === "auth") { - result0 = "auth"; - pos += 4; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"auth\""); - } - } - if (result0 === null) { - result0 = parse_token(); - } - } - return result0; - } - - function parse_Proxy_Require() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_token(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Record_Route() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_rec_route(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_rec_route(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_rec_route(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_rec_route() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_name_addr(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_generic_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_generic_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Require() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_token(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Route() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_route_param(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_route_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_route_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_route_param() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_name_addr(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_generic_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_generic_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_Subscription_State() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_substate_value(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_subexp_params(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_subexp_params(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_substate_value() { - var result0; - var pos0; - - pos0 = pos; - if (input.substr(pos, 6) === "active") { - result0 = "active"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"active\""); - } - } - if (result0 === null) { - if (input.substr(pos, 7) === "pending") { - result0 = "pending"; - pos += 7; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"pending\""); - } - } - if (result0 === null) { - if (input.substr(pos, 10) === "terminated") { - result0 = "terminated"; - pos += 10; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"terminated\""); - } - } - if (result0 === null) { - result0 = parse_token(); - } - } - } - if (result0 !== null) { - result0 = (function(offset) { - data.state = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_subexp_params() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 6) === "reason") { - result0 = "reason"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"reason\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_event_reason_value(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, reason) { - if (typeof reason !== 'undefined') data.reason = reason; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - if (result0 === null) { - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 7) === "expires") { - result0 = "expires"; - pos += 7; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"expires\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_delta_seconds(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, expires) { - if (typeof expires !== 'undefined') data.expires = expires; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - if (result0 === null) { - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 11) === "retry_after") { - result0 = "retry_after"; - pos += 11; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"retry_after\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_delta_seconds(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, retry_after) { - if (typeof retry_after !== 'undefined') data.retry_after = retry_after; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - if (result0 === null) { - pos0 = pos; - result0 = parse_generic_param(); - if (result0 !== null) { - result0 = (function(offset, g_p) { - if (typeof g_p !== 'undefined') { - if(!data.params) data.params = {}; - if(g_p[1]) data.params[g_p[0]] = g_p[1]; - else data.params[g_p[0]] = true; - }; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - } - } - } - return result0; - } - - function parse_event_reason_value() { - var result0; - - if (input.substr(pos, 11) === "deactivated") { - result0 = "deactivated"; - pos += 11; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"deactivated\""); - } - } - if (result0 === null) { - if (input.substr(pos, 9) === "probation") { - result0 = "probation"; - pos += 9; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"probation\""); - } - } - if (result0 === null) { - if (input.substr(pos, 8) === "rejected") { - result0 = "rejected"; - pos += 8; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"rejected\""); - } - } - if (result0 === null) { - if (input.substr(pos, 7) === "timeout") { - result0 = "timeout"; - pos += 7; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"timeout\""); - } - } - if (result0 === null) { - if (input.substr(pos, 6) === "giveup") { - result0 = "giveup"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"giveup\""); - } - } - if (result0 === null) { - if (input.substr(pos, 10) === "noresource") { - result0 = "noresource"; - pos += 10; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"noresource\""); - } - } - if (result0 === null) { - if (input.substr(pos, 9) === "invariant") { - result0 = "invariant"; - pos += 9; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"invariant\""); - } - } - if (result0 === null) { - result0 = parse_token(); - } - } - } - } - } - } - } - return result0; - } - - function parse_Subject() { - var result0; - - result0 = parse_TEXT_UTF8_TRIM(); - result0 = result0 !== null ? result0 : ""; - return result0; - } - - function parse_Supported() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_token(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_token(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - result0 = result0 !== null ? result0 : ""; - return result0; - } - - function parse_To() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_addr_spec_simple(); - if (result0 === null) { - result0 = parse_name_addr(); - } - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_to_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_SEMI(); - if (result2 !== null) { - result3 = parse_to_param(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_to_param() { - var result0; - - result0 = parse_tag_param(); - if (result0 === null) { - result0 = parse_generic_param(); - } - return result0; - } - - function parse_Via() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - result0 = parse_via_parm(); - if (result0 !== null) { - result1 = []; - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_via_parm(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - while (result2 !== null) { - result1.push(result2); - pos1 = pos; - result2 = parse_COMMA(); - if (result2 !== null) { - result3 = parse_via_parm(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_via_parm() { - var result0, result1, result2, result3, result4, result5; - var pos0, pos1; - - pos0 = pos; - result0 = parse_sent_protocol(); - if (result0 !== null) { - result1 = parse_LWS(); - if (result1 !== null) { - result2 = parse_sent_by(); - if (result2 !== null) { - result3 = []; - pos1 = pos; - result4 = parse_SEMI(); - if (result4 !== null) { - result5 = parse_via_params(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos1; - } - } else { - result4 = null; - pos = pos1; - } - while (result4 !== null) { - result3.push(result4); - pos1 = pos; - result4 = parse_SEMI(); - if (result4 !== null) { - result5 = parse_via_params(); - if (result5 !== null) { - result4 = [result4, result5]; - } else { - result4 = null; - pos = pos1; - } - } else { - result4 = null; - pos = pos1; - } - } - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_via_params() { - var result0; - - result0 = parse_via_ttl(); - if (result0 === null) { - result0 = parse_via_maddr(); - if (result0 === null) { - result0 = parse_via_received(); - if (result0 === null) { - result0 = parse_via_branch(); - if (result0 === null) { - result0 = parse_response_port(); - if (result0 === null) { - result0 = parse_generic_param(); - } - } - } - } - } - return result0; - } - - function parse_via_ttl() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 3) === "ttl") { - result0 = "ttl"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"ttl\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_ttl(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, via_ttl_value) { - data.ttl = via_ttl_value; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_via_maddr() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 5) === "maddr") { - result0 = "maddr"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"maddr\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_host(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, via_maddr) { - data.maddr = via_maddr; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_via_received() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 8) === "received") { - result0 = "received"; - pos += 8; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"received\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_IPv4address(); - if (result2 === null) { - result2 = parse_IPv6address(); - } - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, via_received) { - data.received = via_received; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_via_branch() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 6) === "branch") { - result0 = "branch"; - pos += 6; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"branch\""); - } - } - if (result0 !== null) { - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = parse_token(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, via_branch) { - data.branch = via_branch; })(pos0, result0[2]); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_response_port() { - var result0, result1, result2, result3; - var pos0, pos1, pos2; - - pos0 = pos; - pos1 = pos; - if (input.substr(pos, 5) === "rport") { - result0 = "rport"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"rport\""); - } - } - if (result0 !== null) { - pos2 = pos; - result1 = parse_EQUAL(); - if (result1 !== null) { - result2 = []; - result3 = parse_DIGIT(); - while (result3 !== null) { - result2.push(result3); - result3 = parse_DIGIT(); - } - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos2; - } - } else { - result1 = null; - pos = pos2; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - if(typeof response_port !== 'undefined') - data.rport = response_port.join(""); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_sent_protocol() { - var result0, result1, result2, result3, result4; - var pos0; - - pos0 = pos; - result0 = parse_protocol_name(); - if (result0 !== null) { - result1 = parse_SLASH(); - if (result1 !== null) { - result2 = parse_token(); - if (result2 !== null) { - result3 = parse_SLASH(); - if (result3 !== null) { - result4 = parse_transport(); - if (result4 !== null) { - result0 = [result0, result1, result2, result3, result4]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_protocol_name() { - var result0; - var pos0; - - pos0 = pos; - if (input.substr(pos, 3) === "SIP") { - result0 = "SIP"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"SIP\""); - } - } - if (result0 === null) { - result0 = parse_token(); - } - if (result0 !== null) { - result0 = (function(offset, via_protocol) { - data.protocol = via_protocol; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_transport() { - var result0; - var pos0; - - pos0 = pos; - if (input.substr(pos, 3) === "UDP") { - result0 = "UDP"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"UDP\""); - } - } - if (result0 === null) { - if (input.substr(pos, 3) === "TCP") { - result0 = "TCP"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"TCP\""); - } - } - if (result0 === null) { - if (input.substr(pos, 3) === "TLS") { - result0 = "TLS"; - pos += 3; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"TLS\""); - } - } - if (result0 === null) { - if (input.substr(pos, 4) === "SCTP") { - result0 = "SCTP"; - pos += 4; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"SCTP\""); - } - } - if (result0 === null) { - result0 = parse_token(); - } - } - } - } - if (result0 !== null) { - result0 = (function(offset, via_transport) { - data.transport = via_transport; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_sent_by() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - result0 = parse_via_host(); - if (result0 !== null) { - pos1 = pos; - result1 = parse_COLON(); - if (result1 !== null) { - result2 = parse_via_port(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos1; - } - } else { - result1 = null; - pos = pos1; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_via_host() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_hostname(); - if (result0 === null) { - result0 = parse_IPv4address(); - if (result0 === null) { - result0 = parse_IPv6reference(); - } - } - if (result0 !== null) { - result0 = (function(offset) { - data.host = input.substring(pos, offset); })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_via_port() { - var result0, result1, result2, result3, result4; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_DIGIT(); - result0 = result0 !== null ? result0 : ""; - if (result0 !== null) { - result1 = parse_DIGIT(); - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result2 = parse_DIGIT(); - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result3 = parse_DIGIT(); - result3 = result3 !== null ? result3 : ""; - if (result3 !== null) { - result4 = parse_DIGIT(); - result4 = result4 !== null ? result4 : ""; - if (result4 !== null) { - result0 = [result0, result1, result2, result3, result4]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, via_sent_by_port) { - data.port = parseInt(via_sent_by_port.join("")); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_ttl() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_DIGIT(); - if (result0 !== null) { - result1 = parse_DIGIT(); - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result2 = parse_DIGIT(); - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset, ttl) { - return parseInt(ttl.join("")); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_WWW_Authenticate() { - var result0; - - result0 = parse_challenge(); - return result0; - } - - function parse_extension_header() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_token(); - if (result0 !== null) { - result1 = parse_HCOLON(); - if (result1 !== null) { - result2 = parse_header_value(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_header_value() { - var result0, result1; - - result0 = []; - result1 = parse_TEXT_UTF8char(); - if (result1 === null) { - result1 = parse_UTF8_CONT(); - if (result1 === null) { - result1 = parse_LWS(); - } - } - while (result1 !== null) { - result0.push(result1); - result1 = parse_TEXT_UTF8char(); - if (result1 === null) { - result1 = parse_UTF8_CONT(); - if (result1 === null) { - result1 = parse_LWS(); - } - } - } - return result0; - } - - function parse_message_body() { - var result0, result1; - - result0 = []; - result1 = parse_OCTET(); - while (result1 !== null) { - result0.push(result1); - result1 = parse_OCTET(); - } - return result0; - } - - function parse_stun_URI() { - var result0, result1, result2; - var pos0; - - pos0 = pos; - result0 = parse_stun_scheme(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_stun_host_port(); - if (result2 !== null) { - result0 = [result0, result1, result2]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_stun_scheme() { - var result0; - var pos0; - - pos0 = pos; - if (input.substr(pos, 5) === "stuns") { - result0 = "stuns"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"stuns\""); - } - } - if (result0 === null) { - if (input.substr(pos, 4) === "stun") { - result0 = "stun"; - pos += 4; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"stun\""); - } - } - } - if (result0 !== null) { - result0 = (function(offset, scheme) { - data.scheme = scheme; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_stun_host_port() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - result0 = parse_stun_host(); - if (result0 !== null) { - pos1 = pos; - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_port(); - if (result2 !== null) { - result1 = [result1, result2]; - } else { - result1 = null; - pos = pos1; - } - } else { - result1 = null; - pos = pos1; - } - result1 = result1 !== null ? result1 : ""; - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_stun_host() { - var result0; - var pos0; - - pos0 = pos; - result0 = parse_reg_name(); - if (result0 === null) { - result0 = parse_IPv4address(); - if (result0 === null) { - result0 = parse_IPv6reference(); - } - } - if (result0 !== null) { - result0 = (function(offset, host) { - data.host = host.join(''); })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_reg_name() { - var result0, result1; - - result0 = []; - result1 = parse_stun_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - result1 = parse_sub_delims(); - } - } - while (result1 !== null) { - result0.push(result1); - result1 = parse_stun_unreserved(); - if (result1 === null) { - result1 = parse_escaped(); - if (result1 === null) { - result1 = parse_sub_delims(); - } - } - } - return result0; - } - - function parse_stun_unreserved() { - var result0; - - result0 = parse_ALPHA(); - if (result0 === null) { - result0 = parse_DIGIT(); - if (result0 === null) { - if (input.charCodeAt(pos) === 45) { - result0 = "-"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"-\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 46) { - result0 = "."; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\".\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 95) { - result0 = "_"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"_\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 126) { - result0 = "~"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"~\""); - } - } - } - } - } - } - } - return result0; - } - - function parse_sub_delims() { - var result0; - - if (input.charCodeAt(pos) === 33) { - result0 = "!"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"!\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 36) { - result0 = "$"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"$\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 38) { - result0 = "&"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"&\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 39) { - result0 = "'"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"'\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 40) { - result0 = "("; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"(\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 41) { - result0 = ")"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\")\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 42) { - result0 = "*"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"*\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 43) { - result0 = "+"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"+\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 44) { - result0 = ","; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\",\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 59) { - result0 = ";"; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\";\""); - } - } - if (result0 === null) { - if (input.charCodeAt(pos) === 61) { - result0 = "="; - pos++; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"=\""); - } - } - } - } - } - } - } - } - } - } - } - } - return result0; - } - - function parse_turn_URI() { - var result0, result1, result2, result3, result4; - var pos0, pos1; - - pos0 = pos; - result0 = parse_turn_scheme(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result2 = parse_stun_host_port(); - if (result2 !== null) { - pos1 = pos; - if (input.substr(pos, 11) === "?transport=") { - result3 = "?transport="; - pos += 11; - } else { - result3 = null; - if (reportFailures === 0) { - matchFailed("\"?transport=\""); - } - } - if (result3 !== null) { - result4 = parse_transport(); - if (result4 !== null) { - result3 = [result3, result4]; - } else { - result3 = null; - pos = pos1; - } - } else { - result3 = null; - pos = pos1; - } - result3 = result3 !== null ? result3 : ""; - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - function parse_turn_scheme() { - var result0; - var pos0; - - pos0 = pos; - if (input.substr(pos, 5) === "turns") { - result0 = "turns"; - pos += 5; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"turns\""); - } - } - if (result0 === null) { - if (input.substr(pos, 4) === "turn") { - result0 = "turn"; - pos += 4; - } else { - result0 = null; - if (reportFailures === 0) { - matchFailed("\"turn\""); - } - } - } - if (result0 !== null) { - result0 = (function(offset, scheme) { - data.scheme = scheme; })(pos0, result0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_turn_transport() { - var result0, result1, result2; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_transport(); - if (result0 !== null) { - if (input.substr(pos, 3) === "udp") { - result1 = "udp"; - pos += 3; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"udp\""); - } - } - if (result1 === null) { - if (input.substr(pos, 3) === "tcp") { - result1 = "tcp"; - pos += 3; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\"tcp\""); - } - } - if (result1 === null) { - result1 = []; - result2 = parse_unreserved(); - while (result2 !== null) { - result1.push(result2); - result2 = parse_unreserved(); - } - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - if (result0 !== null) { - result0 = (function(offset) { - data.transport = transport; })(pos0); - } - if (result0 === null) { - pos = pos0; - } - return result0; - } - - function parse_lazy_uri() { - var result0, result1, result2, result3; - var pos0, pos1; - - pos0 = pos; - pos1 = pos; - result0 = parse_uri_scheme(); - if (result0 !== null) { - if (input.charCodeAt(pos) === 58) { - result1 = ":"; - pos++; - } else { - result1 = null; - if (reportFailures === 0) { - matchFailed("\":\""); - } - } - if (result1 !== null) { - result0 = [result0, result1]; - } else { - result0 = null; - pos = pos1; - } - } else { - result0 = null; - pos = pos1; - } - result0 = result0 !== null ? result0 : ""; - if (result0 !== null) { - result1 = parse_user(); - if (result1 !== null) { - pos1 = pos; - if (input.charCodeAt(pos) === 64) { - result2 = "@"; - pos++; - } else { - result2 = null; - if (reportFailures === 0) { - matchFailed("\"@\""); - } - } - if (result2 !== null) { - result3 = parse_hostport(); - if (result3 !== null) { - result2 = [result2, result3]; - } else { - result2 = null; - pos = pos1; - } - } else { - result2 = null; - pos = pos1; - } - result2 = result2 !== null ? result2 : ""; - if (result2 !== null) { - result3 = parse_uri_parameters(); - if (result3 !== null) { - result0 = [result0, result1, result2, result3]; - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - } else { - result0 = null; - pos = pos0; - } - return result0; - } - - - function cleanupExpected(expected) { - expected.sort(); - - var lastExpected = null; - var cleanExpected = []; - for (var i = 0; i < expected.length; i++) { - if (expected[i] !== lastExpected) { - cleanExpected.push(expected[i]); - lastExpected = expected[i]; - } - } - return cleanExpected; - } - - function computeErrorPosition() { - /* - * The first idea was to use |String.split| to break the input up to the - * error position along newlines and derive the line and column from - * there. However IE's |split| implementation is so broken that it was - * enough to prevent it. - */ - - var line = 1; - var column = 1; - var seenCR = false; - - for (var i = 0; i < Math.max(pos, rightmostFailuresPos); i++) { - var ch = input.charAt(i); - if (ch === "\n") { - if (!seenCR) { line++; } - column = 1; - seenCR = false; - } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { - line++; - column = 1; - seenCR = true; - } else { - column++; - seenCR = false; - } - } - - return { line: line, column: column }; - } - - var data = {}; - - var result = parseFunctions[startRule](); - - /* - * The parser is now in one of the following three states: - * - * 1. The parser successfully parsed the whole input. - * - * - |result !== null| - * - |pos === input.length| - * - |rightmostFailuresExpected| may or may not contain something - * - * 2. The parser successfully parsed only a part of the input. - * - * - |result !== null| - * - |pos < input.length| - * - |rightmostFailuresExpected| may or may not contain something - * - * 3. The parser did not successfully parse any part of the input. - * - * - |result === null| - * - |pos === 0| - * - |rightmostFailuresExpected| contains at least one failure - * - * All code following this comment (including called functions) must - * handle these states. - */ - if (result === null || pos !== input.length) { - var offset = Math.max(pos, rightmostFailuresPos); - var found = offset < input.length ? input.charAt(offset) : null; - var errorPosition = computeErrorPosition(); - - new this.SyntaxError( - cleanupExpected(rightmostFailuresExpected), - found, - offset, - errorPosition.line, - errorPosition.column - ); - - return -1; - } - - return data; - }, - - /* Returns the parser source code. */ - toSource: function() { return this._source; } - }; - - /* Thrown when a parser encounters a syntax error. */ - - result.SyntaxError = function(expected, found, offset, line, column) { - function buildMessage(expected, found) { - var expectedHumanized, foundHumanized; - - switch (expected.length) { - case 0: - expectedHumanized = "end of input"; - break; - case 1: - expectedHumanized = expected[0]; - break; - default: - expectedHumanized = expected.slice(0, expected.length - 1).join(", ") - + " or " - + expected[expected.length - 1]; - } - - foundHumanized = found ? quote(found) : "end of input"; - - return "Expected " + expectedHumanized + " but " + foundHumanized + " found."; - } - - this.name = "SyntaxError"; - this.expected = expected; - this.found = found; - this.message = buildMessage(expected, found); - this.offset = offset; - this.line = line; - this.column = column; - }; - - result.SyntaxError.prototype = Error.prototype; - - return result; -})(); diff --git a/src/grammar/dist/grammar.min.js b/src/grammar/dist/grammar.min.js deleted file mode 100644 index 96648da44..000000000 --- a/src/grammar/dist/grammar.min.js +++ /dev/null @@ -1,148 +0,0 @@ -JsSIP.grammar=function(){function fb(f){return'"'+f.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var J={parse:function(f,C){function h(a){bO&&(O=b,wa=[]),wa.push(a))}function gb(){var a;"\r\n"===f.substr(b,2)?(a="\r\n",b+=2):(a=null,0===g&&h('"\\r\\n"'));return a}function p(){var a;/^[0-9]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a= -null,0===g&&h("[0-9]"));return a}function P(){var a;/^[a-zA-Z]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[a-zA-Z]"));return a}function G(){var a;/^[0-9a-fA-F]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[0-9a-fA-F]"));return a}function Q(){var a;a=z();null===a&&(a=H());return a}function xa(){var a;/^[\0-\xFF]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[\\0-\\xFF]"));return a}function D(){var a;/^["]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h('["]')); -return a}function z(){var a;32===f.charCodeAt(b)?(a=" ",b++):(a=null,0===g&&h('" "'));return a}function H(){var a;9===f.charCodeAt(b)?(a="\t",b++):(a=null,0===g&&h('"\\t"'));return a}function E(){var a;/^[a-zA-Z0-9]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[a-zA-Z0-9]"));return a}function da(){var a;59===f.charCodeAt(b)?(a=";",b++):(a=null,0===g&&h('";"'));if(null===a&&(47===f.charCodeAt(b)?(a="/",b++):(a=null,0===g&&h('"/"')),null===a))if(63===f.charCodeAt(b)?(a="?",b++):(a=null, -0===g&&h('"?"')),null===a)if(58===f.charCodeAt(b)?(a=":",b++):(a=null,0===g&&h('":"')),null===a)if(64===f.charCodeAt(b)?(a="@",b++):(a=null,0===g&&h('"@"')),null===a)if(38===f.charCodeAt(b)?(a="&",b++):(a=null,0===g&&h('"&"')),null===a)if(61===f.charCodeAt(b)?(a="=",b++):(a=null,0===g&&h('"="')),null===a)if(43===f.charCodeAt(b)?(a="+",b++):(a=null,0===g&&h('"+"')),null===a)if(36===f.charCodeAt(b)?(a="$",b++):(a=null,0===g&&h('"$"')),null===a)44===f.charCodeAt(b)?(a=",",b++):(a=null,0===g&&h('","')); -return a}function w(){var a;a=E();null===a&&(a=J());return a}function J(){var a;45===f.charCodeAt(b)?(a="-",b++):(a=null,0===g&&h('"-"'));if(null===a&&(95===f.charCodeAt(b)?(a="_",b++):(a=null,0===g&&h('"_"')),null===a))if(46===f.charCodeAt(b)?(a=".",b++):(a=null,0===g&&h('"."')),null===a)if(33===f.charCodeAt(b)?(a="!",b++):(a=null,0===g&&h('"!"')),null===a)if(126===f.charCodeAt(b)?(a="~",b++):(a=null,0===g&&h('"~"')),null===a)if(42===f.charCodeAt(b)?(a="*",b++):(a=null,0===g&&h('"*"')),null===a)if(39=== -f.charCodeAt(b)?(a="'",b++):(a=null,0===g&&h('"\'"')),null===a)if(40===f.charCodeAt(b)?(a="(",b++):(a=null,0===g&&h('"("')),null===a)41===f.charCodeAt(b)?(a=")",b++):(a=null,0===g&&h('")"'));return a}function x(){var a,c,d,e;e=b;37===f.charCodeAt(b)?(a="%",b++):(a=null,0===g&&h('"%"'));null!==a?(c=G(),null!==c?(d=G(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e);return a}function y(){var a,c,d,e,f;d=f=e=b;a=[];for(c=Q();null!==c;)a.push(c),c=Q();null!==a?(c=gb(),null!==c?a=[a,c]:(a= -null,b=d)):(a=null,b=d);a=null!==a?a:"";if(null!==a){d=Q();if(null!==d)for(c=[];null!==d;)c.push(d),d=Q();else c=null;null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;null!==a&&(a=" ");null===a&&(b=e);return a}function s(){var a;a=y();return null!==a?a:""}function hb(){var a,c,d,e,i;i=e=b;a=[];c=z();for(null===c&&(c=H());null!==c;)a.push(c),c=z(),null===c&&(c=H());null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?(d=s(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i):(a=null, -b=i);null!==a&&(a=":");null===a&&(b=e);return a}function ib(){var a,c,d,e,i,h,g;h=i=b;c=I();if(null!==c)for(a=[];null!==c;)a.push(c),c=I();else a=null;if(null!==a){c=[];g=b;d=[];for(e=y();null!==e;)d.push(e),e=y();null!==d?(e=I(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;){c.push(d);g=b;d=[];for(e=y();null!==e;)d.push(e),e=y();null!==d?(e=I(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g)}null!==c?a=[a,c]:(a=null,b=h)}else a=null,b=h;null!==a&&(a=f.substring(b,i));null===a&&(b=i);return a} -function I(){var a;/^[!-~]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[!-~]"));null===a&&(a=K());return a}function K(){var a;/^[\x80-\uFFFF]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[\\x80-\\uFFFF]"));return a}function R(){var a;/^[\x80-\xBF]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[\\x80-\\xBF]"));return a}function r(){var a,c,d;d=b;c=E();if(null===c&&(45===f.charCodeAt(b)?(c="-",b++):(c=null,0===g&&h('"-"')),null===c))if(46===f.charCodeAt(b)?(c=".", -b++):(c=null,0===g&&h('"."')),null===c)if(33===f.charCodeAt(b)?(c="!",b++):(c=null,0===g&&h('"!"')),null===c)if(37===f.charCodeAt(b)?(c="%",b++):(c=null,0===g&&h('"%"')),null===c)if(42===f.charCodeAt(b)?(c="*",b++):(c=null,0===g&&h('"*"')),null===c)if(95===f.charCodeAt(b)?(c="_",b++):(c=null,0===g&&h('"_"')),null===c)if(43===f.charCodeAt(b)?(c="+",b++):(c=null,0===g&&h('"+"')),null===c)if(96===f.charCodeAt(b)?(c="`",b++):(c=null,0===g&&h('"`"')),null===c)if(39===f.charCodeAt(b)?(c="'",b++):(c=null, -0===g&&h('"\'"')),null===c)126===f.charCodeAt(b)?(c="~",b++):(c=null,0===g&&h('"~"'));if(null!==c)for(a=[];null!==c;){if(a.push(c),c=E(),null===c&&(45===f.charCodeAt(b)?(c="-",b++):(c=null,0===g&&h('"-"')),null===c))if(46===f.charCodeAt(b)?(c=".",b++):(c=null,0===g&&h('"."')),null===c)if(33===f.charCodeAt(b)?(c="!",b++):(c=null,0===g&&h('"!"')),null===c)if(37===f.charCodeAt(b)?(c="%",b++):(c=null,0===g&&h('"%"')),null===c)if(42===f.charCodeAt(b)?(c="*",b++):(c=null,0===g&&h('"*"')),null===c)if(95=== -f.charCodeAt(b)?(c="_",b++):(c=null,0===g&&h('"_"')),null===c)if(43===f.charCodeAt(b)?(c="+",b++):(c=null,0===g&&h('"+"')),null===c)if(96===f.charCodeAt(b)?(c="`",b++):(c=null,0===g&&h('"`"')),null===c)if(39===f.charCodeAt(b)?(c="'",b++):(c=null,0===g&&h('"\'"')),null===c)126===f.charCodeAt(b)?(c="~",b++):(c=null,0===g&&h('"~"'))}else a=null;null!==a&&(a=f.substring(b,d));null===a&&(b=d);return a}function ea(){var a,c,d;d=b;c=E();if(null===c&&(45===f.charCodeAt(b)?(c="-",b++):(c=null,0===g&&h('"-"')), -null===c))if(33===f.charCodeAt(b)?(c="!",b++):(c=null,0===g&&h('"!"')),null===c)if(37===f.charCodeAt(b)?(c="%",b++):(c=null,0===g&&h('"%"')),null===c)if(42===f.charCodeAt(b)?(c="*",b++):(c=null,0===g&&h('"*"')),null===c)if(95===f.charCodeAt(b)?(c="_",b++):(c=null,0===g&&h('"_"')),null===c)if(43===f.charCodeAt(b)?(c="+",b++):(c=null,0===g&&h('"+"')),null===c)if(96===f.charCodeAt(b)?(c="`",b++):(c=null,0===g&&h('"`"')),null===c)if(39===f.charCodeAt(b)?(c="'",b++):(c=null,0===g&&h('"\'"')),null===c)126=== -f.charCodeAt(b)?(c="~",b++):(c=null,0===g&&h('"~"'));if(null!==c)for(a=[];null!==c;){if(a.push(c),c=E(),null===c&&(45===f.charCodeAt(b)?(c="-",b++):(c=null,0===g&&h('"-"')),null===c))if(33===f.charCodeAt(b)?(c="!",b++):(c=null,0===g&&h('"!"')),null===c)if(37===f.charCodeAt(b)?(c="%",b++):(c=null,0===g&&h('"%"')),null===c)if(42===f.charCodeAt(b)?(c="*",b++):(c=null,0===g&&h('"*"')),null===c)if(95===f.charCodeAt(b)?(c="_",b++):(c=null,0===g&&h('"_"')),null===c)if(43===f.charCodeAt(b)?(c="+",b++):(c= -null,0===g&&h('"+"')),null===c)if(96===f.charCodeAt(b)?(c="`",b++):(c=null,0===g&&h('"`"')),null===c)if(39===f.charCodeAt(b)?(c="'",b++):(c=null,0===g&&h('"\'"')),null===c)126===f.charCodeAt(b)?(c="~",b++):(c=null,0===g&&h('"~"'))}else a=null;null!==a&&(a=f.substring(b,d));null===a&&(b=d);return a}function ya(){var a,c,d;d=b;c=E();if(null===c&&(45===f.charCodeAt(b)?(c="-",b++):(c=null,0===g&&h('"-"')),null===c))if(46===f.charCodeAt(b)?(c=".",b++):(c=null,0===g&&h('"."')),null===c)if(33===f.charCodeAt(b)? -(c="!",b++):(c=null,0===g&&h('"!"')),null===c)if(37===f.charCodeAt(b)?(c="%",b++):(c=null,0===g&&h('"%"')),null===c)if(42===f.charCodeAt(b)?(c="*",b++):(c=null,0===g&&h('"*"')),null===c)if(95===f.charCodeAt(b)?(c="_",b++):(c=null,0===g&&h('"_"')),null===c)if(43===f.charCodeAt(b)?(c="+",b++):(c=null,0===g&&h('"+"')),null===c)if(96===f.charCodeAt(b)?(c="`",b++):(c=null,0===g&&h('"`"')),null===c)if(39===f.charCodeAt(b)?(c="'",b++):(c=null,0===g&&h('"\'"')),null===c)if(126===f.charCodeAt(b)?(c="~",b++): -(c=null,0===g&&h('"~"')),null===c)if(40===f.charCodeAt(b)?(c="(",b++):(c=null,0===g&&h('"("')),null===c)if(41===f.charCodeAt(b)?(c=")",b++):(c=null,0===g&&h('")"')),null===c)if(60===f.charCodeAt(b)?(c="<",b++):(c=null,0===g&&h('"<"')),null===c)if(62===f.charCodeAt(b)?(c=">",b++):(c=null,0===g&&h('">"')),null===c)if(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null===c)if(92===f.charCodeAt(b)?(c="\\",b++):(c=null,0===g&&h('"\\\\"')),null===c)if(c=D(),null===c&&(47===f.charCodeAt(b)?(c= -"/",b++):(c=null,0===g&&h('"/"')),null===c))if(91===f.charCodeAt(b)?(c="[",b++):(c=null,0===g&&h('"["')),null===c)if(93===f.charCodeAt(b)?(c="]",b++):(c=null,0===g&&h('"]"')),null===c)if(63===f.charCodeAt(b)?(c="?",b++):(c=null,0===g&&h('"?"')),null===c)if(123===f.charCodeAt(b)?(c="{",b++):(c=null,0===g&&h('"{"')),null===c)125===f.charCodeAt(b)?(c="}",b++):(c=null,0===g&&h('"}"'));if(null!==c)for(a=[];null!==c;){if(a.push(c),c=E(),null===c&&(45===f.charCodeAt(b)?(c="-",b++):(c=null,0===g&&h('"-"')), -null===c))if(46===f.charCodeAt(b)?(c=".",b++):(c=null,0===g&&h('"."')),null===c)if(33===f.charCodeAt(b)?(c="!",b++):(c=null,0===g&&h('"!"')),null===c)if(37===f.charCodeAt(b)?(c="%",b++):(c=null,0===g&&h('"%"')),null===c)if(42===f.charCodeAt(b)?(c="*",b++):(c=null,0===g&&h('"*"')),null===c)if(95===f.charCodeAt(b)?(c="_",b++):(c=null,0===g&&h('"_"')),null===c)if(43===f.charCodeAt(b)?(c="+",b++):(c=null,0===g&&h('"+"')),null===c)if(96===f.charCodeAt(b)?(c="`",b++):(c=null,0===g&&h('"`"')),null===c)if(39=== -f.charCodeAt(b)?(c="'",b++):(c=null,0===g&&h('"\'"')),null===c)if(126===f.charCodeAt(b)?(c="~",b++):(c=null,0===g&&h('"~"')),null===c)if(40===f.charCodeAt(b)?(c="(",b++):(c=null,0===g&&h('"("')),null===c)if(41===f.charCodeAt(b)?(c=")",b++):(c=null,0===g&&h('")"')),null===c)if(60===f.charCodeAt(b)?(c="<",b++):(c=null,0===g&&h('"<"')),null===c)if(62===f.charCodeAt(b)?(c=">",b++):(c=null,0===g&&h('">"')),null===c)if(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null===c)if(92===f.charCodeAt(b)? -(c="\\",b++):(c=null,0===g&&h('"\\\\"')),null===c)if(c=D(),null===c&&(47===f.charCodeAt(b)?(c="/",b++):(c=null,0===g&&h('"/"')),null===c))if(91===f.charCodeAt(b)?(c="[",b++):(c=null,0===g&&h('"["')),null===c)if(93===f.charCodeAt(b)?(c="]",b++):(c=null,0===g&&h('"]"')),null===c)if(63===f.charCodeAt(b)?(c="?",b++):(c=null,0===g&&h('"?"')),null===c)if(123===f.charCodeAt(b)?(c="{",b++):(c=null,0===g&&h('"{"')),null===c)125===f.charCodeAt(b)?(c="}",b++):(c=null,0===g&&h('"}"'))}else a=null;null!==a&&(a= -f.substring(b,d));null===a&&(b=d);return a}function jb(){var a,c,d,e,i;i=e=b;a=s();null!==a?(42===f.charCodeAt(b)?(c="*",b++):(c=null,0===g&&h('"*"')),null!==c)?(d=s(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i):(a=null,b=i);null!==a&&(a="*");null===a&&(b=e);return a}function fa(){var a,c,d,e,i;i=e=b;a=s();null!==a?(47===f.charCodeAt(b)?(c="/",b++):(c=null,0===g&&h('"/"')),null!==c)?(d=s(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i):(a=null,b=i);null!==a&&(a="/");null===a&&(b=e);return a}function t(){var a, -c,d,e,i;i=e=b;a=s();null!==a?(61===f.charCodeAt(b)?(c="=",b++):(c=null,0===g&&h('"="')),null!==c)?(d=s(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i):(a=null,b=i);null!==a&&(a="=");null===a&&(b=e);return a}function kb(){var a,c,d,e,i;i=e=b;a=s();null!==a?(40===f.charCodeAt(b)?(c="(",b++):(c=null,0===g&&h('"("')),null!==c)?(d=s(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i):(a=null,b=i);null!==a&&(a="(");null===a&&(b=e);return a}function lb(){var a,c,d,e,i;i=e=b;a=s();null!==a?(41===f.charCodeAt(b)? -(c=")",b++):(c=null,0===g&&h('")"')),null!==c)?(d=s(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i):(a=null,b=i);null!==a&&(a=")");null===a&&(b=e);return a}function mb(){var a,c,d,e;e=d=b;62===f.charCodeAt(b)?(a=">",b++):(a=null,0===g&&h('">"'));null!==a?(c=s(),null!==c?a=[a,c]:(a=null,b=e)):(a=null,b=e);null!==a&&(a=">");null===a&&(b=d);return a}function nb(){var a,c,d,e;e=d=b;a=s();null!==a?(60===f.charCodeAt(b)?(c="<",b++):(c=null,0===g&&h('"<"')),null!==c)?a=[a,c]:(a=null,b=e):(a=null,b=e);null!== -a&&(a="<");null===a&&(b=d);return a}function u(){var a,c,d,e,i;i=e=b;a=s();null!==a?(44===f.charCodeAt(b)?(c=",",b++):(c=null,0===g&&h('","')),null!==c)?(d=s(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i):(a=null,b=i);null!==a&&(a=",");null===a&&(b=e);return a}function v(){var a,c,d,e,i;i=e=b;a=s();null!==a?(59===f.charCodeAt(b)?(c=";",b++):(c=null,0===g&&h('";"')),null!==c)?(d=s(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i):(a=null,b=i);null!==a&&(a=";");null===a&&(b=e);return a}function ob(){var a, -c,d,e,i;i=e=b;a=s();null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?(d=s(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i):(a=null,b=i);null!==a&&(a=":");null===a&&(b=e);return a}function za(){var a,c,d,e;e=d=b;a=s();null!==a?(c=D(),null!==c?a=[a,c]:(a=null,b=e)):(a=null,b=e);null!==a&&(a='"');null===a&&(b=d);return a}function Aa(){var a,c,d,e;e=d=b;a=D();null!==a?(c=s(),null!==c?a=[a,c]:(a=null,b=e)):(a=null,b=e);null!==a&&(a='"');null===a&&(b=d);return a}function Ba(){var a, -c,d,e;e=b;a=kb();if(null!==a){c=[];d=Ca();null===d&&(d=S(),null===d&&(d=Ba()));for(;null!==d;)c.push(d),d=Ca(),null===d&&(d=S(),null===d&&(d=Ba()));null!==c?(d=lb(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)}else a=null,b=e;return a}function Ca(){var a;/^[!-']/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[!-']"));if(null===a&&(/^[*-[]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[*-[]")),null===a))if(/^[\]-~]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[\\]-~]")), -null===a)a=K(),null===a&&(a=y());return a}function F(){var a,c,d,e,i,g;g=i=b;a=s();if(null!==a)if(c=D(),null!==c){d=[];e=Da();for(null===e&&(e=S());null!==e;)d.push(e),e=Da(),null===e&&(e=S());null!==d?(e=D(),null!==e?a=[a,c,d,e]:(a=null,b=g)):(a=null,b=g)}else a=null,b=g;else a=null,b=g;null!==a&&(a=f.substring(b,i));null===a&&(b=i);return a}function Da(){var a;a=y();if(null===a&&(33===f.charCodeAt(b)?(a="!",b++):(a=null,0===g&&h('"!"')),null===a))if(/^[#-[]/.test(f.charAt(b))?(a=f.charAt(b),b++): -(a=null,0===g&&h("[#-[]")),null===a)/^[\]-~]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[\\]-~]")),null===a&&(a=K());return a}function S(){var a,c,d;d=b;92===f.charCodeAt(b)?(a="\\",b++):(a=null,0===g&&h('"\\\\"'));if(null!==a){/^[\0-\t]/.test(f.charAt(b))?(c=f.charAt(b),b++):(c=null,0===g&&h("[\\0-\\t]"));if(null===c&&(/^[\x0B-\f]/.test(f.charAt(b))?(c=f.charAt(b),b++):(c=null,0===g&&h("[\\x0B-\\f]")),null===c))/^[\x0E-\u007f]/.test(f.charAt(b))?(c=f.charAt(b),b++):(c=null,0===g&&h("[\\x0E-\u007f]")); -null!==c?a=[a,c]:(a=null,b=d)}else a=null,b=d;return a}function pb(){var a,c,d,e,i,j;j=i=b;a=ga();null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?(d=ha(),d=null!==d?d:"",null!==d?(e=T(),null!==e?a=[a,c,d,e]:(a=null,b=j)):(a=null,b=j)):(a=null,b=j):(a=null,b=j);null!==a&&(o.uri=f.substring(b,i),a=void 0);null===a&&(b=i);return a}function Ea(){var a,c,d,e,i,j,l,n;n=l=b;a=ga();null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?(d=ha(),d=null!== -d?d:"",null!==d?(e=T(),null!==e?(i=Fa(),null!==i?(j=qb(),j=null!==j?j:"",null!==j?a=[a,c,d,e,i,j]:(a=null,b=n)):(a=null,b=n)):(a=null,b=n)):(a=null,b=n)):(a=null,b=n):(a=null,b=n);null!==a&&(o.uri=f.substring(b,l),a=void 0);null===a&&(b=l);return a}function ga(){var a,c;c=b;"sip"===f.substr(b,3)?(a="sip",b+=3):(a=null,0===g&&h('"sip"'));null!==a&&(o.scheme=a,a=void 0);null===a&&(b=c);return a}function ha(){var a,c,d;d=b;a=Ga();null!==a?(64===f.charCodeAt(b)?(c="@",b++):(c=null,0===g&&h('"@"')),null!== -c)?a=[a,c]:(a=null,b=d):(a=null,b=d);return a}function Ga(){var a,c,d;d=b;c=w();null===c&&(c=x(),null===c&&(c=Ha()));if(null!==c)for(a=[];null!==c;)a.push(c),c=w(),null===c&&(c=x(),null===c&&(c=Ha()));else a=null;null!==a&&(o.user=f.substring(b,d),a=void 0);null===a&&(b=d);return a}function Ha(){var a;38===f.charCodeAt(b)?(a="&",b++):(a=null,0===g&&h('"&"'));if(null===a&&(61===f.charCodeAt(b)?(a="=",b++):(a=null,0===g&&h('"="')),null===a))if(43===f.charCodeAt(b)?(a="+",b++):(a=null,0===g&&h('"+"')), -null===a)if(36===f.charCodeAt(b)?(a="$",b++):(a=null,0===g&&h('"$"')),null===a)if(44===f.charCodeAt(b)?(a=",",b++):(a=null,0===g&&h('","')),null===a)if(59===f.charCodeAt(b)?(a=";",b++):(a=null,0===g&&h('";"')),null===a)if(63===f.charCodeAt(b)?(a="?",b++):(a=null,0===g&&h('"?"')),null===a)47===f.charCodeAt(b)?(a="/",b++):(a=null,0===g&&h('"/"'));return a}function T(){var a,c,d,e,i;e=b;a=U();null!==a?(i=b,58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c?(d=Ia(),null!==d?c=[c,d]:(c= -null,b=i)):(c=null,b=i),c=null!==c?c:"",null!==c)?a=[a,c]:(a=null,b=e):(a=null,b=e);return a}function U(){var a,c;c=b;a=Ja();null===a&&(a=L(),null===a&&(a=ia()));null!==a&&(o.host=f.substring(b,c),a=void 0);null===a&&(b=c);return a}function Ja(){var a,c,d,e,i,j;i=e=b;a=[];j=b;c=Ka();null!==c?(46===f.charCodeAt(b)?(d=".",b++):(d=null,0===g&&h('"."')),null!==d)?c=[c,d]:(c=null,b=j):(c=null,b=j);for(;null!==c;)(a.push(c),j=b,c=Ka(),null!==c)?(46===f.charCodeAt(b)?(d=".",b++):(d=null,0===g&&h('"."')), -null!==d)?c=[c,d]:(c=null,b=j):(c=null,b=j);null!==a?(c=rb(),null!==c)?(46===f.charCodeAt(b)?(d=".",b++):(d=null,0===g&&h('"."')),d=null!==d?d:"",null!==d)?a=[a,c,d]:(a=null,b=i):(a=null,b=i):(a=null,b=i);null!==a&&(o.host_type="domain",a=f.substring(b,e));null===a&&(b=e);return a}function Ka(){var a,c;/^[a-zA-Z0-9_\-]/.test(f.charAt(b))?(c=f.charAt(b),b++):(c=null,0===g&&h("[a-zA-Z0-9_\\-]"));if(null!==c)for(a=[];null!==c;)a.push(c),/^[a-zA-Z0-9_\-]/.test(f.charAt(b))?(c=f.charAt(b),b++):(c=null, -0===g&&h("[a-zA-Z0-9_\\-]"));else a=null;return a}function rb(){var a,c;/^[a-zA-Z_\-]/.test(f.charAt(b))?(c=f.charAt(b),b++):(c=null,0===g&&h("[a-zA-Z_\\-]"));if(null!==c)for(a=[];null!==c;)a.push(c),/^[a-zA-Z_\-]/.test(f.charAt(b))?(c=f.charAt(b),b++):(c=null,0===g&&h("[a-zA-Z_\\-]"));else a=null;return a}function ia(){var a,c,d,e,i;i=e=b;91===f.charCodeAt(b)?(a="[",b++):(a=null,0===g&&h('"["'));null!==a?(c=La(),null!==c)?(93===f.charCodeAt(b)?(d="]",b++):(d=null,0===g&&h('"]"')),null!==d)?a=[a, -c,d]:(a=null,b=i):(a=null,b=i):(a=null,b=i);null!==a&&(o.host_type="IPv6",a=f.substring(b,e));null===a&&(b=e);return a}function La(){var a,c,d,e,i,j,l,n,m,p,r,s,t,u,k;k=u=b;a=q();null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?(d=q(),null!==d)?(58===f.charCodeAt(b)?(e=":",b++):(e=null,0===g&&h('":"')),null!==e)?(i=q(),null!==i)?(58===f.charCodeAt(b)?(j=":",b++):(j=null,0===g&&h('":"')),null!==j)?(l=q(),null!==l)?(58===f.charCodeAt(b)?(n=":",b++):(n=null,0===g&&h('":"')), -null!==n)?(m=q(),null!==m)?(58===f.charCodeAt(b)?(p=":",b++):(p=null,0===g&&h('":"')),null!==p)?(r=q(),null!==r)?(58===f.charCodeAt(b)?(s=":",b++):(s=null,0===g&&h('":"')),null!==s)?(t=A(),null!==t?a=[a,c,d,e,i,j,l,n,m,p,r,s,t]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k);if(null===a&&(k=b,"::"===f.substr(b,2)?(a="::",b+=2):(a=null,0===g&&h('"::"')),null!==a?(c=q(),null!==c)? -(58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d)?(e=q(),null!==e)?(58===f.charCodeAt(b)?(i=":",b++):(i=null,0===g&&h('":"')),null!==i)?(j=q(),null!==j)?(58===f.charCodeAt(b)?(l=":",b++):(l=null,0===g&&h('":"')),null!==l)?(n=q(),null!==n)?(58===f.charCodeAt(b)?(m=":",b++):(m=null,0===g&&h('":"')),null!==m)?(p=q(),null!==p)?(58===f.charCodeAt(b)?(r=":",b++):(r=null,0===g&&h('":"')),null!==r)?(s=A(),null!==s?a=[a,c,d,e,i,j,l,n,m,p,r,s]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null, -b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a))if(k=b,"::"===f.substr(b,2)?(a="::",b+=2):(a=null,0===g&&h('"::"')),null!==a?(c=q(),null!==c)?(58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d)?(e=q(),null!==e)?(58===f.charCodeAt(b)?(i=":",b++):(i=null,0===g&&h('":"')),null!==i)?(j=q(),null!==j)?(58===f.charCodeAt(b)?(l=":",b++):(l=null,0===g&&h('":"')),null!==l)?(n=q(),null!==n)?(58===f.charCodeAt(b)?(m=":",b++): -(m=null,0===g&&h('":"')),null!==m)?(p=A(),null!==p?a=[a,c,d,e,i,j,l,n,m,p]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)if(k=b,"::"===f.substr(b,2)?(a="::",b+=2):(a=null,0===g&&h('"::"')),null!==a?(c=q(),null!==c)?(58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d)?(e=q(),null!==e)?(58===f.charCodeAt(b)?(i=":",b++):(i=null,0===g&&h('":"')),null!==i)?(j=q(),null!==j)?(58===f.charCodeAt(b)? -(l=":",b++):(l=null,0===g&&h('":"')),null!==l)?(n=A(),null!==n?a=[a,c,d,e,i,j,l,n]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)if(k=b,"::"===f.substr(b,2)?(a="::",b+=2):(a=null,0===g&&h('"::"')),null!==a?(c=q(),null!==c)?(58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d)?(e=q(),null!==e)?(58===f.charCodeAt(b)?(i=":",b++):(i=null,0===g&&h('":"')),null!==i)?(j=A(),null!==j?a=[a,c,d,e,i,j]:(a=null,b=k)):(a=null,b= -k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)if(k=b,"::"===f.substr(b,2)?(a="::",b+=2):(a=null,0===g&&h('"::"')),null!==a?(c=q(),null!==c)?(58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d)?(e=A(),null!==e?a=[a,c,d,e]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)if(k=b,"::"===f.substr(b,2)?(a="::",b+=2):(a=null,0===g&&h('"::"')),null!==a?(c=A(),null!==c?a=[a,c]:(a=null,b=k)):(a=null,b=k),null===a)if(k=b,"::"===f.substr(b,2)?(a="::",b+=2):(a=null, -0===g&&h('"::"')),null!==a?(c=q(),null!==c?a=[a,c]:(a=null,b=k)):(a=null,b=k),null===a)if(k=b,a=q(),null!==a?("::"===f.substr(b,2)?(c="::",b+=2):(c=null,0===g&&h('"::"')),null!==c)?(d=q(),null!==d)?(58===f.charCodeAt(b)?(e=":",b++):(e=null,0===g&&h('":"')),null!==e)?(i=q(),null!==i)?(58===f.charCodeAt(b)?(j=":",b++):(j=null,0===g&&h('":"')),null!==j)?(l=q(),null!==l)?(58===f.charCodeAt(b)?(n=":",b++):(n=null,0===g&&h('":"')),null!==n)?(m=q(),null!==m)?(58===f.charCodeAt(b)?(p=":",b++):(p=null,0=== -g&&h('":"')),null!==p)?(r=A(),null!==r?a=[a,c,d,e,i,j,l,n,m,p,r]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)if(k=b,a=q(),null!==a?(m=b,58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c?(d=q(),null!==d?c=[c,d]:(c=null,b=m)):(c=null,b=m),c=null!==c?c:"",null!==c)?("::"===f.substr(b,2)?(d="::",b+=2):(d=null,0===g&&h('"::"')),null!==d)?(e=q(),null!==e)?(58===f.charCodeAt(b)?(i= -":",b++):(i=null,0===g&&h('":"')),null!==i)?(j=q(),null!==j)?(58===f.charCodeAt(b)?(l=":",b++):(l=null,0===g&&h('":"')),null!==l)?(n=q(),null!==n)?(58===f.charCodeAt(b)?(m=":",b++):(m=null,0===g&&h('":"')),null!==m)?(p=A(),null!==p?a=[a,c,d,e,i,j,l,n,m,p]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)if(k=b,a=q(),null!==a?(m=b,58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c?(d=q(),null!== -d?c=[c,d]:(c=null,b=m)):(c=null,b=m),c=null!==c?c:"",null!==c)?(m=b,58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d?(e=q(),null!==e?d=[d,e]:(d=null,b=m)):(d=null,b=m),d=null!==d?d:"",null!==d)?("::"===f.substr(b,2)?(e="::",b+=2):(e=null,0===g&&h('"::"')),null!==e)?(i=q(),null!==i)?(58===f.charCodeAt(b)?(j=":",b++):(j=null,0===g&&h('":"')),null!==j)?(l=q(),null!==l)?(58===f.charCodeAt(b)?(n=":",b++):(n=null,0===g&&h('":"')),null!==n)?(m=A(),null!==m?a=[a,c,d,e,i,j,l,n,m]:(a=null, -b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)if(k=b,a=q(),null!==a?(m=b,58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c?(d=q(),null!==d?c=[c,d]:(c=null,b=m)):(c=null,b=m),c=null!==c?c:"",null!==c)?(m=b,58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d?(e=q(),null!==e?d=[d,e]:(d=null,b=m)):(d=null,b=m),d=null!==d?d:"",null!==d)?(m=b,58===f.charCodeAt(b)?(e=":",b++):(e=null,0===g&&h('":"')), -null!==e?(i=q(),null!==i?e=[e,i]:(e=null,b=m)):(e=null,b=m),e=null!==e?e:"",null!==e)?("::"===f.substr(b,2)?(i="::",b+=2):(i=null,0===g&&h('"::"')),null!==i)?(j=q(),null!==j)?(58===f.charCodeAt(b)?(l=":",b++):(l=null,0===g&&h('":"')),null!==l)?(n=A(),null!==n?a=[a,c,d,e,i,j,l,n]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)if(k=b,a=q(),null!==a?(m=b,58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c?(d=q(),null!== -d?c=[c,d]:(c=null,b=m)):(c=null,b=m),c=null!==c?c:"",null!==c)?(m=b,58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d?(e=q(),null!==e?d=[d,e]:(d=null,b=m)):(d=null,b=m),d=null!==d?d:"",null!==d)?(m=b,58===f.charCodeAt(b)?(e=":",b++):(e=null,0===g&&h('":"')),null!==e?(i=q(),null!==i?e=[e,i]:(e=null,b=m)):(e=null,b=m),e=null!==e?e:"",null!==e)?(m=b,58===f.charCodeAt(b)?(i=":",b++):(i=null,0===g&&h('":"')),null!==i?(j=q(),null!==j?i=[i,j]:(i=null,b=m)):(i=null,b=m),i=null!==i?i:"",null!== -i)?("::"===f.substr(b,2)?(j="::",b+=2):(j=null,0===g&&h('"::"')),null!==j)?(l=A(),null!==l?a=[a,c,d,e,i,j,l]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)if(k=b,a=q(),null!==a?(m=b,58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c?(d=q(),null!==d?c=[c,d]:(c=null,b=m)):(c=null,b=m),c=null!==c?c:"",null!==c)?(m=b,58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d?(e=q(),null!==e?d=[d,e]:(d=null,b=m)):(d=null,b= -m),d=null!==d?d:"",null!==d)?(m=b,58===f.charCodeAt(b)?(e=":",b++):(e=null,0===g&&h('":"')),null!==e?(i=q(),null!==i?e=[e,i]:(e=null,b=m)):(e=null,b=m),e=null!==e?e:"",null!==e)?(m=b,58===f.charCodeAt(b)?(i=":",b++):(i=null,0===g&&h('":"')),null!==i?(j=q(),null!==j?i=[i,j]:(i=null,b=m)):(i=null,b=m),i=null!==i?i:"",null!==i)?(m=b,58===f.charCodeAt(b)?(j=":",b++):(j=null,0===g&&h('":"')),null!==j?(l=q(),null!==l?j=[j,l]:(j=null,b=m)):(j=null,b=m),j=null!==j?j:"",null!==j)?("::"===f.substr(b,2)?(l= -"::",b+=2):(l=null,0===g&&h('"::"')),null!==l)?(n=q(),null!==n?a=[a,c,d,e,i,j,l,n]:(a=null,b=k)):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k),null===a)(k=b,a=q(),null!==a)?(m=b,58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c?(d=q(),null!==d?c=[c,d]:(c=null,b=m)):(c=null,b=m),c=null!==c?c:"",null!==c)?(m=b,58===f.charCodeAt(b)?(d=":",b++):(d=null,0===g&&h('":"')),null!==d?(e=q(),null!==e?d=[d,e]:(d=null,b=m)):(d=null,b=m),d=null!==d? -d:"",null!==d)?(m=b,58===f.charCodeAt(b)?(e=":",b++):(e=null,0===g&&h('":"')),null!==e?(i=q(),null!==i?e=[e,i]:(e=null,b=m)):(e=null,b=m),e=null!==e?e:"",null!==e)?(m=b,58===f.charCodeAt(b)?(i=":",b++):(i=null,0===g&&h('":"')),null!==i?(j=q(),null!==j?i=[i,j]:(i=null,b=m)):(i=null,b=m),i=null!==i?i:"",null!==i)?(m=b,58===f.charCodeAt(b)?(j=":",b++):(j=null,0===g&&h('":"')),null!==j?(l=q(),null!==l?j=[j,l]:(j=null,b=m)):(j=null,b=m),j=null!==j?j:"",null!==j)?(m=b,58===f.charCodeAt(b)?(l=":",b++):(l= -null,0===g&&h('":"')),null!==l?(n=q(),null!==n?l=[l,n]:(l=null,b=m)):(l=null,b=m),l=null!==l?l:"",null!==l)?("::"===f.substr(b,2)?(n="::",b+=2):(n=null,0===g&&h('"::"')),null!==n)?a=[a,c,d,e,i,j,l,n]:(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k):(a=null,b=k);null!==a&&(o.host_type="IPv6",a=f.substring(b,u));null===a&&(b=u);return a}function q(){var a,c,d,e,f;f=b;a=G();null!==a?(c=G(),c=null!==c?c:"",null!==c?(d=G(),d=null!==d?d:"",null!==d?(e=G(),e=null!== -e?e:"",null!==e?a=[a,c,d,e]:(a=null,b=f)):(a=null,b=f)):(a=null,b=f)):(a=null,b=f);return a}function A(){var a,c,d,e;e=b;a=q();null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?(d=q(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e):(a=null,b=e);null===a&&(a=L());return a}function L(){var a,c,d,e,i,j,l,n,m;m=n=b;a=V();null!==a?(46===f.charCodeAt(b)?(c=".",b++):(c=null,0===g&&h('"."')),null!==c)?(d=V(),null!==d)?(46===f.charCodeAt(b)?(e=".",b++):(e=null,0===g&&h('"."')),null!== -e)?(i=V(),null!==i)?(46===f.charCodeAt(b)?(j=".",b++):(j=null,0===g&&h('"."')),null!==j)?(l=V(),null!==l?a=[a,c,d,e,i,j,l]:(a=null,b=m)):(a=null,b=m):(a=null,b=m):(a=null,b=m):(a=null,b=m):(a=null,b=m):(a=null,b=m);null!==a&&(o.host_type="IPv4",a=f.substring(b,n));null===a&&(b=n);return a}function V(){var a,c,d,e;e=b;"25"===f.substr(b,2)?(a="25",b+=2):(a=null,0===g&&h('"25"'));null!==a?(/^[0-5]/.test(f.charAt(b))?(c=f.charAt(b),b++):(c=null,0===g&&h("[0-5]")),null!==c)?a=[a,c]:(a=null,b=e):(a=null, -b=e);if(null===a&&(e=b,50===f.charCodeAt(b)?(a="2",b++):(a=null,0===g&&h('"2"')),null!==a?(/^[0-4]/.test(f.charAt(b))?(c=f.charAt(b),b++):(c=null,0===g&&h("[0-4]")),null!==c)?(d=p(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e):(a=null,b=e),null===a))if(e=b,49===f.charCodeAt(b)?(a="1",b++):(a=null,0===g&&h('"1"')),null!==a?(c=p(),null!==c?(d=p(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e),null===a)e=b,/^[1-9]/.test(f.charAt(b))?(a=f.charAt(b),b++):(a=null,0===g&&h("[1-9]")),null!== -a?(c=p(),null!==c?a=[a,c]:(a=null,b=e)):(a=null,b=e),null===a&&(a=p());return a}function Ia(){var a,c,d,e,f,g,h;h=g=b;a=p();a=null!==a?a:"";null!==a?(c=p(),c=null!==c?c:"",null!==c?(d=p(),d=null!==d?d:"",null!==d?(e=p(),e=null!==e?e:"",null!==e?(f=p(),f=null!==f?f:"",null!==f?a=[a,c,d,e,f]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h)):(a=null,b=h)):(a=null,b=h);null!==a&&(a=parseInt(a.join("")),o.port=a);null===a&&(b=g);return a}function Fa(){var a,c,d,e;a=[];e=b;59===f.charCodeAt(b)?(c=";",b++):(c=null, -0===g&&h('";"'));null!==c?(d=Ma(),null!==d?c=[c,d]:(c=null,b=e)):(c=null,b=e);for(;null!==c;)(a.push(c),e=b,59===f.charCodeAt(b)?(c=";",b++):(c=null,0===g&&h('";"')),null!==c)?(d=Ma(),null!==d?c=[c,d]:(c=null,b=e)):(c=null,b=e);return a}function Ma(){var a;a=sb();null===a&&(a=tb(),null===a&&(a=ub(),null===a&&(a=vb(),null===a&&(a=wb(),null===a&&(a=xb(),null===a&&(a=yb()))))));return a}function sb(){var a,c,d,e;e=d=b;"transport="===f.substr(b,10)?(a="transport=",b+=10):(a=null,0===g&&h('"transport="')); -if(null!==a){"udp"===f.substr(b,3)?(c="udp",b+=3):(c=null,0===g&&h('"udp"'));if(null===c&&("tcp"===f.substr(b,3)?(c="tcp",b+=3):(c=null,0===g&&h('"tcp"')),null===c))if("sctp"===f.substr(b,4)?(c="sctp",b+=4):(c=null,0===g&&h('"sctp"')),null===c)"tls"===f.substr(b,3)?(c="tls",b+=3):(c=null,0===g&&h('"tls"')),null===c&&(c=r());null!==c?a=[a,c]:(a=null,b=e)}else a=null,b=e;null!==a&&(a=a[1],o.params||(o.params={}),o.params.transport=a,a=void 0);null===a&&(b=d);return a}function tb(){var a,c,d,e;e=d=b; -"user="===f.substr(b,5)?(a="user=",b+=5):(a=null,0===g&&h('"user="'));null!==a?("phone"===f.substr(b,5)?(c="phone",b+=5):(c=null,0===g&&h('"phone"')),null===c&&("ip"===f.substr(b,2)?(c="ip",b+=2):(c=null,0===g&&h('"ip"')),null===c&&(c=r())),null!==c)?a=[a,c]:(a=null,b=e):(a=null,b=e);null!==a&&(a=a[1],o.params||(o.params={}),o.params.user=a,a=void 0);null===a&&(b=d);return a}function ub(){var a,c,d,e;e=d=b;"method="===f.substr(b,7)?(a="method=",b+=7):(a=null,0===g&&h('"method="'));null!==a?(c=ja(), -null!==c?a=[a,c]:(a=null,b=e)):(a=null,b=e);null!==a&&(a=a[1],o.params||(o.params={}),o.params.method=a,a=void 0);null===a&&(b=d);return a}function vb(){var a,c,d,e;e=d=b;"ttl="===f.substr(b,4)?(a="ttl=",b+=4):(a=null,0===g&&h('"ttl="'));null!==a?(c=Na(),null!==c?a=[a,c]:(a=null,b=e)):(a=null,b=e);null!==a&&(a=a[1],o.params||(o.params={}),o.params.ttl=a,a=void 0);null===a&&(b=d);return a}function wb(){var a,c,d,e;e=d=b;"maddr="===f.substr(b,6)?(a="maddr=",b+=6):(a=null,0===g&&h('"maddr="'));null!== -a?(c=U(),null!==c?a=[a,c]:(a=null,b=e)):(a=null,b=e);null!==a&&(a=a[1],o.params||(o.params={}),o.params.maddr=a,a=void 0);null===a&&(b=d);return a}function xb(){var a,c;c=b;"lr"===f.substr(b,2)?(a="lr",b+=2):(a=null,0===g&&h('"lr"'));null!==a&&(o.params||(o.params={}),o.params.lr=!0,a=void 0);null===a&&(b=c);return a}function yb(){var a,c,d,e,i,j;i=e=b;a=zb();null!==a?(j=b,61===f.charCodeAt(b)?(c="=",b++):(c=null,0===g&&h('"="')),null!==c?(d=Ab(),null!==d?c=[c,d]:(c=null,b=j)):(c=null,b=j),c=null!== -c?c:"",null!==c)?a=[a,c]:(a=null,b=i):(a=null,b=i);null!==a&&(a=a[0],o.params||(o.params={}),o.params[a]=a.length===b-e?!0:f.substring(b,e+a.length+1),a=void 0);null===a&&(b=e);return a}function zb(){var a,c,d;d=b;c=W();if(null!==c)for(a=[];null!==c;)a.push(c),c=W();else a=null;null!==a&&(a=a.join(""));null===a&&(b=d);return a}function Ab(){var a,c,d;d=b;c=W();if(null!==c)for(a=[];null!==c;)a.push(c),c=W();else a=null;null!==a&&(a=a.join(""));null===a&&(b=d);return a}function W(){var a;a=Bb();null=== -a&&(a=w(),null===a&&(a=x()));return a}function Bb(){var a;91===f.charCodeAt(b)?(a="[",b++):(a=null,0===g&&h('"["'));if(null===a&&(93===f.charCodeAt(b)?(a="]",b++):(a=null,0===g&&h('"]"')),null===a))if(47===f.charCodeAt(b)?(a="/",b++):(a=null,0===g&&h('"/"')),null===a)if(58===f.charCodeAt(b)?(a=":",b++):(a=null,0===g&&h('":"')),null===a)if(38===f.charCodeAt(b)?(a="&",b++):(a=null,0===g&&h('"&"')),null===a)if(43===f.charCodeAt(b)?(a="+",b++):(a=null,0===g&&h('"+"')),null===a)36===f.charCodeAt(b)?(a= -"$",b++):(a=null,0===g&&h('"$"'));return a}function qb(){var a,c,d,e,i,j,l;j=b;63===f.charCodeAt(b)?(a="?",b++):(a=null,0===g&&h('"?"'));if(null!==a)if(c=ka(),null!==c){d=[];l=b;38===f.charCodeAt(b)?(e="&",b++):(e=null,0===g&&h('"&"'));null!==e?(i=ka(),null!==i?e=[e,i]:(e=null,b=l)):(e=null,b=l);for(;null!==e;)(d.push(e),l=b,38===f.charCodeAt(b)?(e="&",b++):(e=null,0===g&&h('"&"')),null!==e)?(i=ka(),null!==i?e=[e,i]:(e=null,b=l)):(e=null,b=l);null!==d?a=[a,c,d]:(a=null,b=j)}else a=null,b=j;else a= -null,b=j;return a}function ka(){var a,c,d,e;e=b;a=Cb();null!==a?(61===f.charCodeAt(b)?(c="=",b++):(c=null,0===g&&h('"="')),null!==c)?(d=Db(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e):(a=null,b=e);return a}function Cb(){var a,b;b=X();null===b&&(b=w(),null===b&&(b=x()));if(null!==b)for(a=[];null!==b;)a.push(b),b=X(),null===b&&(b=w(),null===b&&(b=x()));else a=null;return a}function Db(){var a,b;a=[];b=X();null===b&&(b=w(),null===b&&(b=x()));for(;null!==b;)a.push(b),b=X(),null===b&&(b=w(),null=== -b&&(b=x()));return a}function X(){var a;91===f.charCodeAt(b)?(a="[",b++):(a=null,0===g&&h('"["'));if(null===a&&(93===f.charCodeAt(b)?(a="]",b++):(a=null,0===g&&h('"]"')),null===a))if(47===f.charCodeAt(b)?(a="/",b++):(a=null,0===g&&h('"/"')),null===a)if(63===f.charCodeAt(b)?(a="?",b++):(a=null,0===g&&h('"?"')),null===a)if(58===f.charCodeAt(b)?(a=":",b++):(a=null,0===g&&h('":"')),null===a)if(43===f.charCodeAt(b)?(a="+",b++):(a=null,0===g&&h('"+"')),null===a)36===f.charCodeAt(b)?(a="$",b++):(a=null, -0===g&&h('"$"'));return a}function Eb(){var a,c,d,e,f,g;g=b;a=ja();null!==a?(c=z(),null!==c?(d=Fb(),null!==d?(e=z(),null!==e?(f=Oa(),null!==f?a=[a,c,d,e,f]:(a=null,b=g)):(a=null,b=g)):(a=null,b=g)):(a=null,b=g)):(a=null,b=g);return a}function Fb(){var a;a=Ea();null===a&&(a=Y());return a}function Y(){var a,c,d,e;e=b;a=Gb();null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?(d=Hb(),null===d&&(d=Ib()),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e):(a=null,b=e);return a}function Hb(){var a, -c,d,e,i;e=b;a=Jb();null===a&&(a=la());null!==a?(i=b,63===f.charCodeAt(b)?(c="?",b++):(c=null,0===g&&h('"?"')),null!==c?(d=Kb(),null!==d?c=[c,d]:(c=null,b=i)):(c=null,b=i),c=null!==c?c:"",null!==c)?a=[a,c]:(a=null,b=e):(a=null,b=e);return a}function Jb(){var a,c,d,e;e=b;"//"===f.substr(b,2)?(a="//",b+=2):(a=null,0===g&&h('"//"'));null!==a?(c=Lb(),null!==c?(d=la(),d=null!==d?d:"",null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e);return a}function la(){var a,c,d;d=b;47===f.charCodeAt(b)?(a= -"/",b++):(a=null,0===g&&h('"/"'));null!==a?(c=Mb(),null!==c?a=[a,c]:(a=null,b=d)):(a=null,b=d);return a}function Ib(){var a,c,d,e;e=b;a=Nb();if(null!==a){c=[];for(d=Z();null!==d;)c.push(d),d=Z();null!==c?a=[a,c]:(a=null,b=e)}else a=null,b=e;return a}function Z(){var a;a=da();null===a&&(a=w(),null===a&&(a=x()));return a}function Nb(){var a;a=w();if(null===a&&(a=x(),null===a&&(59===f.charCodeAt(b)?(a=";",b++):(a=null,0===g&&h('";"')),null===a)))if(63===f.charCodeAt(b)?(a="?",b++):(a=null,0===g&&h('"?"')), -null===a)if(58===f.charCodeAt(b)?(a=":",b++):(a=null,0===g&&h('":"')),null===a)if(64===f.charCodeAt(b)?(a="@",b++):(a=null,0===g&&h('"@"')),null===a)if(38===f.charCodeAt(b)?(a="&",b++):(a=null,0===g&&h('"&"')),null===a)if(61===f.charCodeAt(b)?(a="=",b++):(a=null,0===g&&h('"="')),null===a)if(43===f.charCodeAt(b)?(a="+",b++):(a=null,0===g&&h('"+"')),null===a)if(36===f.charCodeAt(b)?(a="$",b++):(a=null,0===g&&h('"$"')),null===a)44===f.charCodeAt(b)?(a=",",b++):(a=null,0===g&&h('","'));return a}function Mb(){var a, -c,d,e,i,j;i=b;a=ma();if(null!==a){c=[];j=b;47===f.charCodeAt(b)?(d="/",b++):(d=null,0===g&&h('"/"'));null!==d?(e=ma(),null!==e?d=[d,e]:(d=null,b=j)):(d=null,b=j);for(;null!==d;)(c.push(d),j=b,47===f.charCodeAt(b)?(d="/",b++):(d=null,0===g&&h('"/"')),null!==d)?(e=ma(),null!==e?d=[d,e]:(d=null,b=j)):(d=null,b=j);null!==c?a=[a,c]:(a=null,b=i)}else a=null,b=i;return a}function ma(){var a,c,d,e,i,j;i=b;a=[];for(c=$();null!==c;)a.push(c),c=$();if(null!==a){c=[];j=b;59===f.charCodeAt(b)?(d=";",b++):(d=null, -0===g&&h('";"'));null!==d?(e=Pa(),null!==e?d=[d,e]:(d=null,b=j)):(d=null,b=j);for(;null!==d;)(c.push(d),j=b,59===f.charCodeAt(b)?(d=";",b++):(d=null,0===g&&h('";"')),null!==d)?(e=Pa(),null!==e?d=[d,e]:(d=null,b=j)):(d=null,b=j);null!==c?a=[a,c]:(a=null,b=i)}else a=null,b=i;return a}function Pa(){var a,b;a=[];for(b=$();null!==b;)a.push(b),b=$();return a}function $(){var a;a=w();if(null===a&&(a=x(),null===a&&(58===f.charCodeAt(b)?(a=":",b++):(a=null,0===g&&h('":"')),null===a)))if(64===f.charCodeAt(b)? -(a="@",b++):(a=null,0===g&&h('"@"')),null===a)if(38===f.charCodeAt(b)?(a="&",b++):(a=null,0===g&&h('"&"')),null===a)if(61===f.charCodeAt(b)?(a="=",b++):(a=null,0===g&&h('"="')),null===a)if(43===f.charCodeAt(b)?(a="+",b++):(a=null,0===g&&h('"+"')),null===a)if(36===f.charCodeAt(b)?(a="$",b++):(a=null,0===g&&h('"$"')),null===a)44===f.charCodeAt(b)?(a=",",b++):(a=null,0===g&&h('","'));return a}function Gb(){var a,c,d,e,i;i=e=b;a=P();if(null!==a){c=[];d=P();if(null===d&&(d=p(),null===d&&(43===f.charCodeAt(b)? -(d="+",b++):(d=null,0===g&&h('"+"')),null===d)))if(45===f.charCodeAt(b)?(d="-",b++):(d=null,0===g&&h('"-"')),null===d)46===f.charCodeAt(b)?(d=".",b++):(d=null,0===g&&h('"."'));for(;null!==d;)if(c.push(d),d=P(),null===d&&(d=p(),null===d&&(43===f.charCodeAt(b)?(d="+",b++):(d=null,0===g&&h('"+"')),null===d)))if(45===f.charCodeAt(b)?(d="-",b++):(d=null,0===g&&h('"-"')),null===d)46===f.charCodeAt(b)?(d=".",b++):(d=null,0===g&&h('"."'));null!==c?a=[a,c]:(a=null,b=i)}else a=null,b=i;null!==a&&(o.scheme= -f.substring(b,e),a=void 0);null===a&&(b=e);return a}function Lb(){var a;a=Ob();null===a&&(a=aa());return a}function Ob(){var a,c,d,e;e=d=b;a=ha();null!==a?(64===f.charCodeAt(b)?(c="@",b++):(c=null,0===g&&h('"@"')),null!==c)?a=[a,c]:(a=null,b=e):(a=null,b=e);a=null!==a?a:"";null!==a?(c=T(),null!==c?a=[a,c]:(a=null,b=d)):(a=null,b=d);return null!==a?a:""}function aa(){var a,c;c=w();if(null===c&&(c=x(),null===c&&(36===f.charCodeAt(b)?(c="$",b++):(c=null,0===g&&h('"$"')),null===c)))if(44===f.charCodeAt(b)? -(c=",",b++):(c=null,0===g&&h('","')),null===c)if(59===f.charCodeAt(b)?(c=";",b++):(c=null,0===g&&h('";"')),null===c)if(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null===c)if(64===f.charCodeAt(b)?(c="@",b++):(c=null,0===g&&h('"@"')),null===c)if(38===f.charCodeAt(b)?(c="&",b++):(c=null,0===g&&h('"&"')),null===c)if(61===f.charCodeAt(b)?(c="=",b++):(c=null,0===g&&h('"="')),null===c)43===f.charCodeAt(b)?(c="+",b++):(c=null,0===g&&h('"+"'));if(null!==c)for(a=[];null!==c;){if(a.push(c),c= -w(),null===c&&(c=x(),null===c&&(36===f.charCodeAt(b)?(c="$",b++):(c=null,0===g&&h('"$"')),null===c)))if(44===f.charCodeAt(b)?(c=",",b++):(c=null,0===g&&h('","')),null===c)if(59===f.charCodeAt(b)?(c=";",b++):(c=null,0===g&&h('";"')),null===c)if(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null===c)if(64===f.charCodeAt(b)?(c="@",b++):(c=null,0===g&&h('"@"')),null===c)if(38===f.charCodeAt(b)?(c="&",b++):(c=null,0===g&&h('"&"')),null===c)if(61===f.charCodeAt(b)?(c="=",b++):(c=null,0===g&& -h('"="')),null===c)43===f.charCodeAt(b)?(c="+",b++):(c=null,0===g&&h('"+"'))}else a=null;return a}function Kb(){var a,b;a=[];for(b=Z();null!==b;)a.push(b),b=Z();return a}function Oa(){var a,c,d,e,i,j,l,n;n=l=b;"SIP"===f.substr(b,3)?(a="SIP",b+=3):(a=null,0===g&&h('"SIP"'));if(null!==a)if(47===f.charCodeAt(b)?(c="/",b++):(c=null,0===g&&h('"/"')),null!==c){e=p();if(null!==e)for(d=[];null!==e;)d.push(e),e=p();else d=null;if(null!==d)if(46===f.charCodeAt(b)?(e=".",b++):(e=null,0===g&&h('"."')),null!== -e){j=p();if(null!==j)for(i=[];null!==j;)i.push(j),j=p();else i=null;null!==i?a=[a,c,d,e,i]:(a=null,b=n)}else a=null,b=n;else a=null,b=n}else a=null,b=n;else a=null,b=n;null!==a&&(o.sip_version=f.substring(b,l),a=void 0);null===a&&(b=l);return a}function Pb(){var a;"INVITE"===f.substr(b,6)?(a="INVITE",b+=6):(a=null,0===g&&h('"INVITE"'));return a}function Qb(){var a;"ACK"===f.substr(b,3)?(a="ACK",b+=3):(a=null,0===g&&h('"ACK"'));return a}function Rb(){var a;"OPTIONS"===f.substr(b,7)?(a="OPTIONS",b+= -7):(a=null,0===g&&h('"OPTIONS"'));return a}function Sb(){var a;"BYE"===f.substr(b,3)?(a="BYE",b+=3):(a=null,0===g&&h('"BYE"'));return a}function Tb(){var a;"CANCEL"===f.substr(b,6)?(a="CANCEL",b+=6):(a=null,0===g&&h('"CANCEL"'));return a}function Ub(){var a;"REGISTER"===f.substr(b,8)?(a="REGISTER",b+=8):(a=null,0===g&&h('"REGISTER"'));return a}function Vb(){var a;"SUBSCRIBE"===f.substr(b,9)?(a="SUBSCRIBE",b+=9):(a=null,0===g&&h('"SUBSCRIBE"'));return a}function Wb(){var a;"NOTIFY"===f.substr(b,6)? -(a="NOTIFY",b+=6):(a=null,0===g&&h('"NOTIFY"'));return a}function ja(){var a,c;c=b;a=Pb();null===a&&(a=Qb(),null===a&&(a=Rb(),null===a&&(a=Sb(),null===a&&(a=Tb(),null===a&&(a=Ub(),null===a&&(a=Vb(),null===a&&(a=Wb(),null===a&&(a=r()))))))));null!==a&&(o.method=f.substring(b,c),a=void 0);null===a&&(b=c);return a}function Xb(){var a,c,d,e,f,g;g=b;a=Oa();null!==a?(c=z(),null!==c?(d=Yb(),null!==d?(e=z(),null!==e?(f=Zb(),null!==f?a=[a,c,d,e,f]:(a=null,b=g)):(a=null,b=g)):(a=null,b=g)):(a=null,b=g)):(a= -null,b=g);return a}function Yb(){var a,c;c=b;a=$b();null!==a&&(o.status_code=parseInt(a.join("")),a=void 0);null===a&&(b=c);return a}function $b(){var a,c,d,e;e=b;a=p();null!==a?(c=p(),null!==c?(d=p(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e);return a}function Zb(){var a,c,d;d=b;a=[];c=da();null===c&&(c=w(),null===c&&(c=x(),null===c&&(c=K(),null===c&&(c=R(),null===c&&(c=z(),null===c&&(c=H()))))));for(;null!==c;)a.push(c),c=da(),null===c&&(c=w(),null===c&&(c=x(),null===c&&(c=K(), -null===c&&(c=R(),null===c&&(c=z(),null===c&&(c=H()))))));null!==a&&(o.reason_phrase=f.substring(b,d),a=void 0);null===a&&(b=d);return a}function na(){var a,c,d,e,f,g;f=b;a=Qa();null===a&&(a=M());if(null!==a){c=[];g=b;d=v();null!==d?(e=Ra(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=v(),null!==d?(e=Ra(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a}function M(){var a,c,d,e,f;f=b;a=ac();a=null!==a?a:"";null!==a?(c= -nb(),null!==c?(d=Qa(),null!==d?(e=mb(),null!==e?a=[a,c,d,e]:(a=null,b=f)):(a=null,b=f)):(a=null,b=f)):(a=null,b=f);return a}function Qa(){var a;a=Ea();null===a&&(a=Y());return a}function Sa(){var a;a=pb();null===a&&(a=Y());return a}function ac(){var a,c,d,e,f,g,h;g=f=b;a=r();if(null!==a){c=[];h=b;d=y();null!==d?(e=r(),null!==e?d=[d,e]:(d=null,b=h)):(d=null,b=h);for(;null!==d;)c.push(d),h=b,d=y(),null!==d?(e=r(),null!==e?d=[d,e]:(d=null,b=h)):(d=null,b=h);null!==c?a=[a,c]:(a=null,b=g)}else a=null, -b=g;null===a&&(a=F());null!==a&&(o.display_name=a,a=void 0);null===a&&(b=f);return a}function Ra(){var a;a=bc();null===a&&(a=cc(),null===a&&(a=dc()));return a}function bc(){var a,c,d,e,i;i=e=b;113===f.charCodeAt(b)?(a="q",b++):(a=null,0===g&&h('"q"'));null!==a?(c=t(),null!==c?(d=ec(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i);null!==a&&(a=a[2],o.params||(o.params={}),o.params.q=a,a=void 0);null===a&&(b=e);return a}function cc(){var a,c,d,e,i;i=e=b;"expires"===f.substr(b,7)?(a="expires", -b+=7):(a=null,0===g&&h('"expires"'));null!==a?(c=t(),null!==c?(d=N(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i);null!==a&&(a=a[2],o.params||(o.params={}),o.params.expires=a,a=void 0);null===a&&(b=e);return a}function dc(){var a,c;c=b;a=B();null!==a&&(o.params||(o.params={}),o.params[a[0]]=a[1]?a[1]:!0,a=void 0);null===a&&(b=c);return a}function N(){var a,c,d;d=b;c=p();if(null!==c)for(a=[];null!==c;)a.push(c),c=p();else a=null;null!==a&&(a=parseInt(a.join("")));null===a&&(b=d);return a} -function ec(){var a,c,d,e,i,j,l,n;l=j=b;48===f.charCodeAt(b)?(a="0",b++):(a=null,0===g&&h('"0"'));null!==a?(n=b,46===f.charCodeAt(b)?(c=".",b++):(c=null,0===g&&h('"."')),null!==c?(d=p(),d=null!==d?d:"",null!==d?(e=p(),e=null!==e?e:"",null!==e?(i=p(),i=null!==i?i:"",null!==i?c=[c,d,e,i]:(c=null,b=n)):(c=null,b=n)):(c=null,b=n)):(c=null,b=n),c=null!==c?c:"",null!==c)?a=[a,c]:(a=null,b=l):(a=null,b=l);null!==a&&(a=parseFloat(f.substring(b,j)));null===a&&(b=j);return a}function B(){var a,c,d,e,f,g;f= -e=b;a=r();null!==a?(g=b,c=t(),null!==c?(d=fc(),null!==d?c=[c,d]:(c=null,b=g)):(c=null,b=g),c=null!==c?c:"",null!==c)?a=[a,c]:(a=null,b=f):(a=null,b=f);null!==a&&(c=a[1],c="undefined"===typeof c?null:c[1],a=[a[0],c]);null===a&&(b=e);return a}function fc(){var a;a=r();null===a&&(a=U(),null===a&&(a=F()));return a}function gc(){var a;"render"===f.substr(b,6)?(a="render",b+=6):(a=null,0===g&&h('"render"'));if(null===a&&("session"===f.substr(b,7)?(a="session",b+=7):(a=null,0===g&&h('"session"')),null=== -a))if("icon"===f.substr(b,4)?(a="icon",b+=4):(a=null,0===g&&h('"icon"')),null===a)"alert"===f.substr(b,5)?(a="alert",b+=5):(a=null,0===g&&h('"alert"')),null===a&&(a=r());return a}function Ta(){var a;a=hc();null===a&&(a=B());return a}function hc(){var a,c,d,e;e=b;"handling"===f.substr(b,8)?(a="handling",b+=8):(a=null,0===g&&h('"handling"'));null!==a?(c=t(),null!==c)?("optional"===f.substr(b,8)?(d="optional",b+=8):(d=null,0===g&&h('"optional"')),null===d&&("required"===f.substr(b,8)?(d="required",b+= -8):(d=null,0===g&&h('"required"')),null===d&&(d=r())),null!==d)?a=[a,c,d]:(a=null,b=e):(a=null,b=e):(a=null,b=e);return a}function ic(){var a,c,d,e,f,g,h,n;h=b;a=jc();if(null!==a)if(c=fa(),null!==c)if(d=kc(),null!==d){e=[];n=b;f=v();null!==f?(g=Ua(),null!==g?f=[f,g]:(f=null,b=n)):(f=null,b=n);for(;null!==f;)e.push(f),n=b,f=v(),null!==f?(g=Ua(),null!==g?f=[f,g]:(f=null,b=n)):(f=null,b=n);null!==e?a=[a,c,d,e]:(a=null,b=h)}else a=null,b=h;else a=null,b=h;else a=null,b=h;return a}function jc(){var a; -a=lc();null===a&&(a=mc());return a}function lc(){var a;"text"===f.substr(b,4)?(a="text",b+=4):(a=null,0===g&&h('"text"'));if(null===a&&("image"===f.substr(b,5)?(a="image",b+=5):(a=null,0===g&&h('"image"')),null===a))if("audio"===f.substr(b,5)?(a="audio",b+=5):(a=null,0===g&&h('"audio"')),null===a)if("video"===f.substr(b,5)?(a="video",b+=5):(a=null,0===g&&h('"video"')),null===a)"application"===f.substr(b,11)?(a="application",b+=11):(a=null,0===g&&h('"application"')),null===a&&(a=oa());return a}function mc(){var a; -"message"===f.substr(b,7)?(a="message",b+=7):(a=null,0===g&&h('"message"'));null===a&&("multipart"===f.substr(b,9)?(a="multipart",b+=9):(a=null,0===g&&h('"multipart"')),null===a&&(a=oa()));return a}function oa(){var a;a=r();null===a&&(a=nc());return a}function nc(){var a,c,d;d=b;"x-"===f.substr(b,2)?(a="x-",b+=2):(a=null,0===g&&h('"x-"'));null!==a?(c=r(),null!==c?a=[a,c]:(a=null,b=d)):(a=null,b=d);return a}function kc(){var a;a=oa();null===a&&(a=r());return a}function Ua(){var a,c,d,e;e=b;a=r();null!== -a?(c=t(),null!==c?(d=oc(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e);return a}function oc(){var a;a=r();null===a&&(a=F());return a}function pc(){var a,c,d;d=b;c=p();if(null!==c)for(a=[];null!==c;)a.push(c),c=p();else a=null;null!==a&&(o.value=parseInt(a.join("")),a=void 0);null===a&&(b=d);return a}function ba(){var a,c,d,e,i,j;i=b;a=ea();if(null!==a){c=[];j=b;46===f.charCodeAt(b)?(d=".",b++):(d=null,0===g&&h('"."'));null!==d?(e=ea(),null!==e?d=[d,e]:(d=null,b=j)):(d=null,b=j);for(;null!== -d;)(c.push(d),j=b,46===f.charCodeAt(b)?(d=".",b++):(d=null,0===g&&h('"."')),null!==d)?(e=ea(),null!==e?d=[d,e]:(d=null,b=j)):(d=null,b=j);null!==c?a=[a,c]:(a=null,b=i)}else a=null,b=i;return a}function Va(){var a,c;c=b;a=B();null!==a&&(o.params||(o.params={}),o.params[a[0]]=a[1]?a[1]:!0,a=void 0);null===a&&(b=c);return a}function Wa(){var a;a=Xa();null===a&&(a=B());return a}function Xa(){var a,c,d,e,i;i=e=b;"tag"===f.substr(b,3)?(a="tag",b+=3):(a=null,0===g&&h('"tag"'));null!==a?(c=t(),null!==c?(d= -r(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i);null!==a&&(o.tag=a[2],a=void 0);null===a&&(b=e);return a}function Ya(){var a,c,d,e,i,j,l,n;l=b;"Digest"===f.substr(b,6)?(a="Digest",b+=6):(a=null,0===g&&h('"Digest"'));if(null!==a)if(c=y(),null!==c)if(d=pa(),null!==d){e=[];n=b;i=u();null!==i?(j=pa(),null!==j?i=[i,j]:(i=null,b=n)):(i=null,b=n);for(;null!==i;)e.push(i),n=b,i=u(),null!==i?(j=pa(),null!==j?i=[i,j]:(i=null,b=n)):(i=null,b=n);null!==e?a=[a,c,d,e]:(a=null,b=l)}else a=null,b= -l;else a=null,b=l;else a=null,b=l;null===a&&(a=qc());return a}function qc(){var a,c,d,e,f,g,h,n;h=b;a=r();if(null!==a)if(c=y(),null!==c)if(d=ca(),null!==d){e=[];n=b;f=u();null!==f?(g=ca(),null!==g?f=[f,g]:(f=null,b=n)):(f=null,b=n);for(;null!==f;)e.push(f),n=b,f=u(),null!==f?(g=ca(),null!==g?f=[f,g]:(f=null,b=n)):(f=null,b=n);null!==e?a=[a,c,d,e]:(a=null,b=h)}else a=null,b=h;else a=null,b=h;else a=null,b=h;return a}function ca(){var a,c,d,e;e=b;a=r();null!==a?(c=t(),null!==c?(d=r(),null===d&&(d=F()), -null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e);return a}function pa(){var a;a=rc();null===a&&(a=sc(),null===a&&(a=tc(),null===a&&(a=uc(),null===a&&(a=vc(),null===a&&(a=wc(),null===a&&(a=xc(),null===a&&(a=ca())))))));return a}function rc(){var a,c,d,e;e=b;"realm"===f.substr(b,5)?(a="realm",b+=5):(a=null,0===g&&h('"realm"'));null!==a?(c=t(),null!==c?(d=yc(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e);return a}function yc(){var a,c;c=b;a=F();null!==a&&(o.realm=a,a=void 0); -null===a&&(b=c);return a}function sc(){var a,c,d,e,i,j,l,n,m;n=b;"domain"===f.substr(b,6)?(a="domain",b+=6):(a=null,0===g&&h('"domain"'));if(null!==a)if(c=t(),null!==c)if(d=za(),null!==d)if(e=qa(),null!==e){i=[];m=b;l=z();if(null!==l)for(j=[];null!==l;)j.push(l),l=z();else j=null;null!==j?(l=qa(),null!==l?j=[j,l]:(j=null,b=m)):(j=null,b=m);for(;null!==j;){i.push(j);m=b;l=z();if(null!==l)for(j=[];null!==l;)j.push(l),l=z();else j=null;null!==j?(l=qa(),null!==l?j=[j,l]:(j=null,b=m)):(j=null,b=m)}null!== -i?(j=Aa(),null!==j?a=[a,c,d,e,i,j]:(a=null,b=n)):(a=null,b=n)}else a=null,b=n;else a=null,b=n;else a=null,b=n;else a=null,b=n;return a}function qa(){var a;a=Y();null===a&&(a=la());return a}function tc(){var a,c,d,e;e=b;"nonce"===f.substr(b,5)?(a="nonce",b+=5):(a=null,0===g&&h('"nonce"'));null!==a?(c=t(),null!==c?(d=zc(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e);return a}function zc(){var a,c;c=b;a=F();null!==a&&(o.nonce=a,a=void 0);null===a&&(b=c);return a}function uc(){var a,c, -d,e,i;i=e=b;"opaque"===f.substr(b,6)?(a="opaque",b+=6):(a=null,0===g&&h('"opaque"'));null!==a?(c=t(),null!==c?(d=F(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i);null!==a&&(o.opaque=a[2],a=void 0);null===a&&(b=e);return a}function vc(){var a,c,d,e,i;i=e=b;"stale"===f.substr(b,5)?(a="stale",b+=5):(a=null,0===g&&h('"stale"'));null!==a?(c=t(),null!==c)?("true"===f.substr(b,4)?(d="true",b+=4):(d=null,0===g&&h('"true"')),null===d&&("false"===f.substr(b,5)?(d="false",b+=5):(d=null,0===g&& -h('"false"'))),null!==d)?a=[a,c,d]:(a=null,b=i):(a=null,b=i):(a=null,b=i);null!==a&&(o.stale=a[2],a=void 0);null===a&&(b=e);return a}function wc(){var a,c,d,e,i;i=e=b;"algorithm"===f.substr(b,9)?(a="algorithm",b+=9):(a=null,0===g&&h('"algorithm"'));null!==a?(c=t(),null!==c)?("MD5"===f.substr(b,3)?(d="MD5",b+=3):(d=null,0===g&&h('"MD5"')),null===d&&("MD5-sess"===f.substr(b,8)?(d="MD5-sess",b+=8):(d=null,0===g&&h('"MD5-sess"')),null===d&&(d=r())),null!==d)?a=[a,c,d]:(a=null,b=i):(a=null,b=i):(a=null, -b=i);null!==a&&(o.algorithm=a[2],a=void 0);null===a&&(b=e);return a}function xc(){var a,c,d,e,i,j,l,n,m,q,p;m=n=b;"qop"===f.substr(b,3)?(a="qop",b+=3):(a=null,0===g&&h('"qop"'));if(null!==a)if(c=t(),null!==c)if(d=za(),null!==d){q=b;e=ra();if(null!==e){i=[];p=b;44===f.charCodeAt(b)?(j=",",b++):(j=null,0===g&&h('","'));null!==j?(l=ra(),null!==l?j=[j,l]:(j=null,b=p)):(j=null,b=p);for(;null!==j;)(i.push(j),p=b,44===f.charCodeAt(b)?(j=",",b++):(j=null,0===g&&h('","')),null!==j)?(l=ra(),null!==l?j=[j,l]: -(j=null,b=p)):(j=null,b=p);null!==i?e=[e,i]:(e=null,b=q)}else e=null,b=q;null!==e?(i=Aa(),null!==i?a=[a,c,d,e,i]:(a=null,b=m)):(a=null,b=m)}else a=null,b=m;else a=null,b=m;else a=null,b=m;null!==a&&(o.qop=f.substring(b-1,n+5),a=void 0);null===a&&(b=n);return a}function ra(){var a;"auth-int"===f.substr(b,8)?(a="auth-int",b+=8):(a=null,0===g&&h('"auth-int"'));null===a&&("auth"===f.substr(b,4)?(a="auth",b+=4):(a=null,0===g&&h('"auth"')),null===a&&(a=r()));return a}function sa(){var a,c,d,e,f,g;f=b;a= -M();if(null!==a){c=[];g=b;d=v();null!==d?(e=B(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=v(),null!==d?(e=B(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a}function ta(){var a,c,d,e,f,g;f=b;a=M();if(null!==a){c=[];g=b;d=v();null!==d?(e=B(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=v(),null!==d?(e=B(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a= -null,b=f;return a}function Ac(){var a,c;c=b;"active"===f.substr(b,6)?(a="active",b+=6):(a=null,0===g&&h('"active"'));if(null===a&&("pending"===f.substr(b,7)?(a="pending",b+=7):(a=null,0===g&&h('"pending"')),null===a))"terminated"===f.substr(b,10)?(a="terminated",b+=10):(a=null,0===g&&h('"terminated"')),null===a&&(a=r());null!==a&&(o.state=f.substring(b,c),a=void 0);null===a&&(b=c);return a}function Za(){var a,c,d,e,i;i=e=b;"reason"===f.substr(b,6)?(a="reason",b+=6):(a=null,0===g&&h('"reason"'));null!== -a?(c=t(),null!==c?(d=Bc(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i);null!==a&&(a=function(a,b){if(typeof b!=="undefined")o.reason=b}(e,a[2]));null===a&&(b=e);if(null===a&&(i=e=b,"expires"===f.substr(b,7)?(a="expires",b+=7):(a=null,0===g&&h('"expires"')),null!==a?(c=t(),null!==c?(d=N(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i),null!==a&&(a=function(a,b){if(typeof b!=="undefined")o.expires=b}(e,a[2])),null===a&&(b=e),null===a))if(i=e=b,"retry_after"===f.substr(b, -11)?(a="retry_after",b+=11):(a=null,0===g&&h('"retry_after"')),null!==a?(c=t(),null!==c?(d=N(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i),null!==a&&(a=function(a,b){if(typeof b!=="undefined")o.retry_after=b}(e,a[2])),null===a&&(b=e),null===a)e=b,a=B(),null!==a&&(a=function(a,b){if(typeof b!=="undefined"){if(!o.params)o.params={};o.params[b[0]]=b[1]?b[1]:true}}(e,a)),null===a&&(b=e);return a}function Bc(){var a;"deactivated"===f.substr(b,11)?(a="deactivated",b+=11):(a=null,0===g&& -h('"deactivated"'));if(null===a&&("probation"===f.substr(b,9)?(a="probation",b+=9):(a=null,0===g&&h('"probation"')),null===a))if("rejected"===f.substr(b,8)?(a="rejected",b+=8):(a=null,0===g&&h('"rejected"')),null===a)if("timeout"===f.substr(b,7)?(a="timeout",b+=7):(a=null,0===g&&h('"timeout"')),null===a)if("giveup"===f.substr(b,6)?(a="giveup",b+=6):(a=null,0===g&&h('"giveup"')),null===a)if("noresource"===f.substr(b,10)?(a="noresource",b+=10):(a=null,0===g&&h('"noresource"')),null===a)"invariant"=== -f.substr(b,9)?(a="invariant",b+=9):(a=null,0===g&&h('"invariant"')),null===a&&(a=r());return a}function $a(){var a;a=Xa();null===a&&(a=B());return a}function ua(){var a,c,d,e,f,g,h,n;h=b;a=Cc();if(null!==a)if(c=y(),null!==c)if(d=Dc(),null!==d){e=[];n=b;f=v();null!==f?(g=ab(),null!==g?f=[f,g]:(f=null,b=n)):(f=null,b=n);for(;null!==f;)e.push(f),n=b,f=v(),null!==f?(g=ab(),null!==g?f=[f,g]:(f=null,b=n)):(f=null,b=n);null!==e?a=[a,c,d,e]:(a=null,b=h)}else a=null,b=h;else a=null,b=h;else a=null,b=h;return a} -function ab(){var a;a=Ec();null===a&&(a=Fc(),null===a&&(a=Gc(),null===a&&(a=Hc(),null===a&&(a=Ic(),null===a&&(a=B())))));return a}function Ec(){var a,c,d,e,i;i=e=b;"ttl"===f.substr(b,3)?(a="ttl",b+=3):(a=null,0===g&&h('"ttl"'));null!==a?(c=t(),null!==c?(d=Na(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i);null!==a&&(o.ttl=a[2],a=void 0);null===a&&(b=e);return a}function Fc(){var a,c,d,e,i;i=e=b;"maddr"===f.substr(b,5)?(a="maddr",b+=5):(a=null,0===g&&h('"maddr"'));null!==a?(c=t(),null!== -c?(d=U(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i);null!==a&&(o.maddr=a[2],a=void 0);null===a&&(b=e);return a}function Gc(){var a,c,d,e,i;i=e=b;"received"===f.substr(b,8)?(a="received",b+=8):(a=null,0===g&&h('"received"'));null!==a?(c=t(),null!==c?(d=L(),null===d&&(d=La()),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i);null!==a&&(o.received=a[2],a=void 0);null===a&&(b=e);return a}function Hc(){var a,c,d,e,i;i=e=b;"branch"===f.substr(b,6)?(a="branch",b+=6):(a=null,0=== -g&&h('"branch"'));null!==a?(c=t(),null!==c?(d=r(),null!==d?a=[a,c,d]:(a=null,b=i)):(a=null,b=i)):(a=null,b=i);null!==a&&(o.branch=a[2],a=void 0);null===a&&(b=e);return a}function Ic(){var a,c,d,e,i,j,l;j=i=b;"rport"===f.substr(b,5)?(a="rport",b+=5):(a=null,0===g&&h('"rport"'));if(null!==a){l=b;c=t();if(null!==c){d=[];for(e=p();null!==e;)d.push(e),e=p();null!==d?c=[c,d]:(c=null,b=l)}else c=null,b=l;c=null!==c?c:"";null!==c?a=[a,c]:(a=null,b=j)}else a=null,b=j;null!==a&&("undefined"!==typeof response_port&& -(o.rport=response_port.join("")),a=void 0);null===a&&(b=i);return a}function Cc(){var a,c,d,e,f,g;g=b;a=Jc();null!==a?(c=fa(),null!==c?(d=r(),null!==d?(e=fa(),null!==e?(f=va(),null!==f?a=[a,c,d,e,f]:(a=null,b=g)):(a=null,b=g)):(a=null,b=g)):(a=null,b=g)):(a=null,b=g);return a}function Jc(){var a,c;c=b;"SIP"===f.substr(b,3)?(a="SIP",b+=3):(a=null,0===g&&h('"SIP"'));null===a&&(a=r());null!==a&&(o.protocol=a,a=void 0);null===a&&(b=c);return a}function va(){var a,c;c=b;"UDP"===f.substr(b,3)?(a="UDP", -b+=3):(a=null,0===g&&h('"UDP"'));if(null===a&&("TCP"===f.substr(b,3)?(a="TCP",b+=3):(a=null,0===g&&h('"TCP"')),null===a))if("TLS"===f.substr(b,3)?(a="TLS",b+=3):(a=null,0===g&&h('"TLS"')),null===a)"SCTP"===f.substr(b,4)?(a="SCTP",b+=4):(a=null,0===g&&h('"SCTP"')),null===a&&(a=r());null!==a&&(o.transport=a,a=void 0);null===a&&(b=c);return a}function Dc(){var a,c,d,e,f;e=b;a=Kc();null!==a?(f=b,c=ob(),null!==c?(d=Lc(),null!==d?c=[c,d]:(c=null,b=f)):(c=null,b=f),c=null!==c?c:"",null!==c)?a=[a,c]:(a=null, -b=e):(a=null,b=e);return a}function Kc(){var a,c;c=b;a=Ja();null===a&&(a=L(),null===a&&(a=ia()));null!==a&&(o.host=f.substring(b,c),a=void 0);null===a&&(b=c);return a}function Lc(){var a,c,d,e,f,g,h;h=g=b;a=p();a=null!==a?a:"";null!==a?(c=p(),c=null!==c?c:"",null!==c?(d=p(),d=null!==d?d:"",null!==d?(e=p(),e=null!==e?e:"",null!==e?(f=p(),f=null!==f?f:"",null!==f?a=[a,c,d,e,f]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h)):(a=null,b=h)):(a=null,b=h);null!==a&&(o.port=parseInt(a.join("")),a=void 0);null=== -a&&(b=g);return a}function Na(){var a,c,d,e,f;f=e=b;a=p();null!==a?(c=p(),c=null!==c?c:"",null!==c?(d=p(),d=null!==d?d:"",null!==d?a=[a,c,d]:(a=null,b=f)):(a=null,b=f)):(a=null,b=f);null!==a&&(a=parseInt(a.join("")));null===a&&(b=e);return a}function Mc(){var a,b;a=[];b=I();null===b&&(b=R(),null===b&&(b=y()));for(;null!==b;)a.push(b),b=I(),null===b&&(b=R(),null===b&&(b=y()));return a}function Nc(){var a,c;c=b;"stuns"===f.substr(b,5)?(a="stuns",b+=5):(a=null,0===g&&h('"stuns"'));null===a&&("stun"=== -f.substr(b,4)?(a="stun",b+=4):(a=null,0===g&&h('"stun"')));null!==a&&(o.scheme=a,a=void 0);null===a&&(b=c);return a}function bb(){var a,c,d,e,i;e=b;a=Oc();null!==a?(i=b,58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c?(d=Ia(),null!==d?c=[c,d]:(c=null,b=i)):(c=null,b=i),c=null!==c?c:"",null!==c)?a=[a,c]:(a=null,b=e):(a=null,b=e);return a}function Oc(){var a,c;c=b;a=aa();null===a&&(a=L(),null===a&&(a=ia()));null!==a&&(o.host=a.join(""),a=void 0);null===a&&(b=c);return a}function aa(){var a, -b;a=[];b=cb();null===b&&(b=x(),null===b&&(b=db()));for(;null!==b;)a.push(b),b=cb(),null===b&&(b=x(),null===b&&(b=db()));return a}function cb(){var a;a=P();if(null===a&&(a=p(),null===a&&(45===f.charCodeAt(b)?(a="-",b++):(a=null,0===g&&h('"-"')),null===a)))if(46===f.charCodeAt(b)?(a=".",b++):(a=null,0===g&&h('"."')),null===a)if(95===f.charCodeAt(b)?(a="_",b++):(a=null,0===g&&h('"_"')),null===a)126===f.charCodeAt(b)?(a="~",b++):(a=null,0===g&&h('"~"'));return a}function db(){var a;33===f.charCodeAt(b)? -(a="!",b++):(a=null,0===g&&h('"!"'));if(null===a&&(36===f.charCodeAt(b)?(a="$",b++):(a=null,0===g&&h('"$"')),null===a))if(38===f.charCodeAt(b)?(a="&",b++):(a=null,0===g&&h('"&"')),null===a)if(39===f.charCodeAt(b)?(a="'",b++):(a=null,0===g&&h('"\'"')),null===a)if(40===f.charCodeAt(b)?(a="(",b++):(a=null,0===g&&h('"("')),null===a)if(41===f.charCodeAt(b)?(a=")",b++):(a=null,0===g&&h('")"')),null===a)if(42===f.charCodeAt(b)?(a="*",b++):(a=null,0===g&&h('"*"')),null===a)if(43===f.charCodeAt(b)?(a="+", -b++):(a=null,0===g&&h('"+"')),null===a)if(44===f.charCodeAt(b)?(a=",",b++):(a=null,0===g&&h('","')),null===a)if(59===f.charCodeAt(b)?(a=";",b++):(a=null,0===g&&h('";"')),null===a)61===f.charCodeAt(b)?(a="=",b++):(a=null,0===g&&h('"="'));return a}function Pc(){var a,c;c=b;"turns"===f.substr(b,5)?(a="turns",b+=5):(a=null,0===g&&h('"turns"'));null===a&&("turn"===f.substr(b,4)?(a="turn",b+=4):(a=null,0===g&&h('"turn"')));null!==a&&(o.scheme=a,a=void 0);null===a&&(b=c);return a}function Sc(a){a.sort(); -for(var b=null,d=[],e=0;e",b++):(a=null,0===g&&h('">"')),null===a)if(64===f.charCodeAt(b)?(a="@",b++):(a=null,0===g&&h('"@"')),null=== -a)if(44===f.charCodeAt(b)?(a=",",b++):(a=null,0===g&&h('","')),null===a)if(59===f.charCodeAt(b)?(a=";",b++):(a=null,0===g&&h('";"')),null===a)if(58===f.charCodeAt(b)?(a=":",b++):(a=null,0===g&&h('":"')),null===a)if(92===f.charCodeAt(b)?(a="\\",b++):(a=null,0===g&&h('"\\\\"')),null===a)if(a=D(),null===a&&(47===f.charCodeAt(b)?(a="/",b++):(a=null,0===g&&h('"/"')),null===a))if(91===f.charCodeAt(b)?(a="[",b++):(a=null,0===g&&h('"["')),null===a)if(93===f.charCodeAt(b)?(a="]",b++):(a=null,0===g&&h('"]"')), -null===a)if(63===f.charCodeAt(b)?(a="?",b++):(a=null,0===g&&h('"?"')),null===a)if(61===f.charCodeAt(b)?(a="=",b++):(a=null,0===g&&h('"="')),null===a)if(123===f.charCodeAt(b)?(a="{",b++):(a=null,0===g&&h('"{"')),null===a)if(125===f.charCodeAt(b)?(a="}",b++):(a=null,0===g&&h('"}"')),null===a)a=z(),null===a&&(a=H());return a},word:ya,STAR:jb,SLASH:fa,EQUAL:t,LPAREN:kb,RPAREN:lb,RAQUOT:mb,LAQUOT:nb,COMMA:u,SEMI:v,COLON:ob,LDQUOT:za,RDQUOT:Aa,comment:Ba,ctext:Ca,quoted_string:F,qdtext:Da,quoted_pair:S, -SIP_URI_simple:pb,SIP_URI:Ea,uri_scheme:ga,userinfo:ha,user:Ga,user_unreserved:Ha,password:function(){var a,c;a=[];c=w();if(null===c&&(c=x(),null===c&&(38===f.charCodeAt(b)?(c="&",b++):(c=null,0===g&&h('"&"')),null===c)))if(61===f.charCodeAt(b)?(c="=",b++):(c=null,0===g&&h('"="')),null===c)if(43===f.charCodeAt(b)?(c="+",b++):(c=null,0===g&&h('"+"')),null===c)if(36===f.charCodeAt(b)?(c="$",b++):(c=null,0===g&&h('"$"')),null===c)44===f.charCodeAt(b)?(c=",",b++):(c=null,0===g&&h('","'));for(;null!== -c;)if(a.push(c),c=w(),null===c&&(c=x(),null===c&&(38===f.charCodeAt(b)?(c="&",b++):(c=null,0===g&&h('"&"')),null===c)))if(61===f.charCodeAt(b)?(c="=",b++):(c=null,0===g&&h('"="')),null===c)if(43===f.charCodeAt(b)?(c="+",b++):(c=null,0===g&&h('"+"')),null===c)if(36===f.charCodeAt(b)?(c="$",b++):(c=null,0===g&&h('"$"')),null===c)44===f.charCodeAt(b)?(c=",",b++):(c=null,0===g&&h('","'));return a},hostport:T,host:U,hostname:Ja,domainlabel:Ka,toplabel:rb,IPv6reference:ia,IPv6address:La,h16:q,ls32:A,IPv4address:L, -dec_octet:V,port:Ia,uri_parameters:Fa,uri_parameter:Ma,transport_param:sb,user_param:tb,method_param:ub,ttl_param:vb,maddr_param:wb,lr_param:xb,other_param:yb,pname:zb,pvalue:Ab,paramchar:W,param_unreserved:Bb,headers:qb,header:ka,hname:Cb,hvalue:Db,hnv_unreserved:X,Request_Response:function(){var a;a=Xb();null===a&&(a=Eb());return a},Request_Line:Eb,Request_URI:Fb,absoluteURI:Y,hier_part:Hb,net_path:Jb,abs_path:la,opaque_part:Ib,uric:Z,uric_no_slash:Nb,path_segments:Mb,segment:ma,param:Pa,pchar:$, -scheme:Gb,authority:Lb,srvr:Ob,reg_name:aa,query:Kb,SIP_Version:Oa,INVITEm:Pb,ACKm:Qb,OPTIONSm:Rb,BYEm:Sb,CANCELm:Tb,REGISTERm:Ub,SUBSCRIBEm:Vb,NOTIFYm:Wb,Method:ja,Status_Line:Xb,Status_Code:Yb,extension_code:$b,Reason_Phrase:Zb,Allow_Events:function(){var a,c,d,e,f,g;f=b;a=ba();if(null!==a){c=[];g=b;d=u();null!==d?(e=ba(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=u(),null!==d?(e=ba(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a= -null,b=f;return a},Call_ID:function(){var a,c,d,e,i,j;i=e=b;a=ya();null!==a?(j=b,64===f.charCodeAt(b)?(c="@",b++):(c=null,0===g&&h('"@"')),null!==c?(d=ya(),null!==d?c=[c,d]:(c=null,b=j)):(c=null,b=j),c=null!==c?c:"",null!==c)?a=[a,c]:(a=null,b=i):(a=null,b=i);null!==a&&(o=f.substring(b,e),a=void 0);null===a&&(b=e);return a},Contact:function(){var a,c,d,e,f,g;a=jb();if(null===a)if(f=b,a=na(),null!==a){c=[];g=b;d=u();null!==d?(e=na(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d), -g=b,d=u(),null!==d?(e=na(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},contact_param:na,name_addr:M,addr_spec:Qa,addr_spec_simple:Sa,display_name:ac,contact_params:Ra,c_p_q:bc,c_p_expires:cc,contact_extension:dc,delta_seconds:N,qvalue:ec,generic_param:B,gen_value:fc,Content_Disposition:function(){var a,c,d,e,f,g;f=b;a=gc();if(null!==a){c=[];g=b;d=v();null!==d?(e=Ta(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d= -v(),null!==d?(e=Ta(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},disp_type:gc,disp_param:Ta,handling_param:hc,Content_Encoding:function(){var a,c,d,e,f,g;f=b;a=r();if(null!==a){c=[];g=b;d=u();null!==d?(e=r(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=u(),null!==d?(e=r(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},Content_Length:function(){var a,c,d;d=b;c= -p();if(null!==c)for(a=[];null!==c;)a.push(c),c=p();else a=null;null!==a&&(o=parseInt(a.join("")),a=void 0);null===a&&(b=d);return a},Content_Type:function(){var a,c;c=b;a=ic();null!==a&&(o=f.substring(b,c),a=void 0);null===a&&(b=c);return a},media_type:ic,m_type:jc,discrete_type:lc,composite_type:mc,extension_token:oa,x_token:nc,m_subtype:kc,m_parameter:Ua,m_value:oc,CSeq:function(){var a,c,d,e;e=b;a=pc();null!==a?(c=y(),null!==c?(d=ja(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e); -return a},CSeq_value:pc,Expires:function(){var a,c;c=b;a=N();null!==a&&(o=a,a=void 0);null===a&&(b=c);return a},Event:function(){var a,c,d,e,f,g,h;g=f=b;a=ba();if(null!==a){c=[];h=b;d=v();null!==d?(e=Va(),null!==e?d=[d,e]:(d=null,b=h)):(d=null,b=h);for(;null!==d;)c.push(d),h=b,d=v(),null!==d?(e=Va(),null!==e?d=[d,e]:(d=null,b=h)):(d=null,b=h);null!==c?a=[a,c]:(a=null,b=g)}else a=null,b=g;null!==a&&(o.event=a[0].join(""),a=void 0);null===a&&(b=f);return a},event_type:ba,event_param:Va,From:function(){var a, -c,d,e,f,g;f=b;a=Sa();null===a&&(a=M());if(null!==a){c=[];g=b;d=v();null!==d?(e=Wa(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=v(),null!==d?(e=Wa(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},from_param:Wa,tag_param:Xa,Max_Forwards:function(){var a,c,d;d=b;c=p();if(null!==c)for(a=[];null!==c;)a.push(c),c=p();else a=null;null!==a&&(o=parseInt(a.join("")),a=void 0);null===a&&(b=d);return a},Min_Expires:function(){var a, -c;c=b;a=N();null!==a&&(o=a,a=void 0);null===a&&(b=c);return a},Proxy_Authenticate:function(){return Ya()},challenge:Ya,other_challenge:qc,auth_param:ca,digest_cln:pa,realm:rc,realm_value:yc,domain:sc,URI:qa,nonce:tc,nonce_value:zc,opaque:uc,stale:vc,algorithm:wc,qop_options:xc,qop_value:ra,Proxy_Require:function(){var a,c,d,e,f,g;f=b;a=r();if(null!==a){c=[];g=b;d=u();null!==d?(e=r(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=u(),null!==d?(e=r(),null!==e?d=[d,e]:(d= -null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},Record_Route:function(){var a,c,d,e,f,g;f=b;a=sa();if(null!==a){c=[];g=b;d=u();null!==d?(e=sa(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=u(),null!==d?(e=sa(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},rec_route:sa,Require:function(){var a,c,d,e,f,g;f=b;a=r();if(null!==a){c=[];g=b;d=u();null!==d?(e=r(),null!==e?d=[d,e]:(d=null,b= -g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=u(),null!==d?(e=r(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},Route:function(){var a,c,d,e,f,g;f=b;a=ta();if(null!==a){c=[];g=b;d=u();null!==d?(e=ta(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=u(),null!==d?(e=ta(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},route_param:ta,Subscription_State:function(){var a, -c,d,e,f,g;f=b;a=Ac();if(null!==a){c=[];g=b;d=v();null!==d?(e=Za(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=v(),null!==d?(e=Za(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},substate_value:Ac,subexp_params:Za,event_reason_value:Bc,Subject:function(){var a;a=ib();return null!==a?a:""},Supported:function(){var a,c,d,e,f,g;f=b;a=r();if(null!==a){c=[];g=b;d=u();null!==d?(e=r(),null!==e?d=[d,e]:(d=null,b=g)):(d=null, -b=g);for(;null!==d;)c.push(d),g=b,d=u(),null!==d?(e=r(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return null!==a?a:""},To:function(){var a,c,d,e,f,g;f=b;a=Sa();null===a&&(a=M());if(null!==a){c=[];g=b;d=v();null!==d?(e=$a(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=v(),null!==d?(e=$a(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},to_param:$a,Via:function(){var a, -c,d,e,f,g;f=b;a=ua();if(null!==a){c=[];g=b;d=u();null!==d?(e=ua(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);for(;null!==d;)c.push(d),g=b,d=u(),null!==d?(e=ua(),null!==e?d=[d,e]:(d=null,b=g)):(d=null,b=g);null!==c?a=[a,c]:(a=null,b=f)}else a=null,b=f;return a},via_parm:ua,via_params:ab,via_ttl:Ec,via_maddr:Fc,via_received:Gc,via_branch:Hc,response_port:Ic,sent_protocol:Cc,protocol_name:Jc,transport:va,sent_by:Dc,via_host:Kc,via_port:Lc,ttl:Na,WWW_Authenticate:function(){return Ya()},extension_header:function(){var a, -c,d,e;e=b;a=r();null!==a?(c=hb(),null!==c?(d=Mc(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e)):(a=null,b=e);return a},header_value:Mc,message_body:function(){var a,b;a=[];for(b=xa();null!==b;)a.push(b),b=xa();return a},stun_URI:function(){var a,c,d,e;e=b;a=Nc();null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?(d=bb(),null!==d?a=[a,c,d]:(a=null,b=e)):(a=null,b=e):(a=null,b=e);return a},stun_scheme:Nc,stun_host_port:bb,stun_host:Oc,reg_name:aa,stun_unreserved:cb,sub_delims:db, -turn_URI:function(){var a,c,d,e,i,j,l;j=b;a=Pc();null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?(d=bb(),null!==d)?(l=b,"?transport="===f.substr(b,11)?(e="?transport=",b+=11):(e=null,0===g&&h('"?transport="')),null!==e?(i=va(),null!==i?e=[e,i]:(e=null,b=l)):(e=null,b=l),e=null!==e?e:"",null!==e)?a=[a,c,d,e]:(a=null,b=j):(a=null,b=j):(a=null,b=j):(a=null,b=j);return a},turn_scheme:Pc,turn_transport:function(){var a,c,d,e,i;i=e=b;a=va();if(null!==a){"udp"===f.substr(b, -3)?(c="udp",b+=3):(c=null,0===g&&h('"udp"'));if(null===c&&("tcp"===f.substr(b,3)?(c="tcp",b+=3):(c=null,0===g&&h('"tcp"')),null===c)){c=[];for(d=w();null!==d;)c.push(d),d=w()}null!==c?a=[a,c]:(a=null,b=i)}else a=null,b=i;null!==a&&(o.transport=transport,a=void 0);null===a&&(b=e);return a},lazy_uri:function(){var a,c,d,e,i,j;j=i=b;a=ga();null!==a?(58===f.charCodeAt(b)?(c=":",b++):(c=null,0===g&&h('":"')),null!==c)?a=[a,c]:(a=null,b=j):(a=null,b=j);a=null!==a?a:"";null!==a?(c=Ga(),null!==c)?(j=b,64=== -f.charCodeAt(b)?(d="@",b++):(d=null,0===g&&h('"@"')),null!==d?(e=T(),null!==e?d=[d,e]:(d=null,b=j)):(d=null,b=j),d=null!==d?d:"",null!==d)?(e=Fa(),null!==e?a=[a,c,d,e]:(a=null,b=i)):(a=null,b=i):(a=null,b=i):(a=null,b=i);return a}};if(void 0!==C){if(void 0===Qc[C])throw Error("Invalid rule name: "+fb(C)+".");}else C="CRLF";var b=0,g=0,O=0,wa=[],o={};if(null===Qc[C]()||b!==f.length){var eb=Math.max(b,O),Uc=eb