Monday, October 28, 2013

Fun with EXCON

I took a bit of time to revisit a fun script I wrote some time back.  I felt it was time to improve on this and build a full parser and encoder using TCL.  Scripting is such a great way of manipulating and playing around with strings.  TCL is my natural choice at the moment.  So the final script I ended up is this.

This will accept a file path and attempt to read the contents.  It will print the output on stdout and can read a long list of EXCON instructions or encode ASCII text into EXCON.  One note on the parser code (which is just the old script).  It will always clear the binary buffer after every line.  The script also does not support the fancy ! instruction call to simply print out the binary value in the buffer by the previous command.

No comments: