Determining argument types at compile-time

"Jaspar Cahill" <jasparcahill@optusnet.com.au>
3 Jul 2001 23:23:03 -0400

          From comp.compilers

Related articles
Determining argument types at compile-time jasparcahill@optusnet.com.au (Jaspar Cahill) (2001-07-03)
| List of all articles for this month |

From: "Jaspar Cahill" <jasparcahill@optusnet.com.au>
Newsgroups: comp.compilers
Date: 3 Jul 2001 23:23:03 -0400
Organization: Compilers Central
Keywords: types, analysis
Posted-Date: 03 Jul 2001 23:23:03 EDT

I am parsing some Java files and am trying to find a way to determine
the type of each argument in a method call. The types are needed to
match the method call to the actual method. Matching is not simply
based on name. The problem is that argument type is not always easy
to obtain. In the case of


        func1('a')


it is easy to work out that the type is char. But in the case of,


        func1(func2('a'))


func2 has to be matched to a method based on its argument, and return
type obtained, in order to obtain the argument type for func1.
Nesting could be deeper.


An argument is an expression, so the problem gets down to working out the
resulting type of an expression.


This issue must come up frequently in Java compilation. Is there a
common way of dealing it? Is it possible in Java to work out argument
types in all cases at compile-time?


Any help would be greatly appreciated.


Jaspar


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.