[antlr-interest] generating cyclic state machines in Java

Jeff Barnes jbarnesweb at yahoo.com
Wed Feb 8 19:59:43 PST 2006


Hi Ter,

> 
> Java creates an array of arrays, which is a lot of
> objects and  
> hopefully it doesn't wipe to 0 first and then add
> these default  
> values. :(
> 
> Anybody have experience with this in Java?
> 
> Ter
> 

Is this what you're asking?

public class Test
{
	public static void main(String[] args)
	{
		char[] s = new char[10];
		for (int i = 0; i < s.length; i++)
		{
			System.out.println((int)s[i]);
		}
	}
}

C:\dev\playground>javac Test.java

C:\dev\playground>java Test
0
0
0
0
0
0
0
0
0
0

I believe you are going to find that the processor
cost of creating an array is roughly equal to the cost
of creating a metamodel... and a lot more work.

I'm putting together a rough draft of what I had in
mind. I'll post it by end of week or so, if that's ok.
Just something for you to consider.

We actually got some sun here in Seattle this week.
'Got distracted by it.

;-)

Regards,
Jeff



More information about the antlr-interest mailing list