Hello,
        first of all many thanks to all the people who kindly answered.

I've collected many different advices on Java parsers, so maybe it is wiser to
explain my purpose. 
I noticed that java performance decreases dramatically as more and more classes
and object instances are created. 

From:

class one
{
  int number = 0

  void aMethod()
    {
       number++;
    }
}


To:

class two
{
   myInt number;

   void aMethod()
     {
        number.increase();
     }
}

class myInt
{
  int n = 0;

  void increase()
  {
     n++;
  }
}

There is no semanthic difference, but if you call aMethod() many times (say
10000) the second version is even twice slower.

Yet, the latter version takes advantage of modularity and object structure,
"good" coding implies that kind of structure.

What I want to do is a tool that "flattens" the class hierachy to improve
performance. In this way I'll be able to write properly structured code but the
tool will cut away performance-wise useless classes and method before I compile.
I know it is not always possible to do that and that the rules to change the
program must always keep semanthic unchanged... I know this is not easy.
But suppose I manage to write down a set of rules to do that, I'll need a parser
to parse the Java code and provide the changed source code according to the
rules.

After I explained my goal, what would be the best parser to achieve it?

Needless to say, my tool will work on Linux (that's why I'm posting here) so
the choice will be on parsers available in Linux or written themselves in Java.


Andrea.

PS 1: thanks for the pointers to a Java grammar, indeed I needed that too.

PS 2: about my signature, the long one was supposed to be used only for
personal messages not for the mailing list, I guess my XFMail configuration
needs some checks :/

---
Andrea "Kontorotsui" Controzzi - MALE Student of Computer Science at 
University of Pisa  -  Italy  -  E-mail: [EMAIL PROTECTED]
My home page: http://www.cli.di.unipi.it/~controzz/intro.html


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to