Index: contrib/arch/hadlbppp.py
===================================================================
--- contrib/arch/hadlbppp.py	(revision af6cad4bb7b7a98c908b368ca1dd891db173aae8)
+++ contrib/arch/hadlbppp.py	(revision 0578271269331fb048f182ef5c3d26dae37c84ea)
@@ -42,12 +42,12 @@
 	"Print usage syntax"
 	
-	print "%s <--bp|--ebp|--adl|--dot|--nop>+ <OUTPUT>" % prname
-	print
-	print "--bp   Dump original Behavior Protocols (dChecker, BPSlicer)"
-	print "--ebp  Dump Extended Behavior Protocols (bp2promela)"
-	print "--adl  Dump Architecture Description Language (modified SOFA ADL/CDL)"
-	print "--dot  Dump Dot architecture diagram (GraphViz)"
-	print "--nop  Do not dump anything (just input files syntax check)"
-	print
+	print("%s <--bp|--ebp|--adl|--dot|--nop>+ <OUTPUT>" % prname)
+	print()
+	print("--bp   Dump original Behavior Protocols (dChecker, BPSlicer)")
+	print("--ebp  Dump Extended Behavior Protocols (bp2promela)")
+	print("--adl  Dump Architecture Description Language (modified SOFA ADL/CDL)")
+	print("--dot  Dump Dot architecture diagram (GraphViz)")
+	print("--nop  Do not dump anything (just input files syntax check)")
+	print()
 
 def tabs(cnt):
@@ -163,7 +163,7 @@
 						result.append(tokens[i])
 				else:
-					print "%s: Syntax error in tentative statement" % name
+					print("%s: Syntax error in tentative statement" % name)
 			else:
-				print "%s: Expected '{' for tentative statement" % name
+				print("%s: Expected '{' for tentative statement" % name)
 		else:
 			result.append(tokens[i])
@@ -231,11 +231,11 @@
 								result.append(tokens[i])
 						else:
-							print "%s: Syntax error in alternative statement" % name
+							print("%s: Syntax error in alternative statement" % name)
 					else:
-						print "%s: Expected '{' for alternative statement body" % name
+						print("%s: Expected '{' for alternative statement body" % name)
 				else:
-					print "%s: At least one pattern and one replacement required for alternative statement" % name
+					print("%s: At least one pattern and one replacement required for alternative statement" % name)
 			else:
-				print "%s: Expected '(' for alternative statement head" % name
+				print("%s: Expected '(' for alternative statement head" % name)
 		else:
 			result.append(tokens[i])
@@ -269,5 +269,5 @@
 					result.append(tokens[i])
 			else:
-				print "%s: Unexpected end of protocol" % name
+				print("%s: Unexpected end of protocol" % name)
 		
 		i += 1
@@ -349,5 +349,5 @@
 		elif (token == ")"):
 			if (indent < base_indent):
-				print "%s: Too many parentheses" % name
+				print("%s: Too many parentheses" % name)
 			
 			indent -= 1
@@ -358,5 +358,5 @@
 		elif (token == "}"):
 			if (indent < base_indent):
-				print "%s: Too many parentheses" % name
+				print("%s: Too many parentheses" % name)
 			
 			indent -= 1
@@ -370,5 +370,5 @@
 	
 	if (indent > base_indent):
-		print "%s: Missing parentheses" % name
+		print("%s: Missing parentheses" % name)
 	
 	output = output.strip()
@@ -405,5 +405,5 @@
 			result.extend(inherited_protocols(supiface))
 		else:
-			print "%s: Extends unknown interface '%s'" % (iface['name'], iface['extends'])
+			print("%s: Extends unknown interface '%s'" % (iface['name'], iface['extends']))
 	
 	return result
@@ -459,13 +459,13 @@
 						protocols.append(proto)
 			else:
-				print "%s: Provided interface '%s' is undefined" % (frame['name'], provides['iface'])
+				print("%s: Provided interface '%s' is undefined" % (frame['name'], provides['iface']))
 	
 	if (opt_bp):
-		outf = file(outname, "w")
+		outf = open(outname, "w")
 		outf.write(parse_bp(outname, merge_bp(initialization, finalization, protocols), 0))
 		outf.close()
 	
 	if (opt_ebp):
-		outf = file(outname, "w")
+		outf = open(outname, "w")
 		outf.write(parse_ebp(frame['name'], outname, merge_bp(initialization, finalization, protocols), 0))
 		outf.close()
@@ -514,10 +514,10 @@
 	
 	if (opt_bp):
