Changes between Initial Version and Version 1 of SemanticQuery/FileEntity


Ignore:
Timestamp:
Feb 20, 2012, 7:59:34 AM (12 years ago)
Author:
manualwiki
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SemanticQuery/FileEntity

    v1 v1  
     1= File (or module) entity = 
     2 
     3A file entity corresponds to an Erlang source file. This entity represents the module concept of Erlang, as modules are mapped to files, but header files also fall into this category. 
     4 
     5== Initial selectors == 
     6File entities can be referred at the start of a query by two selectors: 
     7* {{{files}}} (or {{{modules}}}) yields every file (or module) loaded into the refactoring database 
     8* {{{@file}}} (or {{{@module}}}) yields the current file (or module) 
     9 
     10TODO: difference between files and modules 
     11 
     12== Selectors ==  
     13The following selectors can be used on file entities.  Note that every selector can be used on either module or header files, but some of them will give no results for headers (e.g. a header file can't export functions). 
     14 
     15''After the name of the selector between parentheses you can find the type of the elements in the resulted set.'' 
     16 
     17* {{{funs}}} (''function''): returns the set of function entities defined in the file. 
     18* {{{records}}} (''record''): returns every record entity defined in the file. 
     19* {{{macros}}} (''macro''): returns the macro entities introduced in the file. 
     20* {{{includes}}} (''file''): returns all the file entities included in the file, either directly with a {{{-include}}} directive, or indirectly through an include chain. 
     21* {{{included_by}}} (''file''): using this selector on a particular file entity gives all the file entities that include the  previous file. 
     22* {{{imports}}} (''function''): returns the set of function entities that are referred with an import directive in the file. 
     23* {{{exports}}} (''function''): returns the set of functions exported in the file. 
     24 
     25== Properties == 
     26These properties are defined for file entities: 
     27* {{{module}}} (''boolean''): gives true if the file is a module. 
     28* {{{header}}} (''boolean''): returns true if the file is a header (.hrl). 
     29* {{{name}}} (''atom, string''): gives the name of the file. In case of modules it does not contain the {{{.erl}}} extension to make it easier to work with module names. 
     30* {{{filename}}} (''string''): returns the file name as a string with the {{{.erl}}} extension. 
     31* {{{dir}}} (''string''): returns the directory containing the file. 
     32* {{{path}}} (''string''): returns the absolute path of the file (the directory and the complete file name).