Posts

Showing posts with the label openjdk

Implementing a Parser and Simple Compiler for the Java Virtual Machine

Image
1. Overview   This document covers the implementation of a simple recursive-descent parser for an infix adder language with a lexer, parser, and compiler.  The language is implemented with Java and compiles to Java Virtual Machine (JVM) bytecode.  The first implementation of the compiler is different from other implementations because it is fully implemented in one class without third party parser generator libraries.  The implementation of the language only uses the Java standard libraries.  The code for the parser does not use a parser generator so it only contains pure Java standard libraries and no references to third-party libraries. I wanted to discuss this particular example it helps for you to understand the nature of programming languages and their implementation.  Don't be scared about the parsing input token routines in them.  They help as a tool to the developer.  This a basic implementation but at least I provided a JVM compiler...

OpenJDK Hotspot, source code line count

Here are some notes, source code analysis of hotspot: # perl cloc-1.53.pl src 1786 text files. 1716 unique files. 121 files ignored. ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C++ 673 64909 97522 340057 C/C++ Header 796 25928 49603 101144 XML 61 474 179 15360 Java 78 1908 2397 8663 C 11 1194 2327 7236 XSLT 7 560 166 4406 Assembly 6 89 36 2245 D 4 83 ...