Skip to content

Tests for compiler of java-like language from course Compiler construction

Notifications You must be signed in to change notification settings

varqox/mrjp-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latte compiler

Language extensions

  • arrays
  • classes with inheritance and virtual methods
  • null implicitly converts to any array and to any class

Language semantics

  • variables namespace is independent of the functions (and methods) namespace, e.g. (accepted code):
int foo() { return 42; }
int main() {
    int foo = 3;
    if (foo() + foo != 45) error();
    return 0;
}
  • field shadowing is not possible, e.g. (rejected code):
class X {
    int x;
}
class Y extends X {
    string x;
}
int main() {
    return 0;
}

Tests

Tests comprehensively cover language construct, type conversions and required static analysis. Some tests reflect chosen language semantics, thus compilers implementing other interpretations may not pass them.

Tests are not divided into ones categories based on which extensions they require. Test folder structure:

  • good/ -- tests that present correct programs
  • bad/ -- tests that present incorrect programs
  • warnings/ -- tests that present programs producing diagnostic warnings

About

Tests for compiler of java-like language from course Compiler construction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published