mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-10-23 08:03:11 -06:00
Generate JavaScript type annotator. Use lindef in JavaScript.
This commit is contained in:
1 parent
5455046dd8
commit
e8b8185e04
8 files changed
+171
-99
No files matched your search
+98
-52
@@ -5,15 +5,27 @@ function Fun(name) {
|
|||||||
}
|
}
|
||||||
Fun.prototype.print = function () { return this.show(0); } ;
|
Fun.prototype.print = function () { return this.show(0); } ;
|
||||||
Fun.prototype.show = function (prec) {
|
Fun.prototype.show = function (prec) {
|
||||||
var s = this.name;
|
if (this.name == '?') {
|
||||||
var cs = this.getChildren();
|
if (isUndefined(this.type)) {
|
||||||
for (var i in cs) {
|
return '?';
|
||||||
s += " " + cs[i].show(1);
|
} else {
|
||||||
|
var s = '?:' + this.type;
|
||||||
|
if (prec > 0) {
|
||||||
|
s = "(" + s + ")" ;
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var s = this.name;
|
||||||
|
var cs = this.getChildren();
|
||||||
|
for (var i in cs) {
|
||||||
|
s += " " + cs[i].show(1);
|
||||||
|
}
|
||||||
|
if (prec > 0 && cs.length > 0) {
|
||||||
|
s = "(" + s + ")" ;
|
||||||
|
}
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
if (prec > 0 && cs.length > 0) {
|
|
||||||
s = "(" + s + ")" ;
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
};
|
};
|
||||||
Fun.prototype.getChild = function (i) {
|
Fun.prototype.getChild = function (i) {
|
||||||
return this['arg'+i];
|
return this['arg'+i];
|
||||||
@@ -33,44 +45,6 @@ Fun.prototype.getChildren = function () {
|
|||||||
return a;
|
return a;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
/* Hack to get around the fact that our SISR doesn't build real Fun objects. */
|
|
||||||
function copyTree(x) {
|
|
||||||
if (typeof x == 'string' && x == '?') {
|
|
||||||
return new Fun('?');
|
|
||||||
} else {
|
|
||||||
var t = new Fun(x.name);
|
|
||||||
for (var i = 0; ; i++) {
|
|
||||||
var c = x['arg' + i];
|
|
||||||
if (isUndefined(c)) { break; }
|
|
||||||
t.setChild(i, copyTree(c));
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseTree(str) {
|
|
||||||
return parseTree_(str.match(new RegExp("[\\w\\']+|\\(|\\)","g")), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseTree_(tokens, prec) {
|
|
||||||
if (tokens.length == 0 || tokens[0] == ")") { return null; }
|
|
||||||
var t = tokens.shift();
|
|
||||||
if (t == "(") {
|
|
||||||
var tree = parseTree_(tokens, 0);
|
|
||||||
tokens.shift();
|
|
||||||
return tree;
|
|
||||||
} else {
|
|
||||||
var tree = new Fun(t);
|
|
||||||
if (prec == 0) {
|
|
||||||
var c;
|
|
||||||
var i;
|
|
||||||
for (i = 0; (c = parseTree_(tokens, 1)) !== null; i++) {
|
|
||||||
tree.setChild(i,c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return tree;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Concrete syntax terms */
|
/* Concrete syntax terms */
|
||||||
|
|
||||||
@@ -104,17 +78,89 @@ function Int(value) { this.value = value; }
|
|||||||
Int.prototype.print = function() { return this.value; };
|
Int.prototype.print = function() { return this.value; };
|
||||||
Int.prototype.toIndex = function() { return this.value; };
|
Int.prototype.toIndex = function() { return this.value; };
|
||||||
|
|
||||||
|
/* Type annotation */
|
||||||
|
|
||||||
|
function Abstract() {
|
||||||
|
this.types = new Array();
|
||||||
|
}
|
||||||
|
Abstract.prototype.addType = function(fun, args, cat) {
|
||||||
|
this.types[fun] = new Type(args, cat);
|
||||||
|
} ;
|
||||||
|
Abstract.prototype.annotate = function(tree, type) {
|
||||||
|
if (tree.name == '?') {
|
||||||
|
tree.type = type;
|
||||||
|
} else {
|
||||||
|
var typ = this.types[tree.name];
|
||||||
|
var cs = tree.getChildren();
|
||||||
|
for (var i = 0; i < cs.length; i++) {
|
||||||
|
this.annotate(cs[i], typ.args[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tree;
|
||||||
|
} ;
|
||||||
|
/* Hack to get around the fact that our SISR doesn't build real Fun objects. */
|
||||||
|
Abstract.prototype.copyTree = function(x, type) {
|
||||||
|
return this.annotate(this.copyTree_(x), type);
|
||||||
|
};
|
||||||
|
Abstract.prototype.copyTree_ = function(x) {
|
||||||
|
if (typeof x == 'string' && x == '?') {
|
||||||
|
return new Fun('?');
|
||||||
|
} else {
|
||||||
|
var t = new Fun(x.name);
|
||||||
|
for (var i = 0; ; i++) {
|
||||||
|
var c = x['arg' + i];
|
||||||
|
if (isUndefined(c)) { break; }
|
||||||
|
t.setChild(i, this.copyTree(c));
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
Abstract.prototype.parseTree = function(str, type) {
|
||||||
|
return this.annotate(this.parseTree_(str.match(/[\w\']+|\(|\)|\?/g), 0), type);
|
||||||
|
} ;
|
||||||
|
Abstract.prototype.parseTree_ = function(tokens, prec) {
|
||||||
|
if (tokens.length == 0 || tokens[0] == ")") { return null; }
|
||||||
|
var t = tokens.shift();
|
||||||
|
if (t == "(") {
|
||||||
|
var tree = this.parseTree_(tokens, 0);
|
||||||
|
tokens.shift();
|
||||||
|
return tree;
|
||||||
|
} else if (t == '?') {
|
||||||
|
return new Fun('?');
|
||||||
|
} else {
|
||||||
|
var tree = new Fun(t);
|
||||||
|
if (prec == 0) {
|
||||||
|
var c, i;
|
||||||
|
for (i = 0; (c = this.parseTree_(tokens, 1)) !== null; i++) {
|
||||||
|
tree.setChild(i,c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tree;
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
function Type(args, cat) {
|
||||||
|
this.args = args;
|
||||||
|
this.cat = cat;
|
||||||
|
}
|
||||||
|
|
||||||
/* Linearization */
|
/* Linearization */
|
||||||
|
|
||||||
function Linearizer() {
|
function Concrete(abstr) {
|
||||||
|
this.abstr = abstr;
|
||||||
this.rules = new Array();
|
this.rules = new Array();
|
||||||
}
|
}
|
||||||
Linearizer.prototype.rule = function (name, cs) { return this.rules[name](cs); };
|
Concrete.prototype.rule = function (name, cs) { return this.rules[name](cs); };
|
||||||
Linearizer.prototype.addRule = function (name, f) { this.rules[name] = f; };
|
Concrete.prototype.addRule = function (name, f) { this.rules[name] = f; };
|
||||||
Linearizer.prototype.linearize = function (tree) { return this.linearizeToTerm(tree).print(); };
|
Concrete.prototype.lindef = function (cat, v) { return this.rules["_d"+cat]([new Str(v)]); } ;
|
||||||
Linearizer.prototype.linearizeToTerm = function (tree) {
|
Concrete.prototype.linearize = function (tree) { return this.linearizeToTerm(tree).print(); };
|
||||||
|
Concrete.prototype.linearizeToTerm = function (tree) {
|
||||||
if (tree.name == '?') {
|
if (tree.name == '?') {
|
||||||
return new Meta();
|
if (isUndefined(tree.type)) {
|
||||||
|
return new Meta();
|
||||||
|
} else {
|
||||||
|
return this.lindef(tree.type, tree.name);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
var cs = tree.getChildren();
|
var cs = tree.getChildren();
|
||||||
for (var i = 0; i < cs.length; i++) {
|
for (var i = 0; i < cs.length; i++) {
|
||||||
|
|||||||
@@ -11,11 +11,22 @@ prCanon2js :: CanonGrammar -> String
|
|||||||
prCanon2js gr = gfcc2js $ mkCanon2gfcc gr
|
prCanon2js gr = gfcc2js $ mkCanon2gfcc gr
|
||||||
|
|
||||||
gfcc2js :: C.Grammar -> String
|
gfcc2js :: C.Grammar -> String
|
||||||
gfcc2js (C.Grm _ _ cs) = JS.printTree $ JS.Program $ concatMap concrete2js cs
|
gfcc2js (C.Grm (C.Hdr n _) as cs) = JS.printTree $ JS.Program $ abstract2js n as ++ concatMap (concrete2js n) cs
|
||||||
|
|
||||||
concrete2js :: C.Concrete -> [JS.Element]
|
abstract2js :: C.CId -> C.Abstract -> [JS.Element]
|
||||||
concrete2js (C.Cnc (C.CId c) ds) =
|
abstract2js (C.CId n) (C.Abs ds) =
|
||||||
[JS.ElStmt $ JS.SDeclOrExpr $ JS.Decl [JS.DInit l (new "Linearizer" [])]]
|
[JS.ElStmt $ JS.SDeclOrExpr $ JS.Decl [JS.DInit a (new "Abstract" [])]]
|
||||||
|
++ concatMap (absdef2js a) ds
|
||||||
|
where a = JS.Ident n
|
||||||
|
|
||||||
|
absdef2js :: JS.Ident -> C.AbsDef -> [JS.Element]
|
||||||
|
absdef2js a (C.Fun (C.CId f) (C.Typ args (C.CId cat)) _) =
|
||||||
|
[JS.ElStmt $ JS.SDeclOrExpr $ JS.DExpr $ JS.ECall (JS.EMember (JS.EVar a) (JS.Ident "addType"))
|
||||||
|
[JS.EStr f, JS.EArray [JS.EStr x | C.CId x <- args], JS.EStr cat]]
|
||||||
|
|
||||||
|
concrete2js :: C.CId -> C.Concrete -> [JS.Element]
|
||||||
|
concrete2js (C.CId a) (C.Cnc (C.CId c) ds) =
|
||||||
|
[JS.ElStmt $ JS.SDeclOrExpr $ JS.Decl [JS.DInit l (new "Concrete" [JS.EVar (JS.Ident a)])]]
|
||||||
++ concatMap (cncdef2js l) ds
|
++ concatMap (cncdef2js l) ds
|
||||||
where l = JS.Ident c
|
where l = JS.Ident c
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ data Expr =
|
|||||||
| ENull
|
| ENull
|
||||||
| EThis
|
| EThis
|
||||||
| EFun [Ident] [Stmt]
|
| EFun [Ident] [Stmt]
|
||||||
|
| EArray [Expr]
|
||||||
| ESeq [Expr]
|
| ESeq [Expr]
|
||||||
deriving (Eq,Ord,Show)
|
deriving (Eq,Ord,Show)
|
||||||
|
|
||||||
@@ -38,6 +38,7 @@ EFalse. Expr16 ::= "false" ;
|
|||||||
ENull. Expr16 ::= "null" ;
|
ENull. Expr16 ::= "null" ;
|
||||||
EThis. Expr16 ::= "this" ;
|
EThis. Expr16 ::= "this" ;
|
||||||
EFun. Expr16 ::= "function" "(" [Ident] ")" "{" [Stmt] "}" ;
|
EFun. Expr16 ::= "function" "(" [Ident] ")" "{" [Stmt] "}" ;
|
||||||
|
EArray. Expr16 ::= "[" [Expr] "]" ;
|
||||||
|
|
||||||
eseq1. Expr16 ::= "(" Expr "," [Expr] ")";
|
eseq1. Expr16 ::= "(" Expr "," [Expr] ")";
|
||||||
internal ESeq. Expr16 ::= "(" [Expr] ")" ;
|
internal ESeq. Expr16 ::= "(" [Expr] ")" ;
|
||||||
|
|||||||
+53
-43
@@ -212,21 +212,21 @@ happyOutTok x = unsafeCoerce# x
|
|||||||
{-# INLINE happyOutTok #-}
|
{-# INLINE happyOutTok #-}
|
||||||
|
|
||||||
happyActOffsets :: HappyAddr
|
happyActOffsets :: HappyAddr
|
||||||
happyActOffsets = HappyA# "\x00\x00\x76\x00\x00\x00\x70\x00\x78\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x00\x00\x00\x9a\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9c\x01\x00\x00\x00\x00\x11\x00\x73\x00\x00\x00\x8e\x01\x00\x00\x00\x00\x73\x00\x00\x00\x00\x00\x00\x00\x99\x00\x82\x00\x00\x00\x7f\x00\x00\x00\x83\x00\x81\x00\x69\x00\x56\x00\x62\x01\x05\x00\x9c\x01\x56\x00\x9c\x01\x9c\x01\x00\x00\x00\x00\x59\x00\x00\x00\x66\x00\x7e\x00\x00\x00\x9c\x01\x00\x00\x00\x00\x7c\x00\x65\x00\x35\x00\x9c\x01\x00\x00\x35\x00\x9c\x01\x00\x00\x00\x00\x64\x00\x63\x00\x61\x00\x34\x00\x60\x00\x9c\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\x00\x00\x00\x00\x00\x4c\x01\x00\x00\x36\x01\x00\x00\x00\x00"#
|
happyActOffsets = HappyA# "\x00\x00\x91\x00\x00\x00\x8a\x00\x97\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x00\x00\x00\x9a\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\x01\x00\x00\xbb\x01\x00\x00\x11\x00\x75\x00\x00\x00\xad\x01\x00\x00\x00\x00\x75\x00\x00\x00\x00\x00\x00\x00\x82\x00\x9b\x00\x00\x00\x81\x00\x00\x00\x85\x00\x84\x00\x83\x00\x57\x00\x78\x00\x7e\x00\x81\x01\x05\x00\xbb\x01\x56\x00\xbb\x01\xbb\x01\x00\x00\x00\x00\x59\x00\x00\x00\x66\x00\x00\x00\xbb\x01\x00\x00\x00\x00\xbb\x01\x00\x00\x7c\x00\x65\x00\x35\x00\xbb\x01\x00\x00\x35\x00\xbb\x01\x00\x00\x00\x00\x64\x00\x63\x00\x61\x00\x34\x00\x00\x00\x60\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\x00\x00\x00\x00\x00\x6b\x01\x00\x00\x55\x01\x00\x00\x00\x00"#
|
||||||
|
|
||||||
happyGotoOffsets :: HappyAddr
|
happyGotoOffsets :: HappyAddr
|
||||||
happyGotoOffsets = HappyA# "\x23\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x01\x3d\x00\x00\x00\x45\x00\x31\x00\x00\x00\xf9\x00\x00\x00\x00\x00\xbb\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x44\x00\x20\x00\x00\x00\x9c\x00\x2b\x00\xda\x00\xb3\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x43\x00\x5e\x00\x00\x00\xae\x01\xbb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x25\x00\x00\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x00\x00\x00\x00\xff\xff\x20\x00\x00\x00\x20\x00\x00\x00\x00\x00"#
|
happyGotoOffsets = HappyA# "\x23\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x37\x01\x3d\x00\xbb\x00\x00\x00\x45\x00\x31\x00\x00\x00\x18\x01\x00\x00\x00\x00\xda\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x44\x00\x00\x00\x00\x00\x20\x00\x00\x00\x9c\x00\x2b\x00\xf9\x00\xd2\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x00\x00\x00\x00\x00\x5e\x00\x00\x00\x00\x00\x00\x00\x43\x00\x3f\x00\x00\x00\xcd\x01\xda\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x25\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x00\x00\x00\x00\xff\xff\x20\x00\x00\x00\x20\x00\x00\x00\x00\x00"#
|
||||||
|
|
||||||
happyDefActions :: HappyAddr
|
happyDefActions :: HappyAddr
|
||||||
happyDefActions = HappyA# "\xf7\xff\x00\x00\xfe\xff\x00\x00\xfa\xff\xdd\xff\xdc\xff\xdb\xff\xda\xff\xf6\xff\xf8\xff\x00\x00\xc3\xff\xe4\xff\xe2\xff\xde\xff\xeb\xff\xcf\xff\xce\xff\xcd\xff\xcc\xff\xcb\xff\xca\xff\xc9\xff\xc8\xff\xc7\xff\xc6\xff\xc5\xff\xc4\xff\x00\x00\xee\xff\xd8\xff\x00\x00\x00\x00\xd7\xff\x00\x00\xd6\xff\xd9\xff\xe8\xff\xfd\xff\xfc\xff\xfb\xff\xea\xff\xe7\xff\xec\xff\x00\x00\xf1\xff\x00\x00\x00\x00\x00\x00\xf5\xff\x00\x00\x00\x00\xd2\xff\x00\x00\x00\x00\x00\x00\xef\xff\xe5\xff\x00\x00\xe1\xff\x00\x00\xd1\xff\xd3\xff\xd2\xff\xed\xff\xf2\xff\xf4\xff\x00\x00\xf5\xff\xd2\xff\xf0\xff\xe8\xff\x00\x00\xe9\xff\xe6\xff\x00\x00\x00\x00\x00\x00\xf5\xff\x00\x00\xd2\xff\xdf\xff\xe0\xff\xd0\xff\xd4\xff\xf3\xff\xee\xff\x00\x00\xe3\xff\xee\xff\x00\x00\xd5\xff\x00\x00\xf9\xff"#
|
happyDefActions = HappyA# "\xf7\xff\x00\x00\xfe\xff\x00\x00\xfa\xff\xdd\xff\xdc\xff\xdb\xff\xda\xff\xf6\xff\xf8\xff\x00\x00\xc2\xff\xe4\xff\xe2\xff\xde\xff\xeb\xff\xce\xff\xcd\xff\xcc\xff\xcb\xff\xca\xff\xc9\xff\xc8\xff\xc7\xff\xc6\xff\xc5\xff\xc4\xff\xc3\xff\x00\x00\xee\xff\xd1\xff\xd8\xff\x00\x00\x00\x00\xd7\xff\x00\x00\xd6\xff\xd9\xff\xe8\xff\xfd\xff\xfc\xff\xfb\xff\xea\xff\xe7\xff\xec\xff\x00\x00\xf1\xff\x00\x00\x00\x00\x00\x00\xf5\xff\x00\x00\xd0\xff\x00\x00\x00\x00\xd1\xff\x00\x00\x00\x00\x00\x00\xef\xff\xe5\xff\x00\x00\xe1\xff\x00\x00\xd2\xff\xd1\xff\xed\xff\xf2\xff\xd1\xff\xd4\xff\xf4\xff\x00\x00\xf5\xff\xd1\xff\xf0\xff\xe8\xff\x00\x00\xe9\xff\xe6\xff\x00\x00\x00\x00\x00\x00\xf5\xff\xcf\xff\x00\x00\xdf\xff\xe0\xff\xd3\xff\xf3\xff\xee\xff\x00\x00\xe3\xff\xee\xff\x00\x00\xd5\xff\x00\x00\xf9\xff"#
|
||||||
|
|
||||||
happyCheck :: HappyAddr
|
happyCheck :: HappyAddr
|
||||||
happyCheck = HappyA# "\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x01\x00\x05\x00\x02\x00\x09\x00\x08\x00\x05\x00\x0a\x00\x08\x00\x09\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x01\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x13\x00\x00\x00\x09\x00\x04\x00\x08\x00\x06\x00\x0a\x00\x00\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x00\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x00\x00\x00\x00\x00\x00\x09\x00\x13\x00\x13\x00\x03\x00\x07\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x02\x00\x0a\x00\x03\x00\x02\x00\x02\x00\x02\x00\x02\x00\x13\x00\x01\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x05\x00\x01\x00\x05\x00\x01\x00\x06\x00\x13\x00\x05\x00\x18\x00\x13\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x07\x00\x07\x00\xff\xff\x06\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\x06\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x01\x00\x10\x00\x11\x00\xff\xff\x13\x00\x14\x00\x15\x00\x16\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\xff\xff\x10\x00\x11\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
|
happyCheck = HappyA# "\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x01\x00\x05\x00\x02\x00\x09\x00\x08\x00\x05\x00\x0a\x00\x08\x00\x09\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x01\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x13\x00\x00\x00\x09\x00\x04\x00\x08\x00\x06\x00\x0a\x00\x00\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x00\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x00\x00\x00\x00\x00\x00\x09\x00\x13\x00\x13\x00\x03\x00\x07\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x02\x00\x0a\x00\x03\x00\x02\x00\x02\x00\x02\x00\x02\x00\x13\x00\x13\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x05\x00\x0a\x00\x05\x00\x01\x00\x01\x00\x01\x00\x06\x00\x13\x00\x07\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x05\x00\x07\x00\x18\x00\x06\x00\x13\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\x06\x00\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x01\x00\x10\x00\x11\x00\xff\xff\x13\x00\x14\x00\x15\x00\x16\x00\x09\x00\xff\xff\x0b\x00\x0c\x00\x0d\x00\x0e\x00\xff\xff\x10\x00\x11\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0e\x00\x0f\x00\x10\x00\xff\xff\xff\xff\x0b\x00\x0c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
|
||||||
|
|
||||||
happyTable :: HappyAddr
|
happyTable :: HappyAddr
|
||||||
happyTable = HappyA# "\x00\x00\x05\x00\x06\x00\x07\x00\x08\x00\x36\x00\x09\x00\x40\x00\x5d\x00\x0a\x00\x41\x00\x0b\x00\x37\x00\x38\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x33\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x03\x00\x43\x00\x5b\x00\x03\x00\x41\x00\x04\x00\x0b\x00\x3c\x00\x56\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x30\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x43\x00\x43\x00\x31\x00\x33\x00\x03\x00\x03\x00\x5b\x00\x4d\x00\x44\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x54\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x56\x00\x54\x00\x58\x00\x59\x00\x5a\x00\x4f\x00\x53\x00\x03\x00\x46\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x4c\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x50\x00\x47\x00\x52\x00\x33\x00\x48\x00\x03\x00\x49\x00\xff\xff\x03\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x50\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x4a\x00\x39\x00\x00\x00\x3a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x3d\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x4a\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x3b\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x2d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x34\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1e\x00\x00\x00\x1f\x00\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x1e\x00\x00\x00\x1f\x00\x5d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x1e\x00\x00\x00\x1f\x00\x43\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x1e\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x1e\x00\x25\x00\x26\x00\x00\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x00\x00\x00\x00\x20\x00\x30\x00\x22\x00\x23\x00\x00\x00\x25\x00\x26\x00\x2a\x00\x03\x00\x28\x00\x29\x00\x2a\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x2b\x00\x4b\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3a\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x00\x00\x2b\x00\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
|
happyTable = HappyA# "\x00\x00\x05\x00\x06\x00\x07\x00\x08\x00\x39\x00\x09\x00\x42\x00\x60\x00\x0a\x00\x43\x00\x0b\x00\x3a\x00\x3b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x34\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x03\x00\x47\x00\x5e\x00\x03\x00\x43\x00\x04\x00\x0b\x00\x3f\x00\x59\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x31\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x47\x00\x47\x00\x32\x00\x36\x00\x03\x00\x03\x00\x5e\x00\x51\x00\x48\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x50\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x59\x00\x58\x00\x5b\x00\x5c\x00\x5d\x00\x53\x00\x57\x00\x03\x00\x03\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x54\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x54\x00\x47\x00\x46\x00\x4a\x00\x4b\x00\x34\x00\x4c\x00\x03\x00\x4e\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x55\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x4d\x00\x3c\x00\xff\xff\x3d\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x40\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x34\x00\x35\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x4e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x3e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x2e\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x37\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1e\x00\x00\x00\x1f\x00\x62\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x1e\x00\x00\x00\x1f\x00\x60\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x1e\x00\x00\x00\x1f\x00\x45\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x1e\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x1e\x00\x26\x00\x27\x00\x00\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x20\x00\x00\x00\x21\x00\x31\x00\x23\x00\x24\x00\x00\x00\x26\x00\x27\x00\x2b\x00\x03\x00\x29\x00\x2a\x00\x2b\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x2c\x00\x4f\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3d\x00\x0d\x00\x0e\x00\x0f\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
|
||||||
|
|
||||||
happyReduceArr = array (1, 60) [
|
happyReduceArr = array (1, 61) [
|
||||||
(1 , happyReduce_1),
|
(1 , happyReduce_1),
|
||||||
(2 , happyReduce_2),
|
(2 , happyReduce_2),
|
||||||
(3 , happyReduce_3),
|
(3 , happyReduce_3),
|
||||||
@@ -286,7 +286,8 @@ happyReduceArr = array (1, 60) [
|
|||||||
(57 , happyReduce_57),
|
(57 , happyReduce_57),
|
||||||
(58 , happyReduce_58),
|
(58 , happyReduce_58),
|
||||||
(59 , happyReduce_59),
|
(59 , happyReduce_59),
|
||||||
(60 , happyReduce_60)
|
(60 , happyReduce_60),
|
||||||
|
(61 , happyReduce_61)
|
||||||
]
|
]
|
||||||
|
|
||||||
happy_n_terms = 25 :: Int
|
happy_n_terms = 25 :: Int
|
||||||
@@ -633,8 +634,17 @@ happyReduction_42 (happy_x_7 `HappyStk`
|
|||||||
(EFun happy_var_3 (reverse happy_var_6)
|
(EFun happy_var_3 (reverse happy_var_6)
|
||||||
) `HappyStk` happyRest}}
|
) `HappyStk` happyRest}}
|
||||||
|
|
||||||
happyReduce_43 = happyReduce 5# 16# happyReduction_43
|
happyReduce_43 = happySpecReduce_3 16# happyReduction_43
|
||||||
happyReduction_43 (happy_x_5 `HappyStk`
|
happyReduction_43 happy_x_3
|
||||||
|
happy_x_2
|
||||||
|
happy_x_1
|
||||||
|
= case happyOut21 happy_x_2 of { happy_var_2 ->
|
||||||
|
happyIn20
|
||||||
|
(EArray happy_var_2
|
||||||
|
)}
|
||||||
|
|
||||||
|
happyReduce_44 = happyReduce 5# 16# happyReduction_44
|
||||||
|
happyReduction_44 (happy_x_5 `HappyStk`
|
||||||
happy_x_4 `HappyStk`
|
happy_x_4 `HappyStk`
|
||||||
happy_x_3 `HappyStk`
|
happy_x_3 `HappyStk`
|
||||||
happy_x_2 `HappyStk`
|
happy_x_2 `HappyStk`
|
||||||
@@ -646,8 +656,8 @@ happyReduction_43 (happy_x_5 `HappyStk`
|
|||||||
(eseq1_ happy_var_2 happy_var_4
|
(eseq1_ happy_var_2 happy_var_4
|
||||||
) `HappyStk` happyRest}}
|
) `HappyStk` happyRest}}
|
||||||
|
|
||||||
happyReduce_44 = happySpecReduce_3 16# happyReduction_44
|
happyReduce_45 = happySpecReduce_3 16# happyReduction_45
|
||||||
happyReduction_44 happy_x_3
|
happyReduction_45 happy_x_3
|
||||||
happy_x_2
|
happy_x_2
|
||||||
happy_x_1
|
happy_x_1
|
||||||
= case happyOut22 happy_x_2 of { happy_var_2 ->
|
= case happyOut22 happy_x_2 of { happy_var_2 ->
|
||||||
@@ -655,20 +665,20 @@ happyReduction_44 happy_x_3
|
|||||||
(happy_var_2
|
(happy_var_2
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_45 = happySpecReduce_0 17# happyReduction_45
|
happyReduce_46 = happySpecReduce_0 17# happyReduction_46
|
||||||
happyReduction_45 = happyIn21
|
happyReduction_46 = happyIn21
|
||||||
([]
|
([]
|
||||||
)
|
)
|
||||||
|
|
||||||
happyReduce_46 = happySpecReduce_1 17# happyReduction_46
|
happyReduce_47 = happySpecReduce_1 17# happyReduction_47
|
||||||
happyReduction_46 happy_x_1
|
happyReduction_47 happy_x_1
|
||||||
= case happyOut22 happy_x_1 of { happy_var_1 ->
|
= case happyOut22 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn21
|
happyIn21
|
||||||
((:[]) happy_var_1
|
((:[]) happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_47 = happySpecReduce_3 17# happyReduction_47
|
happyReduce_48 = happySpecReduce_3 17# happyReduction_48
|
||||||
happyReduction_47 happy_x_3
|
happyReduction_48 happy_x_3
|
||||||
happy_x_2
|
happy_x_2
|
||||||
happy_x_1
|
happy_x_1
|
||||||
= case happyOut22 happy_x_1 of { happy_var_1 ->
|
= case happyOut22 happy_x_1 of { happy_var_1 ->
|
||||||
@@ -677,92 +687,92 @@ happyReduction_47 happy_x_3
|
|||||||
((:) happy_var_1 happy_var_3
|
((:) happy_var_1 happy_var_3
|
||||||
)}}
|
)}}
|
||||||
|
|
||||||
happyReduce_48 = happySpecReduce_1 18# happyReduction_48
|
happyReduce_49 = happySpecReduce_1 18# happyReduction_49
|
||||||
happyReduction_48 happy_x_1
|
happyReduction_49 happy_x_1
|
||||||
= case happyOut23 happy_x_1 of { happy_var_1 ->
|
= case happyOut23 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn22
|
happyIn22
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_49 = happySpecReduce_1 19# happyReduction_49
|
happyReduce_50 = happySpecReduce_1 19# happyReduction_50
|
||||||
happyReduction_49 happy_x_1
|
happyReduction_50 happy_x_1
|
||||||
= case happyOut24 happy_x_1 of { happy_var_1 ->
|
= case happyOut24 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn23
|
happyIn23
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_50 = happySpecReduce_1 20# happyReduction_50
|
happyReduce_51 = happySpecReduce_1 20# happyReduction_51
|
||||||
happyReduction_50 happy_x_1
|
happyReduction_51 happy_x_1
|
||||||
= case happyOut25 happy_x_1 of { happy_var_1 ->
|
= case happyOut25 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn24
|
happyIn24
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_51 = happySpecReduce_1 21# happyReduction_51
|
happyReduce_52 = happySpecReduce_1 21# happyReduction_52
|
||||||
happyReduction_51 happy_x_1
|
happyReduction_52 happy_x_1
|
||||||
= case happyOut26 happy_x_1 of { happy_var_1 ->
|
= case happyOut26 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn25
|
happyIn25
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_52 = happySpecReduce_1 22# happyReduction_52
|
happyReduce_53 = happySpecReduce_1 22# happyReduction_53
|
||||||
happyReduction_52 happy_x_1
|
happyReduction_53 happy_x_1
|
||||||
= case happyOut27 happy_x_1 of { happy_var_1 ->
|
= case happyOut27 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn26
|
happyIn26
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_53 = happySpecReduce_1 23# happyReduction_53
|
happyReduce_54 = happySpecReduce_1 23# happyReduction_54
|
||||||
happyReduction_53 happy_x_1
|
happyReduction_54 happy_x_1
|
||||||
= case happyOut28 happy_x_1 of { happy_var_1 ->
|
= case happyOut28 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn27
|
happyIn27
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_54 = happySpecReduce_1 24# happyReduction_54
|
happyReduce_55 = happySpecReduce_1 24# happyReduction_55
|
||||||
happyReduction_54 happy_x_1
|
happyReduction_55 happy_x_1
|
||||||
= case happyOut29 happy_x_1 of { happy_var_1 ->
|
= case happyOut29 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn28
|
happyIn28
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_55 = happySpecReduce_1 25# happyReduction_55
|
happyReduce_56 = happySpecReduce_1 25# happyReduction_56
|
||||||
happyReduction_55 happy_x_1
|
happyReduction_56 happy_x_1
|
||||||
= case happyOut30 happy_x_1 of { happy_var_1 ->
|
= case happyOut30 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn29
|
happyIn29
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_56 = happySpecReduce_1 26# happyReduction_56
|
happyReduce_57 = happySpecReduce_1 26# happyReduction_57
|
||||||
happyReduction_56 happy_x_1
|
happyReduction_57 happy_x_1
|
||||||
= case happyOut31 happy_x_1 of { happy_var_1 ->
|
= case happyOut31 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn30
|
happyIn30
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_57 = happySpecReduce_1 27# happyReduction_57
|
happyReduce_58 = happySpecReduce_1 27# happyReduction_58
|
||||||
happyReduction_57 happy_x_1
|
happyReduction_58 happy_x_1
|
||||||
= case happyOut32 happy_x_1 of { happy_var_1 ->
|
= case happyOut32 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn31
|
happyIn31
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_58 = happySpecReduce_1 28# happyReduction_58
|
happyReduce_59 = happySpecReduce_1 28# happyReduction_59
|
||||||
happyReduction_58 happy_x_1
|
happyReduction_59 happy_x_1
|
||||||
= case happyOut33 happy_x_1 of { happy_var_1 ->
|
= case happyOut33 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn32
|
happyIn32
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_59 = happySpecReduce_1 29# happyReduction_59
|
happyReduce_60 = happySpecReduce_1 29# happyReduction_60
|
||||||
happyReduction_59 happy_x_1
|
happyReduction_60 happy_x_1
|
||||||
= case happyOut34 happy_x_1 of { happy_var_1 ->
|
= case happyOut34 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn33
|
happyIn33
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
)}
|
)}
|
||||||
|
|
||||||
happyReduce_60 = happySpecReduce_1 30# happyReduction_60
|
happyReduce_61 = happySpecReduce_1 30# happyReduction_61
|
||||||
happyReduction_60 happy_x_1
|
happyReduction_61 happy_x_1
|
||||||
= case happyOut17 happy_x_1 of { happy_var_1 ->
|
= case happyOut17 happy_x_1 of { happy_var_1 ->
|
||||||
happyIn34
|
happyIn34
|
||||||
(happy_var_1
|
(happy_var_1
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ Expr16 : Ident { EVar $1 }
|
|||||||
| 'null' { ENull }
|
| 'null' { ENull }
|
||||||
| 'this' { EThis }
|
| 'this' { EThis }
|
||||||
| 'function' '(' ListIdent ')' '{' ListStmt '}' { EFun $3 (reverse $6) }
|
| 'function' '(' ListIdent ')' '{' ListStmt '}' { EFun $3 (reverse $6) }
|
||||||
|
| '[' ListExpr ']' { EArray $2 }
|
||||||
| '(' Expr ',' ListExpr ')' { eseq1_ $2 $4 }
|
| '(' Expr ',' ListExpr ')' { eseq1_ $2 $4 }
|
||||||
| '(' Expr ')' { $2 }
|
| '(' Expr ')' { $2 }
|
||||||
|
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ instance Print Expr where
|
|||||||
ENull -> prPrec i 16 (concatD [doc (showString "null")])
|
ENull -> prPrec i 16 (concatD [doc (showString "null")])
|
||||||
EThis -> prPrec i 16 (concatD [doc (showString "this")])
|
EThis -> prPrec i 16 (concatD [doc (showString "this")])
|
||||||
EFun ids stmts -> prPrec i 16 (concatD [doc (showString "function") , doc (showString "(") , prt 0 ids , doc (showString ")") , doc (showString "{") , prt 0 stmts , doc (showString "}")])
|
EFun ids stmts -> prPrec i 16 (concatD [doc (showString "function") , doc (showString "(") , prt 0 ids , doc (showString ")") , doc (showString "{") , prt 0 stmts , doc (showString "}")])
|
||||||
|
EArray exprs -> prPrec i 16 (concatD [doc (showString "[") , prt 0 exprs , doc (showString "]")])
|
||||||
ESeq exprs -> prPrec i 16 (concatD [doc (showString "(") , prt 0 exprs , doc (showString ")")])
|
ESeq exprs -> prPrec i 16 (concatD [doc (showString "(") , prt 0 exprs , doc (showString ")")])
|
||||||
|
|
||||||
prtList es = case es of
|
prtList es = case es of
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ transExpr x = case x of
|
|||||||
ENull -> failure x
|
ENull -> failure x
|
||||||
EThis -> failure x
|
EThis -> failure x
|
||||||
EFun ids stmts -> failure x
|
EFun ids stmts -> failure x
|
||||||
|
EArray exprs -> failure x
|
||||||
ESeq exprs -> failure x
|
ESeq exprs -> failure x
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user