We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Processing and Java5.0 (Read 2665 times)
Processing and Java5.0
Jan 2nd, 2006, 11:55pm
 
Hi

I have two libs I would like to share in the near future but that heavily realy on the new generic possibilities of Java 1.5. I tried to include the new Synthax into Processings Preprocessor by inluding a new Java.g file, that includes the new java 1.5 synthax. Unfortunatly the pde.g seems to cause some trouble, I tried to find the problem but I have not enough experience with these grammar stuff.

I noticed that the Lexer is generated by the pde.g file. I let  clean.sh run but now PdeTokenTypes is not generated anymore.
Re: Processing and Java5.0
Reply #1 - Jan 4th, 2006, 6:43pm
 
if you remove your 'work' dir everything should regenerate just fine. i haven't looked at clean.sh for a while, i'm not sure if it's up to date.

pde.g basically extends java.g to include the extra p5 language stuff. we'd need to find a 1.5 version of java.g (i assume the antlr folks have done this) and get that running along with pde.g. right this moment, 1.5 support isn't a big priority (as compared to others) so fwiw, i probably won't be looking into this one for a bit. but if you find anything, contributions are always welcome...
Re: Processing and Java5.0
Reply #2 - Jan 4th, 2006, 6:54pm
 
Well I deleted the work folder everytime. It just a bit strange because the Java.g based files are generated correctly but the pde.g based files are not generated when I change java.g to support 1.5 features.

I looked through all the things you changed on pde.g but there  does not seem to be a problem with that. Guess there is just a little detail that I do not see.

Java 1.5 support would really be fine ass it offers many new possibilties and you do need to care about casting.
Re: Processing and Java5.0
Reply #3 - Jan 9th, 2006, 11:41am
 
Hi Ben

I solved the problem with the pde.g file. The rule field that you used in pde.g was called classField in the new java.g. Everything is compiled fine so far.

Now the Processing compiler causes trouble. My first test was
Code:
void setup(){
ArrayList<String> test = new ArrayList<String>();
}


The compiled java Applet file looks like this:
Code:

public class sketch_060109a extends PApplet {
public void setup(){
ArrayListtest = new ArrayList

static public void main(String args[]) {
PApplet.main(new String[] { "sketch_060109a" });
}
}


The Type declaration seems to be ignored. This is the trace in processing:

Invalid type:55
Invalid type:55
C:/Dokumente und Einstellungen/tex/Eigene Dateien/Processing/sketch_060109a/applet/sketch_060109a.java:1:264:2:37: Syntax Error: misplaced construct(s)

processing.app.RunnerException: misplaced construct(s)
at processing.app.Compiler.message(Compiler.java:332)
at processing.app.MessageSiphon.run(MessageSiphon.java:60)
at java.lang.Thread.run(Unknown Source)

I tried to fix the problem, but I don't find the trouble causing part. Any clue?
Page Index Toggle Pages: 1