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(); } } }
How to free more space on your home drive by redirecting the location for SDKs in RAD Studio
Learn the command line used to compile System.pas in Delphi
A method to design records so that they're allocated on a specific byte boundary, such as 16 bytes, 512 bytes, 4096 bytes, etc.
Learn why the map is cool in Go!