Ladies and Gentlemen,
The day you have all[1] been waiting for is here.
Surf on over and have a look at the GIT repository on Google Code for the Java source code to the current version of the PLUS interpreter. If you happen to switch to the "test" repository, you can also see some test cases. (Some deliberately trigger an error message.)
Here's a quick guide to the source code.
The main routine is (shockingly enough) in Main.java.
Stuff related to code generation (generically) and the bytecode interpreter are in the "run" subpackage.
The other subpackages are all about different categories of the various objects[2] generated during parsing. Presently these also participate directly in type-checking and code generation. This might not be the best way to organize it, but it was that or a bazillion classes all together.
All the broad generalities of type checking are found in the main "plus" package, alongside Main.java.
Also in the same package, you can find the (few) built-in functions, which are presently all defined in B.java. (Horrible name, except that lots of things refer to the built-in types and we can always refactor...)
1: Those of you with a Java development environment installed, anyway. We'll get a Jar file available for download soon enough.
2: Syntax tree nodes, for the geeky.
No comments:
Post a Comment