|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
parseProg(){ |
|
|
parseProg(){ |
|
|
let line = this.stream.line(); |
|
|
let line = this.stream.line(); |
|
|
let col = this.stream.col(); |
|
|
let col = this.stream.col(); |
|
|
|
|
|
|
|
|
col: col |
|
|
col: col |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
parse(tokens){ |
|
|
parse(tokens){ |
|
|
if (tokens) |
|
|
if (tokens) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.__stream !== null){ |
|
|
if (this.__stream !== null){ |
|
|
if (this.__output === null && this.__stream.pos() === 0) |
|
|
if (this.__output === null && this.__stream.pos() === 0) |
|
|
this.__output = this.parseProg(); |
|
|
|
|
|
|
|
|
this.__output = this.parseBlock(); |
|
|
return this.__output; |
|
|
return this.__output; |
|
|
} |
|
|
} |
|
|
return null; |
|
|
return null; |