Skip to main content

module analysis::flow::ObjectFlow

rascal-Not specified

Intermediate Language and Basic Algorithms for object flow analysis

Usage​

import analysis::flow::ObjectFlow;

Dependencies​

import List;
extend analysis::graphs::Graph;

Description​

The object flow language from the Tonella and Potrich book "Reverse Engineering Object Oriented Code" is an intermediate representation for object flow. We may translate for example Java to this intermediate language and then analyze object flow based on the simpler language.

The implementation in this file is intended to work with Core-M3 models

data FlowProgram​

data FlowProgram  
= flowProgram(set[FlowDecl] decls, set[FlowStm] statements)
;

data FlowDecl​

Figure 2.1

data FlowDecl  
= attribute(loc id)
| method(loc id, list[loc] formalParameters)
| constructor(loc id, list[loc] formalParameters)
;

data FlowStm​

Figure 2.1

data FlowStm  
= newAssign(loc target, loc class, loc ctor, list[loc] actualParameters)
| assign(loc target, loc cast, loc source)
| call(loc target, loc cast, loc receiver, loc method, list[loc] actualParameters)
;

alias OFG​

rel[loc from, loc to]

function buildFlowGraph​

Figure 2.2

OFG buildFlowGraph(FlowProgram p)

function propagate​

Section 2.4

rel[loc,&T] propagate(OFG g, rel[loc,&T] gen, rel[loc,&T] kill, bool back)