About the author
package cx.ath.journeyman.JavaTranslator; import java.io.FileInputStream; import java.io.IOException; import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.ParseTreeWalker; import cx.ath.journeyman.JavaTranslator.generated.JavaLexer; import cx.ath.journeyman.JavaTranslator.generated.JavaParser; public class JavaTranslator { /** * @param args */ public static void main(String[] args) { String Directory = "C:\\temp\\"; String filename = "Main.java"; String fullFilename = Directory + filename; try { FileInputStream fis = new FileInputStream(fullFilename); ANTLRInputStream input = new ANTLRInputStream(fis); JavaLexer lexer = new JavaLexer(input); CommonTokenStream tokens = new CommonTokenStream(lexer); JavaParser parser = new JavaParser(tokens); ParseTree tree = parser.compilationUnit(); // parse System.out.println(tree.toStringTree()); ParseTreeWalker walker = new ParseTreeWalker(); // create standard // walker ExtractInterfaceListener extractor = new ExtractInterfaceListener( parser, "c:\\temp\\" + filename); walker.walk(extractor, tree); // initiate walk of tree with listener } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
Continued discussion of undocumented Delphi 8 Property Access Specifiers, and other ways of adding and removing delegates / events handlers, including clearing the list of all the delegates / event handlers.
This article discusses the new Delphi 8 property access specifiers.
A method pointer is now the same as a global procedure, ie, procedure of object = procedure.