Operator
overloading, or redefinition, is one of the great features of Object Oriented Languages
that Java developers can't use.
Operator
overloading increases code legibility, for example
if you want to sum two Complex numbers, you have to write Complex
result = c1.sum(c2) (where c1 and c2 are two istances
of Complex class); How about Complex
result = c1 + c2!?! And what do you prefer between
c1 + c2 * c3 and c1.sum(c2.mul(c3))?!?
For
this reason I'm introducing JOP. JOP is a simple compiler that allows
operator overloading in Java.
JOP is based on a subset of Java language syntax called Featherweight
Java (FJ); It is a small pre-processor that translates FJ
+ Operator overloadingsyntax (jopc
syntax) into Java files the java compiler (javac) can process
and transform into bytecode.
JOP
Mission
The
first goal of this project is implement operator
overloading considering java 1.4.x standard syntax.
The second one wants to put pre-processor behavior
into javac compiler.