SDA SE Wiki

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

User Tools

Site Tools



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, constructorT, classInitializerT, fieldT, classT, annotationMemberT, annotationT
ID of the fact that represents the enclosing element.

#type: Types, 'null'
the id of the type of the literal or null for the null literal

'value': atom
the value of this literal.

Sample Java Code

class HelloWorld  { 
  public static void main(String[] args){
    System.out.println("Hello World!");    //literalT: "Hello World!"
  }
}

Its PEF Representation

methodT(#encl, ..., 'main', ..., #returntype, [], ...).
callT(#parent, .., #encl, ..., 'println', [#id], ...),
literalT(#id, #parent, #encl, #literaltype, 'Hello World!').

AST Specification

ast_node_type_spec(literalT,[
     ast_arg(id,      mult(1,1,no ), id,  [literalT]),
     ast_arg(parent,  mult(1,1,no ), id,  [id]),
     ast_arg(encl,    mult(1,1,no ), id,  [methodT, constructorT, classInitializerT,fieldT,classT,annotationMemberT,packageT]),
     ast_arg(type,    mult(1,1,no ), id,  [type_inst, null_type]),
     ast_arg(value,   mult(1,1,no ), attr,[atomic]) 
]).
research/jtransformer/api/java/pefs/4.2/literalt.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019