From 63f3a4eb779986a0423a6584297c34f52fde3251 Mon Sep 17 00:00:00 2001 From: Iftah Haimovitch Date: Wed, 16 Jan 2013 03:08:28 +0200 Subject: [PATCH 01/10] realtime, client side parsing of regexp! --- .gitignore | 1 + app/assets/javascripts/main.js | 88 ++++++++++++++----- app/assets/javascripts/regexper.js | 15 ++-- .../javascripts/regexper/any_character.js | 4 +- app/assets/javascripts/regexper/base.js | 4 +- app/assets/javascripts/regexper/charset.js | 4 +- app/assets/javascripts/regexper/escaped.js | 4 +- app/assets/javascripts/regexper/literal.js | 4 +- app/assets/javascripts/regexper/match.js | 4 +- app/assets/javascripts/regexper/range.js | 4 +- app/assets/javascripts/regexper/regexp.js | 4 +- app/assets/javascripts/regexper/repetition.js | 4 +- app/assets/javascripts/regexper/subexp.js | 4 +- app/assets/javascripts/regexper/text_box.js | 4 +- app/assets/stylesheets/main.css | 1 + public/humans.txt | 17 ---- public/index.html | 79 ----------------- public/robots.txt | 3 - 18 files changed, 99 insertions(+), 149 deletions(-) delete mode 100755 public/humans.txt delete mode 100644 public/index.html delete mode 100755 public/robots.txt diff --git a/.gitignore b/.gitignore index 208fdc5..95a50cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store /tmp /coverage +.idea diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index f90274b..54b7417 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -1,39 +1,87 @@ //=require vendor/raphael-min //=require vendor/require //=require vendor/microajax +//=require vendor/canopy -require.config({ - baseUrl: '/assets' -}); +//require.config({ +// baseUrl: '/assets' +//}); + +modules = {} (function() { - var form = document.getElementById('regexp_form'), - input = document.getElementById('regexp_input'), + + // ugly class loading, because I had problems setting up Require.js + var Renderer = getRenderer(); + var base = getBase(Renderer); + var text_box = getTextBox(Renderer, base); + var charset = getCharset(Renderer, base); + var escaped = getEscaped(Renderer, text_box); + var literal = getLiteral(Renderer, text_box); + var match = getMatch(Renderer, base, text_box); + var range = getRange(Renderer, base); + var regexp = getRegexp(Renderer, base); + var repetition = getRepetition(Renderer, base); + var subexp = getSubexp(Renderer, base, regexp); + + modules = { + charset: charset, + escaped: escaped, + literal: literal, + match: match, + range: range, + regexp: regexp, + repetition: repetition, + subexp: subexp + }; + + for (var k in RegexperClasses) { + RegexperParser[k] = RegexperClasses[k]; + } + + var input = document.getElementById('regexp_input'), error = document.getElementById('error'), paper_container = document.getElementById('paper-container'); - form.onsubmit = function() { + var prev_input = null; + + input.onkeyup = function() { + if (input.value === prev_input) { + return; // key hasn't changed text + } + prev_input = input.value; paper_container.innerHTML = ''; error.innerHTML = ''; + RegexperParser.Subexp.capture_group = 1; + document.body.className = 'is-loading'; - new microAjax(form.action, function(text) { - if (this.request.status == 200) { + try { + var tree = RegexperParser.parse(input.value) + if (!tree) { + console.log("No tree!") + return; + } + var obj = tree.to_obj(); + try { document.body.className += ' has-results'; - - require(['regexper'], function(Regexper) { - Regexper.draw(paper_container, JSON.parse(text), function() { - document.body.className = 'has-results'; - console.log("DONE"); - }); + Renderer.draw(paper_container, {"raw_expr":input.value,"structure":obj} , function() { + document.body.className = 'has-results'; }); - } else { - error.innerHTML = JSON.parse(text).error; - document.body.className = 'has-results'; } - }, input.value); + catch(e) { + err = e; + error.innerHTML = "Exception drawing tree:
"+ e.stack.replace(/\n/g,"
"); + } + } + catch(e) { + err = e; + error.innerHTML = "Exception running grammer:
"+ e.stack.replace(/\n/g,"
"); + } + + + } + - return false; - }; }()); diff --git a/app/assets/javascripts/regexper.js b/app/assets/javascripts/regexper.js index 293df62..6442065 100644 --- a/app/assets/javascripts/regexper.js +++ b/app/assets/javascripts/regexper.js @@ -1,4 +1,4 @@ -define(function() { +getRenderer = function() { var base_path_attrs = { 'stroke-width': 2 }, @@ -56,13 +56,12 @@ define(function() { }, render: function(paper, structure, complete) { - var module_name = 'regexper/' + structure.type; + var module_name = structure.type; - require([module_name], function(Module) { - var module = new Module(paper, structure); - module.complete(function() { - complete(module); - }); + var Module = modules[module_name]; + var module = new Module(paper, structure); + module.complete(function() { + complete(module); }); }, @@ -93,4 +92,4 @@ define(function() { }; return Regexper; -}); +} diff --git a/app/assets/javascripts/regexper/any_character.js b/app/assets/javascripts/regexper/any_character.js index 51ca486..0a697df 100644 --- a/app/assets/javascripts/regexper/any_character.js +++ b/app/assets/javascripts/regexper/any_character.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/text_box'], function(Regexper, TextBox) { +getAnyChar = function(Regexper, TextBox) { var base_text_attrs = { 'font-size': 12, fill: '#ffffff' @@ -17,4 +17,4 @@ define(['regexper', 'regexper/text_box'], function(Regexper, TextBox) { Regexper.extend(AnyCharacter.prototype, TextBox.prototype); return AnyCharacter; -}); +} diff --git a/app/assets/javascripts/regexper/base.js b/app/assets/javascripts/regexper/base.js index 0763b64..bbfe0c5 100644 --- a/app/assets/javascripts/regexper/base.js +++ b/app/assets/javascripts/regexper/base.js @@ -1,4 +1,4 @@ -define(['regexper'], function(Regexper) { +getBase = function(Regexper) { var Base = function() { this._contents = []; this._stack_order = []; @@ -69,4 +69,4 @@ define(['regexper'], function(Regexper) { }); return Base; -}); +} diff --git a/app/assets/javascripts/regexper/charset.js b/app/assets/javascripts/regexper/charset.js index 407654a..4da1dfc 100644 --- a/app/assets/javascripts/regexper/charset.js +++ b/app/assets/javascripts/regexper/charset.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/base'], function(Regexper, Base) { +getCharset = function(Regexper, Base) { var margin = 5, item_spacing = 10, base_box_attrs = { @@ -94,4 +94,4 @@ define(['regexper', 'regexper/base'], function(Regexper, Base) { }); return Charset; -}); +} diff --git a/app/assets/javascripts/regexper/escaped.js b/app/assets/javascripts/regexper/escaped.js index 596e56c..ff73a6b 100644 --- a/app/assets/javascripts/regexper/escaped.js +++ b/app/assets/javascripts/regexper/escaped.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/text_box'], function(Regexper, TextBox) { +getEscaped = function(Regexper, TextBox) { var base_text_attrs = { 'font-size': 12 }, @@ -38,4 +38,4 @@ define(['regexper', 'regexper/text_box'], function(Regexper, TextBox) { Regexper.extend(Escaped.prototype, TextBox.prototype); return Escaped; -}); +} diff --git a/app/assets/javascripts/regexper/literal.js b/app/assets/javascripts/regexper/literal.js index c414bc8..e0bdc31 100644 --- a/app/assets/javascripts/regexper/literal.js +++ b/app/assets/javascripts/regexper/literal.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/text_box'], function(Regexper, TextBox) { +getLiteral = function(Regexper, TextBox) { var base_text_attrs = { 'font-size': 12 }, @@ -16,4 +16,4 @@ define(['regexper', 'regexper/text_box'], function(Regexper, TextBox) { Regexper.extend(Literal.prototype, TextBox.prototype); return Literal; -}); +} diff --git a/app/assets/javascripts/regexper/match.js b/app/assets/javascripts/regexper/match.js index 8d23c0c..e4c846d 100644 --- a/app/assets/javascripts/regexper/match.js +++ b/app/assets/javascripts/regexper/match.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/base', 'regexper/text_box'], function(Regexper, Base, TextBox) { +getMatch = function(Regexper, Base, TextBox) { var item_spacing = 10, base_anchor_text_attrs = { 'font-size': 12, @@ -105,4 +105,4 @@ define(['regexper', 'regexper/base', 'regexper/text_box'], function(Regexper, Ba }); return Match; -}); +} diff --git a/app/assets/javascripts/regexper/range.js b/app/assets/javascripts/regexper/range.js index 1377b25..36a7f0b 100644 --- a/app/assets/javascripts/regexper/range.js +++ b/app/assets/javascripts/regexper/range.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/base'], function(Regexper, Base) { +getRange = function(Regexper, Base) { var base_text_attrs = { 'font-size': 12, 'font-weight': 'bold' @@ -56,4 +56,4 @@ define(['regexper', 'regexper/base'], function(Regexper, Base) { }); return Range; -}); +} diff --git a/app/assets/javascripts/regexper/regexp.js b/app/assets/javascripts/regexper/regexp.js index f252437..49ea509 100644 --- a/app/assets/javascripts/regexper/regexp.js +++ b/app/assets/javascripts/regexper/regexp.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/base'], function(Regexper, Base) { +getRegexp = function(Regexper, Base) { var item_spacing = 10, curve_radius = 10, base_connector_attrs = { @@ -127,4 +127,4 @@ define(['regexper', 'regexper/base'], function(Regexper, Base) { }); return Regexp; -}); +} diff --git a/app/assets/javascripts/regexper/repetition.js b/app/assets/javascripts/regexper/repetition.js index 2d95eb8..aae886b 100644 --- a/app/assets/javascripts/regexper/repetition.js +++ b/app/assets/javascripts/regexper/repetition.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/base'], function(Regexper, Base) { +getRepetition = function(Regexper, Base) { var curve_radius = 10, base_text_attrs = { 'font-size': 10 @@ -207,4 +207,4 @@ define(['regexper', 'regexper/base'], function(Regexper, Base) { }); return Repetition; -}); +} diff --git a/app/assets/javascripts/regexper/subexp.js b/app/assets/javascripts/regexper/subexp.js index 05061d6..0ee6baf 100644 --- a/app/assets/javascripts/regexper/subexp.js +++ b/app/assets/javascripts/regexper/subexp.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/base', 'regexper/regexp'], function(Regexper, Base, Regexp) { +getSubexp = function(Regexper, Base, Regexp) { var margin = 10 base_connector_attrs = { 'stroke-width': 2 @@ -136,4 +136,4 @@ define(['regexper', 'regexper/base', 'regexper/regexp'], function(Regexper, Base }); return Subexp; -}); +} diff --git a/app/assets/javascripts/regexper/text_box.js b/app/assets/javascripts/regexper/text_box.js index 77bb93c..0956a06 100644 --- a/app/assets/javascripts/regexper/text_box.js +++ b/app/assets/javascripts/regexper/text_box.js @@ -1,4 +1,4 @@ -define(['regexper', 'regexper/base'], function(Regexper, Base) { +getTextBox = function(Regexper, Base) { var text_margin = 5; var TextBox = function(paper, label, text_attrs, rect_attrs) { @@ -38,4 +38,4 @@ define(['regexper', 'regexper/base'], function(Regexper, Base) { }); return TextBox; -}); +} diff --git a/app/assets/stylesheets/main.css b/app/assets/stylesheets/main.css index 29de5cf..2dde3e7 100755 --- a/app/assets/stylesheets/main.css +++ b/app/assets/stylesheets/main.css @@ -95,6 +95,7 @@ body.is-loading #loading { } #error { + margin-top:30px; background: #d00; color: #fff; text-indent: 0.5em; diff --git a/public/humans.txt b/public/humans.txt deleted file mode 100755 index 43db87c..0000000 --- a/public/humans.txt +++ /dev/null @@ -1,17 +0,0 @@ -# humanstxt.org/ -# The humans responsible & technology colophon - -# TEAM - - Creator: Jeff Avallone - Site: http://github.com/javallone - Twitter: @javallone - -# THANKS - - strfriend.com for the idea, whatever happened to you? - -# TECHNOLOGY COLOPHON - - HTML5, CSS3, SVG, RaphaelJS - Ruby, Rack, Treetop diff --git a/public/index.html b/public/index.html deleted file mode 100644 index e086fb4..0000000 --- a/public/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - Regexper - - - - - - - - - - - - - - - - -
-

Regexper

