SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
research:jtransformer:api:meta:meta-model:argument_descriptors [2014/02/05 19:58]
127.0.0.1 external edit
research:jtransformer:api:meta:meta-model:argument_descriptors [2018/05/09 01:59] (current)
Line 1: Line 1:
 +====== Argument Descriptors ======
 +
 +In the [[ast_node_def | ast_node_def/​3]] facts of a [[astspecification|language meta-model]],​ each AST node argument is described by a term of the form
 +
 +<Code lang-prolog> ​     ast_arg(ArgName,​ Cardinality,​ IdOrAttribute,​ Types)</​Code>​
 +
 +//ArgName// is the name of the argument (usually an atom).
 +
 +//​Cardinality//​ is a term of the form ''​mult(From,​To,​OrderedorNot)''​. The table below gives some examples: ​
 +
 +^SCHEMA ​  ^ EXAMPLE ​    ^ EXPLANATION^
 +| any      | mult(0,​*,​no) | Any cardinality including 0, no order.|
 +| list     | mult(0,​*,​ord)| Any cardinality including 0, the arguments are ordered. In the JT2 representation this argument is a list.|
 +| From-To ​ | mult(1,​2,​no) | A cardinality range with the lower bound |
 +| optional | mult(0,​1,​no) | An optional, single-valued argument - may be the atom '​null'​. |
 +
 +//​IdOrAttribute // is either
 +  * **id  ** -- Indicates that the value is the identity of an AST node. By convention the first argument of any AST node is the id of that node and has the argument name '​id'​. All other id arguments refer to other AST nodes. ​
 +    We call them '​references'​.
 +  * **attr** -- Indicates that the value is not to be interpreted as an id. It can be any legal Prolog term including compound terms.
 +
 +//Types// --  is a list of AST node types defined for this language. ​
 +Any term in a second argument of an [[ast_node_def | ast_node_def/​3]] fact for this language my appear in this list. In addition, the types '​typeTermType'​ and '​atom'​ may be used. The latter indicates any constant value that is not a compound term (that is, has not a functor and arguments). The '​typeTermType'​ indicates ​
 +a term of the form type(class, id, int) or type(basic, typename, int).
 +
 +Each value of the respective AST node argument must be from one of these
 +types. The value '​null',​ legal if the cardinality includes
 +0, is considered as an element of every type.
 +
 +Two contracts must be fullfilled for AST node argument types: The types 
 +'​typeTermType'​ and '​atom'​ must not be used together with another type.
 +
 +
  
research/jtransformer/api/meta/meta-model/argument_descriptors.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019