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:4.2:precedencet [2018/05/09 01:59] (current)
Line 1: Line 1:
 +{{page>​prologast_bodypef_index&​fullpage&​nofooter}}
 +
 +----
 +
 +=== precedenceT(#​id,​ #parent, #encl, #​expr) ​ ===
 +== ==
 +
 +Represents an expression in parentheses //()// in the source code.
 +
 +=== Arguments ===
 +== ==
 +**#id:** id\\ 
 +the unique ID given to this node.
 +
 +**#​parent:​** id\\ 
 +ID if the parent node in the AST.
 +
 +**#encl:** [[methodt|methodT]],​ [[constructort|constructorT]],​ [[classinitializert|classInitializerT]],​ [[fieldt|fieldT]]\\ ​
 +ID of the fact that represents the enclosing element.
 +
 +**#expr:** [[plastexpression|expression]]\\ ​
 +ID of the expression within the parenthesis.
 +
 +=== Sample Java Code ===
 +==  ==
 +<Code lang-java>​
 +...
 +int i = (4 + 8) * 2;    // (4 + 8) is our precedenceT
 +...
 +</​Code>​
 +
 +
 +=== Its PEF Representation ===
 +==  ==
 +<Code lang-prolog>​
 +localT(#​Local,​ #Parent, #Enclosing, type(basic, int, 0), '​i',​ #​OuterOperation).
 + ​operationT(#​OuterOperation,​ #Local, #Enclosing, [#​Precedence,​ #​Literal_15],​ *, 0).
 +   ​precedenceT(#​Precedence,​ #​OuterOperation,​ #Enclosing, #​InnerOperation).
 +     ​operationT(#​InnerOperation,​ #​Precedence,​ #Enclosing, [#​Literal_4,​ #​Literal_8],​ +, 0).
 +     ​literalT(#​Literal_4,​ #​InnerOperation,​ #Enclosing, type(basic, int, 0), '​4'​).
 +     ​literalT(#​Literal_8,​ #​InnerOperation,​ #Enclosing, type(basic, int, 0), '​8'​).
 +   ​literalT(#​Literal_15,​ #​OuterOperation,​ #Enclosing, type(basic, int, 0), '​15'​).
 +</​Code>​
 +
 +=== AST Specification ===
 +== ==
 +<​Code>​
 +ast_node_type_spec(precedenceT,​[
 +     ​ast_arg(id, ​    ​mult(1,​1,​no ), id,  [precedenceT]),​
 +     ​ast_arg(parent,​ mult(1,1,no ), id,  [id]),
 +     ​ast_arg(encl, ​  ​mult(1,​1,​no ), id,  [methodT, constructorT,​ classInitializerT,​fieldT]),​
 +     ​ast_arg(expr, ​  ​mult(1,​1,​no ), id,  [expressionType])
 +]).
 +</​Code>​
  
research/jtransformer/api/java/pefs/4.2/precedencet.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019