-		outf = file(outname, "w")
+		outf = open(outname, "w")
 		outf.write("NULL")
 		outf.close()
 	
 	if (opt_ebp):
-		outf = file(outname, "w")
+		outf = open(outname, "w")
 		outf.write("component null {\n\tbehavior {\n\t\tNULL\n\t}\n}")
 		outf.close()
@@ -587,5 +587,5 @@
 					insts.append({'var': "%s_%s" % (prefix, inst['var']), 'frame': subframe})
 				else:
-					print "%s: '%s' is neither an architecture nor a frame" % (arch['name'], inst['type'])
+					print("%s: '%s' is neither an architecture nor a frame" % (arch['name'], inst['type']))
 	
 	if ('bind' in arch):
@@ -612,5 +612,5 @@
 	
 	if (arch is None):
-		print "Unable to find system architecture"
+		print("Unable to find system architecture")
 		return
 	
@@ -634,5 +634,5 @@
 					insts.append({'var': inst['var'], 'frame': subframe})
 				else:
-					print "%s: '%s' is neither an architecture nor a frame" % (arch['name'], inst['type'])
+					print("%s: '%s' is neither an architecture nor a frame" % (arch['name'], inst['type']))
 	
 	if ('bind' in arch):
@@ -642,10 +642,10 @@
 	if ('delegate' in arch):
 		for delegate in arch['delegate']:
-			print "Unable to delegate interface in system architecture"
+			print("Unable to delegate interface in system architecture")
 			break
 	
 	if ('subsume' in arch):
 		for subsume in arch['subsume']:
-			print "Unable to subsume interface in system architecture"
+			print("Unable to subsume interface in system architecture")
 			break
 	
@@ -654,5 +654,5 @@
 	outname = os.path.join(outdir, "%s.archbp" % arch['name'])
 	if ((opt_bp) or (opt_ebp)):
-		outf = file(outname, "w")
+		outf = open(outname, "w")
 	else:
 		outf = None
@@ -709,5 +709,5 @@
 		
 		if (not os.path.isfile(path)):
-			print "%s: Unable to include file %s" % (inname, path)
+			print("%s: Unable to include file %s" % (inname, path))
 			return ""
 	else:
@@ -716,5 +716,5 @@
 		nested_root = root
 	
-	inf = file(path, "r")
+	inf = open(path, "r")
 	
 	raw = preproc_adl(inf.read(), inarg)
@@ -733,5 +733,5 @@
 		if (POST_INC in context):
 			if (token != "]"):
-				print "%s: Expected ]" % inname
+				print("%s: Expected ]" % inname)
 			
 			context.remove(POST_INC)
@@ -774,5 +774,5 @@
 			if (NULL in context):
 				if (token != ";"):
-					print "%s: Expected ';' in frame '%s'" % (inname, frame)
+					print("%s: Expected ';' in frame '%s'" % (inname, frame))
 				else:
 					output += "%s\n" % token
@@ -798,5 +798,5 @@
 						
 						if ('finalization' in frame_properties[frame]):
-							print "%s: Finalization protocol for frame '%s' already defined" % (inname, frame)
+							print("%s: Finalization protocol for frame '%s' already defined" % (inname, frame))
 						else:
 							frame_properties[frame]['finalization'] = bp
@@ -832,5 +832,5 @@
 						
 						if ('initialization' in frame_properties[frame]):
-							print "%s: Initialization protocol for frame '%s' already defined" % (inname, frame)
+							print("%s: Initialization protocol for frame '%s' already defined" % (inname, frame))
 						else:
 							frame_properties[frame]['initialization'] = bp
@@ -866,5 +866,5 @@
 						
 						if ('protocol' in frame_properties[frame]):
-							print "%s: Protocol for frame '%s' already defined" % (inname, frame)
+							print("%s: Protocol for frame '%s' already defined" % (inname, frame))
 						else:
 							frame_properties[frame]['protocol'] = bp
@@ -889,5 +889,5 @@
 					if (FIN in context):
 						if (token != ";"):
-							print "%s: Expected ';' in frame '%s'" % (inname, frame)
+							print("%s: Expected ';' in frame '%s'" % (inname, frame))
 						else:
 							output += "%s" % token
@@ -898,5 +898,5 @@
 					if (VAR in context):
 						if (not identifier(token)):
-							print "%s: Variable name expected in frame '%s'" % (inname, frame)
+							print("%s: Variable name expected in frame '%s'" % (inname, frame))
 						else:
 							if (not frame in frame_properties):
@@ -919,5 +919,5 @@
 					else:
 						if (not identifier(token)):
