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:3.0:literalt [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +----
 +
 +=== literalT(#​id,​ #parent, #encl, #type, '​value'​) ​ ===
 +== ==
 +
 +Represents ​ the literal node (boolean literal, character literal, number literal, string literal, type literal)
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID assigned to this fact.
 +
 +**#​parent:​** id\\ 
 +ID of the parent node.
 +
 +**#encl:** [[methodT|methodT]],​ [[constructorT|constructorT]],​ [[classInitializerT|classInitializerT]],​ [[fieldt|fieldT]],​ [[classt|classT]],​ [[annotationmembert|annotationMemberT]],​ [[annotationt|annotationT]]\\ ​
 +ID of the fact that represents the enclosing element.
 +
 +**#type:** [[typeinst]]\\
 +the id of the type of the literal
 +
 +**'​value':​** atom\\ ​
 +the value of this literal.
 + 
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +class HelloWorld ​ { 
 +  public static void main(String[] args){
 +    System.out.println("​Hello World!"​); ​   //literalT: "Hello World!"​
 +  }
 +}
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +methodT(#​encl,​ ..., '​main',​ ..., #​returntype,​ [], ...).
 +callT(#​parent,​ .., #encl, ..., '​println',​ [#id], ...),
 +literalT(#​id,​ #parent, #encl, #​literaltype,​ 'Hello World!'​).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_def('​Java',​literalT,​[
 +     ​ast_arg(id, ​     mult(1,1,no ), id,  [literalT]),​ % <-- convention!!!
 +     ​ast_arg(parent, ​ mult(1,1,no ), id,  [id]), % <-- convention!!!
 +     ​ast_arg(encl, ​   mult(1,1,no ), id,  [methodT, constructorT,​ classInitializerT,​ fieldT, classT, annotationMemberT,​ annotationT]),​
 +     ​ast_arg(type, ​   mult(1,1,no ), id,  [typeInst]),​
 +     ​ast_arg(value, ​  ​mult(1,​1,​no ), attr,  [atom])
 +]).
 +</​Code>​
 + 
 +
  
research/jtransformer/api/java/pefs/3.0/literalt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019