dan-blank / javatomips_testcases Goto Github PK
View Code? Open in Web Editor NEWTestcases for compiler construction classes based on "Modern Compiler Implementation in Java" by Andrew Appel and Jens Palsberg.
Testcases for compiler construction classes based on "Modern Compiler Implementation in Java" by Andrew Appel and Jens Palsberg.
@Jonast the file jt_ValidOverride.java should not be valid because of BaseType != SubType.
Thanks to you I found a bug in my typechecker! :)
And less helpfull, but more official:
https://docs.oracle.com/javase/tutorial/java/IandI/override.html
At the line 21 of ok/db_expressions
we have:
true = !false;
However, we have only production id = Exp
, which means that true
should be id
, but I guess it should be not possible, because true
is a keyword.
Dann füge ich noch meine Tests hinzu. Danke!
At the line 23 of ok/db_expressions
we have:
new Object().apply(2,3,4,new OtherObject());
That is incorrect because it is Exp
, and we expect Statement
, we do not have production from one to another.
@Jonast in jt_InvalidMemberOverride:
It is okay that the subclass has a member with the same name, even it is of a different type.
https://docs.oracle.com/javase/tutorial/java/IandI/hidevariables.html
@SgnJp some of your ok-testcases contain overloading, which is not allowed in MiniJava, source: https://proglang.informatik.uni-freiburg.de/teaching/compilerbau/2016ws/ex2.pdf
Sorry that this comes up so late :/
Let's change the structure from
exercise<number>/<initials>/[ok|error]/<initials>_<test_case_name>.java
to
exercise<number>/[ok|error]/<initials>_<test_case_name>.java
I guess it would be easier to use it directly, and the test case owner is defined by the initials at the begging of test name
@Jonast : in Class B, there is the method
public int test(int a, boolean c) {
int[] a;
a = new int[5];
return a[3];
}
This should be illegal according to the java specification
I researched a bit to make sure and found this thread with the relevant quote in the top-answer: http://stackoverflow.com/questions/4623334/question-about-variable-scope-and-shadowing-in-java
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.