-							print "%s: Interface name expected in frame '%s'" % (inname, frame)
+							print("%s: Interface name expected in frame '%s'" % (inname, frame))
 						else:
 							arg0 = token
@@ -930,5 +930,5 @@
 					if (FIN in context):
 						if (token != ";"):
-							print "%s: Expected ';' in frame '%s'" % (inname, frame)
+							print("%s: Expected ';' in frame '%s'" % (inname, frame))
 						else:
 							output += "%s" % token
@@ -939,5 +939,5 @@
 					if (VAR in context):
 						if (not identifier(token)):
-							print "%s: Variable name expected in frame '%s'" % (inname, frame)
+							print("%s: Variable name expected in frame '%s'" % (inname, frame))
 						else:
 							if (not frame in frame_properties):
@@ -960,5 +960,5 @@
 					else:
 						if (not identifier(token)):
-							print "%s: Interface name expected in frame '%s'" % (inname, frame)
+							print("%s: Interface name expected in frame '%s'" % (inname, frame))
 						else:
 							arg0 = token
@@ -970,5 +970,5 @@
 				if (token == "}"):
 					if (indent != 2):
-						print "%s: Wrong number of parentheses in frame '%s'" % (inname, frame)
+						print("%s: Wrong number of parentheses in frame '%s'" % (inname, frame))
 					else:
 						indent = 0
@@ -1010,5 +1010,5 @@
 					continue
 				
-				print "%s: Unknown token '%s' in frame '%s'" % (inname, token, frame)
+				print("%s: Unknown token '%s' in frame '%s'" % (inname, token, frame))
 				continue
 			
@@ -1027,10 +1027,10 @@
 					continue
 				
-				print "%s: Unknown token '%s' in frame head '%s'" % (inname, token, frame)
+				print("%s: Unknown token '%s' in frame head '%s'" % (inname, token, frame))
 				
 				continue
 			
 			if (not identifier(token)):
-				print "%s: Expected frame name" % inname
+				print("%s: Expected frame name" % inname)
 			else:
 				frame = token
@@ -1050,5 +1050,5 @@
 			if (NULL in context):
 				if (token != ";"):
-					print "%s: Expected ';' in interface '%s'" % (inname, interface)
+					print("%s: Expected ';' in interface '%s'" % (inname, interface))
 				else:
 					output += "%s\n" % token
@@ -1074,5 +1074,5 @@
 						
 						if ('protocol' in iface_properties[interface]):
-							print "%s: Protocol for interface '%s' already defined" % (inname, interface)
+							print("%s: Protocol for interface '%s' already defined" % (inname, interface))
 						else:
 							iface_properties[interface]['protocol'] = bp
@@ -1094,5 +1094,5 @@
 					if (FIN in context):
 						if (token != ";"):
-							print "%s: Expected ';' in interface '%s'" % (inname, interface)
+							print("%s: Expected ';' in interface '%s'" % (inname, interface))
 						else:
 							output += "%s" % token
@@ -1124,5 +1124,5 @@
 					if (PAR_LEFT in context):
 						if (token != "("):
-							print "%s: Expected '(' in interface '%s'" % (inname, interface)
+							print("%s: Expected '(' in interface '%s'" % (inname, interface))
 						else:
 							output += "%s" % token
@@ -1133,5 +1133,5 @@
 					
 					if (not identifier(token)):
-						print "%s: Method identifier expected in interface '%s'" % (inname, interface)
+						print("%s: Method identifier expected in interface '%s'" % (inname, interface))
 					else:
 						output += "%s" % token
@@ -1142,5 +1142,5 @@
 				if (token == "}"):
 					if (indent != 2):
-						print "%s: Wrong number of parentheses in interface '%s'" % (inname, interface)
+						print("%s: Wrong number of parentheses in interface '%s'" % (inname, interface))
 					else:
 						indent = 0
@@ -1163,5 +1163,5 @@
 					continue
 				
-				print "%s: Unknown token '%s' in interface '%s'" % (inname, token, interface)
+				print("%s: Unknown token '%s' in interface '%s'" % (inname, token, interface))
 				continue
 			
@@ -1183,10 +1183,10 @@
 						continue
 						
-					print "%s: Expected '{' or ';' in interface head '%s'" % (inname, interface)
+					print("%s: Expected '{' or ';' in interface head '%s'" % (inname, interface))
 					continue
 				
 				if (EXTENDS in context):
 					if (not identifier(token)):
-						print "%s: Expected inherited interface name in interface head '%s'" % (inname, interface)
+						print("%s: Expected inherited interface name in interface head '%s'" % (inname, interface))
 					else:
 						output += "%s " % token
