E
ennio
Hi.
This is my problem.
I have a proprietary framework with kind-of-java support. It uses
kind-of-java as a of scripting language.
You can write your own java class with a particular syntax, then you
upload this source code into the framework, it slightly modifies it,
compiles it with javac, and TADA you've your own script.
I would like to write a kind of bridge between standard Java source
code and this "particular-framework-script-syntax".
Here is an example of what i need to do.
I have to create Useless.my_java knowing the content of Useless.java.
Here are the files:
-Useless.java---------
class Useless {
Integer i;
public Useless() {
System.out.println("new Useless!");
i = new Integer(0);
AnotherUselessClass.doSomethingUseless();
}
}
-end-of-file----------
-Useless.my_java---------
class ${CLASS:Useless} {
Integer i;
public ${CLASS:Useless} () {
System.out.println("new Useless!");
i = new Integer(0);
${CLASS:AnotherUselessClass}.doSomethingUseless();
}
}
-end-of-file----------
To achieve this, i need a java parser-almost-compiler of java source
code.
I tried with Eclipse jdt libraries, but my problem is the following
one:
It doesn't tell me if, when it reads
AnotherUselessClass.doSomethingUseless()
if AnotherUselessClass is a class or a variable, because it could even
be a variable, and i need to know it.
if it's a class, Eclipse jdt can't tell me its path. (in which package?
or is it in current dir? )
Did anyone understand my terrific explaination?
Can anyone even give me a hint?
thanks
This is my problem.
I have a proprietary framework with kind-of-java support. It uses
kind-of-java as a of scripting language.
You can write your own java class with a particular syntax, then you
upload this source code into the framework, it slightly modifies it,
compiles it with javac, and TADA you've your own script.
I would like to write a kind of bridge between standard Java source
code and this "particular-framework-script-syntax".
Here is an example of what i need to do.
I have to create Useless.my_java knowing the content of Useless.java.
Here are the files:
-Useless.java---------
class Useless {
Integer i;
public Useless() {
System.out.println("new Useless!");
i = new Integer(0);
AnotherUselessClass.doSomethingUseless();
}
}
-end-of-file----------
-Useless.my_java---------
class ${CLASS:Useless} {
Integer i;
public ${CLASS:Useless} () {
System.out.println("new Useless!");
i = new Integer(0);
${CLASS:AnotherUselessClass}.doSomethingUseless();
}
}
-end-of-file----------
To achieve this, i need a java parser-almost-compiler of java source
code.
I tried with Eclipse jdt libraries, but my problem is the following
one:
It doesn't tell me if, when it reads
AnotherUselessClass.doSomethingUseless()
if AnotherUselessClass is a class or a variable, because it could even
be a variable, and i need to know it.
if it's a class, Eclipse jdt can't tell me its path. (in which package?
or is it in current dir? )
Did anyone understand my terrific explaination?
Can anyone even give me a hint?
thanks