Pico Compiler favicon

Pico Compiler

Pico Compiler is a lightweight, offline development environment for writing Java programs. It is designed primarily for students, providing an simple interface and the ability to interactively evaluate Java source code. The major design goal was to keep the compiler small and simple, while providing an Java compatible compiler. The following elements of the Java programming language are implemented: • packages, imports • classes, interfaces • Inheritance • Static members • Classes, instances initializers • Fields, methods declarations • Local variables declaration • if ... else, for, while, do ... while, try ... catch ... finally, throw, return, break, continue, switch, synchronized statements • All primitive types • Superclass member access • this (reference to current instance) • Superclass constructor invocation (super(a, b, c);) • Method invocation • Class instance creation (new Abc()) • Primitive array creation (new int[10][5][]) • Class or interface array creation (new Abc[10][5][]) • Array access (args[0]) • Local variable access • null literal • Unary numeric conversion • Block scope, method scope, class scope, global scope • throws clause • Array initializer (String[] a = { "x", "y", "z" }) • Primitive class literals (int.class) • Non-primitive class literals (String.class) • Accessibility checking (PUBLIC, PROTECTED, PRIVATE) • Autoboxing and unboxing • Variable arity methods (a.k.a. "varargs")

Limitations: • Compiler can't open external projects or jars • Compiler can process only one file at a time (no multi file projects) • Type arguments (generic types) are parsed, but otherwise ignored • Declaration of parametrized types • Typesafe enums • Annotation declarations