I am new to Eclipse AST and I was wondering is it possible to get the type of the variable during the traversal of the tree? I read somewhere that it is possible to get it by setting the setResolveBindings. However, I don’t know what needs to be done in visit methods. To be concrete, I would like to get the type of the variable when processing the SimpleName visit.
Share
resolveTypeBinding()from theExpressionclass – a superclass ofSimpleNameandNumberLiteral– will return anITypeBinding. A method such asgetName()will get you the type.