2017-06-19 13:47:55 +00:00
|
|
|
function HMML_parse(contents) {
|
|
|
|
var l = new HMMLexer();
|
|
|
|
var state = {
|
|
|
|
line: 0,
|
|
|
|
annos: [],
|
2017-06-20 20:15:26 +00:00
|
|
|
meta: {
|
|
|
|
annotators: [],
|
|
|
|
guests: [],
|
|
|
|
co_hosts: []
|
|
|
|
},
|
2017-06-19 13:47:55 +00:00
|
|
|
an: {
|
|
|
|
line: 0,
|
|
|
|
text: "",
|
|
|
|
references: [],
|
|
|
|
markers: [],
|
|
|
|
},
|
2017-06-19 17:23:17 +00:00
|
|
|
ref: {},
|
2017-06-19 13:47:55 +00:00
|
|
|
first: true
|
|
|
|
};
|
|
|
|
l.setInput(contents, state);
|
|
|
|
|
|
|
|
try {
|
|
|
|
var r;
|
|
|
|
do {
|
|
|
|
r = l.next();
|
|
|
|
} while (!r);
|
|
|
|
return {
|
|
|
|
metadata: state.meta,
|
|
|
|
annotations: state.annos
|
|
|
|
};
|
|
|
|
} catch (e) {
|
|
|
|
return {
|
2017-06-19 15:31:46 +00:00
|
|
|
error: e
|
2017-06-19 13:47:55 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function HMMLexer() {}
|
|
|
|
/* generated by jison-lex 0.3.4 */
|
|
|
|
HMMLexer.prototype = {
|