Skip to content

Instantly share code, notes, and snippets.

@vic
Created February 19, 2009 02:54
Show Gist options
  • Save vic/66701 to your computer and use it in GitHub Desktop.
Save vic/66701 to your computer and use it in GitHub Desktop.
An attempt to parse Ioke in javascript
To compile the grammar you need the antlr jar provided with ioke.
A v8 linux binary has been included to run the test.js
There seems to be a bug in the port of ioke.g, it doesnt create
tree for a simple ioke expr.
I think Ioke would be a wondeful language to have on the browser. It's very lightweight and I believe it would be wonderful to have it's homoiconic power for scripting webpages. Given that Ioke's primary platform is the JVM, I think we could develop some webapps that inject ioke code to the browser. Ioke's syntax would also allows to define web DSL
div(class: "content",
p("This is a paragraph")
script(language: "ioke",
we couldEven(call jsLibrary)))
/*
Copyright (c) 2003-2008 Terence Parr. All rights reserved.
Code licensed under the BSD License:
http://www.antlr.org/license.html
Some parts of the ANTLR class:
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
*/
/*
Some portions:
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
// create org.antlr module
if (typeof org == "undefined" || !org) {
var org = {};
}
if (typeof org.antlr == "undefined" || !org.antlr) {
/**
* The org.antlr global namespace object. If antlr is already defined, the
* existing antlr object will not be overwritten so that defined
* namespaces are preserved.
* @namespace org.antlr
*/
org.antlr = {};
}
/**
* The global JavaScript object.
*/
org.antlr.global = (function() {
return this;
}).call(null);
/**
* Returns the namespace specified and creates it if it doesn't exist.
*
* Be careful when naming packages. Reserved words may work in some browsers
* and not others. For instance, the following will fail in Safari:
* <pre>
* org.antlr.namespace("really.long.nested.namespace");
* </pre>
* This fails because "long" is a future reserved word in ECMAScript
*
* @static
* @param {String*} arguments 1-n namespaces to create
* @return {Object} A reference to the last namespace object created
* @example
* org.antlr.namespace("org.antlr.property.package");
*/
org.antlr.namespace = function() {
var a=arguments, o=null, i, j, d;
for (i=0; i<a.length; i=i+1) {
d=a[i].split(".");
o=org.antlr.global;
// ANTLR is implied, so it is ignored if it is included
for (j=0; j<d.length; j=j+1) {
o[d[j]]=o[d[j]] || {};
o=o[d[j]];
}
}
return o;
};
/**
* org.antlr.env is used to keep track of what is known about the library and
* the browsing environment
* @namespace org.antlr.env
*/
org.antlr.env = org.antlr.env || {};
/**
* Do not fork for a browser if it can be avoided. Use feature detection when
* you can. Use the user agent as a last resort. org.antlr.env.ua stores a
* version number for the browser engine, 0 otherwise. This value may or may
* not map to the version number of the browser using the engine. The value is
* presented as a float so that it can easily be used for boolean evaluation
* as well as for looking for a particular range of versions. Because of this,
* some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9
* reports 1.8).
* @namespace org.antlr.env.ua
*/
org.antlr.env.ua = function() {
var o= /** @lends org.antlr.env.ua */ {
/**
* Internet Explorer version number or 0. Example: 6
* @property ie
* @type float
*/
ie:0,
/**
* Opera version number or 0. Example: 9.2
* @property opera
* @type float
*/
opera:0,
/**
* Gecko engine revision number. Will evaluate to 1 if Gecko
* is detected but the revision could not be found. Other browsers
* will be 0. Example: 1.8
* <pre>
* Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7
* Firefox 1.5.0.9: 1.8.0.9 <-- Reports 1.8
* Firefox 2.0.0.3: 1.8.1.3 <-- Reports 1.8
* Firefox 3 alpha: 1.9a4 <-- Reports 1.9
* </pre>
* @property gecko
* @type float
*/
gecko:0,
/**
* AppleWebKit version. KHTML browsers that are not WebKit browsers
* will evaluate to 1, other browsers 0. Example: 418.9.1
* <pre>
* Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
* latest available for Mac OSX 10.3.
* Safari 2.0.2: 416 <-- hasOwnProperty introduced
* Safari 2.0.4: 418 <-- preventDefault fixed
* Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
* different versions of webkit
* Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been
* updated, but not updated
* to the latest patch.
* Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native SVG
* and many major issues fixed).
* 3.x yahoo.com, flickr:422 <-- Safari 3.x hacks the user agent
* string when hitting yahoo.com and
* flickr.com.
* Safari 3.0.4 (523.12):523.12 <-- First Tiger release - automatic update
* from 2.x via the 10.4.11 OS patch
* Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event.
* yahoo.com user agent hack removed.
*
* </pre>
* http://developer.apple.com/internet/safari/uamatrix.html
* @property webkit
* @type float
*/
webkit: 0,
/**
* The mobile property will be set to a string containing any relevant
* user agent information when a modern mobile browser is detected.
* Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
* devices with the WebKit-based browser, and Opera Mini.
* @property mobile
* @type string
*/
mobile: null,
/**
* Adobe AIR version number or 0. Only populated if webkit is detected.
* Example: 1.0
* @property air
* @type float
*/
air: 0,
/**
* Is this the Rhino interpreter?
* @property rhino
* @type Boolean
*/
rhino: false
};
var ua, m;
try {
ua = navigator.userAgent;
// Modern KHTML browsers should qualify as Safari X-Grade
if ((/KHTML/).test(ua)) {
o.webkit=1;
}
// Modern WebKit browsers are at least X-Grade
m=ua.match(/AppleWebKit\/([^\s]*)/);
if (m&&m[1]) {
o.webkit=parseFloat(m[1]);
// Mobile browser check
if (/ Mobile\//.test(ua)) {
o.mobile = "Apple"; // iPhone or iPod Touch
} else {
m=ua.match(/NokiaN[^\/]*/);
if (m) {
o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
}
}
m=ua.match(/AdobeAIR\/([^\s]*)/);
if (m) {
o.air = m[0]; // Adobe AIR 1.0 or better
}
}
if (!o.webkit) { // not webkit
// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
m=ua.match(/Opera[\s\/]([^\s]*)/);
if (m&&m[1]) {
o.opera=parseFloat(m[1]);
m=ua.match(/Opera Mini[^;]*/);
if (m) {
o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
}
} else { // not opera or webkit
m=ua.match(/MSIE\s([^;]*)/);
if (m&&m[1]) {
o.ie=parseFloat(m[1]);
} else { // not opera, webkit, or ie
m=ua.match(/Gecko\/([^\s]*)/);
if (m) {
o.gecko=1; // Gecko detected, look for revision
m=ua.match(/rv:([^\s\)]*)/);
if (m&&m[1]) {
o.gecko=parseFloat(m[1]);
}
}
}
}
}
} catch(e) {
// ignore this if we're not in a browser
}
try {
if (typeof window=="undefined" && loadClass) {
o.rhino = true;
}
} catch(e) {}
return o;
}();
/**
* JavaScript runtime library code.
* @name org.antlr.runtime
* @namespace
*/
/**
* JavaScript runtime library tree parser code.
* @name org.antlr.runtime.tree
* @namespace
*/
org.antlr.namespace("org.antlr.runtime.tree");
/**
* Provides the language utilites and extensions used by the library
* @namespace org.antlr.lang
*/
org.antlr.lang = org.antlr.lang || /** @lends org.antlr.lang */ {
/**
* Determines whether or not the provided object is an array.
* Testing typeof/instanceof/constructor of arrays across frame
* boundaries isn't possible in Safari unless you have a reference
* to the other frame to test against its Array prototype. To
* handle this case, we test well-known array properties instead.
* properties.
* @param {any} o The object being testing
* @return {boolean} the result
*/
isArray: function(o) {
if (o) {
var l = org.antlr.lang;
return l.isNumber(o.length) && l.isFunction(o.splice);
}
return false;
},
/**
* Determines whether or not the provided object is a boolean
* @param {any} o The object being testing
* @return {boolean} the result
*/
isBoolean: function(o) {
return typeof o === 'boolean';
},
/**
* Determines whether or not the provided object is a function
* @param {any} o The object being testing
* @return {boolean} the result
*/
isFunction: function(o) {
return typeof o === 'function';
},
/**
* Determines whether or not the provided object is null
* @param {any} o The object being testing
* @return {boolean} the result
*/
isNull: function(o) {
return o === null;
},
/**
* Determines whether or not the provided object is a legal number
* @param {any} o The object being testing
* @return {boolean} the result
*/
isNumber: function(o) {
return typeof o === 'number' && isFinite(o);
},
/**
* Determines whether or not the provided object is of type object
* or function
* @param {any} o The object being testing
* @return {boolean} the result
*/
isObject: function(o) {
return (o && (typeof o === 'object' || org.antlr.lang.isFunction(o))) || false;
},
/**
* Determines whether or not the provided object is a string
* @param {any} o The object being testing
* @return {boolean} the result
*/
isString: function(o) {
return typeof o === 'string';
},
/**
* Determines whether or not the provided object is undefined
* @param {any} o The object being testing
* @return {boolean} the result
*/
isUndefined: function(o) {
return typeof o === 'undefined';
},
/**
* IE will not enumerate native functions in a derived object even if the
* function was overridden. This is a workaround for specific functions
* we care about on the Object prototype.
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @private
*/
_IEEnumFix: function(r, s) {
if (org.antlr.env.ua.ie) {
var add=["toString", "valueOf"], i;
for (i=0;i<add.length;i=i+1) {
var fname=add[i],f=s[fname];
if (org.antlr.lang.isFunction(f) && f!=Object.prototype[fname]) {
r[fname]=f;
}
}
}
},
/**
* Utility to set up the prototype, constructor and superclass properties to
* support an inheritance strategy that can chain constructors and methods.
* Static members will not be inherited.
*
* @method extend
* @static
* @param {Function} subc the object to modify
* @param {Function} superc the object to inherit
* @param {Object} [overrides] additional properties/methods to add to the
* subclass prototype. These will override the
* matching items obtained from the superclass
* if present.
*/
extend: function(subc, superc, overrides) {
if (!superc||!subc) {
throw new Error("org.antlr.lang.extend failed, please check that " +
"all dependencies are included.");
}
var F = function() {};
F.prototype=superc.prototype;
subc.prototype=new F();
subc.prototype.constructor=subc;
subc.superclass=superc.prototype;
if (superc.prototype.constructor == Object.prototype.constructor) {
superc.prototype.constructor=superc;
}
if (overrides) {
for (var i in overrides) {
subc.prototype[i]=overrides[i];
}
org.antlr.lang._IEEnumFix(subc.prototype, overrides);
}
},
/**
* Applies all properties in the supplier to the receiver if the
* receiver does not have these properties yet. Optionally, one or
* more methods/properties can be specified (as additional
* parameters). This option will overwrite the property if receiver
* has it already. If true is passed as the third parameter, all
* properties will be applied and _will_ overwrite properties in
* the receiver.
*
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @param {String*|boolean} [arguments] zero or more properties methods
* to augment the receiver with. If none specified, everything
* in the supplier will be used unless it would
* overwrite an existing property in the receiver. If true
* is specified as the third parameter, all properties will
* be applied and will overwrite an existing property in
* the receiver
*/
augmentObject: function(r, s) {
if (!s||!r) {
throw new Error("Absorb failed, verify dependencies.");
}
var a=arguments, i, p, override=a[2];
if (override && override!==true) { // only absorb the specified properties
for (i=2; i<a.length; i=i+1) {
r[a[i]] = s[a[i]];
}
} else { // take everything, overwriting only if the third parameter is true
for (p in s) {
if (override || !r[p]) {
r[p] = s[p];
}
}
org.antlr.lang._IEEnumFix(r, s);
}
},
/**
* Same as org.antlr.lang.augmentObject, except it only applies prototype properties
* @see org.antlr.lang.augmentObject
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @param {String*|boolean} [arguments] zero or more properties methods
* to augment the receiver with. If none specified, everything
* in the supplier will be used unless it would overwrite an existing
* property in the receiver. if true is specified as the third
* parameter, all properties will be applied and will overwrite an
* existing property in the receiver
*/
augmentProto: function(r, s) {
if (!s||!r) {
throw new Error("Augment failed, verify dependencies.");
}
//var a=[].concat(arguments);
var a=[r.prototype,s.prototype];
for (var i=2;i<arguments.length;i=i+1) {
a.push(arguments[i]);
}
org.antlr.lang.augmentObject.apply(this, a);
},
/**
* Returns a new object containing all of the properties of
* all the supplied objects. The properties from later objects
* will overwrite those in earlier objects.
* @param arguments {Object*} the objects to merge
* @return the new merged object
*/
merge: function() {
var o={}, a=arguments;
for (var i=0, l=a.length; i<l; i=i+1) {
org.antlr.lang.augmentObject(o, a[i], true);
}
return o;
},
/**
* A convenience method for detecting a legitimate non-null value.
* Returns false for null/undefined/NaN, true for other values,
* including 0/false/''
* @param o {any} the item to test
* @return {boolean} true if it is not null/undefined/NaN || false
*/
isValue: function(o) {
var l = org.antlr.lang;
return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
},
/** @namespace org.antlr.lang.array Array convenience methods. */
array: /** @lends org.antlr.lang.array */ {
/**
* Retrieve the last element of an array. Throws an error if a is not
* an array or empty.
* @param a {Array} the array stack to peek in
* @return the last element of the array
*/
peek: function(a) {
if (!org.antlr.lang.isArray(a)) {
throw new Error("org.antlr.lang.array.peek: a is not an array.");
}
var l = a.length;
if (l<=0) {
throw new Error("org.antlr.lang.array.peek: a is empty.");
}
return a[l-1];
}
}
};
/** The set of fields needed by an abstract recognizer to recognize input
* and recover from errors etc... As a separate state object, it can be
* shared among multiple grammars; e.g., when one grammar imports another.
*
* These fields are publically visible but the actual state pointer per
* parser is protected.
*/
org.antlr.runtime.RecognizerSharedState = function() {
/** Track the set of token types that can follow any rule invocation.
* Stack grows upwards. When it hits the max, it grows 2x in size
* and keeps going.
*/
this.following = [];
this._fsp = -1;
/** This is true when we see an error and before having successfully
* matched a token. Prevents generation of more than one error message
* per error.
*/
this.errorRecovery = false;
/** The index into the input stream where the last error occurred.
* This is used to prevent infinite loops where an error is found
* but no token is consumed during recovery...another error is found,
* ad naseum. This is a failsafe mechanism to guarantee that at least
* one token/tree node is consumed for two errors.
*/
this.lastErrorIndex = -1;
/** In lieu of a return value, this indicates that a rule or token
* has failed to match. Reset to false upon valid token match.
*/
this.failed = false;
/** Did the recognizer encounter a syntax error? Track how many. */
this.syntaxErrors = 0;
/** If 0, no backtracking is going on. Safe to exec actions etc...
* If >0 then it's the level of backtracking.
*/
this.backtracking = 0;
/** An array[size num rules] of Map<Integer,Integer> that tracks
* the stop token index for each rule. ruleMemo[ruleIndex] is
* the memoization table for ruleIndex. For key ruleStartIndex, you
* get back the stop token for associated rule or MEMO_RULE_FAILED.
*
* This is only used if rule memoization is on (which it is by default).
*/
this.ruleMemo = null;
// LEXER FIELDS (must be in same state object to avoid casting
// constantly in generated code and Lexer object) :(
/** The goal of all lexer rules/methods is to create a token object.
* This is an instance variable as multiple rules may collaborate to
* create a single token. nextToken will return this object after
* matching lexer rule(s). If you subclass to allow multiple token
* emissions, then set this to the last token to be matched or
* something nonnull so that the auto token emit mechanism will not
* emit another token.
*/
this.token = null;
/** What character index in the stream did the current token start at?
* Needed, for example, to get the text for current token. Set at
* the start of nextToken.
*/
this.tokenStartCharIndex = -1;
/** The line on which the first character of the token resides */
// this.tokenStartLine;
/** The character position of first character within the line */
// this.tokenStartCharPositionInLine;
/** The channel number for the current token */
// this.channel;
/** The token type for the current token */
// this.type;
/** You can set the text for the current token to override what is in
* the input char buffer. Use setText() or can set this instance var.
*/
this.text = null;
};
org.antlr.runtime.IndexOutOfBoundsException = function(m) {
org.antlr.runtime.IndexOutOfBoundsException.superclass.constructor.call(this, m);
};
org.antlr.lang.extend(org.antlr.runtime.IndexOutOfBoundsException, Error, {
name: "org.antlr.runtime.IndexOutOfBoundsException"
});
/** The root of the ANTLR exception hierarchy.
*
* <p>To avoid English-only error messages and to generally make things
* as flexible as possible, these exceptions are not created with strings,
* but rather the information necessary to generate an error. Then
* the various reporting methods in Parser and Lexer can be overridden
* to generate a localized error message. For example, MismatchedToken
* exceptions are built with the expected token type.
* So, don't expect getMessage() to return anything.</p>
*
* <p>ANTLR generates code that throws exceptions upon recognition error and
* also generates code to catch these exceptions in each rule. If you
* want to quit upon first error, you can turn off the automatic error
* handling mechanism using rulecatch action, but you still need to
* override methods mismatch and recoverFromMismatchSet.</p>
*
* <p>In general, the recognition exceptions can track where in a grammar a
* problem occurred and/or what was the expected input. While the parser
* knows its state (such as current input symbol and line info) that
* state can change before the exception is reported so current token index
* is computed and stored at exception time. From this info, you can
* perhaps print an entire line of input not just a single token, for example.
* Better to just say the recognizer had a problem and then let the parser
* figure out a fancy report.</p>
*
* @class
* @param {org.antlr.runtime.CommonTokenStream|org.antlr.runtime.tree.TreeNodeStream|org.antlr.runtime.ANTLRStringStream} input input stream that has an exception.
* @extends Error
*
*/
org.antlr.runtime.RecognitionException = function(input) {
org.antlr.runtime.RecognitionException.superclass.constructor.call(this);
this.input = input;
this.index = input.index();
if ( input instanceof org.antlr.runtime.CommonTokenStream ) {
this.token = input.LT(1);
this.line = this.token.getLine();
this.charPositionInLine = this.token.getCharPositionInLine();
}
if ( input instanceof org.antlr.runtime.tree.TreeNodeStream ) {
this.extractInformationFromTreeNodeStream(input);
}
else if ( input instanceof org.antlr.runtime.ANTLRStringStream ) {
// Note: removed CharStream from hierarchy in JS port so checking for
// StringStream instead
this.c = input.LA(1);
this.line = input.getLine();
this.charPositionInLine = input.getCharPositionInLine();
}
else {
this.c = input.LA(1);
}
this.message = this.toString();
};
org.antlr.lang.extend(org.antlr.runtime.RecognitionException, Error,
/** @lends org.antlr.runtime.RecognitionException.prototype */
{
/**
* What input stream did the error occur in?
*/
input: null,
/** What is index of token/char were we looking at when the error occurred?
* @type Number
*/
index: null,
/** The current Token when an error occurred. Since not all streams
* can retrieve the ith Token, we have to track the Token object.
* For parsers. Even when it's a tree parser, token might be set.
* @type org.antlr.runtime.CommonToken
*/
token: null,
/** If this is a tree parser exception, node is set to the node with
* the problem.
* @type Object
*/
node: null,
/** The current char when an error occurred. For lexers.
* @type Number
*/
c: null,
/** Track the line at which the error occurred in case this is
* generated from a lexer. We need to track this since the
* unexpected char doesn't carry the line info.
* @type Number
*/
line: null,
/** The exception's class name.
* @type String
*/
name: "org.antlr.runtime.RecognitionException",
/** Position in the line where exception occurred.
* @type Number
*/
charPositionInLine: null,
/** If you are parsing a tree node stream, you will encounter som
* imaginary nodes w/o line/col info. We now search backwards looking
* for most recent token with line/col info, but notify getErrorHeader()
* that info is approximate.
* @type Boolean
*/
approximateLineInfo: null,
/** Gather exception information from input stream.
* @param {org.antlr.runtime.CommonTokenStream|org.antlr.runtime.tree.TreeNodeStream|org.antlr.runtime.ANTLRStringStream} input input stream that has an exception.
*/
extractInformationFromTreeNodeStream: function(input) {
var nodes = input,
priorNode,
priorPayLoad,
type,
text,
i;
this.node = nodes.LT(1);
var adaptor = nodes.getTreeAdaptor(),
payload = adaptor.getToken(this.node);
if ( payload ) {
this.token = payload;
if ( payload.getLine()<= 0 ) {
// imaginary node; no line/pos info; scan backwards
i = -1;
priorNode = nodes.LT(i);
while ( priorNode ) {
priorPayload = adaptor.getToken(priorNode);
if ( priorPayload && priorPayload.getLine()>0 ) {
// we found the most recent real line / pos info
this.line = priorPayload.getLine();
this.charPositionInLine = priorPayload.getCharPositionInLine();
this.approximateLineInfo = true;
break;
}
--i;
priorNode = nodes.LT(i);
}
}
else { // node created from real token
this.line = payload.getLine();
this.charPositionInLine = payload.getCharPositionInLine();
}
}
else if ( this.node instanceof org.antlr.runtime.tree.CommonTree) {
this.line = this.node.getLine();
this.charPositionInLine = this.node.getCharPositionInLine();
if ( this.node instanceof org.antlr.runtime.tree.CommonTree) {
this.token = this.node.token;
}
}
else {
type = adaptor.getType(this.node);
text = adaptor.getText(this.node);
this.token = new org.antlr.runtime.CommonToken(type, text);
}
},
/** Return the token type or char of the unexpected input element
* @return {Number} type of the unexpected input element.
*/
getUnexpectedType: function() {
if ( this.input instanceof org.antlr.runtime.CommonTokenStream ) {
return this.token.getType();
}
else if ( this.input instanceof org.antlr.runtime.tree.TreeNodeStream ) {
var nodes = this.input;
var adaptor = nodes.getTreeAdaptor();
return adaptor.getType(this.node);
}
else {
return this.c;
}
}
});
org.antlr.runtime.MismatchedTokenException = function(expecting, input) {
if (arguments.length===0) {
this.expecting = org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
} else {
org.antlr.runtime.MismatchedTokenException.superclass.constructor.call(
this, input);
this.expecting = expecting;
}
};
org.antlr.lang.extend(
org.antlr.runtime.MismatchedTokenException,
org.antlr.runtime.RecognitionException, {
toString: function() {
return "MismatchedTokenException(" +
this.getUnexpectedType() + "!=" + this.expecting + ")";
},
name: "org.antlr.runtime.MismatchedTokenException"
});
/** An extra token while parsing a TokenStream */
org.antlr.runtime.UnwantedTokenException = function(expecting, input) {
if (arguments.length>0) {
org.antlr.runtime.UnwantedTokenException.superclass.constructor.call(
this, expecting, input);
}
};
org.antlr.lang.extend(
org.antlr.runtime.UnwantedTokenException,
org.antlr.runtime.MismatchedTokenException, {
getUnexpectedToken: function() {
return this.token;
},
toString: function() {
var exp = ", expected "+this.expecting;
if ( this.expecting===org.antlr.runtime.Token.INVALID_TOKEN_TYPE ) {
exp = "";
}
if ( !org.antlr.lang.isValue(this.token) ) {
return "UnwantedTokenException(found="+exp+")";
}
return "UnwantedTokenException(found="+this.token.getText()+exp+")";
},
name: "org.antlr.runtime.UnwantedTokenException"
});
org.antlr.runtime.MissingTokenException = function(expecting, input, inserted) {
if (arguments.length>0) {
org.antlr.runtime.MissingTokenException.superclass.constructor.call(
this, expecting, input);
this.inserted = inserted;
}
};
org.antlr.lang.extend(
org.antlr.runtime.MissingTokenException,
org.antlr.runtime.MismatchedTokenException, {
getMissingType: function() {
return this.expecting;
},
toString: function() {
if (org.antlr.lang.isValue(this.inserted) &&
org.antlr.lang.isValue(this.token))
{
return "MissingTokenException(inserted "+this.inserted+" at "+this.token.getText()+")";
}
if ( org.antlr.lang.isValue(this.token) ) {
return "MissingTokenException(at "+this.token.getText()+")";
}
return "MissingTokenException";
},
name: "org.antlr.runtime.MissingTokenException"
});
org.antlr.runtime.NoViableAltException = function(grammarDecisionDescription,
decisionNumber,
stateNumber,
input)
{
org.antlr.runtime.NoViableAltException.superclass.constructor.call(this, input);
this.grammarDecisionDescription = grammarDecisionDescription;
this.decisionNumber = decisionNumber;
this.stateNumber = stateNumber;
};
org.antlr.lang.extend(
org.antlr.runtime.NoViableAltException,
org.antlr.runtime.RecognitionException, {
toString: function() {
if ( this.input instanceof org.antlr.runtime.ANTLRStringStream ) {
return "NoViableAltException('"+this.getUnexpectedType()+"'@["+this.grammarDecisionDescription+"])";
}
else {
return "NoViableAltException("+this.getUnexpectedType()+"@["+this.grammarDecisionDescription+"])";
}
},
name: "org.antlr.runtime.NoViableAltException"
});
/** The recognizer did not match anything for a ()+ loop.
*
* @class
* @param {Number} decisionNumber
* @param {org.antlr.runtime.CommonTokenStream|org.antlr.runtime.tree.TreeNodeStream|org.antlr.runtime.ANTLRStringStream} input input stream that has an exception.
* @extends org.antlr.runtime.RecognitionException
*/
org.antlr.runtime.EarlyExitException = function(decisionNumber, input) {
org.antlr.runtime.EarlyExitException.superclass.constructor.call(
this, input);
this.decisionNumber = decisionNumber;
};
org.antlr.lang.extend(
org.antlr.runtime.EarlyExitException,
org.antlr.runtime.RecognitionException,
/** @lends org.antlr.runtime.EarlyExitException.prototype */
{
/** Name of this class.
* @type String
*/
name: "org.antlr.runtime.EarlyExitException"
});
org.antlr.runtime.MismatchedSetException = function(expecting, input) {
org.antlr.runtime.MismatchedSetException.superclass.constructor.call(
this, input);
this.expecting = expecting;
};
org.antlr.lang.extend(
org.antlr.runtime.MismatchedSetException,
org.antlr.runtime.RecognitionException, {
toString: function() {
return "MismatchedSetException(" +
this.getUnexpectedType() + "!=" + this.expecting + ")";
},
name: "org.antlr.runtime.MismatchedSetException"
});
org.antlr.runtime.MismatchedNotSetException = function(expecting, input) {
org.antlr.runtime.MismatchedNotSetException.superclass.constructor.call(this, expecting, input);
};
org.antlr.lang.extend(
org.antlr.runtime.MismatchedNotSetException,
org.antlr.runtime.MismatchedSetException, {
toString: function() {
return "MismatchedNotSetException(" +
this.getUnexpectedType() + "!=" + this.expecting + ")";
},
name: "org.antlr.runtime.MismatchedNotSetException"
});
org.antlr.runtime.MismatchedRangeException = function(a, b, input) {
if (arguments.length===0) {
return this;
}
org.antlr.runtime.MismatchedRangeException.superclass.constructor.call(
this, input);
this.a = a;
this.b = b;
};
org.antlr.lang.extend(
org.antlr.runtime.MismatchedRangeException,
org.antlr.runtime.RecognitionException, {
toString: function() {
return "MismatchedRangeException(" +
this.getUnexpectedType()+" not in ["+this.a+","+this.b+"])";
},
name: "org.antlr.runtime.MismatchedRangeException"
});
/** A semantic predicate failed during validation. Validation of predicates
* occurs when normally parsing the alternative just like matching a token.
* Disambiguating predicate evaluation occurs when we hoist a predicate into
* a prediction decision.
*
* @class
* @param {org.antlr.runtime.CommonTokenStream|org.antlr.runtime.tree.TreeNodeStream|org.antlr.runtime.ANTLRStringStream} input input stream that has an exception.
* @param {String} ruleName name of the rule in which the exception occurred.
* @param {String} predicateText the predicate that failed.
* @extends org.antlr.runtime.RecognitionException
*/
org.antlr.runtime.FailedPredicateException = function(input, ruleName, predicateText){
org.antlr.runtime.FailedPredicateException.superclass.constructor.call(this, input);
this.ruleName = ruleName;
this.predicateText = predicateText;
};
org.antlr.lang.extend(
org.antlr.runtime.FailedPredicateException,
org.antlr.runtime.RecognitionException,
/** @lends org.antlr.runtime.FailedPredicateException.prototype */
{
/** Create a string representation of this exception.
* @returns {String}
*/
toString: function() {
return "FailedPredicateException("+this.ruleName+",{"+this.predicateText+"}?)";
},
/** Name of this class.
* @type String
*/
name: "org.antlr.runtime.FailedPredicateException"
});
/**
* A BitSet similar to java.util.BitSet.
*
* <p>JavaScript Note: There is no good way to implement something like this in
* JavaScript. JS has no true int type, arrays are usually implemented as
* hashes, etc. This class should probably be nixed for something that is
* similarly (in)efficient, but more clear.</p>
*
* @class
* @param {Number|Array} [bits] a 32 bit number or array of 32 bit numbers
* representing the bitset. These are typically
* generated by the ANTLR Tool.
*/
org.antlr.runtime.BitSet = function(bits) {
if (!bits) {
bits = org.antlr.runtime.BitSet.BITS;
}
if (org.antlr.lang.isArray(bits)) {
/**
* An array of Numbers representing the BitSet.
* @type Array
*/
this.bits = bits;
} else if(org.antlr.lang.isNumber(bits)) {
this.bits = [];
}
};
org.antlr.lang.augmentObject(org.antlr.runtime.BitSet, {
/**
* Number of bits in each number.
* @constant
* @memberOf org.antlr.runtime.BitSet
*/
BITS: 32,
/**
* Log (base 2) of the number of bits in each number.
* @constant
* @memberOf org.antlr.runtime.BitSet
*/
LOG_BITS: 5, // 2^5 == 32
/**
* We will often need to do a mod operator (i mod nbits). Its
* turns out that, for powers of two, this mod operation is
* same as (i & (nbits-1)). Since mod is slow, we use a
* precomputed mod mask to do the mod instead.
* @constant
* @memberOf org.antlr.runtime.BitSet
*/
MOD_MASK: 31, // BITS - 1
/**
* Create mask for bit modded to fit in a single word.
* @example
* bitmask(35) => 00000000000000000000000000000100
* bitmask(3) => 00000000000000000000000000000100
* @param {Number} bitNumber the bit to create a mask for.
* @returns {Number} the bitmask.
* @memberOf org.antlr.runtime.BitSet
* @private
*/
bitMask: function(bitNumber) {
var bitPosition = bitNumber & org.antlr.runtime.BitSet.MOD_MASK;
return 1 << bitPosition;
},
/**
* Calculate the minimum number of bits needed to represent el.
* @param {Number} el a number to be included in the BitSet.
* @returns {Number} the number of bits need to create a BitSet with member
* el.
* @memberOf org.antlr.runtime.BitSet
* @private
*/
numWordsToHold: function(el) {
return (el >> org.antlr.runtime.BitSet.LOG_BITS) + 1;
},
/**
* @param {Number} bit a number to be included in the BitSet
* @returns {Number} the index of the word in the field bits that would
* hold bit.
* @memberOf org.antlr.runtime.BitSet
* @private
*/
wordNumber: function(bit) {
return bit >> org.antlr.runtime.BitSet.LOG_BITS; // bit / BITS
},
/**
* BitSet factory method.
*
* <p>Operates in a number of modes:
* <ul>
* <li>If el is a number create the BitSet containing that number.</li>
* <li>If el is an array create the BitSet containing each number in the
* array.</li>
* <li>If el is a BitSet return el.</li>
* <li>If el is an Object create the BitSet containing each numeric value
* in el.</li>
* <li>If el is a number and el2 is a number return a BitSet containing
* the numbers between el and el2 (inclusive).</li>
* </ul>
* </p>
* @param {Number|Array|org.antlr.runtime.BitSet|Object} el
* @param {Number} el2
* @returns {org.antlr.runtime.BitSet}
* @memberOf org.antlr.runtime.BitSet
*/
of: function(el, el2) {
var i, n, s, keys;
if (org.antlr.lang.isNumber(el)) {
if (org.antlr.lang.isNumber(el2)) {
s = new org.antlr.runtime.BitSet(el2 + 1);
for (i = el; i <= el2; i++) {
n = org.antlr.runtime.BitSet.wordNumber(i);
s.bits[n] |= org.antlr.runtime.BitSet.bitMask(i);
}
return s;
} else {
s = new org.antlr.runtime.BitSet(el + 1);
s.add(el);
return s;
}
} else if(org.antlr.lang.isArray(el)) {
s = new org.antlr.runtime.BitSet();
for (i=el.length-1; i>=0; i--) {
s.add(el[i]);
}
return s;
} else if (el instanceof org.antlr.runtime.BitSet) {
if (!el) {
return null;
}
return el;
} else if (el instanceof org.antlr.runtime.IntervalSet) {
if (!el) {
return null;
}
s = new org.antlr.runtime.BitSet();
s.addAll(el);
return s;
} else if (org.antlr.lang.isObject(el)) {
keys = [];
for (i in el) {
if (org.antlr.lang.isNumber(i)) {
keys.push(i);
}
}
return org.antlr.runtime.BitSet.of(keys);
}
}
});
org.antlr.runtime.BitSet.prototype = {
/**
* Add el into this set.
* @param {Number} el the number to add to the set.
*/
add: function(el) {
var n = org.antlr.runtime.BitSet.wordNumber(el);
if (n >= this.bits.length) {
this.growToInclude(el);
}
this.bits[n] |= org.antlr.runtime.BitSet.bitMask(el);
},
/**
* Add multiple elements into this set.
* @param {Array|org.antlr.runtime.BitSet} elements the elements to be added to
* this set.
*/
addAll: function(elements) {
var other,
i,
e;
if ( elements instanceof org.antlr.runtime.BitSet ) {
this.orInPlace(elements);
}
else if ( elements instanceof org.antlr.runtime.IntervalSet ) {
other = elements;
// walk set and add each interval
/* @todo after implementing intervalset
for (Iterator iter = other.intervals.iterator(); iter.hasNext();) {
Interval I = (Interval) iter.next();
this.orInPlace(BitSet.range(I.a,I.b));
}*/
} else if (org.antlr.lang.isArray(elements)) {
for (i = 0; i < elements.length; i++) {
e = elements[i];
this.add(e);
}
} else {
return;
}
},
/**
* Clone this BitSet and then {@link #andInPlace} with a.
* @param {org.antlr.runtime.BitSet} a a bit set.
* @returns {org.antlr.runtime.BitSet}
*/
and: function(a) {
var s = this.clone();
s.andInPlace(a);
return s;
},
/**
* Perform a logical AND of this target BitSet with the argument BitSet.
*
* This bit set is modified so that each bit in it has the value true if
* and only if it both initially had the value true and the corresponding
* bit in the bit set argument also had the value true.
* @param {org.antlr.runtime.BitSet} a a bit set.
* @returns {org.antlr.runtime.BitSet}
*/
andInPlace: function(a) {
var min = Math.min(this.bits.length, a.bits.length),
i;
for (i = min - 1; i >= 0; i--) {
this.bits[i] &= a.bits[i];
}
// clear all bits in this not present in a (if this bigger than a).
for (i = min; i < this.bits.length; i++) {
this.bits[i] = 0;
}
},
/**
* Clear all bits or a specific bit.
*
* If no arguments given, sets all of the bits in this BitSet to false.
* If one argument given, sets the bit specified by the index to false.
* @param {Number} [el] the index of the bit to be cleared.
*/
clear: function(el) {
if (arguments.length===0) {
var i;
for (i = this.bits.length - 1; i >= 0; i--) {
this.bits[i] = 0;
}
return;
}
var n = org.antlr.runtime.BitSet.wordNumber(el);
if (n >= this.bits.length) { // grow as necessary to accommodate
this.growToInclude(el);
}
this.bits[n] &= ~org.antlr.runtime.BitSet.bitMask(el);
},
/**
* Cloning this BitSet produces a new BitSet that is equal to it.
*
* The clone of the bit set is another bit set that has exactly the same
* bit set to true as this bit set.
* @returns {org.antlr.runtime.BitSet} a clone of this BitSet.
*/
clone: function() {
var i, len, b=[];
for (i=0, len=this.bits.length; i<len; i++) {
b[i] = this.bits[i];
}
return new org.antlr.runtime.BitSet(b);
},
/**
* Returns the number of bits of space actually in use by this BitSet to
* represent bit values.
*
* The maximum element in the set is the size - 1st element.
* @returns {Number} the number of bits currently in this bit set.
*/
size: function() {
var deg = 0, i, word, bit;
for (i = this.bits.length - 1; i >= 0; i--) {
word = this.bits[i];
if (word !== 0) {
for (bit = org.antlr.runtime.BitSet.BITS - 1; bit >= 0; bit--) {
if ((word & (1 << bit)) !== 0) {
deg++;
}
}
}
}
return deg;
},
/**
* Compares this object against the specified object.
*
* The result is true if and only if the argument is not null and is a
* BitSet object that has exactly the same set of bits set to true as
* this bit set. That is, for every nonnegative int index k,
* <pre><code>
* ((BitSet)obj).get(k) == this.get(k)
* </code></pre>
* must be true. The current sizes of the two bit sets are not compared.
* @param {Object} other the object to compare with.
* @returns {Boolean} if the objects are the same; false otherwise.
*/
equals: function(other) {
if ( !other || !(other instanceof org.antlr.runtime.BitSet) ) {
return false;
}
var otherSet = other,
i,
n = Math.min(this.bits.length, otherSet.bits.length);
// for any bits in common, compare
for (i=0; i<n; i++) {
if (this.bits[i] != otherSet.bits[i]) {
return false;
}
}
// make sure any extra bits are off
if (this.bits.length > n) {
for (i = n+1; i<this.bits.length; i++) {
if (this.bits[i] !== 0) {
return false;
}
}
}
else if (otherSet.bits.length > n) {
for (i = n+1; i<otherSet.bits.length; i++) {
if (otherSet.bits[i] !== 0) {
return false;
}
}
}
return true;
},
/**
* Grows the set to a larger number of bits.
* @param {Number} bit element that must fit in set
* @private
*/
growToInclude: function(bit) {
var newSize = Math.max(this.bits.length << 1, org.antlr.runtime.BitSet.numWordsToHold(bit)),
newbits = [], //new Array(newSize),
i;
for (i=0, len=this.bits.length; i<len; i++) {
newbits[i] = this.bits[i];
}
this.bits = newbits;
},
/**
* Returns the value of the bit with the specified index.
*
* The value is true if the bit with the index el is currently set
* in this BitSet; otherwise, the result is false.
* @param {Number} el the bit index.
* @returns {Boolean} the value of the bit with the specified index.
*/
member: function(el) {
var n = org.antlr.runtime.BitSet.wordNumber(el);
if (n >= this.bits.length) { return false; }
return (this.bits[n] & org.antlr.runtime.BitSet.bitMask(el)) !== 0;
},
/**
* Returns the index of the first bit that is set to true.
* If no such bit exists then -1 is returned.
* @returns {Number} the index of the next set bit.
*/
getSingleElement: function() {
var i;
for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
if (this.member(i)) {
return i;
}
}
return -1; //Label.INVALID;
},
/**
* Returns true if this BitSet contains no bits that are set to true.
* @returns {Boolean} boolean indicating whether this BitSet is empty.
*/
isNil: function() {
var i;
for (i = this.bits.length - 1; i >= 0; i--) {
if (this.bits[i] !== 0) {
return false;
}
}
return true;
},
/**
* If a bit set argument is passed performs a {@link #subtract} of this bit
* set with the argument bit set. If no argument is passed, clone this bit
* set and {@link #notInPlace}.
* @param {org.antlr.runtime.BitSet} [set]
* @returns {org.antlr.runtime.BitSet}
*/
complement: function(set) {
if (set) {
return set.subtract(this);
} else {
var s = this.clone();
s.notInPlace();
return s;
}
},
/**
* If no arguments are passed sets all bits to the complement of their
* current values. If one argument is passed sets each bit from the
* beginning of the bit set to index1 (inclusive) to the complement of its
* current value. If two arguments are passed sets each bit from the
* specified index1 (inclusive) to the sepcified index2 (inclusive) to the
* complement of its current value.
* @param {Number} index1
* @param {Number} index2
*/
notInPlace: function() {
var minBit, maxBit, i, n;
if (arguments.length===0) {
for (i = this.bits.length - 1; i >= 0; i--) {
this.bits[i] = ~this.bits[i];
}
} else {
if (arguments.length===1) {
minBit = 0;
maxBit = arguments[0];
} else {
minBit = arguments[0];
maxBit = arguments[1];
}
// make sure that we have room for maxBit
this.growToInclude(maxBit);
for (i = minBit; i <= maxBit; i++) {
n = org.antlr.runtime.BitSet.wordNumber(i);
this.bits[n] ^= org.antlr.runtime.BitSet.bitMask(i);
}
}
},
/**
* Performs a logical OR of this bit set with the bit set argument.
* If no argument is passed, return this bit set. Otherwise a clone of
* this bit set is modified so that a bit in it has the value true if and
* only if it either already had the value true or the corresponding bit
* in the bit set argument has the value true.
* @param {org.antlr.runtime.BitSet} [a] a bit set.
* @returns {org.antlr.runtime.BitSet}
*/
or: function(a) {
if ( !a ) {
return this;
}
var s = this.clone();
s.orInPlace(a);
return s;
},
/**
* Performs a logical {@link #or} in place.
* @param {org.antlr.runtime.BitSet} [a]
* @returns {org.antlr.runtime.BitSet}
*/
orInPlace: function(a) {
if ( !a ) {
return;
}
// If this is smaller than a, grow this first
if (a.bits.length > this.bits.length) {
this.setSize(a.bits.length);
}
var min = Math.min(this.bits.length, a.bits.length),
i;
for (i = min - 1; i >= 0; i--) {
this.bits[i] |= a.bits[i];
}
},
/**
* Sets the bit specified by the index to false.
* @param {Number} bitIndex the index of the bit to be cleared.
*/
remove: function(el) {
var n = org.antlr.runtime.BitSet.wordNumber(el);
if (n >= this.bits.length) {
this.growToInclude(el);
}
this.bits[n] &= ~org.antlr.runtime.BitSet.bitMask(el);
},
/**
* Grows the internal bits array to include at least nwords numbers.
* @private
* @param {Number} nwords how many words the new set should be
* @private
*/
setSize: function(nwords) {
var n = nwords - this.bits.length;
while (n>=0) {
this.bits.push(0);
n--;
}
},
/**
* Returns the number of bits capable of being represented by this bit set
* given its current size.
* @returns {Number} the maximum number of bits that can be represented at
* the moment.
* @private
*/
numBits: function() {
return this.bits.length << org.antlr.runtime.BitSet.LOG_BITS; // num words * bits per word
},
/**
* Return how much space is being used by the bits array not
* how many actually have member bits on.
* @returns {Number} the length of the internal bits array.
* @private
*/
lengthInLongWords: function() {
return this.bits.length;
},
/**
* Is this bit set contained within a?
* @param {org.antlr.runtime.BitSet} a bit set
* @returns {Boolean} true if and only if a is a subset of this bit set.
*/
subset: function(a) {
if (!a) { return false; }
return this.and(a).equals(this);
},
/**
* Subtract the elements of the argument bit set from this bit set in place.
* That is, for each set bit in the argument bit set, set the corresponding
* bit in this bit set to false.
* @param {org.antlr.runtime.BitSet} a bit set.
*/
subtractInPlace: function(a) {
if (!a) { return; }
// for all words of 'a', turn off corresponding bits of 'this'
var i;
for (i = 0; i < this.bits.length && i < a.bits.length; i++) {
this.bits[i] &= ~a.bits[i];
}
},
/**
* Perform a {@link #subtractInPlace} on a clone of this bit set.
* @param {org.antlr.runtime.BitSet} a bit set.
* @returns {org.antlr.runtime.BitSet} the new bit set.
*/
subtract: function(a) {
if (!a || !(a instanceof org.antlr.runtime.BitSet)) { return null; }
var s = this.clone();
s.subtractInPlace(a);
return s;
},
/* antlr-java needs this to make its class hierarchy happy . . .
toList: function() {
throw new Error("BitSet.toList() unimplemented");
},
*/
/**
* Creates an array of the indexes of each bit set in this bit set.
* @returns {Array}
*/
toArray: function() {
var elems = [], //new Array(this.size()),
i,
en = 0;
for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
if (this.member(i)) {
elems[en++] = i;
}
}
return elems;
},
/**
* Returns the internal representation of this bit set.
* This representation is an array of numbers, each representing 32 bits.
* @returns {Array}
*/
toPackedArray: function() {
return this.bits;
},
/**
* Returns a string representation of this bit set.
* <p>For every index for which this BitSet contains a bit in the set state,
* the decimal representation of that index is included in the result.
* Such indices are listed in order from lowest to highest, separated by
* ", " (a comma and a space) and surrounded by braces, resulting in the
* usual mathematical notation for a set of integers.</p>
*
* <p>If a grammar g is passed, print g.getTokenDisplayName(i) for each set
* index instead of the numerical index.</p>
*
* <>If two arguments are passed, the first will be used as a custom
* separator string. The second argument is an array whose i-th element
* will be added if the corresponding bit is set.</p>
*
* @param {Object|String} [arg1] an Object with function property
* getTokenDispalyName or a String that will be used as a list
* separator.
* @param {Array} [vocabulary] array from which the i-th value will be
* drawn if the corresponding bit is set. Must pass a string as the
* first argument if using this option.
* @return A commma-separated list of values
*/
toString: function() {
if (arguments.length===0) {
return this.toString1(null);
} else {
if (org.antlr.lang.isString(arguments[0])) {
if (!org.antlr.lang.isValue(arguments[1])) {
return this.toString1(null);
} else {
return this.toString2(arguments[0], arguments[1]);
}
} else {
return this.toString1(arguments[0]);
}
}
},
/**
* Transform a bit set into a string by formatting each element as an
* integer separator The string to put in between elements
* @private
* @return A commma-separated list of values
*/
toString1: function(g) {
var buf = "{",
separator = ",",
i,
havePrintedAnElement = false;
for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
if (this.member(i)) {
if (i > 0 && havePrintedAnElement ) {
buf += separator;
}
if ( g ) {
buf += g.getTokenDisplayName(i);
}
else {
buf += i.toString();
}
havePrintedAnElement = true;
}
}
return buf + "}";
},
/**
* Create a string representation where instead of integer elements, the
* ith element of vocabulary is displayed instead. Vocabulary is a Vector
* of Strings.
* separator The string to put in between elements
* @private
* @return A commma-separated list of character constants.
*/
toString2: function(separator, vocabulary) {
var str = "",
i;
for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
if (this.member(i)) {
if (str.length > 0) {
str += separator;
}
if (i >= vocabulary.size()) {
str += "'" + i + "'";
}
else if (!org.antlr.lang.isValue(vocabulary.get(i))) {
str += "'" + i + "'";
}
else {
str += vocabulary.get(i);
}
}
}
return str;
}
/*
* Dump a comma-separated list of the words making up the bit set.
* Split each 32 bit number into two more manageable 16 bit numbers.
* @returns {String} comma separated list view of the this.bits property.
*
toStringOfHalfWords: function() {
var s = "",
tmp,
i;
for (i = 0; i < this.bits.length; i++) {
if (i !== 0) {
s+=", ";
}
tmp = this.bits[i];
tmp &= 0xFFFF;
s += tmp + "UL, ";
tmp = this.bits[i] >> 16;
tmp &= 0xFFFF;
s += tmp+"UL";
}
return s;
},
*/
/*
* Dump a comma-separated list of the words making up the bit set.
* This generates a comma-separated list of Java-like long int constants.
*
toStringOfWords: function() {
var s="",
i;
for (i = 0; i < this.bits.length; i++) {
if (i !== 0) {
s+=", ";
}
s += this.bits[i]+"L";
}
return s;
},
toStringWithRanges: function() {
return this.toString();
}
*/
};
/*
*
*
org.antlr.runtime.IntervalSet = function() {
throw new Error("not implemented");
};
*/
org.antlr.runtime.CharStream = {
EOF: -1
};
org.antlr.runtime.CommonToken = function() {
var oldToken;
this.charPositionInLine = -1; // set to invalid position
this.channel = 0; // org.antlr.runtime.CommonToken.DEFAULT_CHANNEL
this.index = -1;
if (arguments.length == 1) {
if (org.antlr.lang.isNumber(arguments[0])) {
this.type = arguments[0];
} else {
oldToken = arguments[0];
this.text = oldToken.getText();
this.type = oldToken.getType();
this.line = oldToken.getLine();
this.index = oldToken.getTokenIndex();
this.charPositionInLine = oldToken.getCharPositionInLine();
this.channel = oldToken.getChannel();
if ( oldToken instanceof org.antlr.runtime.CommonToken ) {
this.start = oldToken.start;
this.stop = oldToken.stop;
}
}
} else if (arguments.length == 2) {
this.type = arguments[0];
this.text = arguments[1];
this.channel = 0; // org.antlr.runtime.CommonToken.DEFAULT_CHANNEL
} else if (arguments.length == 5) {
this.input = arguments[0];
this.type = arguments[1];
this.channel = arguments[2];
this.start = arguments[3];
this.stop = arguments[4];
}
};
org.antlr.runtime.CommonToken.prototype = {
getType: function() {
return this.type;
},
setLine: function(line) {
this.line = line;
},
getText: function() {
if ( org.antlr.lang.isString(this.text) ) {
return this.text;
}
if ( !this.input ) {
return null;
}
this.text = this.input.substring(this.start,this.stop);
return this.text;
},
/** Override the text for this token. getText() will return this text
* rather than pulling from the buffer. Note that this does not mean
* that start/stop indexes are not valid. It means that that input
* was converted to a new string in the token object.
*/
setText: function(text) {
this.text = text;
},
getLine: function() {
return this.line;
},
getCharPositionInLine: function() {
return this.charPositionInLine;
},
setCharPositionInLine: function(charPositionInLine) {
this.charPositionInLine = charPositionInLine;
},
getChannel: function() {
return this.channel;
},
setChannel: function(channel) {
this.channel = channel;
},
setType: function(type) {
this.type = type;
},
getStartIndex: function() {
return this.start;
},
setStartIndex: function(start) {
this.start = start;
},
getStopIndex: function() {
return this.stop;
},
setStopIndex: function(stop) {
this.stop = stop;
},
getTokenIndex: function() {
return this.index;
},
setTokenIndex: function(index) {
this.index = index;
},
getInputStream: function() {
return this.input;
},
setInputStream: function(input) {
this.input = input;
},
toString: function() {
var channelStr = "";
if ( this.channel>0 ) {
channelStr=",channel="+this.channel;
}
var txt = this.getText();
if ( !org.antlr.lang.isNull(txt) ) {
txt = txt.replace(/\n/g,"\\\\n");
txt = txt.replace(/\r/g,"\\\\r");
txt = txt.replace(/\t/g,"\\\\t");
}
else {
txt = "<no text>";
}
return "[@"+this.getTokenIndex()+","+this.start+":"+this.stop+"='"+txt+"',<"+this.type+">"+channelStr+","+this.line+":"+this.getCharPositionInLine()+"]";
}
};
// NB: Because Token has static members of type CommonToken, the Token dummy
// constructor is defined in CommonToken. All methods and vars of Token are
// defined here. Token is an interface, not a subclass in the Java runtime.
/**
* @class Abstract base class of all token types.
* @name Token
* @memberOf org.antlr.runtime
*/
org.antlr.runtime.Token = function() {};
org.antlr.lang.augmentObject(org.antlr.runtime.Token, /** @lends Token */ {
EOR_TOKEN_TYPE: 1,
/** imaginary tree navigation type; traverse "get child" link */
DOWN: 2,
/** imaginary tree navigation type; finish with a child list */
UP: 3,
MIN_TOKEN_TYPE: 4, // UP+1,
EOF: org.antlr.runtime.CharStream.EOF,
EOF_TOKEN: new org.antlr.runtime.CommonToken(org.antlr.runtime.CharStream.EOF),
INVALID_TOKEN_TYPE: 0,
INVALID_TOKEN: new org.antlr.runtime.CommonToken(0),
/** In an action, a lexer rule can set token to this SKIP_TOKEN and ANTLR
* will avoid creating a token for this symbol and try to fetch another.
*/
SKIP_TOKEN: new org.antlr.runtime.CommonToken(0),
/** All tokens go to the parser (unless skip() is called in that rule)
* on a particular "channel". The parser tunes to a particular channel
* so that whitespace etc... can go to the parser on a "hidden" channel.
*/
DEFAULT_CHANNEL: 0,
/** Anything on different channel than DEFAULT_CHANNEL is not parsed
* by parser.
*/
HIDDEN_CHANNEL: 99
});
org.antlr.lang.augmentObject(org.antlr.runtime.CommonToken, org.antlr.runtime.Token);
org.antlr.runtime.tree.RewriteCardinalityException = function(elementDescription) {
this.elementDescription = elementDescription;
};
/** Base class for all exceptions thrown during AST rewrite construction.
* This signifies a case where the cardinality of two or more elements
* in a subrule are different: (ID INT)+ where |ID|!=|INT|
*/
org.antlr.lang.extend(org.antlr.runtime.tree.RewriteCardinalityException, Error, {
getMessage: function() {
if ( org.antlr.lang.isString(this.elementDescription) ) {
return this.elementDescription;
}
return null;
},
name: function() {
return "org.antlr.runtime.tree.RewriteCardinalityException";
}
});
/** Ref to ID or expr but no tokens in ID stream or subtrees in expr stream */
org.antlr.runtime.tree.RewriteEmptyStreamException = function(elementDescription) {
var sup = org.antlr.runtime.tree.RewriteEmptyStreamException.superclass;
sup.constructor.call(this, elementDescription);
};
org.antlr.lang.extend(org.antlr.runtime.tree.RewriteEmptyStreamException,
org.antlr.runtime.tree.RewriteCardinalityException, {
name: function() {
return "org.antlr.runtime.tree.RewriteEmptyStreamException";
}
});
/** No elements within a (...)+ in a rewrite rule */
org.antlr.runtime.tree.RewriteEarlyExitException = function(elementDescription) {
var sup = org.antlr.runtime.tree.RewriteEarlyExitException.superclass;
if (org.antlr.lang.isUndefined(elementDescription)) {
elementDescription = null;
}
sup.constructor.call(this, elementDescription);
};
org.antlr.lang.extend(org.antlr.runtime.tree.RewriteEarlyExitException,
org.antlr.runtime.tree.RewriteCardinalityException, {
name: function() {
return "org.antlr.runtime.tree.RewriteEarlyExitException";
}
});
org.antlr.runtime.MismatchedTreeNodeException = function(expecting, input) {
if (expecting && input) {
org.antlr.runtime.MismatchedTreeNodeException.superclass.constructor.call(
this, input);
this.expecting = expecting;
}
};
org.antlr.lang.extend(
org.antlr.runtime.MismatchedTreeNodeException,
org.antlr.runtime.RecognitionException, {
toString: function() {
return "MismatchedTreeNodeException(" +
this.getUnexpectedType() + "!=" + this.expecting + ")";
},
name: "org.antlr.runtime.MismatchedTreeNodeException"
});
/** A generic tree implementation with no payload. You must subclass to
* actually have any user data. ANTLR v3 uses a list of children approach
* instead of the child-sibling approach in v2. A flat tree (a list) is
* an empty node whose children represent the list. An empty, but
* non-null node is called "nil".
*/
org.antlr.runtime.tree.BaseTree = function() {};
org.antlr.runtime.tree.BaseTree.prototype = {
getChild: function(i) {
if ( !this.children || i>=this.children.length ) {
return null;
}
return this.children[i];
},
/** Get the children internal List; note that if you directly mess with
* the list, do so at your own risk.
*/
getChildren: function() {
return this.children;
},
getFirstChildWithType: function(type) {
var i, t;
for (i = 0; this.children && i < this.children.length; i++) {
t = this.children[i];
if ( t.getType()===type ) {
return t;
}
}
return null;
},
getChildCount: function() {
if ( !this.children ) {
return 0;
}
return this.children.length;
},
/** Add t as child of this node.
*
* Warning: if t has no children, but child does
* and child isNil then this routine moves children to t via
* t.children = child.children; i.e., without copying the array.
*/
addChild: function(t) {
if ( !org.antlr.lang.isValue(t) ) {
return; // do nothing upon addChild(null)
}
var childTree = t, n, i, c;
if ( childTree.isNil() ) { // t is an empty node possibly with children
if ( this.children && this.children == childTree.children ) {
throw new Error("attempt to add child list to itself");
}
// just add all of childTree's children to this
if ( childTree.children ) {
if ( this.children ) { // must copy, this has children already
n = childTree.children.length;
for (i = 0; i < n; i++) {
c = childTree.children[i];
this.children.push(c);
// handle double-link stuff for each child of nil root
c.setParent(this);
c.setChildIndex(this.children.length-1);
}
}
else {
// no children for this but t has children; just set pointer
// call general freshener routine
this.children = childTree.children;
this.freshenParentAndChildIndexes();
}
}
}
else { // child is not nil (don't care about children)
if ( !this.children ) {
this.children = this.createChildrenList(); // create children list on demand
}
this.children.push(t);
childTree.setParent(this);
childTree.setChildIndex(this.children.length-1);
}
},
/** Add all elements of kids list as children of this node */
addChildren: function(kids) {
var i, t;
for (i = 0; i < kids.length; i++) {
t = kids[i];
this.addChild(t);
}
},
setChild: function(i, t) {
if ( !t ) {
return;
}
if ( t.isNil() ) {
throw new Error("Can't set single child to a list");
}
if ( !this.children ) {
this.children = this.createChildrenList();
}
this.children[i] = t;
t.setParent(this);
t.setChildIndex(i);
},
deleteChild: function(i) {
if ( !this.children ) {
return null;
}
if (i<0 || i>=this.children.length) {
throw new Error("Index out of bounds.");
}
var killed = this.children.splice(i, 1)[0];
// walk rest and decrement their child indexes
this.freshenParentAndChildIndexes(i);
return killed;
},
/** Delete children from start to stop and replace with t even if t is
* a list (nil-root tree). num of children can increase or decrease.
* For huge child lists, inserting children can force walking rest of
* children to set their childindex; could be slow.
*/
replaceChildren: function(startChildIndex, stopChildIndex, t) {
if ( !this.children ) {
throw new Error("indexes invalid; no children in list");
}
var replacingHowMany = stopChildIndex - startChildIndex + 1;
var replacingWithHowMany;
var newTree = t;
var newChildren = null;
// normalize to a list of children to add: newChildren
if ( newTree.isNil() ) {
newChildren = newTree.children;
}
else {
newChildren = [];
newChildren.push(newTree);
}
replacingWithHowMany = newChildren.length;
var numNewChildren = newChildren.length;
var delta = replacingHowMany - replacingWithHowMany;
var j, i, child, indexToDelete, c, killed, numToInsert;
// if same number of nodes, do direct replace
if ( delta === 0 ) {
j = 0; // index into new children
for (i=startChildIndex; i<=stopChildIndex; i++) {
child = newChildren[j];
this.children[i] = child;
child.setParent(this);
child.setChildIndex(i);
j++;
}
}
else if ( delta > 0 ) { // fewer new nodes than there were
// set children and then delete extra
for (j=0; j<numNewChildren; j++) {
this.children[startChildIndex+j] = newChildren[j];
}
indexToDelete = startChildIndex+numNewChildren;
for (c=indexToDelete; c<=stopChildIndex; c++) {
// delete same index, shifting everybody down each time
killed = this.children.splice(indexToDelete, 1)[0];
}
this.freshenParentAndChildIndexes(startChildIndex);
}
else { // more new nodes than were there before
// fill in as many children as we can (replacingHowMany) w/o moving data
for (j=0; j<replacingHowMany; j++) {
this.children[startChildIndex+j] = newChildren[j];
}
numToInsert = replacingWithHowMany-replacingHowMany;
for (j=replacingHowMany; j<replacingWithHowMany; j++) {
this.children.splice(startChildIndex+j, 0, newChildren[j]);
}
this.freshenParentAndChildIndexes(startChildIndex);
}
},
/** Override in a subclass to change the impl of children list */
createChildrenList: function() {
return [];
},
isNil: function() {
return false;
},
freshenParentAndChildIndexes: function(offset) {
if (!org.antlr.lang.isNumber(offset)) {
offset = 0;
}
var n = this.getChildCount(),
c,
child;
for (c = offset; c < n; c++) {
child = this.getChild(c);
child.setChildIndex(c);
child.setParent(this);
}
},
sanityCheckParentAndChildIndexes: function(parent, i) {
if (arguments.length===0) {
parent = null;
i = -1;
}
if ( parent!==this.getParent() ) {
throw new Error("parents don't match; expected "+parent+" found "+this.getParent());
}
if ( i!==this.getChildIndex() ) {
throw new Error("child indexes don't match; expected "+i+" found "+this.getChildIndex());
}
var n = this.getChildCount(),
c,
child;
for (c = 0; c < n; c++) {
child = this.getChild(c);
child.sanityCheckParentAndChildIndexes(this, c);
}
},
/** BaseTree doesn't track child indexes. */
getChildIndex: function() {
return 0;
},
setChildIndex: function(index) {
},
/** BaseTree doesn't track parent pointers. */
getParent: function() {
return null;
},
setParent: function(t) {
},
getTree: function() {
return this;
},
/** Print out a whole tree not just a node */
toStringTree: function() {
if ( !this.children || this.children.length===0 ) {
return this.toString();
}
var buf = "",
i,
t;
if ( !this.isNil() ) {
buf += "(";
buf += this.toString();
buf += ' ';
}
for (i = 0; this.children && i < this.children.length; i++) {
t = this.children[i];
if ( i>0 ) {
buf += ' ';
}
buf += t.toStringTree();
}
if ( !this.isNil() ) {
buf += ")";
}
return buf;
},
getLine: function() {
return 0;
},
getCharPositionInLine: function() {
return 0;
}
};
/** A tree node that is wrapper for a Token object. After 3.0 release
* while building tree rewrite stuff, it became clear that computing
* parent and child index is very difficult and cumbersome. Better to
* spend the space in every tree node. If you don't want these extra
* fields, it's easy to cut them out in your own BaseTree subclass.
*/
org.antlr.runtime.tree.CommonTree = function(node) {
/** What token indexes bracket all tokens associated with this node
* and below?
*/
this.startIndex = -1;
this.stopIndex = -1;
/** What index is this node in the child list? Range: 0..n-1 */
this.childIndex = -1;
/** Who is the parent node of this node; if null, implies node is root */
this.parent = null;
/** A single token is the payload */
this.token = null;
if (node instanceof org.antlr.runtime.tree.CommonTree) {
org.antlr.runtime.tree.CommonTree.superclass.constructor.call(this, node);
this.token = node.token;
this.startIndex = node.startIndex;
this.stopIndex = node.stopIndex;
} else if (node instanceof org.antlr.runtime.CommonToken) {
this.token = node;
}
};
/** A tree node that is wrapper for a Token object. */
org.antlr.lang.extend(org.antlr.runtime.tree.CommonTree, org.antlr.runtime.tree.BaseTree, {
getToken: function() {
return this.token;
},
dupNode: function() {
return new org.antlr.runtime.tree.CommonTree(this);
},
isNil: function() {
return !this.token;
},
getType: function() {
if ( !this.token ) {
return org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
}
return this.token.getType();
},
getText: function() {
if ( !this.token ) {
return null;
}
return this.token.getText();
},
getLine: function() {
if ( !this.token || this.token.getLine()===0 ) {
if ( this.getChildCount()>0 ) {
return this.getChild(0).getLine();
}
return 0;
}
return this.token.getLine();
},
getCharPositionInLine: function() {
if ( !this.token || this.token.getCharPositionInLine()===-1 ) {
if ( this.getChildCount()>0 ) {
return this.getChild(0).getCharPositionInLine();
}
return 0;
}
return this.token.getCharPositionInLine();
},
getTokenStartIndex: function() {
if ( this.token ) {
return this.token.getTokenIndex();
}
return this.startIndex;
},
setTokenStartIndex: function(index) {
this.startIndex = index;
},
getTokenStopIndex: function() {
if ( this.token ) {
return this.token.getTokenIndex();
}
return this.stopIndex;
},
setTokenStopIndex: function(index) {
this.stopIndex = index;
},
getChildIndex: function() {
return this.childIndex;
},
getParent: function() {
return this.parent;
},
setParent: function(t) {
this.parent = t;
},
setChildIndex: function(index) {
this.childIndex = index;
},
toString: function() {
if ( this.isNil() ) {
return "nil";
}
if ( this.getType()===org.antlr.runtime.Token.INVALID_TOKEN_TYPE ) {
return "<errornode>";
}
if ( !this.token ) {
return null;
}
return this.token.getText();
}
});
/** What does a tree look like? ANTLR has a number of support classes
* such as CommonTreeNodeStream that work on these kinds of trees. You
* don't have to make your trees implement this interface, but if you do,
* you'll be able to use more support code.
*
* NOTE: When constructing trees, ANTLR can build any kind of tree; it can
* even use Token objects as trees if you add a child list to your tokens.
*
* This is a tree node without any payload; just navigation and factory stuff.
*/
org.antlr.runtime.tree.Tree = {
INVALID_NODE: new org.antlr.runtime.tree.CommonTree(org.antlr.runtime.Token.INVALID_TOKEN)
};
org.antlr.runtime.tree.CommonErrorNode = function(input, start, stop, e) {
if ( !stop ||
(stop.getTokenIndex() < start.getTokenIndex() &&
stop.getType()!=org.antlr.runtime.Token.EOF) )
{
// sometimes resync does not consume a token (when LT(1) is
// in follow set. So, stop will be 1 to left to start. adjust.
// Also handle case where start is the first token and no token
// is consumed during recovery; LT(-1) will return null.
stop = start;
}
this.input = input;
this.start = start;
this.stop = stop;
this.trappedException = e;
};
org.antlr.lang.extend(org.antlr.runtime.tree.CommonErrorNode, org.antlr.runtime.tree.CommonTree, {
isNil: function() {
return false;
},
getType: function() {
return org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
},
getText: function() {
var badText = null;
if ( this.start instanceof org.antlr.runtime.CommonToken ) {
var i = this.start.getTokenIndex();
var j = this.stop.getTokenIndex();
if ( this.stop.getType() === org.antlr.runtime.Token.EOF ) {
j = this.input.size();
}
badText = this.input.toString(i, j);
}
else if ( this.start instanceof org.antlr.runtime.tree.CommonTree ) {
badText = this.input.toString(this.start, this.stop);
}
else {
// people should subclass if they alter the tree type so this
// next one is for sure correct.
badText = "<unknown>";
}
return badText;
},
toString: function() {
if ( this.trappedException instanceof org.antlr.runtime.MissingTokenException ) {
return "<missing type: "+
this.trappedException.getMissingType()+
">";
}
else if ( this.trappedException instanceof org.antlr.runtime.UnwantedTokenException ) {
return "<extraneous: "+
this.trappedException.getUnexpectedToken()+
", resync="+this.getText()+">";
}
else if ( this.trappedException instanceof org.antlr.runtime.MismatchedTokenException ) {
return "<mismatched token: "+this.trappedException.token+", resync="+this.getText()+">";
}
else if ( this.trappedException instanceof org.antlr.runtime.NoViableAltException ) {
return "<unexpected: "+this.trappedException.token+
", resync="+this.getText()+">";
}
return "<error: "+this.getText()+">";
}
});
/** A TreeAdaptor that works with any Tree implementation. */
org.antlr.runtime.tree.BaseTreeAdaptor = function() {
this.uniqueNodeID = 1;
};
org.antlr.runtime.tree.BaseTreeAdaptor.prototype = {
nil: function() {
return this.create(null);
},
/** create tree node that holds the start and stop tokens associated
* with an error.
*
* If you specify your own kind of tree nodes, you will likely have to
* override this method. CommonTree returns Token.INVALID_TOKEN_TYPE
* if no token payload but you might have to set token type for diff
* node type.
*/
errorNode: function(input, start, stop, e) {
var t = new org.antlr.runtime.tree.CommonErrorNode(input, start, stop, e);
return t;
},
isNil: function(tree) {
return tree.isNil();
},
/** This is generic in the sense that it will work with any kind of
* tree (not just Tree interface). It invokes the adaptor routines
* not the tree node routines to do the construction.
*/
dupTree: function(t, parent) {
if (arguments.length===1) {
parent = null;
}
if ( !t ) {
return null;
}
var newTree = this.dupNode(t);
// ensure new subtree root has parent/child index set
this.setChildIndex(newTree, this.getChildIndex(t)); // same index in new tree
this.setParent(newTree, parent);
var n = this.getChildCount(t),
i, child, newSubTree;
for (i = 0; i < n; i++) {
child = this.getChild(t, i);
newSubTree = this.dupTree(child, t);
this.addChild(newTree, newSubTree);
}
return newTree;
},
/** Add a child to the tree t. If child is a flat tree (a list), make all
* in list children of t. Warning: if t has no children, but child does
* and child isNil then you can decide it is ok to move children to t via
* t.children = child.children; i.e., without copying the array. Just
* make sure that this is consistent with have the user will build
* ASTs.
*/
addChild: function(t, child) {
if ( t && org.antlr.lang.isValue(child) ) {
t.addChild(child);
}
},
/** If oldRoot is a nil root, just copy or move the children to newRoot.
* If not a nil root, make oldRoot a child of newRoot.
*
* old=^(nil a b c), new=r yields ^(r a b c)
* old=^(a b c), new=r yields ^(r ^(a b c))
*
* If newRoot is a nil-rooted single child tree, use the single
* child as the new root node.
*
* old=^(nil a b c), new=^(nil r) yields ^(r a b c)
* old=^(a b c), new=^(nil r) yields ^(r ^(a b c))
*
* If oldRoot was null, it's ok, just return newRoot (even if isNil).
*
* old=null, new=r yields r
* old=null, new=^(nil r) yields ^(nil r)
*
* Return newRoot. Throw an exception if newRoot is not a
* simple node or nil root with a single child node--it must be a root
* node. If newRoot is ^(nil x) return x as newRoot.
*
* Be advised that it's ok for newRoot to point at oldRoot's
* children; i.e., you don't have to copy the list. We are
* constructing these nodes so we should have this control for
* efficiency.
*/
becomeRoot: function(newRoot, oldRoot) {
if (newRoot instanceof org.antlr.runtime.CommonToken || !newRoot) {
newRoot = this.create(newRoot);
}
var newRootTree = newRoot,
oldRootTree = oldRoot;
if ( !oldRoot ) {
return newRoot;
}
// handle ^(nil real-node)
if ( newRootTree.isNil() ) {
if ( newRootTree.getChildCount()>1 ) {
// TODO: make tree run time exceptions hierarchy
throw new Error("more than one node as root (TODO: make exception hierarchy)");
}
newRootTree = newRootTree.getChild(0);
}
// add oldRoot to newRoot; addChild takes care of case where oldRoot
// is a flat list (i.e., nil-rooted tree). All children of oldRoot
// are added to newRoot.
newRootTree.addChild(oldRootTree);
return newRootTree;
},
/** Transform ^(nil x) to x */
rulePostProcessing: function(root) {
var r = root;
if ( r && r.isNil() ) {
if ( r.getChildCount()===0 ) {
r = null;
}
else if ( r.getChildCount()===1 ) {
r = r.getChild(0);
// whoever invokes rule will set parent and child index
r.setParent(null);
r.setChildIndex(-1);
}
}
return r;
},
create: function(tokenType, fromToken) {
var text, t;
if (arguments.length===2) {
if (org.antlr.lang.isString(arguments[1])) {
text = arguments[1];
fromToken = this.createToken(tokenType, text);
t = this.create(fromToken);
return t;
} else {
fromToken = this.createToken(fromToken);
fromToken.setType(tokenType);
t = this.create(fromToken);
return t;
}
} else if (arguments.length===3) {
text = arguments[2];
fromToken = this.createToken(fromToken);
fromToken.setType(tokenType);
fromToken.setText(text);
t = this.create(fromToken);
return t;
}
},
getType: function(t) {
t.getType();
return 0;
},
setType: function(t, type) {
throw new Error("don't know enough about Tree node");
},
getText: function(t) {
return t.getText();
},
setText: function(t, text) {
throw new Error("don't know enough about Tree node");
},
getChild: function(t, i) {
return t.getChild(i);
},
setChild: function(t, i, child) {
t.setChild(i, child);
},
deleteChild: function(t, i) {
return t.deleteChild(i);
},
getChildCount: function(t) {
return t.getChildCount();
},
getUniqueID: function(node) {
if ( !this.treeToUniqueIDMap ) {
this.treeToUniqueIDMap = {};
}
var prevID = this.treeToUniqueIDMap[node];
if ( org.antlr.lang.isValue(prevID) ) {
return prevID;
}
var ID = this.uniqueNodeID;
this.treeToUniqueIDMap[node] = ID;
this.uniqueNodeID++;
return ID;
// GC makes these nonunique:
// return System.identityHashCode(node);
}
};
/** A TreeAdaptor that works with any Tree implementation. It provides
* really just factory methods; all the work is done by BaseTreeAdaptor.
* If you would like to have different tokens created than ClassicToken
* objects, you need to override this and then set the parser tree adaptor to
* use your subclass.
*
* To get your parser to build nodes of a different type, override
* create(Token).
*/
org.antlr.runtime.tree.CommonTreeAdaptor = function() {};
org.antlr.lang.extend(org.antlr.runtime.tree.CommonTreeAdaptor,
org.antlr.runtime.tree.BaseTreeAdaptor, {
/** Duplicate a node. This is part of the factory;
* override if you want another kind of node to be built.
*
* I could use reflection to prevent having to override this
* but reflection is slow.
*/
dupNode: function(t) {
if ( !org.antlr.lang.isValue(t) ) {
return null;
}
return t.dupNode();
},
create: function(payload) {
if (arguments.length>1) {
return org.antlr.runtime.tree.CommonTreeAdaptor.superclass.create.apply(this, arguments);
}
return new org.antlr.runtime.tree.CommonTree(payload);
},
/** Tell me how to create a token for use with imaginary token nodes.
* For example, there is probably no input symbol associated with imaginary
* token DECL, but you need to create it as a payload or whatever for
* the DECL node as in ^(DECL type ID).
*
* If you care what the token payload objects' type is, you should
* override this method and any other createToken variant.
*
* Tell me how to create a token for use with imaginary token nodes.
* For example, there is probably no input symbol associated with imaginary
* token DECL, but you need to create it as a payload or whatever for
* the DECL node as in ^(DECL type ID).
*
* This is a variant of createToken where the new token is derived from
* an actual real input token. Typically this is for converting '{'
* tokens to BLOCK etc... You'll see
*
* r : lc='{' ID+ '}' -> ^(BLOCK[$lc] ID+) ;
*
* If you care what the token payload objects' type is, you should
* override this method and any other createToken variant.
*/
createToken: function(fromToken) {
if (arguments.length===2) {
return new org.antlr.runtime.CommonToken(arguments[0], arguments[1]);
} else {
return new org.antlr.runtime.CommonToken(arguments[0]);
}
},
/** Track start/stop token for subtree root created for a rule.
* Only works with Tree nodes. For rules that match nothing,
* seems like this will yield start=i and stop=i-1 in a nil node.
* Might be useful info so I'll not force to be i..i.
*/
setTokenBoundaries: function(t, startToken, stopToken) {
if ( !org.antlr.lang.isValue(t) ) {
return;
}
var start = 0,
stop = 0;
if ( org.antlr.lang.isValue(startToken) ) {
if (startToken.getTokenIndex) {
start = startToken.getTokenIndex();
} else if (startToken.getStartIndex) {
start = startToken.getStartIndex();
} else {
start = startToken.getTokenStartIndex();
}
}
if ( org.antlr.lang.isValue(stopToken) ) {
if (stop.getTokenIndex) {
stop = stopToken.getTokenIndex();
} else if (stopToken.getStopIndex) {
stop = stopToken.getStopIndex();
} else {
stop = stopToken.getTokenStopIndex();
}
}
t.setTokenStartIndex(start);
t.setTokenStopIndex(stop);
},
getTokenStartIndex: function(t) {
if (!t) {
return -1;
}
return t.getTokenStartIndex();
},
getTokenStopIndex: function(t) {
if (!t) {
return -1;
}
return t.getTokenStopIndex();
},
getText: function(t) {
if (!t) {
return null;
}
return t.getText();
},
getType: function(t) {
if (!t) {
return org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
}
return t.getType();
},
/** What is the Token associated with this node? If
* you are not using CommonTree, then you must
* override this in your own adaptor.
*/
getToken: function(t) {
if ( t instanceof org.antlr.runtime.tree.CommonTree ) {
return t.getToken();
}
return null; // no idea what to do
},
getChild: function(t, i) {
if (!t) {
return null;
}
return t.getChild(i);
},
getChildCount: function(t) {
if (!t) {
return 0;
}
return t.getChildCount();
},
getParent: function(t) {
return t.getParent();
},
setParent: function(t, parent) {
t.setParent(parent);
},
getChildIndex: function(t) {
return t.getChildIndex();
},
setChildIndex: function(t, index) {
t.setChildIndex(index);
},
replaceChildren: function(parent, startChildIndex, stopChildIndex, t) {
if ( parent ) {
parent.replaceChildren(startChildIndex, stopChildIndex, t);
}
}
});
/**
* A stream of characters created from a JavaScript string that in turn gets
* fed to a lexer.
* @class
* @param {String} data the string from which this stream will be created.
*/
org.antlr.runtime.ANTLRStringStream = function(data) {
/**
* Location in the stream.
* Ranges from 0 to (stream length - 1).
* @private
* @type Number
*/
this.p = 0;
/**
* The current line in the input.
* Ranges from 1 to (number of lines).
* @private
* @type Number
*/
this.line = 1;
/**
* The index of the character relative to the beginning of the line.
* Ranges from 0 to (length of line - 1).
* @private
* @type Number
*/
this.charPositionInLine = 0;
/**
* Tracks how deep mark() calls are nested
* @private
* @type Number
*/
this.markDepth = 0;
/**
* An Array of objects that tracks the stream state
* values line, charPositionInLine, and p that can change as you
* move through the input stream. Indexed from 1..markDepth.
* A null is kept at index 0. Created upon first call to mark().
* @private
* @type Array
*/
this.markers = null;
/**
* Track the last mark() call result value for use in rewind().
* @private
* @type Number
*/
this.lastMarker = null;
/**
* The data being scanned.
* @private
* @type String
*/
this.data = data;
/**
* The number of characters in the stream.
* @private
* @type Number
*/
this.n = data.length;
};
org.antlr.runtime.ANTLRStringStream.prototype = {
/**
* Reset the stream so that it's in the same state it was
* when the object was created *except* the data array is not
* touched.
*/
reset: function() {
this.p = 0;
this.line = 1;
this.charPositionInLine = 0;
this.markDepth = 0;
},
/**
* Consume the next character of data in the stream.
*/
consume: function() {
if ( this.p < this.n ) {
this.charPositionInLine++;
if ( this.data.charAt(this.p)==="\n" ) {
this.line++;
this.charPositionInLine=0;
}
this.p++;
}
},
/**
* Get character at current input pointer + i ahead where i=1 is next int.
* Negative indexes are allowed. LA(-1) is previous token (token
* just matched). LA(-i) where i is before first token should
* yield -1, invalid char / EOF.
* @param {Number} i non-zero amount of lookahead or lookback
* @returns {String|Number} The charcter at the specified position or -1 if
* you fell off either end of the stream.
*/
LA: function(i) {
if ( i<0 ) {
i++; // e.g., translate LA(-1) to use offset i=0; then data[p+0-1]
}
var new_pos = this.p+i-1;
if (new_pos>=this.n || new_pos<0) {
return org.antlr.runtime.CharStream.EOF;
}
return this.data.charAt(new_pos);
},
/**
* Return the current input symbol index 0..n where n indicates the
* last symbol has been read. The index is the index of char to
* be returned from LA(1) (i.e. the one about to be consumed).
* @returns {Number} the index of the current input symbol
*/
index: function() {
return this.p;
},
/**
* The length of this stream.
* @returns {Number} the length of this stream.
*/
size: function() {
return this.n;
},
/**
* Tell the stream to start buffering if it hasn't already. Return
* current input position, index(), or some other marker so that
* when passed to rewind() you get back to the same spot.
* rewind(mark()) should not affect the input cursor. The Lexer
* tracks line/col info as well as input index so its markers are
* not pure input indexes. Same for tree node streams.
*
* <p>Marking is a mechanism for storing the current position of a stream
* in a stack. This corresponds with the predictive look-ahead mechanism
* used in Lexers.</p>
* @returns {Number} the current size of the mark stack.
*/
mark: function() {
if ( !this.markers ) {
this.markers = [];
this.markers.push(null); // depth 0 means no backtracking, leave blank
}
this.markDepth++;
var state = null;
if ( this.markDepth>=this.markers.length ) {
state = {};
this.markers.push(state);
}
else {
state = this.markers[this.markDepth];
}
state.p = this.p;
state.line = this.line;
state.charPositionInLine = this.charPositionInLine;
this.lastMarker = this.markDepth;
return this.markDepth;
},
/**
* Rewind to the input position of the last marker.
* Used currently only after a cyclic DFA and just
* before starting a sem/syn predicate to get the
* input position back to the start of the decision.
* Do not "pop" the marker off the state. mark(i)
* and rewind(i) should balance still. It is
* like invoking rewind(last marker) but it should not "pop"
* the marker off. It's like seek(last marker's input position).
* @param {Number} [m] the index in the mark stack to load instead of the
* last.
*/
rewind: function(m) {
if (!org.antlr.lang.isNumber(m)) {
m = this.lastMarker;
}
var state = this.markers[m];
// restore stream state
this.seek(state.p);
this.line = state.line;
this.charPositionInLine = state.charPositionInLine;
this.release(m);
},
/**
* You may want to commit to a backtrack but don't want to force the
* stream to keep bookkeeping objects around for a marker that is
* no longer necessary. This will have the same behavior as
* rewind() except it releases resources without the backward seek.
* This must throw away resources for all markers back to the marker
* argument. So if you're nested 5 levels of mark(), and then release(2)
* you have to release resources for depths 2..5.
* @param {Number} marker the mark depth above which all mark states will
* be released.
*/
release: function(marker) {
// unwind any other markers made after m and release m
this.markDepth = marker;
// release this marker
this.markDepth--;
},
/**
* Set the input cursor to the position indicated by index. This is
* normally used to seek ahead in the input stream. No buffering is
* required to do this unless you know your stream will use seek to
* move backwards such as when backtracking.
*
* <p>This is different from rewind in its multi-directional
* requirement and in that its argument is strictly an input cursor
* (index).</p>
*
* <p>For char streams, seeking forward must update the stream state such
* as line number. For seeking backwards, you will be presumably
* backtracking using the mark/rewind mechanism that restores state and
* so this method does not need to update state when seeking backwards.</p>
*
* <p>Currently, this method is only used for efficient backtracking using
* memoization, but in the future it may be used for incremental
* parsing.</p>
*
* <p>The index is 0..n-1. A seek to position i means that LA(1) will
* return the ith symbol. So, seeking to 0 means LA(1) will return the
* first element in the stream.</p>
*
* <p>Esentially this method method moves the input position,
* {@link #consume}-ing data if necessary.</p>
*
* @param {Number} index the position to seek to.
*/
seek: function(index) {
if ( index<=this.p ) {
this.p = index; // just jump; don't update stream state (line, ...)
return;
}
// seek forward, consume until p hits index
while ( this.p<index ) {
this.consume();
}
},
/**
* Retrieve a substring from this stream.
* @param {Number} start the starting index of the substring (inclusive).
* @param {Number} stop the last index of the substring (inclusive).
* @returns {String}
*/
substring: function(start, stop) {
return this.data.substr(start,stop-start+1);
},
/**
* Return the current line position in the stream.
* @returns {Number} the current line position in the stream (1..numlines).
*/
getLine: function() {
return this.line;
},
/**
* Get the index of the character relative to the beginning of the line.
* Ranges from 0 to (length of line - 1).
* @returns {Number}
*/
getCharPositionInLine: function() {
return this.charPositionInLine;
},
/**
* Set the current line in the input stream.
* This is used internally when performing rewinds.
* @param {Number} line
* @private
*/
setLine: function(line) {
this.line = line;
},
/**
* Set the index of the character relative to the beginning of the line.
* Ranges from 0 to (length of line - 1).
* @param {Number} pos
* @private
*/
setCharPositionInLine: function(pos) {
this.charPositionInLine = pos;
},
/** Where are you getting symbols from? Normally, implementations will
* pass the buck all the way to the lexer who can ask its input stream
* for the file name or whatever.
*/
getSourceName: function() {
return null;
}
};
/**
* Alias for {@link #LA}.
* @methodOf org.antlr.runtime.ANTLRStringStream.prototype
* @name LT
*/
org.antlr.runtime.ANTLRStringStream.LT = org.antlr.runtime.ANTLRStringStream.LA;
/** The most common stream of tokens is one where every token is buffered up
* and tokens are prefiltered for a certain channel (the parser will only
* see these tokens and cannot change the filter channel number during the
* parse).
*
* TODO: how to access the full token stream? How to track all tokens matched per rule?
*/
org.antlr.runtime.CommonTokenStream = function(tokenSource, channel) {
this.p = -1;
this.channel = org.antlr.runtime.Token.DEFAULT_CHANNEL;
this.v_discardOffChannelTokens = false;
this.tokens = [];
if (arguments.length >= 2) {
this.channel = channel;
} else if (arguments.length === 1) {
this.tokenSource = tokenSource;
}
};
org.antlr.runtime.CommonTokenStream.prototype = {
/** Reset this token stream by setting its token source. */
setTokenSource: function(tokenSource) {
this.tokenSource = tokenSource;
this.tokens = [];
this.p = -1;
this.channel = org.antlr.runtime.Token.DEFAULT_CHANNEL;
},
/** Load all tokens from the token source and put in tokens.
* This is done upon first LT request because you might want to
* set some token type / channel overrides before filling buffer.
*/
fillBuffer: function() {
var index = 0,
t = this.tokenSource.nextToken(),
discard,
channelI;
while ( org.antlr.lang.isValue(t) &&
t.getType()!=org.antlr.runtime.CharStream.EOF )
{
discard = false;
// is there a channel override for token type?
if ( this.channelOverrideMap ) {
channelI = this.channelOverrideMap[t.getType()];
if ( org.antlr.lang.isValue(channelI) ) {
t.setChannel(channelI);
}
}
if ( this.discardSet && this.discardSet[t.getType()] )
{
discard = true;
}
else if ( this.v_discardOffChannelTokens &&
t.getChannel()!=this.channel )
{
discard = true;
}
if ( !discard ) {
t.setTokenIndex(index);
this.tokens.push(t);
index++;
}
t = this.tokenSource.nextToken();
}
// leave p pointing at first token on channel
this.p = 0;
this.p = this.skipOffTokenChannels(this.p);
},
/** Move the input pointer to the next incoming token. The stream
* must become active with LT(1) available. consume() simply
* moves the input pointer so that LT(1) points at the next
* input symbol. Consume at least one token.
*
* Walk past any token not on the channel the parser is listening to.
*/
consume: function() {
if ( this.p<this.tokens.length ) {
this.p++;
this.p = this.skipOffTokenChannels(this.p); // leave p on valid token
}
},
/** Given a starting index, return the index of the first on-channel
* token.
*/
skipOffTokenChannels: function(i) {
var n = this.tokens.length;
while ( i<n && (this.tokens[i]).getChannel()!=this.channel ) {
i++;
}
return i;
},
skipOffTokenChannelsReverse: function(i) {
while ( i>=0 && (this.tokens[i]).getChannel()!=this.channel ) {
i--;
}
return i;
},
/** A simple filter mechanism whereby you can tell this token stream
* to force all tokens of type ttype to be on channel. For example,
* when interpreting, we cannot exec actions so we need to tell
* the stream to force all WS and NEWLINE to be a different, ignored
* channel.
*/
setTokenTypeChannel: function(ttype, channel) {
if ( !this.channelOverrideMap ) {
this.channelOverrideMap = {};
}
this.channelOverrideMap[ttype] = channel;
},
discardTokenType: function(ttype) {
if ( !this.discardSet ) {
this.discardSet = {};
}
this.discardSet[ttype] = true;
},
discardOffChannelTokens: function(b) {
this.v_discardOffChannelTokens = b;
},
/** Given a start and stop index, return a List of all tokens in
* the token type BitSet. Return null if no tokens were found. This
* method looks at both on and off channel tokens.
*/
getTokens: function(start, stop, types) {
if ( this.p === -1 ) {
this.fillBuffer();
}
if (arguments.length===0) {
return this.tokens;
}
if (org.antlr.lang.isArray(types)) {
types = new org.antlr.runtime.BitSet(types);
} else if (org.antlr.lang.isNumber(types)) {
types = org.antlr.runtime.BitSet.of(types);
}
if ( stop>=this.tokens.length ) {
stop=this.tokens.length-1;
}
if ( start<0 ) {
start=0;
}
if ( start>stop ) {
return null;
}
// list = tokens[start:stop]:{Token t, t.getType() in types}
var filteredTokens = [],
i,
t;
for (i=start; i<=stop; i++) {
t = this.tokens[i];
if ( !this.types || types.member(t.getType()) ) {
filteredTokens.push(t);
}
}
if ( filteredTokens.length===0 ) {
filteredTokens = null;
}
return filteredTokens;
},
/** Get the ith token from the current position 1..n where k=1 is the
* first symbol of lookahead.
*/
LT: function(k) {
if ( this.p === -1 ) {
this.fillBuffer();
}
if ( k===0 ) {
return null;
}
if ( k<0 ) {
return this.LB(-1*k);
}
if ( (this.p+k-1) >= this.tokens.length ) {
return org.antlr.runtime.Token.EOF_TOKEN;
}
var i = this.p,
n = 1;
// find k good tokens
while ( n<k ) {
// skip off-channel tokens
i = this.skipOffTokenChannels(i+1); // leave p on valid token
n++;
}
if ( i>=this.tokens.length ) {
return org.antlr.runtime.Token.EOF_TOKEN;
}
return this.tokens[i];
},
/** Look backwards k tokens on-channel tokens */
LB: function(k) {
if ( this.p === -1 ) {
this.fillBuffer();
}
if ( k===0 ) {
return null;
}
if ( (this.p-k)<0 ) {
return null;
}
var i = this.p,
n = 1;
// find k good tokens looking backwards
while ( n<=k ) {
// skip off-channel tokens
i = this.skipOffTokenChannelsReverse(i-1); // leave p on valid token
n++;
}
if ( i<0 ) {
return null;
}
return this.tokens[i];
},
/** Return absolute token i; ignore which channel the tokens are on;
* that is, count all tokens not just on-channel tokens.
*/
get: function(i) {
return this.tokens[i];
},
LA: function(i) {
return this.LT(i).getType();
},
mark: function() {
if ( this.p === -1 ) {
this.fillBuffer();
}
this.lastMarker = this.index();
return this.lastMarker;
},
release: function(marker) {
// no resources to release
},
size: function() {
return this.tokens.length;
},
index: function() {
return this.p;
},
rewind: function(marker) {
if (!org.antlr.lang.isNumber(marker)) {
marker = this.lastMarker;
}
this.seek(marker);
},
reset: function() {
this.p = -1;
this.lastMarker = 0;
},
seek: function(index) {
this.p = index;
},
getTokenSource: function() {
return this.tokenSource;
},
getSourceName: function() {
return this.getTokenSource().getSourceName();
},
toString: function(start, stop) {
if (arguments.length===0) {
if ( this.p === -1 ) {
this.fillBuffer();
}
start = 0;
stop = this.tokens.length-1;
}
if (!org.antlr.lang.isNumber(start) && !org.antlr.lang.isNumber(stop)) {
if ( org.antlr.lang.isValue(start) && org.antlr.lang.isValue(stop) ) {
start = start.getTokenIndex();
stop = stop.getTokenIndex();
} else {
return null;
}
}
var buf = "",
i;
if ( start<0 || stop<0 ) {
return null;
}
if ( this.p == -1 ) {
this.fillBuffer();
}
if ( stop>=this.tokens.length ) {
stop = this.tokens.length-1;
}
for (i = start; i <= stop; i++) {
t = this.tokens[i];
buf = buf + this.tokens[i].getText();
}
return buf;
}
};
/* Useful for dumping out the input stream after doing some
* augmentation or other manipulations.
*
* You can insert stuff, replace, and delete chunks. Note that the
* operations are done lazily--only if you convert the buffer to a
* String. This is very efficient because you are not moving data around
* all the time. As the buffer of tokens is converted to strings, the
* toString() method(s) check to see if there is an operation at the
* current index. If so, the operation is done and then normal String
* rendering continues on the buffer. This is like having multiple Turing
* machine instruction streams (programs) operating on a single input tape. :)
*
* Since the operations are done lazily at toString-time, operations do not
* screw up the token index values. That is, an insert operation at token
* index i does not change the index values for tokens i+1..n-1.
*
* Because operations never actually alter the buffer, you may always get
* the original token stream back without undoing anything. Since
* the instructions are queued up, you can easily simulate transactions and
* roll back any changes if there is an error just by removing instructions.
* For example,
*
* CharStream input = new ANTLRFileStream("input");
* TLexer lex = new TLexer(input);
* TokenRewriteStream tokens = new TokenRewriteStream(lex);
* T parser = new T(tokens);
* parser.startRule();
*
* Then in the rules, you can execute
* Token t,u;
* ...
* input.insertAfter(t, "text to put after t");}
* input.insertAfter(u, "text after u");}
* System.out.println(tokens.toString());
*
* Actually, you have to cast the 'input' to a TokenRewriteStream. :(
*
* You can also have multiple "instruction streams" and get multiple
* rewrites from a single pass over the input. Just name the instruction
* streams and use that name again when printing the buffer. This could be
* useful for generating a C file and also its header file--all from the
* same buffer:
*
* tokens.insertAfter("pass1", t, "text to put after t");}
* tokens.insertAfter("pass2", u, "text after u");}
* System.out.println(tokens.toString("pass1"));
* System.out.println(tokens.toString("pass2"));
*
* If you don't use named rewrite streams, a "default" stream is used as
* the first example shows.
*/
org.antlr.runtime.TokenRewriteStream = function() {
var sup = org.antlr.runtime.TokenRewriteStream.superclass;
/** You may have multiple, named streams of rewrite operations.
* I'm calling these things "programs."
* Maps String (name) -> rewrite (List)
*/
this.programs = null;
/** Map String (program name) -> Integer index */
this.lastRewriteTokenIndexes = null;
if (arguments.length===0) {
this.init();
} else {
sup.constructor.apply(this, arguments);
this.init();
}
};
(function(){
var trs = org.antlr.runtime.TokenRewriteStream;
org.antlr.lang.augmentObject(trs, {
DEFAULT_PROGRAM_NAME: "default",
PROGRAM_INIT_SIZE: 100,
MIN_TOKEN_INDEX: 0
});
//
// Define the rewrite operation hierarchy
//
trs.RewriteOperation = function(index, text) {
this.index = index;
this.text = text;
};
/** Execute the rewrite operation by possibly adding to the buffer.
* Return the index of the next token to operate on.
*/
trs.RewriteOperation.prototype = {
execute: function(buf) {
return this.index;
},
toString: function() {
/*String opName = getClass().getName();
int $index = opName.indexOf('$');
opName = opName.substring($index+1, opName.length());
return opName+"@"+index+'"'+text+'"';*/
return this.text;
}
};
trs.InsertBeforeOp = function(index, text) {
trs.InsertBeforeOp.superclass.constructor.call(this, index, text);
};
org.antlr.lang.extend(trs.InsertBeforeOp, trs.RewriteOperation, {
execute: function(buf) {
buf.push(this.text);
return this.index;
}
});
/** I'm going to try replacing range from x..y with (y-x)+1 ReplaceOp
* instructions.
*/
trs.ReplaceOp = function(from, to, text) {
trs.ReplaceOp.superclass.constructor.call(this, from, text);
this.lastIndex = to;
};
org.antlr.lang.extend(trs.ReplaceOp, trs.RewriteOperation, {
execute: function(buf) {
if (org.antlr.lang.isValue(this.text)) {
buf.push(this.text);
}
return this.lastIndex+1;
}
});
trs.DeleteOp = function(from, to) {
trs.DeleteOp.superclass.constructor.call(this, from, to);
};
org.antlr.lang.extend(trs.DeleteOp, trs.ReplaceOp);
org.antlr.lang.extend(trs, org.antlr.runtime.CommonTokenStream, {
init: function() {
this.programs = {};
this.programs[trs.DEFAULT_PROGRAM_NAME] = [];
this.lastRewriteTokenIndexes = {};
},
/** Rollback the instruction stream for a program so that
* the indicated instruction (via instructionIndex) is no
* longer in the stream. UNTESTED!
*/
rollback: function() {
var programName,
instructionIndex;
if (arguments.length===1) {
programName = trs.DEFAULT_PROGRAM_NAME;
instructionIndex = arguments[0];
} else if (arguments.length===2) {
programName = arguments[0];
instructionIndex = arguments[1];
}
var is = this.programs[programName];
if (is) {
programs[programName] = is.slice(trs.MIN_TOKEN_INDEX, this.instructionIndex);
}
},
/** Reset the program so that no instructions exist */
deleteProgram: function(programName) {
programName = programName || trs.DEFAULT_PROGRAM_NAME;
this.rollback(programName, trs.MIN_TOKEN_INDEX);
},
/** Add an instruction to the rewrite instruction list ordered by
* the instruction number (use a binary search for efficiency).
* The list is ordered so that toString() can be done efficiently.
*
* When there are multiple instructions at the same index, the instructions
* must be ordered to ensure proper behavior. For example, a delete at
* index i must kill any replace operation at i. Insert-before operations
* must come before any replace / delete instructions. If there are
* multiple insert instructions for a single index, they are done in
* reverse insertion order so that "insert foo" then "insert bar" yields
* "foobar" in front rather than "barfoo". This is convenient because
* I can insert new InsertOp instructions at the index returned by
* the binary search. A ReplaceOp kills any previous replace op. Since
* delete is the same as replace with null text, i can check for
* ReplaceOp and cover DeleteOp at same time. :)
*/
addToSortedRewriteList: function() {
var programName,
op;
if (arguments.length===1) {
programName = trs.DEFAULT_PROGRAM_NAME;
op = arguments[0];
} else if (arguments.length===2) {
programName = arguments[0];
op = arguments[1];
}
var rewrites = this.getProgram(programName);
var len, pos, searchOp, replaced, prevOp, i;
for (pos=0, len=rewrites.length; pos<len; pos++) {
searchOp = rewrites[pos];
if (searchOp.index===op.index) {
// now pos is the index in rewrites of first op with op.index
// an instruction operating already on that index was found;
// make this one happen after all the others
if (op instanceof trs.ReplaceOp) {
replaced = false;
// look for an existing replace
for (i=pos; i<rewrites.length; i++) {
prevOp = rewrites[pos];
if (prevOp.index!==op.index) {
break;
}
if (prevOp instanceof trs.ReplaceOp) {
rewrites[pos] = op; // replace old with new
replaced=true;
break;
}
// keep going; must be an insert
}
if ( !replaced ) {
// add replace op to the end of all the inserts
rewrites.splice(i, 0, op);
}
} else {
// inserts are added in front of existing inserts
rewrites.splice(pos, 0, op);
}
break;
} else if (searchOp.index > op.index) {
rewrites.splice(pos, 0, op);
break;
}
}
if (pos===len) {
rewrites.push(op);
}
},
insertAfter: function() {
var index, programName, text;
if (arguments.length===2) {
programName = trs.DEFAULT_PROGRAM_NAME;
index = arguments[0];
text = arguments[1];
} else if (arguments.length===3) {
programName = arguments[0];
index = arguments[1];
text = arguments[2];
}
if (index instanceof org.antlr.runtime.CommonToken) {
// index is a Token, grab it's stream index
index = index.index; // that's ugly
}
// insert after is the same as insert before the next index
this.insertBefore(programName, index+1, text);
},
insertBefore: function() {
var index, programName, text;
if (arguments.length===2) {
programName = trs.DEFAULT_PROGRAM_NAME;
index = arguments[0];
text = arguments[1];
} else if (arguments.length===3) {
programName = arguments[0];
index = arguments[1];
text = arguments[2];
}
if (index instanceof org.antlr.runtime.CommonToken) {
// index is a Token, grab it's stream index
index = index.index; // that's ugly
}
this.addToSortedRewriteList(
programName,
new trs.InsertBeforeOp(index,text)
);
},
replace: function() {
var programName, first, last, text;
if (arguments.length===2) {
programName = trs.DEFAULT_PROGRAM_NAME;
first = arguments[0];
last = arguments[0];
text = arguments[1];
} else if (arguments.length===3) {
programName = trs.DEFAULT_PROGRAM_NAME;
first = arguments[0];
last = arguments[1];
text = arguments[2];
} if (arguments.length===4) {
programName = arguments[0];
first = arguments[1];
last = arguments[2];
text = arguments[3];
}
if (first instanceof org.antlr.runtime.CommonToken) {
first = first.index;
}
if (last instanceof org.antlr.runtime.CommonToken) {
last = last.index; // that's ugly
}
if ( first > last || last<0 || first<0 ) {
return;
}
this.addToSortedRewriteList(
programName,
new trs.ReplaceOp(first, last, text));
},
// !!! API Break: delete is a JS keyword, so using remove instead.
remove: function() {
// convert arguments to a real array
var args=[], i=arguments.length-1;
while (i>=0) {
args[i] = arguments[i];
i--;
}
args.push("");
this.replace.apply(this, args);
},
getLastRewriteTokenIndex: function(programName) {
programName = programName || trs.DEFAULT_PROGRAM_NAME;
return this.lastRewriteTokenIndexes[programName] || -1;
},
setLastRewriteTokenIndex: function(programName, i) {
this.lastRewriteTokenIndexes[programName] = i;
},
getProgram: function(name) {
var is = this.programs[name];
if ( !is ) {
is = this.initializeProgram(name);
}
return is;
},
initializeProgram: function(name) {
var is = [];
this.programs[name] = is;
return is;
},
toOriginalString: function(start, end) {
if (!org.antlr.lang.isNumber(start)) {
start = trs.MIN_TOKEN_INDEX;
}
if (!org.antlr.lang.isNumber(end)) {
end = this.size()-1;
}
var buf = [], i;
for (i=start; i>=trs.MIN_TOKEN_INDEX && i<=end && i<this.tokens.length; i++) {
buf.push(this.get(i).getText());
}
return buf.join("");
},
toString: function() {
var programName, start, end;
if (arguments.length===0) {
programName = trs.DEFAULT_PROGRAM_NAME;
start = trs.MIN_TOKEN_INDEX;
end = this.size() - 1;
} else if (arguments.length===1) {
programName = arguments[0];
start = trs.MIN_TOKEN_INDEX;
end = this.size() - 1;
} else if (arguments.length===2) {
programName = trs.DEFAULT_PROGRAM_NAME;
start = arguments[0];
end = arguments[1];
}
var rewrites = this.programs[programName];
if ( !rewrites || rewrites.length===0 ) {
return this.toOriginalString(start,end);
}
/// Index of first rewrite we have not done
var rewriteOpIndex = 0,
tokenCursor=start,
buf = [],
op;
while ( tokenCursor>=trs.MIN_TOKEN_INDEX &&
tokenCursor<=end &&
tokenCursor<this.tokens.length )
{
// execute instructions associated with this token index
if ( rewriteOpIndex<rewrites.length ) {
op = rewrites[rewriteOpIndex];
// skip all ops at lower index
while (op.index<tokenCursor && rewriteOpIndex<rewrites.length) {
rewriteOpIndex++;
if ( rewriteOpIndex<rewrites.length ) {
op = rewrites[rewriteOpIndex];
}
}
// while we have ops for this token index, exec them
while (tokenCursor===op.index && rewriteOpIndex<rewrites.length) {
//System.out.println("execute "+op+" at instruction "+rewriteOpIndex);
tokenCursor = op.execute(buf);
//System.out.println("after execute tokenCursor = "+tokenCursor);
rewriteOpIndex++;
if ( rewriteOpIndex<rewrites.length ) {
op = rewrites[rewriteOpIndex];
}
}
}
// dump the token at this index
if ( tokenCursor<=end ) {
buf.push(this.get(tokenCursor).getText());
tokenCursor++;
}
}
// now see if there are operations (append) beyond last token index
var opi;
for (opi=rewriteOpIndex; opi<rewrites.length; opi++) {
op = rewrites[opi];
if ( op.index>=this.size() ) {
op.execute(buf); // must be insertions if after last token
}
}
return buf.join("");
},
toDebugString: function(start, end) {
if (!org.antlr.lang.isNumber(start)) {
start = trs.MIN_TOKEN_INDEX;
}
if (!org.antlr.lang.isNumber(end)) {
end = this.size()-1;
}
var buf = [],
i;
for (i=start; i>=trs.MIN_TOKEN_INDEX && i<=end && i<this.tokens.length; i++) {
buf.push(this.get(i));
}
return buf.join("");
}
});
})();
/** A stream of tree nodes, accessing nodes from a tree of some kind */
org.antlr.runtime.tree.TreeNodeStream = function() {};
/** A buffered stream of tree nodes. Nodes can be from a tree of ANY kind.
*
* This node stream sucks all nodes out of the tree specified in
* the constructor during construction and makes pointers into
* the tree using an array of Object pointers. The stream necessarily
* includes pointers to DOWN and UP and EOF nodes.
*
* This stream knows how to mark/release for backtracking.
*
* This stream is most suitable for tree interpreters that need to
* jump around a lot or for tree parsers requiring speed (at cost of memory).
* There is some duplicated functionality here with UnBufferedTreeNodeStream
* but just in bookkeeping, not tree walking etc...
*
* @see UnBufferedTreeNodeStream
*/
org.antlr.runtime.tree.CommonTreeNodeStream = function(adaptor,
tree,
initialBufferSize)
{
if (arguments.length===1) {
tree = adaptor;
adaptor = new org.antlr.runtime.tree.CommonTreeAdaptor();
}
if (arguments.length <= 2) {
initialBufferSize =
org.antlr.runtime.tree.CommonTreeNodeStream.DEFAULT_INITIAL_BUFFER_SIZE;
}
/** Reuse same DOWN, UP navigation nodes unless this is true */
this.uniqueNavigationNodes = false;
/** The index into the nodes list of the current node (next node
* to consume). If -1, nodes array not filled yet.
*/
this.p = -1;
var Token = org.antlr.runtime.Token;
this.root = tree;
this.adaptor = adaptor;
this.nodes = []; //new ArrayList(initialBufferSize);
this.down = this.adaptor.create(Token.DOWN, "DOWN");
this.up = this.adaptor.create(Token.UP, "UP");
this.eof = this.adaptor.create(Token.EOF, "EOF");
};
org.antlr.lang.augmentObject(org.antlr.runtime.tree.CommonTreeNodeStream, {
DEFAULT_INITIAL_BUFFER_SIZE: 100,
INITIAL_CALL_STACK_SIZE: 10
});
org.antlr.lang.extend(org.antlr.runtime.tree.CommonTreeNodeStream,
org.antlr.runtime.tree.TreeNodeStream,
{
StreamIterator: function() {
var i = 0,
nodes = this.nodes,
eof = this.eof;
return {
hasNext: function() {
return i<nodes.length;
},
next: function() {
var current = i;
i++;
if ( current < nodes.length ) {
return nodes[current];
}
return eof;
},
remove: function() {
throw new Error("cannot remove nodes from stream");
}
};
},
/** Walk tree with depth-first-search and fill nodes buffer.
* Don't do DOWN, UP nodes if its a list (t is isNil).
*/
fillBuffer: function(t) {
var reset_p = false;
if (org.antlr.lang.isUndefined(t)) {
t = this.root;
reset_p = true;
}
var nil = this.adaptor.isNil(t);
if ( !nil ) {
this.nodes.push(t); // add this node
}
// add DOWN node if t has children
var n = this.adaptor.getChildCount(t);
if ( !nil && n>0 ) {
this.addNavigationNode(org.antlr.runtime.Token.DOWN);
}
// and now add all its children
var c, child;
for (c=0; c<n; c++) {
child = this.adaptor.getChild(t,c);
this.fillBuffer(child);
}
// add UP node if t has children
if ( !nil && n>0 ) {
this.addNavigationNode(org.antlr.runtime.Token.UP);
}
if (reset_p) {
this.p = 0; // buffer of nodes intialized now
}
},
getNodeIndex: function(node) {
if ( this.p==-1 ) {
this.fillBuffer();
}
var i, t;
for (i=0; i<this.nodes.length; i++) {
t = this.nodes[i];
if ( t===node ) {
return i;
}
}
return -1;
},
/** As we flatten the tree, we use UP, DOWN nodes to represent
* the tree structure. When debugging we need unique nodes
* so instantiate new ones when uniqueNavigationNodes is true.
*/
addNavigationNode: function(ttype) {
var navNode = null;
if ( ttype===org.antlr.runtime.Token.DOWN ) {
if ( this.hasUniqueNavigationNodes() ) {
navNode = this.adaptor.create(org.antlr.runtime.Token.DOWN, "DOWN");
}
else {
navNode = this.down;
}
}
else {
if ( this.hasUniqueNavigationNodes() ) {
navNode = this.adaptor.create(org.antlr.runtime.Token.UP, "UP");
}
else {
navNode = this.up;
}
}
this.nodes.push(navNode);
},
get: function(i) {
if ( this.p===-1 ) {
this.fillBuffer();
}
return this.nodes[i];
},
LT: function(k) {
if ( this.p===-1 ) {
this.fillBuffer();
}
if ( k===0 ) {
return null;
}
if ( k<0 ) {
return this.LB(-1*k);
}
if ( (this.p+k-1) >= this.nodes.length ) {
return this.eof;
}
return this.nodes[this.p+k-1];
},
getCurrentSymbol: function() { return this.LT(1); },
/** Look backwards k nodes */
LB: function(k) {
if ( k===0 ) {
return null;
}
if ( (this.p-k)<0 ) {
return null;
}
return this.nodes[this.p-k];
},
getTreeSource: function() {
return this.root;
},
getSourceName: function() {
return this.getTokenStream().getSourceName();
},
getTokenStream: function() {
return this.tokens;
},
setTokenStream: function(tokens) {
this.tokens = tokens;
},
getTreeAdaptor: function() {
return this.adaptor;
},
setTreeAdaptor: function(adaptor) {
this.adaptor = adaptor;
},
hasUniqueNavigationNodes: function() {
return this.uniqueNavigationNodes;
},
setUniqueNavigationNodes: function(uniqueNavigationNodes) {
this.uniqueNavigationNodes = uniqueNavigationNodes;
},
consume: function() {
if ( this.p===-1 ) {
this.fillBuffer();
}
this.p++;
},
LA: function(i) {
return this.adaptor.getType(this.LT(i));
},
mark: function() {
if ( this.p===-1 ) {
this.fillBuffer();
}
this.lastMarker = this.index();
return this.lastMarker;
},
release: function(marker) {
// no resources to release
},
index: function() {
return this.p;
},
rewind: function(marker) {
if (!org.antlr.lang.isNumber(marker)) {
marker = this.lastMarker;
}
this.seek(marker);
},
seek: function(index) {
if ( this.p===-1 ) {
this.fillBuffer();
}
this.p = index;
},
/** Make stream jump to a new location, saving old location.
* Switch back with pop().
*/
push: function(index) {
if ( !this.calls ) {
this.calls = [];
}
this.calls.push(this.p); // save current index
this.seek(index);
},
/** Seek back to previous index saved during last push() call.
* Return top of stack (return index).
*/
pop: function() {
var ret = this.calls.pop();
this.seek(ret);
return ret;
},
reset: function() {
this.p = -1;
this.lastMarker = 0;
if (this.calls) {
this.calls = [];
}
},
size: function() {
if ( this.p===-1 ) {
this.fillBuffer();
}
return this.nodes.length;
},
iterator: function() {
if ( this.p===-1 ) {
this.fillBuffer();
}
return this.StreamIterator();
},
replaceChildren: function(parent, startChildIndex, stopChildIndex, t) {
if ( parent ) {
this.adaptor.replaceChildren(parent, startChildIndex, stopChildIndex, t);
}
},
/** Debugging */
toTokenString: function(start, stop) {
if ( this.p===-1 ) {
this.fillBuffer();
}
var buf='', i, t;
for (i = start; i < this.nodes.length && i <= stop; i++) {
t = this.nodes[i];
buf += " "+this.adaptor.getToken(t);
}
return buf;
},
/** Used for testing, just return the token type stream */
toString: function(start, stop) {
var buf = "",
text,
t,
i;
if (arguments.length===0) {
if ( this.p===-1 ) {
this.fillBuffer();
}
for (i = 0; i < this.nodes.length; i++) {
t = this.nodes[i];
buf += " ";
buf += this.adaptor.getType(t);
}
return buf;
} else {
if ( !org.antlr.lang.isNumber(start) || !org.antlr.lang.isNumber(stop) ) {
return null;
}
if ( this.p===-1 ) {
this.fillBuffer();
}
//System.out.println("stop: "+stop);
if ( start instanceof org.antlr.runtime.tree.CommonTree ) {
//System.out.print("toString: "+((CommonTree)start).getToken()+", ");
} else {
//System.out.println(start);
}
if ( stop instanceof org.antlr.runtime.tree.CommonTree ) {
//System.out.println(((CommonTree)stop).getToken());
} else {
//System.out.println(stop);
}
// if we have the token stream, use that to dump text in order
var beginTokenIndex,
endTokenIndex;
if ( this.tokens ) {
beginTokenIndex = this.adaptor.getTokenStartIndex(start);
endTokenIndex = this.adaptor.getTokenStopIndex(stop);
// if it's a tree, use start/stop index from start node
// else use token range from start/stop nodes
if ( this.adaptor.getType(stop)===org.antlr.runtime.Token.UP ) {
endTokenIndex = this.adaptor.getTokenStopIndex(start);
}
else if ( this.adaptor.getType(stop)==org.antlr.runtime.Token.EOF )
{
endTokenIndex = this.size()-2; // don't use EOF
}
return this.tokens.toString(beginTokenIndex, endTokenIndex);
}
// walk nodes looking for start
t = null;
i = 0;
for (; i < this.nodes.length; i++) {
t = this.nodes[i];
if ( t===start ) {
break;
}
}
// now walk until we see stop, filling string buffer with text
buf = text = "";
t = this.nodes[i];
while ( t!==stop ) {
text = this.adaptor.getText(t);
if ( !org.antlr.lang.isString(text) ) {
text = " "+this.adaptor.getType(t).toString();
}
buf += text;
i++;
t = nodes[i];
}
// include stop node too
text = this.adaptor.getText(stop);
if ( !org.antlr.lang.isString(text) ) {
text = " "+this.adaptor.getType(stop).toString();
}
buf += text;
return buf;
}
}
});
/** A generic list of elements tracked in an alternative to be used in
* a -> rewrite rule. We need to subclass to fill in the next() method,
* which returns either an AST node wrapped around a token payload or
* an existing subtree.
*
* Once you start next()ing, do not try to add more elements. It will
* break the cursor tracking I believe.
*
* @see org.antlr.runtime.tree.RewriteRuleSubtreeStream
* @see org.antlr.runtime.tree.RewriteRuleTokenStream
*
* TODO: add mechanism to detect/puke on modification after reading from stream
*/
org.antlr.runtime.tree.RewriteRuleElementStream = function(adaptor, elementDescription, el) {
/** Cursor 0..n-1. If singleElement!=null, cursor is 0 until you next(),
* which bumps it to 1 meaning no more elements.
*/
this.cursor = 0;
/** Once a node / subtree has been used in a stream, it must be dup'd
* from then on. Streams are reset after subrules so that the streams
* can be reused in future subrules. So, reset must set a dirty bit.
* If dirty, then next() always returns a dup.
*
* I wanted to use "naughty bit" here, but couldn't think of a way
* to use "naughty".
*/
this.dirty = false;
this.elementDescription = elementDescription;
this.adaptor = adaptor;
if (el) {
if (org.antlr.lang.isArray(el)) {
this.singleElement = null;
this.elements = el;
} else {
this.add(el);
}
}
};
org.antlr.runtime.tree.RewriteRuleElementStream.prototype = {
/** Reset the condition of this stream so that it appears we have
* not consumed any of its elements. Elements themselves are untouched.
* Once we reset the stream, any future use will need duplicates. Set
* the dirty bit.
*/
reset: function() {
this.cursor = 0;
this.dirty = true;
},
add: function(el) {
if ( !org.antlr.lang.isValue(el) ) {
return;
}
if ( this.elements ) { // if in list, just add
this.elements.push(el);
return;
}
if ( !org.antlr.lang.isValue(this.singleElement) ) { // no elements yet, track w/o list
this.singleElement = el;
return;
}
// adding 2nd element, move to list
this.elements = [];
this.elements.push(this.singleElement);
this.singleElement = null;
this.elements.push(el);
},
/** Return the next element in the stream. If out of elements, throw
* an exception unless size()==1. If size is 1, then return elements[0].
* Return a duplicate node/subtree if stream is out of elements and
* size==1. If we've already used the element, dup (dirty bit set).
*/
nextTree: function() {
var n = this.size(),
el;
if ( this.dirty || (this.cursor>=n && n==1) ) {
// if out of elements and size is 1, dup
el = this._next();
return this.dup(el);
}
// test size above then fetch
el = this._next();
return el;
},
/** do the work of getting the next element, making sure that it's
* a tree node or subtree. Deal with the optimization of single-
* element list versus list of size > 1. Throw an exception
* if the stream is empty or we're out of elements and size>1.
* protected so you can override in a subclass if necessary.
*/
_next: function() {
var n = this.size();
if (n===0) {
throw new org.antlr.runtime.tree.RewriteEmptyStreamException(this.elementDescription);
}
if ( this.cursor>= n) { // out of elements?
if ( n===1 ) { // if size is 1, it's ok; return and we'll dup
return this.toTree(this.singleElement);
}
// out of elements and size was not 1, so we can't dup
throw new org.antlr.runtime.tree.RewriteCardinalityException(this.elementDescription);
}
// we have elements
if ( org.antlr.lang.isValue(this.singleElement) ) {
this.cursor++; // move cursor even for single element list
return this.toTree(this.singleElement);
}
// must have more than one in list, pull from elements
var o = this.toTree(this.elements[this.cursor]);
this.cursor++;
return o;
},
/** Ensure stream emits trees; tokens must be converted to AST nodes.
* AST nodes can be passed through unmolested.
*/
toTree: function(el) {
if (el && el.getTree) {
return el.getTree();
}
return el;
},
hasNext: function() {
return (org.antlr.lang.isValue(this.singleElement) && this.cursor < 1) ||
(this.elements && this.cursor < this.elements.length);
},
size: function() {
var n = 0;
if ( org.antlr.lang.isValue(this.singleElement) ) {
n = 1;
}
if ( this.elements ) {
return this.elements.length;
}
return n;
},
getDescription: function() {
return this.elementDescription;
}
};
/** Queues up nodes matched on left side of -> in a tree parser. This is
* the analog of RewriteRuleTokenStream for normal parsers.
*/
org.antlr.runtime.tree.RewriteRuleNodeStream = function(adaptor, elementDescription, el) {
org.antlr.runtime.tree.RewriteRuleNodeStream.superclass.constructor.apply(this, arguments);
};
org.antlr.lang.extend(org.antlr.runtime.tree.RewriteRuleNodeStream,
org.antlr.runtime.tree.RewriteRuleElementStream,
{
nextNode: function() {
return this._next();
},
toTree: function(el) {
return this.adaptor.dupNode(el);
},
dup: function() {
// we dup every node, so don't have to worry about calling dup; short-
// circuited next() so it doesn't call.
throw new Error("dup can't be called for a node stream.");
}
});
org.antlr.runtime.tree.RewriteRuleTokenStream = function(adaptor, elementDescription, el) {
var sup = org.antlr.runtime.tree.RewriteRuleTokenStream.superclass;
sup.constructor.apply(this, arguments);
};
org.antlr.lang.extend(org.antlr.runtime.tree.RewriteRuleTokenStream,
org.antlr.runtime.tree.RewriteRuleElementStream, {
/** Get next token from stream and make a node for it */
nextNode: function() {
var t = this._next();
return this.adaptor.create(t);
},
nextToken: function() {
return this._next();
},
/** Don't convert to a tree unless they explicitly call nextTree.
* This way we can do hetero tree nodes in rewrite.
*/
toTree: function(el) {
return el;
},
dup: function(el) {
throw new Error("dup can't be called for a token stream.");
}
});
org.antlr.runtime.tree.RewriteRuleSubtreeStream = function() {
var sup = org.antlr.runtime.tree.RewriteRuleSubtreeStream.superclass;
sup.constructor.apply(this, arguments);
};
org.antlr.lang.extend(org.antlr.runtime.tree.RewriteRuleSubtreeStream,
org.antlr.runtime.tree.RewriteRuleElementStream, {
/** Treat next element as a single node even if it's a subtree.
* This is used instead of next() when the result has to be a
* tree root node. Also prevents us from duplicating recently-added
* children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration
* must dup the type node, but ID has been added.
*
* Referencing a rule result twice is ok; dup entire tree as
* we can't be adding trees as root; e.g., expr expr.
*
* Hideous code duplication here with super.next(). Can't think of
* a proper way to refactor. This needs to always call dup node
* and super.next() doesn't know which to call: dup node or dup tree.
*/
nextNode: function() {
var n = this.size(),
el;
if ( this.dirty || (this.cursor>=n && n===1) ) {
// if out of elements and size is 1, dup (at most a single node
// since this is for making root nodes).
el = this._next();
return this.adaptor.dupNode(el);
}
// test size above then fetch
el = this._next();
return el;
},
dup: function(el) {
return this.adaptor.dupTree(el);
}
});/** A generic recognizer that can handle recognizers generated from
* lexer, parser, and tree grammars. This is all the parsing
* support code essentially; most of it is error recovery stuff and
* backtracking.
*
* <p>This class should not be instantiated directly. Instead, use one of its
* subclasses.</p>
*
* @class
* @param {org.antlr.runtime.RecognizerSharedState} [state] optional state object
* with which to initialize this recognizer.
*/
org.antlr.runtime.BaseRecognizer = function(state) {
/** State of a lexer, parser, or tree parser are collected into a state
* object so the state can be shared. This sharing is needed to
* have one grammar import others and share same error variables
* and other state variables. It's a kind of explicit multiple
* inheritance via delegation of methods and shared state.
*/
this.state = state || new org.antlr.runtime.RecognizerSharedState();
};
/* static vars, methods */
org.antlr.lang.augmentObject(org.antlr.runtime.BaseRecognizer, {
MEMO_RULE_FAILED: -2,
MEMO_RULE_UNKNOWN: -1,
INITIAL_FOLLOW_STACK_SIZE: 100,
MEMO_RULE_FAILED_I: -2,
DEFAULT_TOKEN_CHANNEL: org.antlr.runtime.Token.DEFAULT_CHANNEL,
HIDDEN: org.antlr.runtime.Token.HIDDEN_CHANNEL,
NEXT_TOKEN_RULE_NAME: "nextToken"
});
org.antlr.runtime.BaseRecognizer.prototype = {
/** Reset the parser's state. Subclasses must rewinds the input stream */
reset: function() {
var i, len;
// wack everything related to error recovery
if (!this.state) {
return; // no shared state work to do
}
this.state._fsp = -1;
this.state.errorRecovery = false;
this.state.lastErrorIndex = -1;
this.state.failed = false;
this.state.syntaxErrors = 0;
// wack everything related to backtracking and memoization
this.state.backtracking = 0;
// wipe cache
if (this.state.ruleMemo) {
for (i=0, len=this.state.ruleMemo.length; i<len; i++) {
this.state.ruleMemo[i] = null;
}
}
},
/** Match current input symbol against ttype. Attempt
* single token insertion or deletion error recovery. If
* that fails, throw {@link org.antlr.runtime.MismatchedTokenException}.
*
* <p>To turn off single token insertion or deletion error
* recovery, override {@link #mismatchRecover} and have it call
* plain {@link #mismatch}, which does not recover. Then any error
* in a rule will cause an exception and immediate exit from
* rule. Rule would recover by resynchronizing to the set of
* symbols that can follow rule ref.</p>
*
* @param {org.antlr.runtime.IntStream} input input stream to match against.
* @param {Number} ttype input type to match.
* @param {org.antlr.runtime.BitSet} [follow] set of tokens that can follow the
* matched token.
* @returns {Object} the matched symbol
*/
match: function(input, ttype, follow) {
var matchedSymbol = this.getCurrentInputSymbol(input);
if ( input.LA(1)===ttype ) {
input.consume();
this.state.errorRecovery = false;
this.state.failed = false;
return matchedSymbol;
}
if ( this.state.backtracking>0 ) {
this.state.failed = true;
return matchedSymbol;
}
matchedSymbol = this.recoverFromMismatchedToken(input, ttype, follow);
return matchedSymbol;
},
/**
* Match any token.
* @param {org.antlr.runtime.IntStream} input input stream to match against.
*/
matchAny: function(input) {
this.state.errorRecovery = false;
this.state.failed = false;
input.consume();
},
/**
* Is the following token (LA(2)) the unwanted type (ttype)?
* @param {org.antlr.runtime.IntStream} input input stream to match against.
* @param {Number} ttype the undesired token type.
* @returns {Boolean} true if and only if the following token is the
* unwanted type.
*/
mismatchIsUnwantedToken: function(input, ttype) {
return input.LA(2)===ttype;
},
/**
* Does the stream appear to be missing a single token?
* @param {org.antlr.runtime.IntStream} input input stream to match against.
* @param {org.antlr.runtime.BitSet} [follow] set of tokens that can follow the
* matched token.
* @returns {Boolean} true if and only if it appears that the stream is
* missing a single token.
*/
mismatchIsMissingToken: function(input, follow) {
if ( !follow ) {
// we have no information about the follow; we can only consume
// a single token and hope for the best
return false;
}
// compute what can follow this grammar element reference
if ( follow.member(org.antlr.runtime.Token.EOR_TOKEN_TYPE) ) {
if ( this.state._fsp>=0 ) { // remove EOR if we're not the start symbol
follow.remove(org.antlr.runtime.Token.EOR_TOKEN_TYPE);
}
var viableTokensFollowingThisRule = this.computeContextSensitiveRuleFOLLOW();
follow = follow.or(this.viableTokensFollowingThisRule);
}
// if current token is consistent with what could come after set
// then we know we're missing a token; error recovery is free to
// "insert" the missing token
// BitSet cannot handle negative numbers like -1 (EOF) so I leave EOR
// in follow set to indicate that the fall of the start symbol is
// in the set (EOF can follow).
if ( follow.member(input.LA(1)) ||
follow.member(org.antlr.runtime.Token.EOR_TOKEN_TYPE) )
{
return true;
}
return false;
},
/** Factor out what to do upon token mismatch so tree parsers can behave
* differently. Override and call {@link #mismatchRecover}
* to get single token insertion and deletion.
*
* @param {org.antlr.runtime.IntStream} input input stream to match against.
* @param {Number} ttype input type to match.
* @param {org.antlr.runtime.BitSet} [follow] set of tokens that can follow the
* matched token.
*/
mismatch: function(input, ttype, follow) {
if ( this.mismatchIsUnwantedToken(input, ttype) ) {
throw new org.antlr.runtime.UnwantedTokenException(ttype, input);
} else if ( this.mismatchIsMissingToken(input, follow) ) {
throw new org.antlr.runtime.MissingTokenException(ttype, input, null);
}
throw new org.antlr.runtime.MismatchedTokenException(ttype, input);
},
/** Report a recognition problem.
*
* <p>This method sets errorRecovery to indicate the parser is recovering
* not parsing. Once in recovery mode, no errors are generated.
* To get out of recovery mode, the parser must successfully match
* a token (after a resync). So it will go:</p>
* <ol>
* <li>error occurs</li>
* <li>enter recovery mode, report error</li>
* <li>consume until token found in resynch set</li>
* <li>try to resume parsing</li>
* <li>next match() will reset errorRecovery mode</li>
* </ol>
*
* <p>If you override, make sure to update this.state.syntaxErrors if you
* care about that.</p>
* @param {org.antlr.runtime.RecognitionException} e the error to be reported.
*/
reportError: function(e) {
// if we've already reported an error and have not matched a token
// yet successfully, don't report any errors.
if ( this.state.errorRecovery ) {
return;
}
this.state.syntaxErrors++;
this.state.errorRecovery = true;
this.displayRecognitionError(this.getTokenNames(), e);
},
/**
* Assemble recognition error message.
* @param {Array} tokenNames array of token names (strings).
* @param {org.antlr.runtime.RecognitionException} e the error to be reported.
*/
displayRecognitionError: function(tokenNames, e) {
var hdr = this.getErrorHeader(e),
msg = this.getErrorMessage(e, tokenNames);
this.emitErrorMessage(hdr+" "+msg);
},
/**
* Create error header message. Format is <q>line
* lineNumber:positionInLine</q>.
* @param {org.antlr.runtime.RecognitionException} e the error to be reported.
* @returns {String} The error header.
*/
getErrorHeader: function(e) {
/* handle null input */
if (!org.antlr.lang.isNumber(e.line)) {
e.line = 0;
}
return "line "+e.line+":"+e.charPositionInLine;
},
/**
* Override this method to change where error messages go.
* Defaults to "alert"-ing the error in browsers and "print"-ing the error
* in other environments (e.g. Rhino, SpiderMonkey).
* @param {String} msg the error message to be displayed.
*/
emitErrorMessage: function(msg) {
if (typeof(window) != 'undefined' && window.alert) {
alert(msg);
} else {
print(msg);
}
},
/** What error message should be generated for the various
* exception types?
*
* <p>Not very object-oriented code, but I like having all error message
* generation within one method rather than spread among all of the
* exception classes. This also makes it much easier for the exception
* handling because the exception classes do not have to have pointers back
* to this object to access utility routines and so on. Also, changing
* the message for an exception type would be difficult because you
* would have to be subclassing exceptions, but then somehow get ANTLR
* to make those kinds of exception objects instead of the default.</p>
*
* <p>For grammar debugging, you will want to override this to add
* more information such as the stack frame and no viable alts.</p>
*
* <p>Override this to change the message generated for one or more
* exception types.</p>
*
* @param {Array} tokenNames array of token names (strings).
* @param {org.antlr.runtime.RecognitionException} e the error to be reported.
* @returns {String} the error message to be emitted.
*/
getErrorMessage: function(e, tokenNames) {
var msg = (e && e.getMessage) ? e.getMessage() : null,
mte,
tokenName;
if ( e instanceof org.antlr.runtime.UnwantedTokenException ) {
var ute = e;
tokenName="<unknown>";
if ( ute.expecting== org.antlr.runtime.Token.EOF ) {
tokenName = "EOF";
} else {
tokenName = tokenNames[ute.expecting];
}
msg = "extraneous input "+this.getTokenErrorDisplay(ute.getUnexpectedToken())+
" expecting "+tokenName;
}
else if ( e instanceof org.antlr.runtime.MissingTokenException ) {
mte = e;
tokenName="<unknown>";
if ( mte.expecting== org.antlr.runtime.Token.EOF ) {
tokenName = "EOF";
} else {
tokenName = tokenNames[mte.expecting];
}
msg = "missing "+tokenName+" at "+this.getTokenErrorDisplay(e.token);
}
else if ( e instanceof org.antlr.runtime.MismatchedTokenException ) {
mte = e;
tokenName="<unknown>";
if ( mte.expecting== org.antlr.runtime.Token.EOF ) {
tokenName = "EOF";
}
else {
tokenName = tokenNames[mte.expecting];
}
msg = "mismatched input "+this.getTokenErrorDisplay(e.token)+
" expecting "+tokenName;
}
else if ( e instanceof org.antlr.runtime.NoViableAltException ) {
msg = "no viable alternative at input "+this.getTokenErrorDisplay(e.token);
}
else if ( e instanceof org.antlr.runtime.EarlyExitException ) {
msg = "required (...)+ loop did not match anything at input "+
this.getTokenErrorDisplay(e.token);
}
else if ( e instanceof org.antlr.runtime.MismatchedSetException ) {
msg = "mismatched input "+this.getTokenErrorDisplay(e.token)+
" expecting set "+e.expecting;
}
else if ( e instanceof org.antlr.runtime.MismatchedNotSetException ) {
msg = "mismatched input "+this.getTokenErrorDisplay(e.token)+
" expecting set "+e.expecting;
}
else if ( e instanceof org.antlr.runtime.FailedPredicateException ) {
msg = "rule "+e.ruleName+" failed predicate: {"+
e.predicateText+"}?";
}
return msg;
},
/** Get number of recognition errors (lexer, parser, tree parser). Each
* recognizer tracks its own number. So parser and lexer each have
* separate count. Does not count the spurious errors found between
* an error and next valid token match
*
* See also reportError()
*/
getNumberOfSyntaxErrors: function() {
return this.state.syntaxErrors;
},
/** How should a token be displayed in an error message? The default
* is to display just the text, but during development you might
* want to have a lot of information spit out. Override in that case
* to use t.toString() (which, for CommonToken, dumps everything about
* the token). This is better than forcing you to override a method in
* your token objects because you don't have to go modify your lexer
* so that it creates a new Java type.
*/
getTokenErrorDisplay: function(t) {
var s = t.getText();
if ( !org.antlr.lang.isValue(s) ) {
if ( t.getType()==org.antlr.runtime.Token.EOF ) {
s = "<EOF>";
}
else {
s = "<"+t.getType()+">";
}
}
s = s.replace(/\n/g,"\\n");
s = s.replace(/\r/g,"\\r");
s = s.replace(/\t/g,"\\t");
return "'"+s+"'";
},
/** Recover from an error found on the input stream. This is
* for NoViableAlt and mismatched symbol exceptions. If you enable
* single token insertion and deletion, this will usually not
* handle mismatched symbol exceptions but there could be a mismatched
* token that the match() routine could not recover from.
*/
recover: function(input, re) {
if ( this.state.lastErrorIndex==input.index() ) {
// uh oh, another error at same token index; must be a case
// where LT(1) is in the recovery token set so nothing is
// consumed; consume a single token so at least to prevent
// an infinite loop; this is a failsafe.
input.consume();
}
this.state.lastErrorIndex = input.index();
var followSet = this.computeErrorRecoverySet();
this.beginResync();
this.consumeUntil(input, followSet);
this.endResync();
},
/** A hook to listen in on the token consumption during error recovery.
* The DebugParser subclasses this to fire events to the listenter.
*/
beginResync: function() {
},
endResync: function() {
},
/* Compute the error recovery set for the current rule. During
* rule invocation, the parser pushes the set of tokens that can
* follow that rule reference on the stack; this amounts to
* computing FIRST of what follows the rule reference in the
* enclosing rule. This local follow set only includes tokens
* from within the rule; i.e., the FIRST computation done by
* ANTLR stops at the end of a rule.
*
* EXAMPLE
*
* When you find a "no viable alt exception", the input is not
* consistent with any of the alternatives for rule r. The best
* thing to do is to consume tokens until you see something that
* can legally follow a call to r *or* any rule that called r.
* You don't want the exact set of viable next tokens because the
* input might just be missing a token--you might consume the
* rest of the input looking for one of the missing tokens.
*
* Consider grammar:
*
* a : '[' b ']'
* | '(' b ')'
* ;
* b : c '^' INT ;
* c : ID
* | INT
* ;
*
* At each rule invocation, the set of tokens that could follow
* that rule is pushed on a stack. Here are the various "local"
* follow sets:
*
* FOLLOW(b1_in_a) = FIRST(']') = ']'
* FOLLOW(b2_in_a) = FIRST(')') = ')'
* FOLLOW(c_in_b) = FIRST('^') = '^'
*
* Upon erroneous input "[]", the call chain is
*
* a -> b -> c
*
* and, hence, the follow context stack is:
*
* depth local follow set after call to rule
* 0 <EOF> a (from main())
* 1 ']' b
* 3 '^' c
*
* Notice that ')' is not included, because b would have to have
* been called from a different context in rule a for ')' to be
* included.
*
* For error recovery, we cannot consider FOLLOW(c)
* (context-sensitive or otherwise). We need the combined set of
* all context-sensitive FOLLOW sets--the set of all tokens that
* could follow any reference in the call chain. We need to
* resync to one of those tokens. Note that FOLLOW(c)='^' and if
* we resync'd to that token, we'd consume until EOF. We need to
* sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}.
* In this case, for input "[]", LA(1) is in this set so we would
* not consume anything and after printing an error rule c would
* return normally. It would not find the required '^' though.
* At this point, it gets a mismatched token error and throws an
* exception (since LA(1) is not in the viable following token
* set). The rule exception handler tries to recover, but finds
* the same recovery set and doesn't consume anything. Rule b
* exits normally returning to rule a. Now it finds the ']' (and
* with the successful match exits errorRecovery mode).
*
* So, you cna see that the parser walks up call chain looking
* for the token that was a member of the recovery set.
*
* Errors are not generated in errorRecovery mode.
*
* ANTLR's error recovery mechanism is based upon original ideas:
*
* "Algorithms + Data Structures = Programs" by Niklaus Wirth
*
* and
*
* "A note on error recovery in recursive descent parsers":
* http://portal.acm.org/citation.cfm?id=947902.947905
*
* Later, Josef Grosch had some good ideas:
*
* "Efficient and Comfortable Error Recovery in Recursive Descent
* Parsers":
* ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip
*
* Like Grosch I implemented local FOLLOW sets that are combined
* at run-time upon error to avoid overhead during parsing.
*/
computeErrorRecoverySet: function() {
return this.combineFollows(false);
},
/** Compute the context-sensitive FOLLOW set for current rule.
* This is set of token types that can follow a specific rule
* reference given a specific call chain. You get the set of
* viable tokens that can possibly come next (lookahead depth 1)
* given the current call chain. Contrast this with the
* definition of plain FOLLOW for rule r:
*
* FOLLOW(r)={x | S=>*alpha r beta in G and x in FIRST(beta)}
*
* where x in T* and alpha, beta in V*; T is set of terminals and
* V is the set of terminals and nonterminals. In other words,
* FOLLOW(r) is the set of all tokens that can possibly follow
* references to r in *any* sentential form (context). At
* runtime, however, we know precisely which context applies as
* we have the call chain. We may compute the exact (rather
* than covering superset) set of following tokens.
*
* For example, consider grammar:
*
* stat : ID '=' expr ';' // FOLLOW(stat)=={EOF}
* | "return" expr '.'
* ;
* expr : atom ('+' atom)* ; // FOLLOW(expr)=={';','.',')'}
* atom : INT // FOLLOW(atom)=={'+',')',';','.'}
* | '(' expr ')'
* ;
*
* The FOLLOW sets are all inclusive whereas context-sensitive
* FOLLOW sets are precisely what could follow a rule reference.
* For input input "i=(3);", here is the derivation:
*
* stat => ID '=' expr ';'
* => ID '=' atom ('+' atom)* ';'
* => ID '=' '(' expr ')' ('+' atom)* ';'
* => ID '=' '(' atom ')' ('+' atom)* ';'
* => ID '=' '(' INT ')' ('+' atom)* ';'
* => ID '=' '(' INT ')' ';'
*
* At the "3" token, you'd have a call chain of
*
* stat -> expr -> atom -> expr -> atom
*
* What can follow that specific nested ref to atom? Exactly ')'
* as you can see by looking at the derivation of this specific
* input. Contrast this with the FOLLOW(atom)={'+',')',';','.'}.
*
* You want the exact viable token set when recovering from a
* token mismatch. Upon token mismatch, if LA(1) is member of
* the viable next token set, then you know there is most likely
* a missing token in the input stream. "Insert" one by just not
* throwing an exception.
*/
computeContextSensitiveRuleFOLLOW: function() {
return this.combineFollows(true);
},
combineFollows: function(exact) {
var top = this.state._fsp,
i,
localFollowSet,
followSet = new org.antlr.runtime.BitSet();
for (i=top; i>=0; i--) {
localFollowSet = this.state.following[i];
followSet.orInPlace(localFollowSet);
if ( exact ) {
// can we see end of rule?
if ( localFollowSet.member(org.antlr.runtime.Token.EOR_TOKEN_TYPE) )
{
// Only leave EOR in set if at top (start rule); this lets
// us know if have to include follow(start rule); i.e., EOF
if ( i>0 ) {
followSet.remove(org.antlr.runtime.Token.EOR_TOKEN_TYPE);
}
}
else { // can't see end of rule, quit
break;
}
}
}
return followSet;
},
/** Attempt to recover from a single missing or extra token.
*
* EXTRA TOKEN
*
* LA(1) is not what we are looking for. If LA(2) has the right token,
* however, then assume LA(1) is some extra spurious token. Delete it
* and LA(2) as if we were doing a normal match(), which advances the
* input.
*
* MISSING TOKEN
*
* If current token is consistent with what could come after
* ttype then it is ok to "insert" the missing token, else throw
* exception For example, Input "i=(3;" is clearly missing the
* ')'. When the parser returns from the nested call to expr, it
* will have call chain:
*
* stat -> expr -> atom
*
* and it will be trying to match the ')' at this point in the
* derivation:
*
* => ID '=' '(' INT ')' ('+' atom)* ';'
* ^
* match() will see that ';' doesn't match ')' and report a
* mismatched token error. To recover, it sees that LA(1)==';'
* is in the set of tokens that can follow the ')' token
* reference in rule atom. It can assume that you forgot the ')'.
*/
recoverFromMismatchedToken: function(input,
ttype,
follow)
{
var e = null;
// if next token is what we are looking for then "delete" this token
if ( this.mismatchIsUnwantedToken(input, ttype) ) {
e = new org.antlr.runtime.UnwantedTokenException(ttype, input);
this.beginResync();
input.consume(); // simply delete extra token
this.endResync();
this.reportError(e); // report after consuming so AW sees the token in the exception
// we want to return the token we're actually matching
var matchedSymbol = this.getCurrentInputSymbol(input);
input.consume(); // move past ttype token as if all were ok
return matchedSymbol;
}
// can't recover with single token deletion, try insertion
if ( this.mismatchIsMissingToken(input, follow) ) {
var inserted = this.getMissingSymbol(input, e, ttype, follow);
e = new org.antlr.runtime.MissingTokenException(ttype, input, inserted);
this.reportError(e); // report after inserting so AW sees the token in the exception
return inserted;
}
// even that didn't work; must throw the exception
e = new org.antlr.runtime.MismatchedTokenException(ttype, input);
throw e;
},
recoverFromMismatchedSet: function(input,
e,
follow)
{
if ( this.mismatchIsMissingToken(input, follow) ) {
// System.out.println("missing token");
this.reportError(e);
// we don't know how to conjure up a token for sets yet
return this.getMissingSymbol(input, e, org.antlr.runtime.Token.INVALID_TOKEN_TYPE, follow);
}
throw e;
},
/** Match needs to return the current input symbol, which gets put
* into the label for the associated token ref; e.g., x=ID. Token
* and tree parsers need to return different objects. Rather than test
* for input stream type or change the IntStream interface, I use
* a simple method to ask the recognizer to tell me what the current
* input symbol is.
*
* This is ignored for lexers.
*/
getCurrentInputSymbol: function(input) { return null; },
/** Conjure up a missing token during error recovery.
*
* The recognizer attempts to recover from single missing
* symbols. But, actions might refer to that missing symbol.
* For example, x=ID {f($x);}. The action clearly assumes
* that there has been an identifier matched previously and that
* $x points at that token. If that token is missing, but
* the next token in the stream is what we want we assume that
* this token is missing and we keep going. Because we
* have to return some token to replace the missing token,
* we have to conjure one up. This method gives the user control
* over the tokens returned for missing tokens. Mostly,
* you will want to create something special for identifier
* tokens. For literals such as '{' and ',', the default
* action in the parser or tree parser works. It simply creates
* a CommonToken of the appropriate type. The text will be the token.
* If you change what tokens must be created by the lexer,
* override this method to create the appropriate tokens.
*/
getMissingSymbol: function(input,
e,
expectedTokenType,
follow)
{
return null;
},
/** Consume tokens until one matches the given token set */
consumeUntil: function(input, set) {
var ttype = input.LA(1);
while (ttype != org.antlr.runtime.Token.EOF && !set.member(ttype) ) {
input.consume();
ttype = input.LA(1);
}
},
/** Push a rule's follow set using our own hardcoded stack */
pushFollow: function(fset) {
if ( (this.state._fsp +1)>=this.state.following.length ) {
var f = [];
var i;
for (i=this.state.following.length-1; i>=0; i--) {
f[i] = this.state.following[i];
}
this.state.following = f;
}
this.state._fsp++;
this.state.following[this.state._fsp] = fset;
},
/** Return List<String> of the rules in your parser instance
* leading up to a call to this method. You could override if
* you want more details such as the file/line info of where
* in the parser java code a rule is invoked.
*
* This is very useful for error messages and for context-sensitive
* error recovery.
*
* A more general version of getRuleInvocationStack where you can
* pass in, for example, a RecognitionException to get it's rule
* stack trace. This routine is shared with all recognizers, hence,
* static.
*
* TODO: move to a utility class or something; weird having lexer call this
*
* Most JS interpreters can't do real stack reflection. See this
* spidermonkey bug, for example:
* https://bugzilla.mozilla.org/show_bug.cgi?id=332104
*
* JS is supposed to get real stack traces in v4, at which time it would
* be easy to implement this function.
*
* Until then I'll leave this unimplemented. If there is enough clamor
* it would be possible to keep track of the invocation stack using an
* auxillary array, but that will definitely be a performance hit.
*/
getRuleInvocationStack: function(e, recognizerClassName)
{
throw new Error("Not implemented.");
},
getBacktrackingLevel: function() {
return this.state.backtracking;
},
/** Used to print out token names like ID during debugging and
* error reporting. The generated parsers implement a method
* that overrides this to point to their String[] tokenNames.
*/
getTokenNames: function() {
return null;
},
/** For debugging and other purposes, might want the grammar name.
* Have ANTLR generate an implementation for this method.
*/
getGrammarFileName: function() {
return null;
},
/** A convenience method for use most often with template rewrites.
* Convert a List<Token> to List<String>
*/
toStrings: function(tokens) {
if ( !tokens ) {
return null;
}
var strings = [];
var i;
for (i=0; i<tokens.length; i++) {
strings.push(tokens[i].getText());
}
return strings;
},
/** Given a rule number and a start token index number, return
* MEMO_RULE_UNKNOWN if the rule has not parsed input starting from
* start index. If this rule has parsed input starting from the
* start index before, then return where the rule stopped parsing.
* It returns the index of the last token matched by the rule.
*
* For now we use a hashtable and just the slow Object-based one.
* Later, we can make a special one for ints and also one that
* tosses out data after we commit past input position i.
*/
getRuleMemoization: function(ruleIndex, ruleStartIndex) {
if ( !this.state.ruleMemo[ruleIndex] ) {
this.state.ruleMemo[ruleIndex] = {};
}
var stopIndexI =
this.state.ruleMemo[ruleIndex][ruleStartIndex];
if ( !org.antlr.lang.isNumber(stopIndexI) ) {
return org.antlr.runtime.BaseRecognizer.MEMO_RULE_UNKNOWN;
}
return stopIndexI;
},
/** Has this rule already parsed input at the current index in the
* input stream? Return the stop token index or MEMO_RULE_UNKNOWN.
* If we attempted but failed to parse properly before, return
* MEMO_RULE_FAILED.
*
* This method has a side-effect: if we have seen this input for
* this rule and successfully parsed before, then seek ahead to
* 1 past the stop token matched for this rule last time.
*/
alreadyParsedRule: function(input, ruleIndex) {
var stopIndex = this.getRuleMemoization(ruleIndex, input.index());
if ( stopIndex==org.antlr.runtime.BaseRecognizer.MEMO_RULE_UNKNOWN ) {
return false;
}
if ( stopIndex==org.antlr.runtime.BaseRecognizer.MEMO_RULE_FAILED ) {
//System.out.println("rule "+ruleIndex+" will never succeed");
this.state.failed=true;
}
else {
input.seek(stopIndex+1); // jump to one past stop token
}
return true;
},
/** Record whether or not this rule parsed the input at this position
* successfully. Use a standard java hashtable for now.
*/
memoize: function(input,
ruleIndex,
ruleStartIndex)
{
var stopTokenIndex = this.state.failed ?
org.antlr.runtime.BaseRecognizer.MEMO_RULE_FAILED : input.index()-1;
if ( !org.antlr.lang.isValue(this.state.ruleMemo) ) {
throw new Error("!!!!!!!!! memo array is null for "+ this.getGrammarFileName());
}
if ( ruleIndex >= this.state.ruleMemo.length ) {
throw new Error("!!!!!!!!! memo size is "+this.state.ruleMemo.length+", but rule index is "+ruleIndex);
}
if ( org.antlr.lang.isValue(this.state.ruleMemo[ruleIndex]) ) {
this.state.ruleMemo[ruleIndex][ruleStartIndex] = stopTokenIndex;
}
},
/** return how many rule/input-index pairs there are in total.
* TODO: this includes synpreds.
*/
getRuleMemoizationCacheSize: function() {
var n = 0, i;
for (i = 0; this.state.ruleMemo && i < this.state.ruleMemo.length; i++) {
var ruleMap = this.state.ruleMemo[i];
if ( ruleMap ) {
// @todo need to get size of rulemap?
n += ruleMap.length; // how many input indexes are recorded?
}
}
return n;
},
traceIn: function(ruleName, ruleIndex, inputSymbol) {
this.emitErrorMessage("enter "+ruleName+" "+inputSymbol);
if ( this.state.failed ) {
this.emitErrorMessage(" failed="+this.failed);
}
if ( this.state.backtracking>0 ) {
this.emitErrorMessage(" backtracking="+this.state.backtracking);
}
// System.out.println();
},
traceOut: function(ruleName, ruleIndex, inputSymbol) {
this.emitErrorMessage("exit "+ruleName+" "+inputSymbol);
if ( this.state.failed ) {
this.emitErrorMessage(" failed="+this.state.failed);
}
if ( this.state.backtracking>0 ) {
this.emitErrorMessage(" backtracking="+this.state.backtracking);
}
}
};
/** A lexer is recognizer that draws input symbols from a character stream.
* lexer grammars result in a subclass of this object. A Lexer object
* uses simplified match() and error recovery mechanisms in the interest
* of speed.
*/
org.antlr.runtime.Lexer = function(input, state) {
if (state) {
org.antlr.runtime.Lexer.superclass.constructor.call(this, state);
}
if (input) {
this.input = input;
}
};
org.antlr.lang.extend(org.antlr.runtime.Lexer, org.antlr.runtime.BaseRecognizer, {
reset: function() {
// reset all recognizer state variables
org.antlr.runtime.Lexer.superclass.reset.call(this);
if ( org.antlr.lang.isValue(this.input) ) {
this.input.seek(0); // rewind the input
}
if ( !org.antlr.lang.isValue(this.state) ) {
return; // no shared state work to do
}
this.state.token = null;
this.state.type = org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
this.state.channel = org.antlr.runtime.Token.DEFAULT_CHANNEL;
this.state.tokenStartCharIndex = -1;
this.state.tokenStartCharPositionInLine = -1;
this.state.tokenStartLine = -1;
this.state.text = null;
},
/** Return a token from this source; i.e., match a token on the char
* stream.
*/
nextToken: function() {
while (true) {
this.state.token = null;
this.state.channel = org.antlr.runtime.Token.DEFAULT_CHANNEL;
this.state.tokenStartCharIndex = this.input.index();
this.state.tokenStartCharPositionInLine = this.input.getCharPositionInLine();
this.state.tokenStartLine = this.input.getLine();
this.state.text = null;
if ( this.input.LA(1)===org.antlr.runtime.CharStream.EOF ) {
return org.antlr.runtime.Token.EOF_TOKEN;
}
try {
this.mTokens();
if ( !org.antlr.lang.isValue(this.state.token) ) {
this.emit();
}
else if ( this.state.token==org.antlr.runtime.Token.SKIP_TOKEN ) {
continue;
}
return this.state.token;
}
catch (re) {
if ( re instanceof org.antlr.runtime.RecognitionException ) {
this.reportError(re);
} else if (re instanceof org.antlr.runtime.NoViableAltException) {
this.reportError(re);
this.recover(re);
} else {
throw re;
}
}
}
},
/** Instruct the lexer to skip creating a token for current lexer rule
* and look for another token. nextToken() knows to keep looking when
* a lexer rule finishes with token set to SKIP_TOKEN. Recall that
* if token==null at end of any token rule, it creates one for you
* and emits it.
*/
skip: function() {
this.state.token = org.antlr.runtime.Token.SKIP_TOKEN;
},
/** Set the char stream and reset the lexer */
setCharStream: function(input) {
this.input = null;
this.reset();
this.input = input;
},
getCharStream: function() {
return this.input;
},
getSourceName: function() {
return this.input.getSourceName();
},
/** Currently does not support multiple emits per nextToken invocation
* for efficiency reasons. Subclass and override this method and
* nextToken (to push tokens into a list and pull from that list rather
* than a single variable as this implementation does).
*
* The standard method called to automatically emit a token at the
* outermost lexical rule. The token object should point into the
* char buffer start..stop. If there is a text override in 'text',
* use that to set the token's text. Override this method to emit
* custom Token objects.
*
* If you are building trees, then you should also override
* Parser or TreeParser.getMissingSymbol().
*/
emit: function() {
if (arguments.length===0) {
var t = new org.antlr.runtime.CommonToken(this.input, this.state.type, this.state.channel, this.state.tokenStartCharIndex, this.getCharIndex()-1);
t.setLine(this.state.tokenStartLine);
t.setText(this.state.text);
t.setCharPositionInLine(this.state.tokenStartCharPositionInLine);
this.state.token = t;
return t;
} else {
this.state.token = arguments[0];
}
},
match: function(s) {
var i = 0,
mte;
if (org.antlr.lang.isString(s)) {
while ( i<s.length ) {
if ( this.input.LA(1)!=s.charAt(i) ) {
if ( this.state.backtracking>0 ) {
this.state.failed = true;
return;
}
mte = new org.antlr.runtime.MismatchedTokenException(s.charAt(i), this.input);
this.recover(mte);
throw mte;
}
i++;
this.input.consume();
this.state.failed = false;
}
} else if (org.antlr.lang.isNumber(s)) {
if ( this.input.LA(1)!=s ) {
if ( this.state.backtracking>0 ) {
this.state.failed = true;
return;
}
mte = new org.antlr.runtime.MismatchedTokenException(s, this.input);
this.recover(mte);
throw mte;
}
this.input.consume();
this.state.failed = false;
}
},
matchAny: function() {
this.input.consume();
},
matchRange: function(a, b) {
if ( this.input.LA(1)<a || this.input.LA(1)>b ) {
if ( this.state.backtracking>0 ) {
this.state.failed = true;
return;
}
mre = new org.antlr.runtime.MismatchedRangeException(a,b,this.input);
this.recover(mre);
throw mre;
}
this.input.consume();
this.state.failed = false;
},
getLine: function() {
return this.input.getLine();
},
getCharPositionInLine: function() {
return this.input.getCharPositionInLine();
},
/** What is the index of the current character of lookahead? */
getCharIndex: function() {
return this.input.index();
},
/** Return the text matched so far for the current token or any
* text override.
*/
getText: function() {
if ( org.antlr.lang.isString(this.state.text) ) {
return this.state.text;
}
return this.input.substring(this.state.tokenStartCharIndex,this.getCharIndex()-1);
},
/** Set the complete text of this token; it wipes any previous
* changes to the text.
*/
setText: function(text) {
this.state.text = text;
},
reportError: function(e) {
/** TODO: not thought about recovery in lexer yet.
*
// if we've already reported an error and have not matched a token
// yet successfully, don't report any errors.
if ( errorRecovery ) {
//System.err.print("[SPURIOUS] ");
return;
}
errorRecovery = true;
*/
this.displayRecognitionError(this.getTokenNames(), e);
},
getErrorMessage: function(e, tokenNames) {
var msg = null;
if ( e instanceof org.antlr.runtime.MismatchedTokenException ) {
msg = "mismatched character "+this.getCharErrorDisplay(e.c)+" expecting "+this.getCharErrorDisplay(e.expecting);
}
else if ( e instanceof org.antlr.runtime.NoViableAltException ) {
msg = "no viable alternative at character "+this.getCharErrorDisplay(e.c);
}
else if ( e instanceof org.antlr.runtime.EarlyExitException ) {
msg = "required (...)+ loop did not match anything at character "+this.getCharErrorDisplay(e.c);
}
else if ( e instanceof org.antlr.runtime.MismatchedNotSetException ) {
msg = "mismatched character "+this.getCharErrorDisplay(e.c)+" expecting set "+e.expecting;
}
else if ( e instanceof org.antlr.runtime.MismatchedSetException ) {
msg = "mismatched character "+this.getCharErrorDisplay(e.c)+" expecting set "+e.expecting;
}
else if ( e instanceof org.antlr.runtime.MismatchedRangeException ) {
msg = "mismatched character "+this.getCharErrorDisplay(e.c)+" expecting set "+
this.getCharErrorDisplay(e.a)+".."+this.getCharErrorDisplay(e.b);
}
else {
msg = org.antlr.runtime.Lexer.superclass.getErrorMessage.call(this, e, tokenNames);
}
return msg;
},
getCharErrorDisplay: function(c) {
var s = c; //String.fromCharCode(c);
switch ( s ) {
case org.antlr.runtime.Token.EOF :
s = "<EOF>";
break;
case "\n" :
s = "\\n";
break;
case "\t" :
s = "\\t";
break;
case "\r" :
s = "\\r";
break;
}
return "'"+s+"'";
},
/** Lexers can normally match any char in it's vocabulary after matching
* a token, so do the easy thing and just kill a character and hope
* it all works out. You can instead use the rule invocation stack
* to do sophisticated error recovery if you are in a fragment rule.
*/
recover: function(re) {
this.input.consume();
},
traceIn: function(ruleName, ruleIndex) {
var inputSymbol = String.fromCharCode(this.input.LT(1))+" line="+this.getLine()+":"+this.getCharPositionInLine();
org.antlr.runtime.Lexer.superclass.traceIn.call(this, ruleName, ruleIndex, inputSymbol);
},
traceOut: function(ruleName, ruleIndex) {
var inputSymbol = String.fromCharCode(this.input.LT(1))+" line="+this.getLine()+":"+this.getCharPositionInLine();
org.antlr.runtime.Lexer.superclass.traceOut.call(this, ruleName, ruleIndex, inputSymbol);
}
});
/** Rules that return more than a single value must return an object
* containing all the values. Besides the properties defined in
* RuleLabelScope.predefinedRulePropertiesScope there may be user-defined
* return values. This class simply defines the minimum properties that
* are always defined and methods to access the others that might be
* available depending on output option such as template and tree.
*
* Note text is not an actual property of the return value, it is computed
* from start and stop using the input stream's toString() method. I
* could add a ctor to this so that we can pass in and store the input
* stream, but I'm not sure we want to do that. It would seem to be undefined
* to get the .text property anyway if the rule matches tokens from multiple
* input streams.
*
* I do not use getters for fields of objects that are used simply to
* group values such as this aggregate. The getters/setters are there to
* satisfy the superclass interface.
*/
org.antlr.runtime.ParserRuleReturnScope = function() {};
org.antlr.runtime.ParserRuleReturnScope.prototype = {
getStart: function() { return this.start; },
getStop: function() { return this.stop; }
};
/** This is identical to the ParserRuleReturnScope except that
* the start property is a tree nodes not Token object
* when you are parsing trees. To be generic the tree node types
* have to be Object.
*/
org.antlr.runtime.tree.TreeRuleReturnScope = function(){};
org.antlr.runtime.tree.TreeRuleReturnScope.prototype = {
getStart: function() { return this.start; }
};
/** A parser for TokenStreams. "parser grammars" result in a subclass
* of this.
*/
org.antlr.runtime.Parser = function(input, state) {
org.antlr.runtime.Parser.superclass.constructor.call(this, state);
this.setTokenStream(input);
};
org.antlr.lang.extend(org.antlr.runtime.Parser, org.antlr.runtime.BaseRecognizer, {
reset: function() {
// reset all recognizer state variables
org.antlr.runtime.Parser.superclass.reset.call(this);
if ( org.antlr.lang.isValue(this.input) ) {
this.input.seek(0); // rewind the input
}
},
getCurrentInputSymbol: function(input) {
return input.LT(1);
},
getMissingSymbol: function(input,
e,
expectedTokenType,
follow)
{
var tokenText =
"<missing "+this.getTokenNames()[expectedTokenType]+">";
var t = new org.antlr.runtime.CommonToken(expectedTokenType, tokenText);
var current = input.LT(1);
var old_current;
if ( current.getType() === org.antlr.runtime.Token.EOF ) {
old_current = current;
current = input.LT(-1);
// handle edge case where there are no good tokens in the stream
if (!current) {
current = old_current;
}
}
t.line = current.getLine();
t.charPositionInLine = current.getCharPositionInLine();
t.channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
return t;
},
/** Set the token stream and reset the parser */
setTokenStream: function(input) {
this.input = null;
this.reset();
this.input = input;
},
getTokenStream: function() {
return this.input;
},
getSourceName: function() {
return this.input.getSourceName();
},
traceIn: function(ruleName, ruleIndex) {
org.antlr.runtime.Parser.superclass.traceIn.call(
this, ruleName, ruleIndex, this.input.LT(1));
},
traceOut: function(ruleName, ruleIndex) {
org.antlr.runtime.Parser.superclass.traceOut.call(
this, ruleName, ruleIndex, this.input.LT(1));
}
});
/** A DFA implemented as a set of transition tables.
*
* Any state that has a semantic predicate edge is special; those states
* are generated with if-then-else structures in a specialStateTransition()
* which is generated by cyclicDFA template.
*
* There are at most 32767 states (16-bit signed short).
* Could get away with byte sometimes but would have to generate different
* types and the simulation code too. For a point of reference, the Java
* lexer's Tokens rule DFA has 326 states roughly.
*/
org.antlr.runtime.DFA = function() {};
org.antlr.runtime.DFA.prototype = {
/** From the input stream, predict what alternative will succeed
* using this DFA (representing the covering regular approximation
* to the underlying CFL). Return an alternative number 1..n. Throw
* an exception upon error.
*/
predict: function(input) {
var mark = input.mark(), // remember where decision started in input
s = 0, // we always start at s0
specialState,
c,
snext;
try {
while ( true ) {
specialState = this.special[s];
if ( specialState>=0 ) {
s = this.specialStateTransition(specialState,input);
if (s===-1) {
this.noViableAlt(s, input);
return 0;
}
input.consume();
continue;
}
if ( this.accept[s] >= 1 ) {
return this.accept[s];
}
// look for a normal char transition
c = input.LA(1); // -1 == \uFFFF, all tokens fit in 65000 space
if (c===org.antlr.runtime.Token.EOF) {
c = -1;
} else if (org.antlr.lang.isString(c)) {
c = c.charCodeAt(0);
}
if (c>=this.min[s] && c<=this.max[s]) {
snext = this.transition[s][c-this.min[s]]; // move to next state
if ( snext < 0 ) {
// was in range but not a normal transition
// must check EOT, which is like the else clause.
// eot[s]>=0 indicates that an EOT edge goes to another
// state.
if ( this.eot[s]>=0 ) { // EOT Transition to accept state?
s = this.eot[s];
input.consume();
// TODO: I had this as return accept[eot[s]]
// which assumed here that the EOT edge always
// went to an accept...faster to do this, but
// what about predicated edges coming from EOT
// target?
continue;
}
this.noViableAlt(s,input);
return 0;
}
s = snext;
input.consume();
continue;
}
if ( this.eot[s]>=0 ) { // EOT Transition?
s = this.eot[s];
input.consume();
continue;
}
if ( c==org.antlr.runtime.Token.EOF && this.eof[s]>=0 ) { // EOF Transition to accept state?
return this.accept[this.eof[s]];
}
// not in range and not EOF/EOT, must be invalid symbol
this.noViableAlt(s,input);
return 0;
}
}
finally {
input.rewind(mark);
}
},
noViableAlt: function(s, input) {
if (this.recognizer.state.backtracking>0) {
this.recognizer.state.failed=true;
return;
}
var nvae =
new org.antlr.runtime.NoViableAltException(this.getDescription(),
this.decisionNumber,
s,
input);
this.error(nvae);
throw nvae;
},
/** A hook for debugging interface */
error: function(nvae) { },
specialStateTransition: function(s, input) {
return -1;
},
getDescription: function() {
return "n/a";
}
};
org.antlr.lang.augmentObject(org.antlr.runtime.DFA, {
/** Given a String that has a run-length-encoding of some unsigned shorts
* like "\1\2\3\9", convert to short[] {2,9,9,9}.
*/
unpackEncodedString: function(encodedString) {
// walk first to find how big it is.
var i,
data = [],
di = 0,
n,
v,
j;
for (i=0; i<encodedString.length; i+=2) {
n = encodedString.charCodeAt(i);
v = encodedString.charCodeAt(i+1);
if (v===0xffff) {
v = -1; // overflow at 16 bits
}
// add v n times to data
for (j=1; j<=n; j++) {
data[di++] = v;
}
}
return data;
},
// alias
unpackEncodedStringToUnsignedChars: function(encodedString) {
return org.antlr.runtime.DFA.unpackEncodedString(encodedString);
}
});
/** A parser for a stream of tree nodes. "tree grammars" result in a subclass
* of this. All the error reporting and recovery is shared with Parser via
* the BaseRecognizer superclass.
*/
org.antlr.runtime.tree.TreeParser = function(input) {
org.antlr.runtime.tree.TreeParser.superclass.constructor.call(this, arguments[1]);
this.setTreeNodeStream(input);
};
(function(){
var TP = org.antlr.runtime.tree.TreeParser;
org.antlr.lang.augmentObject(TP, {
DOWN: org.antlr.runtime.Token.DOWN,
UP: org.antlr.runtime.Token.UP
});
org.antlr.lang.extend(TP, org.antlr.runtime.BaseRecognizer, {
reset: function() {
TP.superclass.reset.call(this); // reset all recognizer state variables
if ( this.input ) {
this.input.seek(0); // rewind the input
}
},
/** Set the input stream */
setTreeNodeStream: function(input) {
this.input = input;
},
getTreeNodeStream: function() {
return this.input;
},
getSourceName: function() {
return this.input.getSourceName();
},
getCurrentInputSymbol: function(input) {
return input.LT(1);
},
getMissingSymbol: function(input, e, expectedTokenType, follow) {
var tokenText =
"<missing "+this.getTokenNames()[expectedTokenType]+">";
return new org.antlr.runtime.tree.CommonTree(new org.antlr.runtime.CommonToken(expectedTokenType, tokenText));
},
/** Match '.' in tree parser has special meaning. Skip node or
* entire tree if node has children. If children, scan until
* corresponding UP node.
*/
matchAny: function(ignore) { // ignore stream, copy of this.input
this.state.errorRecovery = false;
this.state.failed = false;
var look = this.input.LT(1);
if ( this.input.getTreeAdaptor().getChildCount(look)===0 ) {
this.input.consume(); // not subtree, consume 1 node and return
return;
}
// current node is a subtree, skip to corresponding UP.
// must count nesting level to get right UP
var level=0,
tokenType = this.input.getTreeAdaptor().getType(look);
while ( tokenType!==org.antlr.runtime.Token.EOF &&
!(tokenType===TP.UP && level===0) )
{
this.input.consume();
look = this.input.LT(1);
tokenType = this.input.getTreeAdaptor().getType(look);
if ( tokenType === TP.DOWN ) {
level++;
}
else if ( tokenType === TP.UP ) {
level--;
}
}
this.input.consume(); // consume UP
},
/** We have DOWN/UP nodes in the stream that have no line info; override.
* plus we want to alter the exception type. Don't try to recover
* * from tree parser errors inline...
*/
mismatch: function(input, ttype, follow) {
throw new org.antlr.runtime.MismatchedTreeNodeException(ttype, input);
},
/** Prefix error message with the grammar name because message is
* always intended for the programmer because the parser built
* the input tree not the user.
*/
getErrorHeader: function(e) {
return this.getGrammarFileName()+": node from "+
(e.approximateLineInfo?"after ":"")+"line "+e.line+":"+e.charPositionInLine;
},
/** Tree parsers parse nodes they usually have a token object as
* payload. Set the exception token and do the default behavior.
*/
getErrorMessage: function(e, tokenNames) {
var adaptor;
if ( this instanceof TP ) {
adaptor = e.input.getTreeAdaptor();
e.token = adaptor.getToken(e.node);
if ( !org.antlr.lang.isValue(e.token) ) { // could be an UP/DOWN node
e.token = new org.antlr.runtime.CommonToken(
adaptor.getType(e.node),
adaptor.getText(e.node));
}
}
return TP.superclass.getErrorMessage.call(this, e, tokenNames);
},
traceIn: function(ruleName, ruleIndex) {
TP.superclass.traceIn.call(this, ruleName, ruleIndex, this.input.LT(1));
},
traceOut: function(ruleName, ruleIndex) {
TP.superclass.traceOut.call(this, ruleName, ruleIndex, this.input.LT(1));
}
});
})();
#!/bin/bash
java -classpath ../lib/build/antlr-3.1.1.jar org.antlr.Tool ioke.g
grammar ioke;
options {
output = AST;
language=JavaScript;
}
tokens {
MESSAGE;
}
@members {
this.parseFully = function() {
var result = this.fullProgram();
return result == null ? null : result.getTree();
};
}
@lexer::members {
var IPOL_STRING = new Object();
var IPOL_ALT_STRING = new Object();
var IPOL_REGEXP = new Object();
var IPOL_ALT_REGEXP = new Object();
var interpolation = new Array();
this.startInterpolation = function() {
interpolation.push(IPOL_STRING);
};
this.startAltInterpolation = function() {
interpolation.push(IPOL_ALT_STRING);
};
this.startRegexpInterpolation = function() {
interpolation.push(IPOL_REGEXP);
};
this.startAltRegexpInterpolation = function () {
interpolation.push(IPOL_REGEXP);
};
this.endInterpolation = function() {
interpolation.pop();
};
this.endAltInterpolation = function() {
interpolation.pop();
};
this.endRegexpInterpolation = function() {
interpolation.pop();
},
this.endAltRegexpInterpolation = function() {
interpolation.pop();
};
this.isInterpolating = function() {
return interpolation.length > 0 && interpolation[interpolation.length-1] == IPOL_STRING;
};
this.isAltInterpolating = function() {
return interpolation.length > 0 && interpolation[interpolation.length-1] == IPOL_ALT_STRING;
};
this.isRegexpInterpolating = function() {
return interpolation.length > 0 && interpolation[interpolation.length-1] == IPOL_REGEXP;
};
this.isAltRegexpInterpolating = function() {
return interpolation.length > 0 && interpolation[interpolation.length-1] == IPOL_ALT_REGEXP;
};
this.isNum = function(c) {
return c>='0' && c<='9';
};
this.unitType = function(type) {
if(type == this.DecimalLiteral) {
return this.UnitDecimalLiteral;
} else {
return this.UnitLiteral;
}
};
this.lookingAtInterpolation = function() {
return this.input.LA(1) == '#' && this.input.LA(2) == '{';
};
}
fullProgram
:
expressionChain? EOF!
;
commatedExpression
:
expressionChain (Comma expressionChain)*
;
expressionChain
:
expression+
;
expression
:
{ "(" !== this.input.LT(2).getText() }?=>
v=Identifier -> ^(MESSAGE[$v] Identifier)
| v=Identifier '(' commatedExpression? ')' -> ^(MESSAGE[$v] Identifier '(' commatedExpression?)
| v='(' commatedExpression? ')' -> ^(MESSAGE[$v] Identifier[""] '(' commatedExpression?)
| v='[' commatedExpression? ']' -> ^(MESSAGE[$v] Identifier["[]"] '[' commatedExpression?)
| v='{' commatedExpression? '}' -> ^(MESSAGE[$v] Identifier["{}"] '{' commatedExpression?)
| v='#{' commatedExpression? '}' -> ^(MESSAGE[$v] Identifier["set"] '{' commatedExpression?)
| literals
| Terminator
;
literals
:
StringLiteral
| RegexpLiteral
| NumberLiteral
| DecimalLiteral
| UnitLiteral
;
fragment
OperatorChar
:
'+'
| '-'
| '*'
| '%'
| '<'
| '>'
| '!'
| '?'
| '~'
| '&'
| '|'
| '^'
| '$'
| '='
| '@'
| '\''
| '`'
| ':'
;
Identifier
:
'[]'
| '{}'
| (OperatorChar | '/') (OperatorChar | '#' | '/')*
| '#' (OperatorChar | '#')+
| '.' '.'+
| Letter (Letter|IDDigit|':'|'!'|'?'|'$')*
| ':' (Letter|IDDigit) (Letter|IDDigit|':'|'!'|'?'|'$')*
;
DecimalLiteral
:
;
fragment
UnitLiteral
:
;
fragment
UnitDecimalLiteral
:
;
NumberLiteral
:
'0' ('x'|'X') HexDigit+
| '0' (
{this.isNum(this.input.LA(2))}?=> (FloatWithLeadingDot) {$type=this.DecimalLiteral;}
|
) (
UnitSpecifier {$type = this.unitType($type);}
|
)
| NonZeroDecimal (
{this.isNum(this.input.LA(2))}?=> (FloatWithLeadingDot) {$type=this.DecimalLiteral;}
| Exponent {$type=this.DecimalLiteral;}
|
) (
UnitSpecifier {$type = this.unitType($type);}
|
)
;
StringLiteral
: ('"'
( ({!this.lookingAtInterpolation()}?=> (EscapeSequence | ~('\\'|'"')))* )
(
'#{' {this.startInterpolation(); }
| '"'))
| ('#['
( ({!this.lookingAtInterpolation()}?=> (EscapeSequence | ~('\\'|']')))* )
(
'#{' {this.startAltInterpolation(); }
| ']'))
| {this.isInterpolating()}?=> ('}' ( ({!this.lookingAtInterpolation()}?=> (EscapeSequence | ~('\\'|'"')))* )
(
'#{' {this.startInterpolation(); }
| '"' {this.endInterpolation(); }))
| {this.isAltInterpolating()}?=> ('}' ( ({!this.lookingAtInterpolation()}?=> (EscapeSequence | ~('\\'|']')))* )
(
'#{' {this.startAltInterpolation(); }
| ']' {this.endAltInterpolation(); }))
;
RegexpLiteral
: ('#/'
( ({!this.lookingAtInterpolation()}?=> ( EscapeSequenceRegexp | ~('\\'|'/')))* )
(
'#{' {this.startRegexpInterpolation(); }
| '/' RegexpModifier))
| ('#r['
( ({!this.lookingAtInterpolation()}?=> (EscapeSequenceRegexp | ~('\\'|']')))* )
(
'#{' {this.startAltRegexpInterpolation(); }
| ']' RegexpModifier))
| {this.isRegexpInterpolating()}?=> ('}' (({!this.lookingAtInterpolation()}?=> (EscapeSequenceRegexp | ~('\\'|'/')))* )
(
'#{' {this.startRegexpInterpolation(); }
| '/' RegexpModifier {this.endRegexpInterpolation(); }))
| {this.isAltRegexpInterpolating()}?=> ('}' ( ({!this.lookingAtInterpolation()}?=> (EscapeSequenceRegexp | ~('\\'|']')))* )
(
'#{' {this.startAltRegexpInterpolation(); }
| '/' RegexpModifier {this.endAltRegexpInterpolation(); }))
;
fragment
EscapeSequence
: '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|']'|'\\'|'\n'|'#'|'e')
| UnicodeEscape
| OctalEscape
;
fragment
EscapeSequenceRegexp
: '\\' ('b'|'t'|'n'|'f'|'r'|'/'|'\\'|'\n'|'#')
| UnicodeEscape
| OctalEscape
;
fragment
RegexpModifier
: ('o'|'x'|'p'|'n'|'i'|'u'|'m'|'s')*
;
Terminator
:
(('\r'? '\n') | {(this.input.LA(2) != '.')}?=> '.')+
;
Whitespace : Separator {this.skip();};
LineComment
: ';' ~('\n'|'\r')* {$channel=HIDDEN;}
| '#!' ~('\n'|'\r')* {$channel=HIDDEN;}
;
Comma
:
','
;
fragment
OctalEscape
: '\\' ('0'..'3') ('0'..'7') ('0'..'7')
| '\\' ('0'..'7') ('0'..'7')
| '\\' ('0'..'7')
;
fragment
UnicodeEscape
: '\\' 'u' HexDigit HexDigit HexDigit HexDigit
;
fragment
FloatWithLeadingDot
:
'.' Digit+ (Exponent)?
;
fragment
UnitSpecifier
:
('a'..'w'|'A'..'W'|'y'|'Y'|'z'|'Z'|'_') ('a'..'z'|'A'..'Z'|'_')*
;
fragment
Exponent
:
('e'|'E') ('+'|'-')? ('0'..'9')+
;
fragment
NonZeroDecimal
:
('1'..'9') Digit*
;
fragment
Digit : '0'..'9' ;
fragment
HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ;
fragment
Separator : (' ' | '\u000c' | '\u0009' | '\u000b' | '\\' '\u000a' )+ ;
fragment
IDDigit
: '\u0030'..'\u0039' |
'\u0660'..'\u0669' |
'\u06f0'..'\u06f9' |
'\u0966'..'\u096f' |
'\u09e6'..'\u09ef' |
'\u0a66'..'\u0a6f' |
'\u0ae6'..'\u0aef' |
'\u0b66'..'\u0b6f' |
'\u0be7'..'\u0bef' |
'\u0c66'..'\u0c6f' |
'\u0ce6'..'\u0cef' |
'\u0d66'..'\u0d6f' |
'\u0e50'..'\u0e59' |
'\u0ed0'..'\u0ed9' |
'\u1040'..'\u1049'
;
fragment
Letter
:
'\u0041'..'\u005a' |
'\u005f' |
'\u0061'..'\u007a' |
'\u00c0'..'\u00d6' |
'\u00d8'..'\u00f6' |
'\u00f8'..'\u00ff' |
'\u0100'..'\u1fff' |
'\u3040'..'\u318f' |
'\u3300'..'\u337f' |
'\u3400'..'\u3d2d' |
'\u4e00'..'\u9fff' |
'\uf900'..'\ufaff'
;
RegexpModifier=24
NumberLiteral=10
RegexpLiteral=9
UnitLiteral=12
FloatWithLeadingDot=18
LineComment=29
Exponent=21
EscapeSequenceRegexp=23
Digit=30
DecimalLiteral=11
HexDigit=17
Identifier=6
Separator=27
StringLiteral=8
T__31=31
T__32=32
T__33=33
UnitSpecifier=19
T__34=34
T__35=35
T__36=36
T__37=37
UnicodeEscape=25
Terminator=7
MESSAGE=4
IDDigit=15
Whitespace=28
OperatorChar=13
Comma=5
OctalEscape=26
EscapeSequence=22
Letter=14
NonZeroDecimal=20
UnitDecimalLiteral=16
'}'=36
'('=31
'['=33
'#{'=37
')'=32
'{'=35
']'=34
// $ANTLR 3.1.1 ioke.g 2009-02-18 20:58:33
var iokeLexer = function(input, state) {
// alternate constructor @todo
// public iokeLexer(CharStream input)
// public iokeLexer(CharStream input, RecognizerSharedState state) {
if (!state) {
state = new org.antlr.runtime.RecognizerSharedState();
}
(function(){
var IPOL_STRING = new Object();
var IPOL_ALT_STRING = new Object();
var IPOL_REGEXP = new Object();
var IPOL_ALT_REGEXP = new Object();
var interpolation = new Array();
this.startInterpolation = function() {
interpolation.push(IPOL_STRING);
};
this.startAltInterpolation = function() {
interpolation.push(IPOL_ALT_STRING);
};
this.startRegexpInterpolation = function() {
interpolation.push(IPOL_REGEXP);
};
this.startAltRegexpInterpolation = function () {
interpolation.push(IPOL_REGEXP);
};
this.endInterpolation = function() {
interpolation.pop();
};
this.endAltInterpolation = function() {
interpolation.pop();
};
this.endRegexpInterpolation = function() {
interpolation.pop();
},
this.endAltRegexpInterpolation = function() {
interpolation.pop();
};
this.isInterpolating = function() {
return interpolation.length > 0 && interpolation[interpolation.length-1] == IPOL_STRING;
};
this.isAltInterpolating = function() {
return interpolation.length > 0 && interpolation[interpolation.length-1] == IPOL_ALT_STRING;
};
this.isRegexpInterpolating = function() {
return interpolation.length > 0 && interpolation[interpolation.length-1] == IPOL_REGEXP;
};
this.isAltRegexpInterpolating = function() {
return interpolation.length > 0 && interpolation[interpolation.length-1] == IPOL_ALT_REGEXP;
};
this.isNum = function(c) {
return c>='0' && c<='9';
};
this.unitType = function(type) {
if(type == this.DecimalLiteral) {
return this.UnitDecimalLiteral;
} else {
return this.UnitLiteral;
}
};
this.lookingAtInterpolation = function() {
return this.input.LA(1) == '#' && this.input.LA(2) == '{';
};
}).call(this);
this.dfa25 = new iokeLexer.DFA25(this);
this.dfa38 = new iokeLexer.DFA38(this);
this.dfa36 = new iokeLexer.DFA36(this);
this.dfa55 = new iokeLexer.DFA55(this);
iokeLexer.superclass.constructor.call(this, input, state);
};
org.antlr.lang.augmentObject(iokeLexer, {
RegexpModifier: 24,
NumberLiteral: 10,
RegexpLiteral: 9,
UnitLiteral: 12,
FloatWithLeadingDot: 18,
LineComment: 29,
Exponent: 21,
EscapeSequenceRegexp: 23,
Digit: 30,
EOF: -1,
DecimalLiteral: 11,
HexDigit: 17,
Identifier: 6,
Separator: 27,
StringLiteral: 8,
T__31: 31,
T__32: 32,
T__33: 33,
T__34: 34,
UnitSpecifier: 19,
T__35: 35,
T__36: 36,
T__37: 37,
UnicodeEscape: 25,
Terminator: 7,
MESSAGE: 4,
IDDigit: 15,
Whitespace: 28,
Comma: 5,
OperatorChar: 13,
Letter: 14,
EscapeSequence: 22,
OctalEscape: 26,
UnitDecimalLiteral: 16,
NonZeroDecimal: 20
});
(function(){
var HIDDEN = org.antlr.runtime.Token.HIDDEN_CHANNEL,
EOF = org.antlr.runtime.Token.EOF;
org.antlr.lang.extend(iokeLexer, org.antlr.runtime.Lexer, {
RegexpModifier : 24,
NumberLiteral : 10,
RegexpLiteral : 9,
UnitLiteral : 12,
FloatWithLeadingDot : 18,
LineComment : 29,
Exponent : 21,
EscapeSequenceRegexp : 23,
Digit : 30,
EOF : -1,
DecimalLiteral : 11,
HexDigit : 17,
Identifier : 6,
Separator : 27,
StringLiteral : 8,
T__31 : 31,
T__32 : 32,
T__33 : 33,
T__34 : 34,
UnitSpecifier : 19,
T__35 : 35,
T__36 : 36,
T__37 : 37,
UnicodeEscape : 25,
Terminator : 7,
MESSAGE : 4,
IDDigit : 15,
Whitespace : 28,
Comma : 5,
OperatorChar : 13,
Letter : 14,
EscapeSequence : 22,
OctalEscape : 26,
UnitDecimalLiteral : 16,
NonZeroDecimal : 20,
getGrammarFileName: function() { return "ioke.g"; }
});
org.antlr.lang.augmentObject(iokeLexer.prototype, {
// $ANTLR start T__31
mT__31: function() {
try {
var _type = this.T__31;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:79:7: ( '(' )
// ioke.g:79:9: '('
this.match('(');
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "T__31",
// $ANTLR start T__32
mT__32: function() {
try {
var _type = this.T__32;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:80:7: ( ')' )
// ioke.g:80:9: ')'
this.match(')');
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "T__32",
// $ANTLR start T__33
mT__33: function() {
try {
var _type = this.T__33;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:81:7: ( '[' )
// ioke.g:81:9: '['
this.match('[');
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "T__33",
// $ANTLR start T__34
mT__34: function() {
try {
var _type = this.T__34;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:82:7: ( ']' )
// ioke.g:82:9: ']'
this.match(']');
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "T__34",
// $ANTLR start T__35
mT__35: function() {
try {
var _type = this.T__35;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:83:7: ( '{' )
// ioke.g:83:9: '{'
this.match('{');
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "T__35",
// $ANTLR start T__36
mT__36: function() {
try {
var _type = this.T__36;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:84:7: ( '}' )
// ioke.g:84:9: '}'
this.match('}');
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "T__36",
// $ANTLR start T__37
mT__37: function() {
try {
var _type = this.T__37;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:85:7: ( '#{' )
// ioke.g:85:9: '#{'
this.match("#{");
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "T__37",
// $ANTLR start OperatorChar
mOperatorChar: function() {
try {
// ioke.g:130:5: ( '+' | '-' | '*' | '%' | '<' | '>' | '!' | '?' | '~' | '&' | '|' | '^' | '$' | '=' | '@' | '\\'' | '`' | ':' )
// ioke.g:
if ( this.input.LA(1)=='!'||(this.input.LA(1)>='$' && this.input.LA(1)<='\'')||(this.input.LA(1)>='*' && this.input.LA(1)<='+')||this.input.LA(1)=='-'||this.input.LA(1)==':'||(this.input.LA(1)>='<' && this.input.LA(1)<='@')||this.input.LA(1)=='^'||this.input.LA(1)=='`'||this.input.LA(1)=='|'||this.input.LA(1)=='~' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
}
finally {
}
},
// $ANTLR end "OperatorChar",
// $ANTLR start Identifier
mIdentifier: function() {
try {
var _type = this.Identifier;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:152:5: ( '[]' | '{}' | ( OperatorChar | '/' ) ( OperatorChar | '#' | '/' )* | '#' ( OperatorChar | '#' )+ | '.' ( '.' )+ | Letter ( Letter | IDDigit | ':' | '!' | '?' | '$' )* | ':' ( Letter | IDDigit ) ( Letter | IDDigit | ':' | '!' | '?' | '$' )* )
var alt6=7;
var LA6_0 = this.input.LA(1);
if ( (LA6_0=='[') ) {
alt6=1;
}
else if ( (LA6_0=='{') ) {
alt6=2;
}
else if ( (LA6_0==':') ) {
var LA6_3 = this.input.LA(2);
if ( ((LA6_3>='0' && LA6_3<='9')||(LA6_3>='A' && LA6_3<='Z')||LA6_3=='_'||(LA6_3>='a' && LA6_3<='z')||(LA6_3>='\u00C0' && LA6_3<='\u00D6')||(LA6_3>='\u00D8' && LA6_3<='\u00F6')||(LA6_3>='\u00F8' && LA6_3<='\u1FFF')||(LA6_3>='\u3040' && LA6_3<='\u318F')||(LA6_3>='\u3300' && LA6_3<='\u337F')||(LA6_3>='\u3400' && LA6_3<='\u3D2D')||(LA6_3>='\u4E00' && LA6_3<='\u9FFF')||(LA6_3>='\uF900' && LA6_3<='\uFAFF')) ) {
alt6=7;
}
else {
alt6=3;}
}
else if ( (LA6_0=='#') ) {
alt6=4;
}
else if ( (LA6_0=='.') ) {
alt6=5;
}
else if ( ((LA6_0>='A' && LA6_0<='Z')||LA6_0=='_'||(LA6_0>='a' && LA6_0<='z')||(LA6_0>='\u00C0' && LA6_0<='\u00D6')||(LA6_0>='\u00D8' && LA6_0<='\u00F6')||(LA6_0>='\u00F8' && LA6_0<='\u1FFF')||(LA6_0>='\u3040' && LA6_0<='\u318F')||(LA6_0>='\u3300' && LA6_0<='\u337F')||(LA6_0>='\u3400' && LA6_0<='\u3D2D')||(LA6_0>='\u4E00' && LA6_0<='\u9FFF')||(LA6_0>='\uF900' && LA6_0<='\uFAFF')) ) {
alt6=6;
}
else if ( (LA6_0=='!'||(LA6_0>='$' && LA6_0<='\'')||(LA6_0>='*' && LA6_0<='+')||LA6_0=='-'||LA6_0=='/'||(LA6_0>='<' && LA6_0<='@')||LA6_0=='^'||LA6_0=='`'||LA6_0=='|'||LA6_0=='~') ) {
alt6=3;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 6, 0, this.input);
throw nvae;
}
switch (alt6) {
case 1 :
// ioke.g:153:9: '[]'
this.match("[]");
break;
case 2 :
// ioke.g:154:9: '{}'
this.match("{}");
break;
case 3 :
// ioke.g:155:9: ( OperatorChar | '/' ) ( OperatorChar | '#' | '/' )*
if ( this.input.LA(1)=='!'||(this.input.LA(1)>='$' && this.input.LA(1)<='\'')||(this.input.LA(1)>='*' && this.input.LA(1)<='+')||this.input.LA(1)=='-'||this.input.LA(1)=='/'||this.input.LA(1)==':'||(this.input.LA(1)>='<' && this.input.LA(1)<='@')||this.input.LA(1)=='^'||this.input.LA(1)=='`'||this.input.LA(1)=='|'||this.input.LA(1)=='~' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
// ioke.g:155:30: ( OperatorChar | '#' | '/' )*
loop1:
do {
var alt1=2;
var LA1_0 = this.input.LA(1);
if ( (LA1_0=='!'||(LA1_0>='#' && LA1_0<='\'')||(LA1_0>='*' && LA1_0<='+')||LA1_0=='-'||LA1_0=='/'||LA1_0==':'||(LA1_0>='<' && LA1_0<='@')||LA1_0=='^'||LA1_0=='`'||LA1_0=='|'||LA1_0=='~') ) {
alt1=1;
}
switch (alt1) {
case 1 :
// ioke.g:
if ( this.input.LA(1)=='!'||(this.input.LA(1)>='#' && this.input.LA(1)<='\'')||(this.input.LA(1)>='*' && this.input.LA(1)<='+')||this.input.LA(1)=='-'||this.input.LA(1)=='/'||this.input.LA(1)==':'||(this.input.LA(1)>='<' && this.input.LA(1)<='@')||this.input.LA(1)=='^'||this.input.LA(1)=='`'||this.input.LA(1)=='|'||this.input.LA(1)=='~' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
default :
break loop1;
}
} while (true);
break;
case 4 :
// ioke.g:156:9: '#' ( OperatorChar | '#' )+
this.match('#');
// ioke.g:156:13: ( OperatorChar | '#' )+
var cnt2=0;
loop2:
do {
var alt2=2;
var LA2_0 = this.input.LA(1);
if ( (LA2_0=='!'||(LA2_0>='#' && LA2_0<='\'')||(LA2_0>='*' && LA2_0<='+')||LA2_0=='-'||LA2_0==':'||(LA2_0>='<' && LA2_0<='@')||LA2_0=='^'||LA2_0=='`'||LA2_0=='|'||LA2_0=='~') ) {
alt2=1;
}
switch (alt2) {
case 1 :
// ioke.g:
if ( this.input.LA(1)=='!'||(this.input.LA(1)>='#' && this.input.LA(1)<='\'')||(this.input.LA(1)>='*' && this.input.LA(1)<='+')||this.input.LA(1)=='-'||this.input.LA(1)==':'||(this.input.LA(1)>='<' && this.input.LA(1)<='@')||this.input.LA(1)=='^'||this.input.LA(1)=='`'||this.input.LA(1)=='|'||this.input.LA(1)=='~' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
default :
if ( cnt2 >= 1 ) {
break loop2;
}
var eee = new org.antlr.runtime.EarlyExitException(2, this.input);
throw eee;
}
cnt2++;
} while (true);
break;
case 5 :
// ioke.g:157:9: '.' ( '.' )+
this.match('.');
// ioke.g:157:13: ( '.' )+
var cnt3=0;
loop3:
do {
var alt3=2;
var LA3_0 = this.input.LA(1);
if ( (LA3_0=='.') ) {
alt3=1;
}
switch (alt3) {
case 1 :
// ioke.g:157:13: '.'
this.match('.');
break;
default :
if ( cnt3 >= 1 ) {
break loop3;
}
var eee = new org.antlr.runtime.EarlyExitException(3, this.input);
throw eee;
}
cnt3++;
} while (true);
break;
case 6 :
// ioke.g:158:9: Letter ( Letter | IDDigit | ':' | '!' | '?' | '$' )*
this.mLetter();
// ioke.g:158:16: ( Letter | IDDigit | ':' | '!' | '?' | '$' )*
loop4:
do {
var alt4=2;
var LA4_0 = this.input.LA(1);
if ( (LA4_0=='!'||LA4_0=='$'||(LA4_0>='0' && LA4_0<=':')||LA4_0=='?'||(LA4_0>='A' && LA4_0<='Z')||LA4_0=='_'||(LA4_0>='a' && LA4_0<='z')||(LA4_0>='\u00C0' && LA4_0<='\u00D6')||(LA4_0>='\u00D8' && LA4_0<='\u00F6')||(LA4_0>='\u00F8' && LA4_0<='\u1FFF')||(LA4_0>='\u3040' && LA4_0<='\u318F')||(LA4_0>='\u3300' && LA4_0<='\u337F')||(LA4_0>='\u3400' && LA4_0<='\u3D2D')||(LA4_0>='\u4E00' && LA4_0<='\u9FFF')||(LA4_0>='\uF900' && LA4_0<='\uFAFF')) ) {
alt4=1;
}
switch (alt4) {
case 1 :
// ioke.g:
if ( this.input.LA(1)=='!'||this.input.LA(1)=='$'||(this.input.LA(1)>='0' && this.input.LA(1)<=':')||this.input.LA(1)=='?'||(this.input.LA(1)>='A' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='z')||(this.input.LA(1)>='\u00C0' && this.input.LA(1)<='\u00D6')||(this.input.LA(1)>='\u00D8' && this.input.LA(1)<='\u00F6')||(this.input.LA(1)>='\u00F8' && this.input.LA(1)<='\u1FFF')||(this.input.LA(1)>='\u3040' && this.input.LA(1)<='\u318F')||(this.input.LA(1)>='\u3300' && this.input.LA(1)<='\u337F')||(this.input.LA(1)>='\u3400' && this.input.LA(1)<='\u3D2D')||(this.input.LA(1)>='\u4E00' && this.input.LA(1)<='\u9FFF')||(this.input.LA(1)>='\uF900' && this.input.LA(1)<='\uFAFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
default :
break loop4;
}
} while (true);
break;
case 7 :
// ioke.g:159:9: ':' ( Letter | IDDigit ) ( Letter | IDDigit | ':' | '!' | '?' | '$' )*
this.match(':');
if ( (this.input.LA(1)>='0' && this.input.LA(1)<='9')||(this.input.LA(1)>='A' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='z')||(this.input.LA(1)>='\u00C0' && this.input.LA(1)<='\u00D6')||(this.input.LA(1)>='\u00D8' && this.input.LA(1)<='\u00F6')||(this.input.LA(1)>='\u00F8' && this.input.LA(1)<='\u1FFF')||(this.input.LA(1)>='\u3040' && this.input.LA(1)<='\u318F')||(this.input.LA(1)>='\u3300' && this.input.LA(1)<='\u337F')||(this.input.LA(1)>='\u3400' && this.input.LA(1)<='\u3D2D')||(this.input.LA(1)>='\u4E00' && this.input.LA(1)<='\u9FFF')||(this.input.LA(1)>='\uF900' && this.input.LA(1)<='\uFAFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
// ioke.g:159:30: ( Letter | IDDigit | ':' | '!' | '?' | '$' )*
loop5:
do {
var alt5=2;
var LA5_0 = this.input.LA(1);
if ( (LA5_0=='!'||LA5_0=='$'||(LA5_0>='0' && LA5_0<=':')||LA5_0=='?'||(LA5_0>='A' && LA5_0<='Z')||LA5_0=='_'||(LA5_0>='a' && LA5_0<='z')||(LA5_0>='\u00C0' && LA5_0<='\u00D6')||(LA5_0>='\u00D8' && LA5_0<='\u00F6')||(LA5_0>='\u00F8' && LA5_0<='\u1FFF')||(LA5_0>='\u3040' && LA5_0<='\u318F')||(LA5_0>='\u3300' && LA5_0<='\u337F')||(LA5_0>='\u3400' && LA5_0<='\u3D2D')||(LA5_0>='\u4E00' && LA5_0<='\u9FFF')||(LA5_0>='\uF900' && LA5_0<='\uFAFF')) ) {
alt5=1;
}
switch (alt5) {
case 1 :
// ioke.g:
if ( this.input.LA(1)=='!'||this.input.LA(1)=='$'||(this.input.LA(1)>='0' && this.input.LA(1)<=':')||this.input.LA(1)=='?'||(this.input.LA(1)>='A' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='z')||(this.input.LA(1)>='\u00C0' && this.input.LA(1)<='\u00D6')||(this.input.LA(1)>='\u00D8' && this.input.LA(1)<='\u00F6')||(this.input.LA(1)>='\u00F8' && this.input.LA(1)<='\u1FFF')||(this.input.LA(1)>='\u3040' && this.input.LA(1)<='\u318F')||(this.input.LA(1)>='\u3300' && this.input.LA(1)<='\u337F')||(this.input.LA(1)>='\u3400' && this.input.LA(1)<='\u3D2D')||(this.input.LA(1)>='\u4E00' && this.input.LA(1)<='\u9FFF')||(this.input.LA(1)>='\uF900' && this.input.LA(1)<='\uFAFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
default :
break loop5;
}
} while (true);
break;
}
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "Identifier",
// $ANTLR start DecimalLiteral
mDecimalLiteral: function() {
try {
var _type = this.DecimalLiteral;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:163:5: ()
// ioke.g:164:5:
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "DecimalLiteral",
// $ANTLR start UnitLiteral
mUnitLiteral: function() {
try {
// ioke.g:168:5: ()
// ioke.g:169:5:
}
finally {
}
},
// $ANTLR end "UnitLiteral",
// $ANTLR start UnitDecimalLiteral
mUnitDecimalLiteral: function() {
try {
// ioke.g:173:5: ()
// ioke.g:174:5:
}
finally {
}
},
// $ANTLR end "UnitDecimalLiteral",
// $ANTLR start NumberLiteral
mNumberLiteral: function() {
try {
var _type = this.NumberLiteral;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:177:5: ( '0' ( 'x' | 'X' ) ( HexDigit )+ | '0' ({...}? => ( FloatWithLeadingDot ) | ) ( UnitSpecifier | ) | NonZeroDecimal ({...}? => ( FloatWithLeadingDot ) | Exponent | ) ( UnitSpecifier | ) )
var alt12=3;
var LA12_0 = this.input.LA(1);
if ( (LA12_0=='0') ) {
var LA12_1 = this.input.LA(2);
if ( (LA12_1=='X'||LA12_1=='x') ) {
alt12=1;
}
else {
alt12=2;}
}
else if ( ((LA12_0>='1' && LA12_0<='9')) ) {
alt12=3;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 12, 0, this.input);
throw nvae;
}
switch (alt12) {
case 1 :
// ioke.g:178:3: '0' ( 'x' | 'X' ) ( HexDigit )+
this.match('0');
if ( this.input.LA(1)=='X'||this.input.LA(1)=='x' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
// ioke.g:178:17: ( HexDigit )+
var cnt7=0;
loop7:
do {
var alt7=2;
var LA7_0 = this.input.LA(1);
if ( ((LA7_0>='0' && LA7_0<='9')||(LA7_0>='A' && LA7_0<='F')||(LA7_0>='a' && LA7_0<='f')) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// ioke.g:178:17: HexDigit
this.mHexDigit();
break;
default :
if ( cnt7 >= 1 ) {
break loop7;
}
var eee = new org.antlr.runtime.EarlyExitException(7, this.input);
throw eee;
}
cnt7++;
} while (true);
break;
case 2 :
// ioke.g:179:9: '0' ({...}? => ( FloatWithLeadingDot ) | ) ( UnitSpecifier | )
this.match('0');
// ioke.g:179:13: ({...}? => ( FloatWithLeadingDot ) | )
var alt8=2;
var LA8_0 = this.input.LA(1);
if ( (LA8_0=='.') && ((this.isNum(this.input.LA(2))))) {
alt8=1;
}
else {
alt8=2;}
switch (alt8) {
case 1 :
// ioke.g:180:13: {...}? => ( FloatWithLeadingDot )
if ( !((this.isNum(this.input.LA(2)))) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "NumberLiteral", "this.isNum(this.input.LA(2))");
}
// ioke.g:180:47: ( FloatWithLeadingDot )
// ioke.g:180:48: FloatWithLeadingDot
this.mFloatWithLeadingDot();
_type=this.DecimalLiteral;
break;
case 2 :
// ioke.g:182:9:
break;
}
// ioke.g:182:11: ( UnitSpecifier | )
var alt9=2;
var LA9_0 = this.input.LA(1);
if ( ((LA9_0>='A' && LA9_0<='W')||(LA9_0>='Y' && LA9_0<='Z')||LA9_0=='_'||(LA9_0>='a' && LA9_0<='w')||(LA9_0>='y' && LA9_0<='z')) ) {
alt9=1;
}
else {
alt9=2;}
switch (alt9) {
case 1 :
// ioke.g:183:13: UnitSpecifier
this.mUnitSpecifier();
_type = this.unitType(_type);
break;
case 2 :
// ioke.g:185:9:
break;
}
break;
case 3 :
// ioke.g:186:9: NonZeroDecimal ({...}? => ( FloatWithLeadingDot ) | Exponent | ) ( UnitSpecifier | )
this.mNonZeroDecimal();
// ioke.g:186:24: ({...}? => ( FloatWithLeadingDot ) | Exponent | )
var alt10=3;
var LA10_0 = this.input.LA(1);
if ( (LA10_0=='.') && ((this.isNum(this.input.LA(2))))) {
alt10=1;
}
else if ( (LA10_0=='E'||LA10_0=='e') ) {
var LA10_2 = this.input.LA(2);
if ( (LA10_2=='+'||LA10_2=='-'||(LA10_2>='0' && LA10_2<='9')) ) {
alt10=2;
}
else {
alt10=3;}
}
else {
alt10=3;}
switch (alt10) {
case 1 :
// ioke.g:187:13: {...}? => ( FloatWithLeadingDot )
if ( !((this.isNum(this.input.LA(2)))) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "NumberLiteral", "this.isNum(this.input.LA(2))");
}
// ioke.g:187:47: ( FloatWithLeadingDot )
// ioke.g:187:48: FloatWithLeadingDot
this.mFloatWithLeadingDot();
_type=this.DecimalLiteral;
break;
case 2 :
// ioke.g:188:11: Exponent
this.mExponent();
_type=this.DecimalLiteral;
break;
case 3 :
// ioke.g:190:9:
break;
}
// ioke.g:190:11: ( UnitSpecifier | )
var alt11=2;
var LA11_0 = this.input.LA(1);
if ( ((LA11_0>='A' && LA11_0<='W')||(LA11_0>='Y' && LA11_0<='Z')||LA11_0=='_'||(LA11_0>='a' && LA11_0<='w')||(LA11_0>='y' && LA11_0<='z')) ) {
alt11=1;
}
else {
alt11=2;}
switch (alt11) {
case 1 :
// ioke.g:191:13: UnitSpecifier
this.mUnitSpecifier();
_type = this.unitType(_type);
break;
case 2 :
// ioke.g:193:9:
break;
}
break;
}
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "NumberLiteral",
// $ANTLR start StringLiteral
mStringLiteral: function() {
try {
var _type = this.StringLiteral;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:197:5: ( ( '\"' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' ) ) | ( '#[' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' ) ) | {...}? => ( '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' ) ) | {...}? => ( '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' ) ) )
var alt25=4;
alt25 = this.dfa25.predict(this.input);
switch (alt25) {
case 1 :
// ioke.g:197:8: ( '\"' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' ) )
// ioke.g:197:8: ( '\"' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' ) )
// ioke.g:197:9: '\"' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' )
this.match('\"');
// ioke.g:198:9: ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* )
// ioke.g:198:11: ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )*
// ioke.g:198:11: ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )*
loop14:
do {
var alt14=2;
var LA14_0 = this.input.LA(1);
if ( (LA14_0=='#') ) {
var LA14_1 = this.input.LA(2);
if ( (LA14_1=='{') ) {
var LA14_4 = this.input.LA(3);
if ( ((LA14_4>='\u0000' && LA14_4<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt14=1;
}
}
else if ( ((LA14_1>='\u0000' && LA14_1<='z')||(LA14_1>='|' && LA14_1<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt14=1;
}
}
else if ( ((LA14_0>='\u0000' && LA14_0<='!')||(LA14_0>='$' && LA14_0<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt14=1;
}
switch (alt14) {
case 1 :
// ioke.g:198:12: {...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) )
if ( !((!this.lookingAtInterpolation())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "StringLiteral", "!this.lookingAtInterpolation()");
}
// ioke.g:198:48: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )
var alt13=2;
var LA13_0 = this.input.LA(1);
if ( (LA13_0=='\\') ) {
alt13=1;
}
else if ( ((LA13_0>='\u0000' && LA13_0<='!')||(LA13_0>='#' && LA13_0<='[')||(LA13_0>=']' && LA13_0<='\uFFFF')) ) {
alt13=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 13, 0, this.input);
throw nvae;
}
switch (alt13) {
case 1 :
// ioke.g:198:49: EscapeSequence
this.mEscapeSequence();
break;
case 2 :
// ioke.g:198:66: ~ ( '\\\\' | '\"' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='!')||(this.input.LA(1)>='#' && this.input.LA(1)<='[')||(this.input.LA(1)>=']' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
}
break;
default :
break loop14;
}
} while (true);
// ioke.g:199:9: ( '#{' | '\"' )
var alt15=2;
var LA15_0 = this.input.LA(1);
if ( (LA15_0=='#') ) {
alt15=1;
}
else if ( (LA15_0=='\"') ) {
alt15=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 15, 0, this.input);
throw nvae;
}
switch (alt15) {
case 1 :
// ioke.g:200:13: '#{'
this.match("#{");
this.startInterpolation();
break;
case 2 :
// ioke.g:201:13: '\"'
this.match('\"');
break;
}
break;
case 2 :
// ioke.g:202:8: ( '#[' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' ) )
// ioke.g:202:8: ( '#[' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' ) )
// ioke.g:202:9: '#[' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' )
this.match("#[");
// ioke.g:203:9: ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* )
// ioke.g:203:11: ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )*
// ioke.g:203:11: ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )*
loop17:
do {
var alt17=2;
var LA17_0 = this.input.LA(1);
if ( (LA17_0=='#') ) {
var LA17_1 = this.input.LA(2);
if ( (LA17_1=='{') ) {
var LA17_4 = this.input.LA(3);
if ( ((LA17_4>='\u0000' && LA17_4<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt17=1;
}
}
else if ( ((LA17_1>='\u0000' && LA17_1<='z')||(LA17_1>='|' && LA17_1<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt17=1;
}
}
else if ( ((LA17_0>='\u0000' && LA17_0<='\"')||(LA17_0>='$' && LA17_0<='\\')||(LA17_0>='^' && LA17_0<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt17=1;
}
switch (alt17) {
case 1 :
// ioke.g:203:12: {...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) )
if ( !((!this.lookingAtInterpolation())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "StringLiteral", "!this.lookingAtInterpolation()");
}
// ioke.g:203:48: ( EscapeSequence | ~ ( '\\\\' | ']' ) )
var alt16=2;
var LA16_0 = this.input.LA(1);
if ( (LA16_0=='\\') ) {
alt16=1;
}
else if ( ((LA16_0>='\u0000' && LA16_0<='[')||(LA16_0>='^' && LA16_0<='\uFFFF')) ) {
alt16=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 16, 0, this.input);
throw nvae;
}
switch (alt16) {
case 1 :
// ioke.g:203:49: EscapeSequence
this.mEscapeSequence();
break;
case 2 :
// ioke.g:203:66: ~ ( '\\\\' | ']' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='[')||(this.input.LA(1)>='^' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
}
break;
default :
break loop17;
}
} while (true);
// ioke.g:204:9: ( '#{' | ']' )
var alt18=2;
var LA18_0 = this.input.LA(1);
if ( (LA18_0=='#') ) {
alt18=1;
}
else if ( (LA18_0==']') ) {
alt18=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 18, 0, this.input);
throw nvae;
}
switch (alt18) {
case 1 :
// ioke.g:205:13: '#{'
this.match("#{");
this.startAltInterpolation();
break;
case 2 :
// ioke.g:206:13: ']'
this.match(']');
break;
}
break;
case 3 :
// ioke.g:207:7: {...}? => ( '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' ) )
if ( !((this.isInterpolating())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "StringLiteral", "this.isInterpolating()");
}
// ioke.g:207:35: ( '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' ) )
// ioke.g:207:36: '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' )
this.match('}');
// ioke.g:207:40: ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* )
// ioke.g:207:42: ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )*
// ioke.g:207:42: ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )*
loop20:
do {
var alt20=2;
var LA20_0 = this.input.LA(1);
if ( (LA20_0=='#') ) {
var LA20_1 = this.input.LA(2);
if ( (LA20_1=='{') ) {
var LA20_4 = this.input.LA(3);
if ( ((LA20_4>='\u0000' && LA20_4<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt20=1;
}
}
else if ( ((LA20_1>='\u0000' && LA20_1<='z')||(LA20_1>='|' && LA20_1<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt20=1;
}
}
else if ( ((LA20_0>='\u0000' && LA20_0<='!')||(LA20_0>='$' && LA20_0<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt20=1;
}
switch (alt20) {
case 1 :
// ioke.g:207:43: {...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) )
if ( !((!this.lookingAtInterpolation())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "StringLiteral", "!this.lookingAtInterpolation()");
}
// ioke.g:207:79: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )
var alt19=2;
var LA19_0 = this.input.LA(1);
if ( (LA19_0=='\\') ) {
alt19=1;
}
else if ( ((LA19_0>='\u0000' && LA19_0<='!')||(LA19_0>='#' && LA19_0<='[')||(LA19_0>=']' && LA19_0<='\uFFFF')) ) {
alt19=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 19, 0, this.input);
throw nvae;
}
switch (alt19) {
case 1 :
// ioke.g:207:80: EscapeSequence
this.mEscapeSequence();
break;
case 2 :
// ioke.g:207:97: ~ ( '\\\\' | '\"' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='!')||(this.input.LA(1)>='#' && this.input.LA(1)<='[')||(this.input.LA(1)>=']' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
}
break;
default :
break loop20;
}
} while (true);
// ioke.g:208:9: ( '#{' | '\"' )
var alt21=2;
var LA21_0 = this.input.LA(1);
if ( (LA21_0=='#') ) {
alt21=1;
}
else if ( (LA21_0=='\"') ) {
alt21=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 21, 0, this.input);
throw nvae;
}
switch (alt21) {
case 1 :
// ioke.g:209:13: '#{'
this.match("#{");
this.startInterpolation();
break;
case 2 :
// ioke.g:210:13: '\"'
this.match('\"');
this.endInterpolation();
break;
}
break;
case 4 :
// ioke.g:211:7: {...}? => ( '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' ) )
if ( !((this.isAltInterpolating())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "StringLiteral", "this.isAltInterpolating()");
}
// ioke.g:211:38: ( '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' ) )
// ioke.g:211:39: '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' )
this.match('}');
// ioke.g:211:43: ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* )
// ioke.g:211:45: ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )*
// ioke.g:211:45: ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )*
loop23:
do {
var alt23=2;
var LA23_0 = this.input.LA(1);
if ( (LA23_0=='#') ) {
var LA23_1 = this.input.LA(2);
if ( (LA23_1=='{') ) {
var LA23_4 = this.input.LA(3);
if ( ((LA23_4>='\u0000' && LA23_4<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt23=1;
}
}
else if ( ((LA23_1>='\u0000' && LA23_1<='z')||(LA23_1>='|' && LA23_1<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt23=1;
}
}
else if ( ((LA23_0>='\u0000' && LA23_0<='\"')||(LA23_0>='$' && LA23_0<='\\')||(LA23_0>='^' && LA23_0<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt23=1;
}
switch (alt23) {
case 1 :
// ioke.g:211:46: {...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) )
if ( !((!this.lookingAtInterpolation())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "StringLiteral", "!this.lookingAtInterpolation()");
}
// ioke.g:211:82: ( EscapeSequence | ~ ( '\\\\' | ']' ) )
var alt22=2;
var LA22_0 = this.input.LA(1);
if ( (LA22_0=='\\') ) {
alt22=1;
}
else if ( ((LA22_0>='\u0000' && LA22_0<='[')||(LA22_0>='^' && LA22_0<='\uFFFF')) ) {
alt22=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 22, 0, this.input);
throw nvae;
}
switch (alt22) {
case 1 :
// ioke.g:211:83: EscapeSequence
this.mEscapeSequence();
break;
case 2 :
// ioke.g:211:100: ~ ( '\\\\' | ']' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='[')||(this.input.LA(1)>='^' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
}
break;
default :
break loop23;
}
} while (true);
// ioke.g:212:9: ( '#{' | ']' )
var alt24=2;
var LA24_0 = this.input.LA(1);
if ( (LA24_0=='#') ) {
alt24=1;
}
else if ( (LA24_0==']') ) {
alt24=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 24, 0, this.input);
throw nvae;
}
switch (alt24) {
case 1 :
// ioke.g:213:13: '#{'
this.match("#{");
this.startAltInterpolation();
break;
case 2 :
// ioke.g:214:13: ']'
this.match(']');
this.endAltInterpolation();
break;
}
break;
}
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "StringLiteral",
// $ANTLR start RegexpLiteral
mRegexpLiteral: function() {
try {
var _type = this.RegexpLiteral;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:218:5: ( ( '#/' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier ) ) | ( '#r[' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' RegexpModifier ) ) | {...}? => ( '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier ) ) | {...}? => ( '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | '/' RegexpModifier ) ) )
var alt38=4;
alt38 = this.dfa38.predict(this.input);
switch (alt38) {
case 1 :
// ioke.g:218:8: ( '#/' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier ) )
// ioke.g:218:8: ( '#/' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier ) )
// ioke.g:218:9: '#/' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier )
this.match("#/");
// ioke.g:219:13: ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* )
// ioke.g:219:15: ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )*
// ioke.g:219:15: ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )*
loop27:
do {
var alt27=2;
var LA27_0 = this.input.LA(1);
if ( (LA27_0=='#') ) {
var LA27_1 = this.input.LA(2);
if ( (LA27_1=='{') ) {
var LA27_4 = this.input.LA(3);
if ( ((LA27_4>='\u0000' && LA27_4<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt27=1;
}
}
else if ( ((LA27_1>='\u0000' && LA27_1<='z')||(LA27_1>='|' && LA27_1<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt27=1;
}
}
else if ( ((LA27_0>='\u0000' && LA27_0<='\"')||(LA27_0>='$' && LA27_0<='.')||(LA27_0>='0' && LA27_0<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt27=1;
}
switch (alt27) {
case 1 :
// ioke.g:219:16: {...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) )
if ( !((!this.lookingAtInterpolation())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "RegexpLiteral", "!this.lookingAtInterpolation()");
}
// ioke.g:219:52: ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) )
var alt26=2;
var LA26_0 = this.input.LA(1);
if ( (LA26_0=='\\') ) {
alt26=1;
}
else if ( ((LA26_0>='\u0000' && LA26_0<='.')||(LA26_0>='0' && LA26_0<='[')||(LA26_0>=']' && LA26_0<='\uFFFF')) ) {
alt26=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 26, 0, this.input);
throw nvae;
}
switch (alt26) {
case 1 :
// ioke.g:219:54: EscapeSequenceRegexp
this.mEscapeSequenceRegexp();
break;
case 2 :
// ioke.g:219:77: ~ ( '\\\\' | '/' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='.')||(this.input.LA(1)>='0' && this.input.LA(1)<='[')||(this.input.LA(1)>=']' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
}
break;
default :
break loop27;
}
} while (true);
// ioke.g:220:13: ( '#{' | '/' RegexpModifier )
var alt28=2;
var LA28_0 = this.input.LA(1);
if ( (LA28_0=='#') ) {
alt28=1;
}
else if ( (LA28_0=='/') ) {
alt28=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 28, 0, this.input);
throw nvae;
}
switch (alt28) {
case 1 :
// ioke.g:221:17: '#{'
this.match("#{");
this.startRegexpInterpolation();
break;
case 2 :
// ioke.g:222:17: '/' RegexpModifier
this.match('/');
this.mRegexpModifier();
break;
}
break;
case 2 :
// ioke.g:223:8: ( '#r[' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' RegexpModifier ) )
// ioke.g:223:8: ( '#r[' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' RegexpModifier ) )
// ioke.g:223:9: '#r[' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' RegexpModifier )
this.match("#r[");
// ioke.g:224:9: ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* )
// ioke.g:224:11: ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )*
// ioke.g:224:11: ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )*
loop30:
do {
var alt30=2;
var LA30_0 = this.input.LA(1);
if ( (LA30_0=='#') ) {
var LA30_1 = this.input.LA(2);
if ( (LA30_1=='{') ) {
var LA30_4 = this.input.LA(3);
if ( ((LA30_4>='\u0000' && LA30_4<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt30=1;
}
}
else if ( ((LA30_1>='\u0000' && LA30_1<='z')||(LA30_1>='|' && LA30_1<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt30=1;
}
}
else if ( ((LA30_0>='\u0000' && LA30_0<='\"')||(LA30_0>='$' && LA30_0<='\\')||(LA30_0>='^' && LA30_0<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt30=1;
}
switch (alt30) {
case 1 :
// ioke.g:224:12: {...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) )
if ( !((!this.lookingAtInterpolation())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "RegexpLiteral", "!this.lookingAtInterpolation()");
}
// ioke.g:224:48: ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) )
var alt29=2;
var LA29_0 = this.input.LA(1);
if ( (LA29_0=='\\') ) {
alt29=1;
}
else if ( ((LA29_0>='\u0000' && LA29_0<='[')||(LA29_0>='^' && LA29_0<='\uFFFF')) ) {
alt29=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 29, 0, this.input);
throw nvae;
}
switch (alt29) {
case 1 :
// ioke.g:224:49: EscapeSequenceRegexp
this.mEscapeSequenceRegexp();
break;
case 2 :
// ioke.g:224:72: ~ ( '\\\\' | ']' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='[')||(this.input.LA(1)>='^' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
}
break;
default :
break loop30;
}
} while (true);
// ioke.g:225:9: ( '#{' | ']' RegexpModifier )
var alt31=2;
var LA31_0 = this.input.LA(1);
if ( (LA31_0=='#') ) {
alt31=1;
}
else if ( (LA31_0==']') ) {
alt31=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 31, 0, this.input);
throw nvae;
}
switch (alt31) {
case 1 :
// ioke.g:226:13: '#{'
this.match("#{");
this.startAltRegexpInterpolation();
break;
case 2 :
// ioke.g:227:13: ']' RegexpModifier
this.match(']');
this.mRegexpModifier();
break;
}
break;
case 3 :
// ioke.g:228:7: {...}? => ( '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier ) )
if ( !((this.isRegexpInterpolating())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "RegexpLiteral", "this.isRegexpInterpolating()");
}
// ioke.g:228:41: ( '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier ) )
// ioke.g:228:42: '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier )
this.match('}');
// ioke.g:228:46: ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* )
// ioke.g:228:47: ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )*
// ioke.g:228:47: ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )*
loop33:
do {
var alt33=2;
var LA33_0 = this.input.LA(1);
if ( (LA33_0=='#') ) {
var LA33_1 = this.input.LA(2);
if ( (LA33_1=='{') ) {
var LA33_4 = this.input.LA(3);
if ( ((LA33_4>='\u0000' && LA33_4<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt33=1;
}
}
else if ( ((LA33_1>='\u0000' && LA33_1<='z')||(LA33_1>='|' && LA33_1<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt33=1;
}
}
else if ( ((LA33_0>='\u0000' && LA33_0<='\"')||(LA33_0>='$' && LA33_0<='.')||(LA33_0>='0' && LA33_0<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {
alt33=1;
}
switch (alt33) {
case 1 :
// ioke.g:228:48: {...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) )
if ( !((!this.lookingAtInterpolation())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "RegexpLiteral", "!this.lookingAtInterpolation()");
}
// ioke.g:228:84: ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) )
var alt32=2;
var LA32_0 = this.input.LA(1);
if ( (LA32_0=='\\') ) {
alt32=1;
}
else if ( ((LA32_0>='\u0000' && LA32_0<='.')||(LA32_0>='0' && LA32_0<='[')||(LA32_0>=']' && LA32_0<='\uFFFF')) ) {
alt32=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 32, 0, this.input);
throw nvae;
}
switch (alt32) {
case 1 :
// ioke.g:228:85: EscapeSequenceRegexp
this.mEscapeSequenceRegexp();
break;
case 2 :
// ioke.g:228:108: ~ ( '\\\\' | '/' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='.')||(this.input.LA(1)>='0' && this.input.LA(1)<='[')||(this.input.LA(1)>=']' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
}
break;
default :
break loop33;
}
} while (true);
// ioke.g:229:9: ( '#{' | '/' RegexpModifier )
var alt34=2;
var LA34_0 = this.input.LA(1);
if ( (LA34_0=='#') ) {
alt34=1;
}
else if ( (LA34_0=='/') ) {
alt34=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 34, 0, this.input);
throw nvae;
}
switch (alt34) {
case 1 :
// ioke.g:230:13: '#{'
this.match("#{");
this.startRegexpInterpolation();
break;
case 2 :
// ioke.g:232:13: '/' RegexpModifier
this.match('/');
this.mRegexpModifier();
this.endRegexpInterpolation();
break;
}
break;
case 4 :
// ioke.g:233:7: {...}? => ( '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | '/' RegexpModifier ) )
if ( !((this.isAltRegexpInterpolating())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "RegexpLiteral", "this.isAltRegexpInterpolating()");
}
// ioke.g:233:44: ( '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | '/' RegexpModifier ) )
// ioke.g:233:45: '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | '/' RegexpModifier )
this.match('}');
// ioke.g:233:49: ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* )
// ioke.g:233:51: ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )*
// ioke.g:233:51: ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )*
loop36:
do {
var alt36=2;
alt36 = this.dfa36.predict(this.input);
switch (alt36) {
case 1 :
// ioke.g:233:52: {...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) )
if ( !((!this.lookingAtInterpolation())) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "RegexpLiteral", "!this.lookingAtInterpolation()");
}
// ioke.g:233:88: ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) )
var alt35=2;
var LA35_0 = this.input.LA(1);
if ( (LA35_0=='\\') ) {
alt35=1;
}
else if ( ((LA35_0>='\u0000' && LA35_0<='[')||(LA35_0>='^' && LA35_0<='\uFFFF')) ) {
alt35=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 35, 0, this.input);
throw nvae;
}
switch (alt35) {
case 1 :
// ioke.g:233:89: EscapeSequenceRegexp
this.mEscapeSequenceRegexp();
break;
case 2 :
// ioke.g:233:112: ~ ( '\\\\' | ']' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='[')||(this.input.LA(1)>='^' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
}
break;
default :
break loop36;
}
} while (true);
// ioke.g:234:9: ( '#{' | '/' RegexpModifier )
var alt37=2;
var LA37_0 = this.input.LA(1);
if ( (LA37_0=='#') ) {
alt37=1;
}
else if ( (LA37_0=='/') ) {
alt37=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 37, 0, this.input);
throw nvae;
}
switch (alt37) {
case 1 :
// ioke.g:235:13: '#{'
this.match("#{");
this.startAltRegexpInterpolation();
break;
case 2 :
// ioke.g:236:13: '/' RegexpModifier
this.match('/');
this.mRegexpModifier();
this.endAltRegexpInterpolation();
break;
}
break;
}
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "RegexpLiteral",
// $ANTLR start EscapeSequence
mEscapeSequence: function() {
try {
// ioke.g:241:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | ']' | '\\\\' | '\\n' | '#' | 'e' ) | UnicodeEscape | OctalEscape )
var alt39=3;
var LA39_0 = this.input.LA(1);
if ( (LA39_0=='\\') ) {
switch ( this.input.LA(2) ) {
case '\n':
case '\"':
case '#':
case '\\':
case ']':
case 'b':
case 'e':
case 'f':
case 'n':
case 'r':
case 't':
alt39=1;
break;
case 'u':
alt39=2;
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
alt39=3;
break;
default:
var nvae =
new org.antlr.runtime.NoViableAltException("", 39, 1, this.input);
throw nvae;
}
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 39, 0, this.input);
throw nvae;
}
switch (alt39) {
case 1 :
// ioke.g:241:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | ']' | '\\\\' | '\\n' | '#' | 'e' )
this.match('\\');
if ( this.input.LA(1)=='\n'||(this.input.LA(1)>='\"' && this.input.LA(1)<='#')||(this.input.LA(1)>='\\' && this.input.LA(1)<=']')||this.input.LA(1)=='b'||(this.input.LA(1)>='e' && this.input.LA(1)<='f')||this.input.LA(1)=='n'||this.input.LA(1)=='r'||this.input.LA(1)=='t' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
case 2 :
// ioke.g:242:9: UnicodeEscape
this.mUnicodeEscape();
break;
case 3 :
// ioke.g:243:9: OctalEscape
this.mOctalEscape();
break;
}
}
finally {
}
},
// $ANTLR end "EscapeSequence",
// $ANTLR start EscapeSequenceRegexp
mEscapeSequenceRegexp: function() {
try {
// ioke.g:248:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '/' | '\\\\' | '\\n' | '#' ) | UnicodeEscape | OctalEscape )
var alt40=3;
var LA40_0 = this.input.LA(1);
if ( (LA40_0=='\\') ) {
switch ( this.input.LA(2) ) {
case '\n':
case '#':
case '/':
case '\\':
case 'b':
case 'f':
case 'n':
case 'r':
case 't':
alt40=1;
break;
case 'u':
alt40=2;
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
alt40=3;
break;
default:
var nvae =
new org.antlr.runtime.NoViableAltException("", 40, 1, this.input);
throw nvae;
}
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 40, 0, this.input);
throw nvae;
}
switch (alt40) {
case 1 :
// ioke.g:248:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '/' | '\\\\' | '\\n' | '#' )
this.match('\\');
if ( this.input.LA(1)=='\n'||this.input.LA(1)=='#'||this.input.LA(1)=='/'||this.input.LA(1)=='\\'||this.input.LA(1)=='b'||this.input.LA(1)=='f'||this.input.LA(1)=='n'||this.input.LA(1)=='r'||this.input.LA(1)=='t' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
case 2 :
// ioke.g:249:9: UnicodeEscape
this.mUnicodeEscape();
break;
case 3 :
// ioke.g:250:9: OctalEscape
this.mOctalEscape();
break;
}
}
finally {
}
},
// $ANTLR end "EscapeSequenceRegexp",
// $ANTLR start RegexpModifier
mRegexpModifier: function() {
try {
// ioke.g:255:3: ( ( 'o' | 'x' | 'p' | 'n' | 'i' | 'u' | 'm' | 's' )* )
// ioke.g:255:5: ( 'o' | 'x' | 'p' | 'n' | 'i' | 'u' | 'm' | 's' )*
// ioke.g:255:5: ( 'o' | 'x' | 'p' | 'n' | 'i' | 'u' | 'm' | 's' )*
loop41:
do {
var alt41=2;
var LA41_0 = this.input.LA(1);
if ( (LA41_0=='i'||(LA41_0>='m' && LA41_0<='p')||LA41_0=='s'||LA41_0=='u'||LA41_0=='x') ) {
alt41=1;
}
switch (alt41) {
case 1 :
// ioke.g:
if ( this.input.LA(1)=='i'||(this.input.LA(1)>='m' && this.input.LA(1)<='p')||this.input.LA(1)=='s'||this.input.LA(1)=='u'||this.input.LA(1)=='x' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
default :
break loop41;
}
} while (true);
}
finally {
}
},
// $ANTLR end "RegexpModifier",
// $ANTLR start Terminator
mTerminator: function() {
try {
var _type = this.Terminator;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:259:5: ( ( ( ( '\\r' )? '\\n' ) | {...}? => '.' )+ )
// ioke.g:260:9: ( ( ( '\\r' )? '\\n' ) | {...}? => '.' )+
// ioke.g:260:9: ( ( ( '\\r' )? '\\n' ) | {...}? => '.' )+
var cnt43=0;
loop43:
do {
var alt43=3;
var LA43_0 = this.input.LA(1);
if ( (LA43_0=='\n'||LA43_0=='\r') ) {
alt43=1;
}
else if ( (LA43_0=='.') && (((this.input.LA(2) != '.')))) {
alt43=2;
}
switch (alt43) {
case 1 :
// ioke.g:260:10: ( ( '\\r' )? '\\n' )
// ioke.g:260:10: ( ( '\\r' )? '\\n' )
// ioke.g:260:11: ( '\\r' )? '\\n'
// ioke.g:260:11: ( '\\r' )?
var alt42=2;
var LA42_0 = this.input.LA(1);
if ( (LA42_0=='\r') ) {
alt42=1;
}
switch (alt42) {
case 1 :
// ioke.g:260:11: '\\r'
this.match('\r');
break;
}
this.match('\n');
break;
case 2 :
// ioke.g:260:25: {...}? => '.'
if ( !(((this.input.LA(2) != '.'))) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "Terminator", "(this.input.LA(2) != '.')");
}
this.match('.');
break;
default :
if ( cnt43 >= 1 ) {
break loop43;
}
var eee = new org.antlr.runtime.EarlyExitException(43, this.input);
throw eee;
}
cnt43++;
} while (true);
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "Terminator",
// $ANTLR start Whitespace
mWhitespace: function() {
try {
var _type = this.Whitespace;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:263:12: ( Separator )
// ioke.g:263:14: Separator
this.mSeparator();
this.skip();
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "Whitespace",
// $ANTLR start LineComment
mLineComment: function() {
try {
var _type = this.LineComment;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:266:5: ( ';' (~ ( '\\n' | '\\r' ) )* | '#!' (~ ( '\\n' | '\\r' ) )* )
var alt46=2;
var LA46_0 = this.input.LA(1);
if ( (LA46_0==';') ) {
alt46=1;
}
else if ( (LA46_0=='#') ) {
alt46=2;
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 46, 0, this.input);
throw nvae;
}
switch (alt46) {
case 1 :
// ioke.g:266:7: ';' (~ ( '\\n' | '\\r' ) )*
this.match(';');
// ioke.g:266:11: (~ ( '\\n' | '\\r' ) )*
loop44:
do {
var alt44=2;
var LA44_0 = this.input.LA(1);
if ( ((LA44_0>='\u0000' && LA44_0<='\t')||(LA44_0>='\u000B' && LA44_0<='\f')||(LA44_0>='\u000E' && LA44_0<='\uFFFF')) ) {
alt44=1;
}
switch (alt44) {
case 1 :
// ioke.g:266:11: ~ ( '\\n' | '\\r' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='\t')||(this.input.LA(1)>='\u000B' && this.input.LA(1)<='\f')||(this.input.LA(1)>='\u000E' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
default :
break loop44;
}
} while (true);
_channel=HIDDEN;
break;
case 2 :
// ioke.g:267:7: '#!' (~ ( '\\n' | '\\r' ) )*
this.match("#!");
// ioke.g:267:12: (~ ( '\\n' | '\\r' ) )*
loop45:
do {
var alt45=2;
var LA45_0 = this.input.LA(1);
if ( ((LA45_0>='\u0000' && LA45_0<='\t')||(LA45_0>='\u000B' && LA45_0<='\f')||(LA45_0>='\u000E' && LA45_0<='\uFFFF')) ) {
alt45=1;
}
switch (alt45) {
case 1 :
// ioke.g:267:12: ~ ( '\\n' | '\\r' )
if ( (this.input.LA(1)>='\u0000' && this.input.LA(1)<='\t')||(this.input.LA(1)>='\u000B' && this.input.LA(1)<='\f')||(this.input.LA(1)>='\u000E' && this.input.LA(1)<='\uFFFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
default :
break loop45;
}
} while (true);
_channel=HIDDEN;
break;
}
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "LineComment",
// $ANTLR start Comma
mComma: function() {
try {
var _type = this.Comma;
var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
// ioke.g:271:5: ( ',' )
// ioke.g:272:9: ','
this.match(',');
this.state.type = _type;
this.state.channel = _channel;
}
finally {
}
},
// $ANTLR end "Comma",
// $ANTLR start OctalEscape
mOctalEscape: function() {
try {
// ioke.g:277:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
var alt47=3;
var LA47_0 = this.input.LA(1);
if ( (LA47_0=='\\') ) {
var LA47_1 = this.input.LA(2);
if ( ((LA47_1>='0' && LA47_1<='3')) ) {
var LA47_2 = this.input.LA(3);
if ( ((LA47_2>='0' && LA47_2<='7')) ) {
var LA47_4 = this.input.LA(4);
if ( ((LA47_4>='0' && LA47_4<='7')) ) {
alt47=1;
}
else {
alt47=2;}
}
else {
alt47=3;}
}
else if ( ((LA47_1>='4' && LA47_1<='7')) ) {
var LA47_3 = this.input.LA(3);
if ( ((LA47_3>='0' && LA47_3<='7')) ) {
alt47=2;
}
else {
alt47=3;}
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 47, 1, this.input);
throw nvae;
}
}
else {
var nvae =
new org.antlr.runtime.NoViableAltException("", 47, 0, this.input);
throw nvae;
}
switch (alt47) {
case 1 :
// ioke.g:277:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
this.match('\\');
// ioke.g:277:14: ( '0' .. '3' )
// ioke.g:277:15: '0' .. '3'
this.matchRange('0','3');
// ioke.g:277:25: ( '0' .. '7' )
// ioke.g:277:26: '0' .. '7'
this.matchRange('0','7');
// ioke.g:277:36: ( '0' .. '7' )
// ioke.g:277:37: '0' .. '7'
this.matchRange('0','7');
break;
case 2 :
// ioke.g:278:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
this.match('\\');
// ioke.g:278:14: ( '0' .. '7' )
// ioke.g:278:15: '0' .. '7'
this.matchRange('0','7');
// ioke.g:278:25: ( '0' .. '7' )
// ioke.g:278:26: '0' .. '7'
this.matchRange('0','7');
break;
case 3 :
// ioke.g:279:9: '\\\\' ( '0' .. '7' )
this.match('\\');
// ioke.g:279:14: ( '0' .. '7' )
// ioke.g:279:15: '0' .. '7'
this.matchRange('0','7');
break;
}
}
finally {
}
},
// $ANTLR end "OctalEscape",
// $ANTLR start UnicodeEscape
mUnicodeEscape: function() {
try {
// ioke.g:284:5: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit )
// ioke.g:284:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit
this.match('\\');
this.match('u');
this.mHexDigit();
this.mHexDigit();
this.mHexDigit();
this.mHexDigit();
}
finally {
}
},
// $ANTLR end "UnicodeEscape",
// $ANTLR start FloatWithLeadingDot
mFloatWithLeadingDot: function() {
try {
// ioke.g:289:9: ( '.' ( Digit )+ ( Exponent )? )
// ioke.g:290:13: '.' ( Digit )+ ( Exponent )?
this.match('.');
// ioke.g:290:17: ( Digit )+
var cnt48=0;
loop48:
do {
var alt48=2;
var LA48_0 = this.input.LA(1);
if ( ((LA48_0>='0' && LA48_0<='9')) ) {
alt48=1;
}
switch (alt48) {
case 1 :
// ioke.g:290:17: Digit
this.mDigit();
break;
default :
if ( cnt48 >= 1 ) {
break loop48;
}
var eee = new org.antlr.runtime.EarlyExitException(48, this.input);
throw eee;
}
cnt48++;
} while (true);
// ioke.g:290:24: ( Exponent )?
var alt49=2;
var LA49_0 = this.input.LA(1);
if ( (LA49_0=='E'||LA49_0=='e') ) {
alt49=1;
}
switch (alt49) {
case 1 :
// ioke.g:290:25: Exponent
this.mExponent();
break;
}
}
finally {
}
},
// $ANTLR end "FloatWithLeadingDot",
// $ANTLR start UnitSpecifier
mUnitSpecifier: function() {
try {
// ioke.g:295:5: ( ( 'a' .. 'w' | 'A' .. 'W' | 'y' | 'Y' | 'z' | 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' )* )
// ioke.g:296:9: ( 'a' .. 'w' | 'A' .. 'W' | 'y' | 'Y' | 'z' | 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' )*
if ( (this.input.LA(1)>='A' && this.input.LA(1)<='W')||(this.input.LA(1)>='Y' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='w')||(this.input.LA(1)>='y' && this.input.LA(1)<='z') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
// ioke.g:296:49: ( 'a' .. 'z' | 'A' .. 'Z' | '_' )*
loop50:
do {
var alt50=2;
var LA50_0 = this.input.LA(1);
if ( ((LA50_0>='A' && LA50_0<='Z')||LA50_0=='_'||(LA50_0>='a' && LA50_0<='z')) ) {
alt50=1;
}
switch (alt50) {
case 1 :
// ioke.g:
if ( (this.input.LA(1)>='A' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='z') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
default :
break loop50;
}
} while (true);
}
finally {
}
},
// $ANTLR end "UnitSpecifier",
// $ANTLR start Exponent
mExponent: function() {
try {
// ioke.g:301:5: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
// ioke.g:302:9: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
if ( this.input.LA(1)=='E'||this.input.LA(1)=='e' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
// ioke.g:302:19: ( '+' | '-' )?
var alt51=2;
var LA51_0 = this.input.LA(1);
if ( (LA51_0=='+'||LA51_0=='-') ) {
alt51=1;
}
switch (alt51) {
case 1 :
// ioke.g:
if ( this.input.LA(1)=='+'||this.input.LA(1)=='-' ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
break;
}
// ioke.g:302:30: ( '0' .. '9' )+
var cnt52=0;
loop52:
do {
var alt52=2;
var LA52_0 = this.input.LA(1);
if ( ((LA52_0>='0' && LA52_0<='9')) ) {
alt52=1;
}
switch (alt52) {
case 1 :
// ioke.g:302:31: '0' .. '9'
this.matchRange('0','9');
break;
default :
if ( cnt52 >= 1 ) {
break loop52;
}
var eee = new org.antlr.runtime.EarlyExitException(52, this.input);
throw eee;
}
cnt52++;
} while (true);
}
finally {
}
},
// $ANTLR end "Exponent",
// $ANTLR start NonZeroDecimal
mNonZeroDecimal: function() {
try {
// ioke.g:307:5: ( ( '1' .. '9' ) ( Digit )* )
// ioke.g:308:6: ( '1' .. '9' ) ( Digit )*
// ioke.g:308:6: ( '1' .. '9' )
// ioke.g:308:7: '1' .. '9'
this.matchRange('1','9');
// ioke.g:308:17: ( Digit )*
loop53:
do {
var alt53=2;
var LA53_0 = this.input.LA(1);
if ( ((LA53_0>='0' && LA53_0<='9')) ) {
alt53=1;
}
switch (alt53) {
case 1 :
// ioke.g:308:17: Digit
this.mDigit();
break;
default :
break loop53;
}
} while (true);
}
finally {
}
},
// $ANTLR end "NonZeroDecimal",
// $ANTLR start Digit
mDigit: function() {
try {
// ioke.g:312:7: ( '0' .. '9' )
// ioke.g:312:9: '0' .. '9'
this.matchRange('0','9');
}
finally {
}
},
// $ANTLR end "Digit",
// $ANTLR start HexDigit
mHexDigit: function() {
try {
// ioke.g:315:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
// ioke.g:315:12: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )
if ( (this.input.LA(1)>='0' && this.input.LA(1)<='9')||(this.input.LA(1)>='A' && this.input.LA(1)<='F')||(this.input.LA(1)>='a' && this.input.LA(1)<='f') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
}
finally {
}
},
// $ANTLR end "HexDigit",
// $ANTLR start Separator
mSeparator: function() {
try {
// ioke.g:318:11: ( ( ' ' | '\\u000c' | '\\u0009' | '\\u000b' | '\\\\' '\\u000a' )+ )
// ioke.g:318:13: ( ' ' | '\\u000c' | '\\u0009' | '\\u000b' | '\\\\' '\\u000a' )+
// ioke.g:318:13: ( ' ' | '\\u000c' | '\\u0009' | '\\u000b' | '\\\\' '\\u000a' )+
var cnt54=0;
loop54:
do {
var alt54=6;
switch ( this.input.LA(1) ) {
case ' ':
alt54=1;
break;
case '\f':
alt54=2;
break;
case '\t':
alt54=3;
break;
case '\u000B':
alt54=4;
break;
case '\\':
alt54=5;
break;
}
switch (alt54) {
case 1 :
// ioke.g:318:14: ' '
this.match(' ');
break;
case 2 :
// ioke.g:318:20: '\\u000c'
this.match('\f');
break;
case 3 :
// ioke.g:318:31: '\\u0009'
this.match('\t');
break;
case 4 :
// ioke.g:318:42: '\\u000b'
this.match('\u000B');
break;
case 5 :
// ioke.g:318:53: '\\\\' '\\u000a'
this.match('\\');
this.match('\n');
break;
default :
if ( cnt54 >= 1 ) {
break loop54;
}
var eee = new org.antlr.runtime.EarlyExitException(54, this.input);
throw eee;
}
cnt54++;
} while (true);
}
finally {
}
},
// $ANTLR end "Separator",
// $ANTLR start IDDigit
mIDDigit: function() {
try {
// ioke.g:322:5: ( '\\u0030' .. '\\u0039' | '\\u0660' .. '\\u0669' | '\\u06f0' .. '\\u06f9' | '\\u0966' .. '\\u096f' | '\\u09e6' .. '\\u09ef' | '\\u0a66' .. '\\u0a6f' | '\\u0ae6' .. '\\u0aef' | '\\u0b66' .. '\\u0b6f' | '\\u0be7' .. '\\u0bef' | '\\u0c66' .. '\\u0c6f' | '\\u0ce6' .. '\\u0cef' | '\\u0d66' .. '\\u0d6f' | '\\u0e50' .. '\\u0e59' | '\\u0ed0' .. '\\u0ed9' | '\\u1040' .. '\\u1049' )
// ioke.g:
if ( (this.input.LA(1)>='0' && this.input.LA(1)<='9')||(this.input.LA(1)>='\u0660' && this.input.LA(1)<='\u0669')||(this.input.LA(1)>='\u06F0' && this.input.LA(1)<='\u06F9')||(this.input.LA(1)>='\u0966' && this.input.LA(1)<='\u096F')||(this.input.LA(1)>='\u09E6' && this.input.LA(1)<='\u09EF')||(this.input.LA(1)>='\u0A66' && this.input.LA(1)<='\u0A6F')||(this.input.LA(1)>='\u0AE6' && this.input.LA(1)<='\u0AEF')||(this.input.LA(1)>='\u0B66' && this.input.LA(1)<='\u0B6F')||(this.input.LA(1)>='\u0BE7' && this.input.LA(1)<='\u0BEF')||(this.input.LA(1)>='\u0C66' && this.input.LA(1)<='\u0C6F')||(this.input.LA(1)>='\u0CE6' && this.input.LA(1)<='\u0CEF')||(this.input.LA(1)>='\u0D66' && this.input.LA(1)<='\u0D6F')||(this.input.LA(1)>='\u0E50' && this.input.LA(1)<='\u0E59')||(this.input.LA(1)>='\u0ED0' && this.input.LA(1)<='\u0ED9')||(this.input.LA(1)>='\u1040' && this.input.LA(1)<='\u1049') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
}
finally {
}
},
// $ANTLR end "IDDigit",
// $ANTLR start Letter
mLetter: function() {
try {
// ioke.g:341:5: ( '\\u0041' .. '\\u005a' | '\\u005f' | '\\u0061' .. '\\u007a' | '\\u00c0' .. '\\u00d6' | '\\u00d8' .. '\\u00f6' | '\\u00f8' .. '\\u00ff' | '\\u0100' .. '\\u1fff' | '\\u3040' .. '\\u318f' | '\\u3300' .. '\\u337f' | '\\u3400' .. '\\u3d2d' | '\\u4e00' .. '\\u9fff' | '\\uf900' .. '\\ufaff' )
// ioke.g:
if ( (this.input.LA(1)>='A' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='z')||(this.input.LA(1)>='\u00C0' && this.input.LA(1)<='\u00D6')||(this.input.LA(1)>='\u00D8' && this.input.LA(1)<='\u00F6')||(this.input.LA(1)>='\u00F8' && this.input.LA(1)<='\u1FFF')||(this.input.LA(1)>='\u3040' && this.input.LA(1)<='\u318F')||(this.input.LA(1)>='\u3300' && this.input.LA(1)<='\u337F')||(this.input.LA(1)>='\u3400' && this.input.LA(1)<='\u3D2D')||(this.input.LA(1)>='\u4E00' && this.input.LA(1)<='\u9FFF')||(this.input.LA(1)>='\uF900' && this.input.LA(1)<='\uFAFF') ) {
this.input.consume();
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
this.recover(mse);
throw mse;}
}
finally {
}
},
// $ANTLR end "Letter",
mTokens: function() {
// ioke.g:1:8: ( T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | Identifier | DecimalLiteral | NumberLiteral | StringLiteral | RegexpLiteral | Terminator | Whitespace | LineComment | Comma )
var alt55=16;
alt55 = this.dfa55.predict(this.input);
switch (alt55) {
case 1 :
// ioke.g:1:10: T__31
this.mT__31();
break;
case 2 :
// ioke.g:1:16: T__32
this.mT__32();
break;
case 3 :
// ioke.g:1:22: T__33
this.mT__33();
break;
case 4 :
// ioke.g:1:28: T__34
this.mT__34();
break;
case 5 :
// ioke.g:1:34: T__35
this.mT__35();
break;
case 6 :
// ioke.g:1:40: T__36
this.mT__36();
break;
case 7 :
// ioke.g:1:46: T__37
this.mT__37();
break;
case 8 :
// ioke.g:1:52: Identifier
this.mIdentifier();
break;
case 9 :
// ioke.g:1:63: DecimalLiteral
this.mDecimalLiteral();
break;
case 10 :
// ioke.g:1:78: NumberLiteral
this.mNumberLiteral();
break;
case 11 :
// ioke.g:1:92: StringLiteral
this.mStringLiteral();
break;
case 12 :
// ioke.g:1:106: RegexpLiteral
this.mRegexpLiteral();
break;
case 13 :
// ioke.g:1:120: Terminator
this.mTerminator();
break;
case 14 :
// ioke.g:1:131: Whitespace
this.mWhitespace();
break;
case 15 :
// ioke.g:1:142: LineComment
this.mLineComment();
break;
case 16 :
// ioke.g:1:154: Comma
this.mComma();
break;
}
}
}, true); // important to pass true to overwrite default implementations
org.antlr.lang.augmentObject(iokeLexer, {
DFA25_eotS:
"\u0007\uffff\u0001\u000e\u0001\u000f\u000e\uffff",
DFA25_eofS:
"\u0017\uffff",
DFA25_minS:
"\u0001\u0022\u0002\uffff\u0001\u0000\u0001\u000a\u0005\u0000\u0001"+
"\u0030\u0003\u0000\u0002\uffff\u0001\u0030\u0002\u0000\u0001\u0030\u0001"+
"\u0000\u0001\u0030\u0001\u0000",
DFA25_maxS:
"\u0001\u007d\u0002\uffff\u0001\uffff\u0001\u0075\u0005\uffff\u0001"+
"\u0066\u0002\uffff\u0001\u0000\u0002\uffff\u0001\u0066\u0002\uffff\u0001"+
"\u0066\u0001\uffff\u0001\u0066\u0001\uffff",
DFA25_acceptS:
"\u0001\uffff\u0001\u0001\u0001\u0002\u000b\uffff\u0001\u0004\u0001"+
"\u0003\u0007\uffff",
DFA25_specialS:
"\u0001\u000d\u0002\uffff\u0001\u0000\u0001\u0001\u0001\u0007\u0001"+
"\u000f\u0001\u0010\u0001\u0002\u0001\u000c\u0001\u0009\u0001\u0012\u0001"+
"\u000e\u0001\u0006\u0002\uffff\u0001\u000a\u0001\u000b\u0001\u0011\u0001"+
"\u0008\u0001\u0005\u0001\u0004\u0001\u0003}>",
DFA25_transitionS: [
"\u0001\u0001\u0001\u0002\u0059\uffff\u0001\u0003",
"",
"",
"\u0022\u0006\u0001\u0008\u0001\u0005\u0038\u0006\u0001\u0004"+
"\u0001\u0007\uffa2\u0006",
"\u0001\u0009\u0017\uffff\u0002\u0009\u000c\uffff\u0004\u000b"+
"\u0004\u000c\u0024\uffff\u0002\u0009\u0004\uffff\u0001\u0009"+
"\u0002\uffff\u0002\u0009\u0007\uffff\u0001\u0009\u0003\uffff"+
"\u0001\u0009\u0001\uffff\u0001\u0009\u0001\u000a",
"\u0022\u0006\u0001\u0008\u0001\u0005\u0038\u0006\u0001\u0004"+
"\u0001\u0007\u001d\u0006\u0001\u000d\uff84\u0006",
"\u0022\u0006\u0001\u0008\u0001\u0005\u0038\u0006\u0001\u0004"+
"\u0001\u0007\uffa2\u0006",
"\u0000\u000f",
"\u0000\u000e",
"\u0022\u0006\u0001\u0008\u0001\u0005\u0038\u0006\u0001\u0004"+
"\u0001\u0007\uffa2\u0006",
"\u000a\u0010\u0007\uffff\u0006\u0010\u001a\uffff\u0006\u0010",
"\u0022\u0006\u0001\u0008\u0001\u0005\u000c\u0006\u0008\u0011"+
"\u0024\u0006\u0001\u0004\u0001\u0007\uffa2\u0006",
"\u0022\u0006\u0001\u0008\u0001\u0005\u000c\u0006\u0008\u0012"+
"\u0024\u0006\u0001\u0004\u0001\u0007\uffa2\u0006",
"\u0001\uffff",
"",
"",
"\u000a\u0013\u0007\uffff\u0006\u0013\u001a\uffff\u0006\u0013",
"\u0022\u0006\u0001\u0008\u0001\u0005\u000c\u0006\u0008\u0014"+
"\u0024\u0006\u0001\u0004\u0001\u0007\uffa2\u0006",
"\u0022\u0006\u0001\u0008\u0001\u0005\u0038\u0006\u0001\u0004"+
"\u0001\u0007\uffa2\u0006",
"\u000a\u0015\u0007\uffff\u0006\u0015\u001a\uffff\u0006\u0015",
"\u0022\u0006\u0001\u0008\u0001\u0005\u0038\u0006\u0001\u0004"+
"\u0001\u0007\uffa2\u0006",
"\u000a\u0016\u0007\uffff\u0006\u0016\u001a\uffff\u0006\u0016",
"\u0022\u0006\u0001\u0008\u0001\u0005\u0038\u0006\u0001\u0004"+
"\u0001\u0007\uffa2\u0006"
]
});
org.antlr.lang.augmentObject(iokeLexer, {
DFA25_eot:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA25_eotS),
DFA25_eof:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA25_eofS),
DFA25_min:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeLexer.DFA25_minS),
DFA25_max:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeLexer.DFA25_maxS),
DFA25_accept:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA25_acceptS),
DFA25_special:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA25_specialS),
DFA25_transition: (function() {
var a = [],
i,
numStates = iokeLexer.DFA25_transitionS.length;
for (i=0; i<numStates; i++) {
a.push(org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA25_transitionS[i]));
}
return a;
})()
});
iokeLexer.DFA25 = function(recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 25;
this.eot = iokeLexer.DFA25_eot;
this.eof = iokeLexer.DFA25_eof;
this.min = iokeLexer.DFA25_min;
this.max = iokeLexer.DFA25_max;
this.accept = iokeLexer.DFA25_accept;
this.special = iokeLexer.DFA25_special;
this.transition = iokeLexer.DFA25_transition;
};
org.antlr.lang.extend(iokeLexer.DFA25, org.antlr.runtime.DFA, {
getDescription: function() {
return "196:1: StringLiteral : ( ( '\"' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' ) ) | ( '#[' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' ) ) | {...}? => ( '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | '\"' ) ) )* ) ( '#{' | '\"' ) ) | {...}? => ( '}' ( ({...}? => ( EscapeSequence | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' ) ) );";
},
specialStateTransition: function(s, input) {
var _s = s;
/* bind to recognizer so semantic predicates can be evaluated */
var retval = (function(s, input) {
switch ( s ) {
case 0 :
var LA25_3 = input.LA(1);
var index25_3 = input.index();
input.rewind();
s = -1;
if ( (LA25_3=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_3=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( ((LA25_3>='\u0000' && LA25_3<='!')||(LA25_3>='$' && LA25_3<='[')||(LA25_3>='^' && LA25_3<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
else if ( (LA25_3==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( (LA25_3=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
input.seek(index25_3);
if ( s>=0 ) return s;
break;
case 1 :
var LA25_4 = input.LA(1);
var index25_4 = input.index();
input.rewind();
s = -1;
if ( (LA25_4=='\n'||(LA25_4>='\"' && LA25_4<='#')||(LA25_4>='\\' && LA25_4<=']')||LA25_4=='b'||(LA25_4>='e' && LA25_4<='f')||LA25_4=='n'||LA25_4=='r'||LA25_4=='t') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 9;}
else if ( (LA25_4=='u') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 10;}
else if ( ((LA25_4>='0' && LA25_4<='3')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 11;}
else if ( ((LA25_4>='4' && LA25_4<='7')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 12;}
input.seek(index25_4);
if ( s>=0 ) return s;
break;
case 2 :
var LA25_8 = input.LA(1);
var index25_8 = input.index();
input.rewind();
s = -1;
if ( ((LA25_8>='\u0000' && LA25_8<='\uFFFF')) && ((this.isAltInterpolating()))) {s = 14;}
else s = 15;
input.seek(index25_8);
if ( s>=0 ) return s;
break;
case 3 :
var LA25_22 = input.LA(1);
var index25_22 = input.index();
input.rewind();
s = -1;
if ( (LA25_22=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( (LA25_22=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
else if ( (LA25_22=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_22==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( ((LA25_22>='\u0000' && LA25_22<='!')||(LA25_22>='$' && LA25_22<='[')||(LA25_22>='^' && LA25_22<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
input.seek(index25_22);
if ( s>=0 ) return s;
break;
case 4 :
var LA25_21 = input.LA(1);
var index25_21 = input.index();
input.rewind();
s = -1;
if ( ((LA25_21>='0' && LA25_21<='9')||(LA25_21>='A' && LA25_21<='F')||(LA25_21>='a' && LA25_21<='f')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 22;}
input.seek(index25_21);
if ( s>=0 ) return s;
break;
case 5 :
var LA25_20 = input.LA(1);
var index25_20 = input.index();
input.rewind();
s = -1;
if ( (LA25_20=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( (LA25_20==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( (LA25_20=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_20=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
else if ( ((LA25_20>='\u0000' && LA25_20<='!')||(LA25_20>='$' && LA25_20<='[')||(LA25_20>='^' && LA25_20<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
input.seek(index25_20);
if ( s>=0 ) return s;
break;
case 6 :
var LA25_13 = input.LA(1);
var index25_13 = input.index();
input.rewind();
s = -1;
if ( ((this.isInterpolating())) ) {s = 15;}
else if ( ((this.isAltInterpolating())) ) {s = 14;}
input.seek(index25_13);
if ( s>=0 ) return s;
break;
case 7 :
var LA25_5 = input.LA(1);
var index25_5 = input.index();
input.rewind();
s = -1;
if ( (LA25_5=='{') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 13;}
else if ( (LA25_5=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( (LA25_5==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( (LA25_5=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_5=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
else if ( ((LA25_5>='\u0000' && LA25_5<='!')||(LA25_5>='$' && LA25_5<='[')||(LA25_5>='^' && LA25_5<='z')||(LA25_5>='|' && LA25_5<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
input.seek(index25_5);
if ( s>=0 ) return s;
break;
case 8 :
var LA25_19 = input.LA(1);
var index25_19 = input.index();
input.rewind();
s = -1;
if ( ((LA25_19>='0' && LA25_19<='9')||(LA25_19>='A' && LA25_19<='F')||(LA25_19>='a' && LA25_19<='f')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 21;}
input.seek(index25_19);
if ( s>=0 ) return s;
break;
case 9 :
var LA25_10 = input.LA(1);
var index25_10 = input.index();
input.rewind();
s = -1;
if ( ((LA25_10>='0' && LA25_10<='9')||(LA25_10>='A' && LA25_10<='F')||(LA25_10>='a' && LA25_10<='f')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 16;}
input.seek(index25_10);
if ( s>=0 ) return s;
break;
case 10 :
var LA25_16 = input.LA(1);
var index25_16 = input.index();
input.rewind();
s = -1;
if ( ((LA25_16>='0' && LA25_16<='9')||(LA25_16>='A' && LA25_16<='F')||(LA25_16>='a' && LA25_16<='f')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 19;}
input.seek(index25_16);
if ( s>=0 ) return s;
break;
case 11 :
var LA25_17 = input.LA(1);
var index25_17 = input.index();
input.rewind();
s = -1;
if ( (LA25_17=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( (LA25_17==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( (LA25_17=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_17=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
else if ( ((LA25_17>='0' && LA25_17<='7')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 20;}
else if ( ((LA25_17>='\u0000' && LA25_17<='!')||(LA25_17>='$' && LA25_17<='/')||(LA25_17>='8' && LA25_17<='[')||(LA25_17>='^' && LA25_17<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
input.seek(index25_17);
if ( s>=0 ) return s;
break;
case 12 :
var LA25_9 = input.LA(1);
var index25_9 = input.index();
input.rewind();
s = -1;
if ( (LA25_9=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( (LA25_9=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
else if ( (LA25_9=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_9==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( ((LA25_9>='\u0000' && LA25_9<='!')||(LA25_9>='$' && LA25_9<='[')||(LA25_9>='^' && LA25_9<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
input.seek(index25_9);
if ( s>=0 ) return s;
break;
case 13 :
var LA25_0 = input.LA(1);
var index25_0 = input.index();
input.rewind();
s = -1;
if ( (LA25_0=='\"') ) {s = 1;}
else if ( (LA25_0=='#') ) {s = 2;}
else if ( (LA25_0=='}') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 3;}
input.seek(index25_0);
if ( s>=0 ) return s;
break;
case 14 :
var LA25_12 = input.LA(1);
var index25_12 = input.index();
input.rewind();
s = -1;
if ( ((LA25_12>='0' && LA25_12<='7')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 18;}
else if ( (LA25_12=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( (LA25_12==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( (LA25_12=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_12=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
else if ( ((LA25_12>='\u0000' && LA25_12<='!')||(LA25_12>='$' && LA25_12<='/')||(LA25_12>='8' && LA25_12<='[')||(LA25_12>='^' && LA25_12<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
input.seek(index25_12);
if ( s>=0 ) return s;
break;
case 15 :
var LA25_6 = input.LA(1);
var index25_6 = input.index();
input.rewind();
s = -1;
if ( (LA25_6=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( (LA25_6==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( (LA25_6=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_6=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
else if ( ((LA25_6>='\u0000' && LA25_6<='!')||(LA25_6>='$' && LA25_6<='[')||(LA25_6>='^' && LA25_6<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
input.seek(index25_6);
if ( s>=0 ) return s;
break;
case 16 :
var LA25_7 = input.LA(1);
var index25_7 = input.index();
input.rewind();
s = -1;
if ( ((LA25_7>='\u0000' && LA25_7<='\uFFFF')) && ((this.isInterpolating()))) {s = 15;}
else s = 14;
input.seek(index25_7);
if ( s>=0 ) return s;
break;
case 17 :
var LA25_18 = input.LA(1);
var index25_18 = input.index();
input.rewind();
s = -1;
if ( (LA25_18=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( (LA25_18==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( (LA25_18=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_18=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
else if ( ((LA25_18>='\u0000' && LA25_18<='!')||(LA25_18>='$' && LA25_18<='[')||(LA25_18>='^' && LA25_18<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
input.seek(index25_18);
if ( s>=0 ) return s;
break;
case 18 :
var LA25_11 = input.LA(1);
var index25_11 = input.index();
input.rewind();
s = -1;
if ( ((LA25_11>='0' && LA25_11<='7')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 17;}
else if ( (LA25_11=='#') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 5;}
else if ( (LA25_11==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 7;}
else if ( (LA25_11=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 4;}
else if ( (LA25_11=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 8;}
else if ( ((LA25_11>='\u0000' && LA25_11<='!')||(LA25_11>='$' && LA25_11<='/')||(LA25_11>='8' && LA25_11<='[')||(LA25_11>='^' && LA25_11<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 6;}
input.seek(index25_11);
if ( s>=0 ) return s;
break;
}
}).call(this.recognizer, s, input);
if (!org.antlr.lang.isUndefined(retval)) {
return retval;
}
var nvae =
new org.antlr.runtime.NoViableAltException(this.getDescription(), 25, _s, input);
this.error(nvae);
throw nvae;
},
dummy: null
});
org.antlr.lang.augmentObject(iokeLexer, {
DFA38_eotS:
"\u0017\uffff",
DFA38_eofS:
"\u0017\uffff",
DFA38_minS:
"\u0001\u0023\u0001\u002f\u0001\u0000\u0002\uffff\u0001\u000a\u0003"+
"\u0000\u0001\uffff\u0001\u0000\u0001\u0030\u0003\u0000\u0001\uffff\u0001"+
"\u0030\u0002\u0000\u0001\u0030\u0001\u0000\u0001\u0030\u0001\u0000",
DFA38_maxS:
"\u0001\u007d\u0001\u0072\u0001\uffff\u0002\uffff\u0001\u0075\u0001"+
"\uffff\u0001\u0000\u0001\uffff\u0001\uffff\u0001\uffff\u0001\u0066\u0002"+
"\uffff\u0001\u0000\u0001\uffff\u0001\u0066\u0002\uffff\u0001\u0066\u0001"+
"\uffff\u0001\u0066\u0001\uffff",
DFA38_acceptS:
"\u0003\uffff\u0001\u0001\u0001\u0002\u0004\uffff\u0001\u0003\u0005"+
"\uffff\u0001\u0004\u0007\uffff",
DFA38_specialS:
"\u0001\u000c\u0001\uffff\u0001\u0007\u0002\uffff\u0001\u000d\u0001"+
"\u0008\u0001\u0011\u0001\u0009\u0001\uffff\u0001\u0000\u0001\u000e\u0001"+
"\u0004\u0001\u0003\u0001\u0005\u0001\uffff\u0001\u000f\u0001\u0001\u0001"+
"\u0002\u0001\u000b\u0001\u000a\u0001\u0006\u0001\u0010}>",
DFA38_transitionS: [
"\u0001\u0001\u0059\uffff\u0001\u0002",
"\u0001\u0003\u0042\uffff\u0001\u0004",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u002c\u0008"+
"\u0001\u0005\u0001\u0009\uffa2\u0008",
"",
"",
"\u0001\u000a\u0018\uffff\u0001\u000a\u000b\uffff\u0001\u000a"+
"\u0004\u000c\u0004\u000d\u0024\uffff\u0001\u000a\u0005\uffff"+
"\u0001\u000a\u0003\uffff\u0001\u000a\u0007\uffff\u0001\u000a"+
"\u0003\uffff\u0001\u000a\u0001\uffff\u0001\u000a\u0001\u000b",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u002c\u0008"+
"\u0001\u0005\u0001\u0009\u001d\u0008\u0001\u000e\uff84\u0008",
"\u0001\uffff",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u002c\u0008"+
"\u0001\u0005\u0001\u0009\uffa2\u0008",
"",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u002c\u0008"+
"\u0001\u0005\u0001\u0009\uffa2\u0008",
"\u000a\u0010\u0007\uffff\u0006\u0010\u001a\uffff\u0006\u0010",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u0008\u0011"+
"\u0024\u0008\u0001\u0005\u0001\u0009\uffa2\u0008",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u0008\u0012"+
"\u0024\u0008\u0001\u0005\u0001\u0009\uffa2\u0008",
"\u0001\uffff",
"",
"\u000a\u0013\u0007\uffff\u0006\u0013\u001a\uffff\u0006\u0013",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u0008\u0014"+
"\u0024\u0008\u0001\u0005\u0001\u0009\uffa2\u0008",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u002c\u0008"+
"\u0001\u0005\u0001\u0009\uffa2\u0008",
"\u000a\u0015\u0007\uffff\u0006\u0015\u001a\uffff\u0006\u0015",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u002c\u0008"+
"\u0001\u0005\u0001\u0009\uffa2\u0008",
"\u000a\u0016\u0007\uffff\u0006\u0016\u001a\uffff\u0006\u0016",
"\u0023\u0008\u0001\u0006\u000b\u0008\u0001\u0007\u002c\u0008"+
"\u0001\u0005\u0001\u0009\uffa2\u0008"
]
});
org.antlr.lang.augmentObject(iokeLexer, {
DFA38_eot:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA38_eotS),
DFA38_eof:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA38_eofS),
DFA38_min:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeLexer.DFA38_minS),
DFA38_max:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeLexer.DFA38_maxS),
DFA38_accept:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA38_acceptS),
DFA38_special:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA38_specialS),
DFA38_transition: (function() {
var a = [],
i,
numStates = iokeLexer.DFA38_transitionS.length;
for (i=0; i<numStates; i++) {
a.push(org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA38_transitionS[i]));
}
return a;
})()
});
iokeLexer.DFA38 = function(recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 38;
this.eot = iokeLexer.DFA38_eot;
this.eof = iokeLexer.DFA38_eof;
this.min = iokeLexer.DFA38_min;
this.max = iokeLexer.DFA38_max;
this.accept = iokeLexer.DFA38_accept;
this.special = iokeLexer.DFA38_special;
this.transition = iokeLexer.DFA38_transition;
};
org.antlr.lang.extend(iokeLexer.DFA38, org.antlr.runtime.DFA, {
getDescription: function() {
return "217:1: RegexpLiteral : ( ( '#/' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier ) ) | ( '#r[' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | ']' RegexpModifier ) ) | {...}? => ( '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | '/' ) ) )* ) ( '#{' | '/' RegexpModifier ) ) | {...}? => ( '}' ( ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )* ) ( '#{' | '/' RegexpModifier ) ) );";
},
specialStateTransition: function(s, input) {
var _s = s;
/* bind to recognizer so semantic predicates can be evaluated */
var retval = (function(s, input) {
switch ( s ) {
case 0 :
var LA38_10 = input.LA(1);
var index38_10 = input.index();
input.rewind();
s = -1;
if ( (LA38_10=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_10=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( (LA38_10=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( ((LA38_10>='\u0000' && LA38_10<='\"')||(LA38_10>='$' && LA38_10<='.')||(LA38_10>='0' && LA38_10<='[')||(LA38_10>='^' && LA38_10<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_10==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_10);
if ( s>=0 ) return s;
break;
case 1 :
var LA38_17 = input.LA(1);
var index38_17 = input.index();
input.rewind();
s = -1;
if ( (LA38_17=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_17=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( (LA38_17=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( ((LA38_17>='0' && LA38_17<='7')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( ((LA38_17>='\u0000' && LA38_17<='\"')||(LA38_17>='$' && LA38_17<='.')||(LA38_17>='8' && LA38_17<='[')||(LA38_17>='^' && LA38_17<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_17==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_17);
if ( s>=0 ) return s;
break;
case 2 :
var LA38_18 = input.LA(1);
var index38_18 = input.index();
input.rewind();
s = -1;
if ( (LA38_18=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_18=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( (LA38_18=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( ((LA38_18>='\u0000' && LA38_18<='\"')||(LA38_18>='$' && LA38_18<='.')||(LA38_18>='0' && LA38_18<='[')||(LA38_18>='^' && LA38_18<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_18==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_18);
if ( s>=0 ) return s;
break;
case 3 :
var LA38_13 = input.LA(1);
var index38_13 = input.index();
input.rewind();
s = -1;
if ( (LA38_13=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_13=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( (LA38_13=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( ((LA38_13>='0' && LA38_13<='7')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 18;}
else if ( ((LA38_13>='\u0000' && LA38_13<='\"')||(LA38_13>='$' && LA38_13<='.')||(LA38_13>='8' && LA38_13<='[')||(LA38_13>='^' && LA38_13<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_13==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_13);
if ( s>=0 ) return s;
break;
case 4 :
var LA38_12 = input.LA(1);
var index38_12 = input.index();
input.rewind();
s = -1;
if ( (LA38_12=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_12=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( (LA38_12=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( ((LA38_12>='0' && LA38_12<='7')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 17;}
else if ( ((LA38_12>='\u0000' && LA38_12<='\"')||(LA38_12>='$' && LA38_12<='.')||(LA38_12>='8' && LA38_12<='[')||(LA38_12>='^' && LA38_12<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_12==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_12);
if ( s>=0 ) return s;
break;
case 5 :
var LA38_14 = input.LA(1);
var index38_14 = input.index();
input.rewind();
s = -1;
if ( ((this.isRegexpInterpolating())) ) {s = 9;}
else if ( ((this.isAltRegexpInterpolating())) ) {s = 15;}
input.seek(index38_14);
if ( s>=0 ) return s;
break;
case 6 :
var LA38_21 = input.LA(1);
var index38_21 = input.index();
input.rewind();
s = -1;
if ( ((LA38_21>='0' && LA38_21<='9')||(LA38_21>='A' && LA38_21<='F')||(LA38_21>='a' && LA38_21<='f')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
input.seek(index38_21);
if ( s>=0 ) return s;
break;
case 7 :
var LA38_2 = input.LA(1);
var index38_2 = input.index();
input.rewind();
s = -1;
if ( (LA38_2=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( (LA38_2=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_2=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( ((LA38_2>='\u0000' && LA38_2<='\"')||(LA38_2>='$' && LA38_2<='.')||(LA38_2>='0' && LA38_2<='[')||(LA38_2>='^' && LA38_2<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_2==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_2);
if ( s>=0 ) return s;
break;
case 8 :
var LA38_6 = input.LA(1);
var index38_6 = input.index();
input.rewind();
s = -1;
if ( (LA38_6=='{') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 14;}
else if ( (LA38_6=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_6=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( (LA38_6=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( ((LA38_6>='\u0000' && LA38_6<='\"')||(LA38_6>='$' && LA38_6<='.')||(LA38_6>='0' && LA38_6<='[')||(LA38_6>='^' && LA38_6<='z')||(LA38_6>='|' && LA38_6<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_6==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_6);
if ( s>=0 ) return s;
break;
case 9 :
var LA38_8 = input.LA(1);
var index38_8 = input.index();
input.rewind();
s = -1;
if ( (LA38_8=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_8=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( (LA38_8=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( ((LA38_8>='\u0000' && LA38_8<='\"')||(LA38_8>='$' && LA38_8<='.')||(LA38_8>='0' && LA38_8<='[')||(LA38_8>='^' && LA38_8<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_8==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_8);
if ( s>=0 ) return s;
break;
case 10 :
var LA38_20 = input.LA(1);
var index38_20 = input.index();
input.rewind();
s = -1;
if ( (LA38_20=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_20=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( (LA38_20=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( ((LA38_20>='\u0000' && LA38_20<='\"')||(LA38_20>='$' && LA38_20<='.')||(LA38_20>='0' && LA38_20<='[')||(LA38_20>='^' && LA38_20<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_20==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_20);
if ( s>=0 ) return s;
break;
case 11 :
var LA38_19 = input.LA(1);
var index38_19 = input.index();
input.rewind();
s = -1;
if ( ((LA38_19>='0' && LA38_19<='9')||(LA38_19>='A' && LA38_19<='F')||(LA38_19>='a' && LA38_19<='f')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index38_19);
if ( s>=0 ) return s;
break;
case 12 :
var LA38_0 = input.LA(1);
var index38_0 = input.index();
input.rewind();
s = -1;
if ( (LA38_0=='#') ) {s = 1;}
else if ( (LA38_0=='}') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 2;}
input.seek(index38_0);
if ( s>=0 ) return s;
break;
case 13 :
var LA38_5 = input.LA(1);
var index38_5 = input.index();
input.rewind();
s = -1;
if ( (LA38_5=='\n'||LA38_5=='#'||LA38_5=='/'||LA38_5=='\\'||LA38_5=='b'||LA38_5=='f'||LA38_5=='n'||LA38_5=='r'||LA38_5=='t') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 10;}
else if ( (LA38_5=='u') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 11;}
else if ( ((LA38_5>='0' && LA38_5<='3')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 12;}
else if ( ((LA38_5>='4' && LA38_5<='7')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 13;}
input.seek(index38_5);
if ( s>=0 ) return s;
break;
case 14 :
var LA38_11 = input.LA(1);
var index38_11 = input.index();
input.rewind();
s = -1;
if ( ((LA38_11>='0' && LA38_11<='9')||(LA38_11>='A' && LA38_11<='F')||(LA38_11>='a' && LA38_11<='f')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 16;}
input.seek(index38_11);
if ( s>=0 ) return s;
break;
case 15 :
var LA38_16 = input.LA(1);
var index38_16 = input.index();
input.rewind();
s = -1;
if ( ((LA38_16>='0' && LA38_16<='9')||(LA38_16>='A' && LA38_16<='F')||(LA38_16>='a' && LA38_16<='f')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
input.seek(index38_16);
if ( s>=0 ) return s;
break;
case 16 :
var LA38_22 = input.LA(1);
var index38_22 = input.index();
input.rewind();
s = -1;
if ( (LA38_22=='#') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 6;}
else if ( (LA38_22=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 7;}
else if ( (LA38_22=='\\') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 5;}
else if ( ((LA38_22>='\u0000' && LA38_22<='\"')||(LA38_22>='$' && LA38_22<='.')||(LA38_22>='0' && LA38_22<='[')||(LA38_22>='^' && LA38_22<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 8;}
else if ( (LA38_22==']') && ((this.isRegexpInterpolating()))) {s = 9;}
input.seek(index38_22);
if ( s>=0 ) return s;
break;
case 17 :
var LA38_7 = input.LA(1);
var index38_7 = input.index();
input.rewind();
s = -1;
if ( ((this.isRegexpInterpolating())) ) {s = 9;}
else if ( ((this.isAltRegexpInterpolating())) ) {s = 15;}
input.seek(index38_7);
if ( s>=0 ) return s;
break;
}
}).call(this.recognizer, s, input);
if (!org.antlr.lang.isUndefined(retval)) {
return retval;
}
var nvae =
new org.antlr.runtime.NoViableAltException(this.getDescription(), 38, _s, input);
this.error(nvae);
throw nvae;
},
dummy: null
});
org.antlr.lang.augmentObject(iokeLexer, {
DFA36_eotS:
"\u0002\uffff\u0001\u0006\u0001\uffff\u0002\u0006\u0001\uffff",
DFA36_eofS:
"\u0007\uffff",
DFA36_minS:
"\u0003\u0000\u0001\uffff\u0002\u0000\u0001\uffff",
DFA36_maxS:
"\u0003\uffff\u0001\uffff\u0002\uffff\u0001\uffff",
DFA36_acceptS:
"\u0003\uffff\u0001\u0001\u0002\uffff\u0001\u0002",
DFA36_specialS:
"\u0001\u0004\u0001\u0003\u0001\u0001\u0001\uffff\u0001\u0000\u0001"+
"\u0002\u0001\uffff}>",
DFA36_transitionS: [
"\u0023\u0003\u0001\u0001\u000b\u0003\u0001\u0002\u002d\u0003"+
"\u0001\uffff\uffa2\u0003",
"\u005d\u0003\u0001\uffff\u001d\u0003\u0001\u0004\uff84\u0003",
"\u005d\u0003\u0001\uffff\u000b\u0003\u0001\u0005\u0003\u0003"+
"\u0004\u0005\u0002\u0003\u0001\u0005\u0001\u0003\u0001\u0005"+
"\u0002\u0003\u0001\u0005\uff87\u0003",
"",
"\u005d\u0003\u0001\uffff\uffa2\u0003",
"\u005d\u0003\u0001\uffff\u000b\u0003\u0001\u0005\u0003\u0003"+
"\u0004\u0005\u0002\u0003\u0001\u0005\u0001\u0003\u0001\u0005"+
"\u0002\u0003\u0001\u0005\uff87\u0003",
""
]
});
org.antlr.lang.augmentObject(iokeLexer, {
DFA36_eot:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA36_eotS),
DFA36_eof:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA36_eofS),
DFA36_min:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeLexer.DFA36_minS),
DFA36_max:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeLexer.DFA36_maxS),
DFA36_accept:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA36_acceptS),
DFA36_special:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA36_specialS),
DFA36_transition: (function() {
var a = [],
i,
numStates = iokeLexer.DFA36_transitionS.length;
for (i=0; i<numStates; i++) {
a.push(org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA36_transitionS[i]));
}
return a;
})()
});
iokeLexer.DFA36 = function(recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 36;
this.eot = iokeLexer.DFA36_eot;
this.eof = iokeLexer.DFA36_eof;
this.min = iokeLexer.DFA36_min;
this.max = iokeLexer.DFA36_max;
this.accept = iokeLexer.DFA36_accept;
this.special = iokeLexer.DFA36_special;
this.transition = iokeLexer.DFA36_transition;
};
org.antlr.lang.extend(iokeLexer.DFA36, org.antlr.runtime.DFA, {
getDescription: function() {
return "()* loopback of 233:51: ({...}? => ( EscapeSequenceRegexp | ~ ( '\\\\' | ']' ) ) )*";
},
specialStateTransition: function(s, input) {
var _s = s;
/* bind to recognizer so semantic predicates can be evaluated */
var retval = (function(s, input) {
switch ( s ) {
case 0 :
var LA36_4 = input.LA(1);
var index36_4 = input.index();
input.rewind();
s = -1;
if ( ((LA36_4>='\u0000' && LA36_4<='\\')||(LA36_4>='^' && LA36_4<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {s = 3;}
else s = 6;
input.seek(index36_4);
if ( s>=0 ) return s;
break;
case 1 :
var LA36_2 = input.LA(1);
var index36_2 = input.index();
input.rewind();
s = -1;
if ( (LA36_2=='i'||(LA36_2>='m' && LA36_2<='p')||LA36_2=='s'||LA36_2=='u'||LA36_2=='x') ) {s = 5;}
else if ( ((LA36_2>='\u0000' && LA36_2<='\\')||(LA36_2>='^' && LA36_2<='h')||(LA36_2>='j' && LA36_2<='l')||(LA36_2>='q' && LA36_2<='r')||LA36_2=='t'||(LA36_2>='v' && LA36_2<='w')||(LA36_2>='y' && LA36_2<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {s = 3;}
else s = 6;
input.seek(index36_2);
if ( s>=0 ) return s;
break;
case 2 :
var LA36_5 = input.LA(1);
var index36_5 = input.index();
input.rewind();
s = -1;
if ( ((LA36_5>='\u0000' && LA36_5<='\\')||(LA36_5>='^' && LA36_5<='h')||(LA36_5>='j' && LA36_5<='l')||(LA36_5>='q' && LA36_5<='r')||LA36_5=='t'||(LA36_5>='v' && LA36_5<='w')||(LA36_5>='y' && LA36_5<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {s = 3;}
else if ( (LA36_5=='i'||(LA36_5>='m' && LA36_5<='p')||LA36_5=='s'||LA36_5=='u'||LA36_5=='x') ) {s = 5;}
else s = 6;
input.seek(index36_5);
if ( s>=0 ) return s;
break;
case 3 :
var LA36_1 = input.LA(1);
var index36_1 = input.index();
input.rewind();
s = -1;
if ( (LA36_1=='{') ) {s = 4;}
else if ( ((LA36_1>='\u0000' && LA36_1<='\\')||(LA36_1>='^' && LA36_1<='z')||(LA36_1>='|' && LA36_1<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {s = 3;}
input.seek(index36_1);
if ( s>=0 ) return s;
break;
case 4 :
var LA36_0 = input.LA(1);
var index36_0 = input.index();
input.rewind();
s = -1;
if ( (LA36_0=='#') ) {s = 1;}
else if ( (LA36_0=='/') ) {s = 2;}
else if ( ((LA36_0>='\u0000' && LA36_0<='\"')||(LA36_0>='$' && LA36_0<='.')||(LA36_0>='0' && LA36_0<='\\')||(LA36_0>='^' && LA36_0<='\uFFFF')) && ((!this.lookingAtInterpolation()))) {s = 3;}
input.seek(index36_0);
if ( s>=0 ) return s;
break;
}
}).call(this.recognizer, s, input);
if (!org.antlr.lang.isUndefined(retval)) {
return retval;
}
var nvae =
new org.antlr.runtime.NoViableAltException(this.getDescription(), 36, _s, input);
this.error(nvae);
throw nvae;
},
dummy: null
});
org.antlr.lang.augmentObject(iokeLexer, {
DFA55_eotS:
"\u0001\u000a\u0002\uffff\u0001\u0011\u0001\uffff\u0001\u0012\u0001"+
"\u0019\u0002\uffff\u0001\u001d\u000c\uffff\u0001\u002b\u0001\u0033\u0001"+
"\u0038\u0003\uffff\u0001\u0008\u0001\uffff\u0001\u003b\u0006\uffff\u0001"+
"\u003f\u0003\uffff\u0001\u002b\u0001\u0043\u0001\uffff\u0001\u0033\u0002"+
"\uffff\u0001\u0038\u0001\uffff\u0001\u002b\u0003\uffff\u0001\u004c\u0001"+
"\uffff\u0001\u0033\u0002\uffff\u0001\u0008\u0005\uffff\u0001\u005b\u0005"+
"\uffff\u0001\u005f\u0002\uffff\u0001\u005f\u0001\uffff\u0001\u0067\u0005"+
"\uffff\u0001\u002b\u0001\u006b\u0001\u006c\u000c\uffff\u0001\u0074\u0005"+
"\uffff\u0001\u005f\u0020\uffff",
DFA55_eofS:
"\u0087\uffff",
DFA55_minS:
"\u0001\u0009\u0002\uffff\u0001\u005d\u0001\uffff\u0001\u007d\u0001"+
"\u0000\u0001\u0021\u0001\uffff\u0001\u002e\u0009\uffff\u0001\u000a\u0005"+
"\u0000\u0003\uffff\u0001\u0000\u0001\uffff\u0001\u000a\u0001\u0000\u0001"+
"\u0030\u0002\uffff\u0004\u0000\u0001\uffff\u0001\u000a\u0002\u0000\u0001"+
"\uffff\u0004\u0000\u0001\u000a\u0002\u0000\u0001\uffff\u0002\u0000\u0001"+
"\u000a\u0001\u0000\u0001\uffff\u0003\u0000\u0001\u0030\u0005\u0000\u0001"+
"\u0030\u0001\uffff\u0004\u0000\u0001\u000a\u0003\u0000\u0001\uffff\u0001"+
"\u0000\u0001\u0030\u0005\u0000\u0001\uffff\u0001\u0000\u0001\u0030\u0002"+
"\u0000\u0001\u0030\u0002\u0000\u0001\u0030\u0002\u0000\u0001\uffff\u0001"+
"\u0000\u0001\uffff\u0001\u0000\u0001\u0030\u0004\u0000\u0001\u0030\u0003"+
"\u0000\u0002\uffff\u0001\u0030\u0002\u0000\u0002\u0030\u0002\u0000\u0001"+
"\u0030\u0002\u0000\u0001\u0030\u0001\u0000\u0001\u0030\u0002\u0000\u0002"+
"\u0030\u0001\u0000\u0002\u0030\u0001\u0000\u0001\u0030\u0003\u0000",
DFA55_maxS:
"\u0001\ufaff\u0002\uffff\u0001\u005d\u0001\uffff\u0001\u007d\u0001"+
"\uffff\u0001\u007e\u0001\uffff\u0001\u002e\u0009\uffff\u0001\u0075\u0005"+
"\uffff\u0003\uffff\u0001\uffff\u0001\uffff\u0001\u002e\u0001\uffff\u0001"+
"\u0066\u0002\uffff\u0004\uffff\u0001\uffff\u0001\u0075\u0002\uffff\u0001"+
"\uffff\u0004\uffff\u0001\u0075\u0002\uffff\u0001\uffff\u0002\uffff\u0001"+
"\u0075\u0001\uffff\u0001\uffff\u0002\uffff\u0001\u0000\u0001\u0066\u0002"+
"\uffff\u0001\u0000\u0002\uffff\u0001\u0066\u0001\uffff\u0004\uffff\u0001"+
"\u0075\u0003\uffff\u0001\uffff\u0001\uffff\u0001\u0066\u0005\uffff\u0001"+
"\uffff\u0001\uffff\u0001\u0066\u0002\uffff\u0001\u0066\u0001\uffff\u0001"+
"\u0000\u0001\u0066\u0002\uffff\u0001\uffff\u0001\uffff\u0001\uffff\u0001"+
"\uffff\u0001\u0066\u0003\uffff\u0001\u0000\u0001\u0066\u0002\uffff\u0001"+
"\u0000\u0002\uffff\u0001\u0066\u0002\uffff\u0002\u0066\u0001\uffff\u0001"+
"\u0000\u0001\u0066\u0002\uffff\u0001\u0066\u0001\uffff\u0001\u0066\u0002"+
"\uffff\u0002\u0066\u0001\uffff\u0002\u0066\u0001\uffff\u0001\u0066\u0003"+
"\uffff",
DFA55_acceptS:
"\u0001\uffff\u0001\u0001\u0001\u0002\u0001\uffff\u0001\u0004\u0003"+
"\uffff\u0001\u0008\u0001\uffff\u0001\u0009\u0001\u000a\u0001\u000b\u0001"+
"\u000d\u0001\u000e\u0001\u000f\u0001\u0010\u0001\u0003\u0001\u0005\u0006"+
"\uffff\u0001\u0006\u0001\u0007\u0001\u000c\u0001\uffff\u0001\u000d\u0003"+
"\uffff\u0001\u000c\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001"+
"\u000c\u0007\uffff\u0001\u000b\u0004\uffff\u0001\u000b\u000a\uffff\u0001"+
"\u000c\u0008\uffff\u0001\u000c\u0007\uffff\u0001\u000b\u000a\uffff\u0001"+
"\u000c\u0001\uffff\u0001\u000b\u000a\uffff\u0001\u000c\u0001\u000b\u0019"+
"\uffff",
DFA55_specialS:
"\u0006\uffff\u0001\u001d\u0002\uffff\u0001\u0027\u0009\uffff\u0001"+
"\u003d\u0001\u0029\u0001\u004f\u0001\u000f\u0001\u005b\u0001\u0011\u0003"+
"\uffff\u0001\u003b\u0001\uffff\u0001\u0033\u0001\u001c\u0001\u000d\u0002"+
"\uffff\u0001\u0053\u0001\u0009\u0001\u000c\u0001\u0054\u0001\uffff\u0001"+
"\u0010\u0001\u0024\u0001\u001a\u0001\uffff\u0001\u003a\u0001\u0055\u0001"+
"\u004c\u0001\u0001\u0001\u001e\u0001\u0034\u0001\u0002\u0001\uffff\u0001"+
"\u001b\u0001\u0021\u0001\u0051\u0001\u0058\u0001\uffff\u0001\u0022\u0001"+
"\u0036\u0001\u0019\u0001\u002a\u0001\u002c\u0001\u004e\u0001\u0032\u0001"+
"\u0020\u0001\u0014\u0001\u003f\u0001\uffff\u0001\u0006\u0001\u0028\u0001"+
"\u0012\u0001\u0007\u0001\u0052\u0001\u000a\u0001\u0035\u0001\u0047\u0001"+
"\uffff\u0001\u005f\u0001\u0043\u0001\u002e\u0001\u005a\u0001\u002f\u0001"+
"\u0061\u0001\u0062\u0001\uffff\u0001\u002d\u0001\u0005\u0001\u005e\u0001"+
"\u004b\u0001\u0023\u0001\u003c\u0001\u0044\u0001\u0059\u0001\u0048\u0001"+
"\u0008\u0001\uffff\u0001\u000e\u0001\uffff\u0001\u0057\u0001\u0004\u0001"+
"\u004d\u0001\u0050\u0001\u001f\u0001\u0042\u0001\u0064\u0001\u0049\u0001"+
"\u0037\u0001\u0017\u0002\uffff\u0001\u0046\u0001\u0056\u0001\u0013\u0001"+
"\u0018\u0001\u0063\u0001\u0000\u0001\u0016\u0001\u0045\u0001\u000b\u0001"+
"\u002b\u0001\u005d\u0001\u0030\u0001\u0041\u0001\u0026\u0001\u0003\u0001"+
"\u005c\u0001\u0040\u0001\u0015\u0001\u0060\u0001\u0039\u0001\u003e\u0001"+
"\u0038\u0001\u004a\u0001\u0031\u0001\u0025}>",
DFA55_transitionS: [
"\u0001\u000e\u0001\u000d\u0002\u000e\u0001\u000d\u0012\uffff"+
"\u0001\u000e\u0001\u0008\u0001\u000c\u0001\u0007\u0004\u0008"+
"\u0001\u0001\u0001\u0002\u0002\u0008\u0001\u0010\u0001\u0008"+
"\u0001\u0009\u0001\u0008\u000a\u000b\u0001\u0008\u0001\u000f"+
"\u001f\u0008\u0001\u0003\u0001\u000e\u0001\u0004\u001d\u0008"+
"\u0001\u0005\u0001\u0008\u0001\u0006\u0001\u0008\u0041\uffff"+
"\u0017\u0008\u0001\uffff\u001f\u0008\u0001\uffff\u1f08\u0008"+
"\u1040\uffff\u0150\u0008\u0170\uffff\u0080\u0008\u0080\uffff"+
"\u092e\u0008\u10d2\uffff\u5200\u0008\u5900\uffff\u0200\u0008",
"",
"",
"\u0001\u0008",
"",
"\u0001\u0008",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u002c\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u0001\u001c\u0001\uffff\u0005\u0008\u0002\uffff\u0002\u0008"+
"\u0001\uffff\u0001\u0008\u0001\uffff\u0001\u001b\u000a\uffff"+
"\u0001\u0008\u0001\uffff\u0005\u0008\u001a\uffff\u0001\u000c"+
"\u0002\uffff\u0001\u0008\u0001\uffff\u0001\u0008\u0011\uffff"+
"\u0001\u001b\u0008\uffff\u0001\u001a\u0001\u0008\u0001\uffff"+
"\u0001\u0008",
"",
"\u0001\u001e",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"\u0001\u001f\u0017\uffff\u0001\u0022\u0001\u001f\u000b\uffff"+
"\u0001\u0021\u0004\u0023\u0004\u0024\u0024\uffff\u0001\u001f"+
"\u0001\u0022\u0004\uffff\u0001\u001f\u0002\uffff\u0001\u0022"+
"\u0001\u001f\u0007\uffff\u0001\u001f\u0003\uffff\u0001\u001f"+
"\u0001\uffff\u0001\u001f\u0001\u0020",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u002c\u0015\u0001\u0013\u0001\u0018\u001d\u0015\u0001\u0025"+
"\uff84\u0015",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u002c\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\u000b\u002d\u0001\u0029"+
"\u0003\u002d\u0004\u0029\u0002\u002d\u0001\u0029\u0001\u002d"+
"\u0001\u0029\u0002\u002d\u0001\u0029\uff87\u002d",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u002c\u0032"+
"\u0001\u0030\u0001\u002f\uffa2\u0032",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u002c\u0039\u0001\u0036\uffa3\u0039",
"",
"",
"",
"\u000a\u000f\u0001\uffff\u0002\u000f\u0001\uffff\u0013\u000f"+
"\u0001\u003a\u0001\u000f\u0005\u003a\u0002\u000f\u0002\u003a"+
"\u0001\u000f\u0001\u003a\u000c\u000f\u0001\u003a\u0001\u000f"+
"\u0005\u003a\u001d\u000f\u0001\u003a\u0001\u000f\u0001\u003a"+
"\u001b\u000f\u0001\u003a\u0001\u000f\u0001\u003a\uff81\u000f",
"",
"\u0001\u001d\u0002\uffff\u0001\u001d\u0020\uffff\u0001\u001e",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u002c\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u000a\u003c\u0007\uffff\u0006\u003c\u001a\uffff\u0006\u003c",
"",
"",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u0008\u003d\u0024\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u0008\u003e\u0024\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u002c\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\u001d\u002d\u0001\u0040"+
"\uff84\u002d",
"",
"\u0001\u0041\u0017\uffff\u0001\u0022\u0001\u0041\u000b\uffff"+
"\u0001\u0043\u0004\u0044\u0004\u0045\u0024\uffff\u0001\u0041"+
"\u0001\u0022\u0004\uffff\u0001\u0041\u0002\uffff\u0001\u0022"+
"\u0001\u0041\u0007\uffff\u0001\u0041\u0003\uffff\u0001\u0041"+
"\u0001\uffff\u0001\u0041\u0001\u0042",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\u000b\u002d\u0001\u0029"+
"\u0003\u002d\u0004\u0029\u0002\u002d\u0001\u0029\u0001\u002d"+
"\u0001\u0029\u0002\u002d\u0001\u0029\uff87\u002d",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\u000b\u002d\u0001\u0046"+
"\u0003\u002d\u0004\u0046\u0002\u002d\u0001\u0046\u0001\u002d"+
"\u0001\u0046\u0002\u002d\u0001\u0046\uff87\u002d",
"",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0038\uffa2\u004a",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\uffa2\u002d",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u002c\u0032"+
"\u0001\u0030\u0001\u002f\u001d\u0032\u0001\u004b\uff84\u0032",
"\u0000\u004c",
"\u0001\u004d\u0017\uffff\u0001\u0038\u0001\u004d\u000b\uffff"+
"\u0001\u0021\u0004\u004f\u0004\u0050\u0024\uffff\u0001\u004d"+
"\u0001\u0038\u0004\uffff\u0001\u004d\u0002\uffff\u0001\u0038"+
"\u0001\u004d\u0007\uffff\u0001\u004d\u0003\uffff\u0001\u004d"+
"\u0001\uffff\u0001\u004d\u0001\u004e",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0038\u000b\u004a\u0001\u0051\u0003\u004a"+
"\u0004\u0051\u0002\u004a\u0001\u0051\u0001\u004a\u0001\u0051"+
"\u0002\u004a\u0001\u0051\uff87\u004a",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u002c\u0032"+
"\u0001\u0030\u0001\u002f\uffa2\u0032",
"",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u002c\u0039\u0001\u0036\u001e\u0039\u0001\u0052\uff84\u0039",
"\u0069\u0054\u0001\u0053\u0003\u0054\u0004\u0053\u0002\u0054"+
"\u0001\u0053\u0001\u0054\u0001\u0053\u0002\u0054\u0001\u0053"+
"\uff87\u0054",
"\u0001\u0055\u0017\uffff\u0001\u0054\u0001\u0055\u000b\uffff"+
"\u0001\u004c\u0004\u0057\u0004\u0058\u0024\uffff\u0001\u0055"+
"\u0001\u0054\u0004\uffff\u0001\u0055\u0002\uffff\u0001\u0054"+
"\u0001\u0055\u0007\uffff\u0001\u0055\u0003\uffff\u0001\u0055"+
"\u0001\uffff\u0001\u0055\u0001\u0056",
"\u0000\u004c",
"",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u002c\u0039\u0001\u0036\uffa3\u0039",
"\u000a\u000f\u0001\uffff\u0002\u000f\u0001\uffff\u0013\u000f"+
"\u0001\u003a\u0001\u000f\u0005\u003a\u0002\u000f\u0002\u003a"+
"\u0001\u000f\u0001\u003a\u000c\u000f\u0001\u003a\u0001\u000f"+
"\u0005\u003a\u001d\u000f\u0001\u003a\u0001\u000f\u0001\u003a"+
"\u001b\u000f\u0001\u003a\u0001\u000f\u0001\u003a\uff81\u000f",
"\u0001\uffff",
"\u000a\u0059\u0007\uffff\u0006\u0059\u001a\uffff\u0006\u0059",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u0008\u005a\u0024\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u002c\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u0001\uffff",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\uffa2\u002d",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\uffa2\u002d",
"\u000a\u005c\u0007\uffff\u0006\u005c\u001a\uffff\u0006\u005c",
"",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u0008\u005d\u0024\u002d\u0001\u0028\u0001\u0027\uffa2\u002d",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u0008\u005e\u0024\u002d\u0001\u0028\u0001\u0027\uffa2\u002d",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\u000b\u002d\u0001\u0046"+
"\u0003\u002d\u0004\u0046\u0002\u002d\u0001\u0046\u0001\u002d"+
"\u0001\u0046\u0002\u002d\u0001\u0046\uff87\u002d",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\u001d\u004a\u0001\u0060\uff84\u004a",
"\u0001\u0062\u0017\uffff\u0001\u0061\u0001\u0062\u000b\uffff"+
"\u0001\u0043\u0004\u0064\u0004\u0065\u0024\uffff\u0001\u0062"+
"\u0001\u0061\u0004\uffff\u0001\u0062\u0002\uffff\u0001\u0061"+
"\u0001\u0062\u0007\uffff\u0001\u0062\u0003\uffff\u0001\u0062"+
"\u0001\uffff\u0001\u0062\u0001\u0063",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\u000b\u004a\u0001\u0066\u0003\u004a"+
"\u0004\u0066\u0002\u004a\u0001\u0066\u0001\u004a\u0001\u0066"+
"\u0002\u004a\u0001\u0066\uff87\u004a",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\uffa2\u004a",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u002c\u0032"+
"\u0001\u0030\u0001\u002f\uffa2\u0032",
"",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u002c\u0032"+
"\u0001\u0030\u0001\u002f\uffa2\u0032",
"\u000a\u0068\u0007\uffff\u0006\u0068\u001a\uffff\u0006\u0068",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u0008\u0069"+
"\u0024\u0032\u0001\u0030\u0001\u002f\uffa2\u0032",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u0008\u006a"+
"\u0024\u0032\u0001\u0030\u0001\u002f\uffa2\u0032",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\u000b\u004a\u0001\u0051\u0003\u004a"+
"\u0004\u0051\u0002\u004a\u0001\u0051\u0001\u004a\u0001\u0051"+
"\u0002\u004a\u0001\u0051\uff87\u004a",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u002c\u0039\u0001\u0036\uffa3\u0039",
"\u0023\u006d\u0001\u0054\u0045\u006d\u0001\u0053\u0003\u006d"+
"\u0004\u0053\u0002\u006d\u0001\u0053\u0001\u006d\u0001\u0053"+
"\u0002\u006d\u0001\u0053\uff87\u006d",
"",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u002c\u0039\u0001\u0036\uffa3\u0039",
"\u000a\u006e\u0007\uffff\u0006\u006e\u001a\uffff\u0006\u006e",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u0008\u006f\u0024\u0039\u0001\u0036\uffa3\u0039",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u0008\u0070\u0024\u0039\u0001\u0036\uffa3\u0039",
"\u000a\u0071\u0007\uffff\u0006\u0071\u001a\uffff\u0006\u0071",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u002c\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u0001\uffff",
"\u000a\u0072\u0007\uffff\u0006\u0072\u001a\uffff\u0006\u0072",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u0008\u0073\u0024\u002d\u0001\u0028\u0001\u0027\uffa2\u002d",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\uffa2\u002d",
"",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\uffa2\u004a",
"",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\uffa2\u004a",
"\u000a\u0075\u0007\uffff\u0006\u0075\u001a\uffff\u0006\u0075",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u0008\u0076"+
"\u0024\u004a\u0001\u0048\u0001\u0061\uffa2\u004a",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u0008\u0077"+
"\u0024\u004a\u0001\u0048\u0001\u0061\uffa2\u004a",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\u000b\u004a\u0001\u0066\u0003\u004a"+
"\u0004\u0066\u0002\u004a\u0001\u0066\u0001\u004a\u0001\u0066"+
"\u0002\u004a\u0001\u0066\uff87\u004a",
"\u0001\uffff",
"\u000a\u0078\u0007\uffff\u0006\u0078\u001a\uffff\u0006\u0078",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u0008\u0079"+
"\u0024\u0032\u0001\u0030\u0001\u002f\uffa2\u0032",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u002c\u0032"+
"\u0001\u0030\u0001\u002f\uffa2\u0032",
"\u0001\uffff",
"",
"",
"\u000a\u007a\u0007\uffff\u0006\u007a\u001a\uffff\u0006\u007a",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u0008\u007b\u0024\u0039\u0001\u0036\uffa3\u0039",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u002c\u0039\u0001\u0036\uffa3\u0039",
"\u000a\u007c\u0007\uffff\u0006\u007c\u001a\uffff\u0006\u007c",
"\u000a\u007d\u0007\uffff\u0006\u007d\u001a\uffff\u0006\u007d",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\uffa2\u002d",
"\u0001\uffff",
"\u000a\u007e\u0007\uffff\u0006\u007e\u001a\uffff\u0006\u007e",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u0008\u007f"+
"\u0024\u004a\u0001\u0048\u0001\u0061\uffa2\u004a",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\uffa2\u004a",
"\u000a\u0080\u0007\uffff\u0006\u0080\u001a\uffff\u0006\u0080",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u002c\u0032"+
"\u0001\u0030\u0001\u002f\uffa2\u0032",
"\u000a\u0081\u0007\uffff\u0006\u0081\u001a\uffff\u0006\u0081",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u002c\u0039\u0001\u0036\uffa3\u0039",
"\u0022\u0015\u0001\u0017\u0001\u0014\u000b\u0015\u0001\u0016"+
"\u002c\u0015\u0001\u0013\u0001\u0018\uffa2\u0015",
"\u000a\u0082\u0007\uffff\u0006\u0082\u001a\uffff\u0006\u0082",
"\u000a\u0083\u0007\uffff\u0006\u0083\u001a\uffff\u0006\u0083",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\uffa2\u004a",
"\u000a\u0084\u0007\uffff\u0006\u0084\u001a\uffff\u0006\u0084",
"\u000a\u0085\u0007\uffff\u0006\u0085\u001a\uffff\u0006\u0085",
"\u0022\u002d\u0001\u002c\u0001\u0026\u000b\u002d\u0001\u002a"+
"\u002c\u002d\u0001\u0028\u0001\u0027\uffa2\u002d",
"\u000a\u0086\u0007\uffff\u0006\u0086\u001a\uffff\u0006\u0086",
"\u0023\u0032\u0001\u002e\u000b\u0032\u0001\u0031\u002c\u0032"+
"\u0001\u0030\u0001\u002f\uffa2\u0032",
"\u0022\u0039\u0001\u0037\u0001\u0034\u000b\u0039\u0001\u0035"+
"\u002c\u0039\u0001\u0036\uffa3\u0039",
"\u0023\u004a\u0001\u0047\u000b\u004a\u0001\u0049\u002c\u004a"+
"\u0001\u0048\u0001\u0061\uffa2\u004a"
]
});
org.antlr.lang.augmentObject(iokeLexer, {
DFA55_eot:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA55_eotS),
DFA55_eof:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA55_eofS),
DFA55_min:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeLexer.DFA55_minS),
DFA55_max:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeLexer.DFA55_maxS),
DFA55_accept:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA55_acceptS),
DFA55_special:
org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA55_specialS),
DFA55_transition: (function() {
var a = [],
i,
numStates = iokeLexer.DFA55_transitionS.length;
for (i=0; i<numStates; i++) {
a.push(org.antlr.runtime.DFA.unpackEncodedString(iokeLexer.DFA55_transitionS[i]));
}
return a;
})()
});
iokeLexer.DFA55 = function(recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 55;
this.eot = iokeLexer.DFA55_eot;
this.eof = iokeLexer.DFA55_eof;
this.min = iokeLexer.DFA55_min;
this.max = iokeLexer.DFA55_max;
this.accept = iokeLexer.DFA55_accept;
this.special = iokeLexer.DFA55_special;
this.transition = iokeLexer.DFA55_transition;
};
org.antlr.lang.extend(iokeLexer.DFA55, org.antlr.runtime.DFA, {
getDescription: function() {
return "1:1: Tokens : ( T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | Identifier | DecimalLiteral | NumberLiteral | StringLiteral | RegexpLiteral | Terminator | Whitespace | LineComment | Comma );";
},
specialStateTransition: function(s, input) {
var _s = s;
/* bind to recognizer so semantic predicates can be evaluated */
var retval = (function(s, input) {
switch ( s ) {
case 0 :
var LA55_115 = input.LA(1);
var index55_115 = input.index();
input.rewind();
s = -1;
if ( (LA55_115=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_115==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_115=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_115=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( (LA55_115=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( ((LA55_115>='\u0000' && LA55_115<='!')||(LA55_115>='$' && LA55_115<='.')||(LA55_115>='0' && LA55_115<='[')||(LA55_115>='^' && LA55_115<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
input.seek(index55_115);
if ( s>=0 ) return s;
break;
case 1 :
var LA55_47 = input.LA(1);
var index55_47 = input.index();
input.rewind();
s = -1;
if ( ((LA55_47>='\u0000' && LA55_47<='\uFFFF')) && ((this.isRegexpInterpolating()))) {s = 76;}
else s = 56;
input.seek(index55_47);
if ( s>=0 ) return s;
break;
case 2 :
var LA55_50 = input.LA(1);
var index55_50 = input.index();
input.rewind();
s = -1;
if ( (LA55_50=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_50==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( (LA55_50=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_50=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( ((LA55_50>='\u0000' && LA55_50<='\"')||(LA55_50>='$' && LA55_50<='.')||(LA55_50>='0' && LA55_50<='[')||(LA55_50>='^' && LA55_50<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
input.seek(index55_50);
if ( s>=0 ) return s;
break;
case 3 :
var LA55_124 = input.LA(1);
var index55_124 = input.index();
input.rewind();
s = -1;
if ( (LA55_124=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_124==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( (LA55_124=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_124=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( (LA55_124=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( ((LA55_124>='\u0000' && LA55_124<='!')||(LA55_124>='$' && LA55_124<='.')||(LA55_124>='0' && LA55_124<='[')||(LA55_124>='^' && LA55_124<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index55_124);
if ( s>=0 ) return s;
break;
case 4 :
var LA55_99 = input.LA(1);
var index55_99 = input.index();
input.rewind();
s = -1;
if ( ((LA55_99>='0' && LA55_99<='9')||(LA55_99>='A' && LA55_99<='F')||(LA55_99>='a' && LA55_99<='f')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 117;}
input.seek(index55_99);
if ( s>=0 ) return s;
break;
case 5 :
var LA55_86 = input.LA(1);
var index55_86 = input.index();
input.rewind();
s = -1;
if ( ((LA55_86>='0' && LA55_86<='9')||(LA55_86>='A' && LA55_86<='F')||(LA55_86>='a' && LA55_86<='f')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 110;}
input.seek(index55_86);
if ( s>=0 ) return s;
break;
case 6 :
var LA55_68 = input.LA(1);
var index55_68 = input.index();
input.rewind();
s = -1;
if ( ((LA55_68>='0' && LA55_68<='7')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 93;}
else if ( (LA55_68=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_68=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( (LA55_68=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_68==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_68=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( ((LA55_68>='\u0000' && LA55_68<='!')||(LA55_68>='$' && LA55_68<='.')||(LA55_68>='8' && LA55_68<='[')||(LA55_68>='^' && LA55_68<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
input.seek(index55_68);
if ( s>=0 ) return s;
break;
case 7 :
var LA55_71 = input.LA(1);
var index55_71 = input.index();
input.rewind();
s = -1;
if ( (LA55_71=='{') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 96;}
else if ( (LA55_71=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_71==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_71=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_71=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_71>='\u0000' && LA55_71<='\"')||(LA55_71>='$' && LA55_71<='.')||(LA55_71>='0' && LA55_71<='[')||(LA55_71>='^' && LA55_71<='z')||(LA55_71>='|' && LA55_71<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
input.seek(index55_71);
if ( s>=0 ) return s;
break;
case 8 :
var LA55_94 = input.LA(1);
var index55_94 = input.index();
input.rewind();
s = -1;
if ( (LA55_94=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_94==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_94=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_94=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( (LA55_94=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( ((LA55_94>='\u0000' && LA55_94<='!')||(LA55_94>='$' && LA55_94<='.')||(LA55_94>='0' && LA55_94<='[')||(LA55_94>='^' && LA55_94<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
input.seek(index55_94);
if ( s>=0 ) return s;
break;
case 9 :
var LA55_36 = input.LA(1);
var index55_36 = input.index();
input.rewind();
s = -1;
if ( (LA55_36=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_36=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( (LA55_36=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_36=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( ((LA55_36>='0' && LA55_36<='7')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 62;}
else if ( (LA55_36==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( ((LA55_36>='\u0000' && LA55_36<='!')||(LA55_36>='$' && LA55_36<='.')||(LA55_36>='8' && LA55_36<='[')||(LA55_36>='^' && LA55_36<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index55_36);
if ( s>=0 ) return s;
break;
case 10 :
var LA55_73 = input.LA(1);
var index55_73 = input.index();
input.rewind();
s = -1;
if ( (LA55_73=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_73==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_73=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_73=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( (LA55_73=='i'||(LA55_73>='m' && LA55_73<='p')||LA55_73=='s'||LA55_73=='u'||LA55_73=='x') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 102;}
else if ( ((LA55_73>='\u0000' && LA55_73<='\"')||(LA55_73>='$' && LA55_73<='.')||(LA55_73>='0' && LA55_73<='[')||(LA55_73>='^' && LA55_73<='h')||(LA55_73>='j' && LA55_73<='l')||(LA55_73>='q' && LA55_73<='r')||LA55_73=='t'||(LA55_73>='v' && LA55_73<='w')||(LA55_73>='y' && LA55_73<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
else s = 95;
input.seek(index55_73);
if ( s>=0 ) return s;
break;
case 11 :
var LA55_118 = input.LA(1);
var index55_118 = input.index();
input.rewind();
s = -1;
if ( (LA55_118=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_118==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_118=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_118=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_118>='0' && LA55_118<='7')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 127;}
else if ( ((LA55_118>='\u0000' && LA55_118<='\"')||(LA55_118>='$' && LA55_118<='.')||(LA55_118>='8' && LA55_118<='[')||(LA55_118>='^' && LA55_118<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
input.seek(index55_118);
if ( s>=0 ) return s;
break;
case 12 :
var LA55_37 = input.LA(1);
var index55_37 = input.index();
input.rewind();
s = -1;
if ( (LA55_37=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_37==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( (LA55_37=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_37=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( (LA55_37=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( ((LA55_37>='\u0000' && LA55_37<='!')||(LA55_37>='$' && LA55_37<='.')||(LA55_37>='0' && LA55_37<='[')||(LA55_37>='^' && LA55_37<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
else s = 63;
input.seek(index55_37);
if ( s>=0 ) return s;
break;
case 13 :
var LA55_32 = input.LA(1);
var index55_32 = input.index();
input.rewind();
s = -1;
if ( ((LA55_32>='0' && LA55_32<='9')||(LA55_32>='A' && LA55_32<='F')||(LA55_32>='a' && LA55_32<='f')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 60;}
input.seek(index55_32);
if ( s>=0 ) return s;
break;
case 14 :
var LA55_96 = input.LA(1);
var index55_96 = input.index();
input.rewind();
s = -1;
if ( (LA55_96=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_96==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_96=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_96=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_96>='\u0000' && LA55_96<='\"')||(LA55_96>='$' && LA55_96<='.')||(LA55_96>='0' && LA55_96<='[')||(LA55_96>='^' && LA55_96<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
else s = 116;
input.seek(index55_96);
if ( s>=0 ) return s;
break;
case 15 :
var LA55_22 = input.LA(1);
var index55_22 = input.index();
input.rewind();
s = -1;
if ( (LA55_22=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_22==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_22=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_22=='i'||(LA55_22>='m' && LA55_22<='p')||LA55_22=='s'||LA55_22=='u'||LA55_22=='x') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 41;}
else if ( (LA55_22=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( (LA55_22=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( ((LA55_22>='\u0000' && LA55_22<='!')||(LA55_22>='$' && LA55_22<='.')||(LA55_22>='0' && LA55_22<='[')||(LA55_22>='^' && LA55_22<='h')||(LA55_22>='j' && LA55_22<='l')||(LA55_22>='q' && LA55_22<='r')||LA55_22=='t'||(LA55_22>='v' && LA55_22<='w')||(LA55_22>='y' && LA55_22<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
else s = 43;
input.seek(index55_22);
if ( s>=0 ) return s;
break;
case 16 :
var LA55_40 = input.LA(1);
var index55_40 = input.index();
input.rewind();
s = -1;
if ( (LA55_40=='\n'||LA55_40=='#'||LA55_40=='\\'||LA55_40=='b'||LA55_40=='f'||LA55_40=='n'||LA55_40=='r'||LA55_40=='t') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 65;}
else if ( (LA55_40=='u') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 66;}
else if ( (LA55_40=='\"'||LA55_40==']'||LA55_40=='e') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 34;}
else if ( (LA55_40=='/') && ((this.isAltRegexpInterpolating()))) {s = 67;}
else if ( ((LA55_40>='0' && LA55_40<='3')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 68;}
else if ( ((LA55_40>='4' && LA55_40<='7')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 69;}
input.seek(index55_40);
if ( s>=0 ) return s;
break;
case 17 :
var LA55_24 = input.LA(1);
var index55_24 = input.index();
input.rewind();
s = -1;
if ( (LA55_24=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_24=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( (LA55_24=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_24=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( ((LA55_24>='\u0000' && LA55_24<='!')||(LA55_24>='$' && LA55_24<='.')||(LA55_24>='0' && LA55_24<='[')||(LA55_24>=']' && LA55_24<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
else s = 56;
input.seek(index55_24);
if ( s>=0 ) return s;
break;
case 18 :
var LA55_70 = input.LA(1);
var index55_70 = input.index();
input.rewind();
s = -1;
if ( (LA55_70=='i'||(LA55_70>='m' && LA55_70<='p')||LA55_70=='s'||LA55_70=='u'||LA55_70=='x') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 70;}
else if ( (LA55_70=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_70==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_70=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_70=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( (LA55_70=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( ((LA55_70>='\u0000' && LA55_70<='!')||(LA55_70>='$' && LA55_70<='.')||(LA55_70>='0' && LA55_70<='[')||(LA55_70>='^' && LA55_70<='h')||(LA55_70>='j' && LA55_70<='l')||(LA55_70>='q' && LA55_70<='r')||LA55_70=='t'||(LA55_70>='v' && LA55_70<='w')||(LA55_70>='y' && LA55_70<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
else s = 95;
input.seek(index55_70);
if ( s>=0 ) return s;
break;
case 19 :
var LA55_112 = input.LA(1);
var index55_112 = input.index();
input.rewind();
s = -1;
if ( (LA55_112=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_112=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( (LA55_112=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_112=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( ((LA55_112>='\u0000' && LA55_112<='!')||(LA55_112>='$' && LA55_112<='.')||(LA55_112>='0' && LA55_112<='[')||(LA55_112>=']' && LA55_112<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
input.seek(index55_112);
if ( s>=0 ) return s;
break;
case 20 :
var LA55_65 = input.LA(1);
var index55_65 = input.index();
input.rewind();
s = -1;
if ( (LA55_65=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_65=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( (LA55_65=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_65==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_65=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( ((LA55_65>='\u0000' && LA55_65<='!')||(LA55_65>='$' && LA55_65<='.')||(LA55_65>='0' && LA55_65<='[')||(LA55_65>='^' && LA55_65<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
input.seek(index55_65);
if ( s>=0 ) return s;
break;
case 21 :
var LA55_127 = input.LA(1);
var index55_127 = input.index();
input.rewind();
s = -1;
if ( (LA55_127=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_127==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_127=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_127=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_127>='\u0000' && LA55_127<='\"')||(LA55_127>='$' && LA55_127<='.')||(LA55_127>='0' && LA55_127<='[')||(LA55_127>='^' && LA55_127<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
input.seek(index55_127);
if ( s>=0 ) return s;
break;
case 22 :
var LA55_116 = input.LA(1);
var index55_116 = input.index();
input.rewind();
s = -1;
if ( ((this.isAltInterpolating())) ) {s = 109;}
else if ( ((this.isAltRegexpInterpolating())) ) {s = 108;}
input.seek(index55_116);
if ( s>=0 ) return s;
break;
case 23 :
var LA55_107 = input.LA(1);
var index55_107 = input.index();
input.rewind();
s = -1;
if ( ((this.isInterpolating())) ) {s = 109;}
else if ( ((this.isRegexpInterpolating())) ) {s = 108;}
input.seek(index55_107);
if ( s>=0 ) return s;
break;
case 24 :
var LA55_113 = input.LA(1);
var index55_113 = input.index();
input.rewind();
s = -1;
if ( ((LA55_113>='0' && LA55_113<='9')||(LA55_113>='A' && LA55_113<='F')||(LA55_113>='a' && LA55_113<='f')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 124;}
input.seek(index55_113);
if ( s>=0 ) return s;
break;
case 25 :
var LA55_59 = input.LA(1);
var index55_59 = input.index();
input.rewind();
s = -1;
if ( (!((((this.input.LA(2) != '.'))))) ) {s = 8;}
else if ( (((this.input.LA(2) != '.'))) ) {s = 29;}
input.seek(index55_59);
if ( s>=0 ) return s;
break;
case 26 :
var LA55_42 = input.LA(1);
var index55_42 = input.index();
input.rewind();
s = -1;
if ( (LA55_42=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_42==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_42=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_42=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( (LA55_42=='i'||(LA55_42>='m' && LA55_42<='p')||LA55_42=='s'||LA55_42=='u'||LA55_42=='x') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 70;}
else if ( (LA55_42=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( ((LA55_42>='\u0000' && LA55_42<='!')||(LA55_42>='$' && LA55_42<='.')||(LA55_42>='0' && LA55_42<='[')||(LA55_42>='^' && LA55_42<='h')||(LA55_42>='j' && LA55_42<='l')||(LA55_42>='q' && LA55_42<='r')||LA55_42=='t'||(LA55_42>='v' && LA55_42<='w')||(LA55_42>='y' && LA55_42<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
else s = 67;
input.seek(index55_42);
if ( s>=0 ) return s;
break;
case 27 :
var LA55_52 = input.LA(1);
var index55_52 = input.index();
input.rewind();
s = -1;
if ( (LA55_52=='{') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 82;}
else if ( (LA55_52=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_52=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( (LA55_52=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_52=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( ((LA55_52>='\u0000' && LA55_52<='!')||(LA55_52>='$' && LA55_52<='.')||(LA55_52>='0' && LA55_52<='[')||(LA55_52>=']' && LA55_52<='z')||(LA55_52>='|' && LA55_52<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
input.seek(index55_52);
if ( s>=0 ) return s;
break;
case 28 :
var LA55_31 = input.LA(1);
var index55_31 = input.index();
input.rewind();
s = -1;
if ( (LA55_31=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_31=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( (LA55_31=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_31==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( (LA55_31=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( ((LA55_31>='\u0000' && LA55_31<='!')||(LA55_31>='$' && LA55_31<='.')||(LA55_31>='0' && LA55_31<='[')||(LA55_31>='^' && LA55_31<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index55_31);
if ( s>=0 ) return s;
break;
case 29 :
var LA55_6 = input.LA(1);
var index55_6 = input.index();
input.rewind();
s = -1;
if ( (LA55_6=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_6=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( ((LA55_6>='\u0000' && LA55_6<='!')||(LA55_6>='$' && LA55_6<='.')||(LA55_6>='0' && LA55_6<='[')||(LA55_6>='^' && LA55_6<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
else if ( (LA55_6=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( (LA55_6=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( (LA55_6==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else s = 25;
input.seek(index55_6);
if ( s>=0 ) return s;
break;
case 30 :
var LA55_48 = input.LA(1);
var index55_48 = input.index();
input.rewind();
s = -1;
if ( (LA55_48=='\n'||LA55_48=='#'||LA55_48=='\\'||LA55_48=='b'||LA55_48=='f'||LA55_48=='n'||LA55_48=='r'||LA55_48=='t') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 77;}
else if ( (LA55_48=='u') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 78;}
else if ( (LA55_48=='\"'||LA55_48==']'||LA55_48=='e') && ((this.isAltInterpolating()))) {s = 56;}
else if ( (LA55_48=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 33;}
else if ( ((LA55_48>='0' && LA55_48<='3')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 79;}
else if ( ((LA55_48>='4' && LA55_48<='7')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 80;}
input.seek(index55_48);
if ( s>=0 ) return s;
break;
case 31 :
var LA55_102 = input.LA(1);
var index55_102 = input.index();
input.rewind();
s = -1;
if ( (LA55_102=='i'||(LA55_102>='m' && LA55_102<='p')||LA55_102=='s'||LA55_102=='u'||LA55_102=='x') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 102;}
else if ( (LA55_102=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_102==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_102=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_102=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_102>='\u0000' && LA55_102<='\"')||(LA55_102>='$' && LA55_102<='.')||(LA55_102>='0' && LA55_102<='[')||(LA55_102>='^' && LA55_102<='h')||(LA55_102>='j' && LA55_102<='l')||(LA55_102>='q' && LA55_102<='r')||LA55_102=='t'||(LA55_102>='v' && LA55_102<='w')||(LA55_102>='y' && LA55_102<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
else s = 95;
input.seek(index55_102);
if ( s>=0 ) return s;
break;
case 32 :
var LA55_64 = input.LA(1);
var index55_64 = input.index();
input.rewind();
s = -1;
if ( (LA55_64=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_64==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_64=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_64=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( (LA55_64=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( ((LA55_64>='\u0000' && LA55_64<='!')||(LA55_64>='$' && LA55_64<='.')||(LA55_64>='0' && LA55_64<='[')||(LA55_64>='^' && LA55_64<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
else s = 91;
input.seek(index55_64);
if ( s>=0 ) return s;
break;
case 33 :
var LA55_53 = input.LA(1);
var index55_53 = input.index();
input.rewind();
s = -1;
if ( (LA55_53=='i'||(LA55_53>='m' && LA55_53<='p')||LA55_53=='s'||LA55_53=='u'||LA55_53=='x') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 83;}
else if ( ((LA55_53>='\u0000' && LA55_53<='h')||(LA55_53>='j' && LA55_53<='l')||(LA55_53>='q' && LA55_53<='r')||LA55_53=='t'||(LA55_53>='v' && LA55_53<='w')||(LA55_53>='y' && LA55_53<='\uFFFF')) && ((this.isInterpolating()))) {s = 84;}
else s = 76;
input.seek(index55_53);
if ( s>=0 ) return s;
break;
case 34 :
var LA55_57 = input.LA(1);
var index55_57 = input.index();
input.rewind();
s = -1;
if ( (LA55_57=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_57=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( (LA55_57=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_57=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( ((LA55_57>='\u0000' && LA55_57<='!')||(LA55_57>='$' && LA55_57<='.')||(LA55_57>='0' && LA55_57<='[')||(LA55_57>=']' && LA55_57<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
input.seek(index55_57);
if ( s>=0 ) return s;
break;
case 35 :
var LA55_89 = input.LA(1);
var index55_89 = input.index();
input.rewind();
s = -1;
if ( ((LA55_89>='0' && LA55_89<='9')||(LA55_89>='A' && LA55_89<='F')||(LA55_89>='a' && LA55_89<='f')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 113;}
input.seek(index55_89);
if ( s>=0 ) return s;
break;
case 36 :
var LA55_41 = input.LA(1);
var index55_41 = input.index();
input.rewind();
s = -1;
if ( (LA55_41=='i'||(LA55_41>='m' && LA55_41<='p')||LA55_41=='s'||LA55_41=='u'||LA55_41=='x') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 41;}
else if ( (LA55_41=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_41==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_41=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_41=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( (LA55_41=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( ((LA55_41>='\u0000' && LA55_41<='!')||(LA55_41>='$' && LA55_41<='.')||(LA55_41>='0' && LA55_41<='[')||(LA55_41>='^' && LA55_41<='h')||(LA55_41>='j' && LA55_41<='l')||(LA55_41>='q' && LA55_41<='r')||LA55_41=='t'||(LA55_41>='v' && LA55_41<='w')||(LA55_41>='y' && LA55_41<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
else s = 43;
input.seek(index55_41);
if ( s>=0 ) return s;
break;
case 37 :
var LA55_134 = input.LA(1);
var index55_134 = input.index();
input.rewind();
s = -1;
if ( (LA55_134=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_134==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_134=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_134=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_134>='\u0000' && LA55_134<='\"')||(LA55_134>='$' && LA55_134<='.')||(LA55_134>='0' && LA55_134<='[')||(LA55_134>='^' && LA55_134<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
input.seek(index55_134);
if ( s>=0 ) return s;
break;
case 38 :
var LA55_123 = input.LA(1);
var index55_123 = input.index();
input.rewind();
s = -1;
if ( (LA55_123=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_123=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( (LA55_123=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_123=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( ((LA55_123>='\u0000' && LA55_123<='!')||(LA55_123>='$' && LA55_123<='.')||(LA55_123>='0' && LA55_123<='[')||(LA55_123>=']' && LA55_123<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
input.seek(index55_123);
if ( s>=0 ) return s;
break;
case 39 :
var LA55_9 = input.LA(1);
var index55_9 = input.index();
input.rewind();
s = -1;
if ( (LA55_9=='.') ) {s = 30;}
else s = 29;
input.seek(index55_9);
if ( s>=0 ) return s;
break;
case 40 :
var LA55_69 = input.LA(1);
var index55_69 = input.index();
input.rewind();
s = -1;
if ( (LA55_69=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_69=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( (LA55_69=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( ((LA55_69>='0' && LA55_69<='7')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 94;}
else if ( (LA55_69==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_69=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( ((LA55_69>='\u0000' && LA55_69<='!')||(LA55_69>='$' && LA55_69<='.')||(LA55_69>='8' && LA55_69<='[')||(LA55_69>='^' && LA55_69<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
input.seek(index55_69);
if ( s>=0 ) return s;
break;
case 41 :
var LA55_20 = input.LA(1);
var index55_20 = input.index();
input.rewind();
s = -1;
if ( (LA55_20=='{') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 37;}
else if ( (LA55_20=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_20==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( (LA55_20=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_20=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( (LA55_20=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( ((LA55_20>='\u0000' && LA55_20<='!')||(LA55_20>='$' && LA55_20<='.')||(LA55_20>='0' && LA55_20<='[')||(LA55_20>='^' && LA55_20<='z')||(LA55_20>='|' && LA55_20<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index55_20);
if ( s>=0 ) return s;
break;
case 42 :
var LA55_60 = input.LA(1);
var index55_60 = input.index();
input.rewind();
s = -1;
if ( ((LA55_60>='0' && LA55_60<='9')||(LA55_60>='A' && LA55_60<='F')||(LA55_60>='a' && LA55_60<='f')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 89;}
input.seek(index55_60);
if ( s>=0 ) return s;
break;
case 43 :
var LA55_119 = input.LA(1);
var index55_119 = input.index();
input.rewind();
s = -1;
if ( (LA55_119=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_119==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_119=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_119=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_119>='\u0000' && LA55_119<='\"')||(LA55_119>='$' && LA55_119<='.')||(LA55_119>='0' && LA55_119<='[')||(LA55_119>='^' && LA55_119<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
input.seek(index55_119);
if ( s>=0 ) return s;
break;
case 44 :
var LA55_61 = input.LA(1);
var index55_61 = input.index();
input.rewind();
s = -1;
if ( (LA55_61=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_61==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( (LA55_61=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_61=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( (LA55_61=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( ((LA55_61>='0' && LA55_61<='7')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 90;}
else if ( ((LA55_61>='\u0000' && LA55_61<='!')||(LA55_61>='$' && LA55_61<='.')||(LA55_61>='8' && LA55_61<='[')||(LA55_61>='^' && LA55_61<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index55_61);
if ( s>=0 ) return s;
break;
case 45 :
var LA55_85 = input.LA(1);
var index55_85 = input.index();
input.rewind();
s = -1;
if ( (LA55_85=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_85=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( (LA55_85=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_85=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( ((LA55_85>='\u0000' && LA55_85<='!')||(LA55_85>='$' && LA55_85<='.')||(LA55_85>='0' && LA55_85<='[')||(LA55_85>=']' && LA55_85<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
input.seek(index55_85);
if ( s>=0 ) return s;
break;
case 46 :
var LA55_79 = input.LA(1);
var index55_79 = input.index();
input.rewind();
s = -1;
if ( ((LA55_79>='0' && LA55_79<='7')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 105;}
else if ( (LA55_79=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_79=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( (LA55_79=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_79==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( ((LA55_79>='\u0000' && LA55_79<='\"')||(LA55_79>='$' && LA55_79<='.')||(LA55_79>='8' && LA55_79<='[')||(LA55_79>='^' && LA55_79<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
input.seek(index55_79);
if ( s>=0 ) return s;
break;
case 47 :
var LA55_81 = input.LA(1);
var index55_81 = input.index();
input.rewind();
s = -1;
if ( (LA55_81=='i'||(LA55_81>='m' && LA55_81<='p')||LA55_81=='s'||LA55_81=='u'||LA55_81=='x') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 81;}
else if ( (LA55_81=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_81==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_81=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_81=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_81>='\u0000' && LA55_81<='\"')||(LA55_81>='$' && LA55_81<='.')||(LA55_81>='0' && LA55_81<='[')||(LA55_81>='^' && LA55_81<='h')||(LA55_81>='j' && LA55_81<='l')||(LA55_81>='q' && LA55_81<='r')||LA55_81=='t'||(LA55_81>='v' && LA55_81<='w')||(LA55_81>='y' && LA55_81<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
else s = 43;
input.seek(index55_81);
if ( s>=0 ) return s;
break;
case 48 :
var LA55_121 = input.LA(1);
var index55_121 = input.index();
input.rewind();
s = -1;
if ( (LA55_121=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_121==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( (LA55_121=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_121=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( ((LA55_121>='\u0000' && LA55_121<='\"')||(LA55_121>='$' && LA55_121<='.')||(LA55_121>='0' && LA55_121<='[')||(LA55_121>='^' && LA55_121<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
input.seek(index55_121);
if ( s>=0 ) return s;
break;
case 49 :
var LA55_133 = input.LA(1);
var index55_133 = input.index();
input.rewind();
s = -1;
if ( (LA55_133=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_133=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( (LA55_133=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_133=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( ((LA55_133>='\u0000' && LA55_133<='!')||(LA55_133>='$' && LA55_133<='.')||(LA55_133>='0' && LA55_133<='[')||(LA55_133>=']' && LA55_133<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
input.seek(index55_133);
if ( s>=0 ) return s;
break;
case 50 :
var LA55_63 = input.LA(1);
var index55_63 = input.index();
input.rewind();
s = -1;
if ( (((this.isAltInterpolating())||(this.isInterpolating()))) ) {s = 84;}
else if ( (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating()))) ) {s = 76;}
input.seek(index55_63);
if ( s>=0 ) return s;
break;
case 51 :
var LA55_30 = input.LA(1);
var index55_30 = input.index();
input.rewind();
s = -1;
if ( (LA55_30=='.') ) {s = 30;}
else if ( (LA55_30=='\n'||LA55_30=='\r') && (((this.input.LA(2) != '.')))) {s = 29;}
else s = 59;
input.seek(index55_30);
if ( s>=0 ) return s;
break;
case 52 :
var LA55_49 = input.LA(1);
var index55_49 = input.index();
input.rewind();
s = -1;
if ( (LA55_49=='i'||(LA55_49>='m' && LA55_49<='p')||LA55_49=='s'||LA55_49=='u'||LA55_49=='x') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 81;}
else if ( (LA55_49=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_49==']') && ((this.isAltInterpolating()))) {s = 56;}
else if ( (LA55_49=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_49=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_49>='\u0000' && LA55_49<='\"')||(LA55_49>='$' && LA55_49<='.')||(LA55_49>='0' && LA55_49<='[')||(LA55_49>='^' && LA55_49<='h')||(LA55_49>='j' && LA55_49<='l')||(LA55_49>='q' && LA55_49<='r')||LA55_49=='t'||(LA55_49>='v' && LA55_49<='w')||(LA55_49>='y' && LA55_49<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
else s = 43;
input.seek(index55_49);
if ( s>=0 ) return s;
break;
case 53 :
var LA55_74 = input.LA(1);
var index55_74 = input.index();
input.rewind();
s = -1;
if ( (LA55_74=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_74==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_74=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_74=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_74>='\u0000' && LA55_74<='\"')||(LA55_74>='$' && LA55_74<='.')||(LA55_74>='0' && LA55_74<='[')||(LA55_74>='^' && LA55_74<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
input.seek(index55_74);
if ( s>=0 ) return s;
break;
case 54 :
var LA55_58 = input.LA(1);
s = -1;
if ( (LA55_58=='!'||(LA55_58>='#' && LA55_58<='\'')||(LA55_58>='*' && LA55_58<='+')||LA55_58=='-'||LA55_58==':'||(LA55_58>='<' && LA55_58<='@')||LA55_58=='^'||LA55_58=='`'||LA55_58=='|'||LA55_58=='~') ) {s = 58;}
else if ( ((LA55_58>='\u0000' && LA55_58<='\t')||(LA55_58>='\u000B' && LA55_58<='\f')||(LA55_58>='\u000E' && LA55_58<=' ')||LA55_58=='\"'||(LA55_58>='(' && LA55_58<=')')||LA55_58==','||(LA55_58>='.' && LA55_58<='9')||LA55_58==';'||(LA55_58>='A' && LA55_58<=']')||LA55_58=='_'||(LA55_58>='a' && LA55_58<='{')||LA55_58=='}'||(LA55_58>='\u007F' && LA55_58<='\uFFFF')) ) {s = 15;}
else s = 8;
if ( s>=0 ) return s;
break;
case 55 :
var LA55_106 = input.LA(1);
var index55_106 = input.index();
input.rewind();
s = -1;
if ( (LA55_106=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_106==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( (LA55_106=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_106=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( ((LA55_106>='\u0000' && LA55_106<='\"')||(LA55_106>='$' && LA55_106<='.')||(LA55_106>='0' && LA55_106<='[')||(LA55_106>='^' && LA55_106<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
input.seek(index55_106);
if ( s>=0 ) return s;
break;
case 56 :
var LA55_131 = input.LA(1);
var index55_131 = input.index();
input.rewind();
s = -1;
if ( ((LA55_131>='0' && LA55_131<='9')||(LA55_131>='A' && LA55_131<='F')||(LA55_131>='a' && LA55_131<='f')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 134;}
input.seek(index55_131);
if ( s>=0 ) return s;
break;
case 57 :
var LA55_129 = input.LA(1);
var index55_129 = input.index();
input.rewind();
s = -1;
if ( ((LA55_129>='0' && LA55_129<='9')||(LA55_129>='A' && LA55_129<='F')||(LA55_129>='a' && LA55_129<='f')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 133;}
input.seek(index55_129);
if ( s>=0 ) return s;
break;
case 58 :
var LA55_44 = input.LA(1);
var index55_44 = input.index();
input.rewind();
s = -1;
if ( (LA55_44=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_44==']') && ((this.isAltInterpolating()))) {s = 56;}
else if ( (LA55_44=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_44=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_44>='\u0000' && LA55_44<='\"')||(LA55_44>='$' && LA55_44<='.')||(LA55_44>='0' && LA55_44<='[')||(LA55_44>='^' && LA55_44<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
else s = 51;
input.seek(index55_44);
if ( s>=0 ) return s;
break;
case 59 :
var LA55_28 = input.LA(1);
s = -1;
if ( (LA55_28=='!'||(LA55_28>='#' && LA55_28<='\'')||(LA55_28>='*' && LA55_28<='+')||LA55_28=='-'||LA55_28==':'||(LA55_28>='<' && LA55_28<='@')||LA55_28=='^'||LA55_28=='`'||LA55_28=='|'||LA55_28=='~') ) {s = 58;}
else if ( ((LA55_28>='\u0000' && LA55_28<='\t')||(LA55_28>='\u000B' && LA55_28<='\f')||(LA55_28>='\u000E' && LA55_28<=' ')||LA55_28=='\"'||(LA55_28>='(' && LA55_28<=')')||LA55_28==','||(LA55_28>='.' && LA55_28<='9')||LA55_28==';'||(LA55_28>='A' && LA55_28<=']')||LA55_28=='_'||(LA55_28>='a' && LA55_28<='{')||LA55_28=='}'||(LA55_28>='\u007F' && LA55_28<='\uFFFF')) ) {s = 15;}
else s = 8;
if ( s>=0 ) return s;
break;
case 60 :
var LA55_90 = input.LA(1);
var index55_90 = input.index();
input.rewind();
s = -1;
if ( (LA55_90=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_90==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( (LA55_90=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_90=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( (LA55_90=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( ((LA55_90>='\u0000' && LA55_90<='!')||(LA55_90>='$' && LA55_90<='.')||(LA55_90>='0' && LA55_90<='[')||(LA55_90>='^' && LA55_90<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index55_90);
if ( s>=0 ) return s;
break;
case 61 :
var LA55_19 = input.LA(1);
var index55_19 = input.index();
input.rewind();
s = -1;
if ( (LA55_19=='\n'||LA55_19=='#'||LA55_19=='\\'||LA55_19=='b'||LA55_19=='f'||LA55_19=='n'||LA55_19=='r'||LA55_19=='t') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 31;}
else if ( (LA55_19=='u') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 32;}
else if ( (LA55_19=='/') && (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 33;}
else if ( (LA55_19=='\"'||LA55_19==']'||LA55_19=='e') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 34;}
else if ( ((LA55_19>='0' && LA55_19<='3')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 35;}
else if ( ((LA55_19>='4' && LA55_19<='7')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 36;}
input.seek(index55_19);
if ( s>=0 ) return s;
break;
case 62 :
var LA55_130 = input.LA(1);
var index55_130 = input.index();
input.rewind();
s = -1;
if ( (LA55_130=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_130==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_130=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_130=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( (LA55_130=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( ((LA55_130>='\u0000' && LA55_130<='!')||(LA55_130>='$' && LA55_130<='.')||(LA55_130>='0' && LA55_130<='[')||(LA55_130>='^' && LA55_130<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
input.seek(index55_130);
if ( s>=0 ) return s;
break;
case 63 :
var LA55_66 = input.LA(1);
var index55_66 = input.index();
input.rewind();
s = -1;
if ( ((LA55_66>='0' && LA55_66<='9')||(LA55_66>='A' && LA55_66<='F')||(LA55_66>='a' && LA55_66<='f')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 92;}
input.seek(index55_66);
if ( s>=0 ) return s;
break;
case 64 :
var LA55_126 = input.LA(1);
var index55_126 = input.index();
input.rewind();
s = -1;
if ( ((LA55_126>='0' && LA55_126<='9')||(LA55_126>='A' && LA55_126<='F')||(LA55_126>='a' && LA55_126<='f')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 131;}
input.seek(index55_126);
if ( s>=0 ) return s;
break;
case 65 :
var LA55_122 = input.LA(1);
var index55_122 = input.index();
input.rewind();
s = -1;
if ( ((LA55_122>='0' && LA55_122<='9')||(LA55_122>='A' && LA55_122<='F')||(LA55_122>='a' && LA55_122<='f')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 129;}
input.seek(index55_122);
if ( s>=0 ) return s;
break;
case 66 :
var LA55_103 = input.LA(1);
var index55_103 = input.index();
input.rewind();
s = -1;
if ( ((this.isAltInterpolating())) ) {s = 109;}
else if ( (((this.isRegexpInterpolating())||(this.isAltRegexpInterpolating()))) ) {s = 108;}
input.seek(index55_103);
if ( s>=0 ) return s;
break;
case 67 :
var LA55_78 = input.LA(1);
var index55_78 = input.index();
input.rewind();
s = -1;
if ( ((LA55_78>='0' && LA55_78<='9')||(LA55_78>='A' && LA55_78<='F')||(LA55_78>='a' && LA55_78<='f')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 104;}
input.seek(index55_78);
if ( s>=0 ) return s;
break;
case 68 :
var LA55_91 = input.LA(1);
var index55_91 = input.index();
input.rewind();
s = -1;
if ( (((this.isAltInterpolating())||(this.isInterpolating()))) ) {s = 109;}
else if ( ((this.isAltRegexpInterpolating())) ) {s = 108;}
input.seek(index55_91);
if ( s>=0 ) return s;
break;
case 69 :
var LA55_117 = input.LA(1);
var index55_117 = input.index();
input.rewind();
s = -1;
if ( ((LA55_117>='0' && LA55_117<='9')||(LA55_117>='A' && LA55_117<='F')||(LA55_117>='a' && LA55_117<='f')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 126;}
input.seek(index55_117);
if ( s>=0 ) return s;
break;
case 70 :
var LA55_110 = input.LA(1);
var index55_110 = input.index();
input.rewind();
s = -1;
if ( ((LA55_110>='0' && LA55_110<='9')||(LA55_110>='A' && LA55_110<='F')||(LA55_110>='a' && LA55_110<='f')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 122;}
input.seek(index55_110);
if ( s>=0 ) return s;
break;
case 71 :
var LA55_75 = input.LA(1);
var index55_75 = input.index();
input.rewind();
s = -1;
if ( (LA55_75=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_75==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( (LA55_75=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_75=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( ((LA55_75>='\u0000' && LA55_75<='\"')||(LA55_75>='$' && LA55_75<='.')||(LA55_75>='0' && LA55_75<='[')||(LA55_75>='^' && LA55_75<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
else s = 103;
input.seek(index55_75);
if ( s>=0 ) return s;
break;
case 72 :
var LA55_93 = input.LA(1);
var index55_93 = input.index();
input.rewind();
s = -1;
if ( (LA55_93=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_93==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_93=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_93=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( (LA55_93=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( ((LA55_93>='0' && LA55_93<='7')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 115;}
else if ( ((LA55_93>='\u0000' && LA55_93<='!')||(LA55_93>='$' && LA55_93<='.')||(LA55_93>='8' && LA55_93<='[')||(LA55_93>='^' && LA55_93<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
input.seek(index55_93);
if ( s>=0 ) return s;
break;
case 73 :
var LA55_105 = input.LA(1);
var index55_105 = input.index();
input.rewind();
s = -1;
if ( (LA55_105=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_105==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( (LA55_105=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_105=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( ((LA55_105>='0' && LA55_105<='7')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 121;}
else if ( ((LA55_105>='\u0000' && LA55_105<='\"')||(LA55_105>='$' && LA55_105<='.')||(LA55_105>='8' && LA55_105<='[')||(LA55_105>='^' && LA55_105<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
input.seek(index55_105);
if ( s>=0 ) return s;
break;
case 74 :
var LA55_132 = input.LA(1);
var index55_132 = input.index();
input.rewind();
s = -1;
if ( (LA55_132=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_132==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( (LA55_132=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_132=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( ((LA55_132>='\u0000' && LA55_132<='\"')||(LA55_132>='$' && LA55_132<='.')||(LA55_132>='0' && LA55_132<='[')||(LA55_132>='^' && LA55_132<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
input.seek(index55_132);
if ( s>=0 ) return s;
break;
case 75 :
var LA55_88 = input.LA(1);
var index55_88 = input.index();
input.rewind();
s = -1;
if ( (LA55_88=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_88=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( (LA55_88=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_88=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( ((LA55_88>='0' && LA55_88<='7')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 112;}
else if ( ((LA55_88>='\u0000' && LA55_88<='!')||(LA55_88>='$' && LA55_88<='.')||(LA55_88>='8' && LA55_88<='[')||(LA55_88>=']' && LA55_88<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
input.seek(index55_88);
if ( s>=0 ) return s;
break;
case 76 :
var LA55_46 = input.LA(1);
var index55_46 = input.index();
input.rewind();
s = -1;
if ( (LA55_46=='{') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 75;}
else if ( (LA55_46=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_46==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( (LA55_46=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_46=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( ((LA55_46>='\u0000' && LA55_46<='\"')||(LA55_46>='$' && LA55_46<='.')||(LA55_46>='0' && LA55_46<='[')||(LA55_46>='^' && LA55_46<='z')||(LA55_46>='|' && LA55_46<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
input.seek(index55_46);
if ( s>=0 ) return s;
break;
case 77 :
var LA55_100 = input.LA(1);
var index55_100 = input.index();
input.rewind();
s = -1;
if ( ((LA55_100>='0' && LA55_100<='7')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 118;}
else if ( (LA55_100=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_100==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_100=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_100=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_100>='\u0000' && LA55_100<='\"')||(LA55_100>='$' && LA55_100<='.')||(LA55_100>='8' && LA55_100<='[')||(LA55_100>='^' && LA55_100<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
input.seek(index55_100);
if ( s>=0 ) return s;
break;
case 78 :
var LA55_62 = input.LA(1);
var index55_62 = input.index();
input.rewind();
s = -1;
if ( (LA55_62=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_62==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( (LA55_62=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_62=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( (LA55_62=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( ((LA55_62>='\u0000' && LA55_62<='!')||(LA55_62>='$' && LA55_62<='.')||(LA55_62>='0' && LA55_62<='[')||(LA55_62>='^' && LA55_62<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index55_62);
if ( s>=0 ) return s;
break;
case 79 :
var LA55_21 = input.LA(1);
var index55_21 = input.index();
input.rewind();
s = -1;
if ( (LA55_21=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_21==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( (LA55_21=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_21=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( (LA55_21=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( ((LA55_21>='\u0000' && LA55_21<='!')||(LA55_21>='$' && LA55_21<='.')||(LA55_21>='0' && LA55_21<='[')||(LA55_21>='^' && LA55_21<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index55_21);
if ( s>=0 ) return s;
break;
case 80 :
var LA55_101 = input.LA(1);
var index55_101 = input.index();
input.rewind();
s = -1;
if ( ((LA55_101>='0' && LA55_101<='7')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 119;}
else if ( (LA55_101=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_101==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_101=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_101=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_101>='\u0000' && LA55_101<='\"')||(LA55_101>='$' && LA55_101<='.')||(LA55_101>='8' && LA55_101<='[')||(LA55_101>='^' && LA55_101<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
input.seek(index55_101);
if ( s>=0 ) return s;
break;
case 81 :
var LA55_54 = input.LA(1);
var index55_54 = input.index();
input.rewind();
s = -1;
if ( (LA55_54=='\n'||LA55_54=='#'||LA55_54=='\\'||LA55_54=='b'||LA55_54=='f'||LA55_54=='n'||LA55_54=='r'||LA55_54=='t') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 85;}
else if ( (LA55_54=='u') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 86;}
else if ( (LA55_54=='/') && ((this.isRegexpInterpolating()))) {s = 76;}
else if ( (LA55_54=='\"'||LA55_54==']'||LA55_54=='e') && ((this.isInterpolating()))) {s = 84;}
else if ( ((LA55_54>='0' && LA55_54<='3')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 87;}
else if ( ((LA55_54>='4' && LA55_54<='7')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 88;}
input.seek(index55_54);
if ( s>=0 ) return s;
break;
case 82 :
var LA55_72 = input.LA(1);
var index55_72 = input.index();
input.rewind();
s = -1;
if ( (LA55_72=='\n'||LA55_72=='#'||LA55_72=='\\'||LA55_72=='b'||LA55_72=='f'||LA55_72=='n'||LA55_72=='r'||LA55_72=='t') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 98;}
else if ( (LA55_72=='u') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 99;}
else if ( (LA55_72=='\"'||LA55_72==']'||LA55_72=='e') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_72=='/') && ((this.isAltRegexpInterpolating()))) {s = 67;}
else if ( ((LA55_72>='0' && LA55_72<='3')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 100;}
else if ( ((LA55_72>='4' && LA55_72<='7')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 101;}
input.seek(index55_72);
if ( s>=0 ) return s;
break;
case 83 :
var LA55_35 = input.LA(1);
var index55_35 = input.index();
input.rewind();
s = -1;
if ( ((LA55_35>='0' && LA55_35<='7')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 61;}
else if ( (LA55_35=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 20;}
else if ( (LA55_35=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 22;}
else if ( (LA55_35=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 19;}
else if ( (LA55_35=='\"') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 23;}
else if ( (LA55_35==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 24;}
else if ( ((LA55_35>='\u0000' && LA55_35<='!')||(LA55_35>='$' && LA55_35<='.')||(LA55_35>='8' && LA55_35<='[')||(LA55_35>='^' && LA55_35<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 21;}
input.seek(index55_35);
if ( s>=0 ) return s;
break;
case 84 :
var LA55_38 = input.LA(1);
var index55_38 = input.index();
input.rewind();
s = -1;
if ( (LA55_38=='{') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 64;}
else if ( (LA55_38=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_38==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_38=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_38=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( (LA55_38=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( ((LA55_38>='\u0000' && LA55_38<='!')||(LA55_38>='$' && LA55_38<='.')||(LA55_38>='0' && LA55_38<='[')||(LA55_38>='^' && LA55_38<='z')||(LA55_38>='|' && LA55_38<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
input.seek(index55_38);
if ( s>=0 ) return s;
break;
case 85 :
var LA55_45 = input.LA(1);
var index55_45 = input.index();
input.rewind();
s = -1;
if ( (LA55_45=='#') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 38;}
else if ( (LA55_45==']') && (((this.isAltInterpolating())||(this.isInterpolating())))) {s = 39;}
else if ( (LA55_45=='\\') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 40;}
else if ( (LA55_45=='/') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 42;}
else if ( (LA55_45=='\"') && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 44;}
else if ( ((LA55_45>='\u0000' && LA55_45<='!')||(LA55_45>='$' && LA55_45<='.')||(LA55_45>='0' && LA55_45<='[')||(LA55_45>='^' && LA55_45<='\uFFFF')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 45;}
input.seek(index55_45);
if ( s>=0 ) return s;
break;
case 86 :
var LA55_111 = input.LA(1);
var index55_111 = input.index();
input.rewind();
s = -1;
if ( (LA55_111=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_111=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( (LA55_111=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_111=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( ((LA55_111>='0' && LA55_111<='7')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 123;}
else if ( ((LA55_111>='\u0000' && LA55_111<='!')||(LA55_111>='$' && LA55_111<='.')||(LA55_111>='8' && LA55_111<='[')||(LA55_111>=']' && LA55_111<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
input.seek(index55_111);
if ( s>=0 ) return s;
break;
case 87 :
var LA55_98 = input.LA(1);
var index55_98 = input.index();
input.rewind();
s = -1;
if ( (LA55_98=='#') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 71;}
else if ( (LA55_98==']') && ((this.isAltInterpolating()))) {s = 97;}
else if ( (LA55_98=='\\') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 72;}
else if ( (LA55_98=='/') && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 73;}
else if ( ((LA55_98>='\u0000' && LA55_98<='\"')||(LA55_98>='$' && LA55_98<='.')||(LA55_98>='0' && LA55_98<='[')||(LA55_98>='^' && LA55_98<='\uFFFF')) && (((this.isAltInterpolating())||(this.isAltRegexpInterpolating())))) {s = 74;}
input.seek(index55_98);
if ( s>=0 ) return s;
break;
case 88 :
var LA55_55 = input.LA(1);
var index55_55 = input.index();
input.rewind();
s = -1;
if ( ((LA55_55>='\u0000' && LA55_55<='\uFFFF')) && ((this.isRegexpInterpolating()))) {s = 76;}
else s = 51;
input.seek(index55_55);
if ( s>=0 ) return s;
break;
case 89 :
var LA55_92 = input.LA(1);
var index55_92 = input.index();
input.rewind();
s = -1;
if ( ((LA55_92>='0' && LA55_92<='9')||(LA55_92>='A' && LA55_92<='F')||(LA55_92>='a' && LA55_92<='f')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 114;}
input.seek(index55_92);
if ( s>=0 ) return s;
break;
case 90 :
var LA55_80 = input.LA(1);
var index55_80 = input.index();
input.rewind();
s = -1;
if ( (LA55_80=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_80=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( (LA55_80=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( ((LA55_80>='0' && LA55_80<='7')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 106;}
else if ( (LA55_80==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( ((LA55_80>='\u0000' && LA55_80<='\"')||(LA55_80>='$' && LA55_80<='.')||(LA55_80>='8' && LA55_80<='[')||(LA55_80>='^' && LA55_80<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
input.seek(index55_80);
if ( s>=0 ) return s;
break;
case 91 :
var LA55_23 = input.LA(1);
var index55_23 = input.index();
input.rewind();
s = -1;
if ( (LA55_23=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_23==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( (LA55_23=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_23=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( ((LA55_23>='\u0000' && LA55_23<='\"')||(LA55_23>='$' && LA55_23<='.')||(LA55_23>='0' && LA55_23<='[')||(LA55_23>='^' && LA55_23<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
else s = 51;
input.seek(index55_23);
if ( s>=0 ) return s;
break;
case 92 :
var LA55_125 = input.LA(1);
var index55_125 = input.index();
input.rewind();
s = -1;
if ( ((LA55_125>='0' && LA55_125<='9')||(LA55_125>='A' && LA55_125<='F')||(LA55_125>='a' && LA55_125<='f')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 130;}
input.seek(index55_125);
if ( s>=0 ) return s;
break;
case 93 :
var LA55_120 = input.LA(1);
var index55_120 = input.index();
input.rewind();
s = -1;
if ( ((LA55_120>='0' && LA55_120<='9')||(LA55_120>='A' && LA55_120<='F')||(LA55_120>='a' && LA55_120<='f')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 128;}
input.seek(index55_120);
if ( s>=0 ) return s;
break;
case 94 :
var LA55_87 = input.LA(1);
var index55_87 = input.index();
input.rewind();
s = -1;
if ( ((LA55_87>='0' && LA55_87<='7')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 111;}
else if ( (LA55_87=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_87=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( (LA55_87=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_87=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( ((LA55_87>='\u0000' && LA55_87<='!')||(LA55_87>='$' && LA55_87<='.')||(LA55_87>='8' && LA55_87<='[')||(LA55_87>=']' && LA55_87<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
input.seek(index55_87);
if ( s>=0 ) return s;
break;
case 95 :
var LA55_77 = input.LA(1);
var index55_77 = input.index();
input.rewind();
s = -1;
if ( (LA55_77=='#') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 46;}
else if ( (LA55_77==']') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())))) {s = 47;}
else if ( (LA55_77=='\\') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 48;}
else if ( (LA55_77=='/') && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 49;}
else if ( ((LA55_77>='\u0000' && LA55_77<='\"')||(LA55_77>='$' && LA55_77<='.')||(LA55_77>='0' && LA55_77<='[')||(LA55_77>='^' && LA55_77<='\uFFFF')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 50;}
input.seek(index55_77);
if ( s>=0 ) return s;
break;
case 96 :
var LA55_128 = input.LA(1);
var index55_128 = input.index();
input.rewind();
s = -1;
if ( ((LA55_128>='0' && LA55_128<='9')||(LA55_128>='A' && LA55_128<='F')||(LA55_128>='a' && LA55_128<='f')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 132;}
input.seek(index55_128);
if ( s>=0 ) return s;
break;
case 97 :
var LA55_82 = input.LA(1);
var index55_82 = input.index();
input.rewind();
s = -1;
if ( (LA55_82=='#') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 52;}
else if ( (LA55_82=='/') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 53;}
else if ( (LA55_82=='\\') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 54;}
else if ( (LA55_82=='\"') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 55;}
else if ( ((LA55_82>='\u0000' && LA55_82<='!')||(LA55_82>='$' && LA55_82<='.')||(LA55_82>='0' && LA55_82<='[')||(LA55_82>=']' && LA55_82<='\uFFFF')) && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 57;}
else s = 107;
input.seek(index55_82);
if ( s>=0 ) return s;
break;
case 98 :
var LA55_83 = input.LA(1);
var index55_83 = input.index();
input.rewind();
s = -1;
if ( (LA55_83=='i'||(LA55_83>='m' && LA55_83<='p')||LA55_83=='s'||LA55_83=='u'||LA55_83=='x') && (((this.isRegexpInterpolating())||(this.isInterpolating())))) {s = 83;}
else if ( (LA55_83=='#') && ((this.isInterpolating()))) {s = 84;}
else if ( ((LA55_83>='\u0000' && LA55_83<='\"')||(LA55_83>='$' && LA55_83<='h')||(LA55_83>='j' && LA55_83<='l')||(LA55_83>='q' && LA55_83<='r')||LA55_83=='t'||(LA55_83>='v' && LA55_83<='w')||(LA55_83>='y' && LA55_83<='\uFFFF')) && ((this.isInterpolating()))) {s = 109;}
else s = 108;
input.seek(index55_83);
if ( s>=0 ) return s;
break;
case 99 :
var LA55_114 = input.LA(1);
var index55_114 = input.index();
input.rewind();
s = -1;
if ( ((LA55_114>='0' && LA55_114<='9')||(LA55_114>='A' && LA55_114<='F')||(LA55_114>='a' && LA55_114<='f')) && (((this.isAltInterpolating())||(this.isInterpolating())||(this.isAltRegexpInterpolating())))) {s = 125;}
input.seek(index55_114);
if ( s>=0 ) return s;
break;
case 100 :
var LA55_104 = input.LA(1);
var index55_104 = input.index();
input.rewind();
s = -1;
if ( ((LA55_104>='0' && LA55_104<='9')||(LA55_104>='A' && LA55_104<='F')||(LA55_104>='a' && LA55_104<='f')) && (((this.isAltInterpolating())||(this.isRegexpInterpolating())||(this.isAltRegexpInterpolating())))) {s = 120;}
input.seek(index55_104);
if ( s>=0 ) return s;
break;
}
}).call(this.recognizer, s, input);
if (!org.antlr.lang.isUndefined(retval)) {
return retval;
}
var nvae =
new org.antlr.runtime.NoViableAltException(this.getDescription(), 55, _s, input);
this.error(nvae);
throw nvae;
},
dummy: null
});
})();
// $ANTLR 3.1.1 ioke.g 2009-02-18 20:58:32
var iokeParser = function(input, state) {
if (!state) {
state = new org.antlr.runtime.RecognizerSharedState();
}
(function(){
this.parseFully = function() {
var result = this.fullProgram();
return result == null ? null : result.getTree();
};
}).call(this);
iokeParser.superclass.constructor.call(this, input, state);
this.dfa9 = new iokeParser.DFA9(this);
/* @todo only create adaptor if output=AST */
this.adaptor = new org.antlr.runtime.tree.CommonTreeAdaptor();
};
org.antlr.lang.augmentObject(iokeParser, {
RegexpModifier: 24,
NumberLiteral: 10,
RegexpLiteral: 9,
UnitLiteral: 12,
FloatWithLeadingDot: 18,
LineComment: 29,
Exponent: 21,
EscapeSequenceRegexp: 23,
Digit: 30,
EOF: -1,
DecimalLiteral: 11,
HexDigit: 17,
Identifier: 6,
Separator: 27,
StringLiteral: 8,
T__31: 31,
T__32: 32,
T__33: 33,
UnitSpecifier: 19,
T__34: 34,
T__35: 35,
T__36: 36,
T__37: 37,
UnicodeEscape: 25,
Terminator: 7,
MESSAGE: 4,
IDDigit: 15,
Whitespace: 28,
OperatorChar: 13,
Comma: 5,
OctalEscape: 26,
EscapeSequence: 22,
Letter: 14,
NonZeroDecimal: 20,
UnitDecimalLiteral: 16
});
(function(){
// public class variables
var RegexpModifier= 24,
NumberLiteral= 10,
RegexpLiteral= 9,
UnitLiteral= 12,
FloatWithLeadingDot= 18,
LineComment= 29,
Exponent= 21,
EscapeSequenceRegexp= 23,
Digit= 30,
EOF= -1,
DecimalLiteral= 11,
HexDigit= 17,
Identifier= 6,
Separator= 27,
StringLiteral= 8,
T__31= 31,
T__32= 32,
T__33= 33,
UnitSpecifier= 19,
T__34= 34,
T__35= 35,
T__36= 36,
T__37= 37,
UnicodeEscape= 25,
Terminator= 7,
MESSAGE= 4,
IDDigit= 15,
Whitespace= 28,
OperatorChar= 13,
Comma= 5,
OctalEscape= 26,
EscapeSequence= 22,
Letter= 14,
NonZeroDecimal= 20,
UnitDecimalLiteral= 16;
// public instance methods/vars
org.antlr.lang.extend(iokeParser, org.antlr.runtime.Parser, {
setTreeAdaptor: function(adaptor) {
this.adaptor = adaptor;
},
getTreeAdaptor: function() {
return this.adaptor;
},
getTokenNames: function() { return iokeParser.tokenNames; },
getGrammarFileName: function() { return "ioke.g"; }
});
org.antlr.lang.augmentObject(iokeParser.prototype, {
// inline static return class
fullProgram_return: (function() {
iokeParser.fullProgram_return = function(){};
org.antlr.lang.extend(iokeParser.fullProgram_return,
org.antlr.runtime.ParserRuleReturnScope,
{
getTree: function() { return this.tree; }
});
return;
})(),
// ioke.g:91:1: fullProgram : ( expressionChain )? EOF ;
// $ANTLR start "fullProgram"
fullProgram: function() {
var retval = new iokeParser.fullProgram_return();
retval.start = this.input.LT(1);
var root_0 = null;
var EOF2 = null;
var expressionChain1 = null;
var EOF2_tree=null;
try {
// ioke.g:92:5: ( ( expressionChain )? EOF )
// ioke.g:93:9: ( expressionChain )? EOF
root_0 = this.adaptor.nil();
// ioke.g:93:9: ( expressionChain )?
var alt1=2;
var LA1_0 = this.input.LA(1);
if ( ((LA1_0>=Identifier && LA1_0<=UnitLiteral)||LA1_0==31||LA1_0==33||LA1_0==35||LA1_0==37) ) {
alt1=1;
}
switch (alt1) {
case 1 :
// ioke.g:93:9: expressionChain
this.pushFollow(iokeParser.FOLLOW_expressionChain_in_fullProgram75);
expressionChain1=this.expressionChain();
this.state._fsp--;
this.adaptor.addChild(root_0, expressionChain1.getTree());
break;
}
EOF2=this.match(this.input,EOF,iokeParser.FOLLOW_EOF_in_fullProgram78);
retval.stop = this.input.LT(-1);
retval.tree = this.adaptor.rulePostProcessing(root_0);
this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (re) {
if (re instanceof org.antlr.runtime.RecognitionException) {
this.reportError(re);
this.recover(this.input,re);
retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
} else {
throw re;
}
}
finally {
}
return retval;
},
// inline static return class
commatedExpression_return: (function() {
iokeParser.commatedExpression_return = function(){};
org.antlr.lang.extend(iokeParser.commatedExpression_return,
org.antlr.runtime.ParserRuleReturnScope,
{
getTree: function() { return this.tree; }
});
return;
})(),
// ioke.g:96:1: commatedExpression : expressionChain ( Comma expressionChain )* ;
// $ANTLR start "commatedExpression"
commatedExpression: function() {
var retval = new iokeParser.commatedExpression_return();
retval.start = this.input.LT(1);
var root_0 = null;
var Comma4 = null;
var expressionChain3 = null;
var expressionChain5 = null;
var Comma4_tree=null;
try {
// ioke.g:97:5: ( expressionChain ( Comma expressionChain )* )
// ioke.g:98:9: expressionChain ( Comma expressionChain )*
root_0 = this.adaptor.nil();
this.pushFollow(iokeParser.FOLLOW_expressionChain_in_commatedExpression104);
expressionChain3=this.expressionChain();
this.state._fsp--;
this.adaptor.addChild(root_0, expressionChain3.getTree());
// ioke.g:98:25: ( Comma expressionChain )*
loop2:
do {
var alt2=2;
var LA2_0 = this.input.LA(1);
if ( (LA2_0==Comma) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// ioke.g:98:26: Comma expressionChain
Comma4=this.match(this.input,Comma,iokeParser.FOLLOW_Comma_in_commatedExpression107);
Comma4_tree = this.adaptor.create(Comma4);
this.adaptor.addChild(root_0, Comma4_tree);
this.pushFollow(iokeParser.FOLLOW_expressionChain_in_commatedExpression109);
expressionChain5=this.expressionChain();
this.state._fsp--;
this.adaptor.addChild(root_0, expressionChain5.getTree());
break;
default :
break loop2;
}
} while (true);
retval.stop = this.input.LT(-1);
retval.tree = this.adaptor.rulePostProcessing(root_0);
this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (re) {
if (re instanceof org.antlr.runtime.RecognitionException) {
this.reportError(re);
this.recover(this.input,re);
retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
} else {
throw re;
}
}
finally {
}
return retval;
},
// inline static return class
expressionChain_return: (function() {
iokeParser.expressionChain_return = function(){};
org.antlr.lang.extend(iokeParser.expressionChain_return,
org.antlr.runtime.ParserRuleReturnScope,
{
getTree: function() { return this.tree; }
});
return;
})(),
// ioke.g:101:1: expressionChain : ( expression )+ ;
// $ANTLR start "expressionChain"
expressionChain: function() {
var retval = new iokeParser.expressionChain_return();
retval.start = this.input.LT(1);
var root_0 = null;
var expression6 = null;
try {
// ioke.g:102:5: ( ( expression )+ )
// ioke.g:103:9: ( expression )+
root_0 = this.adaptor.nil();
// ioke.g:103:9: ( expression )+
var cnt3=0;
loop3:
do {
var alt3=2;
var LA3_0 = this.input.LA(1);
if ( ((LA3_0>=Identifier && LA3_0<=UnitLiteral)||LA3_0==31||LA3_0==33||LA3_0==35||LA3_0==37) ) {
alt3=1;
}
switch (alt3) {
case 1 :
// ioke.g:103:9: expression
this.pushFollow(iokeParser.FOLLOW_expression_in_expressionChain136);
expression6=this.expression();
this.state._fsp--;
this.adaptor.addChild(root_0, expression6.getTree());
break;
default :
if ( cnt3 >= 1 ) {
break loop3;
}
var eee = new org.antlr.runtime.EarlyExitException(3, this.input);
throw eee;
}
cnt3++;
} while (true);
retval.stop = this.input.LT(-1);
retval.tree = this.adaptor.rulePostProcessing(root_0);
this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (re) {
if (re instanceof org.antlr.runtime.RecognitionException) {
this.reportError(re);
this.recover(this.input,re);
retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
} else {
throw re;
}
}
finally {
}
return retval;
},
// inline static return class
expression_return: (function() {
iokeParser.expression_return = function(){};
org.antlr.lang.extend(iokeParser.expression_return,
org.antlr.runtime.ParserRuleReturnScope,
{
getTree: function() { return this.tree; }
});
return;
})(),
// ioke.g:106:1: expression : ({...}? =>v= Identifier -> ^( MESSAGE[$v] Identifier ) | v= Identifier '(' ( commatedExpression )? ')' -> ^( MESSAGE[$v] Identifier '(' ( commatedExpression )? ) | v= '(' ( commatedExpression )? ')' -> ^( MESSAGE[$v] Identifier[\"\"] '(' ( commatedExpression )? ) | v= '[' ( commatedExpression )? ']' -> ^( MESSAGE[$v] Identifier[\"[]\"] '[' ( commatedExpression )? ) | v= '{' ( commatedExpression )? '}' -> ^( MESSAGE[$v] Identifier[\"{}\"] '{' ( commatedExpression )? ) | v= '#{' ( commatedExpression )? '}' -> ^( MESSAGE[$v] Identifier[\"set\"] '{' ( commatedExpression )? ) | literals | Terminator );
// $ANTLR start "expression"
expression: function() {
var retval = new iokeParser.expression_return();
retval.start = this.input.LT(1);
var root_0 = null;
var v = null;
var char_literal7 = null;
var char_literal9 = null;
var char_literal11 = null;
var char_literal13 = null;
var char_literal15 = null;
var char_literal17 = null;
var Terminator19 = null;
var commatedExpression8 = null;
var commatedExpression10 = null;
var commatedExpression12 = null;
var commatedExpression14 = null;
var commatedExpression16 = null;
var literals18 = null;
var v_tree=null;
var char_literal7_tree=null;
var char_literal9_tree=null;
var char_literal11_tree=null;
var char_literal13_tree=null;
var char_literal15_tree=null;
var char_literal17_tree=null;
var Terminator19_tree=null;
var stream_32=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token 32");
var stream_31=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token 31");
var stream_35=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token 35");
var stream_36=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token 36");
var stream_33=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token 33");
var stream_34=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token 34");
var stream_Identifier=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token Identifier");
var stream_37=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token 37");
var stream_commatedExpression=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule commatedExpression");
try {
// ioke.g:107:5: ({...}? =>v= Identifier -> ^( MESSAGE[$v] Identifier ) | v= Identifier '(' ( commatedExpression )? ')' -> ^( MESSAGE[$v] Identifier '(' ( commatedExpression )? ) | v= '(' ( commatedExpression )? ')' -> ^( MESSAGE[$v] Identifier[\"\"] '(' ( commatedExpression )? ) | v= '[' ( commatedExpression )? ']' -> ^( MESSAGE[$v] Identifier[\"[]\"] '[' ( commatedExpression )? ) | v= '{' ( commatedExpression )? '}' -> ^( MESSAGE[$v] Identifier[\"{}\"] '{' ( commatedExpression )? ) | v= '#{' ( commatedExpression )? '}' -> ^( MESSAGE[$v] Identifier[\"set\"] '{' ( commatedExpression )? ) | literals | Terminator )
var alt9=8;
alt9 = this.dfa9.predict(this.input);
switch (alt9) {
case 1 :
// ioke.g:108:9: {...}? =>v= Identifier
if ( !(( "(" !== this.input.LT(2).getText() )) ) {
throw new org.antlr.runtime.FailedPredicateException(this.input, "expression", " \"(\" !== this.input.LT(2).getText() ");
}
v=this.match(this.input,Identifier,iokeParser.FOLLOW_Identifier_in_expression176);
stream_Identifier.add(v);
// AST REWRITE
// elements: Identifier
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
retval.tree = root_0;
var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
root_0 = this.adaptor.nil();
// 109:52: -> ^( MESSAGE[$v] Identifier )
{
// ioke.g:109:55: ^( MESSAGE[$v] Identifier )
{
var root_1 = this.adaptor.nil();
root_1 = this.adaptor.becomeRoot(this.adaptor.create(MESSAGE, v), root_1);
this.adaptor.addChild(root_1, stream_Identifier.nextNode());
this.adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
break;
case 2 :
// ioke.g:110:9: v= Identifier '(' ( commatedExpression )? ')'
v=this.match(this.input,Identifier,iokeParser.FOLLOW_Identifier_in_expression227);
stream_Identifier.add(v);
char_literal7=this.match(this.input,31,iokeParser.FOLLOW_31_in_expression229);
stream_31.add(char_literal7);
// ioke.g:110:26: ( commatedExpression )?
var alt4=2;
var LA4_0 = this.input.LA(1);
if ( ((LA4_0>=Identifier && LA4_0<=UnitLiteral)||LA4_0==31||LA4_0==33||LA4_0==35||LA4_0==37) ) {
alt4=1;
}
switch (alt4) {
case 1 :
// ioke.g:110:26: commatedExpression
this.pushFollow(iokeParser.FOLLOW_commatedExpression_in_expression231);
commatedExpression8=this.commatedExpression();
this.state._fsp--;
stream_commatedExpression.add(commatedExpression8.getTree());
break;
}
char_literal9=this.match(this.input,32,iokeParser.FOLLOW_32_in_expression234);
stream_32.add(char_literal9);
// AST REWRITE
// elements: commatedExpression, Identifier, 31
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
retval.tree = root_0;
var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
root_0 = this.adaptor.nil();
// 110:52: -> ^( MESSAGE[$v] Identifier '(' ( commatedExpression )? )
{
// ioke.g:110:55: ^( MESSAGE[$v] Identifier '(' ( commatedExpression )? )
{
var root_1 = this.adaptor.nil();
root_1 = this.adaptor.becomeRoot(this.adaptor.create(MESSAGE, v), root_1);
this.adaptor.addChild(root_1, stream_Identifier.nextNode());
this.adaptor.addChild(root_1, stream_31.nextNode());
// ioke.g:110:92: ( commatedExpression )?
if ( stream_commatedExpression.hasNext() ) {
this.adaptor.addChild(root_1, stream_commatedExpression.nextTree());
}
stream_commatedExpression.reset();
this.adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
break;
case 3 :
// ioke.g:111:9: v= '(' ( commatedExpression )? ')'
v=this.match(this.input,31,iokeParser.FOLLOW_31_in_expression270);
stream_31.add(v);
// ioke.g:111:16: ( commatedExpression )?
var alt5=2;
var LA5_0 = this.input.LA(1);
if ( ((LA5_0>=Identifier && LA5_0<=UnitLiteral)||LA5_0==31||LA5_0==33||LA5_0==35||LA5_0==37) ) {
alt5=1;
}
switch (alt5) {
case 1 :
// ioke.g:111:16: commatedExpression
this.pushFollow(iokeParser.FOLLOW_commatedExpression_in_expression273);
commatedExpression10=this.commatedExpression();
this.state._fsp--;
stream_commatedExpression.add(commatedExpression10.getTree());
break;
}
char_literal11=this.match(this.input,32,iokeParser.FOLLOW_32_in_expression276);
stream_32.add(char_literal11);
// AST REWRITE
// elements: commatedExpression, 31
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
retval.tree = root_0;
var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
root_0 = this.adaptor.nil();
// 111:52: -> ^( MESSAGE[$v] Identifier[\"\"] '(' ( commatedExpression )? )
{
// ioke.g:111:55: ^( MESSAGE[$v] Identifier[\"\"] '(' ( commatedExpression )? )
{
var root_1 = this.adaptor.nil();
root_1 = this.adaptor.becomeRoot(this.adaptor.create(MESSAGE, v), root_1);
this.adaptor.addChild(root_1, this.adaptor.create(Identifier, ""));
this.adaptor.addChild(root_1, stream_31.nextNode());
// ioke.g:111:92: ( commatedExpression )?
if ( stream_commatedExpression.hasNext() ) {
this.adaptor.addChild(root_1, stream_commatedExpression.nextTree());
}
stream_commatedExpression.reset();
this.adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
break;
case 4 :
// ioke.g:112:9: v= '[' ( commatedExpression )? ']'
v=this.match(this.input,33,iokeParser.FOLLOW_33_in_expression319);
stream_33.add(v);
// ioke.g:112:16: ( commatedExpression )?
var alt6=2;
var LA6_0 = this.input.LA(1);
if ( ((LA6_0>=Identifier && LA6_0<=UnitLiteral)||LA6_0==31||LA6_0==33||LA6_0==35||LA6_0==37) ) {
alt6=1;
}
switch (alt6) {
case 1 :
// ioke.g:112:16: commatedExpression
this.pushFollow(iokeParser.FOLLOW_commatedExpression_in_expression322);
commatedExpression12=this.commatedExpression();
this.state._fsp--;
stream_commatedExpression.add(commatedExpression12.getTree());
break;
}
char_literal13=this.match(this.input,34,iokeParser.FOLLOW_34_in_expression325);
stream_34.add(char_literal13);
// AST REWRITE
// elements: commatedExpression, 33
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
retval.tree = root_0;
var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
root_0 = this.adaptor.nil();
// 112:52: -> ^( MESSAGE[$v] Identifier[\"[]\"] '[' ( commatedExpression )? )
{
// ioke.g:112:55: ^( MESSAGE[$v] Identifier[\"[]\"] '[' ( commatedExpression )? )
{
var root_1 = this.adaptor.nil();
root_1 = this.adaptor.becomeRoot(this.adaptor.create(MESSAGE, v), root_1);
this.adaptor.addChild(root_1, this.adaptor.create(Identifier, "[]"));
this.adaptor.addChild(root_1, stream_33.nextNode());
// ioke.g:112:92: ( commatedExpression )?
if ( stream_commatedExpression.hasNext() ) {
this.adaptor.addChild(root_1, stream_commatedExpression.nextTree());
}
stream_commatedExpression.reset();
this.adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
break;
case 5 :
// ioke.g:113:9: v= '{' ( commatedExpression )? '}'
v=this.match(this.input,35,iokeParser.FOLLOW_35_in_expression366);
stream_35.add(v);
// ioke.g:113:16: ( commatedExpression )?
var alt7=2;
var LA7_0 = this.input.LA(1);
if ( ((LA7_0>=Identifier && LA7_0<=UnitLiteral)||LA7_0==31||LA7_0==33||LA7_0==35||LA7_0==37) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// ioke.g:113:16: commatedExpression
this.pushFollow(iokeParser.FOLLOW_commatedExpression_in_expression369);
commatedExpression14=this.commatedExpression();
this.state._fsp--;
stream_commatedExpression.add(commatedExpression14.getTree());
break;
}
char_literal15=this.match(this.input,36,iokeParser.FOLLOW_36_in_expression372);
stream_36.add(char_literal15);
// AST REWRITE
// elements: 35, commatedExpression
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
retval.tree = root_0;
var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
root_0 = this.adaptor.nil();
// 113:52: -> ^( MESSAGE[$v] Identifier[\"{}\"] '{' ( commatedExpression )? )
{
// ioke.g:113:55: ^( MESSAGE[$v] Identifier[\"{}\"] '{' ( commatedExpression )? )
{
var root_1 = this.adaptor.nil();
root_1 = this.adaptor.becomeRoot(this.adaptor.create(MESSAGE, v), root_1);
this.adaptor.addChild(root_1, this.adaptor.create(Identifier, "{}"));
this.adaptor.addChild(root_1, stream_35.nextNode());
// ioke.g:113:92: ( commatedExpression )?
if ( stream_commatedExpression.hasNext() ) {
this.adaptor.addChild(root_1, stream_commatedExpression.nextTree());
}
stream_commatedExpression.reset();
this.adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
break;
case 6 :
// ioke.g:114:9: v= '#{' ( commatedExpression )? '}'
v=this.match(this.input,37,iokeParser.FOLLOW_37_in_expression413);
stream_37.add(v);
// ioke.g:114:16: ( commatedExpression )?
var alt8=2;
var LA8_0 = this.input.LA(1);
if ( ((LA8_0>=Identifier && LA8_0<=UnitLiteral)||LA8_0==31||LA8_0==33||LA8_0==35||LA8_0==37) ) {
alt8=1;
}
switch (alt8) {
case 1 :
// ioke.g:114:16: commatedExpression
this.pushFollow(iokeParser.FOLLOW_commatedExpression_in_expression415);
commatedExpression16=this.commatedExpression();
this.state._fsp--;
stream_commatedExpression.add(commatedExpression16.getTree());
break;
}
char_literal17=this.match(this.input,36,iokeParser.FOLLOW_36_in_expression418);
stream_36.add(char_literal17);
// AST REWRITE
// elements: 35, commatedExpression
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
retval.tree = root_0;
var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
root_0 = this.adaptor.nil();
// 114:52: -> ^( MESSAGE[$v] Identifier[\"set\"] '{' ( commatedExpression )? )
{
// ioke.g:114:55: ^( MESSAGE[$v] Identifier[\"set\"] '{' ( commatedExpression )? )
{
var root_1 = this.adaptor.nil();
root_1 = this.adaptor.becomeRoot(this.adaptor.create(MESSAGE, v), root_1);
this.adaptor.addChild(root_1, this.adaptor.create(Identifier, "set"));
this.adaptor.addChild(root_1, this.adaptor.create(35, "35"));
// ioke.g:114:92: ( commatedExpression )?
if ( stream_commatedExpression.hasNext() ) {
this.adaptor.addChild(root_1, stream_commatedExpression.nextTree());
}
stream_commatedExpression.reset();
this.adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
break;
case 7 :
// ioke.g:115:9: literals
root_0 = this.adaptor.nil();
this.pushFollow(iokeParser.FOLLOW_literals_in_expression456);
literals18=this.literals();
this.state._fsp--;
this.adaptor.addChild(root_0, literals18.getTree());
break;
case 8 :
// ioke.g:116:9: Terminator
root_0 = this.adaptor.nil();
Terminator19=this.match(this.input,Terminator,iokeParser.FOLLOW_Terminator_in_expression466);
Terminator19_tree = this.adaptor.create(Terminator19);
this.adaptor.addChild(root_0, Terminator19_tree);
break;
}
retval.stop = this.input.LT(-1);
retval.tree = this.adaptor.rulePostProcessing(root_0);
this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (re) {
if (re instanceof org.antlr.runtime.RecognitionException) {
this.reportError(re);
this.recover(this.input,re);
retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
} else {
throw re;
}
}
finally {
}
return retval;
},
// inline static return class
literals_return: (function() {
iokeParser.literals_return = function(){};
org.antlr.lang.extend(iokeParser.literals_return,
org.antlr.runtime.ParserRuleReturnScope,
{
getTree: function() { return this.tree; }
});
return;
})(),
// ioke.g:119:1: literals : ( StringLiteral | RegexpLiteral | NumberLiteral | DecimalLiteral | UnitLiteral );
// $ANTLR start "literals"
literals: function() {
var retval = new iokeParser.literals_return();
retval.start = this.input.LT(1);
var root_0 = null;
var set20 = null;
var set20_tree=null;
try {
// ioke.g:120:5: ( StringLiteral | RegexpLiteral | NumberLiteral | DecimalLiteral | UnitLiteral )
// ioke.g:
root_0 = this.adaptor.nil();
set20=this.input.LT(1);
if ( (this.input.LA(1)>=StringLiteral && this.input.LA(1)<=UnitLiteral) ) {
this.input.consume();
this.adaptor.addChild(root_0, this.adaptor.create(set20));
this.state.errorRecovery=false;
}
else {
var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
throw mse;
}
retval.stop = this.input.LT(-1);
retval.tree = this.adaptor.rulePostProcessing(root_0);
this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (re) {
if (re instanceof org.antlr.runtime.RecognitionException) {
this.reportError(re);
this.recover(this.input,re);
retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
} else {
throw re;
}
}
finally {
}
return retval;
}
// Delegated rules
}, true); // important to pass true to overwrite default implementations
org.antlr.lang.augmentObject(iokeParser, {
DFA9_eotS:
"\u000a\uffff",
DFA9_eofS:
"\u000a\uffff",
DFA9_minS:
"\u0001\u0006\u0001\u0000\u0008\uffff",
DFA9_maxS:
"\u0001\u0025\u0001\u0000\u0008\uffff",
DFA9_acceptS:
"\u0002\uffff\u0001\u0003\u0001\u0004\u0001\u0005\u0001\u0006\u0001"+
"\u0007\u0001\u0008\u0001\u0001\u0001\u0002",
DFA9_specialS:
"\u0001\uffff\u0001\u0000\u0008\uffff}>",
DFA9_transitionS: [
"\u0001\u0001\u0001\u0007\u0005\u0006\u0012\uffff\u0001\u0002"+
"\u0001\uffff\u0001\u0003\u0001\uffff\u0001\u0004\u0001\uffff"+
"\u0001\u0005",
"\u0001\uffff",
"",
"",
"",
"",
"",
"",
"",
""
]
});
org.antlr.lang.augmentObject(iokeParser, {
DFA9_eot:
org.antlr.runtime.DFA.unpackEncodedString(iokeParser.DFA9_eotS),
DFA9_eof:
org.antlr.runtime.DFA.unpackEncodedString(iokeParser.DFA9_eofS),
DFA9_min:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeParser.DFA9_minS),
DFA9_max:
org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(iokeParser.DFA9_maxS),
DFA9_accept:
org.antlr.runtime.DFA.unpackEncodedString(iokeParser.DFA9_acceptS),
DFA9_special:
org.antlr.runtime.DFA.unpackEncodedString(iokeParser.DFA9_specialS),
DFA9_transition: (function() {
var a = [],
i,
numStates = iokeParser.DFA9_transitionS.length;
for (i=0; i<numStates; i++) {
a.push(org.antlr.runtime.DFA.unpackEncodedString(iokeParser.DFA9_transitionS[i]));
}
return a;
})()
});
iokeParser.DFA9 = function(recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 9;
this.eot = iokeParser.DFA9_eot;
this.eof = iokeParser.DFA9_eof;
this.min = iokeParser.DFA9_min;
this.max = iokeParser.DFA9_max;
this.accept = iokeParser.DFA9_accept;
this.special = iokeParser.DFA9_special;
this.transition = iokeParser.DFA9_transition;
};
org.antlr.lang.extend(iokeParser.DFA9, org.antlr.runtime.DFA, {
getDescription: function() {
return "106:1: expression : ({...}? =>v= Identifier -> ^( MESSAGE[$v] Identifier ) | v= Identifier '(' ( commatedExpression )? ')' -> ^( MESSAGE[$v] Identifier '(' ( commatedExpression )? ) | v= '(' ( commatedExpression )? ')' -> ^( MESSAGE[$v] Identifier[\"\"] '(' ( commatedExpression )? ) | v= '[' ( commatedExpression )? ']' -> ^( MESSAGE[$v] Identifier[\"[]\"] '[' ( commatedExpression )? ) | v= '{' ( commatedExpression )? '}' -> ^( MESSAGE[$v] Identifier[\"{}\"] '{' ( commatedExpression )? ) | v= '#{' ( commatedExpression )? '}' -> ^( MESSAGE[$v] Identifier[\"set\"] '{' ( commatedExpression )? ) | literals | Terminator );";
},
specialStateTransition: function(s, input) {
var _s = s;
/* bind to recognizer so semantic predicates can be evaluated */
var retval = (function(s, input) {
switch ( s ) {
case 0 :
var LA9_1 = input.LA(1);
var index9_1 = input.index();
input.rewind();
s = -1;
if ( (( "(" !== this.input.LT(2).getText() )) ) {s = 8;}
else if ( (true) ) {s = 9;}
input.seek(index9_1);
if ( s>=0 ) return s;
break;
}
}).call(this.recognizer, s, input);
if (!org.antlr.lang.isUndefined(retval)) {
return retval;
}
var nvae =
new org.antlr.runtime.NoViableAltException(this.getDescription(), 9, _s, input);
this.error(nvae);
throw nvae;
},
dummy: null
});
// public class variables
org.antlr.lang.augmentObject(iokeParser, {
tokenNames: ["<invalid>", "<EOR>", "<DOWN>", "<UP>", "MESSAGE", "Comma", "Identifier", "Terminator", "StringLiteral", "RegexpLiteral", "NumberLiteral", "DecimalLiteral", "UnitLiteral", "OperatorChar", "Letter", "IDDigit", "UnitDecimalLiteral", "HexDigit", "FloatWithLeadingDot", "UnitSpecifier", "NonZeroDecimal", "Exponent", "EscapeSequence", "EscapeSequenceRegexp", "RegexpModifier", "UnicodeEscape", "OctalEscape", "Separator", "Whitespace", "LineComment", "Digit", "'('", "')'", "'['", "']'", "'{'", "'}'", "'#{'"],
FOLLOW_expressionChain_in_fullProgram75: new org.antlr.runtime.BitSet([0x00000000, 0x00000000]),
FOLLOW_EOF_in_fullProgram78: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
FOLLOW_expressionChain_in_commatedExpression104: new org.antlr.runtime.BitSet([0x00000022, 0x00000000]),
FOLLOW_Comma_in_commatedExpression107: new org.antlr.runtime.BitSet([0x80001FC0, 0x0000002A]),
FOLLOW_expressionChain_in_commatedExpression109: new org.antlr.runtime.BitSet([0x00000022, 0x00000000]),
FOLLOW_expression_in_expressionChain136: new org.antlr.runtime.BitSet([0x80001FC2, 0x0000002A]),
FOLLOW_Identifier_in_expression176: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
FOLLOW_Identifier_in_expression227: new org.antlr.runtime.BitSet([0x80000000, 0x00000000]),
FOLLOW_31_in_expression229: new org.antlr.runtime.BitSet([0x80001FC0, 0x0000002B]),
FOLLOW_commatedExpression_in_expression231: new org.antlr.runtime.BitSet([0x00000000, 0x00000001]),
FOLLOW_32_in_expression234: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
FOLLOW_31_in_expression270: new org.antlr.runtime.BitSet([0x80001FC0, 0x0000002B]),
FOLLOW_commatedExpression_in_expression273: new org.antlr.runtime.BitSet([0x00000000, 0x00000001]),
FOLLOW_32_in_expression276: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
FOLLOW_33_in_expression319: new org.antlr.runtime.BitSet([0x80001FC0, 0x0000002E]),
FOLLOW_commatedExpression_in_expression322: new org.antlr.runtime.BitSet([0x00000000, 0x00000004]),
FOLLOW_34_in_expression325: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
FOLLOW_35_in_expression366: new org.antlr.runtime.BitSet([0x80001FC0, 0x0000003A]),
FOLLOW_commatedExpression_in_expression369: new org.antlr.runtime.BitSet([0x00000000, 0x00000010]),
FOLLOW_36_in_expression372: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
FOLLOW_37_in_expression413: new org.antlr.runtime.BitSet([0x80001FC0, 0x0000003A]),
FOLLOW_commatedExpression_in_expression415: new org.antlr.runtime.BitSet([0x00000000, 0x00000010]),
FOLLOW_36_in_expression418: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
FOLLOW_literals_in_expression456: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
FOLLOW_Terminator_in_expression466: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
FOLLOW_set_in_literals0: new org.antlr.runtime.BitSet([0x00000002, 0x00000000])
});
})();
load('antlr.js');
load('iokeLexer.js');
load('iokeParser.js');
print("Loaded");
var parse = function(string) {
print("WILL PARSE: "+string);
var cstream = new org.antlr.runtime.ANTLRStringStream(string);
var lexer = new iokeLexer(cstream);
var tstream = new org.antlr.runtime.CommonTokenStream(lexer);
var parser = new iokeParser(tstream);
var fp = parser.fullProgram();
print("DONE:"+fp.tree.getType()+" tree: "+fp.tree);
}
parse("a b(c d)");
This file has been truncated, but you can view the full file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment