Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] how to uniquely identify a temp?

The variableId of a variable identifies it uniquely within the context of a
method body (relative to innermost enclosing method), you could picture it
as the rank of declaration of this variable in this method. When comparing
two different trees, you would be in trouble, since you would only know if
you refer to variable <n>, but that doesn't tell you more.



                                                                                                                                          
                      "Adam Kiezun"                                                                                                       
                      <adam.kiezun@xxxxxx         To:      <jdt-core-dev@xxxxxxxxxxx>                                                     
                      t>                          cc:                                                                                     
                      Sent by:                    Subject: [jdt-core-dev] how to uniquely identify a temp?                                
                      jdt-core-dev-admin@                                                                                                 
                      eclipse.org                                                                                                         
                                                                                                                                          
                                                                                                                                          
                      03/18/2002 03:43 PM                                                                                                 
                      Please respond to                                                                                                   
                      jdt-core-dev                                                                                                        
                                                                                                                                          
                                                                                                                                          



hello, i have an ast-related question:

i have 2 ASTs - one is a slightly modified version of the other (1
identifier (of  a temp) changed)
now, i'd like to make sure that temp names still mean the same:
for each temp refererence i get an IBinding. i thought calling getKey()
would give me a unique id for the binding (i could then compare them in
both
trees, expecting them to be equal) - but i get a null.

if the IBinding is a IVariableBinding i can call getVariableId() but that
gives me only an int.
would that int (together with IBinding::getKey() called on
MethodDeclaration - method declaring the temp) be enough to uniquely
identify the temp?

i entered a bug report for that too:
http://dev.eclipse.org/bugs/show_bug.cgi?id=11529

but the list is probably a better forum for a question like this
a.

_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-core-dev






Back to the top