528 |
class mpdep(SimpleRelation): |
class mpdep(SimpleRelation): |
529 |
key = 'dep' |
key = 'dep' |
530 |
def __init__(self, var, s, list): |
def __init__(self, var, s, list): |
531 |
(m,s) = match_remove('^\s*"(.*?)"\s*', s) |
args = s.split() |
532 |
self.stereo = m.group(1) |
if len(args) < 3: raise UMLException("Not enough arguments for 'dep' %s." % (s)) |
533 |
SimpleRelation.__init__(self, var, s, list) |
if len(args) > 3: raise UMLException("Too many arguments for 'dep' %s." %(s)) |
534 |
|
self.stereo = None |
535 |
|
for arg in args: |
536 |
|
if arg.startswith('"'): |
537 |
|
self.stereo = arg |
538 |
|
args.remove(arg) |
539 |
|
if self.stereo == None: raise UMLException("Dependency role not given in %s." %(s)) |
540 |
|
print self.stereo, ' '.join(args) |
541 |
|
SimpleRelation.__init__(self, var, ' '.join(args), list) |
542 |
def draw_code(self): |
def draw_code(self): |
543 |
return self.pathCode() + self.repl(' dep(%%.p, "%stereo%"); ') |
return self.pathCode() + self.repl(' dep(%%.p, %stereo%); ') |
544 |
|
|
545 |
class mpvobsubmatch(SimpleRelation): |
class mpvobsubmatch(SimpleRelation): |
546 |
key = 'vobsubmatch' |
key = 'vobsubmatch' |