@@ -1218,9 +1218,9 @@
 					continue
 				
-				print "%s: Expected 'extends', '{' or ';' in interface head '%s'" % (inname, interface)
+				print("%s: Expected 'extends', '{' or ';' in interface head '%s'" % (inname, interface))
 				continue
 			
 			if (not identifier(token)):
-				print "%s: Expected interface name" % inname
+				print("%s: Expected interface name" % inname)
 			else:
 				interface = token
@@ -1240,5 +1240,5 @@
 			if (NULL in context):
 				if (token != ";"):
-					print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+					print("%s: Expected ';' in architecture '%s'" % (inname, architecture))
 				else:
 					output += "%s\n" % token
@@ -1254,5 +1254,5 @@
 					if (FIN in context):
 						if (token != ";"):
-							print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+							print("%s: Expected ';' in architecture '%s'" % (inname, architecture))
 						else:
 							output += "%s" % token
@@ -1264,5 +1264,5 @@
 					if (VAR in context):
 						if (not descriptor(token)):
-							print "%s: Expected interface descriptor in architecture '%s'" % (inname, architecture)
+							print("%s: Expected interface descriptor in architecture '%s'" % (inname, architecture))
 						else:
 							if (not architecture in arch_properties):
@@ -1283,5 +1283,5 @@
 					if (TO in context):
 						if (token != "to"):
-							print "%s: Expected 'to' in architecture '%s'" % (inname, architecture)
+							print("%s: Expected 'to' in architecture '%s'" % (inname, architecture))
 						else:
 							output += "%s " % token
@@ -1292,5 +1292,5 @@
 					
 					if (not identifier(token)):
-						print "%s: Expected interface name in architecture '%s'" % (inname, architecture)
+						print("%s: Expected interface name in architecture '%s'" % (inname, architecture))
 					else:
 						output += "%s " % token
@@ -1303,5 +1303,5 @@
 					if (FIN in context):
 						if (token != ";"):
-							print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+							print("%s: Expected ';' in architecture '%s'" % (inname, architecture))
 						else:
 							output += "%s" % token
@@ -1313,5 +1313,5 @@
 					if (VAR in context):
 						if (not identifier(token)):
-							print "%s: Expected interface name in architecture '%s'" % (inname, architecture)
+							print("%s: Expected interface name in architecture '%s'" % (inname, architecture))
 						else:
 							if (not architecture in arch_properties):
@@ -1332,5 +1332,5 @@
 					if (TO in context):
 						if (token != "to"):
-							print "%s: Expected 'to' in architecture '%s'" % (inname, architecture)
+							print("%s: Expected 'to' in architecture '%s'" % (inname, architecture))
 						else:
 							output += "%s " % token
@@ -1341,5 +1341,5 @@
 					
 					if (not descriptor(token)):
-						print "%s: Expected interface descriptor in architecture '%s'" % (inname, architecture)
+						print("%s: Expected interface descriptor in architecture '%s'" % (inname, architecture))
 					else:
 						output += "%s " % token
@@ -1352,5 +1352,5 @@
 					if (FIN in context):
 						if (token != ";"):
-							print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+							print("%s: Expected ';' in architecture '%s'" % (inname, architecture))
 						else:
 							output += "%s" % token
@@ -1362,5 +1362,5 @@
 					if (VAR in context):
 						if (not descriptor(token)):
-							print "%s: Expected second interface descriptor in architecture '%s'" % (inname, architecture)
+							print("%s: Expected second interface descriptor in architecture '%s'" % (inname, architecture))
 						else:
 							if (not architecture in arch_properties):
@@ -1381,5 +1381,5 @@
 					if (TO in context):
 						if (token != "to"):
-							print "%s: Expected 'to' in architecture '%s'" % (inname, architecture)
+							print("%s: Expected 'to' in architecture '%s'" % (inname, architecture))
 						else:
 							output += "%s " % token
@@ -1390,5 +1390,5 @@
 					
 					if (not descriptor(token)):
-						print "%s: Expected interface descriptor in architecture '%s'" % (inname, architecture)
+						print("%s: Expected interface descriptor in architecture '%s'" % (inname, architecture))
 					else:
 						output += "%s " % token
@@ -1401,5 +1401,5 @@
 					if (FIN in context):
 						if (token != ";"):
-							print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+							print("%s: Expected ';' in architecture '%s'" % (inname, architecture))
 						else:
 							output += "%s" % token
@@ -1411,5 +1411,5 @@
 					if (VAR in context):
 						if (not identifier(token)):
