constructorT(#id, #class, [#param_1,...], [#exception_1,...], #body)

Represents the constructor declaration.

Added in JT 2.8: Up to 2.8.0 it was part of methodDefT.

Arguments

#id: id
the unique ID assigned to this fact.

#class: classT
ID of the parent/declaring class.

[#param_1,…]: paramT
list of IDs of the method parameters.

[#exception_1,…]: typeRefT
list of IDs of the thrown exceptions.

#body: blockT, null
ID of the block.

Sample Java Source

class Object  {   
	public Object(String name) {            //Constructor
                 ...
	}
        ...                                                       
}

Its PEF Representation

classT(#class, #compilationUnit, 'Object', [..., #const]).
constructorT(#const, #class, [#param], [], #body).

AST Specification

ast_node_def('Java',constructorT,[
    ast_arg(id,      mult(1,1,no ), id,  [constructorT]),
    ast_arg(parent,  mult(1,1,no ), id,  [classT]), 
    ast_arg(params,  mult(0,*,ord), id,  [paramT]),
    ast_arg(excepts, mult(0,*,ord), id,  [typeRefT]),
    ast_arg(body,    mult(0,1,no),  id,  [blockT,nullType])
]).
research/jtransformer/api/java/pefs/3.0/constructort.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024