Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
940a86f
commit b9c93fa
Showing
6 changed files
with
3,397 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
console.log("ATScript compiler. See more at http://atscript.net"); | ||
console.log("COPYRIGHT 2017 (c) ATScript Development Team"); | ||
|
||
var fs = require("fs"); | ||
|
||
if (process.argv.length == 4){ | ||
var ats_script = fs.readFileSync(process.argv[2]); | ||
|
||
var at_parser = require("./lib/ATScript-parser.js"); | ||
var at_generator = require("./lib/AT-generator.js"); | ||
var ast = at_parser.parse(ats_script, false); | ||
var at_code = at_generator.gen_code(ast, {}); | ||
|
||
//console.log(at_code); | ||
|
||
fs.writeFile(process.argv[3], at_code, function(err) { | ||
if (err) { | ||
return console.error(err); | ||
} | ||
|
||
console.log("AT code written to output file."); | ||
}); | ||
} else { | ||
console.log("Usage: node ATScompiler.js inputfile.ats outputfile.at"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.