Generic Name Resolution with Metamodels

作者: Yuriy Tymchuk , Benjamin Arezki , Anne Etien , Nicolas Anquetil , Stéphane Ducasse

DOI:

关键词:

摘要: Nowadays almost all modern IDE provides editor services such as reference resolving while writing code to identify where a given symbol has been defined, constraints checking to highlight duplicate definitions, use before definition, unresolved reference... or code completion by proposing valid identifier in a given context. In parallel, in maintenance, lot of metrics or program analysis approaches rely on the identification of dependencies between concepts. All of these services rely on name resolution also known as symbol resolution. Providing such services for programs written in a language not currently supported requires as a first essential step to develop a name resolution algorithm for this language. Dealing with all the specific cases of the language may put a damper on the developer’s enthusiast that will choose tools already providing name resolution algorithm for the given language and plug the new services to this tool. Such a solution has the major advantage to avoid writing the name resolution algorithm for the new language. Nevertheless, it has the major drawback for the new service to be dependent to another tool. Name resolution amounts to linking a name (an identifier) in the source code to an entity of the program: in the expression i++, the symbol i refers to a variable of the program that must be incremented by one. The basic rule for name resolution in lexical scoping is to look for the entity in the current scope, eg a variable name will be first searched in the scope of the function within which it appears. The entity must first match the identifier, that is to say have the right name, second it must match the kind of entity (variable …

参考文章(0)