- - You thought you only had two problems... -
- -
-
-
- - - - -
-
- -
-
- Loading -
- -
- -
-
-
- - - - - Fork me on GitHub - - - - - - - - - diff --git a/public/robots.txt b/public/robots.txt deleted file mode 100755 index ee2cc21..0000000 --- a/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# robotstxt.org/ - -User-agent: * From 8095ad5843d858250ffff8dde47d99d282ade48e Mon Sep 17 00:00:00 2001 From: Iftahh Date: Wed, 16 Jan 2013 03:11:24 +0200 Subject: [PATCH 02/10] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f65fc9e..e1eaf34 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ Code for the http://www.regexper.com/ site. +## This Fork +This fork was modified by Iftah Haimovitch, it features real time client side parsing of the regular expression! No Ruby and no server side processing is needed. + ## Contributing I greatly appreciate any contributions that you may have for the site. Feel free to fork the project and work on any of the reported issues, or let me know about any improvements you think would be beneficial. From 358f716a81f354cd33b622cfd6028eb5a4c81bbb Mon Sep 17 00:00:00 2001 From: Iftahh Date: Wed, 16 Jan 2013 03:13:27 +0200 Subject: [PATCH 03/10] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e1eaf34..668a328 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ Code for the http://www.regexper.com/ site. ## This Fork This fork was modified by Iftah Haimovitch, it features real time client side parsing of the regular expression! No Ruby and no server side processing is needed. +To run the website go to `regexper/app` and run static file serving (eg. `python -m SimpleHTTPServer 8080`) and then open the browser to http://127.0.0.1:8080/public/ + ## Contributing I greatly appreciate any contributions that you may have for the site. Feel free to fork the project and work on any of the reported issues, or let me know about any improvements you think would be beneficial. From eae78a1b31541699de7b1ba457113cf19f6287d0 Mon Sep 17 00:00:00 2001 From: Iftah Haimovitch Date: Wed, 16 Jan 2013 03:18:28 +0200 Subject: [PATCH 04/10] now commited newly added files --- app/assets/javascripts/grammerClasses.js | 452 +++ app/assets/javascripts/regexpGrammer.js | 3575 ++++++++++++++++++++ app/assets/javascripts/regexpGrammer.peg | 92 + app/public/humans.txt | 17 + app/public/index.html | 88 + app/public/robots.txt | 3 + app/public/test.html | 28 + node_modules/.bin/canopy | 1 + node_modules/canopy/LICENSE.txt | 24 + node_modules/canopy/README.markdown | 34 + node_modules/canopy/bin/canopy | 22 + node_modules/canopy/lib/canopy-min.js | 2 + node_modules/canopy/lib/canopy-min.js.map | 8 + node_modules/canopy/lib/canopy.js | 3595 +++++++++++++++++++++ node_modules/canopy/package.json | 48 + 15 files changed, 7989 insertions(+) create mode 100644 app/assets/javascripts/grammerClasses.js create mode 100644 app/assets/javascripts/regexpGrammer.js create mode 100644 app/assets/javascripts/regexpGrammer.peg create mode 100755 app/public/humans.txt create mode 100644 app/public/index.html create mode 100755 app/public/robots.txt create mode 100644 app/public/test.html create mode 120000 node_modules/.bin/canopy create mode 100644 node_modules/canopy/LICENSE.txt create mode 100644 node_modules/canopy/README.markdown create mode 100755 node_modules/canopy/bin/canopy create mode 100644 node_modules/canopy/lib/canopy-min.js create mode 100644 node_modules/canopy/lib/canopy-min.js.map create mode 100644 node_modules/canopy/lib/canopy.js create mode 100644 node_modules/canopy/package.json diff --git a/app/assets/javascripts/grammerClasses.js b/app/assets/javascripts/grammerClasses.js new file mode 100644 index 0000000..b14f40b --- /dev/null +++ b/app/assets/javascripts/grammerClasses.js @@ -0,0 +1,452 @@ +RegexperClasses = { + RegexpLiteral: { + to_obj: function() { + return this.regexp.to_obj(); + } + }, + + Regexp: { + content: function() { + if (this.alternate.textValue.length == 0) + return [this.match] + else + return [this.match, this.alternate.regexp.content()]; + }, + + to_obj: function() { + var content = this.content(); + var objContent = []; + for (var i=0; i 0 ;}, + _anchor_end: function() { return this.anchor_end.textValue.length > 0; }, + content: function() { + return this.match.elements; +// var content = [] +// for (var i=0; i 0; + }, + count: function() { + return this.repeat.count(); + } + }, + + + RepeatAny: { + count: function() {return "any"} + }, + + RepeatRequired: { + count: function() {return "required"} + }, + + + RepeatOptional: { + count: function() {return "optional"} + }, + + RepeatSpecFull: { + count: function() { + return + } + }, + + RepeatSpecUpTo: { + count: function() { + return { + stop: parseInt(this.stop.textValue) + } + } + }, + + RepeatSpecAtLeast: { + count: function() { + return { + stop: parseInt(this.start.textValue) + } + } + }, + + + RepeatSpecExact: { + count: function() { + return parseInt(this.value.textValue); + } + }, + + Subexp: { + content: function() { + return this.regexp.content(); + }, + kind: function() { + return (!this.flag || this.flag.textValue.length == 0) ? "capture": this.flag.to_sym(); + }, + _capture_group: function() { + if (this.kind() == "capture") { + var group = RegexperClasses.Subexp.capture_group + //if (!group) { + RegexperClasses.Subexp.capture_group += 1; + //} + return group; + } + }, + to_obj: function() { + var content = this.content(); + var objContent = []; + for (var i=0; i :charset, +// :range => [interval.begin, interval.end], +// :inverted => inverted?, +// :content => content.map(&:to_obj) +// } +// end +// end + + CharsetRange: { + to_obj: function() { + return { + type: "range", + range: [this.offset, this.offset+this.textValue.length], + start: this.start.to_obj(), + stop: this.stop.to_obj() + } + } + }, + + Literal: { + to_obj: function() { + return { + type: "literal", + range: [this.offset, this.offset+this.textValue.length], + content: this.textValue + } + } + + }, + + EscapedCharacter: { + is_escaped_literal: function() { + return !this.escape.extension_modules + }, + content: function() { + return this.escape; + }, + to_obj: function() { + if (this.is_escaped_literal()) { + return { + type: "literal", + range: [this.offset, this.offset+this.textValue.length], + content: this.textValue + } + } + else { + return { + type: "escaped", + range: [this.offset, this.offset+this.textValue.length], + content: this.content().to_obj() + } + } + } + }, + + + AnyCharacter: { + extension_modules: true, + to_obj: function() { + return { + type: "any_character", + range: [this.offset, this.offset+this.textValue.length] + } + } + }, + + + BackspaceCharacter: { + extension_modules: true, + to_obj: function() { + return "backspace"; + } + }, + + + WordBoundaryCharacter: { + extension_modules: true, + to_obj: function() { + return "word_boundary"; + } + }, + + + NonWordBoundaryCharacter: { + extension_modules: true, + to_obj: function() { + return "non_word_boundary"; + } + }, + + DigitCharacter: { + extension_modules: true, + to_obj: function() { + return "digit"; + } + }, + + NonDigitCharacter: { + extension_modules: true, + to_obj: function() { + return "non_digit"; + } + }, + + FormFeedCharacter: { + extension_modules: true, + to_obj: function() { + return "form_feed"; + } + }, + + LineFeedCharacter: { + extension_modules: true, + to_obj: function() { + return "line_feed"; + } + }, + + CarriageReturnCharacter: { + extension_modules: true, + to_obj: function() { + return "carriage_return"; + } + }, + + WhiteSpaceCharacter: { + extension_modules: true, + to_obj: function() { + return "white_space"; + } + }, + + NonWhiteSpaceCharacter: { + extension_modules: true, + to_obj: function() { + return "non_white_space"; + } + }, + + TabCharacter: { + extension_modules: true, + to_obj: function() { + return "tab"; + } + }, + + VerticalTabCharacter: { + extension_modules: true, + to_obj: function() { + return "vertical_tab"; + } + }, + + WordCharacter: { + extension_modules: true, + to_obj: function() { + return "word"; + } + }, + + NonWordCharacter: { + extension_modules: true, + to_obj: function() { + return "non_word"; + } + }, + + ControlCharacter: { + extension_modules: true, + to_obj: function() { + return { + type: "control", + code: this.code.textValue.toUpperCase() + } + } + }, + + + BackReference: { + extension_modules: true, + to_obj: function() { + return { + type: "back_reference", + code: parseInt(this.textValue) + } + } + }, + + OctalCharacter: { + extension_modules: true, + to_obj: function() { + return { + type: "octal", + code: this.code.textValue.toUpperCase() + } + } + }, + + HexCharacter: { + extension_modules: true, + to_obj: function() { + return { + type: "hex", + code: this.code.textValue.toUpperCase() + } + } + }, + + UnicodeCharacter: { + extension_modules: true, + to_obj: function() { + return { + type: "unicode", + code: this.code.textValue.toUpperCase() + } + } + }, + + NullCharacter: { + extension_modules: true, + to_obj: function() { + return "null"; + } + } + + +} diff --git a/app/assets/javascripts/regexpGrammer.js b/app/assets/javascripts/regexpGrammer.js new file mode 100644 index 0000000..0036212 --- /dev/null +++ b/app/assets/javascripts/regexpGrammer.js @@ -0,0 +1,3575 @@ +(function() { + var extend = function (destination, source) { + if (!destination || !source) return destination; + for (var key in source) { + if (destination[key] !== source[key]) + destination[key] = source[key]; + } + return destination; + }; + + var find = function (root, objectName) { + var parts = objectName.split('.'), + part; + + while (part = parts.shift()) { + root = root[part]; + if (root === undefined) + throw new Error('Cannot find object named ' + objectName); + } + return root; + }; + + var formatError = function (error) { + var lines = error.input.split(/\n/g), + lineNo = 0, + offset = 0; + + while (offset < error.offset + 1) { + offset += lines[lineNo].length + 1; + lineNo += 1; + } + var message = 'Line ' + lineNo + ': expected ' + error.expected + '\n', + line = lines[lineNo - 1]; + + message += line + '\n'; + offset -= line.length + 1; + + while (offset < error.offset) { + message += ' '; + offset += 1; + } + return message + '^'; + }; + + var Grammar = { + __consume__root: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["root"] = this._nodeCache["root"] || {}; + var cached = this._nodeCache["root"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset; + address0 = this.__consume__regexp_literal(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__regexp(); + if (address0) { + } else { + this._offset = index1; + } + } + return this._nodeCache["root"][index0] = address0; + }, + __consume__regexp_literal: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["regexp_literal"] = this._nodeCache["regexp_literal"] || {}; + var cached = this._nodeCache["regexp_literal"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "/") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("/", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"/\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + address2 = this.__consume__regexp(); + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.regexp = address2; + var address3 = null; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === "/") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1("/", this._offset, []); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += 1; + } else { + address3 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"/\""}; + } + } + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + var address4 = null; + var remaining0 = 0, index2 = this._offset, elements1 = [], text1 = "", address5 = true; + while (address5) { + var slice4 = null; + if (this._input.length > this._offset) { + slice4 = this._input.substring(this._offset, this._offset + 1); + } else { + slice4 = null; + } + if (slice4 && /^[igm]/.test(slice4)) { + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address5 = new klass2(slice4, this._offset, []); + if (typeof type2 === "object") { + extend(address5, type2); + } + this._offset += 1; + } else { + address5 = null; + var slice5 = null; + if (this._input.length > this._offset) { + slice5 = this._input.substring(this._offset, this._offset + 1); + } else { + slice5 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[igm]"}; + } + } + if (address5) { + elements1.push(address5); + text1 += address5.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address4 = new klass3(text1, this._offset, elements1); + if (typeof type3 === "object") { + extend(address4, type3); + } + this._offset += text1.length; + } else { + address4 = null; + } + if (address4) { + elements0.push(address4); + text0 += address4.textValue; + labelled0.flags = address4; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass4 = this.constructor.SyntaxNode; + var type4 = find(this.constructor, "RegexpLiteral"); + address0 = new klass4(text0, this._offset, elements0, labelled0); + if (typeof type4 === "object") { + extend(address0, type4); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["regexp_literal"][index0] = address0; + }, + __consume__regexp: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["regexp"] = this._nodeCache["regexp"] || {}; + var cached = this._nodeCache["regexp"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + address1 = this.__consume__match(); + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.match = address1; + var address2 = null; + var index2 = this._offset; + var index3 = this._offset, elements1 = [], labelled1 = {}, text1 = ""; + var address3 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "|") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address3 = new klass0("|", this._offset, []); + if (typeof type0 === "object") { + extend(address3, type0); + } + this._offset += 1; + } else { + address3 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"|\""}; + } + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + var address4 = null; + address4 = this.__consume__regexp(); + if (address4) { + elements1.push(address4); + text1 += address4.textValue; + labelled1.regexp = address4; + } else { + elements1 = null; + this._offset = index3; + } + } else { + elements1 = null; + this._offset = index3; + } + if (elements1) { + this._offset = index3; + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1(text1, this._offset, elements1, labelled1); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + } else { + this._offset = index2; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2("", this._offset, []); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += 0; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.alternate = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = find(this.constructor, "Regexp"); + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["regexp"][index0] = address0; + }, + __consume__anchor_start: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["anchor_start"] = this._nodeCache["anchor_start"] || {}; + var cached = this._nodeCache["anchor_start"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "^") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address0 = new klass0("^", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"^\""}; + } + } + return this._nodeCache["anchor_start"][index0] = address0; + }, + __consume__anchor_end: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["anchor_end"] = this._nodeCache["anchor_end"] || {}; + var cached = this._nodeCache["anchor_end"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "$") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address0 = new klass0("$", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"$\""}; + } + } + return this._nodeCache["anchor_end"][index0] = address0; + }, + __consume__match: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["match"] = this._nodeCache["match"] || {}; + var cached = this._nodeCache["match"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var index2 = this._offset; + address1 = this.__consume__anchor_start(); + if (address1) { + } else { + this._offset = index2; + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 0; + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.anchor_start = address1; + var address2 = null; + var index3 = this._offset; + address2 = this.__consume__repetition_count(); + this._offset = index3; + if (!(address2)) { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1("", this._offset, []); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += 0; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + var address3 = null; + var remaining0 = 0, index4 = this._offset, elements1 = [], text1 = "", address4 = true; + while (address4) { + var index5 = this._offset; + address4 = this.__consume__repetition(); + if (address4) { + } else { + this._offset = index5; + address4 = this.__consume__subexp(); + if (address4) { + } else { + this._offset = index5; + address4 = this.__consume__charset(); + if (address4) { + } else { + this._offset = index5; + address4 = this.__consume__terminal(); + if (address4) { + } else { + this._offset = index5; + } + } + } + } + if (address4) { + elements1.push(address4); + text1 += address4.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index4; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address3 = new klass2(text1, this._offset, elements1); + if (typeof type2 === "object") { + extend(address3, type2); + } + this._offset += text1.length; + } else { + address3 = null; + } + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + labelled0.match = address3; + var address5 = null; + var index6 = this._offset; + address5 = this.__consume__anchor_end(); + if (address5) { + } else { + this._offset = index6; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address5 = new klass3("", this._offset, []); + if (typeof type3 === "object") { + extend(address5, type3); + } + this._offset += 0; + } + if (address5) { + elements0.push(address5); + text0 += address5.textValue; + labelled0.anchor_end = address5; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass4 = this.constructor.SyntaxNode; + var type4 = find(this.constructor, "Match"); + address0 = new klass4(text0, this._offset, elements0, labelled0); + if (typeof type4 === "object") { + extend(address0, type4); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["match"][index0] = address0; + }, + __consume__repetition: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["repetition"] = this._nodeCache["repetition"] || {}; + var cached = this._nodeCache["repetition"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var index2 = this._offset; + address1 = this.__consume__subexp(); + if (address1) { + } else { + this._offset = index2; + address1 = this.__consume__charset(); + if (address1) { + } else { + this._offset = index2; + address1 = this.__consume__terminal(); + if (address1) { + } else { + this._offset = index2; + } + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.match = address1; + var address2 = null; + address2 = this.__consume__repetition_count(); + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.repetition_count = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "Repetition"); + address0 = new klass0(text0, this._offset, elements0, labelled0); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["repetition"][index0] = address0; + }, + __consume__repetition_count: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["repetition_count"] = this._nodeCache["repetition_count"] || {}; + var cached = this._nodeCache["repetition_count"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var index2 = this._offset; + address1 = this.__consume__repeat_any(); + if (address1) { + } else { + this._offset = index2; + address1 = this.__consume__repeat_required(); + if (address1) { + } else { + this._offset = index2; + address1 = this.__consume__repeat_optional(); + if (address1) { + } else { + this._offset = index2; + address1 = this.__consume__repeat_spec(); + if (address1) { + } else { + this._offset = index2; + } + } + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.repeat = address1; + var address2 = null; + var index3 = this._offset; + address2 = this.__consume__repeat_greedy_flag(); + if (address2) { + } else { + this._offset = index3; + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address2 = new klass0("", this._offset, []); + if (typeof type0 === "object") { + extend(address2, type0); + } + this._offset += 0; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.greedy = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass1 = this.constructor.SyntaxNode; + var type1 = find(this.constructor, "RepetitionCount"); + address0 = new klass1(text0, this._offset, elements0, labelled0); + if (typeof type1 === "object") { + extend(address0, type1); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["repetition_count"][index0] = address0; + }, + __consume__repeat_any: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["repeat_any"] = this._nodeCache["repeat_any"] || {}; + var cached = this._nodeCache["repeat_any"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "*") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "RepeatAny"); + address0 = new klass0("*", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"*\""}; + } + } + return this._nodeCache["repeat_any"][index0] = address0; + }, + __consume__repeat_required: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["repeat_required"] = this._nodeCache["repeat_required"] || {}; + var cached = this._nodeCache["repeat_required"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "+") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "RepeatRequired"); + address0 = new klass0("+", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"+\""}; + } + } + return this._nodeCache["repeat_required"][index0] = address0; + }, + __consume__repeat_optional: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["repeat_optional"] = this._nodeCache["repeat_optional"] || {}; + var cached = this._nodeCache["repeat_optional"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "?") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "RepeatOptional"); + address0 = new klass0("?", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"?\""}; + } + } + return this._nodeCache["repeat_optional"][index0] = address0; + }, + __consume__repeat_spec: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["repeat_spec"] = this._nodeCache["repeat_spec"] || {}; + var cached = this._nodeCache["repeat_spec"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset; + var index2 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "{") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("{", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"{\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var remaining0 = 1, index3 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 && /^[0-9]/.test(slice2)) { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1(slice2, this._offset, []); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += 1; + } else { + address3 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[0-9]"}; + } + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index3; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2(text1, this._offset, elements1); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.start = address2; + var address4 = null; + var slice4 = null; + if (this._input.length > this._offset) { + slice4 = this._input.substring(this._offset, this._offset + 1); + } else { + slice4 = null; + } + if (slice4 === ",") { + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address4 = new klass3(",", this._offset, []); + if (typeof type3 === "object") { + extend(address4, type3); + } + this._offset += 1; + } else { + address4 = null; + var slice5 = null; + if (this._input.length > this._offset) { + slice5 = this._input.substring(this._offset, this._offset + 1); + } else { + slice5 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\",\""}; + } + } + if (address4) { + elements0.push(address4); + text0 += address4.textValue; + var address5 = null; + var remaining1 = 1, index4 = this._offset, elements2 = [], text2 = "", address6 = true; + while (address6) { + var slice6 = null; + if (this._input.length > this._offset) { + slice6 = this._input.substring(this._offset, this._offset + 1); + } else { + slice6 = null; + } + if (slice6 && /^[0-9]/.test(slice6)) { + var klass4 = this.constructor.SyntaxNode; + var type4 = null; + address6 = new klass4(slice6, this._offset, []); + if (typeof type4 === "object") { + extend(address6, type4); + } + this._offset += 1; + } else { + address6 = null; + var slice7 = null; + if (this._input.length > this._offset) { + slice7 = this._input.substring(this._offset, this._offset + 1); + } else { + slice7 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[0-9]"}; + } + } + if (address6) { + elements2.push(address6); + text2 += address6.textValue; + remaining1 -= 1; + } + } + if (remaining1 <= 0) { + this._offset = index4; + var klass5 = this.constructor.SyntaxNode; + var type5 = null; + address5 = new klass5(text2, this._offset, elements2); + if (typeof type5 === "object") { + extend(address5, type5); + } + this._offset += text2.length; + } else { + address5 = null; + } + if (address5) { + elements0.push(address5); + text0 += address5.textValue; + labelled0.stop = address5; + var address7 = null; + var slice8 = null; + if (this._input.length > this._offset) { + slice8 = this._input.substring(this._offset, this._offset + 1); + } else { + slice8 = null; + } + if (slice8 === "}") { + var klass6 = this.constructor.SyntaxNode; + var type6 = null; + address7 = new klass6("}", this._offset, []); + if (typeof type6 === "object") { + extend(address7, type6); + } + this._offset += 1; + } else { + address7 = null; + var slice9 = null; + if (this._input.length > this._offset) { + slice9 = this._input.substring(this._offset, this._offset + 1); + } else { + slice9 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"}\""}; + } + } + if (address7) { + elements0.push(address7); + text0 += address7.textValue; + } else { + elements0 = null; + this._offset = index2; + } + } else { + elements0 = null; + this._offset = index2; + } + } else { + elements0 = null; + this._offset = index2; + } + } else { + elements0 = null; + this._offset = index2; + } + } else { + elements0 = null; + this._offset = index2; + } + if (elements0) { + this._offset = index2; + var klass7 = this.constructor.SyntaxNode; + var type7 = find(this.constructor, "RepeatSpecFull"); + address0 = new klass7(text0, this._offset, elements0, labelled0); + if (typeof type7 === "object") { + extend(address0, type7); + } + this._offset += text0.length; + } else { + address0 = null; + } + if (address0) { + } else { + this._offset = index1; + var index5 = this._offset, elements3 = [], labelled1 = {}, text3 = ""; + var address8 = null; + var slice10 = null; + if (this._input.length > this._offset) { + slice10 = this._input.substring(this._offset, this._offset + 2); + } else { + slice10 = null; + } + if (slice10 === "{,") { + var klass8 = this.constructor.SyntaxNode; + var type8 = null; + address8 = new klass8("{,", this._offset, []); + if (typeof type8 === "object") { + extend(address8, type8); + } + this._offset += 2; + } else { + address8 = null; + var slice11 = null; + if (this._input.length > this._offset) { + slice11 = this._input.substring(this._offset, this._offset + 1); + } else { + slice11 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"{,\""}; + } + } + if (address8) { + elements3.push(address8); + text3 += address8.textValue; + var address9 = null; + var remaining2 = 1, index6 = this._offset, elements4 = [], text4 = "", address10 = true; + while (address10) { + var slice12 = null; + if (this._input.length > this._offset) { + slice12 = this._input.substring(this._offset, this._offset + 1); + } else { + slice12 = null; + } + if (slice12 && /^[0-9]/.test(slice12)) { + var klass9 = this.constructor.SyntaxNode; + var type9 = null; + address10 = new klass9(slice12, this._offset, []); + if (typeof type9 === "object") { + extend(address10, type9); + } + this._offset += 1; + } else { + address10 = null; + var slice13 = null; + if (this._input.length > this._offset) { + slice13 = this._input.substring(this._offset, this._offset + 1); + } else { + slice13 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[0-9]"}; + } + } + if (address10) { + elements4.push(address10); + text4 += address10.textValue; + remaining2 -= 1; + } + } + if (remaining2 <= 0) { + this._offset = index6; + var klass10 = this.constructor.SyntaxNode; + var type10 = null; + address9 = new klass10(text4, this._offset, elements4); + if (typeof type10 === "object") { + extend(address9, type10); + } + this._offset += text4.length; + } else { + address9 = null; + } + if (address9) { + elements3.push(address9); + text3 += address9.textValue; + labelled1.stop = address9; + var address11 = null; + var slice14 = null; + if (this._input.length > this._offset) { + slice14 = this._input.substring(this._offset, this._offset + 1); + } else { + slice14 = null; + } + if (slice14 === "}") { + var klass11 = this.constructor.SyntaxNode; + var type11 = null; + address11 = new klass11("}", this._offset, []); + if (typeof type11 === "object") { + extend(address11, type11); + } + this._offset += 1; + } else { + address11 = null; + var slice15 = null; + if (this._input.length > this._offset) { + slice15 = this._input.substring(this._offset, this._offset + 1); + } else { + slice15 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"}\""}; + } + } + if (address11) { + elements3.push(address11); + text3 += address11.textValue; + } else { + elements3 = null; + this._offset = index5; + } + } else { + elements3 = null; + this._offset = index5; + } + } else { + elements3 = null; + this._offset = index5; + } + if (elements3) { + this._offset = index5; + var klass12 = this.constructor.SyntaxNode; + var type12 = find(this.constructor, "RepeatSpecUpTo"); + address0 = new klass12(text3, this._offset, elements3, labelled1); + if (typeof type12 === "object") { + extend(address0, type12); + } + this._offset += text3.length; + } else { + address0 = null; + } + if (address0) { + } else { + this._offset = index1; + var index7 = this._offset, elements5 = [], labelled2 = {}, text5 = ""; + var address12 = null; + var slice16 = null; + if (this._input.length > this._offset) { + slice16 = this._input.substring(this._offset, this._offset + 1); + } else { + slice16 = null; + } + if (slice16 === "{") { + var klass13 = this.constructor.SyntaxNode; + var type13 = null; + address12 = new klass13("{", this._offset, []); + if (typeof type13 === "object") { + extend(address12, type13); + } + this._offset += 1; + } else { + address12 = null; + var slice17 = null; + if (this._input.length > this._offset) { + slice17 = this._input.substring(this._offset, this._offset + 1); + } else { + slice17 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"{\""}; + } + } + if (address12) { + elements5.push(address12); + text5 += address12.textValue; + var address13 = null; + var remaining3 = 1, index8 = this._offset, elements6 = [], text6 = "", address14 = true; + while (address14) { + var slice18 = null; + if (this._input.length > this._offset) { + slice18 = this._input.substring(this._offset, this._offset + 1); + } else { + slice18 = null; + } + if (slice18 && /^[0-9]/.test(slice18)) { + var klass14 = this.constructor.SyntaxNode; + var type14 = null; + address14 = new klass14(slice18, this._offset, []); + if (typeof type14 === "object") { + extend(address14, type14); + } + this._offset += 1; + } else { + address14 = null; + var slice19 = null; + if (this._input.length > this._offset) { + slice19 = this._input.substring(this._offset, this._offset + 1); + } else { + slice19 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[0-9]"}; + } + } + if (address14) { + elements6.push(address14); + text6 += address14.textValue; + remaining3 -= 1; + } + } + if (remaining3 <= 0) { + this._offset = index8; + var klass15 = this.constructor.SyntaxNode; + var type15 = null; + address13 = new klass15(text6, this._offset, elements6); + if (typeof type15 === "object") { + extend(address13, type15); + } + this._offset += text6.length; + } else { + address13 = null; + } + if (address13) { + elements5.push(address13); + text5 += address13.textValue; + labelled2.start = address13; + var address15 = null; + var slice20 = null; + if (this._input.length > this._offset) { + slice20 = this._input.substring(this._offset, this._offset + 2); + } else { + slice20 = null; + } + if (slice20 === ",}") { + var klass16 = this.constructor.SyntaxNode; + var type16 = null; + address15 = new klass16(",}", this._offset, []); + if (typeof type16 === "object") { + extend(address15, type16); + } + this._offset += 2; + } else { + address15 = null; + var slice21 = null; + if (this._input.length > this._offset) { + slice21 = this._input.substring(this._offset, this._offset + 1); + } else { + slice21 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\",}\""}; + } + } + if (address15) { + elements5.push(address15); + text5 += address15.textValue; + } else { + elements5 = null; + this._offset = index7; + } + } else { + elements5 = null; + this._offset = index7; + } + } else { + elements5 = null; + this._offset = index7; + } + if (elements5) { + this._offset = index7; + var klass17 = this.constructor.SyntaxNode; + var type17 = find(this.constructor, "RepeatSpecAtLeast"); + address0 = new klass17(text5, this._offset, elements5, labelled2); + if (typeof type17 === "object") { + extend(address0, type17); + } + this._offset += text5.length; + } else { + address0 = null; + } + if (address0) { + } else { + this._offset = index1; + var index9 = this._offset, elements7 = [], labelled3 = {}, text7 = ""; + var address16 = null; + var slice22 = null; + if (this._input.length > this._offset) { + slice22 = this._input.substring(this._offset, this._offset + 1); + } else { + slice22 = null; + } + if (slice22 === "{") { + var klass18 = this.constructor.SyntaxNode; + var type18 = null; + address16 = new klass18("{", this._offset, []); + if (typeof type18 === "object") { + extend(address16, type18); + } + this._offset += 1; + } else { + address16 = null; + var slice23 = null; + if (this._input.length > this._offset) { + slice23 = this._input.substring(this._offset, this._offset + 1); + } else { + slice23 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"{\""}; + } + } + if (address16) { + elements7.push(address16); + text7 += address16.textValue; + var address17 = null; + var remaining4 = 1, index10 = this._offset, elements8 = [], text8 = "", address18 = true; + while (address18) { + var slice24 = null; + if (this._input.length > this._offset) { + slice24 = this._input.substring(this._offset, this._offset + 1); + } else { + slice24 = null; + } + if (slice24 && /^[0-9]/.test(slice24)) { + var klass19 = this.constructor.SyntaxNode; + var type19 = null; + address18 = new klass19(slice24, this._offset, []); + if (typeof type19 === "object") { + extend(address18, type19); + } + this._offset += 1; + } else { + address18 = null; + var slice25 = null; + if (this._input.length > this._offset) { + slice25 = this._input.substring(this._offset, this._offset + 1); + } else { + slice25 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[0-9]"}; + } + } + if (address18) { + elements8.push(address18); + text8 += address18.textValue; + remaining4 -= 1; + } + } + if (remaining4 <= 0) { + this._offset = index10; + var klass20 = this.constructor.SyntaxNode; + var type20 = null; + address17 = new klass20(text8, this._offset, elements8); + if (typeof type20 === "object") { + extend(address17, type20); + } + this._offset += text8.length; + } else { + address17 = null; + } + if (address17) { + elements7.push(address17); + text7 += address17.textValue; + labelled3.value = address17; + var address19 = null; + var slice26 = null; + if (this._input.length > this._offset) { + slice26 = this._input.substring(this._offset, this._offset + 1); + } else { + slice26 = null; + } + if (slice26 === "}") { + var klass21 = this.constructor.SyntaxNode; + var type21 = null; + address19 = new klass21("}", this._offset, []); + if (typeof type21 === "object") { + extend(address19, type21); + } + this._offset += 1; + } else { + address19 = null; + var slice27 = null; + if (this._input.length > this._offset) { + slice27 = this._input.substring(this._offset, this._offset + 1); + } else { + slice27 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"}\""}; + } + } + if (address19) { + elements7.push(address19); + text7 += address19.textValue; + } else { + elements7 = null; + this._offset = index9; + } + } else { + elements7 = null; + this._offset = index9; + } + } else { + elements7 = null; + this._offset = index9; + } + if (elements7) { + this._offset = index9; + var klass22 = this.constructor.SyntaxNode; + var type22 = find(this.constructor, "RepeatSpecExact"); + address0 = new klass22(text7, this._offset, elements7, labelled3); + if (typeof type22 === "object") { + extend(address0, type22); + } + this._offset += text7.length; + } else { + address0 = null; + } + if (address0) { + } else { + this._offset = index1; + } + } + } + } + return this._nodeCache["repeat_spec"][index0] = address0; + }, + __consume__repeat_greedy_flag: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["repeat_greedy_flag"] = this._nodeCache["repeat_greedy_flag"] || {}; + var cached = this._nodeCache["repeat_greedy_flag"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "?") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address0 = new klass0("?", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"?\""}; + } + } + return this._nodeCache["repeat_greedy_flag"][index0] = address0; + }, + __consume__subexp: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["subexp"] = this._nodeCache["subexp"] || {}; + var cached = this._nodeCache["subexp"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "(") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("(", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"(\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var index2 = this._offset; + var index3 = this._offset; + address2 = this.__consume__subexp_no_capture(); + if (address2) { + } else { + this._offset = index3; + address2 = this.__consume__subexp_positive_lookahead(); + if (address2) { + } else { + this._offset = index3; + address2 = this.__consume__subexp_negative_lookahead(); + if (address2) { + } else { + this._offset = index3; + } + } + } + if (address2) { + } else { + this._offset = index2; + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1("", this._offset, []); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += 0; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.flag = address2; + var address3 = null; + address3 = this.__consume__regexp(); + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + labelled0.regexp = address3; + var address4 = null; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === ")") { + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address4 = new klass2(")", this._offset, []); + if (typeof type2 === "object") { + extend(address4, type2); + } + this._offset += 1; + } else { + address4 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\")\""}; + } + } + if (address4) { + elements0.push(address4); + text0 += address4.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = find(this.constructor, "Subexp"); + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["subexp"][index0] = address0; + }, + __consume__subexp_no_capture: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["subexp_no_capture"] = this._nodeCache["subexp_no_capture"] || {}; + var cached = this._nodeCache["subexp_no_capture"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 2); + } else { + slice0 = null; + } + if (slice0 === "?:") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "SubexpNoCapture"); + address0 = new klass0("?:", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 2; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"?:\""}; + } + } + return this._nodeCache["subexp_no_capture"][index0] = address0; + }, + __consume__subexp_positive_lookahead: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["subexp_positive_lookahead"] = this._nodeCache["subexp_positive_lookahead"] || {}; + var cached = this._nodeCache["subexp_positive_lookahead"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 2); + } else { + slice0 = null; + } + if (slice0 === "?=") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "SubexpPositiveLookahead"); + address0 = new klass0("?=", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 2; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"?=\""}; + } + } + return this._nodeCache["subexp_positive_lookahead"][index0] = address0; + }, + __consume__subexp_negative_lookahead: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["subexp_negative_lookahead"] = this._nodeCache["subexp_negative_lookahead"] || {}; + var cached = this._nodeCache["subexp_negative_lookahead"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 2); + } else { + slice0 = null; + } + if (slice0 === "?!") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "SubexpNegativeLookahead"); + address0 = new klass0("?!", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 2; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"?!\""}; + } + } + return this._nodeCache["subexp_negative_lookahead"][index0] = address0; + }, + __consume__charset: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["charset"] = this._nodeCache["charset"] || {}; + var cached = this._nodeCache["charset"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "[") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("[", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"[\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var index2 = this._offset; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === "^") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1("^", this._offset, []); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += 1; + } else { + address2 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"^\""}; + } + } + if (address2) { + } else { + this._offset = index2; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2("", this._offset, []); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += 0; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.invert = address2; + var address3 = null; + var remaining0 = 0, index3 = this._offset, elements1 = [], text1 = "", address4 = true; + while (address4) { + var index4 = this._offset; + address4 = this.__consume__charset_range(); + if (address4) { + } else { + this._offset = index4; + address4 = this.__consume__charset_terminal(); + if (address4) { + } else { + this._offset = index4; + } + } + if (address4) { + elements1.push(address4); + text1 += address4.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index3; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address3 = new klass3(text1, this._offset, elements1); + if (typeof type3 === "object") { + extend(address3, type3); + } + this._offset += text1.length; + } else { + address3 = null; + } + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + labelled0.match_spec = address3; + var address5 = null; + var slice4 = null; + if (this._input.length > this._offset) { + slice4 = this._input.substring(this._offset, this._offset + 1); + } else { + slice4 = null; + } + if (slice4 === "]") { + var klass4 = this.constructor.SyntaxNode; + var type4 = null; + address5 = new klass4("]", this._offset, []); + if (typeof type4 === "object") { + extend(address5, type4); + } + this._offset += 1; + } else { + address5 = null; + var slice5 = null; + if (this._input.length > this._offset) { + slice5 = this._input.substring(this._offset, this._offset + 1); + } else { + slice5 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"]\""}; + } + } + if (address5) { + elements0.push(address5); + text0 += address5.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass5 = this.constructor.SyntaxNode; + var type5 = find(this.constructor, "Charset"); + address0 = new klass5(text0, this._offset, elements0, labelled0); + if (typeof type5 === "object") { + extend(address0, type5); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["charset"][index0] = address0; + }, + __consume__charset_range: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["charset_range"] = this._nodeCache["charset_range"] || {}; + var cached = this._nodeCache["charset_range"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + address1 = this.__consume__charset_terminal(); + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.start = address1; + var address2 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "-") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address2 = new klass0("-", this._offset, []); + if (typeof type0 === "object") { + extend(address2, type0); + } + this._offset += 1; + } else { + address2 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"-\""}; + } + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + var address3 = null; + address3 = this.__consume__charset_terminal(); + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + labelled0.stop = address3; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass1 = this.constructor.SyntaxNode; + var type1 = find(this.constructor, "CharsetRange"); + address0 = new klass1(text0, this._offset, elements0, labelled0); + if (typeof type1 === "object") { + extend(address0, type1); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["charset_range"][index0] = address0; + }, + __consume__charset_terminal: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["charset_terminal"] = this._nodeCache["charset_terminal"] || {}; + var cached = this._nodeCache["charset_terminal"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset; + address0 = this.__consume__charset_escaped_character(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__charset_literal(); + if (address0) { + } else { + this._offset = index1; + } + } + return this._nodeCache["charset_terminal"][index0] = address0; + }, + __consume__charset_literal: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["charset_literal"] = this._nodeCache["charset_literal"] || {}; + var cached = this._nodeCache["charset_literal"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 && /^[^\\\]]/.test(slice0)) { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "Literal"); + address0 = new klass0(slice0, this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[^\\\\\\]]"}; + } + } + return this._nodeCache["charset_literal"][index0] = address0; + }, + __consume__charset_escaped_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["charset_escaped_character"] = this._nodeCache["charset_escaped_character"] || {}; + var cached = this._nodeCache["charset_escaped_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "\\") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("\\", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"\\\\\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var index2 = this._offset; + address2 = this.__consume__backspace_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__control_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__digit_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__non_digit_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__form_feed_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__line_feed_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__carriage_return_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__white_space_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__non_white_space_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__tab_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__vertical_tab_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__word_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__non_word_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__octal_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__hex_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__unicode_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__null_character(); + if (address2) { + } else { + this._offset = index2; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + var temp0 = slice2; + if (temp0 === null) { + address2 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: ""}; + } + } else { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1(temp0, this._offset, []); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += 1; + } + if (address2) { + } else { + this._offset = index2; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.escape = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass2 = this.constructor.SyntaxNode; + var type2 = find(this.constructor, "EscapedCharacter"); + address0 = new klass2(text0, this._offset, elements0, labelled0); + if (typeof type2 === "object") { + extend(address0, type2); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["charset_escaped_character"][index0] = address0; + }, + __consume__terminal: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["terminal"] = this._nodeCache["terminal"] || {}; + var cached = this._nodeCache["terminal"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset; + address0 = this.__consume__any_character(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__escaped_character(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__literal(); + if (address0) { + } else { + this._offset = index1; + } + } + } + return this._nodeCache["terminal"][index0] = address0; + }, + __consume__any_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["any_character"] = this._nodeCache["any_character"] || {}; + var cached = this._nodeCache["any_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === ".") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "AnyCharacter"); + address0 = new klass0(".", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\".\""}; + } + } + return this._nodeCache["any_character"][index0] = address0; + }, + __consume__literal: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["literal"] = this._nodeCache["literal"] || {}; + var cached = this._nodeCache["literal"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 && /^[^|\\/.\[\(\)?+*$^]/.test(slice0)) { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "Literal"); + address0 = new klass0(slice0, this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[^|\\\\/.\\[\\(\\)?+*$^]"}; + } + } + return this._nodeCache["literal"][index0] = address0; + }, + __consume__escaped_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["escaped_character"] = this._nodeCache["escaped_character"] || {}; + var cached = this._nodeCache["escaped_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "\\") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("\\", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"\\\\\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var index2 = this._offset; + address2 = this.__consume__word_boundary_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__non_word_boundary_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__control_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__digit_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__non_digit_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__form_feed_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__line_feed_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__carriage_return_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__white_space_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__non_white_space_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__tab_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__vertical_tab_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__word_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__non_word_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__back_reference(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__octal_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__hex_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__unicode_character(); + if (address2) { + } else { + this._offset = index2; + address2 = this.__consume__null_character(); + if (address2) { + } else { + this._offset = index2; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + var temp0 = slice2; + if (temp0 === null) { + address2 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: ""}; + } + } else { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1(temp0, this._offset, []); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += 1; + } + if (address2) { + } else { + this._offset = index2; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.escape = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass2 = this.constructor.SyntaxNode; + var type2 = find(this.constructor, "EscapedCharacter"); + address0 = new klass2(text0, this._offset, elements0, labelled0); + if (typeof type2 === "object") { + extend(address0, type2); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["escaped_character"][index0] = address0; + }, + __consume__backspace_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["backspace_character"] = this._nodeCache["backspace_character"] || {}; + var cached = this._nodeCache["backspace_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "b") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "BackspaceCharacter"); + address0 = new klass0("b", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"b\""}; + } + } + return this._nodeCache["backspace_character"][index0] = address0; + }, + __consume__word_boundary_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["word_boundary_character"] = this._nodeCache["word_boundary_character"] || {}; + var cached = this._nodeCache["word_boundary_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "b") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "WordBoundaryCharacter"); + address0 = new klass0("b", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"b\""}; + } + } + return this._nodeCache["word_boundary_character"][index0] = address0; + }, + __consume__non_word_boundary_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["non_word_boundary_character"] = this._nodeCache["non_word_boundary_character"] || {}; + var cached = this._nodeCache["non_word_boundary_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "B") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "NonWordBoundaryCharacter"); + address0 = new klass0("B", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"B\""}; + } + } + return this._nodeCache["non_word_boundary_character"][index0] = address0; + }, + __consume__digit_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["digit_character"] = this._nodeCache["digit_character"] || {}; + var cached = this._nodeCache["digit_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "d") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "DigitCharacter"); + address0 = new klass0("d", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"d\""}; + } + } + return this._nodeCache["digit_character"][index0] = address0; + }, + __consume__non_digit_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["non_digit_character"] = this._nodeCache["non_digit_character"] || {}; + var cached = this._nodeCache["non_digit_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "D") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "NonDigitCharacter"); + address0 = new klass0("D", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"D\""}; + } + } + return this._nodeCache["non_digit_character"][index0] = address0; + }, + __consume__form_feed_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["form_feed_character"] = this._nodeCache["form_feed_character"] || {}; + var cached = this._nodeCache["form_feed_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "f") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "FormFeedCharacter"); + address0 = new klass0("f", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"f\""}; + } + } + return this._nodeCache["form_feed_character"][index0] = address0; + }, + __consume__line_feed_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["line_feed_character"] = this._nodeCache["line_feed_character"] || {}; + var cached = this._nodeCache["line_feed_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "n") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "LineFeedCharacter"); + address0 = new klass0("n", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"n\""}; + } + } + return this._nodeCache["line_feed_character"][index0] = address0; + }, + __consume__carriage_return_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["carriage_return_character"] = this._nodeCache["carriage_return_character"] || {}; + var cached = this._nodeCache["carriage_return_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "r") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "CarriageReturnCharacter"); + address0 = new klass0("r", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"r\""}; + } + } + return this._nodeCache["carriage_return_character"][index0] = address0; + }, + __consume__white_space_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["white_space_character"] = this._nodeCache["white_space_character"] || {}; + var cached = this._nodeCache["white_space_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "s") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "WhiteSpaceCharacter"); + address0 = new klass0("s", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"s\""}; + } + } + return this._nodeCache["white_space_character"][index0] = address0; + }, + __consume__non_white_space_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["non_white_space_character"] = this._nodeCache["non_white_space_character"] || {}; + var cached = this._nodeCache["non_white_space_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "S") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "NonWhiteSpaceCharacter"); + address0 = new klass0("S", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"S\""}; + } + } + return this._nodeCache["non_white_space_character"][index0] = address0; + }, + __consume__tab_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["tab_character"] = this._nodeCache["tab_character"] || {}; + var cached = this._nodeCache["tab_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "t") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "TabCharacter"); + address0 = new klass0("t", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"t\""}; + } + } + return this._nodeCache["tab_character"][index0] = address0; + }, + __consume__vertical_tab_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["vertical_tab_character"] = this._nodeCache["vertical_tab_character"] || {}; + var cached = this._nodeCache["vertical_tab_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "v") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "VerticalTabCharacter"); + address0 = new klass0("v", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"v\""}; + } + } + return this._nodeCache["vertical_tab_character"][index0] = address0; + }, + __consume__word_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["word_character"] = this._nodeCache["word_character"] || {}; + var cached = this._nodeCache["word_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "w") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "WordCharacter"); + address0 = new klass0("w", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"w\""}; + } + } + return this._nodeCache["word_character"][index0] = address0; + }, + __consume__non_word_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["non_word_character"] = this._nodeCache["non_word_character"] || {}; + var cached = this._nodeCache["non_word_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "W") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "NonWordCharacter"); + address0 = new klass0("W", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"W\""}; + } + } + return this._nodeCache["non_word_character"][index0] = address0; + }, + __consume__control_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["control_character"] = this._nodeCache["control_character"] || {}; + var cached = this._nodeCache["control_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "c") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("c", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"c\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + var temp0 = slice2; + if (temp0 === null) { + address2 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: ""}; + } + } else { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1(temp0, this._offset, []); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += 1; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.code = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass2 = this.constructor.SyntaxNode; + var type2 = find(this.constructor, "ControlCharacter"); + address0 = new klass2(text0, this._offset, elements0, labelled0); + if (typeof type2 === "object") { + extend(address0, type2); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["control_character"][index0] = address0; + }, + __consume__back_reference: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["back_reference"] = this._nodeCache["back_reference"] || {}; + var cached = this._nodeCache["back_reference"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 && /^[1-9]/.test(slice0)) { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "BackReference"); + address0 = new klass0(slice0, this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[1-9]"}; + } + } + return this._nodeCache["back_reference"][index0] = address0; + }, + __consume__octal_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["octal_character"] = this._nodeCache["octal_character"] || {}; + var cached = this._nodeCache["octal_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "0") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("0", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"0\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var remaining0 = 1, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 && /^[0-7]/.test(slice2)) { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1(slice2, this._offset, []); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += 1; + } else { + address3 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[0-7]"}; + } + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2(text1, this._offset, elements1); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.code = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = find(this.constructor, "OctalCharacter"); + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["octal_character"][index0] = address0; + }, + __consume__hex_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["hex_character"] = this._nodeCache["hex_character"] || {}; + var cached = this._nodeCache["hex_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "x") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("x", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"x\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var remaining0 = 1, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 && /^[0-9a-fA-F]/.test(slice2)) { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1(slice2, this._offset, []); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += 1; + } else { + address3 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[0-9a-fA-F]"}; + } + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2(text1, this._offset, elements1); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.code = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = find(this.constructor, "HexCharacter"); + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["hex_character"][index0] = address0; + }, + __consume__unicode_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["unicode_character"] = this._nodeCache["unicode_character"] || {}; + var cached = this._nodeCache["unicode_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "u") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("u", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"u\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var remaining0 = 1, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 && /^[0-9a-fA-F]/.test(slice2)) { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1(slice2, this._offset, []); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += 1; + } else { + address3 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[0-9a-fA-F]"}; + } + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2(text1, this._offset, elements1); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.code = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = find(this.constructor, "UnicodeCharacter"); + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["unicode_character"][index0] = address0; + }, + __consume__null_character: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["null_character"] = this._nodeCache["null_character"] || {}; + var cached = this._nodeCache["null_character"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "0") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "NullCharacter"); + address0 = new klass0("0", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"0\""}; + } + } + return this._nodeCache["null_character"][index0] = address0; + } + }; + + var Parser = function(input) { + this._input = input; + this._offset = 0; + this._nodeCache = {}; + }; + + Parser.prototype.parse = function() { + var result = this.__consume__root(); + if (result && this._offset === this._input.length) { + return result; + } + if (!(this.error)) { + this.error = {input: this._input, offset: this._offset, expected: ""}; + } + var message = formatError(this.error); + var error = new Error(message); + throw error; + }; + + Parser.parse = function(input) { + var parser = new Parser(input); + return parser.parse(); + }; + + extend(Parser.prototype, Grammar); + + var SyntaxNode = function(textValue, offset, elements, properties) { + this.textValue = textValue; + this.offset = offset; + this.elements = elements || []; + if (!properties) return; + for (var key in properties) this[key] = properties[key]; + }; + + SyntaxNode.prototype.forEach = function(block, context) { + for (var i = 0, n = this.elements.length; i < n; i++) { + block.call(context, this.elements[i], i); + } + }; + + Parser.SyntaxNode = SyntaxNode; + + if (typeof require === "function" && typeof exports === "object") { + exports.Grammar = Grammar; + exports.Parser = Parser; + exports.parse = Parser.parse; + + } else { + var namespace = this; + Regexper = Grammar; + RegexperParser = Parser; + RegexperParser.formatError = formatError; + } +})(); + diff --git a/app/assets/javascripts/regexpGrammer.peg b/app/assets/javascripts/regexpGrammer.peg new file mode 100644 index 0000000..4dc8122 --- /dev/null +++ b/app/assets/javascripts/regexpGrammer.peg @@ -0,0 +1,92 @@ +grammar Regexper + root <- regexp_literal / regexp + + regexp_literal <- "/" regexp "/" flags:[igm]* + + regexp <- match:(match) alternate:("|" regexp)? + + anchor_start <- "^" + + anchor_end <- "$" + + match <- anchor_start:anchor_start? (!repetition_count) match:(repetition / subexp / charset / terminal )* anchor_end:anchor_end? + + repetition <- match:(subexp / charset / terminal) repetition_count + + repetition_count <- repeat:(repeat_any / repeat_required / repeat_optional / repeat_spec) greedy:repeat_greedy_flag? + + repeat_any <- "*" + + repeat_required <- "+" + + repeat_optional <- "?" + + repeat_spec <- "{" start:([0-9]+) "," stop:([0-9]+) "}" / "{," stop:([0-9]+) "}" / "{" start:([0-9]+) ",}" / "{" value:([0-9]+) "}" + + repeat_greedy_flag <- "?" + + subexp <- "(" flag:(subexp_no_capture / subexp_positive_lookahead / subexp_negative_lookahead)? regexp ")" + + subexp_no_capture <- "?:" + + subexp_positive_lookahead <- "?=" + + subexp_negative_lookahead <- "?!" + + charset <- "[" invert:"^"? match_spec:(charset_range / charset_terminal)* "]" + + charset_range <- start:charset_terminal "-" stop:charset_terminal + + charset_terminal <- charset_escaped_character / charset_literal + + charset_literal <- [^\\\]] + + charset_escaped_character <- "\\" escape:( backspace_character / control_character / digit_character / non_digit_character / form_feed_character / line_feed_character / carriage_return_character / white_space_character / non_white_space_character / tab_character / vertical_tab_character / word_character / non_word_character / octal_character / hex_character / unicode_character / null_character / . ) + + terminal <- any_character / escaped_character / literal + + any_character <- "." + + literal <- [^|\\/.\[\(\)?+*$^] + + escaped_character <- "\\" escape:( word_boundary_character / non_word_boundary_character / control_character / digit_character / non_digit_character / form_feed_character / line_feed_character / carriage_return_character / white_space_character / non_white_space_character / tab_character / vertical_tab_character / word_character / non_word_character / back_reference / octal_character / hex_character / unicode_character / null_character / . ) + + backspace_character <- "b" + + word_boundary_character <- "b" + + non_word_boundary_character <- "B" + + digit_character <- "d" + + non_digit_character <- "D" + + form_feed_character <- "f" + + line_feed_character <- "n" + + carriage_return_character <- "r" + + white_space_character <- "s" + + non_white_space_character <- "S" + + tab_character <- "t" + + vertical_tab_character <- "v" + + word_character <- "w" + + non_word_character <- "W" + + control_character <- "c" code:(.) + + back_reference <- [1-9] + + octal_character <- "0" code:([0-7]+) + + hex_character <- "x" code:([0-9a-fA-F]+) + + unicode_character <- "u" code:([0-9a-fA-F]+) + + null_character <- "0" diff --git a/app/public/humans.txt b/app/public/humans.txt new file mode 100755 index 0000000..43db87c --- /dev/null +++ b/app/public/humans.txt @@ -0,0 +1,17 @@ +# humanstxt.org/ +# The humans responsible & technology colophon + +# TEAM + + Creator: Jeff Avallone + Site: http://github.com/javallone + Twitter: @javallone + +# THANKS + + strfriend.com for the idea, whatever happened to you? + +# TECHNOLOGY COLOPHON + + HTML5, CSS3, SVG, RaphaelJS + Ruby, Rack, Treetop diff --git a/app/public/index.html b/app/public/index.html new file mode 100644 index 0000000..eb5fcf1 --- /dev/null +++ b/app/public/index.html @@ -0,0 +1,88 @@ + + + + + + + + Regexper + + + + + + + + + + + + + + + + +
+

