summaryrefslogtreecommitdiff
path: root/tools/JackCompiler.bat
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-08-16 11:53:39 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-08-16 11:53:39 +0800
commit9c0cb1d1c32724fc95ac9548e4f8d873d3adaccc (patch)
tree1c12cfcb04dd4e298ddf6c4a5b8d10ea3c4ad47c /tools/JackCompiler.bat
nand2tetris software suite
Diffstat (limited to 'tools/JackCompiler.bat')
-rw-r--r--tools/JackCompiler.bat26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/JackCompiler.bat b/tools/JackCompiler.bat
new file mode 100644
index 0000000..9399b94
--- /dev/null
+++ b/tools/JackCompiler.bat
@@ -0,0 +1,26 @@
+@echo off
+
+rem $Id: JackCompiler.bat,v 1.2 2014/05/10 00:52:43 marka Exp $
+rem mark.armbrust@pobox.com
+
+setlocal
+if not "%2"=="" goto :USAGE
+if "%~1"=="/?" (
+:USAGE
+ echo Usage:
+ echo JackCompiler Compiles all .jack files in the current
+ echo working directory.
+ echo JackCompiler DIRECTORY Compiles all .jack files in DIRECTORY.
+ echo JackCompiler FILE.jack Compiles FILE.jack to FILE.vm.
+ exit -b
+)
+if not "%~1"=="" (
+ set "_arg1=%~f1"
+) else (
+ set "_arg1=%CD%"
+)
+pushd "%~dp0"
+echo Compiling "%_arg1%"
+java -classpath "%CLASSPATH%;bin/classes;bin/lib/Hack.jar;bin/lib/Compilers.jar" ^
+ Hack.Compiler.JackCompiler "%_arg1%"
+popd