The Java Syntactic Extender - TO DO
Enhancements
Housekeeping
- Ensure code has a consistent coding convention.
- Write unit tests for the framents library.
- Remove unused code. (E.g. Symbol class)
- Use a standard logging package (e.g. log4j).
- Improve javadoc.
Parser
- Check (write a test) that the ternary operator ? : does not conflict with pattern variables denoted by ?.
- Update to use latest ANTLR Java grammar that supports latest Java language spec (strictfp etc.)
- Make pretty-printing prettier (e.g. "java.util.Iterator" rather than "java . util . Iterator").
- Preserve whitespace for the
lineup
option. See this article on the ANTLR site.
Macros
- Get a macro-defining macro (e.g. alias) working with the current execution model.
- Implement hygiene. This is obviously harder than the previous items, but it is probably needed if JSE is ever to have wider takeup.
- Implement class-scoped syntax. Rather than creating an inner class as the original JSE paper suggests, ContactDatabase.withOpen could be ContactDatabase_withOpenSExpander - a top-level class rather than a nested static class. This way it avoids the execution model issues mentioned. The only drawback is that it loses visability.
- Explore different source tree organisations. For example, put macro definitions in
.jse
files, but keep Java that only has macro calls in the usual .java
files.
Tools
- Write a JSE plugin for the Eclipse IDE.
- Write code to expand an arbitrary code fragmant. Integrate into the Eclipse plugin.
- Add a timer that stops the JSE Ant task if it takes longer than a pre-set timeout (typically a recursive expander).
Bugs
- Line numbers are not preserved properly with a double "unless" macro.
- Syntax macros lose their "public" modifier if there is no code (e.g. an import) in the file before the "public".