This commit is contained in:
Peter Boyer 2016-06-17 19:21:11 -04:00
parent 6c717889b2
commit 97bf8d63f8
1 changed files with 6 additions and 7 deletions

View File

@ -1,9 +1,7 @@
PORT_DEBUG = false
var antlr4 = require('./antlr4/index'); var antlr4 = require('./antlr4/index');
var TLexer = require('./TLexer'); var DesignScriptLexer = require('./DesignScriptLexer');
var TParser = require('./TParser'); var DesignScriptParser = require('./DesignScriptParser');
var TListener = require('./TListener').TListener; var DesignScriptListener = require('./DesignScriptListener').DesignScriptListener;
// var TVisitor = require('./parser/TVisitor').TVisitor; // var TVisitor = require('./parser/TVisitor').TVisitor;
function TreeShapeListener() { function TreeShapeListener() {
@ -25,10 +23,11 @@ TreeShapeListener.prototype.enterEveryRule = function(ctx) {
}; };
function main(argv) { function main(argv) {
PORT_DEBUG =true
var input = new antlr4.FileStream(argv[2]); var input = new antlr4.FileStream(argv[2]);
var lexer = new TLexer.TLexer(input); var lexer = new DesignScriptLexer.DesignScriptLexer(input);
var stream = new antlr4.CommonTokenStream(lexer); var stream = new antlr4.CommonTokenStream(lexer);
var parser = new TParser.TParser(stream); var parser = new DesignScriptParser.DesignScriptParser(stream);
parser.buildParseTrees = true; parser.buildParseTrees = true;
printer = function() { printer = function() {
this.println = function(s) { console.log(s); } this.println = function(s) { console.log(s); }