// http://javascript.crockford.com/tdop/index.html
// Douglas Crockford 2010-06-26
+// See also http://effbot.org/zone/simple-top-down-parsing.htm
+
+
/*jslint onevar: false
*/
}
};
+ /*
try {
if (console && console.debug) {
function print() {
}
}
} catch (e) {}
+ */
var symbol = function (id) {
var s = symbol_table[id];
return t;
} else {
t.first = [];
- while (token.arity === "name") {
- t.first.push(n);
- n = token;
+ while (token.arity === "name" || token.id === "\\") {
+ if (token.id !== "\\") {
+ t.first.push(n);
+ n = token;
+ }
advance();
}
if (token.arity === "literal" && t.first.length === 0) {