-							print "%s: Expected instance name in architecture '%s'" % (inname, architecture)
+							print("%s: Expected instance name in architecture '%s'" % (inname, architecture))
 						else:
 							if (not architecture in arch_properties):
@@ -1429,5 +1429,5 @@
 					
 					if (not identifier(token)):
-						print "%s: Expected frame/architecture type in architecture '%s'" % (inname, architecture)
+						print("%s: Expected frame/architecture type in architecture '%s'" % (inname, architecture))
 					else:
 						output += "%s " % token
@@ -1439,5 +1439,5 @@
 				if (token == "}"):
 					if (indent != 1):
-						print "%s: Wrong number of parentheses in architecture '%s'" % (inname, architecture)
+						print("%s: Wrong number of parentheses in architecture '%s'" % (inname, architecture))
 					else:
 						indent -= 1
@@ -1468,5 +1468,5 @@
 					continue
 				
-				print "%s: Unknown token '%s' in architecture '%s'" % (inname, token, architecture)
+				print("%s: Unknown token '%s' in architecture '%s'" % (inname, token, architecture))
 				continue
 			
@@ -1487,5 +1487,5 @@
 				
 				if (not word(token)):
-					print "%s: Expected word in architecture head '%s'" % (inname, architecture)
+					print("%s: Expected word in architecture head '%s'" % (inname, architecture))
 				else:
 					output += "%s " % token
@@ -1494,5 +1494,5 @@
 			
 			if (not identifier(token)):
-				print "%s: Expected architecture name" % inname
+				print("%s: Expected architecture name" % inname)
 			else:
 				architecture = token
@@ -1514,5 +1514,5 @@
 		if (SYSTEM in context):
 			if (token != "architecture"):
-				print "%s: Expected 'architecture'" % inname
+				print("%s: Expected 'architecture'" % inname)
 			else:
 				output += "%s " % token
@@ -1541,5 +1541,5 @@
 			continue
 		
-		print "%s: Unknown token '%s'" % (inname, token)
+		print("%s: Unknown token '%s'" % (inname, token))
 	
 	inf.close()
@@ -1575,5 +1575,5 @@
 	
 	if ((output != "") and (opt_adl)):
-		outf = file(outname, "w")
+		outf = open(outname, "w")
 		outf.write(output)
 		outf.close()
@@ -1633,5 +1633,5 @@
 					merge_dot_frame("%s_%s" % (prefix, inst['var']), inst['var'], subframe, outf, indent + 1)
 				else:
-					print "%s: '%s' is neither an architecture nor a frame" % (arch['name'], inst['type'])
+					print("%s: '%s' is neither an architecture nor a frame" % (arch['name'], inst['type']))
 	
 	if ('bind' in arch):
@@ -1728,10 +1728,10 @@
 	
 	if (arch is None):
-		print "Unable to find system architecture"
+		print("Unable to find system architecture")
 		return
 	
 	if (opt_dot):
 		outname = os.path.join(outdir, "%s.dot" % arch['name'])
-		outf = file(outname, "w")
+		outf = open(outname, "w")
 		
 		outf.write("digraph {\n")
@@ -1752,5 +1752,5 @@
 						merge_dot_frame("%s" % inst['var'], inst['var'], subframe, outf, 1)
 					else:
-						print "%s: '%s' is neither an architecture nor a frame" % (arch['name'], inst['type'])
+						print("%s: '%s' is neither an architecture nor a frame" % (arch['name'], inst['type']))
 		
 		if ('bind' in arch):
@@ -1784,10 +1784,10 @@
 		if ('delegate' in arch):
 			for delegate in arch['delegate']:
-				print "Unable to delegate interface in system architecture"
+				print("Unable to delegate interface in system architecture")
 				break
 		
 		if ('subsume' in arch):
 			for subsume in arch['subsume']:
-				print "Unable to subsume interface in system architecture"
+				print("Unable to subsume interface in system architecture")
 				break
 		
@@ -1826,14 +1826,14 @@
 			pass
 		else:
-			print "Error: Unknown command line option '%s'" % arg
+			print("Error: Unknown command line option '%s'" % arg)
 			return
 	
 	if ((opt_bp) and (opt_ebp)):
-		print "Error: Cannot dump both original Behavior Protocols and Extended Behavior Protocols"
+		print("Error: Cannot dump both original Behavior Protocols and Extended Behavior Protocols")
 		return
 	
 	path = os.path.abspath(sys.argv[-1])
 	if (not os.path.isdir(path)):
-		print "Error: <OUTPUT> is not a directory"
+		print("Error: <OUTPUT> is not a directory")
 		return
 	
