In java compiler JCTree.java the JCVariableDecl is defined as the following: However, I am not sure how nameexpr can be useful here. In what situation nameexpr field is not null? I have read the BNF of Java 8 and JavacParser.java it seems that we need to construct a case to make pn.hasTag(Tag.IDENT) && ((JCIdent)pn).name != names._this to be false. Answer
Tag: compiler-construction
would conversion from java code to jvm byte code considered compiling or transpiling?
Compiling is a process to conversion from one level of abstraction to lower level. Meanwhile transpiling is a process of conversion from one level of abstraction to another at same level like converting java code to Kotlin/python. That is my understanding of the two process. Could someone please explain it in terms of java code and jvm byte code. And
Java ClassLoader: load same class twice
I have a ClassLoader which loads a class compiled by JavaCompiler from a source file. But when I change the source file, save it and recompile it, the ClassLoader still loads the first version of the class. What am I missing? like a newInstance or something? Answer A classloader can’t replace a class that already has been loaded. loadClass will
How do I start creating a small compiler for a school project in java or c#
for my final exam (to graduate from university) I’ve been asked to create a tiny compiler, with the following requirements: The student must develop a basic compiler with all the design parts that conforms it (lexical analysis, syntaxis analysis, parsing, etc). This compiler will have an interface that shows 2 panels, a graphic representation (A) and code representation (B). The