Index: contrib/arch/hadlbppp.py
===================================================================
--- contrib/arch/hadlbppp.py	(revision 810860a3b03c68519aa94b96cb8ea5adb53c0a19)
+++ contrib/arch/hadlbppp.py	(revision 303738425e404f1f592efe97699a11cb627d7dbd)
@@ -34,10 +34,8 @@
 import os
 
-# TODO:
-#  - interface inheritance
-
 INC, POST_INC, BLOCK_COMMENT, LINE_COMMENT, SYSTEM, ARCH, HEAD, BODY, NULL, \
-	INST, VAR, FIN, BIND, TO, SUBSUME, DELEGATE, IFACE, PROTOTYPE, PAR_LEFT, \
-	PAR_RIGHT, SIGNATURE, PROTOCOL, FRAME, PROVIDES, REQUIRES = range(25)
+	INST, VAR, FIN, BIND, TO, SUBSUME, DELEGATE, IFACE, EXTENDS, PRE_BODY, \
+	PROTOTYPE, PAR_LEFT, PAR_RIGHT, SIGNATURE, PROTOCOL, FRAME, PROVIDES, \
+	REQUIRES = range(27)
 
 def usage(prname):
@@ -356,4 +354,20 @@
 	return None
 
+def inherited_protocols(iface):
+	"Get protocols inherited by an interface"
+	
+	result = []
+	
+	if ('extends' in iface):
+		supiface = get_iface(iface['extends'])
+		if (not supiface is None):
+			if ('protocol' in supiface):
+				result.append(supiface['protocol'])
+			result.extend(inherited_protocols(supiface))
+		else:
+			print "%s: Extends unknown interface '%s'" % (iface['name'], iface['extends'])
+	
+	return result
+
 def dump_frame(frame, outdir, var, archf):
 	"Dump Behavior Protocol of a given frame"
@@ -374,4 +388,6 @@
 				if ('protocol' in iface):
 					protocols.append(extend_bp(outname, iface['protocol'], iface['name']))
+				for protocol in inherited_protocols(iface):
+					protocols.append(extend_bp(outname, protocol, iface['name']))
 			else:
 				print "%s: Provided interface '%s' is undefined" % (frame['name'], provides['iface'])
@@ -973,4 +989,42 @@
 			
 			if (HEAD in context):
+				if (PRE_BODY in context):
+					if (token == "{"):
+						output += "%s" % token
+						indent += 2
+						context.remove(PRE_BODY)
+						context.remove(HEAD)
+						context.add(BODY)
+						continue
+					
+					if (token == ";"):
+						output += "%s\n" % token
+						context.remove(PRE_BODY)
+						context.remove(HEAD)
+						context.remove(IFACE)
+						continue
+						
+					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)
+					else:
+						output += " %s" % token
+						if (not interface in iface_properties):
+							iface_properties[interface] = {}
+						
+						iface_properties[interface]['extends'] = token
+					
+					context.remove(EXTENDS)
+					context.add(PRE_BODY)
+					continue
+				
+				if (token == "extends"):
+					output += " %s" % token
+					context.add(EXTENDS)
+					continue
+					
 				if (token == "{"):
 					output += "%s" % token
@@ -986,9 +1040,5 @@
 					continue
 				
-				if (not word(token)):
-					print "%s: Expected word in interface head '%s'" % (inname, interface)
-				else:
-					output += "%s " % token
-				
+				print "%s: Expected 'extends', '{' or ';' in interface head '%s'" % (inname, interface)
 				continue
 			