Regexper

+ + You thought you only had two problems... +
+ +
+
+
+ + + + +
+
+
+
+
+ Loading +
+ + +
+
+
+ + + + + Fork me on GitHub + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/public/robots.txt b/app/public/robots.txt new file mode 100755 index 0000000..ee2cc21 --- /dev/null +++ b/app/public/robots.txt @@ -0,0 +1,3 @@ +# robotstxt.org/ + +User-agent: * diff --git a/app/public/test.html b/app/public/test.html new file mode 100644 index 0000000..bec246a --- /dev/null +++ b/app/public/test.html @@ -0,0 +1,28 @@ + +Testing Canopy + +

Testing Canpoy

+ + + + + + + + diff --git a/node_modules/.bin/canopy b/node_modules/.bin/canopy new file mode 120000 index 0000000..ab55386 --- /dev/null +++ b/node_modules/.bin/canopy @@ -0,0 +1 @@ +../canopy/bin/canopy \ No newline at end of file diff --git a/node_modules/canopy/LICENSE.txt b/node_modules/canopy/LICENSE.txt new file mode 100644 index 0000000..b708d01 --- /dev/null +++ b/node_modules/canopy/LICENSE.txt @@ -0,0 +1,24 @@ +Canopy -- a JavaScript parser compiler +====================================== + +http://github.com/jcoglan/canopy + +Copyright (c) 2010-2012 James Coglan + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the 'Software'), to deal in +the Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/canopy/README.markdown b/node_modules/canopy/README.markdown new file mode 100644 index 0000000..5b92d76 --- /dev/null +++ b/node_modules/canopy/README.markdown @@ -0,0 +1,34 @@ +# Canopy + +Canopy is a parser compiler for JavaScript, based on [Parsing Expression +Grammars][1] and heavily influenced by [Treetop][2]. + +[1]: http://en.wikipedia.org/wiki/Parsing_expression_grammar +[2]: http://treetop.rubyforge.org/ + +For usage documentation see [canopy.jcoglan.com](http://canopy.jcoglan.com). + + +## Building and testing Canopy + + git clone git://github.com/jcoglan/canopy.git + cd canopy + gem install jake + npm install + jake + npm test + +Canopy should work on a wide range of JavaScript runtimes, for example: + + v8 spec/console.js + rhino spec/console.js + +It should also run in all major web browsers: + + open spec/browser.html + + +## License + +See `LICENSE.txt`. + diff --git a/node_modules/canopy/bin/canopy b/node_modules/canopy/bin/canopy new file mode 100755 index 0000000..1c58c61 --- /dev/null +++ b/node_modules/canopy/bin/canopy @@ -0,0 +1,22 @@ +#!/usr/bin/env node + +var Canopy = require('../lib/canopy'), + fs = require('fs'); + +try { + var startTime = new Date().getTime(), + inputFile = process.argv[2], + outputFile = inputFile.replace(/\.peg$/, '.js'), + + grammar = fs.readFileSync(inputFile).toString(), + parser = Canopy.compile(grammar), + endTime = new Date().getTime(); + + fs.writeFileSync(outputFile, parser); + console.log('Generated parser in ' + outputFile); + console.log('Completed in ' + ((endTime - startTime) / 1000) + 's'); + +} catch (e) { + console.error(e.message); +} + diff --git a/node_modules/canopy/lib/canopy-min.js b/node_modules/canopy/lib/canopy-min.js new file mode 100644 index 0000000..dae13a1 --- /dev/null +++ b/node_modules/canopy/lib/canopy-min.js @@ -0,0 +1,2 @@ +var Canopy={};Canopy.extend=function(b,a){if(!b||!a)return b;for(var d in a){if(b[d]!==a[d])b[d]=a[d]}return b};Canopy.extend(Canopy,{compile:function(b){var a=new this.Compiler(b),d=a.toSource();eval(d);return d},find:function(b,a){var d=a.split('.'),f;while(f=d.shift()){b=b[f];if(b===undefined)throw new Error('Cannot find object named '+a);}return b},forEach:function(b,a,d){for(var f=0,e=b.length;fthis._offset){i=this._input.substring(this._offset,this._offset+8)}else{i=null}if(i==="grammar "){var q=this.constructor.SyntaxNode;var r=null;g=new q("grammar ",this._offset,[]);if(typeof r==="object"){l(g,r)}this._offset+=8}else{g=null;var m=null;if(this._input.length>this._offset){m=this._input.substring(this._offset,this._offset+1)}else{m=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"grammar \""}}}if(g){c.push(g);h+=g.textValue;var j=null;j=this.__consume__object_identifier();if(j){c.push(j);h+=j.textValue;k.object_identifier=j}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var o=this.constructor.SyntaxNode;var t=null;a=new o(h,this._offset,c,k);if(typeof t==="object"){l(a,t)}this._offset+=h.length}else{a=null}return this._nodeCache["grammar_name"][d]=a},__consume__grammar_rule:function(b){var a=null,d=this._offset;this._nodeCache["grammar_rule"]=this._nodeCache["grammar_rule"]||{};var f=this._nodeCache["grammar_rule"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;g=this.__consume__identifier();if(g){c.push(g);h+=g.textValue;k.identifier=g;var i=null;i=this.__consume__assignment();if(i){c.push(i);h+=i.textValue;k.assignment=i;var q=null;q=this.__consume__parsing_expression();if(q){c.push(q);h+=q.textValue;k.parsing_expression=q}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var r=this.constructor.SyntaxNode;var m=S(this.constructor,"GrammarRule");a=new r(h,this._offset,c,k);if(typeof m==="object"){l(a,m)}this._offset+=h.length}else{a=null}return this._nodeCache["grammar_rule"][d]=a},__consume__assignment:function(b){var a=null,d=this._offset;this._nodeCache["assignment"]=this._nodeCache["assignment"]||{};var f=this._nodeCache["assignment"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=1,q=this._offset,r=[],m="",j=true;while(j){j=this.__consume__space();if(j){r.push(j);m+=j.textValue;i-=1}}if(i<=0){this._offset=q;var o=this.constructor.SyntaxNode;var t=null;g=new o(m,this._offset,r);if(typeof t==="object"){l(g,t)}this._offset+=m.length}else{g=null}if(g){c.push(g);h+=g.textValue;var p=null;var v=null;if(this._input.length>this._offset){v=this._input.substring(this._offset,this._offset+2)}else{v=null}if(v==="<-"){var n=this.constructor.SyntaxNode;var w=null;p=new n("<-",this._offset,[]);if(typeof w==="object"){l(p,w)}this._offset+=2}else{p=null;var y=null;if(this._input.length>this._offset){y=this._input.substring(this._offset,this._offset+1)}else{y=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"<-\""}}}if(p){c.push(p);h+=p.textValue;var u=null;var A=1,B=this._offset,s=[],E="",x=true;while(x){x=this.__consume__space();if(x){s.push(x);E+=x.textValue;A-=1}}if(A<=0){this._offset=B;var z=this.constructor.SyntaxNode;var F=null;u=new z(E,this._offset,s);if(typeof F==="object"){l(u,F)}this._offset+=E.length}else{u=null}if(u){c.push(u);h+=u.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var C=this.constructor.SyntaxNode;var D=null;a=new C(h,this._offset,c,k);if(typeof D==="object"){l(a,D)}this._offset+=h.length}else{a=null}return this._nodeCache["assignment"][d]=a},__consume__parsing_expression:function(b){var a=null,d=this._offset;this._nodeCache["parsing_expression"]=this._nodeCache["parsing_expression"]||{};var f=this._nodeCache["parsing_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset;a=this.__consume__choice_expression();if(a){}else{this._offset=e;a=this.__consume__choice_part();if(a){}else{this._offset=e}}return this._nodeCache["parsing_expression"][d]=a},__consume__parenthesised_expression:function(b){var a=null,d=this._offset;this._nodeCache["parenthesised_expression"]=this._nodeCache["parenthesised_expression"]||{};var f=this._nodeCache["parenthesised_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=null;if(this._input.length>this._offset){i=this._input.substring(this._offset,this._offset+1)}else{i=null}if(i==="("){var q=this.constructor.SyntaxNode;var r=null;g=new q("(",this._offset,[]);if(typeof r==="object"){l(g,r)}this._offset+=1}else{g=null;var m=null;if(this._input.length>this._offset){m=this._input.substring(this._offset,this._offset+1)}else{m=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"(\""}}}if(g){c.push(g);h+=g.textValue;var j=null;var o=0,t=this._offset,p=[],v="",n=true;while(n){n=this.__consume__space();if(n){p.push(n);v+=n.textValue;o-=1}}if(o<=0){this._offset=t;var w=this.constructor.SyntaxNode;var y=null;j=new w(v,this._offset,p);if(typeof y==="object"){l(j,y)}this._offset+=v.length}else{j=null}if(j){c.push(j);h+=j.textValue;var u=null;u=this.__consume__parsing_expression();if(u){c.push(u);h+=u.textValue;k.parsing_expression=u;var A=null;var B=0,s=this._offset,E=[],x="",z=true;while(z){z=this.__consume__space();if(z){E.push(z);x+=z.textValue;B-=1}}if(B<=0){this._offset=s;var F=this.constructor.SyntaxNode;var C=null;A=new F(x,this._offset,E);if(typeof C==="object"){l(A,C)}this._offset+=x.length}else{A=null}if(A){c.push(A);h+=A.textValue;var D=null;var I=null;if(this._input.length>this._offset){I=this._input.substring(this._offset,this._offset+1)}else{I=null}if(I===")"){var G=this.constructor.SyntaxNode;var L=null;D=new G(")",this._offset,[]);if(typeof L==="object"){l(D,L)}this._offset+=1}else{D=null;var Q=null;if(this._input.length>this._offset){Q=this._input.substring(this._offset,this._offset+1)}else{Q=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\")\""}}}if(D){c.push(D);h+=D.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var M=this.constructor.SyntaxNode;var N=null;a=new M(h,this._offset,c,k);if(typeof N==="object"){l(a,N)}this._offset+=h.length}else{a=null}return this._nodeCache["parenthesised_expression"][d]=a},__consume__choice_expression:function(b){var a=null,d=this._offset;this._nodeCache["choice_expression"]=this._nodeCache["choice_expression"]||{};var f=this._nodeCache["choice_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;g=this.__consume__choice_part();if(g){c.push(g);h+=g.textValue;k.first_part=g;var i=null;var q=1,r=this._offset,m=[],j="",o=true;while(o){var t=this._offset,p=[],v={},n="";var w=null;var y=1,u=this._offset,A=[],B="",s=true;while(s){s=this.__consume__space();if(s){A.push(s);B+=s.textValue;y-=1}}if(y<=0){this._offset=u;var E=this.constructor.SyntaxNode;var x=null;w=new E(B,this._offset,A);if(typeof x==="object"){l(w,x)}this._offset+=B.length}else{w=null}if(w){p.push(w);n+=w.textValue;var z=null;var F=null;if(this._input.length>this._offset){F=this._input.substring(this._offset,this._offset+1)}else{F=null}if(F==="/"){var C=this.constructor.SyntaxNode;var D=null;z=new C("/",this._offset,[]);if(typeof D==="object"){l(z,D)}this._offset+=1}else{z=null;var I=null;if(this._input.length>this._offset){I=this._input.substring(this._offset,this._offset+1)}else{I=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"/\""}}}if(z){p.push(z);n+=z.textValue;var G=null;var L=1,Q=this._offset,M=[],N="",H=true;while(H){H=this.__consume__space();if(H){M.push(H);N+=H.textValue;L-=1}}if(L<=0){this._offset=Q;var V=this.constructor.SyntaxNode;var R=null;G=new V(N,this._offset,M);if(typeof R==="object"){l(G,R)}this._offset+=N.length}else{G=null}if(G){p.push(G);n+=G.textValue;var J=null;J=this.__consume__choice_part();if(J){p.push(J);n+=J.textValue;v.expression=J}else{p=null;this._offset=t}}else{p=null;this._offset=t}}else{p=null;this._offset=t}}else{p=null;this._offset=t}if(p){this._offset=t;var X=this.constructor.SyntaxNode;var T=null;o=new X(n,this._offset,p,v);if(typeof T==="object"){l(o,T)}this._offset+=n.length}else{o=null}if(o){m.push(o);j+=o.textValue;q-=1}}if(q<=0){this._offset=r;var K=this.constructor.SyntaxNode;var O=null;i=new K(j,this._offset,m);if(typeof O==="object"){l(i,O)}this._offset+=j.length}else{i=null}if(i){c.push(i);h+=i.textValue;k.rest=i}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var P=this.constructor.SyntaxNode;var U=S(this.constructor,"Choice");a=new P(h,this._offset,c,k);if(typeof U==="object"){l(a,U)}this._offset+=h.length}else{a=null}return this._nodeCache["choice_expression"][d]=a},__consume__choice_part:function(b){var a=null,d=this._offset;this._nodeCache["choice_part"]=this._nodeCache["choice_part"]||{};var f=this._nodeCache["choice_part"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=this._offset;g=this.__consume__sequence_expression();if(g){}else{this._offset=i;g=this.__consume__sequence_part();if(g){}else{this._offset=i}}if(g){c.push(g);h+=g.textValue;var q=null;var r=this._offset;var m=this._offset,j=[],o={},t="";var p=null;var v=1,n=this._offset,w=[],y="",u=true;while(u){u=this.__consume__space();if(u){w.push(u);y+=u.textValue;v-=1}}if(v<=0){this._offset=n;var A=this.constructor.SyntaxNode;var B=null;p=new A(y,this._offset,w);if(typeof B==="object"){l(p,B)}this._offset+=y.length}else{p=null}if(p){j.push(p);t+=p.textValue;var s=null;s=this.__consume__type_expression();if(s){j.push(s);t+=s.textValue;o.type_expression=s}else{j=null;this._offset=m}}else{j=null;this._offset=m}if(j){this._offset=m;var E=this.constructor.SyntaxNode;var x=null;q=new E(t,this._offset,j,o);if(typeof x==="object"){l(q,x)}this._offset+=t.length}else{q=null}if(q){}else{this._offset=r;var z=this.constructor.SyntaxNode;var F=null;q=new z("",this._offset,[]);if(typeof F==="object"){l(q,F)}this._offset+=0}if(q){c.push(q);h+=q.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var C=this.constructor.SyntaxNode;var D=S(this.constructor,"ChoicePart");a=new C(h,this._offset,c,k);if(typeof D==="object"){l(a,D)}this._offset+=h.length}else{a=null}return this._nodeCache["choice_part"][d]=a},__consume__type_expression:function(b){var a=null,d=this._offset;this._nodeCache["type_expression"]=this._nodeCache["type_expression"]||{};var f=this._nodeCache["type_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=null;if(this._input.length>this._offset){i=this._input.substring(this._offset,this._offset+1)}else{i=null}if(i==="<"){var q=this.constructor.SyntaxNode;var r=null;g=new q("<",this._offset,[]);if(typeof r==="object"){l(g,r)}this._offset+=1}else{g=null;var m=null;if(this._input.length>this._offset){m=this._input.substring(this._offset,this._offset+1)}else{m=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"<\""}}}if(g){c.push(g);h+=g.textValue;var j=null;j=this.__consume__object_identifier();if(j){c.push(j);h+=j.textValue;k.object_identifier=j;var o=null;var t=null;if(this._input.length>this._offset){t=this._input.substring(this._offset,this._offset+1)}else{t=null}if(t===">"){var p=this.constructor.SyntaxNode;var v=null;o=new p(">",this._offset,[]);if(typeof v==="object"){l(o,v)}this._offset+=1}else{o=null;var n=null;if(this._input.length>this._offset){n=this._input.substring(this._offset,this._offset+1)}else{n=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\">\""}}}if(o){c.push(o);h+=o.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var w=this.constructor.SyntaxNode;var y=null;a=new w(h,this._offset,c,k);if(typeof y==="object"){l(a,y)}this._offset+=h.length}else{a=null}return this._nodeCache["type_expression"][d]=a},__consume__sequence_expression:function(b){var a=null,d=this._offset;this._nodeCache["sequence_expression"]=this._nodeCache["sequence_expression"]||{};var f=this._nodeCache["sequence_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;g=this.__consume__sequence_part();if(g){c.push(g);h+=g.textValue;k.first_part=g;var i=null;var q=1,r=this._offset,m=[],j="",o=true;while(o){var t=this._offset,p=[],v={},n="";var w=null;var y=1,u=this._offset,A=[],B="",s=true;while(s){s=this.__consume__space();if(s){A.push(s);B+=s.textValue;y-=1}}if(y<=0){this._offset=u;var E=this.constructor.SyntaxNode;var x=null;w=new E(B,this._offset,A);if(typeof x==="object"){l(w,x)}this._offset+=B.length}else{w=null}if(w){p.push(w);n+=w.textValue;var z=null;z=this.__consume__sequence_part();if(z){p.push(z);n+=z.textValue;v.expression=z}else{p=null;this._offset=t}}else{p=null;this._offset=t}if(p){this._offset=t;var F=this.constructor.SyntaxNode;var C=null;o=new F(n,this._offset,p,v);if(typeof C==="object"){l(o,C)}this._offset+=n.length}else{o=null}if(o){m.push(o);j+=o.textValue;q-=1}}if(q<=0){this._offset=r;var D=this.constructor.SyntaxNode;var I=null;i=new D(j,this._offset,m);if(typeof I==="object"){l(i,I)}this._offset+=j.length}else{i=null}if(i){c.push(i);h+=i.textValue;k.rest=i}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var G=this.constructor.SyntaxNode;var L=S(this.constructor,"Sequence");a=new G(h,this._offset,c,k);if(typeof L==="object"){l(a,L)}this._offset+=h.length}else{a=null}return this._nodeCache["sequence_expression"][d]=a},__consume__sequence_part:function(b){var a=null,d=this._offset;this._nodeCache["sequence_part"]=this._nodeCache["sequence_part"]||{};var f=this._nodeCache["sequence_part"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=this._offset;g=this.__consume__label();if(g){}else{this._offset=i;var q=this.constructor.SyntaxNode;var r=null;g=new q("",this._offset,[]);if(typeof r==="object"){l(g,r)}this._offset+=0}if(g){c.push(g);h+=g.textValue;var m=null;var j=this._offset;m=this.__consume__quantified_atom();if(m){}else{this._offset=j;m=this.__consume__atom();if(m){}else{this._offset=j}}if(m){c.push(m);h+=m.textValue;k.expression=m}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var o=this.constructor.SyntaxNode;var t=S(this.constructor,"SequencePart");a=new o(h,this._offset,c,k);if(typeof t==="object"){l(a,t)}this._offset+=h.length}else{a=null}return this._nodeCache["sequence_part"][d]=a},__consume__quantified_atom:function(b){var a=null,d=this._offset;this._nodeCache["quantified_atom"]=this._nodeCache["quantified_atom"]||{};var f=this._nodeCache["quantified_atom"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;g=this.__consume__atom();if(g){c.push(g);h+=g.textValue;k.atom=g;var i=null;i=this.__consume__quantifier();if(i){c.push(i);h+=i.textValue;k.quantifier=i}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var q=this.constructor.SyntaxNode;var r=S(this.constructor,"Repeat");a=new q(h,this._offset,c,k);if(typeof r==="object"){l(a,r)}this._offset+=h.length}else{a=null}return this._nodeCache["quantified_atom"][d]=a},__consume__atom:function(b){var a=null,d=this._offset;this._nodeCache["atom"]=this._nodeCache["atom"]||{};var f=this._nodeCache["atom"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset;a=this.__consume__parenthesised_expression();if(a){}else{this._offset=e;a=this.__consume__predicated_atom();if(a){}else{this._offset=e;a=this.__consume__reference_expression();if(a){}else{this._offset=e;a=this.__consume__string_expression();if(a){}else{this._offset=e;a=this.__consume__ci_string_expression();if(a){}else{this._offset=e;a=this.__consume__any_char_expression();if(a){}else{this._offset=e;a=this.__consume__char_class_expression();if(a){}else{this._offset=e}}}}}}}return this._nodeCache["atom"][d]=a},__consume__predicated_atom:function(b){var a=null,d=this._offset;this._nodeCache["predicated_atom"]=this._nodeCache["predicated_atom"]||{};var f=this._nodeCache["predicated_atom"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=this._offset;var q=null;if(this._input.length>this._offset){q=this._input.substring(this._offset,this._offset+1)}else{q=null}if(q==="&"){var r=this.constructor.SyntaxNode;var m=null;g=new r("&",this._offset,[]);if(typeof m==="object"){l(g,m)}this._offset+=1}else{g=null;var j=null;if(this._input.length>this._offset){j=this._input.substring(this._offset,this._offset+1)}else{j=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"&\""}}}if(g){}else{this._offset=i;var o=null;if(this._input.length>this._offset){o=this._input.substring(this._offset,this._offset+1)}else{o=null}if(o==="!"){var t=this.constructor.SyntaxNode;var p=null;g=new t("!",this._offset,[]);if(typeof p==="object"){l(g,p)}this._offset+=1}else{g=null;var v=null;if(this._input.length>this._offset){v=this._input.substring(this._offset,this._offset+1)}else{v=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"!\""}}}if(g){}else{this._offset=i}}if(g){c.push(g);h+=g.textValue;k.predicate=g;var n=null;n=this.__consume__atom();if(n){c.push(n);h+=n.textValue;k.atom=n}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var w=this.constructor.SyntaxNode;var y=S(this.constructor,"Predicate");a=new w(h,this._offset,c,k);if(typeof y==="object"){l(a,y)}this._offset+=h.length}else{a=null}return this._nodeCache["predicated_atom"][d]=a},__consume__reference_expression:function(b){var a=null,d=this._offset;this._nodeCache["reference_expression"]=this._nodeCache["reference_expression"]||{};var f=this._nodeCache["reference_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;g=this.__consume__identifier();if(g){c.push(g);h+=g.textValue;k.identifier=g;var i=null;var q=this._offset;i=this.__consume__assignment();this._offset=q;if(!(i)){var r=this.constructor.SyntaxNode;var m=null;i=new r("",this._offset,[]);if(typeof m==="object"){l(i,m)}this._offset+=0}else{i=null}if(i){c.push(i);h+=i.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var j=this.constructor.SyntaxNode;var o=S(this.constructor,"Reference");a=new j(h,this._offset,c,k);if(typeof o==="object"){l(a,o)}this._offset+=h.length}else{a=null}return this._nodeCache["reference_expression"][d]=a},__consume__string_expression:function(b){var a=null,d=this._offset;this._nodeCache["string_expression"]=this._nodeCache["string_expression"]||{};var f=this._nodeCache["string_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=null;if(this._input.length>this._offset){i=this._input.substring(this._offset,this._offset+1)}else{i=null}if(i==="\""){var q=this.constructor.SyntaxNode;var r=null;g=new q("\"",this._offset,[]);if(typeof r==="object"){l(g,r)}this._offset+=1}else{g=null;var m=null;if(this._input.length>this._offset){m=this._input.substring(this._offset,this._offset+1)}else{m=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"\\\"\""}}}if(g){c.push(g);h+=g.textValue;var j=null;var o=0,t=this._offset,p=[],v="",n=true;while(n){var w=this._offset;var y=this._offset,u=[],A={},B="";var s=null;var E=null;if(this._input.length>this._offset){E=this._input.substring(this._offset,this._offset+1)}else{E=null}if(E==="\\"){var x=this.constructor.SyntaxNode;var z=null;s=new x("\\",this._offset,[]);if(typeof z==="object"){l(s,z)}this._offset+=1}else{s=null;var F=null;if(this._input.length>this._offset){F=this._input.substring(this._offset,this._offset+1)}else{F=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"\\\\\""}}}if(s){u.push(s);B+=s.textValue;var C=null;var D=null;if(this._input.length>this._offset){D=this._input.substring(this._offset,this._offset+1)}else{D=null}var I=D;if(I===null){C=null;var G=null;if(this._input.length>this._offset){G=this._input.substring(this._offset,this._offset+1)}else{G=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:""}}}else{var L=this.constructor.SyntaxNode;var Q=null;C=new L(I,this._offset,[]);if(typeof Q==="object"){l(C,Q)}this._offset+=1}if(C){u.push(C);B+=C.textValue}else{u=null;this._offset=y}}else{u=null;this._offset=y}if(u){this._offset=y;var M=this.constructor.SyntaxNode;var N=null;n=new M(B,this._offset,u,A);if(typeof N==="object"){l(n,N)}this._offset+=B.length}else{n=null}if(n){}else{this._offset=w;var H=null;if(this._input.length>this._offset){H=this._input.substring(this._offset,this._offset+1)}else{H=null}if(H&&/^[^"]/.test(H)){var V=this.constructor.SyntaxNode;var R=null;n=new V(H,this._offset,[]);if(typeof R==="object"){l(n,R)}this._offset+=1}else{n=null;var J=null;if(this._input.length>this._offset){J=this._input.substring(this._offset,this._offset+1)}else{J=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[^\"]"}}}if(n){}else{this._offset=w}}if(n){p.push(n);v+=n.textValue;o-=1}}if(o<=0){this._offset=t;var X=this.constructor.SyntaxNode;var T=null;j=new X(v,this._offset,p);if(typeof T==="object"){l(j,T)}this._offset+=v.length}else{j=null}if(j){c.push(j);h+=j.textValue;var K=null;var O=null;if(this._input.length>this._offset){O=this._input.substring(this._offset,this._offset+1)}else{O=null}if(O==="\""){var P=this.constructor.SyntaxNode;var U=null;K=new P("\"",this._offset,[]);if(typeof U==="object"){l(K,U)}this._offset+=1}else{K=null;var W=null;if(this._input.length>this._offset){W=this._input.substring(this._offset,this._offset+1)}else{W=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"\\\"\""}}}if(K){c.push(K);h+=K.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var ba=this.constructor.SyntaxNode;var Y=S(this.constructor,"String");a=new ba(h,this._offset,c,k);if(typeof Y==="object"){l(a,Y)}this._offset+=h.length}else{a=null}return this._nodeCache["string_expression"][d]=a},__consume__ci_string_expression:function(b){var a=null,d=this._offset;this._nodeCache["ci_string_expression"]=this._nodeCache["ci_string_expression"]||{};var f=this._nodeCache["ci_string_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=null;if(this._input.length>this._offset){i=this._input.substring(this._offset,this._offset+1)}else{i=null}if(i==="`"){var q=this.constructor.SyntaxNode;var r=null;g=new q("`",this._offset,[]);if(typeof r==="object"){l(g,r)}this._offset+=1}else{g=null;var m=null;if(this._input.length>this._offset){m=this._input.substring(this._offset,this._offset+1)}else{m=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"`\""}}}if(g){c.push(g);h+=g.textValue;var j=null;var o=0,t=this._offset,p=[],v="",n=true;while(n){var w=this._offset;var y=this._offset,u=[],A={},B="";var s=null;var E=null;if(this._input.length>this._offset){E=this._input.substring(this._offset,this._offset+1)}else{E=null}if(E==="\\"){var x=this.constructor.SyntaxNode;var z=null;s=new x("\\",this._offset,[]);if(typeof z==="object"){l(s,z)}this._offset+=1}else{s=null;var F=null;if(this._input.length>this._offset){F=this._input.substring(this._offset,this._offset+1)}else{F=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"\\\\\""}}}if(s){u.push(s);B+=s.textValue;var C=null;var D=null;if(this._input.length>this._offset){D=this._input.substring(this._offset,this._offset+1)}else{D=null}var I=D;if(I===null){C=null;var G=null;if(this._input.length>this._offset){G=this._input.substring(this._offset,this._offset+1)}else{G=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:""}}}else{var L=this.constructor.SyntaxNode;var Q=null;C=new L(I,this._offset,[]);if(typeof Q==="object"){l(C,Q)}this._offset+=1}if(C){u.push(C);B+=C.textValue}else{u=null;this._offset=y}}else{u=null;this._offset=y}if(u){this._offset=y;var M=this.constructor.SyntaxNode;var N=null;n=new M(B,this._offset,u,A);if(typeof N==="object"){l(n,N)}this._offset+=B.length}else{n=null}if(n){}else{this._offset=w;var H=null;if(this._input.length>this._offset){H=this._input.substring(this._offset,this._offset+1)}else{H=null}if(H&&/^[^`]/.test(H)){var V=this.constructor.SyntaxNode;var R=null;n=new V(H,this._offset,[]);if(typeof R==="object"){l(n,R)}this._offset+=1}else{n=null;var J=null;if(this._input.length>this._offset){J=this._input.substring(this._offset,this._offset+1)}else{J=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[^`]"}}}if(n){}else{this._offset=w}}if(n){p.push(n);v+=n.textValue;o-=1}}if(o<=0){this._offset=t;var X=this.constructor.SyntaxNode;var T=null;j=new X(v,this._offset,p);if(typeof T==="object"){l(j,T)}this._offset+=v.length}else{j=null}if(j){c.push(j);h+=j.textValue;var K=null;var O=null;if(this._input.length>this._offset){O=this._input.substring(this._offset,this._offset+1)}else{O=null}if(O==="`"){var P=this.constructor.SyntaxNode;var U=null;K=new P("`",this._offset,[]);if(typeof U==="object"){l(K,U)}this._offset+=1}else{K=null;var W=null;if(this._input.length>this._offset){W=this._input.substring(this._offset,this._offset+1)}else{W=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"`\""}}}if(K){c.push(K);h+=K.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var ba=this.constructor.SyntaxNode;var Y=S(this.constructor,"CIString");a=new ba(h,this._offset,c,k);if(typeof Y==="object"){l(a,Y)}this._offset+=h.length}else{a=null}return this._nodeCache["ci_string_expression"][d]=a},__consume__any_char_expression:function(b){var a=null,d=this._offset;this._nodeCache["any_char_expression"]=this._nodeCache["any_char_expression"]||{};var f=this._nodeCache["any_char_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=null;if(this._input.length>this._offset){e=this._input.substring(this._offset,this._offset+1)}else{e=null}if(e==="."){var c=this.constructor.SyntaxNode;var k=S(this.constructor,"AnyChar");a=new c(".",this._offset,[]);if(typeof k==="object"){l(a,k)}this._offset+=1}else{a=null;var h=null;if(this._input.length>this._offset){h=this._input.substring(this._offset,this._offset+1)}else{h=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\".\""}}}return this._nodeCache["any_char_expression"][d]=a},__consume__char_class_expression:function(b){var a=null,d=this._offset;this._nodeCache["char_class_expression"]=this._nodeCache["char_class_expression"]||{};var f=this._nodeCache["char_class_expression"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=null;if(this._input.length>this._offset){i=this._input.substring(this._offset,this._offset+1)}else{i=null}if(i==="["){var q=this.constructor.SyntaxNode;var r=null;g=new q("[",this._offset,[]);if(typeof r==="object"){l(g,r)}this._offset+=1}else{g=null;var m=null;if(this._input.length>this._offset){m=this._input.substring(this._offset,this._offset+1)}else{m=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"[\""}}}if(g){c.push(g);h+=g.textValue;var j=null;var o=this._offset;var t=null;if(this._input.length>this._offset){t=this._input.substring(this._offset,this._offset+1)}else{t=null}if(t==="^"){var p=this.constructor.SyntaxNode;var v=null;j=new p("^",this._offset,[]);if(typeof v==="object"){l(j,v)}this._offset+=1}else{j=null;var n=null;if(this._input.length>this._offset){n=this._input.substring(this._offset,this._offset+1)}else{n=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"^\""}}}if(j){}else{this._offset=o;var w=this.constructor.SyntaxNode;var y=null;j=new w("",this._offset,[]);if(typeof y==="object"){l(j,y)}this._offset+=0}if(j){c.push(j);h+=j.textValue;var u=null;var A=1,B=this._offset,s=[],E="",x=true;while(x){var z=this._offset;var F=this._offset,C=[],D={},I="";var G=null;var L=null;if(this._input.length>this._offset){L=this._input.substring(this._offset,this._offset+1)}else{L=null}if(L==="\\"){var Q=this.constructor.SyntaxNode;var M=null;G=new Q("\\",this._offset,[]);if(typeof M==="object"){l(G,M)}this._offset+=1}else{G=null;var N=null;if(this._input.length>this._offset){N=this._input.substring(this._offset,this._offset+1)}else{N=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"\\\\\""}}}if(G){C.push(G);I+=G.textValue;var H=null;var V=null;if(this._input.length>this._offset){V=this._input.substring(this._offset,this._offset+1)}else{V=null}var R=V;if(R===null){H=null;var J=null;if(this._input.length>this._offset){J=this._input.substring(this._offset,this._offset+1)}else{J=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:""}}}else{var X=this.constructor.SyntaxNode;var T=null;H=new X(R,this._offset,[]);if(typeof T==="object"){l(H,T)}this._offset+=1}if(H){C.push(H);I+=H.textValue}else{C=null;this._offset=F}}else{C=null;this._offset=F}if(C){this._offset=F;var K=this.constructor.SyntaxNode;var O=null;x=new K(I,this._offset,C,D);if(typeof O==="object"){l(x,O)}this._offset+=I.length}else{x=null}if(x){}else{this._offset=z;var P=null;if(this._input.length>this._offset){P=this._input.substring(this._offset,this._offset+1)}else{P=null}if(P&&/^[^\]]/.test(P)){var U=this.constructor.SyntaxNode;var W=null;x=new U(P,this._offset,[]);if(typeof W==="object"){l(x,W)}this._offset+=1}else{x=null;var ba=null;if(this._input.length>this._offset){ba=this._input.substring(this._offset,this._offset+1)}else{ba=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[^\\]]"}}}if(x){}else{this._offset=z}}if(x){s.push(x);E+=x.textValue;A-=1}}if(A<=0){this._offset=B;var Y=this.constructor.SyntaxNode;var bg=null;u=new Y(E,this._offset,s);if(typeof bg==="object"){l(u,bg)}this._offset+=E.length}else{u=null}if(u){c.push(u);h+=u.textValue;var bb=null;var be=null;if(this._input.length>this._offset){be=this._input.substring(this._offset,this._offset+1)}else{be=null}if(be==="]"){var bl=this.constructor.SyntaxNode;var bh=null;bb=new bl("]",this._offset,[]);if(typeof bh==="object"){l(bb,bh)}this._offset+=1}else{bb=null;var bi=null;if(this._input.length>this._offset){bi=this._input.substring(this._offset,this._offset+1)}else{bi=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"]\""}}}if(bb){c.push(bb);h+=bb.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var bm=this.constructor.SyntaxNode;var bj=S(this.constructor,"CharClass");a=new bm(h,this._offset,c,k);if(typeof bj==="object"){l(a,bj)}this._offset+=h.length}else{a=null}return this._nodeCache["char_class_expression"][d]=a},__consume__label:function(b){var a=null,d=this._offset;this._nodeCache["label"]=this._nodeCache["label"]||{};var f=this._nodeCache["label"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;g=this.__consume__identifier();if(g){c.push(g);h+=g.textValue;k.identifier=g;var i=null;var q=null;if(this._input.length>this._offset){q=this._input.substring(this._offset,this._offset+1)}else{q=null}if(q===":"){var r=this.constructor.SyntaxNode;var m=null;i=new r(":",this._offset,[]);if(typeof m==="object"){l(i,m)}this._offset+=1}else{i=null;var j=null;if(this._input.length>this._offset){j=this._input.substring(this._offset,this._offset+1)}else{j=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\":\""}}}if(i){c.push(i);h+=i.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var o=this.constructor.SyntaxNode;var t=null;a=new o(h,this._offset,c,k);if(typeof t==="object"){l(a,t)}this._offset+=h.length}else{a=null}return this._nodeCache["label"][d]=a},__consume__object_identifier:function(b){var a=null,d=this._offset;this._nodeCache["object_identifier"]=this._nodeCache["object_identifier"]||{};var f=this._nodeCache["object_identifier"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;g=this.__consume__identifier();if(g){c.push(g);h+=g.textValue;k.identifier=g;var i=null;var q=0,r=this._offset,m=[],j="",o=true;while(o){var t=this._offset,p=[],v={},n="";var w=null;var y=null;if(this._input.length>this._offset){y=this._input.substring(this._offset,this._offset+1)}else{y=null}if(y==="."){var u=this.constructor.SyntaxNode;var A=null;w=new u(".",this._offset,[]);if(typeof A==="object"){l(w,A)}this._offset+=1}else{w=null;var B=null;if(this._input.length>this._offset){B=this._input.substring(this._offset,this._offset+1)}else{B=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\".\""}}}if(w){p.push(w);n+=w.textValue;var s=null;s=this.__consume__identifier();if(s){p.push(s);n+=s.textValue;v.identifier=s}else{p=null;this._offset=t}}else{p=null;this._offset=t}if(p){this._offset=t;var E=this.constructor.SyntaxNode;var x=null;o=new E(n,this._offset,p,v);if(typeof x==="object"){l(o,x)}this._offset+=n.length}else{o=null}if(o){m.push(o);j+=o.textValue;q-=1}}if(q<=0){this._offset=r;var z=this.constructor.SyntaxNode;var F=null;i=new z(j,this._offset,m);if(typeof F==="object"){l(i,F)}this._offset+=j.length}else{i=null}if(i){c.push(i);h+=i.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var C=this.constructor.SyntaxNode;var D=null;a=new C(h,this._offset,c,k);if(typeof D==="object"){l(a,D)}this._offset+=h.length}else{a=null}return this._nodeCache["object_identifier"][d]=a},__consume__identifier:function(b){var a=null,d=this._offset;this._nodeCache["identifier"]=this._nodeCache["identifier"]||{};var f=this._nodeCache["identifier"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset,c=[],k={},h="";var g=null;var i=null;if(this._input.length>this._offset){i=this._input.substring(this._offset,this._offset+1)}else{i=null}if(i&&/^[a-zA-Z_$]/.test(i)){var q=this.constructor.SyntaxNode;var r=null;g=new q(i,this._offset,[]);if(typeof r==="object"){l(g,r)}this._offset+=1}else{g=null;var m=null;if(this._input.length>this._offset){m=this._input.substring(this._offset,this._offset+1)}else{m=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[a-zA-Z_$]"}}}if(g){c.push(g);h+=g.textValue;var j=null;var o=0,t=this._offset,p=[],v="",n=true;while(n){var w=null;if(this._input.length>this._offset){w=this._input.substring(this._offset,this._offset+1)}else{w=null}if(w&&/^[a-zA-Z0-9_$]/.test(w)){var y=this.constructor.SyntaxNode;var u=null;n=new y(w,this._offset,[]);if(typeof u==="object"){l(n,u)}this._offset+=1}else{n=null;var A=null;if(this._input.length>this._offset){A=this._input.substring(this._offset,this._offset+1)}else{A=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[a-zA-Z0-9_$]"}}}if(n){p.push(n);v+=n.textValue;o-=1}}if(o<=0){this._offset=t;var B=this.constructor.SyntaxNode;var s=null;j=new B(v,this._offset,p);if(typeof s==="object"){l(j,s)}this._offset+=v.length}else{j=null}if(j){c.push(j);h+=j.textValue}else{c=null;this._offset=e}}else{c=null;this._offset=e}if(c){this._offset=e;var E=this.constructor.SyntaxNode;var x=null;a=new E(h,this._offset,c,k);if(typeof x==="object"){l(a,x)}this._offset+=h.length}else{a=null}return this._nodeCache["identifier"][d]=a},__consume__quantifier:function(b){var a=null,d=this._offset;this._nodeCache["quantifier"]=this._nodeCache["quantifier"]||{};var f=this._nodeCache["quantifier"][d];if(f){this._offset+=f.textValue.length;return f}var e=this._offset;var c=null;if(this._input.length>this._offset){c=this._input.substring(this._offset,this._offset+1)}else{c=null}if(c==="?"){var k=this.constructor.SyntaxNode;var h=null;a=new k("?",this._offset,[]);if(typeof h==="object"){l(a,h)}this._offset+=1}else{a=null;var g=null;if(this._input.length>this._offset){g=this._input.substring(this._offset,this._offset+1)}else{g=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"?\""}}}if(a){}else{this._offset=e;var i=null;if(this._input.length>this._offset){i=this._input.substring(this._offset,this._offset+1)}else{i=null}if(i==="*"){var q=this.constructor.SyntaxNode;var r=null;a=new q("*",this._offset,[]);if(typeof r==="object"){l(a,r)}this._offset+=1}else{a=null;var m=null;if(this._input.length>this._offset){m=this._input.substring(this._offset,this._offset+1)}else{m=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"*\""}}}if(a){}else{this._offset=e;var j=null;if(this._input.length>this._offset){j=this._input.substring(this._offset,this._offset+1)}else{j=null}if(j==="+"){var o=this.constructor.SyntaxNode;var t=null;a=new o("+",this._offset,[]);if(typeof t==="object"){l(a,t)}this._offset+=1}else{a=null;var p=null;if(this._input.length>this._offset){p=this._input.substring(this._offset,this._offset+1)}else{p=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"\"+\""}}}if(a){}else{this._offset=e}}}return this._nodeCache["quantifier"][d]=a},__consume__space:function(b){var a=null,d=this._offset;this._nodeCache["space"]=this._nodeCache["space"]||{};var f=this._nodeCache["space"][d];if(f){this._offset+=f.textValue.length;return f}var e=null;if(this._input.length>this._offset){e=this._input.substring(this._offset,this._offset+1)}else{e=null}if(e&&/^[\s\n\r\t]/.test(e)){var c=this.constructor.SyntaxNode;var k=null;a=new c(e,this._offset,[]);if(typeof k==="object"){l(a,k)}this._offset+=1}else{a=null;var h=null;if(this._input.length>this._offset){h=this._input.substring(this._offset,this._offset+1)}else{h=null}if(!this.error||this.error.offset<=this._offset){this.error=this.constructor.lastError={input:this._input,offset:this._offset,expected:"[\\s\\n\\r\\t]"}}}return this._nodeCache["space"][d]=a}};var Z=function(b){this._input=b;this._offset=0;this._nodeCache={}};Z.prototype.parse=function(){var b=this.__consume__grammar();if(b&&this._offset===this._input.length){return b}if(!(this.error)){this.error={input:this._input,offset:this._offset,expected:""}}var a=bd(this.error);var d=new Error(a);throw d;};Z.parse=function(b){var a=new Z(b);return a.parse()};l(Z.prototype,bc);var bk=function(b,a,d,f){this.textValue=b;this.offset=a;this.elements=d||[];if(!f)return;for(var e in f)this[e]=f[e]};bk.prototype.forEach=function(b,a){for(var d=0,f=this.elements.length;d '+e,function(b){b.line_(d+' = '+f+'.substring('+e+', '+e+' + '+a+')')});this.else_(function(b){b.line_(d+' = null')});return d},syntaxNode_:function(b,a,d,f,e,c){e=', '+(e||'[]');c=c?', '+c:'';var k=this.tempVar_('klass','this.constructor.SyntaxNode'),h=this.findType_(a),g=', '+this.offset_();this.line_(b+' = new '+k+'('+d+g+e+c+')');this.extendNode_(b,h);this.line_(this.offset_()+' += '+f)},findType_:function(b){if(b)return this.tempVar_('type','find(this.constructor, "'+b+'")');else return this.tempVar_('type','null')},extendNode_:function(a,d){if(!d)return;this.if_('typeof '+d+' === "object"',function(b){b.line_('extend('+a+', '+d+')')})},failure_:function(a,d){this.line_(a+' = null');var f=this.input_(),e=this.offset_(),c=this.slice_(1);var k='this.error = this.constructor.lastError';d=d.replace(/\\/g,'\\\\').replace(/"/g,'\\"');this.if_('!this.error || this.error.offset <= '+e,function(b){b.line_(k+' = {input: '+f+', offset: '+e+', expected: "'+d+'"}')})},namespace_:function(b){var a=b.split('.');this.var_('namespace','this');for(var d=0,f=a.length;d"}')});a.var_('message','formatError(this.error)');a.var_('error','new Error(message)');a.line_('throw error')});e.function_('Parser.parse',['input'],function(b){b.var_('parser','new Parser(input)');b.return_('parser.parse()')});e.line_('extend(Parser.prototype, Grammar)');e.newline_();e.function_('var SyntaxNode',['textValue','offset','elements','properties'],function(b){b.line_('this.textValue = textValue');b.line_('this.offset = offset');b.line_('this.elements = elements || []');b.line_('if (!properties) return');b.line_('for (var key in properties) this[key] = properties[key]')});e.function_('SyntaxNode.prototype.forEach',['block','context'],function(a){a.for_('var i = 0, n = this.elements.length;i < n;i++',function(b){b.line_('block.call(context, this.elements[i], i)')})});e.line_('Parser.SyntaxNode = SyntaxNode');var i=function(b){b.line_(c+' = Grammar');b.line_(k+' = Parser');b.line_(k+'.formatError = formatError')};var q=h.length,r;if(q>0){r=[];for(var m=0;m')});a.else_(function(b){b.syntaxNode_(d,f,e,1)})}};Canopy.Compiler.CharClass={toSexp:function(){return['char-class',this.textValue]},compile:function(a,d,f){var e='/^'+this.textValue+'/',c=a.slice_(1);a.if_(c+' && '+e+'.test('+c+')',function(b){b.syntaxNode_(d,f,c,1)});a.else_(function(b){b.failure_(d,this.textValue)},this)}};Canopy.Compiler.String={toSexp:function(){return['string',eval(this.textValue)]},compile:function(a,d,f){var e=this.textValue,c=eval(this.textValue).length;a.if_(a.slice_(c)+' === '+e,function(b){b.syntaxNode_(d,f,e,c)});a.else_(function(b){b.failure_(d,this.textValue)},this)}};Canopy.Compiler.CIString={toSexp:function(){return['ci-string',this.stringValue()]},compile:function(a,d,f){var e=this.stringValue(),c=e.length,k=a.tempVar_('temp',a.slice_(c)),h='.toLowerCase()';a.if_(k+h+' === "'+e+'"'+h,function(b){b.syntaxNode_(d,f,k,c)});a.else_(function(b){b.failure_(d,this.textValue)},this)},stringValue:function(){var b='"'+this.elements[1].textValue+'"';return eval(b)}};Canopy.Compiler.Predicate={atomic:function(){var b=this.atom;return b.parsing_expression||b},toSexp:function(){var b=this.atomic(),a={'&':'and','!':'not'},d=a[this.predicate.textValue];return[d,b.toSexp()]},compile:function(a,d,f){var e=a.tempVar_('index',a.offset_()),c={'&':'if_','!':'unless_'},k=c[this.predicate.textValue];this.atomic().compile(a,d);a.line_(a.offset_()+' = '+e);a[k](d,function(b){b.syntaxNode_(d,f,'""',0)});a.else_(function(b){b.line_(d+' = null')})}};Canopy.Compiler.Repeat={QUANTITIES:{'*':0,'+':1},atomic:function(){var b=this.atom;return b.parsing_expression||b},toSexp:function(){var b=this.atomic(),a=b.toSexp();a=b.toSexp();switch(this.quantifier.textValue){case'*':a=['repeat',0,a];break;case'+':a=['repeat',1,a];break;case'?':a=['maybe',a];break}return a},compile:function(d,f,e){var c=this.quantifier.textValue;if(c==='?')return this._compileMaybe(d,f,e);var k=this.QUANTITIES[c],h=d.tempVars_({remaining:k,index:d.offset_(),elements:'[]',text:'""',address:'true'}),g=h.remaining,i=h.index,q=h.elements,r=h.text,m=h.address;d.while_(m,function(a){this.atomic().compile(a,m);a.if_(m,function(b){b.line_(q+'.push('+m+')');b.line_(r+' += '+m+'.textValue');b.line_(g+' -= 1')})},this);d.if_(g+' <= 0',function(b){b.line_(b.offset_()+' = '+i);b.syntaxNode_(f,e,r,r+'.length',q)});d.else_(function(b){b.line_(f+' = null')})},_compileMaybe:function(d,f,e){var c=d.tempVar_('index',d.offset_());this.atomic().compile(d,f);d.if_(f,function(b){if(e){var a=b.findType_(e);b.extendNode_(f,a)}});d.else_(function(b){b.line_(b.offset_()+' = '+c);b.syntaxNode_(f,e,'""',0)})}};Canopy.Compiler.Sequence={expressions:function(){if(this._expressions)return this._expressions;this._expressions=[this.first_part];this.rest.forEach(function(b){this._expressions.push(b.expression)},this);return this._expressions},toSexp:function(){var a=['sequence'];Canopy.forEach(this.expressions(),function(b){a.push(b.toSexp())});return a},compile:function(a,d,f){var e=a.tempVars_({index:a.offset_(),elements:'[]',labelled:'{}',text:'""'});var c=e.index,k=e.elements,h=e.labelled,g=e.text;this._compileExpressions(a,0,c,k,h,g);a.if_(k,function(b){b.line_(b.offset_()+' = '+c);b.syntaxNode_(d,f,g,g+'.length',k,h)});a.else_(function(b){b.line_(d+' = null')})},_compileExpressions:function(a,d,f,e,c,k){var h=this.expressions();if(d===h.length)return;var g=a.tempVar_('address'),i=h[d].label();h[d].compile(a,g);a.if_(g,function(b){b.line_(e+'.push('+g+')');b.line_(k+' += '+g+'.textValue');if(i)b.line_(c+'.'+i+' = '+g);this._compileExpressions(b,d+1,f,e,c,k)},this);a.else_(function(b){b.line_(e+' = null');b.line_(b.offset_()+' = '+f)})}};Canopy.Compiler.SequencePart={atomic:function(){var b=this.expression;return b.parsing_expression||b},label:function(){var b=this.elements[0].identifier,a=this.atomic();if(b)return b.textValue;if(a.referenceName)return a.referenceName();return null},toSexp:function(){var b=this.atomic(),a=this.label(),d=b.toSexp();if(element=this.elements[0].identifier)d=['label',a,d];return d},compile:function(b,a,d){return this.atomic().compile(b,a,d)}};Canopy.Compiler.Reference={referenceName:function(){return this.identifier.textValue},toSexp:function(){return['reference',this.referenceName()]},compile:function(b,a,d){b.line_(a+' = this.__consume__'+this.referenceName()+'()');if(d){var f=b.findType_(d);b.extendNode_(a,f)}}};(function(){for(var b in Canopy.Compiler){if(/^[A-Z]/.test(b))Canopy.MetaGrammarParser[b]=Canopy.Compiler[b]}if(typeof exports==='object'){module.exports=exports;Canopy.extend(exports,Canopy);exports.compile=Canopy.compile}})(); +//@ sourceMappingURL=canopy-min.js.map \ No newline at end of file diff --git a/node_modules/canopy/lib/canopy-min.js.map b/node_modules/canopy/lib/canopy-min.js.map new file mode 100644 index 0000000..e976632 --- /dev/null +++ b/node_modules/canopy/lib/canopy-min.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "file": "canopy-min.js", + "sourceRoot": "", + "sources": ["canopy.js"], + "names": ["Grammar", "P", "Parser", "SyntaxNode", "address", "address0", "address1", "address10", "address2", "address3", "address4", "address5", "address6", "address7", "address8", "address9", "args", "block", "branch", "builder", "bump", "cacheAddr", "cached", "choice", "code", "compiler", "condition", "context", "destination", "elAddr", "element", "elements", "elements0", "elements1", "elements2", "elements3", "elements4", "elements5", "error", "expAddr", "expected", "expose", "expression", "expressions", "extend", "find", "formatError", "grammar", "grammarText", "i", "index", "index0", "index1", "index2", "index3", "index4", "index5", "index6", "input", "key", "klass", "klass0", "klass1", "klass2", "klass3", "klass4", "klass5", "klass6", "klass7", "klass8", "klass9", "kwd", "label", "labelled", "labelled0", "labelled1", "length", "line", "lineNo", "lines", "list", "message", "minimum", "n", "name", "names", "namespace", "namespaceCondition", "nodeType", "objectName", "of", "offset", "parent", "parser", "part", "parts", "predicate", "properties", "quantifier", "regex", "remaining", "remaining0", "remaining1", "remaining2", "remaining3", "result", "root", "rule", "sexp", "slice", "slice0", "slice1", "slice10", "slice11", "slice2", "slice3", "slice4", "slice5", "slice6", "slice7", "slice8", "slice9", "source", "startOffset", "string", "table", "temp", "temp0", "text0", "text1", "text2", "text3", "text4", "text5", "textValue", "tlc", "tree", "type", "type0", "type1", "type2", "type3", "type4", "type5", "type6", "type7", "type8", "type9", "value", "varName", "vars"], + "mappings": "AA0BA,IAAI,UAEJ,OAAO,OAAS,SAAS4B,EAAa8F,GAClC,IAAK9F,IAAgB8F,EAAQ,OAAO9F,EACpC,IAAK,IAAI+B,EAAI,GAAG+D,GACd,GAAI9F,EAAY+B,KAAS+D,EAAO/D,GAC9B/B,EAAY+B,GAAO+D,EAAO/D,GAE9B,OAAO/B,GAGX,OAAO,OAAO,QACZ,QAAS,SAASmB,GAChB,IAAItB,EAAW,IAAI,KAAK,SAASsB,GAC7B2E,EAAWjG,EAAS,WAExB,KAAKiG,GACL,OAAOA,GAGT,KAAM,SAAShB,EAAMjB,GACnB,IAAIM,EAAQN,EAAW,WACnBK,EAEJ,MAAOA,EAAOC,EAAM,SAClBW,EA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A,EAAQ,MAAMY,MAAe,OAC7BZ,EAAQ,MAAMA,EAAQ,gBAAoBwG,OAMhD,OAAO,SAAS,cACd,OAAQ,WACN,IAAIjF,EAAa,KAAK,WACtB,OAAOA,EAAW,oBAAsBA,GAG1C,MAAO,WACL,IAAIZ,EAAU,KAAK,YAAY,WAC3BY,EAAa,KAAK,SAEtB,GAAIZ,EAAS,OAAOA,EAAQ,UAC5B,GAAIY,EAAW,cAAe,OAAOA,EAAW,gBAEhD,OAAO,MAGT,OAAQ,WACN,IAAIA,EAAa,KAAK,SAClB8B,EAAQ,KAAK,QACboC,EAAQlE,EAAW,SAEvB,GAAI,QAAU,KAAK,YAAY,WAC7BkE,IAAS,OAAQpC,EAAOoC,GAE1B,OAAOA,GAGT,QAAS,SAASzF,EAASf,EAASoF,GAClC,OAAO,KAAK,SAAS,QAAQrE,EAASf,EAASoF,KAKnD,OAAO,SAAS,WACd,cAAe,WACb,OAAO,KAAK,WAAW,WAGzB,OAAQ,WACN,QAAS,WAAY,KAAK,kBAG5B,QAAS,SAASrE,EAASf,EAASoF,GAClCrE,EAAQ,MAAMf,MAAc,KAAK,aAAe,KAAK,sBACrD,GAAIoF,GACF,IAAIiD,EAAOtH,EAAQ,UAAUqE,GAC7BrE,EAAQ,YAAYf,EAASqI,OAMlC,WACC,IAAK,IAAIA,EAAK,GAAG,OAAO,UACtB,MAAO,EAAE,IAAI,KAAKA,GAChB,OAAO,kBAAkBA,GAAQ,OAAO,SAASA,GAGrD,GAAI,OAAO,WAAa,SACtB,OAAO,QAAU,QACjB,OAAO,OAAO,QAAS,QACvB,QAAQ,QAAU,OAAO;" +} \ No newline at end of file diff --git a/node_modules/canopy/lib/canopy.js b/node_modules/canopy/lib/canopy.js new file mode 100644 index 0000000..6ab1855 --- /dev/null +++ b/node_modules/canopy/lib/canopy.js @@ -0,0 +1,3595 @@ +/** + * Canopy -- a JavaScript parser compiler + * ====================================== + * + * http://github.com/jcoglan/canopy + * + * Copyright (c) 2010-2012 James Coglan + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the 'Software'), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + **/ + +var Canopy = {}; + +Canopy.extend = function(destination, source) { + if (!destination || !source) return destination; + for (var key in source) { + if (destination[key] !== source[key]) + destination[key] = source[key]; + } + return destination; + }; + +Canopy.extend(Canopy, { + compile: function(grammar) { + var compiler = new this.Compiler(grammar), + source = compiler.toSource(); + + eval(source); + return source; + }, + + find: function(root, objectName) { + var parts = objectName.split('.'), + part; + + while (part = parts.shift()) { + root = root[part]; + if (root === undefined) + throw new Error('Cannot find object named ' + objectName); + } + return root; + }, + + forEach: function(list, block, context) { + for (var i = 0, n = list.length; i < n; i++) + block.call(context, list[i], i); + }, + + formatError: function(error) { + var lines = error.input.split(/\n/g), + lineNo = 0, + offset = 0; + + while (offset < error.offset + 1) { + offset += lines[lineNo].length + 1; + lineNo += 1; + } + var message = 'Line ' + lineNo + ': expected ' + error.expected + '\n', + line = lines[lineNo - 1]; + + message += line + '\n'; + offset -= line.length + 1; + + while (offset < error.offset) { + message += ' '; + offset += 1; + } + return message + '^'; + } +}); + + +(function() { + var extend = function (destination, source) { + if (!destination || !source) return destination; + for (var key in source) { + if (destination[key] !== source[key]) + destination[key] = source[key]; + } + return destination; + }; + + var find = function (root, objectName) { + var parts = objectName.split('.'), + part; + + while (part = parts.shift()) { + root = root[part]; + if (root === undefined) + throw new Error('Cannot find object named ' + objectName); + } + return root; + }; + + var formatError = function (error) { + var lines = error.input.split(/\n/g), + lineNo = 0, + offset = 0; + + while (offset < error.offset + 1) { + offset += lines[lineNo].length + 1; + lineNo += 1; + } + var message = 'Line ' + lineNo + ': expected ' + error.expected + '\n', + line = lines[lineNo - 1]; + + message += line + '\n'; + offset -= line.length + 1; + + while (offset < error.offset) { + message += ' '; + offset += 1; + } + return message + '^'; + }; + + var Grammar = { + __consume__grammar: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["grammar"] = this._nodeCache["grammar"] || {}; + var cached = this._nodeCache["grammar"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var remaining0 = 0, index2 = this._offset, elements1 = [], text1 = "", address2 = true; + while (address2) { + address2 = this.__consume__space(); + if (address2) { + elements1.push(address2); + text1 += address2.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0(text1, this._offset, elements1); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += text1.length; + } else { + address1 = null; + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address3 = null; + address3 = this.__consume__grammar_name(); + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + labelled0.grammar_name = address3; + var address4 = null; + var remaining1 = 1, index3 = this._offset, elements2 = [], text2 = "", address5 = true; + while (address5) { + var index4 = this._offset, elements3 = [], labelled1 = {}, text3 = ""; + var address6 = null; + var remaining2 = 0, index5 = this._offset, elements4 = [], text4 = "", address7 = true; + while (address7) { + address7 = this.__consume__space(); + if (address7) { + elements4.push(address7); + text4 += address7.textValue; + remaining2 -= 1; + } + } + if (remaining2 <= 0) { + this._offset = index5; + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address6 = new klass1(text4, this._offset, elements4); + if (typeof type1 === "object") { + extend(address6, type1); + } + this._offset += text4.length; + } else { + address6 = null; + } + if (address6) { + elements3.push(address6); + text3 += address6.textValue; + var address8 = null; + address8 = this.__consume__grammar_rule(); + if (address8) { + elements3.push(address8); + text3 += address8.textValue; + labelled1.grammar_rule = address8; + } else { + elements3 = null; + this._offset = index4; + } + } else { + elements3 = null; + this._offset = index4; + } + if (elements3) { + this._offset = index4; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address5 = new klass2(text3, this._offset, elements3, labelled1); + if (typeof type2 === "object") { + extend(address5, type2); + } + this._offset += text3.length; + } else { + address5 = null; + } + if (address5) { + elements2.push(address5); + text2 += address5.textValue; + remaining1 -= 1; + } + } + if (remaining1 <= 0) { + this._offset = index3; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address4 = new klass3(text2, this._offset, elements2); + if (typeof type3 === "object") { + extend(address4, type3); + } + this._offset += text2.length; + } else { + address4 = null; + } + if (address4) { + elements0.push(address4); + text0 += address4.textValue; + labelled0.rules = address4; + var address9 = null; + var remaining3 = 0, index6 = this._offset, elements5 = [], text5 = "", address10 = true; + while (address10) { + address10 = this.__consume__space(); + if (address10) { + elements5.push(address10); + text5 += address10.textValue; + remaining3 -= 1; + } + } + if (remaining3 <= 0) { + this._offset = index6; + var klass4 = this.constructor.SyntaxNode; + var type4 = null; + address9 = new klass4(text5, this._offset, elements5); + if (typeof type4 === "object") { + extend(address9, type4); + } + this._offset += text5.length; + } else { + address9 = null; + } + if (address9) { + elements0.push(address9); + text0 += address9.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass5 = this.constructor.SyntaxNode; + var type5 = find(this.constructor, "Grammar"); + address0 = new klass5(text0, this._offset, elements0, labelled0); + if (typeof type5 === "object") { + extend(address0, type5); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["grammar"][index0] = address0; + }, + __consume__grammar_name: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["grammar_name"] = this._nodeCache["grammar_name"] || {}; + var cached = this._nodeCache["grammar_name"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 8); + } else { + slice0 = null; + } + if (slice0 === "grammar ") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("grammar ", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 8; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"grammar \""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + address2 = this.__consume__object_identifier(); + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.object_identifier = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address0 = new klass1(text0, this._offset, elements0, labelled0); + if (typeof type1 === "object") { + extend(address0, type1); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["grammar_name"][index0] = address0; + }, + __consume__grammar_rule: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["grammar_rule"] = this._nodeCache["grammar_rule"] || {}; + var cached = this._nodeCache["grammar_rule"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + address1 = this.__consume__identifier(); + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.identifier = address1; + var address2 = null; + address2 = this.__consume__assignment(); + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.assignment = address2; + var address3 = null; + address3 = this.__consume__parsing_expression(); + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + labelled0.parsing_expression = address3; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "GrammarRule"); + address0 = new klass0(text0, this._offset, elements0, labelled0); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["grammar_rule"][index0] = address0; + }, + __consume__assignment: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["assignment"] = this._nodeCache["assignment"] || {}; + var cached = this._nodeCache["assignment"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var remaining0 = 1, index2 = this._offset, elements1 = [], text1 = "", address2 = true; + while (address2) { + address2 = this.__consume__space(); + if (address2) { + elements1.push(address2); + text1 += address2.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0(text1, this._offset, elements1); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += text1.length; + } else { + address1 = null; + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address3 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 2); + } else { + slice0 = null; + } + if (slice0 === "<-") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1("<-", this._offset, []); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += 2; + } else { + address3 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"<-\""}; + } + } + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + var address4 = null; + var remaining1 = 1, index3 = this._offset, elements2 = [], text2 = "", address5 = true; + while (address5) { + address5 = this.__consume__space(); + if (address5) { + elements2.push(address5); + text2 += address5.textValue; + remaining1 -= 1; + } + } + if (remaining1 <= 0) { + this._offset = index3; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address4 = new klass2(text2, this._offset, elements2); + if (typeof type2 === "object") { + extend(address4, type2); + } + this._offset += text2.length; + } else { + address4 = null; + } + if (address4) { + elements0.push(address4); + text0 += address4.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["assignment"][index0] = address0; + }, + __consume__parsing_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["parsing_expression"] = this._nodeCache["parsing_expression"] || {}; + var cached = this._nodeCache["parsing_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset; + address0 = this.__consume__choice_expression(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__choice_part(); + if (address0) { + } else { + this._offset = index1; + } + } + return this._nodeCache["parsing_expression"][index0] = address0; + }, + __consume__parenthesised_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["parenthesised_expression"] = this._nodeCache["parenthesised_expression"] || {}; + var cached = this._nodeCache["parenthesised_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "(") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("(", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"(\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var remaining0 = 0, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + address3 = this.__consume__space(); + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1(text1, this._offset, elements1); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + var address4 = null; + address4 = this.__consume__parsing_expression(); + if (address4) { + elements0.push(address4); + text0 += address4.textValue; + labelled0.parsing_expression = address4; + var address5 = null; + var remaining1 = 0, index3 = this._offset, elements2 = [], text2 = "", address6 = true; + while (address6) { + address6 = this.__consume__space(); + if (address6) { + elements2.push(address6); + text2 += address6.textValue; + remaining1 -= 1; + } + } + if (remaining1 <= 0) { + this._offset = index3; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address5 = new klass2(text2, this._offset, elements2); + if (typeof type2 === "object") { + extend(address5, type2); + } + this._offset += text2.length; + } else { + address5 = null; + } + if (address5) { + elements0.push(address5); + text0 += address5.textValue; + var address7 = null; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === ")") { + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address7 = new klass3(")", this._offset, []); + if (typeof type3 === "object") { + extend(address7, type3); + } + this._offset += 1; + } else { + address7 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\")\""}; + } + } + if (address7) { + elements0.push(address7); + text0 += address7.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass4 = this.constructor.SyntaxNode; + var type4 = null; + address0 = new klass4(text0, this._offset, elements0, labelled0); + if (typeof type4 === "object") { + extend(address0, type4); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["parenthesised_expression"][index0] = address0; + }, + __consume__choice_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["choice_expression"] = this._nodeCache["choice_expression"] || {}; + var cached = this._nodeCache["choice_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + address1 = this.__consume__choice_part(); + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.first_part = address1; + var address2 = null; + var remaining0 = 1, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var index3 = this._offset, elements2 = [], labelled1 = {}, text2 = ""; + var address4 = null; + var remaining1 = 1, index4 = this._offset, elements3 = [], text3 = "", address5 = true; + while (address5) { + address5 = this.__consume__space(); + if (address5) { + elements3.push(address5); + text3 += address5.textValue; + remaining1 -= 1; + } + } + if (remaining1 <= 0) { + this._offset = index4; + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address4 = new klass0(text3, this._offset, elements3); + if (typeof type0 === "object") { + extend(address4, type0); + } + this._offset += text3.length; + } else { + address4 = null; + } + if (address4) { + elements2.push(address4); + text2 += address4.textValue; + var address6 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "/") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address6 = new klass1("/", this._offset, []); + if (typeof type1 === "object") { + extend(address6, type1); + } + this._offset += 1; + } else { + address6 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"/\""}; + } + } + if (address6) { + elements2.push(address6); + text2 += address6.textValue; + var address7 = null; + var remaining2 = 1, index5 = this._offset, elements4 = [], text4 = "", address8 = true; + while (address8) { + address8 = this.__consume__space(); + if (address8) { + elements4.push(address8); + text4 += address8.textValue; + remaining2 -= 1; + } + } + if (remaining2 <= 0) { + this._offset = index5; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address7 = new klass2(text4, this._offset, elements4); + if (typeof type2 === "object") { + extend(address7, type2); + } + this._offset += text4.length; + } else { + address7 = null; + } + if (address7) { + elements2.push(address7); + text2 += address7.textValue; + var address9 = null; + address9 = this.__consume__choice_part(); + if (address9) { + elements2.push(address9); + text2 += address9.textValue; + labelled1.expression = address9; + } else { + elements2 = null; + this._offset = index3; + } + } else { + elements2 = null; + this._offset = index3; + } + } else { + elements2 = null; + this._offset = index3; + } + } else { + elements2 = null; + this._offset = index3; + } + if (elements2) { + this._offset = index3; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address3 = new klass3(text2, this._offset, elements2, labelled1); + if (typeof type3 === "object") { + extend(address3, type3); + } + this._offset += text2.length; + } else { + address3 = null; + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass4 = this.constructor.SyntaxNode; + var type4 = null; + address2 = new klass4(text1, this._offset, elements1); + if (typeof type4 === "object") { + extend(address2, type4); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.rest = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass5 = this.constructor.SyntaxNode; + var type5 = find(this.constructor, "Choice"); + address0 = new klass5(text0, this._offset, elements0, labelled0); + if (typeof type5 === "object") { + extend(address0, type5); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["choice_expression"][index0] = address0; + }, + __consume__choice_part: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["choice_part"] = this._nodeCache["choice_part"] || {}; + var cached = this._nodeCache["choice_part"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var index2 = this._offset; + address1 = this.__consume__sequence_expression(); + if (address1) { + } else { + this._offset = index2; + address1 = this.__consume__sequence_part(); + if (address1) { + } else { + this._offset = index2; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var index3 = this._offset; + var index4 = this._offset, elements1 = [], labelled1 = {}, text1 = ""; + var address3 = null; + var remaining0 = 1, index5 = this._offset, elements2 = [], text2 = "", address4 = true; + while (address4) { + address4 = this.__consume__space(); + if (address4) { + elements2.push(address4); + text2 += address4.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index5; + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address3 = new klass0(text2, this._offset, elements2); + if (typeof type0 === "object") { + extend(address3, type0); + } + this._offset += text2.length; + } else { + address3 = null; + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + var address5 = null; + address5 = this.__consume__type_expression(); + if (address5) { + elements1.push(address5); + text1 += address5.textValue; + labelled1.type_expression = address5; + } else { + elements1 = null; + this._offset = index4; + } + } else { + elements1 = null; + this._offset = index4; + } + if (elements1) { + this._offset = index4; + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1(text1, this._offset, elements1, labelled1); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + } else { + this._offset = index3; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2("", this._offset, []); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += 0; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = find(this.constructor, "ChoicePart"); + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["choice_part"][index0] = address0; + }, + __consume__type_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["type_expression"] = this._nodeCache["type_expression"] || {}; + var cached = this._nodeCache["type_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "<") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("<", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"<\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + address2 = this.__consume__object_identifier(); + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.object_identifier = address2; + var address3 = null; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === ">") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1(">", this._offset, []); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += 1; + } else { + address3 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\">\""}; + } + } + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address0 = new klass2(text0, this._offset, elements0, labelled0); + if (typeof type2 === "object") { + extend(address0, type2); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["type_expression"][index0] = address0; + }, + __consume__sequence_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["sequence_expression"] = this._nodeCache["sequence_expression"] || {}; + var cached = this._nodeCache["sequence_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + address1 = this.__consume__sequence_part(); + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.first_part = address1; + var address2 = null; + var remaining0 = 1, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var index3 = this._offset, elements2 = [], labelled1 = {}, text2 = ""; + var address4 = null; + var remaining1 = 1, index4 = this._offset, elements3 = [], text3 = "", address5 = true; + while (address5) { + address5 = this.__consume__space(); + if (address5) { + elements3.push(address5); + text3 += address5.textValue; + remaining1 -= 1; + } + } + if (remaining1 <= 0) { + this._offset = index4; + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address4 = new klass0(text3, this._offset, elements3); + if (typeof type0 === "object") { + extend(address4, type0); + } + this._offset += text3.length; + } else { + address4 = null; + } + if (address4) { + elements2.push(address4); + text2 += address4.textValue; + var address6 = null; + address6 = this.__consume__sequence_part(); + if (address6) { + elements2.push(address6); + text2 += address6.textValue; + labelled1.expression = address6; + } else { + elements2 = null; + this._offset = index3; + } + } else { + elements2 = null; + this._offset = index3; + } + if (elements2) { + this._offset = index3; + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1(text2, this._offset, elements2, labelled1); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += text2.length; + } else { + address3 = null; + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2(text1, this._offset, elements1); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.rest = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = find(this.constructor, "Sequence"); + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["sequence_expression"][index0] = address0; + }, + __consume__sequence_part: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["sequence_part"] = this._nodeCache["sequence_part"] || {}; + var cached = this._nodeCache["sequence_part"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var index2 = this._offset; + address1 = this.__consume__label(); + if (address1) { + } else { + this._offset = index2; + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 0; + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var index3 = this._offset; + address2 = this.__consume__quantified_atom(); + if (address2) { + } else { + this._offset = index3; + address2 = this.__consume__atom(); + if (address2) { + } else { + this._offset = index3; + } + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.expression = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass1 = this.constructor.SyntaxNode; + var type1 = find(this.constructor, "SequencePart"); + address0 = new klass1(text0, this._offset, elements0, labelled0); + if (typeof type1 === "object") { + extend(address0, type1); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["sequence_part"][index0] = address0; + }, + __consume__quantified_atom: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["quantified_atom"] = this._nodeCache["quantified_atom"] || {}; + var cached = this._nodeCache["quantified_atom"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + address1 = this.__consume__atom(); + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.atom = address1; + var address2 = null; + address2 = this.__consume__quantifier(); + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.quantifier = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "Repeat"); + address0 = new klass0(text0, this._offset, elements0, labelled0); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["quantified_atom"][index0] = address0; + }, + __consume__atom: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["atom"] = this._nodeCache["atom"] || {}; + var cached = this._nodeCache["atom"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset; + address0 = this.__consume__parenthesised_expression(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__predicated_atom(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__reference_expression(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__string_expression(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__ci_string_expression(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__any_char_expression(); + if (address0) { + } else { + this._offset = index1; + address0 = this.__consume__char_class_expression(); + if (address0) { + } else { + this._offset = index1; + } + } + } + } + } + } + } + return this._nodeCache["atom"][index0] = address0; + }, + __consume__predicated_atom: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["predicated_atom"] = this._nodeCache["predicated_atom"] || {}; + var cached = this._nodeCache["predicated_atom"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var index2 = this._offset; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "&") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("&", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"&\""}; + } + } + if (address1) { + } else { + this._offset = index2; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === "!") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address1 = new klass1("!", this._offset, []); + if (typeof type1 === "object") { + extend(address1, type1); + } + this._offset += 1; + } else { + address1 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"!\""}; + } + } + if (address1) { + } else { + this._offset = index2; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.predicate = address1; + var address2 = null; + address2 = this.__consume__atom(); + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + labelled0.atom = address2; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass2 = this.constructor.SyntaxNode; + var type2 = find(this.constructor, "Predicate"); + address0 = new klass2(text0, this._offset, elements0, labelled0); + if (typeof type2 === "object") { + extend(address0, type2); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["predicated_atom"][index0] = address0; + }, + __consume__reference_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["reference_expression"] = this._nodeCache["reference_expression"] || {}; + var cached = this._nodeCache["reference_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + address1 = this.__consume__identifier(); + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.identifier = address1; + var address2 = null; + var index2 = this._offset; + address2 = this.__consume__assignment(); + this._offset = index2; + if (!(address2)) { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address2 = new klass0("", this._offset, []); + if (typeof type0 === "object") { + extend(address2, type0); + } + this._offset += 0; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass1 = this.constructor.SyntaxNode; + var type1 = find(this.constructor, "Reference"); + address0 = new klass1(text0, this._offset, elements0, labelled0); + if (typeof type1 === "object") { + extend(address0, type1); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["reference_expression"][index0] = address0; + }, + __consume__string_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["string_expression"] = this._nodeCache["string_expression"] || {}; + var cached = this._nodeCache["string_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "\"") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("\"", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"\\\"\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var remaining0 = 0, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var index3 = this._offset; + var index4 = this._offset, elements2 = [], labelled1 = {}, text2 = ""; + var address4 = null; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === "\\") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address4 = new klass1("\\", this._offset, []); + if (typeof type1 === "object") { + extend(address4, type1); + } + this._offset += 1; + } else { + address4 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"\\\\\""}; + } + } + if (address4) { + elements2.push(address4); + text2 += address4.textValue; + var address5 = null; + var slice4 = null; + if (this._input.length > this._offset) { + slice4 = this._input.substring(this._offset, this._offset + 1); + } else { + slice4 = null; + } + var temp0 = slice4; + if (temp0 === null) { + address5 = null; + var slice5 = null; + if (this._input.length > this._offset) { + slice5 = this._input.substring(this._offset, this._offset + 1); + } else { + slice5 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: ""}; + } + } else { + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address5 = new klass2(temp0, this._offset, []); + if (typeof type2 === "object") { + extend(address5, type2); + } + this._offset += 1; + } + if (address5) { + elements2.push(address5); + text2 += address5.textValue; + } else { + elements2 = null; + this._offset = index4; + } + } else { + elements2 = null; + this._offset = index4; + } + if (elements2) { + this._offset = index4; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address3 = new klass3(text2, this._offset, elements2, labelled1); + if (typeof type3 === "object") { + extend(address3, type3); + } + this._offset += text2.length; + } else { + address3 = null; + } + if (address3) { + } else { + this._offset = index3; + var slice6 = null; + if (this._input.length > this._offset) { + slice6 = this._input.substring(this._offset, this._offset + 1); + } else { + slice6 = null; + } + if (slice6 && /^[^"]/.test(slice6)) { + var klass4 = this.constructor.SyntaxNode; + var type4 = null; + address3 = new klass4(slice6, this._offset, []); + if (typeof type4 === "object") { + extend(address3, type4); + } + this._offset += 1; + } else { + address3 = null; + var slice7 = null; + if (this._input.length > this._offset) { + slice7 = this._input.substring(this._offset, this._offset + 1); + } else { + slice7 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[^\"]"}; + } + } + if (address3) { + } else { + this._offset = index3; + } + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass5 = this.constructor.SyntaxNode; + var type5 = null; + address2 = new klass5(text1, this._offset, elements1); + if (typeof type5 === "object") { + extend(address2, type5); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + var address6 = null; + var slice8 = null; + if (this._input.length > this._offset) { + slice8 = this._input.substring(this._offset, this._offset + 1); + } else { + slice8 = null; + } + if (slice8 === "\"") { + var klass6 = this.constructor.SyntaxNode; + var type6 = null; + address6 = new klass6("\"", this._offset, []); + if (typeof type6 === "object") { + extend(address6, type6); + } + this._offset += 1; + } else { + address6 = null; + var slice9 = null; + if (this._input.length > this._offset) { + slice9 = this._input.substring(this._offset, this._offset + 1); + } else { + slice9 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"\\\"\""}; + } + } + if (address6) { + elements0.push(address6); + text0 += address6.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass7 = this.constructor.SyntaxNode; + var type7 = find(this.constructor, "String"); + address0 = new klass7(text0, this._offset, elements0, labelled0); + if (typeof type7 === "object") { + extend(address0, type7); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["string_expression"][index0] = address0; + }, + __consume__ci_string_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["ci_string_expression"] = this._nodeCache["ci_string_expression"] || {}; + var cached = this._nodeCache["ci_string_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "`") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("`", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"`\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var remaining0 = 0, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var index3 = this._offset; + var index4 = this._offset, elements2 = [], labelled1 = {}, text2 = ""; + var address4 = null; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === "\\") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address4 = new klass1("\\", this._offset, []); + if (typeof type1 === "object") { + extend(address4, type1); + } + this._offset += 1; + } else { + address4 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"\\\\\""}; + } + } + if (address4) { + elements2.push(address4); + text2 += address4.textValue; + var address5 = null; + var slice4 = null; + if (this._input.length > this._offset) { + slice4 = this._input.substring(this._offset, this._offset + 1); + } else { + slice4 = null; + } + var temp0 = slice4; + if (temp0 === null) { + address5 = null; + var slice5 = null; + if (this._input.length > this._offset) { + slice5 = this._input.substring(this._offset, this._offset + 1); + } else { + slice5 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: ""}; + } + } else { + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address5 = new klass2(temp0, this._offset, []); + if (typeof type2 === "object") { + extend(address5, type2); + } + this._offset += 1; + } + if (address5) { + elements2.push(address5); + text2 += address5.textValue; + } else { + elements2 = null; + this._offset = index4; + } + } else { + elements2 = null; + this._offset = index4; + } + if (elements2) { + this._offset = index4; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address3 = new klass3(text2, this._offset, elements2, labelled1); + if (typeof type3 === "object") { + extend(address3, type3); + } + this._offset += text2.length; + } else { + address3 = null; + } + if (address3) { + } else { + this._offset = index3; + var slice6 = null; + if (this._input.length > this._offset) { + slice6 = this._input.substring(this._offset, this._offset + 1); + } else { + slice6 = null; + } + if (slice6 && /^[^`]/.test(slice6)) { + var klass4 = this.constructor.SyntaxNode; + var type4 = null; + address3 = new klass4(slice6, this._offset, []); + if (typeof type4 === "object") { + extend(address3, type4); + } + this._offset += 1; + } else { + address3 = null; + var slice7 = null; + if (this._input.length > this._offset) { + slice7 = this._input.substring(this._offset, this._offset + 1); + } else { + slice7 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[^`]"}; + } + } + if (address3) { + } else { + this._offset = index3; + } + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass5 = this.constructor.SyntaxNode; + var type5 = null; + address2 = new klass5(text1, this._offset, elements1); + if (typeof type5 === "object") { + extend(address2, type5); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + var address6 = null; + var slice8 = null; + if (this._input.length > this._offset) { + slice8 = this._input.substring(this._offset, this._offset + 1); + } else { + slice8 = null; + } + if (slice8 === "`") { + var klass6 = this.constructor.SyntaxNode; + var type6 = null; + address6 = new klass6("`", this._offset, []); + if (typeof type6 === "object") { + extend(address6, type6); + } + this._offset += 1; + } else { + address6 = null; + var slice9 = null; + if (this._input.length > this._offset) { + slice9 = this._input.substring(this._offset, this._offset + 1); + } else { + slice9 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"`\""}; + } + } + if (address6) { + elements0.push(address6); + text0 += address6.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass7 = this.constructor.SyntaxNode; + var type7 = find(this.constructor, "CIString"); + address0 = new klass7(text0, this._offset, elements0, labelled0); + if (typeof type7 === "object") { + extend(address0, type7); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["ci_string_expression"][index0] = address0; + }, + __consume__any_char_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["any_char_expression"] = this._nodeCache["any_char_expression"] || {}; + var cached = this._nodeCache["any_char_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === ".") { + var klass0 = this.constructor.SyntaxNode; + var type0 = find(this.constructor, "AnyChar"); + address0 = new klass0(".", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\".\""}; + } + } + return this._nodeCache["any_char_expression"][index0] = address0; + }, + __consume__char_class_expression: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["char_class_expression"] = this._nodeCache["char_class_expression"] || {}; + var cached = this._nodeCache["char_class_expression"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "[") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0("[", this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"[\""}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var index2 = this._offset; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === "^") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address2 = new klass1("^", this._offset, []); + if (typeof type1 === "object") { + extend(address2, type1); + } + this._offset += 1; + } else { + address2 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"^\""}; + } + } + if (address2) { + } else { + this._offset = index2; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2("", this._offset, []); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += 0; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + var address3 = null; + var remaining0 = 1, index3 = this._offset, elements1 = [], text1 = "", address4 = true; + while (address4) { + var index4 = this._offset; + var index5 = this._offset, elements2 = [], labelled1 = {}, text2 = ""; + var address5 = null; + var slice4 = null; + if (this._input.length > this._offset) { + slice4 = this._input.substring(this._offset, this._offset + 1); + } else { + slice4 = null; + } + if (slice4 === "\\") { + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address5 = new klass3("\\", this._offset, []); + if (typeof type3 === "object") { + extend(address5, type3); + } + this._offset += 1; + } else { + address5 = null; + var slice5 = null; + if (this._input.length > this._offset) { + slice5 = this._input.substring(this._offset, this._offset + 1); + } else { + slice5 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"\\\\\""}; + } + } + if (address5) { + elements2.push(address5); + text2 += address5.textValue; + var address6 = null; + var slice6 = null; + if (this._input.length > this._offset) { + slice6 = this._input.substring(this._offset, this._offset + 1); + } else { + slice6 = null; + } + var temp0 = slice6; + if (temp0 === null) { + address6 = null; + var slice7 = null; + if (this._input.length > this._offset) { + slice7 = this._input.substring(this._offset, this._offset + 1); + } else { + slice7 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: ""}; + } + } else { + var klass4 = this.constructor.SyntaxNode; + var type4 = null; + address6 = new klass4(temp0, this._offset, []); + if (typeof type4 === "object") { + extend(address6, type4); + } + this._offset += 1; + } + if (address6) { + elements2.push(address6); + text2 += address6.textValue; + } else { + elements2 = null; + this._offset = index5; + } + } else { + elements2 = null; + this._offset = index5; + } + if (elements2) { + this._offset = index5; + var klass5 = this.constructor.SyntaxNode; + var type5 = null; + address4 = new klass5(text2, this._offset, elements2, labelled1); + if (typeof type5 === "object") { + extend(address4, type5); + } + this._offset += text2.length; + } else { + address4 = null; + } + if (address4) { + } else { + this._offset = index4; + var slice8 = null; + if (this._input.length > this._offset) { + slice8 = this._input.substring(this._offset, this._offset + 1); + } else { + slice8 = null; + } + if (slice8 && /^[^\]]/.test(slice8)) { + var klass6 = this.constructor.SyntaxNode; + var type6 = null; + address4 = new klass6(slice8, this._offset, []); + if (typeof type6 === "object") { + extend(address4, type6); + } + this._offset += 1; + } else { + address4 = null; + var slice9 = null; + if (this._input.length > this._offset) { + slice9 = this._input.substring(this._offset, this._offset + 1); + } else { + slice9 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[^\\]]"}; + } + } + if (address4) { + } else { + this._offset = index4; + } + } + if (address4) { + elements1.push(address4); + text1 += address4.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index3; + var klass7 = this.constructor.SyntaxNode; + var type7 = null; + address3 = new klass7(text1, this._offset, elements1); + if (typeof type7 === "object") { + extend(address3, type7); + } + this._offset += text1.length; + } else { + address3 = null; + } + if (address3) { + elements0.push(address3); + text0 += address3.textValue; + var address7 = null; + var slice10 = null; + if (this._input.length > this._offset) { + slice10 = this._input.substring(this._offset, this._offset + 1); + } else { + slice10 = null; + } + if (slice10 === "]") { + var klass8 = this.constructor.SyntaxNode; + var type8 = null; + address7 = new klass8("]", this._offset, []); + if (typeof type8 === "object") { + extend(address7, type8); + } + this._offset += 1; + } else { + address7 = null; + var slice11 = null; + if (this._input.length > this._offset) { + slice11 = this._input.substring(this._offset, this._offset + 1); + } else { + slice11 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"]\""}; + } + } + if (address7) { + elements0.push(address7); + text0 += address7.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass9 = this.constructor.SyntaxNode; + var type9 = find(this.constructor, "CharClass"); + address0 = new klass9(text0, this._offset, elements0, labelled0); + if (typeof type9 === "object") { + extend(address0, type9); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["char_class_expression"][index0] = address0; + }, + __consume__label: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["label"] = this._nodeCache["label"] || {}; + var cached = this._nodeCache["label"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + address1 = this.__consume__identifier(); + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.identifier = address1; + var address2 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === ":") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address2 = new klass0(":", this._offset, []); + if (typeof type0 === "object") { + extend(address2, type0); + } + this._offset += 1; + } else { + address2 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\":\""}; + } + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address0 = new klass1(text0, this._offset, elements0, labelled0); + if (typeof type1 === "object") { + extend(address0, type1); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["label"][index0] = address0; + }, + __consume__object_identifier: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["object_identifier"] = this._nodeCache["object_identifier"] || {}; + var cached = this._nodeCache["object_identifier"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + address1 = this.__consume__identifier(); + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + labelled0.identifier = address1; + var address2 = null; + var remaining0 = 0, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var index3 = this._offset, elements2 = [], labelled1 = {}, text2 = ""; + var address4 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === ".") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address4 = new klass0(".", this._offset, []); + if (typeof type0 === "object") { + extend(address4, type0); + } + this._offset += 1; + } else { + address4 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\".\""}; + } + } + if (address4) { + elements2.push(address4); + text2 += address4.textValue; + var address5 = null; + address5 = this.__consume__identifier(); + if (address5) { + elements2.push(address5); + text2 += address5.textValue; + labelled1.identifier = address5; + } else { + elements2 = null; + this._offset = index3; + } + } else { + elements2 = null; + this._offset = index3; + } + if (elements2) { + this._offset = index3; + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1(text2, this._offset, elements2, labelled1); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += text2.length; + } else { + address3 = null; + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2(text1, this._offset, elements1); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["object_identifier"][index0] = address0; + }, + __consume__identifier: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["identifier"] = this._nodeCache["identifier"] || {}; + var cached = this._nodeCache["identifier"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset, elements0 = [], labelled0 = {}, text0 = ""; + var address1 = null; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 && /^[a-zA-Z_$]/.test(slice0)) { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address1 = new klass0(slice0, this._offset, []); + if (typeof type0 === "object") { + extend(address1, type0); + } + this._offset += 1; + } else { + address1 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[a-zA-Z_$]"}; + } + } + if (address1) { + elements0.push(address1); + text0 += address1.textValue; + var address2 = null; + var remaining0 = 0, index2 = this._offset, elements1 = [], text1 = "", address3 = true; + while (address3) { + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 && /^[a-zA-Z0-9_$]/.test(slice2)) { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address3 = new klass1(slice2, this._offset, []); + if (typeof type1 === "object") { + extend(address3, type1); + } + this._offset += 1; + } else { + address3 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[a-zA-Z0-9_$]"}; + } + } + if (address3) { + elements1.push(address3); + text1 += address3.textValue; + remaining0 -= 1; + } + } + if (remaining0 <= 0) { + this._offset = index2; + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address2 = new klass2(text1, this._offset, elements1); + if (typeof type2 === "object") { + extend(address2, type2); + } + this._offset += text1.length; + } else { + address2 = null; + } + if (address2) { + elements0.push(address2); + text0 += address2.textValue; + } else { + elements0 = null; + this._offset = index1; + } + } else { + elements0 = null; + this._offset = index1; + } + if (elements0) { + this._offset = index1; + var klass3 = this.constructor.SyntaxNode; + var type3 = null; + address0 = new klass3(text0, this._offset, elements0, labelled0); + if (typeof type3 === "object") { + extend(address0, type3); + } + this._offset += text0.length; + } else { + address0 = null; + } + return this._nodeCache["identifier"][index0] = address0; + }, + __consume__quantifier: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["quantifier"] = this._nodeCache["quantifier"] || {}; + var cached = this._nodeCache["quantifier"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var index1 = this._offset; + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 === "?") { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address0 = new klass0("?", this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"?\""}; + } + } + if (address0) { + } else { + this._offset = index1; + var slice2 = null; + if (this._input.length > this._offset) { + slice2 = this._input.substring(this._offset, this._offset + 1); + } else { + slice2 = null; + } + if (slice2 === "*") { + var klass1 = this.constructor.SyntaxNode; + var type1 = null; + address0 = new klass1("*", this._offset, []); + if (typeof type1 === "object") { + extend(address0, type1); + } + this._offset += 1; + } else { + address0 = null; + var slice3 = null; + if (this._input.length > this._offset) { + slice3 = this._input.substring(this._offset, this._offset + 1); + } else { + slice3 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"*\""}; + } + } + if (address0) { + } else { + this._offset = index1; + var slice4 = null; + if (this._input.length > this._offset) { + slice4 = this._input.substring(this._offset, this._offset + 1); + } else { + slice4 = null; + } + if (slice4 === "+") { + var klass2 = this.constructor.SyntaxNode; + var type2 = null; + address0 = new klass2("+", this._offset, []); + if (typeof type2 === "object") { + extend(address0, type2); + } + this._offset += 1; + } else { + address0 = null; + var slice5 = null; + if (this._input.length > this._offset) { + slice5 = this._input.substring(this._offset, this._offset + 1); + } else { + slice5 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "\"+\""}; + } + } + if (address0) { + } else { + this._offset = index1; + } + } + } + return this._nodeCache["quantifier"][index0] = address0; + }, + __consume__space: function(input) { + var address0 = null, index0 = this._offset; + this._nodeCache["space"] = this._nodeCache["space"] || {}; + var cached = this._nodeCache["space"][index0]; + if (cached) { + this._offset += cached.textValue.length; + return cached; + } + var slice0 = null; + if (this._input.length > this._offset) { + slice0 = this._input.substring(this._offset, this._offset + 1); + } else { + slice0 = null; + } + if (slice0 && /^[\s\n\r\t]/.test(slice0)) { + var klass0 = this.constructor.SyntaxNode; + var type0 = null; + address0 = new klass0(slice0, this._offset, []); + if (typeof type0 === "object") { + extend(address0, type0); + } + this._offset += 1; + } else { + address0 = null; + var slice1 = null; + if (this._input.length > this._offset) { + slice1 = this._input.substring(this._offset, this._offset + 1); + } else { + slice1 = null; + } + if (!this.error || this.error.offset <= this._offset) { + this.error = this.constructor.lastError = {input: this._input, offset: this._offset, expected: "[\\s\\n\\r\\t]"}; + } + } + return this._nodeCache["space"][index0] = address0; + } + }; + + var Parser = function(input) { + this._input = input; + this._offset = 0; + this._nodeCache = {}; + }; + + Parser.prototype.parse = function() { + var result = this.__consume__grammar(); + if (result && this._offset === this._input.length) { + return result; + } + if (!(this.error)) { + this.error = {input: this._input, offset: this._offset, expected: ""}; + } + var message = formatError(this.error); + var error = new Error(message); + throw error; + }; + + Parser.parse = function(input) { + var parser = new Parser(input); + return parser.parse(); + }; + + extend(Parser.prototype, Grammar); + + var SyntaxNode = function(textValue, offset, elements, properties) { + this.textValue = textValue; + this.offset = offset; + this.elements = elements || []; + if (!properties) return; + for (var key in properties) this[key] = properties[key]; + }; + + SyntaxNode.prototype.forEach = function(block, context) { + for (var i = 0, n = this.elements.length; i < n; i++) { + block.call(context, this.elements[i], i); + } + }; + + Parser.SyntaxNode = SyntaxNode; + + if (typeof require === "function" && typeof exports === "object") { + exports.Grammar = Grammar; + exports.Parser = Parser; + exports.parse = Parser.parse; + + if (typeof Canopy !== "undefined") { + Canopy.MetaGrammar = Grammar; + Canopy.MetaGrammarParser = Parser; + Canopy.MetaGrammarParser.formatError = formatError; + } + } else { + var namespace = this; + namespace = namespace.Canopy = namespace.Canopy || {}; + Canopy.MetaGrammar = Grammar; + Canopy.MetaGrammarParser = Parser; + Canopy.MetaGrammarParser.formatError = formatError; + } +})(); + + +Canopy.Builder = function(parent) { + if (parent) { + this._parent = parent; + this._indentLevel = parent._indentLevel; + } else { + this._buffer = ''; + this._indentLevel = 0; + } + this._methodSeparator = ''; + this._varIndex = {}; +}; + +Canopy.extend(Canopy.Builder.prototype, { + serialize: function() { + return this._buffer; + }, + + write: function(string) { + if (this._parent) return this._parent.write(string); + this._buffer += string; + }, + + indent_: function(block, context) { + this._indentLevel += 1; + block.call(context, this); + this._indentLevel -= 1; + }, + + newline_: function() { + this.write('\n'); + var i = this._indentLevel; + while (i--) this.write(' '); + }, + + delimitField_: function() { + this.write(this._methodSeparator); + this._methodSeparator = ','; + }, + + line_: function(source) { + this.newline_(); + this.write(source + ';'); + }, + + input_: function() { + return 'this._input'; + }, + + offset_: function() { + return 'this._offset'; + }, + + slice_: function(length) { + var slice = this.tempVar_('slice'), input = this.input_(), of = this.offset_(); + this.if_(input + '.length > ' + of, function(builder) { + builder.line_(slice + ' = ' + input + '.substring(' + of + ', ' + of + ' + ' + length + ')'); + }); + this.else_(function(builder) { + builder.line_(slice + ' = null'); + }); + return slice; + }, + + syntaxNode_: function(address, nodeType, expression, bump, elements, labelled) { + elements = ', ' + (elements || '[]'); + labelled = labelled ? ', ' + labelled : ''; + + var klass = this.tempVar_('klass', 'this.constructor.SyntaxNode'), + type = this.findType_(nodeType), + of = ', ' + this.offset_(); + + this.line_(address + ' = new ' + klass + '(' + expression + of + elements + labelled + ')'); + this.extendNode_(address, type); + this.line_(this.offset_() + ' += ' + bump); + }, + + findType_: function(nodeType) { + if (nodeType) + return this.tempVar_('type', 'find(this.constructor, "' + nodeType + '")'); + else + return this.tempVar_('type', 'null'); + }, + + extendNode_: function(address, nodeType) { + if (!nodeType) return; + this.if_('typeof ' + nodeType + ' === "object"', function(builder) { + builder.line_('extend(' + address + ', ' + nodeType + ')'); + }); + }, + + failure_: function(address, expected) { + this.line_(address + ' = null'); + var input = this.input_(), of = this.offset_(), slice = this.slice_(1); + var error = 'this.error = this.constructor.lastError'; + expected = expected.replace(/\\/g, '\\\\').replace(/"/g, '\\"'); + this.if_('!this.error || this.error.offset <= ' + of, function(builder) { + builder.line_(error + ' = {input: ' + input + + ', offset: ' + of + + ', expected: "' + expected + '"}'); + }); + }, + + namespace_: function(objectName) { + var parts = objectName.split('.'); + this.var_('namespace', 'this'); + for (var i = 0, n = parts.length; i < n - 1; i++) + this.line_('namespace = namespace.' + parts[i] + ' = namespace.' + parts[i] + ' || {}'); + }, + + closure_: function(block, context) { + this.write('(function() {'); + new Canopy.Builder(this).indent_(block, context); + this.newline_(); + this.write('})();'); + this.newline_(); + this.newline_(); + }, + + function_: function(name, args, block, context) { + this.newline_(); + this.write(name + ' = function(' + args.join(', ') + ') {'); + new Canopy.Builder(this).indent_(block, context); + this.newline_(); + this.write('};'); + this.newline_(); + }, + + module_: function(name, block, context) { + this.newline_(); + this.write(name + ' = {'); + new Canopy.Builder(this).indent_(block, context); + this.newline_(); + this.write('};'); + }, + + field_: function(name, value) { + this.delimitField_(); + this.newline_(); + this.write(name + ': ' + value); + }, + + method_: function(name, args, block, context) { + this.delimitField_(); + this.newline_(); + this.write(name + ': function(' + args.join(', ') + ') {'); + this._varIndex = {}; + this.indent_(block, context); + this.newline_(); + this.write('}'); + }, + + ivar_: function(name, value) { + this.line_('this._' + name + ' = ' + value); + }, + + var_: function() { + for (var i = 0, n = arguments.length; i < n; i += 2) + this.line_('var ' + arguments[i] + ' = ' + arguments[i+1]); + }, + + tempVar_: function(name, value) { + this._varIndex[name] = this._varIndex[name] || 0; + var varName = name + this._varIndex[name]; + this._varIndex[name] += 1; + this.var_(varName, (value === undefined) ? 'null' : value); + return varName; + }, + + tempVars_: function(vars) { + var names = {}, code = [], varName; + for (var name in vars) { + this._varIndex[name] = this._varIndex[name] || 0; + varName = name + this._varIndex[name]; + this._varIndex[name] += 1; + code.push(varName + ' = ' + vars[name]); + names[name] = varName; + } + this.line_('var ' + code.join(', ')); + return names; + }, + + conditional_: function(kwd, condition, block, context) { + this.newline_(); + this.write(kwd + ' (' + condition + ') {'); + this.indent_(block, context); + this.newline_(); + this.write('}'); + }, + + for_: function(condition, block, context) { + this.conditional_('for', condition, block, context); + }, + + while_: function(condition, block, context) { + this.conditional_('while', condition, block, context); + }, + + if_: function(condition, block, context) { + this.conditional_('if', condition, block, context); + }, + + unless_: function(condition, block, context) { + this.conditional_('if', '!(' + condition + ')', block, context); + }, + + else_: function(block, context) { + this.write(' else {'); + this.indent_(block, context); + this.newline_(); + this.write('}'); + }, + + return_: function(expression) { + this.line_('return ' + expression); + } +}); + + +Canopy.Compiler = function(grammarText) { + this._grammarText = grammarText; +}; + +Canopy.extend(Canopy.Compiler.prototype, { + parseTree: function() { + if (this._tree) return this._tree; + var P = Canopy.MetaGrammarParser, message; + + this._tree = P.parse(this._grammarText); + if (this._tree) return this._tree; + + message = P.formatError(P.lastError); + throw new Error(message); + }, + + toSexp: function(tree) { + return this.parseTree().toSexp(); + }, + + toSource: function() { + var builder = new Canopy.Builder(); + this.parseTree().compile(builder); + return builder.serialize(); + } +}); + + +Canopy.Compiler.Grammar = { + grammarName: function() { + return this.grammar_name.object_identifier.textValue + }, + + toSexp: function() { + var sexp = ['grammar', this.grammarName()]; + this.rules.forEach(function(rule) { + sexp.push(rule.grammar_rule.toSexp()); + }); + return sexp; + }, + + compile: function(builder) { + builder.closure_(function(builder) { + builder.line_('var extend = ' + Canopy.extend.toString()); + builder.newline_(); + builder.line_('var find = ' + Canopy.find.toString()); + builder.newline_(); + builder.line_('var formatError = ' + Canopy.formatError.toString()); + builder.newline_(); + + builder.module_('var Grammar', function(builder) { + this.rules.forEach(function(rule) { + rule.grammar_rule.compile(builder); + }); + }, this); + builder.newline_(); + + var grammar = this.grammarName(), + parser = this.grammarName() + 'Parser', + namespace = /\./.test(grammar) ? grammar.replace(/\.[^\.]+$/g, '').split('.') : [], + root = this.rules.elements[0].grammar_rule.name(); + + builder.function_('var Parser', ['input'], function(builder) { + builder.ivar_('input', 'input'); + builder.ivar_('offset', '0'); + builder.ivar_('nodeCache', '{}'); + }); + builder.function_('Parser.prototype.parse', [], function(builder) { + var input = builder.input_(), + of = builder.offset_(); + + builder.var_('result', 'this.__consume__' + root + '()'); + + builder.if_('result && ' + of + ' === ' + input + '.length', function(builder) { + builder.return_('result'); + }); + builder.unless_('this.error', function(builder) { + builder.line_('this.error = {input: ' + input + ', offset: ' + of + ', expected: ""}'); + }); + builder.var_('message', 'formatError(this.error)'); + builder.var_('error', 'new Error(message)'); + builder.line_('throw error'); + }); + builder.function_('Parser.parse', ['input'], function(builder) { + builder.var_('parser', 'new Parser(input)'); + builder.return_('parser.parse()'); + }); + builder.line_('extend(Parser.prototype, Grammar)'); + builder.newline_(); + + builder.function_('var SyntaxNode', ['textValue', 'offset', 'elements', 'properties'], function(builder) { + builder.line_('this.textValue = textValue'); + builder.line_('this.offset = offset'); + builder.line_('this.elements = elements || []'); + + builder.line_('if (!properties) return'); + builder.line_('for (var key in properties) this[key] = properties[key]'); + }); + builder.function_('SyntaxNode.prototype.forEach', ['block', 'context'], function(builder) { + builder.for_('var i = 0, n = this.elements.length; i < n; i++', function(builder) { + builder.line_('block.call(context, this.elements[i], i)'); + }); + }); + builder.line_('Parser.SyntaxNode = SyntaxNode'); + + var expose = function(builder) { + builder.line_(grammar + ' = Grammar'); + builder.line_(parser + ' = Parser'); + builder.line_(parser + '.formatError = formatError'); + }; + + var n = namespace.length, namespaceCondition; + if (n > 0) { + namespaceCondition = []; + for (var i = 0; i < n; i++) + namespaceCondition.push('typeof ' + namespace.slice(0,i+1).join('.') + ' !== "undefined"'); + namespaceCondition = namespaceCondition.join(' && '); + } + + builder.newline_(); + builder.if_('typeof require === "function" && typeof exports === "object"', function(builder) { + builder.line_('exports.Grammar = Grammar'); + builder.line_('exports.Parser = Parser'); + builder.line_('exports.parse = Parser.parse'); + builder.newline_(); + if (namespaceCondition) + builder.if_(namespaceCondition, expose); + }); + builder.else_(function(builder) { + builder.namespace_(grammar); + expose(builder); + }); + }, this); + } +}; + + +Canopy.Compiler.GrammarRule = { + name: function() { + return this.identifier.textValue; + }, + + toSexp: function() { + return ['rule', this.name(), this.parsing_expression.toSexp()]; + }, + + compile: function(builder) { + var name = this.name(); + + builder.method_('__consume__' + name, ['input'], function() { + var temp = builder.tempVars_({address: 'null', index: builder.offset_()}), + address = temp.address, + offset = temp.index, + cacheAddr = 'this._nodeCache["' + name + '"][' + offset + ']'; + + builder.line_('this._nodeCache["' + name + '"] = this._nodeCache["' + name + '"] || {}'); + builder.var_('cached', cacheAddr); + + builder.if_('cached', function(builder) { + builder.line_(builder.offset_() + ' += cached.textValue.length'); + builder.return_('cached'); + }, this); + + this.parsing_expression.compile(builder, address); + + builder.return_(cacheAddr + ' = ' + address); + }, this); + } +}; + + +Canopy.Compiler.Choice = { + expressions: function() { + if (this._expressions) return this._expressions; + this._expressions = [this.first_part]; + this.rest.forEach(function(choice) { + this._expressions.push(choice.expression); + }, this); + return this._expressions; + }, + + toSexp: function() { + var sexp = ['choice']; + Canopy.forEach(this.expressions(), function(expression) { + sexp.push(expression.toSexp()); + }); + return sexp; + }, + + compile: function(builder, address, nodeType) { + var startOffset = builder.tempVar_('index', builder.offset_()); + this._compileChoices(builder, 0, address, nodeType, startOffset); + }, + + _compileChoices: function(builder, index, address, nodeType, startOffset) { + var expressions = this.expressions(); + if (index === expressions.length) return; + + expressions[index].compile(builder, address); + + builder.if_(address, function(builder) { + if (nodeType) { + var type = builder.findType_(nodeType); + builder.extendNode_(address, type); + } + }); + builder.else_(function(builder) { + builder.line_(builder.offset_() + ' = ' + startOffset); + this._compileChoices(builder, index + 1, address, nodeType, startOffset); + }, this); + } +}; + + +Canopy.Compiler.ChoicePart = { + nodeType: function() { + var element = this.elements[1].type_expression; + return element ? element.object_identifier.textValue : null; + }, + + toSexp: function() { + var sexp = this.elements[0].toSexp(), type; + if (type = this.nodeType()) sexp = ['type', type, sexp]; + return sexp; + }, + + compile: function(builder, address) { + this.elements[0].compile(builder, address, this.nodeType()); + } +}; + + +Canopy.Compiler.AnyChar = { + toSexp: function() { + return ['any-char']; + }, + + compile: function(builder, address, nodeType) { + var temp = builder.tempVar_('temp', builder.slice_(1)); + + builder.if_(temp + ' === null', function(builder) { + builder.failure_(address, ''); + }); + builder.else_(function(builder) { + builder.syntaxNode_(address, nodeType, temp, 1); + }); + } +}; + + +Canopy.Compiler.CharClass = { + toSexp: function() { + return ['char-class', this.textValue]; + }, + + compile: function(builder, address, nodeType) { + var regex = '/^' + this.textValue + '/', + slice = builder.slice_(1); + + builder.if_(slice + ' && ' + regex + '.test(' + slice + ')', function(builder) { + builder.syntaxNode_(address, nodeType, slice, 1); + }); + builder.else_(function(builder) { + builder.failure_(address, this.textValue); + }, this); + } +}; + + +Canopy.Compiler.String = { + toSexp: function() { + return ['string', eval(this.textValue)]; + }, + + compile: function(builder, address, nodeType) { + var string = this.textValue, + length = eval(this.textValue).length; + + builder.if_(builder.slice_(length) + ' === ' + string, function(builder) { + builder.syntaxNode_(address, nodeType, string, length); + }); + builder.else_(function(builder) { + builder.failure_(address, this.textValue); + }, this); + } +}; + + +Canopy.Compiler.CIString = { + toSexp: function() { + return ['ci-string', this.stringValue()]; + }, + + compile: function(builder, address, nodeType) { + var string = this.stringValue(), + length = string.length, + temp = builder.tempVar_('temp', builder.slice_(length)), + tlc = '.toLowerCase()'; + + builder.if_(temp + tlc + ' === "' + string + '"' + tlc, function(builder) { + builder.syntaxNode_(address, nodeType, temp, length); + }); + builder.else_(function(builder) { + builder.failure_(address, this.textValue); + }, this); + }, + + stringValue: function() { + var string = '"' + this.elements[1].textValue + '"'; + return eval(string); + } +}; + + +Canopy.Compiler.Predicate = { + atomic: function() { + var expression = this.atom; + return expression.parsing_expression || expression; + }, + + toSexp: function() { + var expression = this.atomic(), + table = {'&': 'and', '!': 'not'}, + predicate = table[this.predicate.textValue]; + + return [predicate, expression.toSexp()]; + }, + + compile: function(builder, address, nodeType) { + var startOffset = builder.tempVar_('index', builder.offset_()), + table = {'&': 'if_', '!': 'unless_'}, + branch = table[this.predicate.textValue]; + + this.atomic().compile(builder, address); + builder.line_(builder.offset_() + ' = ' + startOffset); + + builder[branch](address, function(builder) { + builder.syntaxNode_(address, nodeType, '""', 0); + }); + builder.else_(function(builder) { + builder.line_(address + ' = null'); + }); + } +}; + + +Canopy.Compiler.Repeat = { + QUANTITIES: {'*': 0, '+': 1}, + + atomic: function() { + var expression = this.atom; + return expression.parsing_expression || expression; + }, + + toSexp: function() { + var expression = this.atomic(), + sexp = expression.toSexp(); + + sexp = expression.toSexp(); + switch (this.quantifier.textValue) { + case '*': sexp = ['repeat', 0, sexp]; break; + case '+': sexp = ['repeat', 1, sexp]; break; + case '?': sexp = ['maybe', sexp]; break; + } + return sexp; + }, + + compile: function(builder, address, nodeType) { + var quantifier = this.quantifier.textValue; + + if (quantifier === '?') return this._compileMaybe(builder, address, nodeType); + + var minimum = this.QUANTITIES[quantifier], + temp = builder.tempVars_({ + remaining: minimum, + index: builder.offset_(), + elements: '[]', + text: '""', + address: 'true' + }), + + remaining = temp.remaining, + startOffset = temp.index, + elements = temp.elements, + textValue = temp.text, + elAddr = temp.address; + + builder.while_(elAddr, function(builder) { + this.atomic().compile(builder, elAddr); + builder.if_(elAddr, function(builder) { + builder.line_(elements + '.push(' + elAddr + ')'); + builder.line_(textValue + ' += ' + elAddr + '.textValue'); + builder.line_(remaining + ' -= 1'); + }); + }, this); + + builder.if_(remaining + ' <= 0', function(builder) { + builder.line_(builder.offset_() + ' = ' + startOffset); + builder.syntaxNode_(address, nodeType, textValue, textValue + '.length', elements); + }); + builder.else_(function(builder) { + builder.line_(address + ' = null'); + }); + }, + + _compileMaybe: function(builder, address, nodeType) { + var startOffset = builder.tempVar_('index', builder.offset_()); + this.atomic().compile(builder, address); + + builder.if_(address, function(builder) { + if (nodeType) { + var type = builder.findType_(nodeType); + builder.extendNode_(address, type); + } + }); + builder.else_(function(builder) { + builder.line_(builder.offset_() + ' = ' + startOffset); + builder.syntaxNode_(address, nodeType, '""', 0); + }); + } +}; + + +Canopy.Compiler.Sequence = { + expressions: function() { + if (this._expressions) return this._expressions; + this._expressions = [this.first_part]; + this.rest.forEach(function(part) { + this._expressions.push(part.expression); + }, this); + return this._expressions; + }, + + toSexp: function() { + var sexp = ['sequence']; + Canopy.forEach(this.expressions(), function(expression) { + sexp.push(expression.toSexp()); + }); + return sexp; + }, + + compile: function(builder, address, nodeType) { + var temp = builder.tempVars_({ + index: builder.offset_(), + elements: '[]', + labelled: '{}', + text: '""' + }); + + var startOffset = temp.index, + elements = temp.elements, + labelled = temp.labelled, + textValue = temp.text; + + this._compileExpressions(builder, 0, startOffset, elements, labelled, textValue); + builder.if_(elements, function(builder) { + builder.line_(builder.offset_() + ' = ' + startOffset); + builder.syntaxNode_(address, nodeType, textValue, textValue + '.length', elements, labelled); + }); + builder.else_(function(builder) { + builder.line_(address + ' = null'); + }); + }, + + _compileExpressions: function(builder, index, startOffset, elements, labelled, textValue) { + var expressions = this.expressions(); + if (index === expressions.length) return; + + var expAddr = builder.tempVar_('address'), + label = expressions[index].label(); + + expressions[index].compile(builder, expAddr); + + builder.if_(expAddr, function(builder) { + builder.line_(elements + '.push(' + expAddr + ')'); + builder.line_(textValue + ' += ' + expAddr + '.textValue'); + if (label) builder.line_(labelled + '.' + label + ' = ' + expAddr); + + this._compileExpressions(builder, index + 1, startOffset, elements, labelled, textValue); + + }, this); + builder.else_(function(builder) { + builder.line_(elements + ' = null'); + builder.line_(builder.offset_() + ' = ' + startOffset); + }); + } +}; + + +Canopy.Compiler.SequencePart = { + atomic: function() { + var expression = this.expression; + return expression.parsing_expression || expression; + }, + + label: function() { + var element = this.elements[0].identifier, + expression = this.atomic(); + + if (element) return element.textValue; + if (expression.referenceName) return expression.referenceName(); + + return null; + }, + + toSexp: function() { + var expression = this.atomic(), + label = this.label(), + sexp = expression.toSexp(); + + if (element = this.elements[0].identifier) + sexp = ['label', label, sexp]; + + return sexp; + }, + + compile: function(builder, address, nodeType) { + return this.atomic().compile(builder, address, nodeType); + } +}; + + +Canopy.Compiler.Reference = { + referenceName: function() { + return this.identifier.textValue; + }, + + toSexp: function() { + return ['reference', this.referenceName()]; + }, + + compile: function(builder, address, nodeType) { + builder.line_(address + ' = this.__consume__' + this.referenceName() + '()'); + if (nodeType) { + var type = builder.findType_(nodeType); + builder.extendNode_(address, type); + } + } +}; + + +(function() { + for (var type in Canopy.Compiler) { + if (/^[A-Z]/.test(type)) + Canopy.MetaGrammarParser[type] = Canopy.Compiler[type]; + } + + if (typeof exports === 'object') { + module.exports = exports; + Canopy.extend(exports, Canopy); + exports.compile = Canopy.compile; + } +})(); + diff --git a/node_modules/canopy/package.json b/node_modules/canopy/package.json new file mode 100644 index 0000000..52fe42d --- /dev/null +++ b/node_modules/canopy/package.json @@ -0,0 +1,48 @@ +{ + "name": "canopy", + "description": "PEG parser compiler for JavaScript", + "homepage": "http://canopy.jcoglan.com", + "author": { + "name": "James Coglan", + "email": "jcoglan@gmail.com", + "url": "http://jcoglan.com/" + }, + "keywords": [ + "parser", + "compiler", + "peg" + ], + "version": "0.2.0", + "engines": { + "node": ">=0.4.0" + }, + "main": "./lib/canopy.js", + "bin": { + "canopy": "./bin/canopy" + }, + "preferGlobal": true, + "devDependencies": { + "jsclass": "" + }, + "scripts": { + "test": "node spec/console.js" + }, + "bugs": { + "url": "http://github.com/jcoglan/canopy/issues" + }, + "license": { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + }, + "repository": { + "type": "git", + "url": "git://github.com/jcoglan/canopy.git" + }, + "readme": "# Canopy\n\nCanopy is a parser compiler for JavaScript, based on [Parsing Expression\nGrammars][1] and heavily influenced by [Treetop][2].\n\n[1]: http://en.wikipedia.org/wiki/Parsing_expression_grammar\n[2]: http://treetop.rubyforge.org/\n\nFor usage documentation see [canopy.jcoglan.com](http://canopy.jcoglan.com).\n\n\n## Building and testing Canopy\n\n git clone git://github.com/jcoglan/canopy.git\n cd canopy\n gem install jake\n npm install\n jake\n npm test\n\nCanopy should work on a wide range of JavaScript runtimes, for example:\n\n v8 spec/console.js\n rhino spec/console.js\n\nIt should also run in all major web browsers:\n\n open spec/browser.html\n\n\n## License\n\nSee `LICENSE.txt`.\n\n", + "readmeFilename": "README.markdown", + "_id": "canopy@0.2.0", + "dist": { + "shasum": "60480e6c8d1c30ce634c48d7d82327db7fe5bcb0" + }, + "_from": "canopy" +} From eed5b58cd86cef153c16581c69b39f01425a52b6 Mon Sep 17 00:00:00 2001 From: Iftah Haimovitch Date: Wed, 16 Jan 2013 16:12:05 +0200 Subject: [PATCH 05/10] fix Charset class serialization --- app/assets/javascripts/grammerClasses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/grammerClasses.js b/app/assets/javascripts/grammerClasses.js index b14f40b..05295dc 100644 --- a/app/assets/javascripts/grammerClasses.js +++ b/app/assets/javascripts/grammerClasses.js @@ -196,7 +196,7 @@ RegexperClasses = { return this.invert.textValue == '^' }, content: function() { - return match_spec.elements; + return this.match_spec.elements; }, to_obj: function() { var content = this.content(); From 1de15312fdfeb5740c328fbd3cc7f37d13839b3d Mon Sep 17 00:00:00 2001 From: Iftah Haimovitch Date: Wed, 16 Jan 2013 16:20:40 +0200 Subject: [PATCH 06/10] fixed alternate regexp content --- app/assets/javascripts/grammerClasses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/grammerClasses.js b/app/assets/javascripts/grammerClasses.js index 05295dc..57cb971 100644 --- a/app/assets/javascripts/grammerClasses.js +++ b/app/assets/javascripts/grammerClasses.js @@ -10,7 +10,7 @@ RegexperClasses = { if (this.alternate.textValue.length == 0) return [this.match] else - return [this.match, this.alternate.regexp.content()]; + return [this.match].concat(this.alternate.regexp.content()); }, to_obj: function() { From 07d9ae849e950c819a74834baae90cdb2647fc79 Mon Sep 17 00:00:00 2001 From: Iftah Haimovitch Date: Tue, 12 Feb 2013 03:29:20 +0200 Subject: [PATCH 07/10] oops, added missing 'any-char' file --- app/assets/javascripts/main.js | 6 ++++-- app/assets/javascripts/regexper.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 54b7417..6d0215c 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -7,7 +7,7 @@ // baseUrl: '/assets' //}); -modules = {} +modules = {}; (function() { @@ -16,6 +16,7 @@ modules = {} var base = getBase(Renderer); var text_box = getTextBox(Renderer, base); var charset = getCharset(Renderer, base); + var any_character = getAnyChar(Renderer, text_box); var escaped = getEscaped(Renderer, text_box); var literal = getLiteral(Renderer, text_box); var match = getMatch(Renderer, base, text_box); @@ -32,7 +33,8 @@ modules = {} range: range, regexp: regexp, repetition: repetition, - subexp: subexp + subexp: subexp, + any_character: any_character }; for (var k in RegexperClasses) { diff --git a/app/assets/javascripts/regexper.js b/app/assets/javascripts/regexper.js index 6442065..839600a 100644 --- a/app/assets/javascripts/regexper.js +++ b/app/assets/javascripts/regexper.js @@ -59,6 +59,7 @@ getRenderer = function() { var module_name = structure.type; var Module = modules[module_name]; + console.log("module_name: "+module_name) var module = new Module(paper, structure); module.complete(function() { complete(module); From 2b58e46bd732462f17f17f434f478b38bbe70684 Mon Sep 17 00:00:00 2001 From: Iftah Haimovitch Date: Fri, 15 Feb 2013 04:03:01 +0200 Subject: [PATCH 08/10] added highlighting by hover feature --- app/assets/javascripts/grammerClasses.js | 20 +----- app/assets/javascripts/main.js | 69 ++++++++++++------- app/assets/javascripts/regexper.js | 29 ++++++-- .../javascripts/regexper/any_character.js | 2 +- app/assets/javascripts/regexper/base.js | 47 ++++++++++++- app/assets/javascripts/regexper/charset.js | 4 +- app/assets/javascripts/regexper/escaped.js | 2 +- app/assets/javascripts/regexper/literal.js | 2 +- app/assets/javascripts/regexper/match.js | 6 +- app/assets/javascripts/regexper/range.js | 2 +- app/assets/javascripts/regexper/regexp.js | 4 +- app/assets/javascripts/regexper/repetition.js | 19 +++-- app/assets/javascripts/regexper/subexp.js | 5 +- app/assets/javascripts/regexper/text_box.js | 7 +- app/assets/stylesheets/main.css | 25 ++++++- app/public/index.html | 15 ++-- 16 files changed, 182 insertions(+), 76 deletions(-) diff --git a/app/assets/javascripts/grammerClasses.js b/app/assets/javascripts/grammerClasses.js index 57cb971..47fefa1 100644 --- a/app/assets/javascripts/grammerClasses.js +++ b/app/assets/javascripts/grammerClasses.js @@ -164,7 +164,7 @@ RegexperClasses = { } return { type: "subexp", - range: [this.offset, this.offset+this.textValue.length], + range: [this.offset, this.offset+this.textValue.length], kind: this.kind(), group: this._capture_group(), content: objContent @@ -213,23 +213,7 @@ RegexperClasses = { } } }, -// def inverted? -// invert.text_value == '^' -// end -// -// def content -// match_spec.elements -// end -// -// def to_obj -// { -// :type => :charset, -// :range => [interval.begin, interval.end], -// :inverted => inverted?, -// :content => content.map(&:to_obj) -// } -// end -// end + CharsetRange: { to_obj: function() { diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 6d0215c..240e50a 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -9,6 +9,17 @@ modules = {}; +var regExp = ""; +function highlightRange(start, stop) { + var rxDiv = document.getElementById("regexp"); + if (start === undefined) { + rxDiv.innerHTML = regExp; + } + else { + rxDiv.innerHTML = regExp.slice(0,start)+""+regExp.slice(start,stop)+""+regExp.slice(stop); + } +} + (function() { // ugly class loading, because I had problems setting up Require.js @@ -43,44 +54,50 @@ modules = {}; var input = document.getElementById('regexp_input'), error = document.getElementById('error'), - paper_container = document.getElementById('paper-container'); - - var prev_input = null; + paper_container = document.getElementById('paper-container'), + delayTimer = null; input.onkeyup = function() { - if (input.value === prev_input) { + if (input.value === regExp) { return; // key hasn't changed text } - prev_input = input.value; - paper_container.innerHTML = ''; - error.innerHTML = ''; + regExp = input.value; + highlightRange(); + if (delayTimer) { + clearTimeout(delayTimer); + } + delayTimer = setTimeout(function() { + paper_container.innerHTML = ''; + error.innerHTML = ''; - RegexperParser.Subexp.capture_group = 1; + RegexperParser.Subexp.capture_group = 1; - document.body.className = 'is-loading'; + document.body.className = 'is-loading'; - try { - var tree = RegexperParser.parse(input.value) - if (!tree) { - console.log("No tree!") - return; - } - var obj = tree.to_obj(); try { - document.body.className += ' has-results'; - Renderer.draw(paper_container, {"raw_expr":input.value,"structure":obj} , function() { - document.body.className = 'has-results'; - }); + var tree = RegexperParser.parse(input.value) + if (!tree) { + console.log("No tree!") + return; + } + var obj = tree.to_obj(); + try { + document.body.className += ' has-results'; + Renderer.draw(paper_container, {"raw_expr":input.value,"structure":obj} , function() { + document.body.className = 'has-results'; + }); + } + catch(e) { + err = e; + error.innerHTML = "Exception drawing tree:
"+ e.stack.replace(/\n/g,"
"); + } } catch(e) { err = e; - error.innerHTML = "Exception drawing tree:
"+ e.stack.replace(/\n/g,"
"); + error.innerHTML = "Exception running grammer:
"+ e.stack.replace(/\n/g,"
"); } - } - catch(e) { - err = e; - error.innerHTML = "Exception running grammer:
"+ e.stack.replace(/\n/g,"
"); - } + }, 100) + } diff --git a/app/assets/javascripts/regexper.js b/app/assets/javascripts/regexper.js index 839600a..2d956a7 100644 --- a/app/assets/javascripts/regexper.js +++ b/app/assets/javascripts/regexper.js @@ -19,6 +19,7 @@ getRenderer = function() { }, draw: function(paper_container, data, complete) { + var self = this; Raphael(paper_container, 2, 2, function() { var paper = this; @@ -33,8 +34,14 @@ getRenderer = function() { box = expression.get_box(); offset = expression.get_connection_offset(); - Regexper.draw_anchor(paper, 10, box.y + offset, box.x); - Regexper.draw_anchor(paper, box.x2 + 10, box.y + offset, box.x2); + var start = Regexper.draw_anchor(paper, 10, box.y + offset, box.x); + var end = Regexper.draw_anchor(paper, box.x2 + 10, box.y + offset, box.x2); + + start._range = [0,0]; + start.hover(self.hoverIn, self.hoverOut, start, start); + console.log(data.structure); + end._range = [data.structure.range[1],data.structure.range[1]]; + end.hover(self.hoverIn, self.hoverOut, end, end); paper.setSize(box.width + 40, box.height + 20); @@ -43,6 +50,21 @@ getRenderer = function() { }); }, + hoverIn: function() { + highlightRange(this._range[0], this._range[1]); + this._fill = this.attr('fill'); + this._stroke = this.attr('stroke'); + if (!this._hoverFill) { + this._hoverFill = "#eeee88"; + this._hoverStroke = "#888844" + } + this.attr({"fill": this._hoverFill, "stroke": this._hoverStroke }); + }, + hoverOut: function() { + highlightRange(); + this.attr({"fill": this._fill, "stroke": this._stroke }); + }, + draw_anchor: function(paper, x, y, connection) { paper.path(Raphael.fullfill('M{start.x},{start.y}H{end}', { start: { @@ -52,14 +74,13 @@ getRenderer = function() { end: connection })).attr(base_path_attrs); - paper.circle(x, y, 5).attr(base_anchor_attrs); + return paper.circle(x, y, 5).attr(base_anchor_attrs); }, render: function(paper, structure, complete) { var module_name = structure.type; var Module = modules[module_name]; - console.log("module_name: "+module_name) var module = new Module(paper, structure); module.complete(function() { complete(module); diff --git a/app/assets/javascripts/regexper/any_character.js b/app/assets/javascripts/regexper/any_character.js index 0a697df..5302f69 100644 --- a/app/assets/javascripts/regexper/any_character.js +++ b/app/assets/javascripts/regexper/any_character.js @@ -10,7 +10,7 @@ getAnyChar = function(Regexper, TextBox) { }; var AnyCharacter = function(paper, structure) { - TextBox.call(this, paper, 'any character', + TextBox.call(this, paper, structure.range, 'any character', base_text_attrs, base_rect_attrs); }; diff --git a/app/assets/javascripts/regexper/base.js b/app/assets/javascripts/regexper/base.js index bbfe0c5..fdcf18d 100644 --- a/app/assets/javascripts/regexper/base.js +++ b/app/assets/javascripts/regexper/base.js @@ -1,5 +1,6 @@ getBase = function(Regexper) { - var Base = function() { + var Base = function(range) { + this._range = range; this._contents = []; this._stack_order = []; this._completes = []; @@ -65,7 +66,49 @@ getBase = function(Regexper) { this._completes[i](); } this._completes = []; - } + }, + + bindHover: function(item, context) { + item._range = this._range; + context = context || item; + item.hover(Base.prototype.hoverIn, Base.prototype.hoverOut, context, context); + }, + + bindNoFillHover: function(item, context) { + item._range = this._range; + context = context || item; + item.hover(Base.prototype.hoverInNoFill, Base.prototype.hoverOutNoFill, context, context); + }, + + hoverIn: function() { + highlightRange(this._range[0], this._range[1]); + this._fill = this.attr('fill'); + this._stroke = this.attr('stroke'); + if (!this._hoverFill) { + this._hoverFill = "#eeee88"; + this._hoverStroke = "#888844" + } + this.attr({"fill": this._hoverFill, "stroke": this._hoverStroke }); + }, + hoverOut: function() { + highlightRange(); + this.attr({"fill": this._fill, "stroke": this._stroke }); + }, + + hoverInNoFill: function() { + highlightRange(this._range[0], this._range[1]); + this._swidth = this.attr('stroke-width'); + this._stroke = this.attr('stroke'); + if (!this._hoverStroke) { + this._strokewidth= 3; + this._hoverStroke = "#888844" + } + this.attr({'stroke-width': this._strokewidth, "stroke": this._hoverStroke }); + }, + hoverOutNoFill: function() { + highlightRange(); + this.attr({'stroke-width': this._swidth, "stroke": this._stroke }); + }, }); return Base; diff --git a/app/assets/javascripts/regexper/charset.js b/app/assets/javascripts/regexper/charset.js index 4da1dfc..baf9bef 100644 --- a/app/assets/javascripts/regexper/charset.js +++ b/app/assets/javascripts/regexper/charset.js @@ -13,7 +13,7 @@ getCharset = function(Regexper, Base) { var Charset = function(paper, structure) { var self = this; - Base.call(this); + Base.call(this, structure.range); this._box = paper.rect(0, 0, 0, 0); this._box.attr(base_box_attrs); @@ -51,6 +51,8 @@ getCharset = function(Regexper, Base) { height: self._height }); + self.bindHover(self._box); + self._height += box.height; self._mark_complete(); diff --git a/app/assets/javascripts/regexper/escaped.js b/app/assets/javascripts/regexper/escaped.js index ff73a6b..473975f 100644 --- a/app/assets/javascripts/regexper/escaped.js +++ b/app/assets/javascripts/regexper/escaped.js @@ -31,7 +31,7 @@ getEscaped = function(Regexper, TextBox) { } } - TextBox.call(this, paper, label, + TextBox.call(this, paper, structure.range, label, base_text_attrs, base_rect_attrs); }; diff --git a/app/assets/javascripts/regexper/literal.js b/app/assets/javascripts/regexper/literal.js index e0bdc31..dd54d34 100644 --- a/app/assets/javascripts/regexper/literal.js +++ b/app/assets/javascripts/regexper/literal.js @@ -9,7 +9,7 @@ getLiteral = function(Regexper, TextBox) { }; var Literal = function(paper, structure) { - TextBox.call(this, paper, '"' + structure.content + '"', + TextBox.call(this, paper, structure.range, '"' + structure.content + '"', base_text_attrs, base_rect_attrs); }; diff --git a/app/assets/javascripts/regexper/match.js b/app/assets/javascripts/regexper/match.js index e4c846d..7899436 100644 --- a/app/assets/javascripts/regexper/match.js +++ b/app/assets/javascripts/regexper/match.js @@ -16,7 +16,7 @@ getMatch = function(Regexper, Base, TextBox) { var Match = function(paper, structure) { var self = this; - Base.call(this); + Base.call(this, structure.range); this._paper = paper; @@ -27,12 +27,12 @@ getMatch = function(Regexper, Base, TextBox) { self._contents = contents; if (structure.start) { - self._contents.unshift(new TextBox(paper, 'Start of Line', + self._contents.unshift(new TextBox(paper, [0,1], 'Start of Line', base_anchor_text_attrs, base_anchor_box_attrs)); } if (structure.end) { - self._contents.push(new TextBox(paper, 'End of Line', + self._contents.push(new TextBox(paper, [structure.range[1]-1, structure.range[1]],'End of Line', base_anchor_text_attrs, base_anchor_box_attrs)); } diff --git a/app/assets/javascripts/regexper/range.js b/app/assets/javascripts/regexper/range.js index 36a7f0b..d8dd2b1 100644 --- a/app/assets/javascripts/regexper/range.js +++ b/app/assets/javascripts/regexper/range.js @@ -8,7 +8,7 @@ getRange = function(Regexper, Base) { var Range = function(paper, structure) { var self = this; - Base.call(this); + Base.call(this, structure.range); this._dash = paper.text(0, 0, '-'); this._dash.attr(base_text_attrs); diff --git a/app/assets/javascripts/regexper/regexp.js b/app/assets/javascripts/regexper/regexp.js index 49ea509..691eb9f 100644 --- a/app/assets/javascripts/regexper/regexp.js +++ b/app/assets/javascripts/regexper/regexp.js @@ -8,7 +8,7 @@ getRegexp = function(Regexper, Base) { var Regexp = function(paper, structure) { var self = this; - Base.call(this); + Base.call(this, structure.range); this._paper = paper; @@ -72,6 +72,8 @@ getRegexp = function(Regexper, Base) { above = (box.y + offset) > (item_box.y + item_offset), path_str; + this.bindHover(box); + if (distance >= 1.5 * curve_radius) { path_str = 'M{start.x},{start.y}Q{start_control.x},{start.y} {start_control.x},{start_control.y}V{end_control.y}Q{end_control.x},{end.y} {end.x},{end.y}H{end_connector.x}'; } else { diff --git a/app/assets/javascripts/regexper/repetition.js b/app/assets/javascripts/regexper/repetition.js index aae886b..7e95f90 100644 --- a/app/assets/javascripts/regexper/repetition.js +++ b/app/assets/javascripts/regexper/repetition.js @@ -12,7 +12,7 @@ getRepetition = function(Regexper, Base) { repeat_count = structure.repeat_count, loop_desc; - Base.call(this); + Base.call(this, structure.range); this._paper = paper; @@ -127,6 +127,7 @@ getRepetition = function(Regexper, Base) { y: box.y2 - text_box.height / 2 }); } + }, _draw_lead_lines: function(item) { @@ -136,7 +137,7 @@ getRepetition = function(Regexper, Base) { item_offset = item.get_connection_offset(), path_str = 'M{start.x},{start.y}H{end.x}'; - this._paper.path(Raphael.fullfill(path_str, { + var p1 = this._paper.path(Raphael.fullfill(path_str, { start: { x: box.x, y: box.y + offset @@ -147,7 +148,9 @@ getRepetition = function(Regexper, Base) { } })).attr(base_connector_attrs).toBack(); - this._paper.path(Raphael.fullfill(path_str, { + this.bindNoFillHover(p1); + + var p2 = this._paper.path(Raphael.fullfill(path_str, { start: { x: box.x2, y: box.y + offset @@ -157,6 +160,8 @@ getRepetition = function(Regexper, Base) { y: item_box.y + item_offset } })).attr(base_connector_attrs).toBack(); + + this.bindNoFillHover(p2); }, _draw_skip_line: function() { @@ -165,7 +170,7 @@ getRepetition = function(Regexper, Base) { offset = this.get_connection_offset(), path_str = 'M{start.x},{start.y}q{radius},0 {radius},-{radius}V{top}q0,-{radius} {radius},-{radius}H{end}q{radius},0 {radius},{radius}V{bottom}q0,{radius} {radius},{radius}'; - this._paper.path(Raphael.fullfill(path_str, { + var p1 = this._paper.path(Raphael.fullfill(path_str, { start: { x: box.x, y: box.y + offset @@ -175,6 +180,8 @@ getRepetition = function(Regexper, Base) { bottom: box.y + offset - curve_radius, end: box.x2 - 2 * curve_radius })).attr(base_connector_attrs).toBack(); + + this.bindNoFillHover(p1); }, _draw_loop_line: function() { @@ -183,7 +190,7 @@ getRepetition = function(Regexper, Base) { offset = this.get_connection_offset(), path_str = 'M{start.x},{start.y}q{radius},0 {radius},{radius}V{bottom}q0,{radius} -{radius},{radius}H{end}q-{radius},0 -{radius},-{radius}V{top}q0,-{radius} {radius},-{radius}'; - this._paper.path(Raphael.fullfill(path_str, { + var p1= this._paper.path(Raphael.fullfill(path_str, { start: { x: expression_box.x2, y: box.y + offset @@ -193,6 +200,8 @@ getRepetition = function(Regexper, Base) { bottom: expression_box.y2, end: expression_box.x })).attr(base_connector_attrs).toBack(); + + this.bindNoFillHover(p1); }, get_connection_offset: function() { diff --git a/app/assets/javascripts/regexper/subexp.js b/app/assets/javascripts/regexper/subexp.js index 0ee6baf..02f4dc5 100644 --- a/app/assets/javascripts/regexper/subexp.js +++ b/app/assets/javascripts/regexper/subexp.js @@ -16,7 +16,7 @@ getSubexp = function(Regexper, Base, Regexp) { var Subexp = function(paper, structure) { var self = this, label; - Base.call(this); + Base.call(this, structure.range); this._paper = paper; @@ -41,6 +41,9 @@ getSubexp = function(Regexper, Base, Regexp) { this._text = paper.text(0, 0, label); this._text.attr(base_text_attrs); + this.bindHover(this._rect); + this.bindHover(this._text, this._rect); + this._stack_order = [this._rect, this._text]; } diff --git a/app/assets/javascripts/regexper/text_box.js b/app/assets/javascripts/regexper/text_box.js index 0956a06..d65c0ad 100644 --- a/app/assets/javascripts/regexper/text_box.js +++ b/app/assets/javascripts/regexper/text_box.js @@ -1,10 +1,10 @@ getTextBox = function(Regexper, Base) { var text_margin = 5; - var TextBox = function(paper, label, text_attrs, rect_attrs) { + var TextBox = function(paper, range, label, text_attrs, rect_attrs) { var text_box, rect_box; - Base.call(this); + Base.call(this, range); this._text = paper.text(0, 0, label); this._text.attr(text_attrs); @@ -19,6 +19,9 @@ getTextBox = function(Regexper, Base) { this._width = rect_box.width; this._height = rect_box.height; + this.bindHover(this._rect); + this.bindHover(this._text, this._rect); + this._stack_order = [this._rect, this._text]; this._mark_complete(); }; diff --git a/app/assets/stylesheets/main.css b/app/assets/stylesheets/main.css index 2dde3e7..d1b418c 100755 --- a/app/assets/stylesheets/main.css +++ b/app/assets/stylesheets/main.css @@ -30,6 +30,29 @@ header span { color: #6b6659; } +#regexp-cont { + margin-top:15px; + text-align: center; + padding: 4px; +} +#regexp { + padding: 4px; + border: 1px solid #000; + background: white; + font-size: 20px; + line-height: 20px; + white-space: pre; + font-family: courier; +} + +#regexp .highlight { + background-color: #ff7; + min-width:2px; + min-height:20px; + display:inline-block; + border: 1px solid #ffe; +} + #content .container { border: 1px solid #000; position: relative; @@ -45,7 +68,7 @@ body.has-results #content .results { display: block; } -#content span { +#container span { margin-right: 100px; } diff --git a/app/public/index.html b/app/public/index.html index eb5fcf1..e9c4e0c 100644 --- a/app/public/index.html +++ b/app/public/index.html @@ -33,12 +33,9 @@

Regexper

-
- - - - -
+ + +
@@ -46,15 +43,17 @@

Regexper

Loading
-
+
+ +