Added a new attribute to targets -- 'terminal', which indicates that the current...
authorSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 14 Sep 2009 02:36:27 +0000 (02:36 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 14 Sep 2009 02:36:27 +0000 (02:36 +0000)
sfatables/xmlextension.py

index 1e27e76..77219eb 100644 (file)
@@ -12,6 +12,7 @@ class Xmlextension:
     processor = ""
     operand = "VALUE"
     arguments = []
+    terminal = 0 
 
     def __init__(self, dir, component_name):
         filename = dir+"/"+component_name+".xml"
@@ -34,6 +35,9 @@ class Xmlextension:
         help = p.xpathEval('//rule/argument/help')
         target = p.xpathEval('//rule/argument/operand')
 
+        context = p.xpathEval('//attributes/attribute[@terminal="yes"]')
+        self.terminal = (context != [])
+
         self.arguments = map(lambda (name,help,target):{'name':name.content,'help':help.content,'target':target.content}, zip(name,help,target))
         
         p.xpathFreeContext()