flatIVVisitor.py 1.34 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#! /usr/bin/python

import ocarina
import taste
import lmp

def main ():
	aadlFiles = ['../projects/DemoIV.aadl', '../projects/TASTE-Dataview.aadl', '../projects/TASTE_IV_Properties.aadl', \
		'../projects/taste_properties.aadl', '../projects/data_model.aadl', '../projects/base_types.aadl', '../projects/deployment.aadl']

	ret = taste.load (aadlFiles, "interfaceview::IV::interfaceview.others")
	print 'load', ret 
	
	print  '\nROOT'
	iv = taste.getTasteRoot()
	taste.visitIV(iv, False)

	functionNames = taste.getFunctions (resType = 'names')	
	print '\nFUNCTIONS', functionNames 
	
	functions = taste.getFunctions ()
	for function in functions:
		taste.visitFunction(function, 1, False)
	
	features = taste.getPIRIs('name')
	print '\nFEATURES', features
	 
	features = taste.getPIRIs()
	for feature in features:
		taste.printPIRI(feature, 1)
	
	pis = taste.getPIs('name')
	print '\nPIS', pis
	
	pis = taste.getPIs()
	for pi in pis:
		taste.printPIRI(pi,1)		
	
	ris = taste.getRIs('name')
	print '\nRIS', ris
	
	ris = taste.getRIs()
	for ri in ris:
		taste.printPIRI(ri, 1)		

	connections = taste.getConnections(resType = 'name')
	print '\nCONNECTIONS', connections
	
	connections = taste.getConnections()
	for connection in connections:
		taste.printConnection(connection, 1)
	
if __name__ == "__main__":
    main ()
    #~ sys.exit (0);                       # exit