Changes between Initial Version and Version 1 of SemanticQuery/FunctionParameterEntity


Ignore:
Timestamp:
Feb 27, 2015, 1:48:27 PM (9 years ago)
Author:
manualwiki
Comment:

function parameter entity(sq-type related) description added

Legend:

Unmodified
Added
Removed
Modified
  • SemanticQuery/FunctionParameterEntity

    v1 v1  
     1= Function parameter entity =  
     2 
     3Function parameter entities are almost identical to [SemanticQuery/ExpressionEntity Expression entities]. In fact they are represented and handled internally as expressions. The only difference is that the ''type'' selector has been introduced which can be used to get the assigned types of the parameter according to the "-spec" specification of the function. 
     4 
     5== Initial selector == 
     6Please note that there is no initial selector provided for this entity. An equivalent expression to get the function parameter indicated by the position would be the following: 
     7{{{@expr.fundef.parameters[index in @expr.index]}}} 
     8 
     9== Selectors ==  
     10 
     11Although all selectors and properties of the expression entity are available, the following ones might be useful when handling parameters: 
     12 
     13''The type of returned entities are indicated in parentheses for each selector.'' 
     14 
     15* {{{type}}} (''type''): return the assigned types of the parameter according to the "-spec" specification of the function having this parameter. 
     16* {{{fundef}}} (''function''): returns the function entity which contains the parameter. 
     17{{{#!comment 
     18* {{{funs}}} (''function''): returns every function entity referred directly in the expression. 
     19}}} 
     20* {{{vars}}} (''variable''): returns every variable entity referred in the expression of the parameter. 
     21* {{{records}}} (''record''): returns every record entity referred in the expression of the parameter. 
     22{{{#!comment 
     23* {{{macros}}} (''macro''): returns every macro entity referred in the expression. 
     24}}} 
     25* {{{sub}}} (''expression''): returns the set of expressions that are nested in the expression of the parameter in any depth. 
     26{{{#!comment 
     27A sub nem csak 1 mélységig megy? 
     28}}} 
     29{{{#!comment 
     30* {{{top}}} (''expression''): returns the expression's top-level expression. 
     31}}} 
     32* {{{file}}} (''file''): returns the file entity where the parameter is located. 
     33* {{{origin}}} (''expression''): returns the origin of the parameter's value determined by data-flow analysis. 
     34* {{{reach}}} (''expression''): returns the places where the parameter's value is copied, determined by data-flow analysis. 
     35 
     36 
     37== Properties == 
     38 
     39* {{{value}}}: returns the value of the parameter. 
     40* {{{class}}} (''atom''): returns the class of the parameter: it can be either {{{expr}}} (stands for single expressions) or {{{pattern}}}. 
     41* {{{index}}} (''int''): returns the index of the expression in the containing expression list. 
     42{{{#!comment 
     43* {{{macro_value}}} (''string''): returns the value of the macro contained by the expression. 
     44}}}