From 3da2690ad58e0a3e0c922986f21b449fa8ef171a Mon Sep 17 00:00:00 2001 From: Damianos Mylonakis Date: Tue, 6 Mar 2012 01:35:12 +0200 Subject: [PATCH] add classes for elements --- index.js | 2 +- lib/calendar.js | 48 + lib/element.js | 11 + lib/event.js | 50 + lib/ical.js | 3 - lib/index.js | 5 + lib/parser.js | 1 - lib/parser/ical.js | 22884 ---------------------------------------- lib/parser/ical.pegjs | 696 -- lib/parser/index.js | 1 - test/parse_full.js | 7 +- 11 files changed, 120 insertions(+), 23588 deletions(-) create mode 100644 lib/calendar.js create mode 100644 lib/element.js create mode 100644 lib/event.js delete mode 100644 lib/ical.js create mode 100644 lib/index.js delete mode 100644 lib/parser/ical.js delete mode 100644 lib/parser/ical.pegjs delete mode 100644 lib/parser/index.js diff --git a/index.js b/index.js index db59000..4cc88b3 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -module.exports = require('./lib/ical'); \ No newline at end of file +module.exports = require('./lib'); \ No newline at end of file diff --git a/lib/calendar.js b/lib/calendar.js new file mode 100644 index 0000000..5d0772b --- /dev/null +++ b/lib/calendar.js @@ -0,0 +1,48 @@ +var Element = require('./element').Element + , util = require('util') + , Event = require('./event').Event + +var DELIM = '\r\n' + +function Calendar(data) { + this.prodid = data.prodid + this.version = data.version || '2.0' + this.events = data.events +} + +util.inherits(Calendar, Element) + +Calendar.prototype.addEvent = function (event) { + this.events.push(event) +} + +Calendar.prototype.toICal = function () { + var x = 'BEGIN:VCALENDAR' + DELIM + for (var k in this) { + if (this.hasOwnProperty(k)) { + var prop = this[k] + debugger + if (Array.isArray(prop)) { + for (var i = 0; i < prop.length; i++) { + var p = prop[i] + if (p instanceof Element) { + x += p.toICal() + } + else { + x += k.toUpperCase() + ':' + this[k] + DELIM + } + } + } + if (prop instanceof Element) { + x += prop.toICal() + } + else { + x += k.toUpperCase() + ':' + this[k] + DELIM + } + } + } + x += 'END:VCALENDAR' + return x +} + +exports.Calendar = Calendar \ No newline at end of file diff --git a/lib/element.js b/lib/element.js new file mode 100644 index 0000000..4432ddc --- /dev/null +++ b/lib/element.js @@ -0,0 +1,11 @@ + +function Element() { + +} + +Element.prototype.toICal = function () { + throw new Error('not supported') +} + + +exports.Element = Element \ No newline at end of file diff --git a/lib/event.js b/lib/event.js new file mode 100644 index 0000000..23da93f --- /dev/null +++ b/lib/event.js @@ -0,0 +1,50 @@ +/** + BEGIN:VEVENT + DTSTART:20111206T150000Z + DTEND:20111206T180000Z + DTSTAMP:20120217T005926Z + UID:3v454h0dqpe7m0kbqds4rca32g@google.com + ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=danmyl + onakis@gmail.com;X-NUM-GUESTS=0:mailto:danmylonakis@gmail.com + CREATED:20111206T013929Z + DESCRIPTION: + LAST-MODIFIED:20111206T013929Z + LOCATION: + SEQUENCE:1 + STATUS:TENTATIVE + SUMMARY:557 με δαμον + TRANSP:OPAQUE + CATEGORIES:http://schemas.google.com/g/2005#event + BEGIN:VALARM + ACTION:DISPLAY + DESCRIPTION:This is an event reminder + TRIGGER:-P0DT0H10M0S + END:VALARM + END:VEVENT + */ + +var Element = require('./element').Element + , util = require('util') + +var DELIM = '\r\n' + +function Event(data) { + this.summary = data.summary + this.location = data.location + this.description = data.description +} + +util.inherits(Event, Element) + +Event.prototype.toICal = function () { + var x = 'BEGIN:VEVENT' + DELIM + for (var k in this) { + if (this.hasOwnProperty(k)) { + x += k.toUpperCase() + ':' + this[k] + DELIM + } + } + x += 'END:VEVENT' + DELIM + return x +} + +exports.Event = Event \ No newline at end of file diff --git a/lib/ical.js b/lib/ical.js deleted file mode 100644 index 0670557..0000000 --- a/lib/ical.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - Parser: require('./parser').Parser -} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..c7eb43e --- /dev/null +++ b/lib/index.js @@ -0,0 +1,5 @@ +module.exports = { + Parser: require('./parser').Parser +, Calendar: require('./calendar').Calendar +, Event: require('./event').Event +} \ No newline at end of file diff --git a/lib/parser.js b/lib/parser.js index 0920232..66417ab 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -115,7 +115,6 @@ Parser.prototype._dispatch = function () { if (limit == -1) { return; } - debugger; var content = this.buffer.substr(0, limit); this.buffer = this.buffer.slice(limit + 2, limit + 4); var contentLines = content.split('\r\n'); diff --git a/lib/parser/ical.js b/lib/parser/ical.js deleted file mode 100644 index 15e133a..0000000 --- a/lib/parser/ical.js +++ /dev/null @@ -1,22884 +0,0 @@ -module.exports = (function(){ - /* Generated by PEG.js 0.6.2 (http://pegjs.majda.cz/). */ - - 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 = { - "ALPHA": parse_ALPHA, - "CRLF": parse_CRLF, - "DIGIT": parse_DIGIT, - "DQUOTE": parse_DQUOTE, - "ESCAPED_CHAR": parse_ESCAPED_CHAR, - "HTAB": parse_HTAB, - "Language_Tag": parse_Language_Tag, - "NON_US_ASCII": parse_NON_US_ASCII, - "QSAFE_CHAR": parse_QSAFE_CHAR, - "SAFE_CHAR": parse_SAFE_CHAR, - "SP": parse_SP, - "TSAFE_CHAR": parse_TSAFE_CHAR, - "UTF8_2": parse_UTF8_2, - "UTF8_3": parse_UTF8_3, - "UTF8_4": parse_UTF8_4, - "UTF8_tail": parse_UTF8_tail, - "VALUE_CHAR": parse_VALUE_CHAR, - "WSP": parse_WSP, - "action": parse_action, - "actionparam": parse_actionparam, - "actionvalue": parse_actionvalue, - "alarmc": parse_alarmc, - "altrepparam": parse_altrepparam, - "attach": parse_attach, - "attachparam": parse_attachparam, - "attendee": parse_attendee, - "attparam": parse_attparam, - "audioprop": parse_audioprop, - "b_char": parse_b_char, - "b_end": parse_b_end, - "binary": parse_binary, - "byhrlist": parse_byhrlist, - "byminlist": parse_byminlist, - "bymodaylist": parse_bymodaylist, - "bymolist": parse_bymolist, - "byseclist": parse_byseclist, - "bysplist": parse_bysplist, - "bywdaylist": parse_bywdaylist, - "bywknolist": parse_bywknolist, - "byyrdaylist": parse_byyrdaylist, - "calparam": parse_calparam, - "calprops": parse_calprops, - "calscale": parse_calscale, - "calvalue": parse_calvalue, - "categories": parse_categories, - "catparam": parse_catparam, - "class": parse_class, - "classparam": parse_classparam, - "classvalue": parse_classvalue, - "cnparam": parse_cnparam, - "comment": parse_comment, - "commparam": parse_commparam, - "completed": parse_completed, - "component": parse_component, - "compparam": parse_compparam, - "contact": parse_contact, - "contentline": parse_contentline, - "contparam": parse_contparam, - "creaparam": parse_creaparam, - "created": parse_created, - "cutypeparam": parse_cutypeparam, - "date_fullyear": parse_date_fullyear, - "date_mday": parse_date_mday, - "date_month": parse_date_month, - "date_time": parse_date_time, - "date_value": parse_date_value, - "daylightc": parse_daylightc, - "delfromparam": parse_delfromparam, - "deltoparam": parse_deltoparam, - "descparam": parse_descparam, - "description": parse_description, - "dirparam": parse_dirparam, - "dispprop": parse_dispprop, - "dtend": parse_dtend, - "dtendparam": parse_dtendparam, - "dtendval": parse_dtendval, - "dtstamp": parse_dtstamp, - "dtstart": parse_dtstart, - "dtstparam": parse_dtstparam, - "dtstval": parse_dtstval, - "due": parse_due, - "dueparam": parse_dueparam, - "dueval": parse_dueval, - "dur_date": parse_dur_date, - "dur_day": parse_dur_day, - "dur_hour": parse_dur_hour, - "dur_minute": parse_dur_minute, - "dur_second": parse_dur_second, - "dur_time": parse_dur_time, - "dur_value": parse_dur_value, - "dur_week": parse_dur_week, - "duration": parse_duration, - "durparam": parse_durparam, - "emailprop": parse_emailprop, - "encodingparam": parse_encodingparam, - "enddate": parse_enddate, - "eventc": parse_eventc, - "eventprop": parse_eventprop, - "exdate": parse_exdate, - "exdtparam": parse_exdtparam, - "exdtval": parse_exdtval, - "fbparam": parse_fbparam, - "fbprop": parse_fbprop, - "fbtypeparam": parse_fbtypeparam, - "fbvalue": parse_fbvalue, - "float": parse_float, - "fmttypeparam": parse_fmttypeparam, - "freebusy": parse_freebusy, - "freebusyc": parse_freebusyc, - "freq": parse_freq, - "frmparam": parse_frmparam, - "geo": parse_geo, - "geoparam": parse_geoparam, - "geovalue": parse_geovalue, - "hour": parse_hour, - "iana_comp": parse_iana_comp, - "iana_param": parse_iana_param, - "iana_prop": parse_iana_prop, - "iana_token": parse_iana_token, - "icalbody": parse_icalbody, - "icalobject": parse_icalobject, - "icalparameter": parse_icalparameter, - "icalstream": parse_icalstream, - "integer": parse_integer, - "journalc": parse_journalc, - "jourprop": parse_jourprop, - "languageparam": parse_languageparam, - "last_mod": parse_last_mod, - "location": parse_location, - "locparam": parse_locparam, - "lstparam": parse_lstparam, - "maxver": parse_maxver, - "memberparam": parse_memberparam, - "method": parse_method, - "metparam": parse_metparam, - "minus": parse_minus, - "minutes": parse_minutes, - "minver": parse_minver, - "monthdaynum": parse_monthdaynum, - "monthnum": parse_monthnum, - "name": parse_name, - "ordmoday": parse_ordmoday, - "ordwk": parse_ordwk, - "ordyrday": parse_ordyrday, - "organizer": parse_organizer, - "orgparam": parse_orgparam, - "other_param": parse_other_param, - "param": parse_param, - "param_name": parse_param_name, - "param_value": parse_param_value, - "paramtext": parse_paramtext, - "partstat_event": parse_partstat_event, - "partstat_jour": parse_partstat_jour, - "partstat_todo": parse_partstat_todo, - "partstatparam": parse_partstatparam, - "pctparam": parse_pctparam, - "percent": parse_percent, - "period": parse_period, - "period_explicit": parse_period_explicit, - "period_start": parse_period_start, - "pidparam": parse_pidparam, - "plus": parse_plus, - "prioparam": parse_prioparam, - "priority": parse_priority, - "prodid": parse_prodid, - "quoted_string": parse_quoted_string, - "rangeparam": parse_rangeparam, - "rdate": parse_rdate, - "rdtparam": parse_rdtparam, - "rdtval": parse_rdtval, - "recur": parse_recur, - "recur_rule_part": parse_recur_rule_part, - "recurid": parse_recurid, - "related": parse_related, - "relparam": parse_relparam, - "reltypeparam": parse_reltypeparam, - "repeat": parse_repeat, - "repparam": parse_repparam, - "resources": parse_resources, - "resrcparam": parse_resrcparam, - "ridparam": parse_ridparam, - "ridval": parse_ridval, - "roleparam": parse_roleparam, - "rrule": parse_rrule, - "rrulparam": parse_rrulparam, - "rstatparam": parse_rstatparam, - "rstatus": parse_rstatus, - "rsvpparam": parse_rsvpparam, - "seconds": parse_seconds, - "sentbyparam": parse_sentbyparam, - "seq": parse_seq, - "seqparam": parse_seqparam, - "standardc": parse_standardc, - "statcode": parse_statcode, - "statparam": parse_statparam, - "status": parse_status, - "statvalue": parse_statvalue, - "statvalue_event": parse_statvalue_event, - "statvalue_jour": parse_statvalue_jour, - "statvalue_todo": parse_statvalue_todo, - "stmparam": parse_stmparam, - "summary": parse_summary, - "summparam": parse_summparam, - "text": parse_text, - "time": parse_time, - "time_hour": parse_time_hour, - "time_minute": parse_time_minute, - "time_numzone": parse_time_numzone, - "time_second": parse_time_second, - "time_utc": parse_time_utc, - "timezonec": parse_timezonec, - "todoc": parse_todoc, - "todoprop": parse_todoprop, - "toparam": parse_toparam, - "transp": parse_transp, - "transparam": parse_transparam, - "transvalue": parse_transvalue, - "trigabs": parse_trigabs, - "trigger": parse_trigger, - "trigrel": parse_trigrel, - "trigrelparam": parse_trigrelparam, - "tzid": parse_tzid, - "tzidparam": parse_tzidparam, - "tzidprefix": parse_tzidprefix, - "tzidpropparam": parse_tzidpropparam, - "tzname": parse_tzname, - "tznparam": parse_tznparam, - "tzoffsetfrom": parse_tzoffsetfrom, - "tzoffsetto": parse_tzoffsetto, - "tzprop": parse_tzprop, - "tzurl": parse_tzurl, - "tzurlparam": parse_tzurlparam, - "uid": parse_uid, - "uidparam": parse_uidparam, - "uri": parse_uri, - "url": parse_url, - "urlparam": parse_urlparam, - "value": parse_value, - "valuetype": parse_valuetype, - "valuetypeparam": parse_valuetypeparam, - "vendorid": parse_vendorid, - "verparam": parse_verparam, - "version": parse_version, - "vervalue": parse_vervalue, - "weekday": parse_weekday, - "weekdaynum": parse_weekdaynum, - "weeknum": parse_weeknum, - "x_comp": parse_x_comp, - "x_name": parse_x_name, - "x_param": parse_x_param, - "x_prop": parse_x_prop, - "yeardaynum": parse_yeardaynum - }; - - if (startRule !== undefined) { - if (parseFunctions[startRule] === undefined) { - throw new Error("Invalid rule name: " + quote(startRule) + "."); - } - } else { - startRule = "icalstream"; - } - - var pos = 0; - var reportMatchFailures = true; - var rightmostMatchFailuresPos = 0; - var rightmostMatchFailuresExpected = []; - var cache = {}; - - 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); - - if (charCode <= 0xFF) { - var escapeChar = 'x'; - var length = 2; - } else { - var escapeChar = 'u'; - var length = 4; - } - - return '\\' + escapeChar + padLeft(charCode.toString(16).toUpperCase(), '0', length); - } - - 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. - */ - return '"' + s - .replace(/\\/g, '\\\\') // backslash - .replace(/"/g, '\\"') // closing quote character - .replace(/\r/g, '\\r') // carriage return - .replace(/\n/g, '\\n') // line feed - .replace(/[\x80-\uFFFF]/g, escape) // non-ASCII characters - + '"'; - } - - function matchFailed(failure) { - if (pos < rightmostMatchFailuresPos) { - return; - } - - if (pos > rightmostMatchFailuresPos) { - rightmostMatchFailuresPos = pos; - rightmostMatchFailuresExpected = []; - } - - rightmostMatchFailuresExpected.push(failure); - } - - function parse_icalstream() { - var cacheKey = 'icalstream@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result1 = parse_icalobject(); - if (result1 !== null) { - var result0 = []; - while (result1 !== null) { - result0.push(result1); - var result1 = parse_icalobject(); - } - } else { - var result0 = null; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_icalobject() { - var cacheKey = 'icalobject@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 9) === "VCALENDAR") { - var result3 = "VCALENDAR"; - pos += 9; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"VCALENDAR\""); - } - } - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result5 = parse_icalbody(); - if (result5 !== null) { - if (input.substr(pos, 3) === "END") { - var result6 = "END"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === ":") { - var result7 = ":"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 9) === "VCALENDAR") { - var result8 = "VCALENDAR"; - pos += 9; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"VCALENDAR\""); - } - } - if (result8 !== null) { - var result9 = parse_CRLF(); - if (result9 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_icalbody() { - var cacheKey = 'icalbody@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_calprops(); - if (result1 !== null) { - var result2 = parse_component(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_calprops() { - var cacheKey = 'calprops@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result6 = parse_prodid(); - if (result6 !== null) { - var result0 = result6; - } else { - var result5 = parse_version(); - if (result5 !== null) { - var result0 = result5; - } else { - var result4 = parse_calscale(); - if (result4 !== null) { - var result0 = result4; - } else { - var result3 = parse_method(); - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_x_prop(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_iana_prop(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_component() { - var cacheKey = 'component@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result8 = parse_eventc(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_todoc(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_journalc(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_freebusyc(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_timezonec(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_iana_comp(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_x_comp(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - } - if (result1 !== null) { - var result0 = []; - while (result1 !== null) { - result0.push(result1); - var result8 = parse_eventc(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_todoc(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_journalc(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_freebusyc(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_timezonec(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_iana_comp(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_x_comp(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - } - } - } else { - var result0 = null; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_iana_comp() { - var cacheKey = 'iana_comp@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - var result3 = parse_iana_token(); - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result10 = parse_contentline(); - if (result10 !== null) { - var result5 = []; - while (result10 !== null) { - result5.push(result10); - var result10 = parse_contentline(); - } - } else { - var result5 = null; - } - if (result5 !== null) { - if (input.substr(pos, 3) === "END") { - var result6 = "END"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === ":") { - var result7 = ":"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - var result8 = parse_iana_token(); - if (result8 !== null) { - var result9 = parse_CRLF(); - if (result9 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_x_comp() { - var cacheKey = 'x_comp@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - var result3 = parse_x_name(); - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result10 = parse_contentline(); - if (result10 !== null) { - var result5 = []; - while (result10 !== null) { - result5.push(result10); - var result10 = parse_contentline(); - } - } else { - var result5 = null; - } - if (result5 !== null) { - if (input.substr(pos, 3) === "END") { - var result6 = "END"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === ":") { - var result7 = ":"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - var result8 = parse_x_name(); - if (result8 !== null) { - var result9 = parse_CRLF(); - if (result9 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_todoc() { - var cacheKey = 'todoc@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 5) === "VTODO") { - var result3 = "VTODO"; - pos += 5; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"VTODO\""); - } - } - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result5 = parse_todoprop(); - if (result5 !== null) { - var result6 = []; - var result11 = parse_alarmc(); - while (result11 !== null) { - result6.push(result11); - var result11 = parse_alarmc(); - } - if (result6 !== null) { - if (input.substr(pos, 3) === "END") { - var result7 = "END"; - pos += 3; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 1) === ":") { - var result8 = ":"; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result8 !== null) { - if (input.substr(pos, 5) === "VTODO") { - var result9 = "VTODO"; - pos += 5; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"VTODO\""); - } - } - if (result9 !== null) { - var result10 = parse_CRLF(); - if (result10 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9, result10]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_todoprop() { - var cacheKey = 'todoprop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result34 = parse_dtstamp(); - if (result34 !== null) { - var result1 = result34; - } else { - var result33 = parse_uid(); - if (result33 !== null) { - var result1 = result33; - } else { - var result32 = parse_class(); - if (result32 !== null) { - var result1 = result32; - } else { - var result31 = parse_completed(); - if (result31 !== null) { - var result1 = result31; - } else { - var result30 = parse_created(); - if (result30 !== null) { - var result1 = result30; - } else { - var result29 = parse_description(); - if (result29 !== null) { - var result1 = result29; - } else { - var result28 = parse_dtstart(); - if (result28 !== null) { - var result1 = result28; - } else { - var result27 = parse_geo(); - if (result27 !== null) { - var result1 = result27; - } else { - var result26 = parse_last_mod(); - if (result26 !== null) { - var result1 = result26; - } else { - var result25 = parse_location(); - if (result25 !== null) { - var result1 = result25; - } else { - var result24 = parse_organizer(); - if (result24 !== null) { - var result1 = result24; - } else { - var result23 = parse_percent(); - if (result23 !== null) { - var result1 = result23; - } else { - var result22 = parse_priority(); - if (result22 !== null) { - var result1 = result22; - } else { - var result21 = parse_recurid(); - if (result21 !== null) { - var result1 = result21; - } else { - var result20 = parse_seq(); - if (result20 !== null) { - var result1 = result20; - } else { - var result19 = parse_status(); - if (result19 !== null) { - var result1 = result19; - } else { - var result18 = parse_summary(); - if (result18 !== null) { - var result1 = result18; - } else { - var result17 = parse_url(); - if (result17 !== null) { - var result1 = result17; - } else { - var result16 = parse_rrule(); - if (result16 !== null) { - var result1 = result16; - } else { - var result15 = parse_due(); - if (result15 !== null) { - var result1 = result15; - } else { - var result14 = parse_duration(); - if (result14 !== null) { - var result1 = result14; - } else { - var result13 = parse_attach(); - if (result13 !== null) { - var result1 = result13; - } else { - var result12 = parse_attendee(); - if (result12 !== null) { - var result1 = result12; - } else { - var result11 = parse_categories(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_comment(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_contact(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_exdate(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_rstatus(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_related(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_resources(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_rdate(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var result34 = parse_dtstamp(); - if (result34 !== null) { - var result1 = result34; - } else { - var result33 = parse_uid(); - if (result33 !== null) { - var result1 = result33; - } else { - var result32 = parse_class(); - if (result32 !== null) { - var result1 = result32; - } else { - var result31 = parse_completed(); - if (result31 !== null) { - var result1 = result31; - } else { - var result30 = parse_created(); - if (result30 !== null) { - var result1 = result30; - } else { - var result29 = parse_description(); - if (result29 !== null) { - var result1 = result29; - } else { - var result28 = parse_dtstart(); - if (result28 !== null) { - var result1 = result28; - } else { - var result27 = parse_geo(); - if (result27 !== null) { - var result1 = result27; - } else { - var result26 = parse_last_mod(); - if (result26 !== null) { - var result1 = result26; - } else { - var result25 = parse_location(); - if (result25 !== null) { - var result1 = result25; - } else { - var result24 = parse_organizer(); - if (result24 !== null) { - var result1 = result24; - } else { - var result23 = parse_percent(); - if (result23 !== null) { - var result1 = result23; - } else { - var result22 = parse_priority(); - if (result22 !== null) { - var result1 = result22; - } else { - var result21 = parse_recurid(); - if (result21 !== null) { - var result1 = result21; - } else { - var result20 = parse_seq(); - if (result20 !== null) { - var result1 = result20; - } else { - var result19 = parse_status(); - if (result19 !== null) { - var result1 = result19; - } else { - var result18 = parse_summary(); - if (result18 !== null) { - var result1 = result18; - } else { - var result17 = parse_url(); - if (result17 !== null) { - var result1 = result17; - } else { - var result16 = parse_rrule(); - if (result16 !== null) { - var result1 = result16; - } else { - var result15 = parse_due(); - if (result15 !== null) { - var result1 = result15; - } else { - var result14 = parse_duration(); - if (result14 !== null) { - var result1 = result14; - } else { - var result13 = parse_attach(); - if (result13 !== null) { - var result1 = result13; - } else { - var result12 = parse_attendee(); - if (result12 !== null) { - var result1 = result12; - } else { - var result11 = parse_categories(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_comment(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_contact(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_exdate(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_rstatus(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_related(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_resources(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_rdate(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_journalc() { - var cacheKey = 'journalc@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 8) === "VJOURNAL") { - var result3 = "VJOURNAL"; - pos += 8; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"VJOURNAL\""); - } - } - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result5 = parse_jourprop(); - if (result5 !== null) { - if (input.substr(pos, 3) === "END") { - var result6 = "END"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === ":") { - var result7 = ":"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 8) === "VJOURNAL") { - var result8 = "VJOURNAL"; - pos += 8; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"VJOURNAL\""); - } - } - if (result8 !== null) { - var result9 = parse_CRLF(); - if (result9 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_jourprop() { - var cacheKey = 'jourprop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result26 = parse_dtstamp(); - if (result26 !== null) { - var result1 = result26; - } else { - var result25 = parse_uid(); - if (result25 !== null) { - var result1 = result25; - } else { - var result24 = parse_class(); - if (result24 !== null) { - var result1 = result24; - } else { - var result23 = parse_created(); - if (result23 !== null) { - var result1 = result23; - } else { - var result22 = parse_dtstart(); - if (result22 !== null) { - var result1 = result22; - } else { - var result21 = parse_last_mod(); - if (result21 !== null) { - var result1 = result21; - } else { - var result20 = parse_organizer(); - if (result20 !== null) { - var result1 = result20; - } else { - var result19 = parse_recurid(); - if (result19 !== null) { - var result1 = result19; - } else { - var result18 = parse_seq(); - if (result18 !== null) { - var result1 = result18; - } else { - var result17 = parse_status(); - if (result17 !== null) { - var result1 = result17; - } else { - var result16 = parse_summary(); - if (result16 !== null) { - var result1 = result16; - } else { - var result15 = parse_url(); - if (result15 !== null) { - var result1 = result15; - } else { - var result14 = parse_rrule(); - if (result14 !== null) { - var result1 = result14; - } else { - var result13 = parse_attach(); - if (result13 !== null) { - var result1 = result13; - } else { - var result12 = parse_attendee(); - if (result12 !== null) { - var result1 = result12; - } else { - var result11 = parse_categories(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_comment(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_contact(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_description(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_exdate(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_related(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_rdate(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_rstatus(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var result26 = parse_dtstamp(); - if (result26 !== null) { - var result1 = result26; - } else { - var result25 = parse_uid(); - if (result25 !== null) { - var result1 = result25; - } else { - var result24 = parse_class(); - if (result24 !== null) { - var result1 = result24; - } else { - var result23 = parse_created(); - if (result23 !== null) { - var result1 = result23; - } else { - var result22 = parse_dtstart(); - if (result22 !== null) { - var result1 = result22; - } else { - var result21 = parse_last_mod(); - if (result21 !== null) { - var result1 = result21; - } else { - var result20 = parse_organizer(); - if (result20 !== null) { - var result1 = result20; - } else { - var result19 = parse_recurid(); - if (result19 !== null) { - var result1 = result19; - } else { - var result18 = parse_seq(); - if (result18 !== null) { - var result1 = result18; - } else { - var result17 = parse_status(); - if (result17 !== null) { - var result1 = result17; - } else { - var result16 = parse_summary(); - if (result16 !== null) { - var result1 = result16; - } else { - var result15 = parse_url(); - if (result15 !== null) { - var result1 = result15; - } else { - var result14 = parse_rrule(); - if (result14 !== null) { - var result1 = result14; - } else { - var result13 = parse_attach(); - if (result13 !== null) { - var result1 = result13; - } else { - var result12 = parse_attendee(); - if (result12 !== null) { - var result1 = result12; - } else { - var result11 = parse_categories(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_comment(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_contact(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_description(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_exdate(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_related(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_rdate(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_rstatus(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_freebusyc() { - var cacheKey = 'freebusyc@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 9) === "VFREEBUSY") { - var result3 = "VFREEBUSY"; - pos += 9; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"VFREEBUSY\""); - } - } - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result5 = parse_fbprop(); - if (result5 !== null) { - if (input.substr(pos, 3) === "END") { - var result6 = "END"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === ":") { - var result7 = ":"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 9) === "VFREEBUSY") { - var result8 = "VFREEBUSY"; - pos += 9; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"VFREEBUSY\""); - } - } - if (result8 !== null) { - var result9 = parse_CRLF(); - if (result9 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_fbprop() { - var cacheKey = 'fbprop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result14 = parse_dtstamp(); - if (result14 !== null) { - var result1 = result14; - } else { - var result13 = parse_uid(); - if (result13 !== null) { - var result1 = result13; - } else { - var result12 = parse_contact(); - if (result12 !== null) { - var result1 = result12; - } else { - var result11 = parse_dtstart(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_dtend(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_organizer(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_url(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_attendee(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_comment(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_freebusy(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_rstatus(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var result14 = parse_dtstamp(); - if (result14 !== null) { - var result1 = result14; - } else { - var result13 = parse_uid(); - if (result13 !== null) { - var result1 = result13; - } else { - var result12 = parse_contact(); - if (result12 !== null) { - var result1 = result12; - } else { - var result11 = parse_dtstart(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_dtend(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_organizer(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_url(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_attendee(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_comment(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_freebusy(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_rstatus(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_timezonec() { - var cacheKey = 'timezonec@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 9) === "VTIMEZONE") { - var result3 = "VTIMEZONE"; - pos += 9; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"VTIMEZONE\""); - } - } - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result16 = parse_tzid(); - if (result16 !== null) { - var result5 = result16; - } else { - var result15 = parse_last_mod(); - if (result15 !== null) { - var result5 = result15; - } else { - var result14 = parse_tzurl(); - if (result14 !== null) { - var result5 = result14; - } else { - var result13 = parse_standardc(); - if (result13 !== null) { - var result5 = result13; - } else { - var result12 = parse_daylightc(); - if (result12 !== null) { - var result5 = result12; - } else { - var result11 = parse_x_prop(); - if (result11 !== null) { - var result5 = result11; - } else { - var result10 = parse_iana_prop(); - if (result10 !== null) { - var result5 = result10; - } else { - var result5 = null;; - }; - }; - }; - }; - }; - }; - } - if (result5 !== null) { - if (input.substr(pos, 3) === "END") { - var result6 = "END"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === ":") { - var result7 = ":"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 9) === "VTIMEZONE") { - var result8 = "VTIMEZONE"; - pos += 9; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"VTIMEZONE\""); - } - } - if (result8 !== null) { - var result9 = parse_CRLF(); - if (result9 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_percent() { - var cacheKey = 'percent@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 16) === "PERCENT-COMPLETE") { - var result1 = "PERCENT-COMPLETE"; - pos += 16; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"PERCENT-COMPLETE\""); - } - } - if (result1 !== null) { - var result2 = parse_pctparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_integer(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_pctparam() { - var cacheKey = 'pctparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_due() { - var cacheKey = 'due@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 3) === "DUE") { - var result1 = "DUE"; - pos += 3; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"DUE\""); - } - } - if (result1 !== null) { - var result2 = parse_dueparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_dueval(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dueparam() { - var cacheKey = 'dueparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result14 = "DATE-TIME"; - pos += 9; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 4) === "DATE") { - var result13 = "DATE"; - pos += 4; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result14 = "DATE-TIME"; - pos += 9; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 4) === "DATE") { - var result13 = "DATE"; - pos += 4; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_freebusy() { - var cacheKey = 'freebusy@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "FREEBUSY") { - var result1 = "FREEBUSY"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"FREEBUSY\""); - } - } - if (result1 !== null) { - var result2 = parse_fbparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_fbvalue(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_fbparam() { - var cacheKey = 'fbparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_fbtypeparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_fbtypeparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzoffsetfrom() { - var cacheKey = 'tzoffsetfrom@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 12) === "TZOFFSETFROM") { - var result1 = "TZOFFSETFROM"; - pos += 12; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"TZOFFSETFROM\""); - } - } - if (result1 !== null) { - var result2 = parse_frmparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_time_numzone(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_frmparam() { - var cacheKey = 'frmparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzname() { - var cacheKey = 'tzname@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "TZNAME") { - var result1 = "TZNAME"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"TZNAME\""); - } - } - if (result1 !== null) { - var result2 = parse_tznparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_text(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tznparam() { - var cacheKey = 'tznparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_name() { - var cacheKey = 'name@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_iana_token(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_x_name(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_x_name() { - var cacheKey = 'x_name@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 2) === "X-") { - var result1 = "X-"; - pos += 2; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"X-\""); - } - } - if (result1 !== null) { - if (input.substr(pos).match(/^[vendorid "-"]/) !== null) { - var result2 = input.charAt(pos); - pos++; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("[vendorid \"-\"]"); - } - } - if (result2 !== null) { - var result7 = parse_ALPHA(); - if (result7 !== null) { - var result4 = result7; - } else { - var result6 = parse_DIGIT(); - if (result6 !== null) { - var result4 = result6; - } else { - if (input.substr(pos, 1) === "-") { - var result5 = "-"; - pos += 1; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"-\""); - } - } - if (result5 !== null) { - var result4 = result5; - } else { - var result4 = null;; - }; - }; - } - var result3 = result4 !== null ? result4 : ''; - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_vendorid() { - var cacheKey = 'vendorid@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result10 = parse_ALPHA(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_DIGIT(); - if (result9 !== null) { - var result1 = result9; - } else { - var result1 = null;; - }; - } - if (result1 !== null) { - var result8 = parse_ALPHA(); - if (result8 !== null) { - var result2 = result8; - } else { - var result7 = parse_DIGIT(); - if (result7 !== null) { - var result2 = result7; - } else { - var result2 = null;; - }; - } - if (result2 !== null) { - var result6 = parse_ALPHA(); - if (result6 !== null) { - var result4 = result6; - } else { - var result5 = parse_DIGIT(); - if (result5 !== null) { - var result4 = result5; - } else { - var result4 = null;; - }; - } - if (result4 !== null) { - var result3 = []; - while (result4 !== null) { - result3.push(result4); - var result6 = parse_ALPHA(); - if (result6 !== null) { - var result4 = result6; - } else { - var result5 = parse_DIGIT(); - if (result5 !== null) { - var result4 = result5; - } else { - var result4 = null;; - }; - } - } - } else { - var result3 = null; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_param() { - var cacheKey = 'param@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_param_name(); - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = []; - var result7 = parse_param_value(); - while (result7 !== null) { - result3.push(result7); - var result7 = parse_param_value(); - } - if (result3 !== null) { - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result5 = ","; - pos += 1; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result5 !== null) { - var result6 = parse_param_value(); - if (result6 !== null) { - var result4 = [result5, result6]; - } else { - var result4 = null; - pos = savedPos1; - } - } else { - var result4 = null; - pos = savedPos1; - } - if (result4 !== null) { - var result0 = [result1, result2, result3, result4]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_param_name() { - var cacheKey = 'param_name@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_iana_token(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_x_name(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_param_value() { - var cacheKey = 'param_value@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_paramtext(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_quoted_string(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_paramtext() { - var cacheKey = 'paramtext@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result1 = parse_SAFE_CHAR(); - while (result1 !== null) { - result0.push(result1); - var result1 = parse_SAFE_CHAR(); - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_fbvalue() { - var cacheKey = 'fbvalue@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_period(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_period(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_period(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzid() { - var cacheKey = 'tzid@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 4) === "TZID") { - var result1 = "TZID"; - pos += 4; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"TZID\""); - } - } - if (result1 !== null) { - var result2 = parse_tzidpropparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - if (input.substr(pos).match(/^[tzidprefix]/) !== null) { - var result4 = input.charAt(pos); - pos++; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("[tzidprefix]"); - } - } - if (result4 !== null) { - var result5 = parse_text(); - if (result5 !== null) { - var result6 = parse_CRLF(); - if (result6 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzidpropparam() { - var cacheKey = 'tzidpropparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzurl() { - var cacheKey = 'tzurl@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "TZURL") { - var result1 = "TZURL"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"TZURL\""); - } - } - if (result1 !== null) { - var result2 = parse_tzurlparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzurlparam() { - var cacheKey = 'tzurlparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzoffsetto() { - var cacheKey = 'tzoffsetto@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 10) === "TZOFFSETTO") { - var result1 = "TZOFFSETTO"; - pos += 10; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"TZOFFSETTO\""); - } - } - if (result1 !== null) { - var result2 = parse_toparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_time_numzone(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_time_numzone() { - var cacheKey = 'time_numzone@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 1) === "+") { - var result7 = "+"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"+\""); - } - } - if (result7 !== null) { - var result1 = result7; - } else { - if (input.substr(pos, 1) === "-") { - var result6 = "-"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"-\""); - } - } - if (result6 !== null) { - var result1 = result6; - } else { - var result1 = null;; - }; - } - if (result1 !== null) { - var result2 = parse_time_hour(); - if (result2 !== null) { - var result3 = parse_time_minute(); - if (result3 !== null) { - var result5 = parse_time_second(); - var result4 = result5 !== null ? result5 : ''; - if (result4 !== null) { - var result0 = [result1, result2, result3, result4]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_toparam() { - var cacheKey = 'toparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dueval() { - var cacheKey = 'dueval@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_date_time(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_date_value(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_standardc() { - var cacheKey = 'standardc@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 8) === "STANDARD") { - var result3 = "STANDARD"; - pos += 8; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"STANDARD\""); - } - } - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result5 = parse_tzprop(); - if (result5 !== null) { - if (input.substr(pos, 3) === "END") { - var result6 = "END"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === ":") { - var result7 = ":"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 8) === "STANDARD") { - var result8 = "STANDARD"; - pos += 8; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"STANDARD\""); - } - } - if (result8 !== null) { - var result9 = parse_CRLF(); - if (result9 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_daylightc() { - var cacheKey = 'daylightc@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 8) === "DAYLIGHT") { - var result3 = "DAYLIGHT"; - pos += 8; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"DAYLIGHT\""); - } - } - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result5 = parse_tzprop(); - if (result5 !== null) { - if (input.substr(pos, 3) === "END") { - var result6 = "END"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === ":") { - var result7 = ":"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 8) === "DAYLIGHT") { - var result8 = "DAYLIGHT"; - pos += 8; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"DAYLIGHT\""); - } - } - if (result8 !== null) { - var result9 = parse_CRLF(); - if (result9 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzprop() { - var cacheKey = 'tzprop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result10 = parse_dtstart(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_tzoffsetto(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_tzoffsetfrom(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_rrule(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_comment(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_rdate(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_tzname(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var result10 = parse_dtstart(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_tzoffsetto(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_tzoffsetfrom(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_rrule(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_comment(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_rdate(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_tzname(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_contentline() { - var cacheKey = 'contentline@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_name(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result7 = ";"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result7 !== null) { - var result8 = parse_param(); - if (result8 !== null) { - var result6 = [result7, result8]; - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - while (result6 !== null) { - result2.push(result6); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result7 = ";"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result7 !== null) { - var result8 = parse_param(); - if (result8 !== null) { - var result6 = [result7, result8]; - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_value(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_completed() { - var cacheKey = 'completed@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 9) === "COMPLETED") { - var result1 = "COMPLETED"; - pos += 9; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"COMPLETED\""); - } - } - if (result1 !== null) { - var result2 = parse_compparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_date_time(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_compparam() { - var cacheKey = 'compparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_prodid() { - var cacheKey = 'prodid@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "PRODID") { - var result1 = "PRODID"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"PRODID\""); - } - } - if (result1 !== null) { - var result2 = parse_pidparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_text(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_pidparam() { - var cacheKey = 'pidparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_other_param() { - var cacheKey = 'other_param@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_iana_param(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_x_param(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_iana_param() { - var cacheKey = 'iana_param@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_iana_token(); - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_param_value(); - if (result3 !== null) { - var result4 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result6 = ","; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result6 !== null) { - var result7 = parse_param_value(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - while (result5 !== null) { - result4.push(result5); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result6 = ","; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result6 !== null) { - var result7 = parse_param_value(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - } - if (result4 !== null) { - var result0 = [result1, result2, result3, result4]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_x_param() { - var cacheKey = 'x_param@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_x_name(); - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_param_value(); - if (result3 !== null) { - var result4 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result6 = ","; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result6 !== null) { - var result7 = parse_param_value(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - while (result5 !== null) { - result4.push(result5); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result6 = ","; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result6 !== null) { - var result7 = parse_param_value(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - } - if (result4 !== null) { - var result0 = [result1, result2, result3, result4]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_iana_token() { - var cacheKey = 'iana_token@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result4 = parse_ALPHA(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_DIGIT(); - if (result3 !== null) { - var result1 = result3; - } else { - if (input.substr(pos, 1) === "-") { - var result2 = "-"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"-\""); - } - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - var result0 = result1 !== null ? result1 : ''; - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_version() { - var cacheKey = 'version@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "VERSION") { - var result1 = "VERSION"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"VERSION\""); - } - } - if (result1 !== null) { - var result2 = parse_verparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_vervalue(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_verparam() { - var cacheKey = 'verparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_vervalue() { - var cacheKey = 'vervalue@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 3) === "2.0") { - var result6 = "2.0"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"2.0\""); - } - } - if (result6 !== null) { - var result0 = result6; - } else { - var result5 = parse_maxver(); - if (result5 !== null) { - var result0 = result5; - } else { - var savedPos0 = pos; - var result2 = parse_minver(); - if (result2 !== null) { - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_maxver(); - if (result4 !== null) { - var result1 = [result2, result3, result4]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_maxver() { - var cacheKey = 'maxver@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 0) === "") { - var result0 = ""; - pos += 0; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_minver() { - var cacheKey = 'minver@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 0) === "") { - var result0 = ""; - pos += 0; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_calscale() { - var cacheKey = 'calscale@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "CALSCALE") { - var result1 = "CALSCALE"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CALSCALE\""); - } - } - if (result1 !== null) { - var result2 = parse_calparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_calvalue(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_calparam() { - var cacheKey = 'calparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_calvalue() { - var cacheKey = 'calvalue@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 9) === "GREGORIAN") { - var result0 = "GREGORIAN"; - pos += 9; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"GREGORIAN\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_method() { - var cacheKey = 'method@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "METHOD") { - var result1 = "METHOD"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"METHOD\""); - } - } - if (result1 !== null) { - var result2 = parse_metparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_iana_token(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_metparam() { - var cacheKey = 'metparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_x_prop() { - var cacheKey = 'x_prop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_x_name(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result7 = ";"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result7 !== null) { - var result8 = parse_icalparameter(); - if (result8 !== null) { - var result6 = [result7, result8]; - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - while (result6 !== null) { - result2.push(result6); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result7 = ";"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result7 !== null) { - var result8 = parse_icalparameter(); - if (result8 !== null) { - var result6 = [result7, result8]; - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_value(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_value() { - var cacheKey = 'value@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result1 = parse_VALUE_CHAR(); - while (result1 !== null) { - result0.push(result1); - var result1 = parse_VALUE_CHAR(); - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_iana_prop() { - var cacheKey = 'iana_prop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_iana_token(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result7 = ";"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result7 !== null) { - var result8 = parse_icalparameter(); - if (result8 !== null) { - var result6 = [result7, result8]; - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - while (result6 !== null) { - result2.push(result6); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result7 = ";"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result7 !== null) { - var result8 = parse_icalparameter(); - if (result8 !== null) { - var result6 = [result7, result8]; - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_value(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_quoted_string() { - var cacheKey = 'quoted_string@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DQUOTE(); - if (result1 !== null) { - var result2 = parse_QSAFE_CHAR(); - if (result2 !== null) { - var result3 = []; - var result4 = parse_DQUOTE(); - while (result4 !== null) { - result3.push(result4); - var result4 = parse_DQUOTE(); - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_icalparameter() { - var cacheKey = 'icalparameter@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result21 = parse_altrepparam(); - if (result21 !== null) { - var result0 = result21; - } else { - var result20 = parse_cnparam(); - if (result20 !== null) { - var result0 = result20; - } else { - var result19 = parse_cutypeparam(); - if (result19 !== null) { - var result0 = result19; - } else { - var result18 = parse_delfromparam(); - if (result18 !== null) { - var result0 = result18; - } else { - var result17 = parse_deltoparam(); - if (result17 !== null) { - var result0 = result17; - } else { - var result16 = parse_dirparam(); - if (result16 !== null) { - var result0 = result16; - } else { - var result15 = parse_encodingparam(); - if (result15 !== null) { - var result0 = result15; - } else { - var result14 = parse_fmttypeparam(); - if (result14 !== null) { - var result0 = result14; - } else { - var result13 = parse_fbtypeparam(); - if (result13 !== null) { - var result0 = result13; - } else { - var result12 = parse_languageparam(); - if (result12 !== null) { - var result0 = result12; - } else { - var result11 = parse_memberparam(); - if (result11 !== null) { - var result0 = result11; - } else { - var result10 = parse_partstatparam(); - if (result10 !== null) { - var result0 = result10; - } else { - var result9 = parse_rangeparam(); - if (result9 !== null) { - var result0 = result9; - } else { - var result8 = parse_trigrelparam(); - if (result8 !== null) { - var result0 = result8; - } else { - var result7 = parse_reltypeparam(); - if (result7 !== null) { - var result0 = result7; - } else { - var result6 = parse_roleparam(); - if (result6 !== null) { - var result0 = result6; - } else { - var result5 = parse_rsvpparam(); - if (result5 !== null) { - var result0 = result5; - } else { - var result4 = parse_sentbyparam(); - if (result4 !== null) { - var result0 = result4; - } else { - var result3 = parse_tzidparam(); - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_valuetypeparam(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_other_param(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_altrepparam() { - var cacheKey = 'altrepparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "ALTREP") { - var result1 = "ALTREP"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"ALTREP\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_DQUOTE(); - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_DQUOTE(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_uri() { - var cacheKey = 'uri@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 0) === "") { - var result0 = ""; - pos += 0; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_fmttypeparam() { - var cacheKey = 'fmttypeparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 0) === "") { - var result0 = ""; - pos += 0; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_cnparam() { - var cacheKey = 'cnparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 2) === "CN") { - var result1 = "CN"; - pos += 2; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_param_value(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_cutypeparam() { - var cacheKey = 'cutypeparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "CUTYPE") { - var result1 = "CUTYPE"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CUTYPE\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 10) === "INDIVIDUAL") { - var result10 = "INDIVIDUAL"; - pos += 10; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"INDIVIDUAL\""); - } - } - if (result10 !== null) { - var result3 = result10; - } else { - if (input.substr(pos, 5) === "GROUP") { - var result9 = "GROUP"; - pos += 5; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"GROUP\""); - } - } - if (result9 !== null) { - var result3 = result9; - } else { - if (input.substr(pos, 8) === "RESOURCE") { - var result8 = "RESOURCE"; - pos += 8; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"RESOURCE\""); - } - } - if (result8 !== null) { - var result3 = result8; - } else { - if (input.substr(pos, 4) === "ROOM") { - var result7 = "ROOM"; - pos += 4; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"ROOM\""); - } - } - if (result7 !== null) { - var result3 = result7; - } else { - if (input.substr(pos, 7) === "UNKNOWN") { - var result6 = "UNKNOWN"; - pos += 7; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"UNKNOWN\""); - } - } - if (result6 !== null) { - var result3 = result6; - } else { - var result5 = parse_x_name(); - if (result5 !== null) { - var result3 = result5; - } else { - var result4 = parse_iana_token(); - if (result4 !== null) { - var result3 = result4; - } else { - var result3 = null;; - }; - }; - }; - }; - }; - }; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_delfromparam() { - var cacheKey = 'delfromparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 14) === "DELEGATED-FROM") { - var result1 = "DELEGATED-FROM"; - pos += 14; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"DELEGATED-FROM\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_DQUOTE(); - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_DQUOTE(); - if (result5 !== null) { - var result6 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result8 = ","; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result8 !== null) { - var result9 = parse_DQUOTE(); - if (result9 !== null) { - var result10 = parse_uri(); - if (result10 !== null) { - var result11 = parse_DQUOTE(); - if (result11 !== null) { - var result7 = [result8, result9, result10, result11]; - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - while (result7 !== null) { - result6.push(result7); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result8 = ","; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result8 !== null) { - var result9 = parse_DQUOTE(); - if (result9 !== null) { - var result10 = parse_uri(); - if (result10 !== null) { - var result11 = parse_DQUOTE(); - if (result11 !== null) { - var result7 = [result8, result9, result10, result11]; - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } - if (result6 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_deltoparam() { - var cacheKey = 'deltoparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 12) === "DELEGATED-TO") { - var result1 = "DELEGATED-TO"; - pos += 12; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"DELEGATED-TO\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_DQUOTE(); - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_DQUOTE(); - if (result5 !== null) { - var result6 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result8 = ","; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result8 !== null) { - var result9 = parse_DQUOTE(); - if (result9 !== null) { - var result10 = parse_uri(); - if (result10 !== null) { - var result11 = parse_DQUOTE(); - if (result11 !== null) { - var result7 = [result8, result9, result10, result11]; - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - while (result7 !== null) { - result6.push(result7); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result8 = ","; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result8 !== null) { - var result9 = parse_DQUOTE(); - if (result9 !== null) { - var result10 = parse_uri(); - if (result10 !== null) { - var result11 = parse_DQUOTE(); - if (result11 !== null) { - var result7 = [result8, result9, result10, result11]; - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } - if (result6 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dirparam() { - var cacheKey = 'dirparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 3) === "DIR") { - var result1 = "DIR"; - pos += 3; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"DIR\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_DQUOTE(); - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_DQUOTE(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_encodingparam() { - var cacheKey = 'encodingparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "ENCODING") { - var result1 = "ENCODING"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"ENCODING\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 4) === "8BIT") { - var result5 = "8BIT"; - pos += 4; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"8BIT\""); - } - } - if (result5 !== null) { - var result3 = result5; - } else { - if (input.substr(pos, 6) === "BASE64") { - var result4 = "BASE64"; - pos += 6; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"BASE64\""); - } - } - if (result4 !== null) { - var result3 = result4; - } else { - var result3 = null;; - }; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_fbtypeparam() { - var cacheKey = 'fbtypeparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "FBTYPE") { - var result1 = "FBTYPE"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"FBTYPE\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 4) === "FREE") { - var result9 = "FREE"; - pos += 4; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"FREE\""); - } - } - if (result9 !== null) { - var result3 = result9; - } else { - if (input.substr(pos, 4) === "BUSY") { - var result8 = "BUSY"; - pos += 4; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"BUSY\""); - } - } - if (result8 !== null) { - var result3 = result8; - } else { - if (input.substr(pos, 16) === "BUSY-UNAVAILABLE") { - var result7 = "BUSY-UNAVAILABLE"; - pos += 16; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"BUSY-UNAVAILABLE\""); - } - } - if (result7 !== null) { - var result3 = result7; - } else { - if (input.substr(pos, 14) === "BUSY-TENTATIVE") { - var result6 = "BUSY-TENTATIVE"; - pos += 14; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"BUSY-TENTATIVE\""); - } - } - if (result6 !== null) { - var result3 = result6; - } else { - var result5 = parse_x_name(); - if (result5 !== null) { - var result3 = result5; - } else { - var result4 = parse_iana_token(); - if (result4 !== null) { - var result3 = result4; - } else { - var result3 = null;; - }; - }; - }; - }; - }; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_languageparam() { - var cacheKey = 'languageparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "LANGUAGE") { - var result1 = "LANGUAGE"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"LANGUAGE\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_Language_Tag(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_Language_Tag() { - var cacheKey = 'Language_Tag@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 0) === "") { - var result0 = ""; - pos += 0; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_memberparam() { - var cacheKey = 'memberparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "MEMBER") { - var result1 = "MEMBER"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"MEMBER\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_DQUOTE(); - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_DQUOTE(); - if (result5 !== null) { - var result6 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result8 = ","; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result8 !== null) { - var result9 = parse_DQUOTE(); - if (result9 !== null) { - var result10 = parse_uri(); - if (result10 !== null) { - var result11 = parse_DQUOTE(); - if (result11 !== null) { - var result7 = [result8, result9, result10, result11]; - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - while (result7 !== null) { - result6.push(result7); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result8 = ","; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result8 !== null) { - var result9 = parse_DQUOTE(); - if (result9 !== null) { - var result10 = parse_uri(); - if (result10 !== null) { - var result11 = parse_DQUOTE(); - if (result11 !== null) { - var result7 = [result8, result9, result10, result11]; - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } else { - var result7 = null; - pos = savedPos1; - } - } - if (result6 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_partstatparam() { - var cacheKey = 'partstatparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "PARTSTAT") { - var result1 = "PARTSTAT"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"PARTSTAT\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result6 = parse_partstat_event(); - if (result6 !== null) { - var result3 = result6; - } else { - var result5 = parse_partstat_todo(); - if (result5 !== null) { - var result3 = result5; - } else { - var result4 = parse_partstat_jour(); - if (result4 !== null) { - var result3 = result4; - } else { - var result3 = null;; - }; - }; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_partstat_event() { - var cacheKey = 'partstat_event@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 12) === "NEEDS-ACTION") { - var result7 = "NEEDS-ACTION"; - pos += 12; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"NEEDS-ACTION\""); - } - } - if (result7 !== null) { - var result0 = result7; - } else { - if (input.substr(pos, 8) === "ACCEPTED") { - var result6 = "ACCEPTED"; - pos += 8; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"ACCEPTED\""); - } - } - if (result6 !== null) { - var result0 = result6; - } else { - if (input.substr(pos, 8) === "DECLINED") { - var result5 = "DECLINED"; - pos += 8; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"DECLINED\""); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos, 9) === "TENTATIVE") { - var result4 = "TENTATIVE"; - pos += 9; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"TENTATIVE\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 9) === "DELEGATED") { - var result3 = "DELEGATED"; - pos += 9; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"DELEGATED\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_x_name(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_iana_token(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_partstat_todo() { - var cacheKey = 'partstat_todo@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 12) === "NEEDS-ACTION") { - var result9 = "NEEDS-ACTION"; - pos += 12; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"NEEDS-ACTION\""); - } - } - if (result9 !== null) { - var result0 = result9; - } else { - if (input.substr(pos, 8) === "ACCEPTED") { - var result8 = "ACCEPTED"; - pos += 8; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"ACCEPTED\""); - } - } - if (result8 !== null) { - var result0 = result8; - } else { - if (input.substr(pos, 8) === "DECLINED") { - var result7 = "DECLINED"; - pos += 8; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"DECLINED\""); - } - } - if (result7 !== null) { - var result0 = result7; - } else { - if (input.substr(pos, 9) === "TENTATIVE") { - var result6 = "TENTATIVE"; - pos += 9; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"TENTATIVE\""); - } - } - if (result6 !== null) { - var result0 = result6; - } else { - if (input.substr(pos, 9) === "DELEGATED") { - var result5 = "DELEGATED"; - pos += 9; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"DELEGATED\""); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos, 9) === "COMPLETED") { - var result4 = "COMPLETED"; - pos += 9; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"COMPLETED\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 10) === "IN-PROCESS") { - var result3 = "IN-PROCESS"; - pos += 10; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"IN-PROCESS\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_x_name(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_iana_token(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_partstat_jour() { - var cacheKey = 'partstat_jour@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 12) === "NEEDS-ACTION") { - var result5 = "NEEDS-ACTION"; - pos += 12; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"NEEDS-ACTION\""); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos, 8) === "ACCEPTED") { - var result4 = "ACCEPTED"; - pos += 8; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"ACCEPTED\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 8) === "DECLINED") { - var result3 = "DECLINED"; - pos += 8; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"DECLINED\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_x_name(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_iana_token(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_rangeparam() { - var cacheKey = 'rangeparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "RANGE") { - var result1 = "RANGE"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"RANGE\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 13) === "THISANDFUTURE") { - var result3 = "THISANDFUTURE"; - pos += 13; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"THISANDFUTURE\""); - } - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_trigrelparam() { - var cacheKey = 'trigrelparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "RELATED") { - var result1 = "RELATED"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"RELATED\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 5) === "START") { - var result5 = "START"; - pos += 5; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"START\""); - } - } - if (result5 !== null) { - var result3 = result5; - } else { - if (input.substr(pos, 3) === "END") { - var result4 = "END"; - pos += 3; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result4 !== null) { - var result3 = result4; - } else { - var result3 = null;; - }; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_reltypeparam() { - var cacheKey = 'reltypeparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "RELTYPE") { - var result1 = "RELTYPE"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"RELTYPE\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 6) === "PARENT") { - var result8 = "PARENT"; - pos += 6; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"PARENT\""); - } - } - if (result8 !== null) { - var result3 = result8; - } else { - if (input.substr(pos, 5) === "CHILD") { - var result7 = "CHILD"; - pos += 5; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"CHILD\""); - } - } - if (result7 !== null) { - var result3 = result7; - } else { - if (input.substr(pos, 7) === "SIBLING") { - var result6 = "SIBLING"; - pos += 7; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"SIBLING\""); - } - } - if (result6 !== null) { - var result3 = result6; - } else { - var result5 = parse_iana_token(); - if (result5 !== null) { - var result3 = result5; - } else { - var result4 = parse_x_name(); - if (result4 !== null) { - var result3 = result4; - } else { - var result3 = null;; - }; - }; - }; - }; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_roleparam() { - var cacheKey = 'roleparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 4) === "ROLE") { - var result1 = "ROLE"; - pos += 4; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"ROLE\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 5) === "CHAIR") { - var result9 = "CHAIR"; - pos += 5; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"CHAIR\""); - } - } - if (result9 !== null) { - var result3 = result9; - } else { - if (input.substr(pos, 15) === "REQ-PARTICIPANT") { - var result8 = "REQ-PARTICIPANT"; - pos += 15; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"REQ-PARTICIPANT\""); - } - } - if (result8 !== null) { - var result3 = result8; - } else { - if (input.substr(pos, 15) === "OPT-PARTICIPANT") { - var result7 = "OPT-PARTICIPANT"; - pos += 15; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"OPT-PARTICIPANT\""); - } - } - if (result7 !== null) { - var result3 = result7; - } else { - if (input.substr(pos, 15) === "NON-PARTICIPANT") { - var result6 = "NON-PARTICIPANT"; - pos += 15; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"NON-PARTICIPANT\""); - } - } - if (result6 !== null) { - var result3 = result6; - } else { - var result5 = parse_x_name(); - if (result5 !== null) { - var result3 = result5; - } else { - var result4 = parse_iana_token(); - if (result4 !== null) { - var result3 = result4; - } else { - var result3 = null;; - }; - }; - }; - }; - }; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_rsvpparam() { - var cacheKey = 'rsvpparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 4) === "RSVP") { - var result1 = "RSVP"; - pos += 4; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"RSVP\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 4) === "TRUE") { - var result5 = "TRUE"; - pos += 4; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"TRUE\""); - } - } - if (result5 !== null) { - var result3 = result5; - } else { - if (input.substr(pos, 5) === "FALSE") { - var result4 = "FALSE"; - pos += 5; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"FALSE\""); - } - } - if (result4 !== null) { - var result3 = result4; - } else { - var result3 = null;; - }; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_sentbyparam() { - var cacheKey = 'sentbyparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "SENT-BY") { - var result1 = "SENT-BY"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"SENT-BY\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_DQUOTE(); - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_DQUOTE(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzidparam() { - var cacheKey = 'tzidparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 4) === "TZID") { - var result1 = "TZID"; - pos += 4; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"TZID\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result5 = parse_tzidprefix(); - var result3 = result5 !== null ? result5 : ''; - if (result3 !== null) { - var result4 = parse_paramtext(); - if (result4 !== null) { - var result0 = [result1, result2, result3, result4]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_tzidprefix() { - var cacheKey = 'tzidprefix@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 1) === "/") { - var result0 = "/"; - pos += 1; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"/\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_valuetypeparam() { - var cacheKey = 'valuetypeparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "VALUE") { - var result1 = "VALUE"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === "=") { - var result2 = "="; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result2 !== null) { - var result3 = parse_valuetype(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_valuetype() { - var cacheKey = 'valuetype@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 6) === "BINARY") { - var result16 = "BINARY"; - pos += 6; - } else { - var result16 = null; - if (reportMatchFailures) { - matchFailed("\"BINARY\""); - } - } - if (result16 !== null) { - var result0 = result16; - } else { - if (input.substr(pos, 7) === "BOOLEAN") { - var result15 = "BOOLEAN"; - pos += 7; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\"BOOLEAN\""); - } - } - if (result15 !== null) { - var result0 = result15; - } else { - if (input.substr(pos, 11) === "CAL-ADDRESS") { - var result14 = "CAL-ADDRESS"; - pos += 11; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"CAL-ADDRESS\""); - } - } - if (result14 !== null) { - var result0 = result14; - } else { - if (input.substr(pos, 4) === "DATE") { - var result13 = "DATE"; - pos += 4; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result13 !== null) { - var result0 = result13; - } else { - if (input.substr(pos, 9) === "DATE-TIME") { - var result12 = "DATE-TIME"; - pos += 9; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result12 !== null) { - var result0 = result12; - } else { - if (input.substr(pos, 8) === "DURATION") { - var result11 = "DURATION"; - pos += 8; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"DURATION\""); - } - } - if (result11 !== null) { - var result0 = result11; - } else { - if (input.substr(pos, 5) === "FLOAT") { - var result10 = "FLOAT"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"FLOAT\""); - } - } - if (result10 !== null) { - var result0 = result10; - } else { - if (input.substr(pos, 7) === "INTEGER") { - var result9 = "INTEGER"; - pos += 7; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"INTEGER\""); - } - } - if (result9 !== null) { - var result0 = result9; - } else { - if (input.substr(pos, 6) === "PERIOD") { - var result8 = "PERIOD"; - pos += 6; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"PERIOD\""); - } - } - if (result8 !== null) { - var result0 = result8; - } else { - if (input.substr(pos, 5) === "RECUR") { - var result7 = "RECUR"; - pos += 5; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"RECUR\""); - } - } - if (result7 !== null) { - var result0 = result7; - } else { - if (input.substr(pos, 4) === "TEXT") { - var result6 = "TEXT"; - pos += 4; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"TEXT\""); - } - } - if (result6 !== null) { - var result0 = result6; - } else { - if (input.substr(pos, 4) === "TIME") { - var result5 = "TIME"; - pos += 4; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"TIME\""); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos, 3) === "URI") { - var result4 = "URI"; - pos += 3; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"URI\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 10) === "UTC-OFFSET") { - var result3 = "UTC-OFFSET"; - pos += 10; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"UTC-OFFSET\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_x_name(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_iana_token(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_eventc() { - var cacheKey = 'eventc@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 6) === "VEVENT") { - var result3 = "VEVENT"; - pos += 6; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"VEVENT\""); - } - } - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result5 = parse_eventprop(); - if (result5 !== null) { - var result6 = []; - var result11 = parse_alarmc(); - while (result11 !== null) { - result6.push(result11); - var result11 = parse_alarmc(); - } - if (result6 !== null) { - if (input.substr(pos, 3) === "END") { - var result7 = "END"; - pos += 3; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 1) === ":") { - var result8 = ":"; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result8 !== null) { - if (input.substr(pos, 6) === "VEVENT") { - var result9 = "VEVENT"; - pos += 6; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"VEVENT\""); - } - } - if (result9 !== null) { - var result10 = parse_CRLF(); - if (result10 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9, result10]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_eventprop() { - var cacheKey = 'eventprop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result33 = parse_dtstamp(); - if (result33 !== null) { - var result1 = result33; - } else { - var result32 = parse_uid(); - if (result32 !== null) { - var result1 = result32; - } else { - var result31 = parse_dtstart(); - if (result31 !== null) { - var result1 = result31; - } else { - var result30 = parse_class(); - if (result30 !== null) { - var result1 = result30; - } else { - var result29 = parse_created(); - if (result29 !== null) { - var result1 = result29; - } else { - var result28 = parse_description(); - if (result28 !== null) { - var result1 = result28; - } else { - var result27 = parse_geo(); - if (result27 !== null) { - var result1 = result27; - } else { - var result26 = parse_last_mod(); - if (result26 !== null) { - var result1 = result26; - } else { - var result25 = parse_location(); - if (result25 !== null) { - var result1 = result25; - } else { - var result24 = parse_organizer(); - if (result24 !== null) { - var result1 = result24; - } else { - var result23 = parse_priority(); - if (result23 !== null) { - var result1 = result23; - } else { - var result22 = parse_seq(); - if (result22 !== null) { - var result1 = result22; - } else { - var result21 = parse_status(); - if (result21 !== null) { - var result1 = result21; - } else { - var result20 = parse_summary(); - if (result20 !== null) { - var result1 = result20; - } else { - var result19 = parse_transp(); - if (result19 !== null) { - var result1 = result19; - } else { - var result18 = parse_url(); - if (result18 !== null) { - var result1 = result18; - } else { - var result17 = parse_recurid(); - if (result17 !== null) { - var result1 = result17; - } else { - var result16 = parse_rrule(); - if (result16 !== null) { - var result1 = result16; - } else { - var result15 = parse_dtend(); - if (result15 !== null) { - var result1 = result15; - } else { - var result14 = parse_duration(); - if (result14 !== null) { - var result1 = result14; - } else { - var result13 = parse_attach(); - if (result13 !== null) { - var result1 = result13; - } else { - var result12 = parse_attendee(); - if (result12 !== null) { - var result1 = result12; - } else { - var result11 = parse_categories(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_comment(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_contact(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_exdate(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_rstatus(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_related(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_resources(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_rdate(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var result33 = parse_dtstamp(); - if (result33 !== null) { - var result1 = result33; - } else { - var result32 = parse_uid(); - if (result32 !== null) { - var result1 = result32; - } else { - var result31 = parse_dtstart(); - if (result31 !== null) { - var result1 = result31; - } else { - var result30 = parse_class(); - if (result30 !== null) { - var result1 = result30; - } else { - var result29 = parse_created(); - if (result29 !== null) { - var result1 = result29; - } else { - var result28 = parse_description(); - if (result28 !== null) { - var result1 = result28; - } else { - var result27 = parse_geo(); - if (result27 !== null) { - var result1 = result27; - } else { - var result26 = parse_last_mod(); - if (result26 !== null) { - var result1 = result26; - } else { - var result25 = parse_location(); - if (result25 !== null) { - var result1 = result25; - } else { - var result24 = parse_organizer(); - if (result24 !== null) { - var result1 = result24; - } else { - var result23 = parse_priority(); - if (result23 !== null) { - var result1 = result23; - } else { - var result22 = parse_seq(); - if (result22 !== null) { - var result1 = result22; - } else { - var result21 = parse_status(); - if (result21 !== null) { - var result1 = result21; - } else { - var result20 = parse_summary(); - if (result20 !== null) { - var result1 = result20; - } else { - var result19 = parse_transp(); - if (result19 !== null) { - var result1 = result19; - } else { - var result18 = parse_url(); - if (result18 !== null) { - var result1 = result18; - } else { - var result17 = parse_recurid(); - if (result17 !== null) { - var result1 = result17; - } else { - var result16 = parse_rrule(); - if (result16 !== null) { - var result1 = result16; - } else { - var result15 = parse_dtend(); - if (result15 !== null) { - var result1 = result15; - } else { - var result14 = parse_duration(); - if (result14 !== null) { - var result1 = result14; - } else { - var result13 = parse_attach(); - if (result13 !== null) { - var result1 = result13; - } else { - var result12 = parse_attendee(); - if (result12 !== null) { - var result1 = result12; - } else { - var result11 = parse_categories(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_comment(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_contact(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_exdate(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_rstatus(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_related(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_resources(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_rdate(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_alarmc() { - var cacheKey = 'alarmc@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "BEGIN") { - var result1 = "BEGIN"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"BEGIN\""); - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 6) === "VALARM") { - var result3 = "VALARM"; - pos += 6; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"VALARM\""); - } - } - if (result3 !== null) { - var result4 = parse_CRLF(); - if (result4 !== null) { - var result12 = parse_audioprop(); - if (result12 !== null) { - var result5 = result12; - } else { - var result11 = parse_dispprop(); - if (result11 !== null) { - var result5 = result11; - } else { - var result10 = parse_emailprop(); - if (result10 !== null) { - var result5 = result10; - } else { - var result5 = null;; - }; - }; - } - if (result5 !== null) { - if (input.substr(pos, 3) === "END") { - var result6 = "END"; - pos += 3; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"END\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === ":") { - var result7 = ":"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 6) === "VALARM") { - var result8 = "VALARM"; - pos += 6; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\"VALARM\""); - } - } - if (result8 !== null) { - var result9 = parse_CRLF(); - if (result9 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7, result8, result9]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_audioprop() { - var cacheKey = 'audioprop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result8 = parse_action(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_trigger(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_duration(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_repeat(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_attach(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var result8 = parse_action(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_trigger(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_duration(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_repeat(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_attach(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dispprop() { - var cacheKey = 'dispprop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result8 = parse_action(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_description(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_trigger(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_duration(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_repeat(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var result8 = parse_action(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_description(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_trigger(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_duration(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_repeat(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_emailprop() { - var cacheKey = 'emailprop@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result11 = parse_action(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_description(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_trigger(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_summary(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_attendee(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_duration(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_repeat(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_attach(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var result11 = parse_action(); - if (result11 !== null) { - var result1 = result11; - } else { - var result10 = parse_description(); - if (result10 !== null) { - var result1 = result10; - } else { - var result9 = parse_trigger(); - if (result9 !== null) { - var result1 = result9; - } else { - var result8 = parse_summary(); - if (result8 !== null) { - var result1 = result8; - } else { - var result7 = parse_attendee(); - if (result7 !== null) { - var result1 = result7; - } else { - var result6 = parse_duration(); - if (result6 !== null) { - var result1 = result6; - } else { - var result5 = parse_repeat(); - if (result5 !== null) { - var result1 = result5; - } else { - var result4 = parse_attach(); - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_x_prop(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_iana_prop(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dtstamp() { - var cacheKey = 'dtstamp@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "DTSTAMP") { - var result1 = "DTSTAMP"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"DTSTAMP\""); - } - } - if (result1 !== null) { - var result2 = parse_stmparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_date_time(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_stmparam() { - var cacheKey = 'stmparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_uid() { - var cacheKey = 'uid@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 3) === "UID") { - var result1 = "UID"; - pos += 3; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"UID\""); - } - } - if (result1 !== null) { - var result2 = parse_uidparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_text(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_uidparam() { - var cacheKey = 'uidparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dtstart() { - var cacheKey = 'dtstart@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "DTSTART") { - var result1 = "DTSTART"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"DTSTART\""); - } - } - if (result1 !== null) { - var result2 = parse_dtstparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_dtstval(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dtstparam() { - var cacheKey = 'dtstparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result14 = "DATE-TIME"; - pos += 9; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 4) === "DATE") { - var result13 = "DATE"; - pos += 4; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result14 = "DATE-TIME"; - pos += 9; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 4) === "DATE") { - var result13 = "DATE"; - pos += 4; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dtstval() { - var cacheKey = 'dtstval@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_date_time(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_date_value(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_class() { - var cacheKey = 'class@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "CLASS") { - var result1 = "CLASS"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CLASS\""); - } - } - if (result1 !== null) { - var result2 = parse_classparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_classvalue(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_classparam() { - var cacheKey = 'classparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_classvalue() { - var cacheKey = 'classvalue@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 6) === "PUBLIC") { - var result5 = "PUBLIC"; - pos += 6; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"PUBLIC\""); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos, 7) === "PRIVATE") { - var result4 = "PRIVATE"; - pos += 7; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"PRIVATE\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 12) === "CONFIDENTIAL") { - var result3 = "CONFIDENTIAL"; - pos += 12; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"CONFIDENTIAL\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_iana_token(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_x_name(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_created() { - var cacheKey = 'created@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "CREATED") { - var result1 = "CREATED"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CREATED\""); - } - } - if (result1 !== null) { - var result2 = parse_creaparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_date_time(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_creaparam() { - var cacheKey = 'creaparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_description() { - var cacheKey = 'description@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 11) === "DESCRIPTION") { - var result1 = "DESCRIPTION"; - pos += 11; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"DESCRIPTION\""); - } - } - if (result1 !== null) { - var result2 = parse_descparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_text(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_descparam() { - var cacheKey = 'descparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_geo() { - var cacheKey = 'geo@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 3) === "GEO") { - var result1 = "GEO"; - pos += 3; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"GEO\""); - } - } - if (result1 !== null) { - var result2 = parse_geoparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_geovalue(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_geoparam() { - var cacheKey = 'geoparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_geovalue() { - var cacheKey = 'geovalue@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_float(); - if (result1 !== null) { - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_float(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_float() { - var cacheKey = 'float@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 1) === "+") { - var result11 = "+"; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"+\""); - } - } - var result10 = result11 !== null ? result11 : ''; - if (result10 !== null) { - var result1 = result10; - } else { - if (input.substr(pos, 1) === "-") { - var result9 = "-"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"-\""); - } - } - if (result9 !== null) { - var result1 = result9; - } else { - var result1 = null;; - }; - } - if (result1 !== null) { - var result8 = parse_DIGIT(); - var result2 = result8 !== null ? result8 : ''; - if (result2 !== null) { - var savedPos1 = pos; - if (input.substr(pos, 1) === ".") { - var result5 = "."; - pos += 1; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\".\""); - } - } - if (result5 !== null) { - var result7 = parse_DIGIT(); - var result6 = result7 !== null ? result7 : ''; - if (result6 !== null) { - var result4 = [result5, result6]; - } else { - var result4 = null; - pos = savedPos1; - } - } else { - var result4 = null; - pos = savedPos1; - } - var result3 = result4 !== null ? result4 : ''; - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_last_mod() { - var cacheKey = 'last_mod@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 13) === "LAST-MODIFIED") { - var result1 = "LAST-MODIFIED"; - pos += 13; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"LAST-MODIFIED\""); - } - } - if (result1 !== null) { - var result2 = parse_lstparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_date_time(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_lstparam() { - var cacheKey = 'lstparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_location() { - var cacheKey = 'location@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "LOCATION") { - var result1 = "LOCATION"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"LOCATION\""); - } - } - if (result1 !== null) { - var result2 = parse_locparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_text(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_locparam() { - var cacheKey = 'locparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_organizer() { - var cacheKey = 'organizer@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 9) === "ORGANIZER") { - var result1 = "ORGANIZER"; - pos += 9; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"ORGANIZER\""); - } - } - if (result1 !== null) { - var result2 = parse_orgparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_orgparam() { - var cacheKey = 'orgparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos4 = pos; - if (input.substr(pos, 1) === ";") { - var result15 = ";"; - pos += 1; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result15 !== null) { - var result16 = parse_cnparam(); - if (result16 !== null) { - var result14 = [result15, result16]; - } else { - var result14 = null; - pos = savedPos4; - } - } else { - var result14 = null; - pos = savedPos4; - } - if (result14 !== null) { - var result1 = result14; - } else { - var savedPos3 = pos; - if (input.substr(pos, 1) === ";") { - var result12 = ";"; - pos += 1; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result12 !== null) { - var result13 = parse_dirparam(); - if (result13 !== null) { - var result11 = [result12, result13]; - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - if (result11 !== null) { - var result1 = result11; - } else { - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_sentbyparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos4 = pos; - if (input.substr(pos, 1) === ";") { - var result15 = ";"; - pos += 1; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result15 !== null) { - var result16 = parse_cnparam(); - if (result16 !== null) { - var result14 = [result15, result16]; - } else { - var result14 = null; - pos = savedPos4; - } - } else { - var result14 = null; - pos = savedPos4; - } - if (result14 !== null) { - var result1 = result14; - } else { - var savedPos3 = pos; - if (input.substr(pos, 1) === ";") { - var result12 = ";"; - pos += 1; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result12 !== null) { - var result13 = parse_dirparam(); - if (result13 !== null) { - var result11 = [result12, result13]; - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - if (result11 !== null) { - var result1 = result11; - } else { - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_sentbyparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_priority() { - var cacheKey = 'priority@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "PRIORITY") { - var result1 = "PRIORITY"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"PRIORITY\""); - } - } - if (result1 !== null) { - var result2 = parse_prioparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_integer(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_prioparam() { - var cacheKey = 'prioparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_seq() { - var cacheKey = 'seq@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "SEQUENCE") { - var result1 = "SEQUENCE"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"SEQUENCE\""); - } - } - if (result1 !== null) { - var result2 = parse_seqparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_integer(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_seqparam() { - var cacheKey = 'seqparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_status() { - var cacheKey = 'status@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "STATUS") { - var result1 = "STATUS"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"STATUS\""); - } - } - if (result1 !== null) { - var result2 = parse_statparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_statvalue(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_statparam() { - var cacheKey = 'statparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_statvalue() { - var cacheKey = 'statvalue@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result3 = parse_statvalue_event(); - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_statvalue_todo(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_statvalue_jour(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_statvalue_event() { - var cacheKey = 'statvalue_event@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 9) === "TENTATIVE") { - var result3 = "TENTATIVE"; - pos += 9; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"TENTATIVE\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos, 9) === "CONFIRMED") { - var result2 = "CONFIRMED"; - pos += 9; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"CONFIRMED\""); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - if (input.substr(pos, 9) === "CANCELLED") { - var result1 = "CANCELLED"; - pos += 9; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CANCELLED\""); - } - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_statvalue_todo() { - var cacheKey = 'statvalue_todo@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 12) === "NEEDS-ACTION") { - var result4 = "NEEDS-ACTION"; - pos += 12; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"NEEDS-ACTION\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 9) === "COMPLETED") { - var result3 = "COMPLETED"; - pos += 9; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"COMPLETED\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos, 10) === "IN-PROCESS") { - var result2 = "IN-PROCESS"; - pos += 10; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"IN-PROCESS\""); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - if (input.substr(pos, 9) === "CANCELLED") { - var result1 = "CANCELLED"; - pos += 9; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CANCELLED\""); - } - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_summary() { - var cacheKey = 'summary@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "SUMMARY") { - var result1 = "SUMMARY"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"SUMMARY\""); - } - } - if (result1 !== null) { - var result2 = parse_summparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_text(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_summparam() { - var cacheKey = 'summparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_transp() { - var cacheKey = 'transp@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "TRANSP") { - var result1 = "TRANSP"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"TRANSP\""); - } - } - if (result1 !== null) { - var result2 = parse_transparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_transvalue(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_transparam() { - var cacheKey = 'transparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_transvalue() { - var cacheKey = 'transvalue@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 6) === "OPAQUE") { - var result2 = "OPAQUE"; - pos += 6; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"OPAQUE\""); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - if (input.substr(pos, 11) === "TRANSPARENT") { - var result1 = "TRANSPARENT"; - pos += 11; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"TRANSPARENT\""); - } - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_url() { - var cacheKey = 'url@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 3) === "URL") { - var result1 = "URL"; - pos += 3; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"URL\""); - } - } - if (result1 !== null) { - var result2 = parse_urlparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_urlparam() { - var cacheKey = 'urlparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_recurid() { - var cacheKey = 'recurid@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 13) === "RECURRENCE-ID") { - var result1 = "RECURRENCE-ID"; - pos += 13; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"RECURRENCE-ID\""); - } - } - if (result1 !== null) { - var result2 = parse_ridparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_ridval(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_ridparam() { - var cacheKey = 'ridparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos3 = pos; - if (input.substr(pos, 1) === ";") { - var result12 = ";"; - pos += 1; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result12 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result13 = "VALUE"; - pos += 5; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result13 !== null) { - if (input.substr(pos, 1) === "=") { - var result14 = "="; - pos += 1; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result14 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result17 = "DATE-TIME"; - pos += 9; - } else { - var result17 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result17 !== null) { - var result15 = result17; - } else { - if (input.substr(pos, 4) === "DATE") { - var result16 = "DATE"; - pos += 4; - } else { - var result16 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result16 !== null) { - var result15 = result16; - } else { - var result15 = null;; - }; - } - if (result15 !== null) { - var result11 = [result12, result13, result14, result15]; - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - if (result11 !== null) { - var result1 = result11; - } else { - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_tzidparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_rangeparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos3 = pos; - if (input.substr(pos, 1) === ";") { - var result12 = ";"; - pos += 1; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result12 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result13 = "VALUE"; - pos += 5; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result13 !== null) { - if (input.substr(pos, 1) === "=") { - var result14 = "="; - pos += 1; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result14 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result17 = "DATE-TIME"; - pos += 9; - } else { - var result17 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result17 !== null) { - var result15 = result17; - } else { - if (input.substr(pos, 4) === "DATE") { - var result16 = "DATE"; - pos += 4; - } else { - var result16 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result16 !== null) { - var result15 = result16; - } else { - var result15 = null;; - }; - } - if (result15 !== null) { - var result11 = [result12, result13, result14, result15]; - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - if (result11 !== null) { - var result1 = result11; - } else { - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_tzidparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_rangeparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_ridval() { - var cacheKey = 'ridval@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_date_time(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_date_value(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_rrule() { - var cacheKey = 'rrule@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "RRULE") { - var result1 = "RRULE"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"RRULE\""); - } - } - if (result1 !== null) { - var result2 = parse_rrulparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_recur(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_rrulparam() { - var cacheKey = 'rrulparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dtend() { - var cacheKey = 'dtend@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "DTEND") { - var result1 = "DTEND"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"DTEND\""); - } - } - if (result1 !== null) { - var result2 = parse_dtendparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_dtendval(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dtendparam() { - var cacheKey = 'dtendparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result14 = "DATE-TIME"; - pos += 9; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 4) === "DATE") { - var result13 = "DATE"; - pos += 4; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result14 = "DATE-TIME"; - pos += 9; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 4) === "DATE") { - var result13 = "DATE"; - pos += 4; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dtendval() { - var cacheKey = 'dtendval@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_date_time(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_date_value(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_duration() { - var cacheKey = 'duration@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "DURATION") { - var result1 = "DURATION"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"DURATION\""); - } - } - if (result1 !== null) { - var result2 = parse_durparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_dur_value(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_durparam() { - var cacheKey = 'durparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_attach() { - var cacheKey = 'attach@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos2 = pos; - if (input.substr(pos, 6) === "ATTACH") { - var result15 = "ATTACH"; - pos += 6; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\"ATTACH\""); - } - } - if (result15 !== null) { - var result16 = parse_attachparam(); - if (result16 !== null) { - var savedPos3 = pos; - if (input.substr(pos, 1) === ":") { - var result18 = ":"; - pos += 1; - } else { - var result18 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result18 !== null) { - var result19 = parse_uri(); - if (result19 !== null) { - var result17 = [result18, result19]; - } else { - var result17 = null; - pos = savedPos3; - } - } else { - var result17 = null; - pos = savedPos3; - } - if (result17 !== null) { - var result14 = [result15, result16, result17]; - } else { - var result14 = null; - pos = savedPos2; - } - } else { - var result14 = null; - pos = savedPos2; - } - } else { - var result14 = null; - pos = savedPos2; - } - if (result14 !== null) { - var result0 = result14; - } else { - var savedPos0 = pos; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result4 = ";"; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result4 !== null) { - if (input.substr(pos, 8) === "ENCODING") { - var result5 = "ENCODING"; - pos += 8; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"ENCODING\""); - } - } - if (result5 !== null) { - if (input.substr(pos, 1) === "=") { - var result6 = "="; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 6) === "BASE64") { - var result7 = "BASE64"; - pos += 6; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"BASE64\""); - } - } - if (result7 !== null) { - if (input.substr(pos, 1) === ";") { - var result8 = ";"; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result8 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result9 = "VALUE"; - pos += 5; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 1) === "=") { - var result10 = "="; - pos += 1; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 6) === "BINARY") { - var result11 = "BINARY"; - pos += 6; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"BINARY\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 1) === ":") { - var result12 = ":"; - pos += 1; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result12 !== null) { - var result13 = parse_binary(); - if (result13 !== null) { - var result2 = [result4, result5, result6, result7, result8, result9, result10, result11, result12, result13]; - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - if (result2 !== null) { - var result3 = parse_CRLF(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_attachparam() { - var cacheKey = 'attachparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_fmttypeparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_fmttypeparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_attendee() { - var cacheKey = 'attendee@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 8) === "ATTENDEE") { - var result1 = "ATTENDEE"; - pos += 8; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"ATTENDEE\""); - } - } - if (result1 !== null) { - var result2 = parse_attparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_uri(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_attparam() { - var cacheKey = 'attparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos11 = pos; - if (input.substr(pos, 1) === ";") { - var result36 = ";"; - pos += 1; - } else { - var result36 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result36 !== null) { - var result37 = parse_cutypeparam(); - if (result37 !== null) { - var result35 = [result36, result37]; - } else { - var result35 = null; - pos = savedPos11; - } - } else { - var result35 = null; - pos = savedPos11; - } - if (result35 !== null) { - var result1 = result35; - } else { - var savedPos10 = pos; - if (input.substr(pos, 1) === ";") { - var result33 = ";"; - pos += 1; - } else { - var result33 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result33 !== null) { - var result34 = parse_memberparam(); - if (result34 !== null) { - var result32 = [result33, result34]; - } else { - var result32 = null; - pos = savedPos10; - } - } else { - var result32 = null; - pos = savedPos10; - } - if (result32 !== null) { - var result1 = result32; - } else { - var savedPos9 = pos; - if (input.substr(pos, 1) === ";") { - var result30 = ";"; - pos += 1; - } else { - var result30 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result30 !== null) { - var result31 = parse_roleparam(); - if (result31 !== null) { - var result29 = [result30, result31]; - } else { - var result29 = null; - pos = savedPos9; - } - } else { - var result29 = null; - pos = savedPos9; - } - if (result29 !== null) { - var result1 = result29; - } else { - var savedPos8 = pos; - if (input.substr(pos, 1) === ";") { - var result27 = ";"; - pos += 1; - } else { - var result27 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result27 !== null) { - var result28 = parse_partstatparam(); - if (result28 !== null) { - var result26 = [result27, result28]; - } else { - var result26 = null; - pos = savedPos8; - } - } else { - var result26 = null; - pos = savedPos8; - } - if (result26 !== null) { - var result1 = result26; - } else { - var savedPos7 = pos; - if (input.substr(pos, 1) === ";") { - var result24 = ";"; - pos += 1; - } else { - var result24 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result24 !== null) { - var result25 = parse_rsvpparam(); - if (result25 !== null) { - var result23 = [result24, result25]; - } else { - var result23 = null; - pos = savedPos7; - } - } else { - var result23 = null; - pos = savedPos7; - } - if (result23 !== null) { - var result1 = result23; - } else { - var savedPos6 = pos; - if (input.substr(pos, 1) === ";") { - var result21 = ";"; - pos += 1; - } else { - var result21 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result21 !== null) { - var result22 = parse_deltoparam(); - if (result22 !== null) { - var result20 = [result21, result22]; - } else { - var result20 = null; - pos = savedPos6; - } - } else { - var result20 = null; - pos = savedPos6; - } - if (result20 !== null) { - var result1 = result20; - } else { - var savedPos5 = pos; - if (input.substr(pos, 1) === ";") { - var result18 = ";"; - pos += 1; - } else { - var result18 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result18 !== null) { - var result19 = parse_delfromparam(); - if (result19 !== null) { - var result17 = [result18, result19]; - } else { - var result17 = null; - pos = savedPos5; - } - } else { - var result17 = null; - pos = savedPos5; - } - if (result17 !== null) { - var result1 = result17; - } else { - var savedPos4 = pos; - if (input.substr(pos, 1) === ";") { - var result15 = ";"; - pos += 1; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result15 !== null) { - var result16 = parse_sentbyparam(); - if (result16 !== null) { - var result14 = [result15, result16]; - } else { - var result14 = null; - pos = savedPos4; - } - } else { - var result14 = null; - pos = savedPos4; - } - if (result14 !== null) { - var result1 = result14; - } else { - var savedPos3 = pos; - if (input.substr(pos, 1) === ";") { - var result12 = ";"; - pos += 1; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result12 !== null) { - var result13 = parse_cnparam(); - if (result13 !== null) { - var result11 = [result12, result13]; - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - if (result11 !== null) { - var result1 = result11; - } else { - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_dirparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos11 = pos; - if (input.substr(pos, 1) === ";") { - var result36 = ";"; - pos += 1; - } else { - var result36 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result36 !== null) { - var result37 = parse_cutypeparam(); - if (result37 !== null) { - var result35 = [result36, result37]; - } else { - var result35 = null; - pos = savedPos11; - } - } else { - var result35 = null; - pos = savedPos11; - } - if (result35 !== null) { - var result1 = result35; - } else { - var savedPos10 = pos; - if (input.substr(pos, 1) === ";") { - var result33 = ";"; - pos += 1; - } else { - var result33 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result33 !== null) { - var result34 = parse_memberparam(); - if (result34 !== null) { - var result32 = [result33, result34]; - } else { - var result32 = null; - pos = savedPos10; - } - } else { - var result32 = null; - pos = savedPos10; - } - if (result32 !== null) { - var result1 = result32; - } else { - var savedPos9 = pos; - if (input.substr(pos, 1) === ";") { - var result30 = ";"; - pos += 1; - } else { - var result30 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result30 !== null) { - var result31 = parse_roleparam(); - if (result31 !== null) { - var result29 = [result30, result31]; - } else { - var result29 = null; - pos = savedPos9; - } - } else { - var result29 = null; - pos = savedPos9; - } - if (result29 !== null) { - var result1 = result29; - } else { - var savedPos8 = pos; - if (input.substr(pos, 1) === ";") { - var result27 = ";"; - pos += 1; - } else { - var result27 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result27 !== null) { - var result28 = parse_partstatparam(); - if (result28 !== null) { - var result26 = [result27, result28]; - } else { - var result26 = null; - pos = savedPos8; - } - } else { - var result26 = null; - pos = savedPos8; - } - if (result26 !== null) { - var result1 = result26; - } else { - var savedPos7 = pos; - if (input.substr(pos, 1) === ";") { - var result24 = ";"; - pos += 1; - } else { - var result24 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result24 !== null) { - var result25 = parse_rsvpparam(); - if (result25 !== null) { - var result23 = [result24, result25]; - } else { - var result23 = null; - pos = savedPos7; - } - } else { - var result23 = null; - pos = savedPos7; - } - if (result23 !== null) { - var result1 = result23; - } else { - var savedPos6 = pos; - if (input.substr(pos, 1) === ";") { - var result21 = ";"; - pos += 1; - } else { - var result21 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result21 !== null) { - var result22 = parse_deltoparam(); - if (result22 !== null) { - var result20 = [result21, result22]; - } else { - var result20 = null; - pos = savedPos6; - } - } else { - var result20 = null; - pos = savedPos6; - } - if (result20 !== null) { - var result1 = result20; - } else { - var savedPos5 = pos; - if (input.substr(pos, 1) === ";") { - var result18 = ";"; - pos += 1; - } else { - var result18 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result18 !== null) { - var result19 = parse_delfromparam(); - if (result19 !== null) { - var result17 = [result18, result19]; - } else { - var result17 = null; - pos = savedPos5; - } - } else { - var result17 = null; - pos = savedPos5; - } - if (result17 !== null) { - var result1 = result17; - } else { - var savedPos4 = pos; - if (input.substr(pos, 1) === ";") { - var result15 = ";"; - pos += 1; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result15 !== null) { - var result16 = parse_sentbyparam(); - if (result16 !== null) { - var result14 = [result15, result16]; - } else { - var result14 = null; - pos = savedPos4; - } - } else { - var result14 = null; - pos = savedPos4; - } - if (result14 !== null) { - var result1 = result14; - } else { - var savedPos3 = pos; - if (input.substr(pos, 1) === ";") { - var result12 = ";"; - pos += 1; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result12 !== null) { - var result13 = parse_cnparam(); - if (result13 !== null) { - var result11 = [result12, result13]; - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - if (result11 !== null) { - var result1 = result11; - } else { - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_dirparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_categories() { - var cacheKey = 'categories@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 10) === "CATEGORIES") { - var result1 = "CATEGORIES"; - pos += 10; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CATEGORIES\""); - } - } - if (result1 !== null) { - var result2 = parse_catparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = []; - var result9 = parse_text(); - while (result9 !== null) { - result4.push(result9); - var result9 = parse_text(); - } - if (result4 !== null) { - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result7 = ","; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result7 !== null) { - var result8 = parse_text(); - if (result8 !== null) { - var result5 = [result7, result8]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result6 = parse_CRLF(); - if (result6 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_catparam() { - var cacheKey = 'catparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_comment() { - var cacheKey = 'comment@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "COMMENT") { - var result1 = "COMMENT"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"COMMENT\""); - } - } - if (result1 !== null) { - var result2 = parse_commparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_text(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_commparam() { - var cacheKey = 'commparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_contact() { - var cacheKey = 'contact@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "CONTACT") { - var result1 = "CONTACT"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CONTACT\""); - } - } - if (result1 !== null) { - var result2 = parse_contparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_text(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_contparam() { - var cacheKey = 'contparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_exdate() { - var cacheKey = 'exdate@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "EXDATE") { - var result1 = "EXDATE"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"EXDATE\""); - } - } - if (result1 !== null) { - var result2 = parse_exdtparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = []; - var result9 = parse_exdtval(); - while (result9 !== null) { - result4.push(result9); - var result9 = parse_exdtval(); - } - if (result4 !== null) { - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result7 = ","; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result7 !== null) { - var result8 = parse_exdtval(); - if (result8 !== null) { - var result5 = [result7, result8]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result6 = parse_CRLF(); - if (result6 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_exdtparam() { - var cacheKey = 'exdtparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result14 = "DATE-TIME"; - pos += 9; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 4) === "DATE") { - var result13 = "DATE"; - pos += 4; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result14 = "DATE-TIME"; - pos += 9; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 4) === "DATE") { - var result13 = "DATE"; - pos += 4; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_exdtval() { - var cacheKey = 'exdtval@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_date_time(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_date_value(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_rstatus() { - var cacheKey = 'rstatus@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 14) === "REQUEST-STATUS") { - var result1 = "REQUEST-STATUS"; - pos += 14; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"REQUEST-STATUS\""); - } - } - if (result1 !== null) { - var result2 = parse_rstatparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_statcode(); - if (result4 !== null) { - if (input.substr(pos, 1) === ";") { - var result5 = ";"; - pos += 1; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result5 !== null) { - var result6 = parse_text(); - if (result6 !== null) { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_text(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos1; - } - } else { - var result8 = null; - pos = savedPos1; - } - var result7 = result8 !== null ? result8 : ''; - if (result7 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6, result7]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_rstatparam() { - var cacheKey = 'rstatparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_related() { - var cacheKey = 'related@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 10) === "RELATED-TO") { - var result1 = "RELATED-TO"; - pos += 10; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"RELATED-TO\""); - } - } - if (result1 !== null) { - var result2 = parse_relparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_text(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_relparam() { - var cacheKey = 'relparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_reltypeparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_reltypeparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_resources() { - var cacheKey = 'resources@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 9) === "RESOURCES") { - var result1 = "RESOURCES"; - pos += 9; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"RESOURCES\""); - } - } - if (result1 !== null) { - var result2 = parse_resrcparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = []; - var result9 = parse_text(); - while (result9 !== null) { - result4.push(result9); - var result9 = parse_text(); - } - if (result4 !== null) { - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result7 = ","; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result7 !== null) { - var result8 = parse_text(); - if (result8 !== null) { - var result5 = [result7, result8]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result6 = parse_CRLF(); - if (result6 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_resrcparam() { - var cacheKey = 'resrcparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_altrepparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_languageparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_rdate() { - var cacheKey = 'rdate@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 5) === "RDATE") { - var result1 = "RDATE"; - pos += 5; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"RDATE\""); - } - } - if (result1 !== null) { - var result2 = parse_rdtparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = []; - var result9 = parse_rdtval(); - while (result9 !== null) { - result4.push(result9); - var result9 = parse_rdtval(); - } - if (result4 !== null) { - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result7 = ","; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result7 !== null) { - var result8 = parse_rdtval(); - if (result8 !== null) { - var result5 = [result7, result8]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result6 = parse_CRLF(); - if (result6 !== null) { - var result0 = [result1, result2, result3, result4, result5, result6]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_rdtparam() { - var cacheKey = 'rdtparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result15 = "DATE-TIME"; - pos += 9; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result15 !== null) { - var result12 = result15; - } else { - if (input.substr(pos, 4) === "DATE") { - var result14 = "DATE"; - pos += 4; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 6) === "PERIOD") { - var result13 = "PERIOD"; - pos += 6; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"PERIOD\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result15 = "DATE-TIME"; - pos += 9; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result15 !== null) { - var result12 = result15; - } else { - if (input.substr(pos, 4) === "DATE") { - var result14 = "DATE"; - pos += 4; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"DATE\""); - } - } - if (result14 !== null) { - var result12 = result14; - } else { - if (input.substr(pos, 6) === "PERIOD") { - var result13 = "PERIOD"; - pos += 6; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"PERIOD\""); - } - } - if (result13 !== null) { - var result12 = result13; - } else { - var result12 = null;; - }; - }; - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result1 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_tzidparam(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result1 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result3 = ";"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result3 !== null) { - var result4 = parse_other_param(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos0; - } - } else { - var result2 = null; - pos = savedPos0; - } - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_rdtval() { - var cacheKey = 'rdtval@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result3 = parse_date_time(); - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_date_value(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_period(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_action() { - var cacheKey = 'action@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "ACTION") { - var result1 = "ACTION"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"ACTION\""); - } - } - if (result1 !== null) { - var result2 = parse_actionparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_actionvalue(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_actionparam() { - var cacheKey = 'actionparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_actionvalue() { - var cacheKey = 'actionvalue@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 5) === "AUDIO") { - var result5 = "AUDIO"; - pos += 5; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"AUDIO\""); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos, 7) === "DISPLAY") { - var result4 = "DISPLAY"; - pos += 7; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"DISPLAY\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 5) === "EMAIL") { - var result3 = "EMAIL"; - pos += 5; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"EMAIL\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_iana_token(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_x_name(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_trigger() { - var cacheKey = 'trigger@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 7) === "TRIGGER") { - var result1 = "TRIGGER"; - pos += 7; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"TRIGGER\""); - } - } - if (result1 !== null) { - var result5 = parse_trigrel(); - if (result5 !== null) { - var result2 = result5; - } else { - var result4 = parse_trigabs(); - if (result4 !== null) { - var result2 = result4; - } else { - var result2 = null;; - }; - } - if (result2 !== null) { - var result3 = parse_CRLF(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_trigrel() { - var cacheKey = 'trigrel@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = []; - var savedPos3 = pos; - if (input.substr(pos, 1) === ";") { - var result12 = ";"; - pos += 1; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result12 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result13 = "VALUE"; - pos += 5; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result13 !== null) { - if (input.substr(pos, 1) === "=") { - var result14 = "="; - pos += 1; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result14 !== null) { - if (input.substr(pos, 8) === "DURATION") { - var result15 = "DURATION"; - pos += 8; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\"DURATION\""); - } - } - if (result15 !== null) { - var result11 = [result12, result13, result14, result15]; - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - if (result11 !== null) { - var result4 = result11; - } else { - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_trigrelparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result4 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_other_param(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result4 = result5; - } else { - var result4 = null;; - }; - }; - } - while (result4 !== null) { - result1.push(result4); - var savedPos3 = pos; - if (input.substr(pos, 1) === ";") { - var result12 = ";"; - pos += 1; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result12 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result13 = "VALUE"; - pos += 5; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result13 !== null) { - if (input.substr(pos, 1) === "=") { - var result14 = "="; - pos += 1; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result14 !== null) { - if (input.substr(pos, 8) === "DURATION") { - var result15 = "DURATION"; - pos += 8; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\"DURATION\""); - } - } - if (result15 !== null) { - var result11 = [result12, result13, result14, result15]; - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - } else { - var result11 = null; - pos = savedPos3; - } - if (result11 !== null) { - var result4 = result11; - } else { - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - var result10 = parse_trigrelparam(); - if (result10 !== null) { - var result8 = [result9, result10]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result4 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_other_param(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result4 = result5; - } else { - var result4 = null;; - }; - }; - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - var result3 = parse_dur_value(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_trigabs() { - var cacheKey = 'trigabs@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = []; - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result12 = "DATE-TIME"; - pos += 9; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result4 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_other_param(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result4 = result5; - } else { - var result4 = null;; - }; - } - while (result4 !== null) { - result1.push(result4); - var savedPos2 = pos; - if (input.substr(pos, 1) === ";") { - var result9 = ";"; - pos += 1; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result9 !== null) { - if (input.substr(pos, 5) === "VALUE") { - var result10 = "VALUE"; - pos += 5; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"VALUE\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - if (input.substr(pos, 9) === "DATE-TIME") { - var result12 = "DATE-TIME"; - pos += 9; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("\"DATE-TIME\""); - } - } - if (result12 !== null) { - var result8 = [result9, result10, result11, result12]; - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - } else { - var result8 = null; - pos = savedPos2; - } - if (result8 !== null) { - var result4 = result8; - } else { - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result6 = ";"; - pos += 1; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result6 !== null) { - var result7 = parse_other_param(); - if (result7 !== null) { - var result5 = [result6, result7]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result4 = result5; - } else { - var result4 = null;; - }; - } - } - if (result1 !== null) { - if (input.substr(pos, 1) === ":") { - var result2 = ":"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result2 !== null) { - var result3 = parse_date_time(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_repeat() { - var cacheKey = 'repeat@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 6) === "REPEAT") { - var result1 = "REPEAT"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"REPEAT\""); - } - } - if (result1 !== null) { - var result2 = parse_repparam(); - if (result2 !== null) { - if (input.substr(pos, 1) === ":") { - var result3 = ":"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result3 !== null) { - var result4 = parse_integer(); - if (result4 !== null) { - var result5 = parse_CRLF(); - if (result5 !== null) { - var result0 = [result1, result2, result3, result4, result5]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_repparam() { - var cacheKey = 'repparam@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - while (result1 !== null) { - result0.push(result1); - var savedPos0 = pos; - if (input.substr(pos, 1) === ";") { - var result2 = ";"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result2 !== null) { - var result3 = parse_other_param(); - if (result3 !== null) { - var result1 = [result2, result3]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_date_time() { - var cacheKey = 'date_time@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_date_value(); - if (result1 !== null) { - if (input.substr(pos, 1) === "T") { - var result2 = "T"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"T\""); - } - } - if (result2 !== null) { - var result3 = parse_time(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_text() { - var cacheKey = 'text@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result0 = []; - var result5 = parse_TSAFE_CHAR(); - if (result5 !== null) { - var result1 = result5; - } else { - if (input.substr(pos, 1) === ":") { - var result4 = ":"; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_DQUOTE(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_ESCAPED_CHAR(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - } - while (result1 !== null) { - result0.push(result1); - var result5 = parse_TSAFE_CHAR(); - if (result5 !== null) { - var result1 = result5; - } else { - if (input.substr(pos, 1) === ":") { - var result4 = ":"; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\":\""); - } - } - if (result4 !== null) { - var result1 = result4; - } else { - var result3 = parse_DQUOTE(); - if (result3 !== null) { - var result1 = result3; - } else { - var result2 = parse_ESCAPED_CHAR(); - if (result2 !== null) { - var result1 = result2; - } else { - var result1 = null;; - }; - }; - }; - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_date_value() { - var cacheKey = 'date_value@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_date_fullyear(); - if (result1 !== null) { - var result2 = parse_date_month(); - if (result2 !== null) { - var result3 = parse_date_mday(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_date_fullyear() { - var cacheKey = 'date_fullyear@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result2 = parse_DIGIT(); - if (result2 !== null) { - var result3 = parse_DIGIT(); - if (result3 !== null) { - var result4 = parse_DIGIT(); - if (result4 !== null) { - var result0 = [result1, result2, result3, result4]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_date_month() { - var cacheKey = 'date_month@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result2 = parse_DIGIT(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_date_mday() { - var cacheKey = 'date_mday@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result2 = parse_DIGIT(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_integer() { - var cacheKey = 'integer@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos).match(/^["+"]/) !== null) { - var result4 = input.charAt(pos); - pos++; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("[\"+\"]"); - } - } - if (result4 !== null) { - var result1 = result4; - } else { - if (input.substr(pos, 1) === "-") { - var result3 = "-"; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"-\""); - } - } - if (result3 !== null) { - var result1 = result3; - } else { - var result1 = null;; - }; - } - if (result1 !== null) { - var result2 = parse_DIGIT(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_statvalue_jour() { - var cacheKey = 'statvalue_jour@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 5) === "DRAFT") { - var result3 = "DRAFT"; - pos += 5; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"DRAFT\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos, 5) === "FINAL") { - var result2 = "FINAL"; - pos += 5; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"FINAL\""); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - if (input.substr(pos, 9) === "CANCELLED") { - var result1 = "CANCELLED"; - pos += 9; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"CANCELLED\""); - } - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_recur() { - var cacheKey = 'recur@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_recur_rule_part(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result4 = ";"; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result4 !== null) { - var result5 = parse_recur_rule_part(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ";") { - var result4 = ";"; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result4 !== null) { - var result5 = parse_recur_rule_part(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dur_value() { - var cacheKey = 'dur_value@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos).match(/^["+"]/) !== null) { - var result8 = input.charAt(pos); - pos++; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("[\"+\"]"); - } - } - if (result8 !== null) { - var result1 = result8; - } else { - if (input.substr(pos, 1) === "-") { - var result7 = "-"; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"-\""); - } - } - if (result7 !== null) { - var result1 = result7; - } else { - var result1 = null;; - }; - } - if (result1 !== null) { - if (input.substr(pos, 1) === "P") { - var result2 = "P"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"P\""); - } - } - if (result2 !== null) { - var result6 = parse_dur_date(); - if (result6 !== null) { - var result3 = result6; - } else { - var result5 = parse_dur_time(); - if (result5 !== null) { - var result3 = result5; - } else { - var result4 = parse_dur_week(); - if (result4 !== null) { - var result3 = result4; - } else { - var result3 = null;; - }; - }; - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dur_date() { - var cacheKey = 'dur_date@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_dur_day(); - if (result1 !== null) { - if (input.substr(pos).match(/^[dur_time]/) !== null) { - var result2 = input.charAt(pos); - pos++; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("[dur_time]"); - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dur_time() { - var cacheKey = 'dur_time@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos, 1) === "T") { - var result1 = "T"; - pos += 1; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"T\""); - } - } - if (result1 !== null) { - var result5 = parse_dur_hour(); - if (result5 !== null) { - var result2 = result5; - } else { - var result4 = parse_dur_minute(); - if (result4 !== null) { - var result2 = result4; - } else { - var result3 = parse_dur_second(); - if (result3 !== null) { - var result2 = result3; - } else { - var result2 = null;; - }; - }; - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dur_week() { - var cacheKey = 'dur_week@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result3 = parse_DIGIT(); - if (result3 !== null) { - var result1 = []; - while (result3 !== null) { - result1.push(result3); - var result3 = parse_DIGIT(); - } - } else { - var result1 = null; - } - if (result1 !== null) { - if (input.substr(pos, 1) === "W") { - var result2 = "W"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"W\""); - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dur_hour() { - var cacheKey = 'dur_hour@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result4 = parse_DIGIT(); - if (result4 !== null) { - var result1 = []; - while (result4 !== null) { - result1.push(result4); - var result4 = parse_DIGIT(); - } - } else { - var result1 = null; - } - if (result1 !== null) { - if (input.substr(pos, 1) === "H") { - var result2 = "H"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"H\""); - } - } - if (result2 !== null) { - if (input.substr(pos).match(/^[dur_minute]/) !== null) { - var result3 = input.charAt(pos); - pos++; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("[dur_minute]"); - } - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dur_minute() { - var cacheKey = 'dur_minute@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result4 = parse_DIGIT(); - if (result4 !== null) { - var result1 = []; - while (result4 !== null) { - result1.push(result4); - var result4 = parse_DIGIT(); - } - } else { - var result1 = null; - } - if (result1 !== null) { - if (input.substr(pos, 1) === "M") { - var result2 = "M"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"M\""); - } - } - if (result2 !== null) { - if (input.substr(pos).match(/^[dur_second]/) !== null) { - var result3 = input.charAt(pos); - pos++; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("[dur_second]"); - } - } - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dur_second() { - var cacheKey = 'dur_second@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result3 = parse_DIGIT(); - if (result3 !== null) { - var result1 = []; - while (result3 !== null) { - result1.push(result3); - var result3 = parse_DIGIT(); - } - } else { - var result1 = null; - } - if (result1 !== null) { - if (input.substr(pos, 1) === "S") { - var result2 = "S"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"S\""); - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_dur_day() { - var cacheKey = 'dur_day@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result3 = parse_DIGIT(); - if (result3 !== null) { - var result1 = []; - while (result3 !== null) { - result1.push(result3); - var result3 = parse_DIGIT(); - } - } else { - var result1 = null; - } - if (result1 !== null) { - if (input.substr(pos, 1) === "D") { - var result2 = "D"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"D\""); - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_binary() { - var cacheKey = 'binary@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = []; - var savedPos1 = pos; - var result5 = parse_b_char(); - if (result5 !== null) { - var result6 = parse_b_char(); - if (result6 !== null) { - var result7 = parse_b_char(); - if (result7 !== null) { - var result8 = parse_b_char(); - if (result8 !== null) { - var result4 = [result5, result6, result7, result8]; - } else { - var result4 = null; - pos = savedPos1; - } - } else { - var result4 = null; - pos = savedPos1; - } - } else { - var result4 = null; - pos = savedPos1; - } - } else { - var result4 = null; - pos = savedPos1; - } - while (result4 !== null) { - result1.push(result4); - var savedPos1 = pos; - var result5 = parse_b_char(); - if (result5 !== null) { - var result6 = parse_b_char(); - if (result6 !== null) { - var result7 = parse_b_char(); - if (result7 !== null) { - var result8 = parse_b_char(); - if (result8 !== null) { - var result4 = [result5, result6, result7, result8]; - } else { - var result4 = null; - pos = savedPos1; - } - } else { - var result4 = null; - pos = savedPos1; - } - } else { - var result4 = null; - pos = savedPos1; - } - } else { - var result4 = null; - pos = savedPos1; - } - } - if (result1 !== null) { - var result3 = parse_b_end(); - var result2 = result3 !== null ? result3 : ''; - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_b_char() { - var cacheKey = 'b_char@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result4 = parse_ALPHA(); - if (result4 !== null) { - var result0 = result4; - } else { - var result3 = parse_DIGIT(); - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos, 1) === "+") { - var result2 = "+"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"+\""); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - if (input.substr(pos, 1) === "/") { - var result1 = "/"; - pos += 1; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"/\""); - } - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_b_end() { - var cacheKey = 'b_end@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos1 = pos; - var result7 = parse_b_char(); - if (result7 !== null) { - var result8 = parse_b_char(); - if (result8 !== null) { - if (input.substr(pos, 2) === "==") { - var result9 = "=="; - pos += 2; - } else { - var result9 = null; - if (reportMatchFailures) { - matchFailed("\"==\""); - } - } - if (result9 !== null) { - var result6 = [result7, result8, result9]; - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - if (result6 !== null) { - var result0 = result6; - } else { - var savedPos0 = pos; - var result2 = parse_b_char(); - if (result2 !== null) { - var result3 = parse_b_char(); - if (result3 !== null) { - var result4 = parse_b_char(); - if (result4 !== null) { - if (input.substr(pos, 1) === "=") { - var result5 = "="; - pos += 1; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result5 !== null) { - var result1 = [result2, result3, result4, result5]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_statcode() { - var cacheKey = 'statcode@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result11 = parse_DIGIT(); - if (result11 !== null) { - var result1 = []; - while (result11 !== null) { - result1.push(result11); - var result11 = parse_DIGIT(); - } - } else { - var result1 = null; - } - if (result1 !== null) { - var savedPos2 = pos; - if (input.substr(pos, 1) === ".") { - var result8 = "."; - pos += 1; - } else { - var result8 = null; - if (reportMatchFailures) { - matchFailed("\".\""); - } - } - if (result8 !== null) { - var result10 = parse_DIGIT(); - if (result10 !== null) { - var result9 = []; - while (result10 !== null) { - result9.push(result10); - var result10 = parse_DIGIT(); - } - } else { - var result9 = null; - } - if (result9 !== null) { - var result2 = [result8, result9]; - } else { - var result2 = null; - pos = savedPos2; - } - } else { - var result2 = null; - pos = savedPos2; - } - if (result2 !== null) { - var savedPos1 = pos; - if (input.substr(pos, 1) === ".") { - var result5 = "."; - pos += 1; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\".\""); - } - } - if (result5 !== null) { - var result7 = parse_DIGIT(); - if (result7 !== null) { - var result6 = []; - while (result7 !== null) { - result6.push(result7); - var result7 = parse_DIGIT(); - } - } else { - var result6 = null; - } - if (result6 !== null) { - var result4 = [result5, result6]; - } else { - var result4 = null; - pos = savedPos1; - } - } else { - var result4 = null; - pos = savedPos1; - } - var result3 = result4 !== null ? result4 : ''; - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_period() { - var cacheKey = 'period@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_period_explicit(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_period_start(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_period_explicit() { - var cacheKey = 'period_explicit@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_date_time(); - if (result1 !== null) { - if (input.substr(pos, 1) === "/") { - var result2 = "/"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"/\""); - } - } - if (result2 !== null) { - var result3 = parse_date_time(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_period_start() { - var cacheKey = 'period_start@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_date_time(); - if (result1 !== null) { - if (input.substr(pos, 1) === "/") { - var result2 = "/"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"/\""); - } - } - if (result2 !== null) { - var result3 = parse_dur_value(); - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_time() { - var cacheKey = 'time@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_time_hour(); - if (result1 !== null) { - var result2 = parse_time_minute(); - if (result2 !== null) { - var result3 = parse_time_second(); - if (result3 !== null) { - var result5 = parse_time_utc(); - var result4 = result5 !== null ? result5 : ''; - if (result4 !== null) { - var result0 = [result1, result2, result3, result4]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_time_hour() { - var cacheKey = 'time_hour@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result2 = parse_DIGIT(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_time_minute() { - var cacheKey = 'time_minute@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result2 = parse_DIGIT(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_time_second() { - var cacheKey = 'time_second@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result2 = parse_DIGIT(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_time_utc() { - var cacheKey = 'time_utc@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 1) === "Z") { - var result0 = "Z"; - pos += 1; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"Z\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_TSAFE_CHAR() { - var cacheKey = 'TSAFE_CHAR@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result7 = parse_WSP(); - if (result7 !== null) { - var result0 = result7; - } else { - if (input.substr(pos).match(/^[!]/) !== null) { - var result6 = input.charAt(pos); - pos++; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("[!]"); - } - } - if (result6 !== null) { - var result0 = result6; - } else { - if (input.substr(pos).match(/^[#-+]/) !== null) { - var result5 = input.charAt(pos); - pos++; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("[#-+]"); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos).match(/^[\--9]/) !== null) { - var result4 = input.charAt(pos); - pos++; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("[\\--9]"); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos).match(/^[<-[]/) !== null) { - var result3 = input.charAt(pos); - pos++; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("[<-[]"); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos).match(/^[\]-~]/) !== null) { - var result2 = input.charAt(pos); - pos++; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("[\\]-~]"); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_NON_US_ASCII(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_ESCAPED_CHAR() { - var cacheKey = 'ESCAPED_CHAR@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 1) === "\\") { - var result5 = "\\"; - pos += 1; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"\\\\\""); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos, 1) === ";") { - var result4 = ";"; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\";\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 1) === ",") { - var result3 = ","; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos, 1) === "N") { - var result2 = "N"; - pos += 1; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"N\""); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - if (input.substr(pos, 1) === "\n") { - var result1 = "\n"; - pos += 1; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"\\n\""); - } - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_recur_rule_part() { - var cacheKey = 'recur_rule_part@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos13 = pos; - if (input.substr(pos, 4) === "FREQ") { - var result56 = "FREQ"; - pos += 4; - } else { - var result56 = null; - if (reportMatchFailures) { - matchFailed("\"FREQ\""); - } - } - if (result56 !== null) { - if (input.substr(pos, 1) === "=") { - var result57 = "="; - pos += 1; - } else { - var result57 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result57 !== null) { - var result58 = parse_freq(); - if (result58 !== null) { - var result55 = [result56, result57, result58]; - } else { - var result55 = null; - pos = savedPos13; - } - } else { - var result55 = null; - pos = savedPos13; - } - } else { - var result55 = null; - pos = savedPos13; - } - if (result55 !== null) { - var result0 = result55; - } else { - var savedPos12 = pos; - if (input.substr(pos, 5) === "UNTIL") { - var result52 = "UNTIL"; - pos += 5; - } else { - var result52 = null; - if (reportMatchFailures) { - matchFailed("\"UNTIL\""); - } - } - if (result52 !== null) { - if (input.substr(pos, 1) === "=") { - var result53 = "="; - pos += 1; - } else { - var result53 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result53 !== null) { - var result54 = parse_enddate(); - if (result54 !== null) { - var result51 = [result52, result53, result54]; - } else { - var result51 = null; - pos = savedPos12; - } - } else { - var result51 = null; - pos = savedPos12; - } - } else { - var result51 = null; - pos = savedPos12; - } - if (result51 !== null) { - var result0 = result51; - } else { - var savedPos11 = pos; - if (input.substr(pos, 5) === "COUNT") { - var result47 = "COUNT"; - pos += 5; - } else { - var result47 = null; - if (reportMatchFailures) { - matchFailed("\"COUNT\""); - } - } - if (result47 !== null) { - if (input.substr(pos, 1) === "=") { - var result48 = "="; - pos += 1; - } else { - var result48 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result48 !== null) { - var result50 = parse_DIGIT(); - if (result50 !== null) { - var result49 = []; - while (result50 !== null) { - result49.push(result50); - var result50 = parse_DIGIT(); - } - } else { - var result49 = null; - } - if (result49 !== null) { - var result46 = [result47, result48, result49]; - } else { - var result46 = null; - pos = savedPos11; - } - } else { - var result46 = null; - pos = savedPos11; - } - } else { - var result46 = null; - pos = savedPos11; - } - if (result46 !== null) { - var result0 = result46; - } else { - var savedPos10 = pos; - if (input.substr(pos, 8) === "INTERVAL") { - var result42 = "INTERVAL"; - pos += 8; - } else { - var result42 = null; - if (reportMatchFailures) { - matchFailed("\"INTERVAL\""); - } - } - if (result42 !== null) { - if (input.substr(pos, 1) === "=") { - var result43 = "="; - pos += 1; - } else { - var result43 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result43 !== null) { - var result45 = parse_DIGIT(); - if (result45 !== null) { - var result44 = []; - while (result45 !== null) { - result44.push(result45); - var result45 = parse_DIGIT(); - } - } else { - var result44 = null; - } - if (result44 !== null) { - var result41 = [result42, result43, result44]; - } else { - var result41 = null; - pos = savedPos10; - } - } else { - var result41 = null; - pos = savedPos10; - } - } else { - var result41 = null; - pos = savedPos10; - } - if (result41 !== null) { - var result0 = result41; - } else { - var savedPos9 = pos; - if (input.substr(pos, 8) === "BYSECOND") { - var result38 = "BYSECOND"; - pos += 8; - } else { - var result38 = null; - if (reportMatchFailures) { - matchFailed("\"BYSECOND\""); - } - } - if (result38 !== null) { - if (input.substr(pos, 1) === "=") { - var result39 = "="; - pos += 1; - } else { - var result39 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result39 !== null) { - var result40 = parse_byseclist(); - if (result40 !== null) { - var result37 = [result38, result39, result40]; - } else { - var result37 = null; - pos = savedPos9; - } - } else { - var result37 = null; - pos = savedPos9; - } - } else { - var result37 = null; - pos = savedPos9; - } - if (result37 !== null) { - var result0 = result37; - } else { - var savedPos8 = pos; - if (input.substr(pos, 8) === "BYMINUTE") { - var result34 = "BYMINUTE"; - pos += 8; - } else { - var result34 = null; - if (reportMatchFailures) { - matchFailed("\"BYMINUTE\""); - } - } - if (result34 !== null) { - if (input.substr(pos, 1) === "=") { - var result35 = "="; - pos += 1; - } else { - var result35 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result35 !== null) { - var result36 = parse_byminlist(); - if (result36 !== null) { - var result33 = [result34, result35, result36]; - } else { - var result33 = null; - pos = savedPos8; - } - } else { - var result33 = null; - pos = savedPos8; - } - } else { - var result33 = null; - pos = savedPos8; - } - if (result33 !== null) { - var result0 = result33; - } else { - var savedPos7 = pos; - if (input.substr(pos, 6) === "BYHOUR") { - var result30 = "BYHOUR"; - pos += 6; - } else { - var result30 = null; - if (reportMatchFailures) { - matchFailed("\"BYHOUR\""); - } - } - if (result30 !== null) { - if (input.substr(pos, 1) === "=") { - var result31 = "="; - pos += 1; - } else { - var result31 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result31 !== null) { - var result32 = parse_byhrlist(); - if (result32 !== null) { - var result29 = [result30, result31, result32]; - } else { - var result29 = null; - pos = savedPos7; - } - } else { - var result29 = null; - pos = savedPos7; - } - } else { - var result29 = null; - pos = savedPos7; - } - if (result29 !== null) { - var result0 = result29; - } else { - var savedPos6 = pos; - if (input.substr(pos, 5) === "BYDAY") { - var result26 = "BYDAY"; - pos += 5; - } else { - var result26 = null; - if (reportMatchFailures) { - matchFailed("\"BYDAY\""); - } - } - if (result26 !== null) { - if (input.substr(pos, 1) === "=") { - var result27 = "="; - pos += 1; - } else { - var result27 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result27 !== null) { - var result28 = parse_bywdaylist(); - if (result28 !== null) { - var result25 = [result26, result27, result28]; - } else { - var result25 = null; - pos = savedPos6; - } - } else { - var result25 = null; - pos = savedPos6; - } - } else { - var result25 = null; - pos = savedPos6; - } - if (result25 !== null) { - var result0 = result25; - } else { - var savedPos5 = pos; - if (input.substr(pos, 10) === "BYMONTHDAY") { - var result22 = "BYMONTHDAY"; - pos += 10; - } else { - var result22 = null; - if (reportMatchFailures) { - matchFailed("\"BYMONTHDAY\""); - } - } - if (result22 !== null) { - if (input.substr(pos, 1) === "=") { - var result23 = "="; - pos += 1; - } else { - var result23 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result23 !== null) { - var result24 = parse_bymodaylist(); - if (result24 !== null) { - var result21 = [result22, result23, result24]; - } else { - var result21 = null; - pos = savedPos5; - } - } else { - var result21 = null; - pos = savedPos5; - } - } else { - var result21 = null; - pos = savedPos5; - } - if (result21 !== null) { - var result0 = result21; - } else { - var savedPos4 = pos; - if (input.substr(pos, 9) === "BYYEARDAY") { - var result18 = "BYYEARDAY"; - pos += 9; - } else { - var result18 = null; - if (reportMatchFailures) { - matchFailed("\"BYYEARDAY\""); - } - } - if (result18 !== null) { - if (input.substr(pos, 1) === "=") { - var result19 = "="; - pos += 1; - } else { - var result19 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result19 !== null) { - var result20 = parse_byyrdaylist(); - if (result20 !== null) { - var result17 = [result18, result19, result20]; - } else { - var result17 = null; - pos = savedPos4; - } - } else { - var result17 = null; - pos = savedPos4; - } - } else { - var result17 = null; - pos = savedPos4; - } - if (result17 !== null) { - var result0 = result17; - } else { - var savedPos3 = pos; - if (input.substr(pos, 8) === "BYWEEKNO") { - var result14 = "BYWEEKNO"; - pos += 8; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("\"BYWEEKNO\""); - } - } - if (result14 !== null) { - if (input.substr(pos, 1) === "=") { - var result15 = "="; - pos += 1; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result15 !== null) { - var result16 = parse_bywknolist(); - if (result16 !== null) { - var result13 = [result14, result15, result16]; - } else { - var result13 = null; - pos = savedPos3; - } - } else { - var result13 = null; - pos = savedPos3; - } - } else { - var result13 = null; - pos = savedPos3; - } - if (result13 !== null) { - var result0 = result13; - } else { - var savedPos2 = pos; - if (input.substr(pos, 7) === "BYMONTH") { - var result10 = "BYMONTH"; - pos += 7; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("\"BYMONTH\""); - } - } - if (result10 !== null) { - if (input.substr(pos, 1) === "=") { - var result11 = "="; - pos += 1; - } else { - var result11 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result11 !== null) { - var result12 = parse_bymolist(); - if (result12 !== null) { - var result9 = [result10, result11, result12]; - } else { - var result9 = null; - pos = savedPos2; - } - } else { - var result9 = null; - pos = savedPos2; - } - } else { - var result9 = null; - pos = savedPos2; - } - if (result9 !== null) { - var result0 = result9; - } else { - var savedPos1 = pos; - if (input.substr(pos, 8) === "BYSETPOS") { - var result6 = "BYSETPOS"; - pos += 8; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"BYSETPOS\""); - } - } - if (result6 !== null) { - if (input.substr(pos, 1) === "=") { - var result7 = "="; - pos += 1; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result7 !== null) { - var result8 = parse_bysplist(); - if (result8 !== null) { - var result5 = [result6, result7, result8]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result0 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos, 4) === "WKST") { - var result2 = "WKST"; - pos += 4; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"WKST\""); - } - } - if (result2 !== null) { - if (input.substr(pos, 1) === "=") { - var result3 = "="; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"=\""); - } - } - if (result3 !== null) { - var result4 = parse_weekday(); - if (result4 !== null) { - var result1 = [result2, result3, result4]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_freq() { - var cacheKey = 'freq@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 8) === "SECONDLY") { - var result7 = "SECONDLY"; - pos += 8; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"SECONDLY\""); - } - } - if (result7 !== null) { - var result0 = result7; - } else { - if (input.substr(pos, 8) === "MINUTELY") { - var result6 = "MINUTELY"; - pos += 8; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"MINUTELY\""); - } - } - if (result6 !== null) { - var result0 = result6; - } else { - if (input.substr(pos, 6) === "HOURLY") { - var result5 = "HOURLY"; - pos += 6; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"HOURLY\""); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos, 5) === "DAILY") { - var result4 = "DAILY"; - pos += 5; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"DAILY\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 6) === "WEEKLY") { - var result3 = "WEEKLY"; - pos += 6; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"WEEKLY\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos, 7) === "MONTHLY") { - var result2 = "MONTHLY"; - pos += 7; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"MONTHLY\""); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - if (input.substr(pos, 6) === "YEARLY") { - var result1 = "YEARLY"; - pos += 6; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"YEARLY\""); - } - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_enddate() { - var cacheKey = 'enddate@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_date_value(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_date_time(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_byseclist() { - var cacheKey = 'byseclist@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_seconds(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_seconds(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_seconds(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_seconds() { - var cacheKey = 'seconds@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result3 = parse_DIGIT(); - var result2 = result3 !== null ? result3 : ''; - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_byminlist() { - var cacheKey = 'byminlist@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_minutes(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_minutes(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_minutes(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_minutes() { - var cacheKey = 'minutes@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result3 = parse_DIGIT(); - var result2 = result3 !== null ? result3 : ''; - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_byhrlist() { - var cacheKey = 'byhrlist@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_hour(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_hour(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_hour(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_hour() { - var cacheKey = 'hour@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result3 = parse_DIGIT(); - var result2 = result3 !== null ? result3 : ''; - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_bywdaylist() { - var cacheKey = 'bywdaylist@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_weekdaynum(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_weekdaynum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_weekdaynum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_weekdaynum() { - var cacheKey = 'weekdaynum@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var savedPos1 = pos; - var result8 = parse_plus(); - if (result8 !== null) { - var result6 = result8; - } else { - var result7 = parse_minus(); - if (result7 !== null) { - var result6 = result7; - } else { - var result6 = null;; - }; - } - var result4 = result6 !== null ? result6 : ''; - if (result4 !== null) { - var result5 = parse_ordwk(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - var result1 = result3 !== null ? result3 : ''; - if (result1 !== null) { - var result2 = parse_weekday(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_plus() { - var cacheKey = 'plus@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 1) === "+") { - var result0 = "+"; - pos += 1; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"+\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_minus() { - var cacheKey = 'minus@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 1) === "-") { - var result0 = "-"; - pos += 1; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"-\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_ordwk() { - var cacheKey = 'ordwk@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result3 = parse_DIGIT(); - var result2 = result3 !== null ? result3 : ''; - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_weekday() { - var cacheKey = 'weekday@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 2) === "SU") { - var result7 = "SU"; - pos += 2; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("\"SU\""); - } - } - if (result7 !== null) { - var result0 = result7; - } else { - if (input.substr(pos, 2) === "MO") { - var result6 = "MO"; - pos += 2; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("\"MO\""); - } - } - if (result6 !== null) { - var result0 = result6; - } else { - if (input.substr(pos, 2) === "TU") { - var result5 = "TU"; - pos += 2; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("\"TU\""); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos, 2) === "WE") { - var result4 = "WE"; - pos += 2; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\"WE\""); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos, 2) === "TH") { - var result3 = "TH"; - pos += 2; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\"TH\""); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos, 2) === "FR") { - var result2 = "FR"; - pos += 2; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("\"FR\""); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - if (input.substr(pos, 2) === "SA") { - var result1 = "SA"; - pos += 2; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("\"SA\""); - } - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_bymodaylist() { - var cacheKey = 'bymodaylist@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = []; - var result5 = parse_monthdaynum(); - while (result5 !== null) { - result1.push(result5); - var result5 = parse_monthdaynum(); - } - if (result1 !== null) { - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result3 = ","; - pos += 1; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result3 !== null) { - var result4 = parse_monthdaynum(); - if (result4 !== null) { - var result2 = [result3, result4]; - } else { - var result2 = null; - pos = savedPos1; - } - } else { - var result2 = null; - pos = savedPos1; - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_monthdaynum() { - var cacheKey = 'monthdaynum@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos).match(/^[plus \/ minus]/) !== null) { - var result1 = input.charAt(pos); - pos++; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("[plus \\/ minus]"); - } - } - if (result1 !== null) { - var result2 = parse_ordmoday(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_ordmoday() { - var cacheKey = 'ordmoday@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result3 = parse_DIGIT(); - var result2 = result3 !== null ? result3 : ''; - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_byyrdaylist() { - var cacheKey = 'byyrdaylist@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_yeardaynum(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_yeardaynum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_yeardaynum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_yeardaynum() { - var cacheKey = 'yeardaynum@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos).match(/^[plus \/ minus]/) !== null) { - var result1 = input.charAt(pos); - pos++; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("[plus \\/ minus]"); - } - } - if (result1 !== null) { - var result2 = parse_ordyrday(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_ordyrday() { - var cacheKey = 'ordyrday@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result5 = parse_DIGIT(); - var result2 = result5 !== null ? result5 : ''; - if (result2 !== null) { - var result4 = parse_DIGIT(); - var result3 = result4 !== null ? result4 : ''; - if (result3 !== null) { - var result0 = [result1, result2, result3]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_bywknolist() { - var cacheKey = 'bywknolist@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_weeknum(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_weeknum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_weeknum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_weeknum() { - var cacheKey = 'weeknum@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos).match(/^[plus \/ minus]/) !== null) { - var result1 = input.charAt(pos); - pos++; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("[plus \\/ minus]"); - } - } - if (result1 !== null) { - var result2 = parse_ordwk(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_bymolist() { - var cacheKey = 'bymolist@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_monthnum(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_monthnum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_monthnum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_monthnum() { - var cacheKey = 'monthnum@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_DIGIT(); - if (result1 !== null) { - var result3 = parse_DIGIT(); - var result2 = result3 !== null ? result3 : ''; - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_bysplist() { - var cacheKey = 'bysplist@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - var result1 = parse_yeardaynum(); - if (result1 !== null) { - var result2 = []; - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_yeardaynum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - while (result3 !== null) { - result2.push(result3); - var savedPos1 = pos; - if (input.substr(pos, 1) === ",") { - var result4 = ","; - pos += 1; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("\",\""); - } - } - if (result4 !== null) { - var result5 = parse_yeardaynum(); - if (result5 !== null) { - var result3 = [result4, result5]; - } else { - var result3 = null; - pos = savedPos1; - } - } else { - var result3 = null; - pos = savedPos1; - } - } - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_DQUOTE() { - var cacheKey = 'DQUOTE@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos).match(/^["]/) !== null) { - var result0 = input.charAt(pos); - pos++; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("[\"]"); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_QSAFE_CHAR() { - var cacheKey = 'QSAFE_CHAR@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result4 = parse_WSP(); - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos).match(/^[!]/) !== null) { - var result3 = input.charAt(pos); - pos++; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("[!]"); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos).match(/^[#-~]/) !== null) { - var result2 = input.charAt(pos); - pos++; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("[#-~]"); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_NON_US_ASCII(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_SAFE_CHAR() { - var cacheKey = 'SAFE_CHAR@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result6 = parse_WSP(); - if (result6 !== null) { - var result0 = result6; - } else { - if (input.substr(pos).match(/^[!]/) !== null) { - var result5 = input.charAt(pos); - pos++; - } else { - var result5 = null; - if (reportMatchFailures) { - matchFailed("[!]"); - } - } - if (result5 !== null) { - var result0 = result5; - } else { - if (input.substr(pos).match(/^[#-+]/) !== null) { - var result4 = input.charAt(pos); - pos++; - } else { - var result4 = null; - if (reportMatchFailures) { - matchFailed("[#-+]"); - } - } - if (result4 !== null) { - var result0 = result4; - } else { - if (input.substr(pos).match(/^[\--9]/) !== null) { - var result3 = input.charAt(pos); - pos++; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("[\\--9]"); - } - } - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos).match(/^[<-~]/) !== null) { - var result2 = input.charAt(pos); - pos++; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("[<-~]"); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_NON_US_ASCII(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_NON_US_ASCII() { - var cacheKey = 'NON_US_ASCII@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result3 = parse_UTF8_2(); - if (result3 !== null) { - var result0 = result3; - } else { - var result2 = parse_UTF8_3(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_UTF8_4(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_UTF8_2() { - var cacheKey = 'UTF8_2@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos0 = pos; - if (input.substr(pos).match(/^[\xC2-\xDF]/) !== null) { - var result1 = input.charAt(pos); - pos++; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("[\\xC2-\\xDF]"); - } - } - if (result1 !== null) { - var result2 = parse_UTF8_tail(); - if (result2 !== null) { - var result0 = [result1, result2]; - } else { - var result0 = null; - pos = savedPos0; - } - } else { - var result0 = null; - pos = savedPos0; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_UTF8_3() { - var cacheKey = 'UTF8_3@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos3 = pos; - if (input.substr(pos).match(/^[\xE0]/) !== null) { - var result14 = input.charAt(pos); - pos++; - } else { - var result14 = null; - if (reportMatchFailures) { - matchFailed("[\\xE0]"); - } - } - if (result14 !== null) { - if (input.substr(pos).match(/^[\xA0-\xBF]/) !== null) { - var result15 = input.charAt(pos); - pos++; - } else { - var result15 = null; - if (reportMatchFailures) { - matchFailed("[\\xA0-\\xBF]"); - } - } - if (result15 !== null) { - var result16 = parse_UTF8_tail(); - if (result16 !== null) { - var result13 = [result14, result15, result16]; - } else { - var result13 = null; - pos = savedPos3; - } - } else { - var result13 = null; - pos = savedPos3; - } - } else { - var result13 = null; - pos = savedPos3; - } - if (result13 !== null) { - var result0 = result13; - } else { - var savedPos2 = pos; - if (input.substr(pos).match(/^[\xE1-\xEC]/) !== null) { - var result10 = input.charAt(pos); - pos++; - } else { - var result10 = null; - if (reportMatchFailures) { - matchFailed("[\\xE1-\\xEC]"); - } - } - if (result10 !== null) { - var result11 = parse_UTF8_tail(); - if (result11 !== null) { - var result12 = parse_UTF8_tail(); - if (result12 !== null) { - var result9 = [result10, result11, result12]; - } else { - var result9 = null; - pos = savedPos2; - } - } else { - var result9 = null; - pos = savedPos2; - } - } else { - var result9 = null; - pos = savedPos2; - } - if (result9 !== null) { - var result0 = result9; - } else { - var savedPos1 = pos; - if (input.substr(pos).match(/^[\xED]/) !== null) { - var result6 = input.charAt(pos); - pos++; - } else { - var result6 = null; - if (reportMatchFailures) { - matchFailed("[\\xED]"); - } - } - if (result6 !== null) { - if (input.substr(pos).match(/^[\x80-\x9F]/) !== null) { - var result7 = input.charAt(pos); - pos++; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("[\\x80-\\x9F]"); - } - } - if (result7 !== null) { - var result8 = parse_UTF8_tail(); - if (result8 !== null) { - var result5 = [result6, result7, result8]; - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - } else { - var result5 = null; - pos = savedPos1; - } - if (result5 !== null) { - var result0 = result5; - } else { - var savedPos0 = pos; - if (input.substr(pos).match(/^[\xEE-\xEF]/) !== null) { - var result2 = input.charAt(pos); - pos++; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("[\\xEE-\\xEF]"); - } - } - if (result2 !== null) { - var result3 = parse_UTF8_tail(); - if (result3 !== null) { - var result4 = parse_UTF8_tail(); - if (result4 !== null) { - var result1 = [result2, result3, result4]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_UTF8_4() { - var cacheKey = 'UTF8_4@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var savedPos2 = pos; - if (input.substr(pos).match(/^[\xF0]/) !== null) { - var result12 = input.charAt(pos); - pos++; - } else { - var result12 = null; - if (reportMatchFailures) { - matchFailed("[\\xF0]"); - } - } - if (result12 !== null) { - if (input.substr(pos).match(/^[\x90-\xBF]/) !== null) { - var result13 = input.charAt(pos); - pos++; - } else { - var result13 = null; - if (reportMatchFailures) { - matchFailed("[\\x90-\\xBF]"); - } - } - if (result13 !== null) { - var result14 = parse_UTF8_tail(); - if (result14 !== null) { - var result15 = parse_UTF8_tail(); - if (result15 !== null) { - var result11 = [result12, result13, result14, result15]; - } else { - var result11 = null; - pos = savedPos2; - } - } else { - var result11 = null; - pos = savedPos2; - } - } else { - var result11 = null; - pos = savedPos2; - } - } else { - var result11 = null; - pos = savedPos2; - } - if (result11 !== null) { - var result0 = result11; - } else { - var savedPos1 = pos; - if (input.substr(pos).match(/^[\xF1-\xF3]/) !== null) { - var result7 = input.charAt(pos); - pos++; - } else { - var result7 = null; - if (reportMatchFailures) { - matchFailed("[\\xF1-\\xF3]"); - } - } - if (result7 !== null) { - var result8 = parse_UTF8_tail(); - if (result8 !== null) { - var result9 = parse_UTF8_tail(); - if (result9 !== null) { - var result10 = parse_UTF8_tail(); - if (result10 !== null) { - var result6 = [result7, result8, result9, result10]; - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - } else { - var result6 = null; - pos = savedPos1; - } - if (result6 !== null) { - var result0 = result6; - } else { - var savedPos0 = pos; - if (input.substr(pos).match(/^[\xF4]/) !== null) { - var result2 = input.charAt(pos); - pos++; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("[\\xF4]"); - } - } - if (result2 !== null) { - if (input.substr(pos).match(/^[\x80-\x8F]/) !== null) { - var result3 = input.charAt(pos); - pos++; - } else { - var result3 = null; - if (reportMatchFailures) { - matchFailed("[\\x80-\\x8F]"); - } - } - if (result3 !== null) { - var result4 = parse_UTF8_tail(); - if (result4 !== null) { - var result5 = parse_UTF8_tail(); - if (result5 !== null) { - var result1 = [result2, result3, result4, result5]; - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - } else { - var result1 = null; - pos = savedPos0; - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_UTF8_tail() { - var cacheKey = 'UTF8_tail@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos).match(/^[\x80-\xBF]/) !== null) { - var result0 = input.charAt(pos); - pos++; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("[\\x80-\\xBF]"); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_VALUE_CHAR() { - var cacheKey = 'VALUE_CHAR@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result3 = parse_WSP(); - if (result3 !== null) { - var result0 = result3; - } else { - if (input.substr(pos).match(/^[!-~]/) !== null) { - var result2 = input.charAt(pos); - pos++; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("[!-~]"); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_NON_US_ASCII(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_WSP() { - var cacheKey = 'WSP@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - var result2 = parse_SP(); - if (result2 !== null) { - var result0 = result2; - } else { - var result1 = parse_HTAB(); - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_HTAB() { - var cacheKey = 'HTAB@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos).match(/^[ ]/) !== null) { - var result0 = input.charAt(pos); - pos++; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("[ ]"); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_SP() { - var cacheKey = 'SP@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos).match(/^[ ]/) !== null) { - var result0 = input.charAt(pos); - pos++; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("[ ]"); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_CRLF() { - var cacheKey = 'CRLF@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos, 2) === "\r\n") { - var result0 = "\r\n"; - pos += 2; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("\"\\r\\n\""); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_ALPHA() { - var cacheKey = 'ALPHA@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos).match(/^[a-z]/) !== null) { - var result2 = input.charAt(pos); - pos++; - } else { - var result2 = null; - if (reportMatchFailures) { - matchFailed("[a-z]"); - } - } - if (result2 !== null) { - var result0 = result2; - } else { - if (input.substr(pos).match(/^[A-Z]/) !== null) { - var result1 = input.charAt(pos); - pos++; - } else { - var result1 = null; - if (reportMatchFailures) { - matchFailed("[A-Z]"); - } - } - if (result1 !== null) { - var result0 = result1; - } else { - var result0 = null;; - }; - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function parse_DIGIT() { - var cacheKey = 'DIGIT@' + pos; - var cachedResult = cache[cacheKey]; - if (cachedResult) { - pos = cachedResult.nextPos; - return cachedResult.result; - } - - - if (input.substr(pos).match(/^[0-9]/) !== null) { - var result0 = input.charAt(pos); - pos++; - } else { - var result0 = null; - if (reportMatchFailures) { - matchFailed("[0-9]"); - } - } - - - - cache[cacheKey] = { - nextPos: pos, - result: result0 - }; - return result0; - } - - function buildErrorMessage() { - function buildExpected(failuresExpected) { - failuresExpected.sort(); - - var lastFailure = null; - var failuresExpectedUnique = []; - for (var i = 0; i < failuresExpected.length; i++) { - if (failuresExpected[i] !== lastFailure) { - failuresExpectedUnique.push(failuresExpected[i]); - lastFailure = failuresExpected[i]; - } - } - - switch (failuresExpectedUnique.length) { - case 0: - return 'end of input'; - case 1: - return failuresExpectedUnique[0]; - default: - return failuresExpectedUnique.slice(0, failuresExpectedUnique.length - 1).join(', ') - + ' or ' - + failuresExpectedUnique[failuresExpectedUnique.length - 1]; - } - } - - var expected = buildExpected(rightmostMatchFailuresExpected); - var actualPos = Math.max(pos, rightmostMatchFailuresPos); - var actual = actualPos < input.length - ? quote(input.charAt(actualPos)) - : 'end of input'; - - return 'Expected ' + expected + ' but ' + actual + ' found.'; - } - - 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 < rightmostMatchFailuresPos; 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 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| - * - |rightmostMatchFailuresExpected| may or may not contain something - * - * 2. The parser successfully parsed only a part of the input. - * - * - |result !== null| - * - |pos < input.length| - * - |rightmostMatchFailuresExpected| may or may not contain something - * - * 3. The parser did not successfully parse any part of the input. - * - * - |result === null| - * - |pos === 0| - * - |rightmostMatchFailuresExpected| contains at least one failure - * - * All code following this comment (including called functions) must - * handle these states. - */ - if (result === null || pos !== input.length) { - var errorPosition = computeErrorPosition(); - throw new this.SyntaxError( - buildErrorMessage(), - errorPosition.line, - errorPosition.column - ); - } - - return result; - }, - - /* Returns the parser source code. */ - toSource: function() { return this._source; } - }; - - /* Thrown when a parser encounters a syntax error. */ - - result.SyntaxError = function(message, line, column) { - this.name = 'SyntaxError'; - this.message = message; - this.line = line; - this.column = column; - }; - - result.SyntaxError.prototype = Error.prototype; - - return result; -})(); diff --git a/lib/parser/ical.pegjs b/lib/parser/ical.pegjs deleted file mode 100644 index c127271..0000000 --- a/lib/parser/ical.pegjs +++ /dev/null @@ -1,696 +0,0 @@ -start - = icalstream - -icalstream - = icalobject+ - -icalobject - = "BEGIN" ":" "VCALENDAR" CRLF - icalbody - "END" ":" "VCALENDAR" CRLF - -icalbody = calprops component - -calprops - = prodid - / version - / calscale - / method - / x_prop - / iana_prop - -component = (eventc / todoc / journalc / freebusyc / timezonec / iana_comp / x_comp)+ -iana_comp = "BEGIN" ":" iana_token CRLF contentline+ - "END" ":" iana_token CRLF -x_comp = "BEGIN" ":" x_name CRLF - contentline+ - "END" ":" x_name CRLF -todoc = "BEGIN" ":" "VTODO" CRLF todoprop alarmc* "END" ":" "VTODO" CRLF - -todoprop = ( -dtstamp / uid / -class / completed / created / description / -dtstart / geo / last_mod / location / organizer / -percent / priority / recurid / seq / status / -summary / url / -rrule / -due / duration / -attach / attendee / categories / comment / contact / -exdate / rstatus / related / resources / -rdate / x_prop / iana_prop -)* - -journalc = "BEGIN" ":" "VJOURNAL" CRLF jourprop "END" ":" "VJOURNAL" CRLF -jourprop = ( -dtstamp / uid / -class / created / dtstart / -last_mod / organizer / recurid / seq / -status / summary / url / -rrule / -attach / attendee / categories / comment / -contact / description / exdate / related / rdate / -rstatus / x_prop / iana_prop -)* -freebusyc = "BEGIN" ":" "VFREEBUSY" CRLF fbprop "END" ":" "VFREEBUSY" CRLF -fbprop = ( dtstamp / uid / -contact / dtstart / dtend / -organizer / url / -attendee / comment / freebusy / rstatus / x_prop / -iana_prop -)* - -timezonec - = "BEGIN" ":" "VTIMEZONE" CRLF - ( tzid / last_mod / tzurl / standardc / daylightc / x_prop / iana_prop ) - "END" ":" "VTIMEZONE" CRLF -percent = "PERCENT-COMPLETE" pctparam ":" integer CRLF -pctparam = (";" other_param)* -due = "DUE" dueparam ":" dueval CRLF -dueparam = ( -(";" "VALUE" "=" ("DATE-TIME" / "DATE")) / -(";" tzidparam) / -(";" other_param) -)* -freebusy = "FREEBUSY" fbparam ":" fbvalue CRLF -fbparam = ( -(";" fbtypeparam) / -(";" other_param) -)* -tzoffsetfrom = "TZOFFSETFROM" frmparam ":" utc_offset CRLF -frmparam = (";" other_param)* -tzname = "TZNAME" tznparam ":" text CRLF -tznparam = ( (";" languageparam) / (";" other_param) )* -name = iana_token / x_name -x_name = "X-" [vendorid "-"] (ALPHA / DIGIT / "-")+ -vendorid = (ALPHA / DIGIT) (ALPHA / DIGIT) (ALPHA / DIGIT)+ -param = param_name "=" param_value *("," param_value) -param_name = iana_token / x_name -param_value = paramtext / quoted_string -paramtext = SAFE_CHAR* - -fbvalue = period ("," period)* -tzid = "TZID" tzidpropparam ":" [tzidprefix] text CRLF -tzidpropparam = (";" other_param)* -tzurl = "TZURL" tzurlparam ":" uri CRLF -tzurlparam = (";" other_param)* -tzoffsetto = "TZOFFSETTO" toparam ":" utc_offset CRLF -utc_offset = time_numzone -time_numzone = ("+" / "-") time_hour time_minute time_second? -toparam = (";" other_param)* -dueval = date_time / date -standardc = "BEGIN" ":" "STANDARD" CRLF tzprop "END" ":" "STANDARD" CRLF -daylightc = "BEGIN" ":" "DAYLIGHT" CRLF tzprop "END" ":" "DAYLIGHT" CRLF -tzprop = ( dtstart / tzoffsetto / tzoffsetfrom / rrule / comment / rdate / tzname / x_prop / iana_prop )* -contentline = name (";" param )* ":" value CRLF -completed = "COMPLETED" compparam ":" date_time CRLF -compparam = (";" other_param)* -prodid = "PRODID" pidparam ":" pidvalue CRLF -pidvalue = text -pidparam = (";" other_param)* -other_param = iana_param / x_param -iana_param = iana_token "=" param_value ("," param_value)* -x_param = x_name "=" param_value ("," param_value)* -x_name = "X-" [vendorid "-"] (ALPHA / DIGIT / "-")? -iana_token = (ALPHA / DIGIT / "-")? -param_value = paramtext / quoted_string -paramtext = SAFE_CHAR* -version = "VERSION" verparam ":" vervalue CRLF -verparam = (";" other_param)* -vervalue = "2.0" / maxver / (minver ";" maxver) -maxver = "" minver = "" -calscale = "CALSCALE" calparam ":" calvalue CRLF -calparam = (";" other_param)* -calvalue = "GREGORIAN" -method = "METHOD" metparam ":" metvalue CRLF -metparam = (";" other_param)* -metvalue = iana_token -x_prop = x_name (";" icalparameter)* ":" value CRLF -value = VALUE_CHAR* -iana_prop = iana_token (";" icalparameter)* ":" value CRLF -quoted_string = DQUOTE QSAFE_CHAR DQUOTE* -icalparameter = altrepparam - / cnparam - / cutypeparam - / delfromparam - / deltoparam - / dirparam - / encodingparam - / fmttypeparam - / fbtypeparam - / languageparam - / memberparam - / partstatparam - / rangeparam - / trigrelparam - / reltypeparam - / roleparam - / rsvpparam - / sentbyparam - / tzidparam - / valuetypeparam - / other_param - -altrepparam = "ALTREP" "=" DQUOTE uri DQUOTE -cal_address = uri -uri = "" -fmttypeparam = "" -cnparam = "CN" "=" param_value -cutypeparam - = "CUTYPE" "=" - ("INDIVIDUAL" - / "GROUP" - / "RESOURCE" - / "ROOM" - / "UNKNOWN" - / x_name - / iana_token) - -delfromparam - = "DELEGATED-FROM" "=" DQUOTE cal_address DQUOTE - ("," DQUOTE cal_address DQUOTE)* -deltoparam - = "DELEGATED-TO" "=" DQUOTE cal_address DQUOTE - ("," DQUOTE cal_address DQUOTE)* - -dirparam = "DIR" "=" DQUOTE uri DQUOTE -encodingparam - = "ENCODING" "=" ("8BIT" / "BASE64") - -fbtypeparam - = "FBTYPE" "=" - ("FREE" - / "BUSY" - / "BUSY-UNAVAILABLE" - / "BUSY-TENTATIVE" - / x_name - / iana_token) - -languageparam = "LANGUAGE" "=" language -language = Language_Tag -Language_Tag = "" - -memberparam - = "MEMBER" "=" DQUOTE cal_address - DQUOTE ("," DQUOTE cal_address DQUOTE)* - -partstatparam - = "PARTSTAT" "=" - (partstat_event - / partstat_todo - / partstat_jour) - -partstat_event - = ("NEEDS-ACTION" - / "ACCEPTED" - / "DECLINED" - / "TENTATIVE" - / "DELEGATED" - / x_name - / iana_token) - -partstat_todo - = ("NEEDS-ACTION" - / "ACCEPTED" - / "DECLINED" - / "TENTATIVE" - / "DELEGATED" - / "COMPLETED" - / "IN-PROCESS" - / x_name - / iana_token) - -partstat_jour - = ("NEEDS-ACTION" - / "ACCEPTED" - / "DECLINED" - / x_name - / iana_token) - -rangeparam = "RANGE" "=" "THISANDFUTURE" - -trigrelparam = "RELATED" "=" ("START" / "END") - -reltypeparam - = "RELTYPE" "=" - ("PARENT" - / "CHILD" - / "SIBLING" - / iana_token - / x_name) - -roleparam - = "ROLE" "=" - ("CHAIR" - / "REQ-PARTICIPANT" - / "OPT-PARTICIPANT" - / "NON-PARTICIPANT" - / x_name - / iana_token) - -rsvpparam = "RSVP" "=" ("TRUE" / "FALSE") - -sentbyparam - = "SENT-BY" "=" DQUOTE cal_address DQUOTE - -tzidparam = "TZID" "=" tzidprefix? paramtext -tzidprefix = "/" - -valuetypeparam = "VALUE" "=" valuetype -valuetype - = ("BINARY" - / "BOOLEAN" - / "CAL-ADDRESS" - / "DATE" - / "DATE-TIME" - / "DURATION" - / "FLOAT" - / "INTEGER" - / "PERIOD" - / "RECUR" - / "TEXT" - / "TIME" - / "URI" - / "UTC-OFFSET" - / x_name - / iana_token) - -eventc - = "BEGIN" ":" "VEVENT" CRLF - eventprop alarmc* - "END" ":" "VEVENT" CRLF - -eventprop - = (dtstamp - / uid - / dtstart - / class - / created - / description - / geo - / last_mod - / location - / organizer - / priority - / seq - / status - / summary - / transp - / url - / recurid - / rrule - / dtend - / duration - / attach - / attendee - / categories - / comment - / contact - / exdate - / rstatus - / related - / resources - / rdate - / x_prop - / iana_prop)* - -alarmc - = "BEGIN" ":" "VALARM" CRLF - (audioprop / dispprop / emailprop) - "END" ":" "VALARM" CRLF - -audioprop - = (action - / trigger - / duration - / repeat - / attach - / x_prop / iana_prop)* - -dispprop - = (action - / description - / trigger - / duration - / repeat - / x_prop - / iana_prop)* - -emailprop - = (action - / description - / trigger - / summary - / attendee - / duration - / repeat - / attach - / x_prop - / iana_prop)* - -dtstamp = "DTSTAMP" stmparam ":" date_time CRLF -stmparam = (";" other_param)* -uid = "UID" uidparam ":" text CRLF -uidparam = (";" other_param)* -dtstart = "DTSTART" dtstparam ":" dtstval CRLF -dtstparam - = ( - (";" "VALUE" "=" ("DATE-TIME" / "DATE")) - / (";" tzidparam) - / (";" other_param) - )* -dtstval = date_time / date -class = "CLASS" classparam ":" classvalue CRLF -classparam = (";" other_param)* -classvalue - = "PUBLIC" - / "PRIVATE" - / "CONFIDENTIAL" - / iana_token - / x_name -created = "CREATED" creaparam ":" date_time CRLF -creaparam = (";" other_param)* -description = "DESCRIPTION" descparam ":" text CRLF -descparam - = ( - (";" altrepparam) - / (";" languageparam) - / (";" other_param) - )* -geo = "GEO" geoparam ":" geovalue CRLF -geoparam = (";" other_param)* -geovalue = float ";" float -float = ("+"? / "-") DIGIT? ("." DIGIT?)? -last_mod = "LAST-MODIFIED" lstparam ":" date_time CRLF -lstparam = (";" other_param)* -location = "LOCATION" locparam ":" text CRLF -locparam - = ( - (";" altrepparam) - / (";" languageparam) - / (";" other_param) - )* -organizer= "ORGANIZER" orgparam ":" cal_address CRLF -orgparam - = ( - (";" cnparam) - / (";" dirparam) - / (";" sentbyparam) - / (";" languageparam) - / (";" other_param) - )* -priority = "PRIORITY" prioparam ":" priovalue CRLF -prioparam = (";" other_param)* -priovalue = integer -seq = "SEQUENCE" seqparam ":" integer CRLF -seqparam = (";" other_param)* -status = "STATUS" statparam ":" statvalue CRLF -statparam= (";" other_param)* -statvalue - = (statvalue_event - / statvalue_todo - / statvalue_jour) -statvalue_event - = "TENTATIVE" - / "CONFIRMED" - / "CANCELLED" - -statvalue_todo - = "NEEDS-ACTION" - / "COMPLETED" - / "IN-PROCESS" - / "CANCELLED" -summary = "SUMMARY" summparam ":" text CRLF -summparam - = ( - (";" altrepparam) / (";" languageparam) - / (";" other_param) - )* -transp = "TRANSP" transparam ":" transvalue CRLF -transparam = (";" other_param)* -transvalue = "OPAQUE" / "TRANSPARENT" -url = "URL" urlparam ":" uri CRLF -urlparam = (";" other_param)* -recurid = "RECURRENCE-ID" ridparam ":" ridval CRLF -ridparam - = ( - (";" "VALUE" "=" ("DATE-TIME" / "DATE")) - / (";" tzidparam) / (";" rangeparam) - / (";" other_param) - )* -ridval = date_time / date -rrule = "RRULE" rrulparam ":" recur CRLF -rrulparam = (";" other_param)* -dtend = "DTEND" dtendparam ":" dtendval CRLF -dtendparam - = ( - (";" "VALUE" "=" ("DATE-TIME" / "DATE")) - / (";" tzidparam) - / (";" other_param) - )* -dtendval = date_time / date -duration = "DURATION" durparam ":" dur_value CRLF -durparam = (";" other_param)* -attach - = "ATTACH" attachparam ( ":" uri ) - / (";" "ENCODING" "=" "BASE64" - ";" "VALUE" "=" "BINARY" - ":" binary) CRLF -attachparam - = ( - (";" fmttypeparam) / - (";" other_param) - )* -attendee = "ATTENDEE" attparam ":" cal_address CRLF - -attparam - = ( - (";" cutypeparam) - / (";" memberparam) - / (";" roleparam) - / (";" partstatparam) - / (";" rsvpparam) - / (";" deltoparam) - / (";" delfromparam) - / (";" sentbyparam) - / (";" cnparam) - / (";" dirparam) - / (";" languageparam) - / (";" other_param) - )* -categories - = "CATEGORIES" catparam ":" text *("," text) CRLF - -catparam - = ( - (";" languageparam ) - / (";" other_param) - )* -comment = "COMMENT" commparam ":" text CRLF -commparam - = ( - (";" altrepparam) - / (";" languageparam) - / (";" other_param) - )* -contact = "CONTACT" contparam ":" text CRLF -contparam - = ( - (";" altrepparam) - / (";" languageparam) - / (";" other_param) -)* -exdate = "EXDATE" exdtparam ":" exdtval *("," exdtval) CRLF -exdtparam - = ( - (";" "VALUE" "=" ("DATE-TIME" / "DATE")) - / (";" tzidparam) - / (";" other_param) - )* -exdtval = date_time / date -rstatus - = "REQUEST-STATUS" rstatparam ":" - statcode ";" statdesc (";" extdata)? -rstatparam - = ( - (";" languageparam) - / (";" other_param) - )* -statdesc = text -extdata = text -related = "RELATED-TO" relparam ":" text CRLF -relparam - = ( - (";" reltypeparam) - / (";" other_param) - )* -resources = "RESOURCES" resrcparam ":" text *("," text) CRLF - -resrcparam - = ( - (";" altrepparam) - / (";" languageparam) - / (";" other_param) - )* -exdate = "EXDATE" exdtparam ":" exdtval *("," exdtval) CRLF -exdtparam - = ( - (";" "VALUE" "=" ("DATE-TIME" / "DATE")) - / (";" tzidparam) - / (";" other_param) - )* -exdtval = date_time / date -rdate = "RDATE" rdtparam ":" rdtval *("," rdtval) CRLF - -rdtparam - = ( - (";" "VALUE" "=" ("DATE-TIME" / "DATE" / "PERIOD")) - / (";" tzidparam) - / (";" other_param) - )* -rdtval = date_time / date / period -action = "ACTION" actionparam ":" actionvalue CRLF - -actionparam = (";" other_param)* -actionvalue = "AUDIO" / "DISPLAY" / "EMAIL" / iana_token / x_name -trigger = "TRIGGER" (trigrel / trigabs) CRLF -trigrel - = ( - (";" "VALUE" "=" "DURATION") / - (";" trigrelparam) / - (";" other_param) - )* ":" dur_value - -trigabs - = ( - (";" "VALUE" "=" "DATE-TIME") / - (";" other_param) - )* ":" date_time -repeat = "REPEAT" repparam ":" integer CRLF -repparam = (";" other_param)* -date_time = date "T" time -text = (TSAFE_CHAR / ":" / DQUOTE / ESCAPED_CHAR)* -date = date_value -date_value = date_fullyear date_month date_mday -date_fullyear = DIGIT DIGIT DIGIT DIGIT -date_month = DIGIT DIGIT -date_mday = DIGIT DIGIT -integer = (["+"] / "-") DIGIT -statvalue_jour = "DRAFT" / "FINAL" / "CANCELLED" -recur = recur_rule_part ( ";" recur_rule_part )* -dur_value = (["+"] / "-") "P" (dur_date / dur_time / dur_week) -dur_date = dur_day [dur_time] -dur_time = "T" (dur_hour / dur_minute / dur_second) -dur_week = DIGIT+ "W" -dur_hour = DIGIT+ "H" [dur_minute] -dur_minute = DIGIT+ "M" [dur_second] -dur_second = DIGIT+ "S" -dur_day = DIGIT+ "D" -binary = (b_char b_char b_char b_char)* b_end? -b_char = ALPHA / DIGIT / "+" / "/" -b_end = (b_char b_char "==") / (b_char b_char b_char "=") -b_char = ALPHA / DIGIT / "+" / "/" -statcode = DIGIT+ ("." DIGIT+) ("." DIGIT+)? -statdesc = text -extdata = text -period = period_explicit / period_start -period_explicit = date_time "/" date_time -period_start = date_time "/" dur_value -time = time_hour time_minute time_second time_utc? -time_hour = DIGIT DIGIT -time_minute = DIGIT DIGIT -time_second = DIGIT DIGIT -time_utc = "Z" -TSAFE_CHAR = WSP / [\u0021] / [\u0023-\u002B] / [\u002D-\u0039] / [\u003C-\u005B] / [\u005D-\u007E] / NON_US_ASCII -ESCAPED_CHAR = ("\\" / "\;" / "\," / "\N" / "\n") -recur_rule_part - = ( "FREQ" "=" freq ) - / ( "UNTIL" "=" enddate ) - / ( "COUNT" "=" DIGIT+ ) - / ( "INTERVAL" "=" DIGIT+ ) - / ( "BYSECOND" "=" byseclist ) - / ( "BYMINUTE" "=" byminlist ) - / ( "BYHOUR" "=" byhrlist ) - / ( "BYDAY" "=" bywdaylist ) - / ( "BYMONTHDAY" "=" bymodaylist ) - / ( "BYYEARDAY" "=" byyrdaylist ) - / ( "BYWEEKNO" "=" bywknolist ) - / ( "BYMONTH" "=" bymolist ) - / ( "BYSETPOS" "=" bysplist ) - / ( "WKST" "=" weekday ) -freq = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY" -enddate = date / date_time -byseclist = ( seconds ("," seconds)* ) -seconds = DIGIT DIGIT? -byminlist = ( minutes ("," minutes)* ) -minutes = DIGIT DIGIT? -byhrlist = ( hour ("," hour)* ) -hour = DIGIT DIGIT? -bywdaylist = ( weekdaynum ("," weekdaynum)* ) -weekdaynum = ((plus / minus)? ordwk)? weekday -plus = "+" -minus = "-" -ordwk = DIGIT DIGIT? -weekday = "SU" / "MO" / "TU" / "WE" / "TH" / "FR" / "SA" -bymodaylist = ( monthdaynum *("," monthdaynum) ) -monthdaynum = [plus / minus] ordmoday -ordmoday = DIGIT DIGIT? -byyrdaylist = ( yeardaynum ("," yeardaynum)* ) -yeardaynum = [plus / minus] ordyrday -ordyrday = DIGIT DIGIT? DIGIT? -bywknolist = ( weeknum ("," weeknum)* ) -weeknum = [plus / minus] ordwk -bymolist = ( monthnum ("," monthnum)* ) -monthnum = DIGIT DIGIT? -bysplist = ( setposday ("," setposday)* ) -setposday = yeardaynum - -DQUOTE = [\u0022] - -QSAFE_CHAR - = WSP - / [\u0021] - / [\u0023-\u007E] - / NON_US_ASCII - -SAFE_CHAR - = WSP - / [\u0021] - / [\u0023-\u002B] - / [\u002d-\u0039] - / [\u003c-\u007e] - / NON_US_ASCII - -NON_US_ASCII - = UTF8_2 - / UTF8_3 - / UTF8_4 - -UTF8_2 = [\u00c2-\u00df] UTF8_tail - -UTF8_3 - = [\u00E0] [\u00A0-\u00BF] UTF8_tail - / [\u00E1-\u00EC] UTF8_tail UTF8_tail - / [\u00ED] [\u0080-\u009F] UTF8_tail - / [\u00EE-\u00EF] UTF8_tail UTF8_tail - -UTF8_4 - = [\u00F0] [\u0090-\u00BF] UTF8_tail UTF8_tail - / [\u00F1-\u00F3] UTF8_tail UTF8_tail UTF8_tail - / [\u00F4] [\u0080-\u008F] UTF8_tail UTF8_tail - -UTF8_tail = [\u0080-\u00BF] - -VALUE_CHAR - = WSP - / [\u0021-\u007E] - / NON_US_ASCII - -WSP = SP / HTAB -HTAB = [\u0009] -SP = [\u0020] -CRLF = "\r\n" -ALPHA - = [a-z] - / [A-Z] - -DIGIT = [0-9] \ No newline at end of file diff --git a/lib/parser/index.js b/lib/parser/index.js deleted file mode 100644 index 45cd382..0000000 --- a/lib/parser/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./ical.js'); \ No newline at end of file diff --git a/test/parse_full.js b/test/parse_full.js index baa2b24..bc6b105 100644 --- a/test/parse_full.js +++ b/test/parse_full.js @@ -16,8 +16,11 @@ describe('Parser', function () { parser.write(full_ics) }) it('must parse full.ics streamed', function (done) { - parser.on('end', done); + parser.on('end', function () { + debugger; + done() + }); full_ics_stream.pipe(parser) }) }) -}) \ No newline at end of file +})