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

research:jtransformer:api:java:pefs:2.9:fieldt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +
 +----
 +
 +=== fieldT(#id, #class, TYPE, '​name',​ #​init) ​ ===
 +
 +
 +Represents the field declaration.
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\
 +the unique ID assigned to this fact.
 +
 +**#class:** [[classt|classT]]\\ ​
 +ID of the enclosing/​declaring class.
 +
 +**TYPE:** [[typeterm|type term]]\\ ​
 +the type of the field.
 +
 +**'​name':​** atom\\ ​
 +the name of the field.
 +
 +**#init:** [[plastexpression|expression]],​ null\\ ​
 +ID of the initializer of this variable declaration.
 +
 +=== Sample Java Source ===
 +== ==
 +<Code lang-java>​
 +class HelloWorld extends HelloUniverse { //classT
 +
 +  static String message; //​corresponding code line to fieldT
 +
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +classT(#​class,​ #​compilationUnit,​ '​HelloWorld',​ [..., #field]).
 +fieldT(#​field,​ #class, type(class, ..., 0), '​message',​ '​null'​).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​fieldT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [fieldT]), % <-- convention!!!
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [classT]),
 +     ​ast_arg(type, ​   mult(1,1,no ), attr,​[typeTermType]),​
 +     ​ast_arg(name, ​   mult(1,1,no ), attr,​[atom]),​
 +     ​ast_arg(expr, ​   mult(0,1,no ), id,  [expressionType,​nullType])
 +]).
 +</​Code>​
  
research/jtransformer/api/java/pefs/2.9/fieldt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019