Changes between Version 2 and Version 3 of SemanticQuery/FunctionEntity
- Timestamp:
- Apr 10, 2012, 8:22:15 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SemanticQuery/FunctionEntity
v2 v3 1 1 = Function entity = 2 2 3 Function entities correspond to Erlang functions. Function entities come from two sources: they are either defined in a source file that is loaded into the database, or they are referred in the loaded code, but their definition is not known. In the latter case, some information about the function is not available.3 Function entities correspond to Erlang functions. They can come from two sources: they are either defined in a module loaded into the database, or just referred to in the loaded code. In the latter case, information about the function may be incomplete. 4 4 5 5 == Initial selector == 6 * {{{@fun}}} at the start of a query, this selector can be used to refer to the current function (either the function called by the selected expression, or the function beingdefined at the current selection).6 * {{{@fun}}} at the start of a query, this selector can be used to refer to the "current" function (either a function invoked by the selected call-expression, or a function defined at the current selection). 7 7 8 8 == Selectors == 9 '' After the name of the selector between parentheses you can find the type of the elements in the resulted set.''9 ''In parentheses you find the type of the result elements.'' 10 10 11 * {{{refs}}} (''expression''): returns every expression that refers to the function. These references can be function applications, import/export directives and implicit functionexpressions.12 * {{{dynref}}} (''expression''): returns every expression that refers to the function through a dynamic function call (e.g. an {{{apply}}} call, for details see [wiki:DynFunAnal]. We note here, that you should run the dynamic call analysis at first, otherwise the result will be empty.11 * {{{refs}}} (''expression''): returns every expression that refers to the function. These references can be either function applications, import/export directives or fun-expressions. 12 * {{{dynref}}} (''expression''): returns every expression that refers to the function by a dynamic function call (e.g. an {{{apply}}} call, for details see DynamicCallAnalysis). Note that you have to run dynamic call analysis prior to using this query. 13 13 * {{{calls}}} (''function''): returns the set of function entities called in the body of the function. 14 * {{{dyncalls}}} (''function''): returns the set of functions called in body of the function dynamically (for details, see [wiki:DynFunAnal]).15 * {{{called_by}}} (''function''): returns every function that refers to the specific function, either by application or implicit call.16 * {{{dyn_calledby}}} (''function''): returns the set of functions that call s the given function dynamically (for details, see [wiki:DynFunAnal]).14 * {{{dyncalls}}} (''function''): returns the set of functions dynamically called in body of the function (for details, see DynamicCallAnalysis). 15 * {{{called_by}}} (''function''): returns every function that calls the specified function (not including dynamic calls). 16 * {{{dyn_calledby}}} (''function''): returns the set of functions that call the given function dynamically (for details, see DynamicCallAnalysis). 17 17 * {{{args}}} (''expression''): gives the function arguments as a list of expression entities. 18 18 * {{{body}}} (''expression''): returns the top-level expressions of each clause body. 19 19 * {{{exprs}}} (''expression''): returns the top-level argument, guard, and body expressions of each clause. 20 * {{{vars}}} (''variable''): returns the set of variable entities defined (b inded) in the bodiesof the function.21 * {{{file}}} (''file''): returns the file entity that the given function is defined in.20 * {{{vars}}} (''variable''): returns the set of variable entities defined (bound) in the body of the function. 21 * {{{file}}} (''file''): returns the file entity (the module) that the given function is defined in. 22 22 23 23 == Properties == … … 29 29 * {{{bif}}} (''bool''): returns true if the function is an auto-imported built-in function. 30 30 * {{{pure}}} (''bool''): returns true if the function is free of [wiki:SideEffect side-effects]. We have to mention here, that those functions that are not loaded into the database of !RefactorErl (for example, library functions) are considered as impure. If you need a more precise analysis, you should add the affected files to the database of !RefactorErl. The knowledge about the BIF-s is built into the tool. 31 * {{{dirty}}} (''bool''): returns true if the function has [wiki:SideEffect side-effect ].32 * {{{defined}}} (''bool''): returns true if the definition of the function is loaded into the refactoring software.33 * {{{module}}} (''atom''): returns the name of the containing module.31 * {{{dirty}}} (''bool''): returns true if the function has [wiki:SideEffect side-effects], or in other words, it is impure. 32 * {{{defined}}} (''bool''): returns true if the definition of the function is loaded into the database. 33 * {{{module}}} (''atom''): returns the name of the defining module. 34 34 * {{{spec}}} (''string''): returns the specification of the function (If it is not available in the source code, !RefactorErl calculates it.)