Changes between Version 2 and Version 3 of SemanticQuery/FunctionEntity


Ignore:
Timestamp:
Apr 10, 2012, 8:22:15 PM (13 years ago)
Author:
daniel_h
Comment:

some corrections and improvements

Legend:

Unmodified
Added
Removed
Modified
  • SemanticQuery/FunctionEntity

    v2 v3  
    11= Function entity  = 
    22 
    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. 
     3Function 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. 
    44 
    55== 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 being defined 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). 
    77 
    88== 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.'' 
    1010 
    11 * {{{refs}}} (''expression''): returns every expression that refers to the function. These references can be function applications, import/export directives and implicit function expressions. 
    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. 
    1313* {{{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 calls 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). 
    1717* {{{args}}} (''expression''): gives the function arguments as a list of expression entities. 
    1818* {{{body}}} (''expression''): returns the top-level expressions of each clause body. 
    1919* {{{exprs}}} (''expression''): returns the top-level argument, guard, and body expressions of each clause. 
    20 * {{{vars}}} (''variable''): returns the set of variable entities defined (binded) in the bodies of 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. 
    2222 
    2323== Properties == 
     
    2929* {{{bif}}} (''bool''): returns true if the function is an auto-imported built-in function. 
    3030* {{{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. 
    3434* {{{spec}}} (''string''): returns the specification of the function (If it is not available in the source code, !RefactorErl calculates it.)