示例#1
0
 def visit_Production(self, item):
     self.graph.add_node(
         item,
         style(label='Production', fillcolor=BLUE)
     )
     for index, child in enumerate(item.children):
         styling = (
             style(color=DARKGRAY)
             if item.main > 0 and item.main == index
             else None
         )
         self.graph.add_edge(
             item, child,
             style=styling
         )
示例#2
0
 def visit_MinMaxBoundedRule(self, item):
     self.style(
         item,
         style(
             label='MinMaxBounded [item.min, item.max]'.format(item=item),
             fillcolor=ORANGE
         )
     )
示例#3
0
 def __call__(self, root):
     graph = super(DotTreeTransformator, self).__call__(root)
     for edge in self.relations.edges:
         graph.add_edge(edge.first,
                        edge.second,
                        style=style(label=edge.relation.label,
                                    dir='none',
                                    style='dashed'))
     return graph
示例#4
0
 def visit_Node(self, item):
     color = (
         GREEN
         if item.interpretator
         else BLUE
     )
     self.style(
         item,
         style(label=item.label, fillcolor=color)
     )
     if item.relation:
         self.relations.add(item.relation, item)
示例#5
0
 def visit_Node(self, item):
     color = (
         GREEN
         if item.interpretator
         else BLUE
     )
     self.style(
         item,
         style(label=item.label, fillcolor=color)
     )
     if item.relation:
         self.relations.add(item.relation, item)
示例#6
0
 def __call__(self, root):
     graph = super(DotTreeTransformator, self).__call__(root)
     for edge in self.relations.edges:
         graph.add_edge(
             edge.first,
             edge.second,
             style=style(
                 label=edge.relation.label,
                 dir='none',
                 style='dashed'
             )
         )
     return graph
示例#7
0
 def visit_RepeatableOptionalRule(self, item):
     self.style(item, style(label='RepeatableOptional', fillcolor=ORANGE))
示例#8
0
 def visit_Leaf(self, item):
     return style(label=item.label)
示例#9
0
 def visit_OptionalRule(self, item):
     self.style(
         item,
         style(label='Optional', fillcolor=ORANGE)
     )
示例#10
0
 def visit_ForwardRule(self, item):
     return style(label='Forward', fillcolor=PURPLE)
示例#11
0
 def visit_Node(self, item):
     return style(label=item.label, fillcolor=BLUE)
示例#12
0
 def visit_PipelineRule(self, item):
     self.style(item, style(label=item.pipeline.label, fillcolor=PURPLE))
示例#13
0
 def visit_RepeatableOptionalRule(self, item):
     return style(label='RepeatableOptional', fillcolor=ORANGE)
示例#14
0
 def visit_InterpretationRule(self, item):
     self.style(
         item,
         style(label=item.interpretator.label, fillcolor=GREEN)
     )
示例#15
0
 def visit_RelationRule(self, item):
     self.style(
         item,
         style(label=item.relation.label, fillcolor=PURPLE)
     )
示例#16
0
 def visit_PipelineProduction(self, item):
     self.style(
         item,
         style(label='PipelineProduction', fillcolor=BLUE)
     )
示例#17
0
 def visit_NamedRule(self, item):
     self.style(
         item,
         style(label=item.name, fillcolor=RED)
     )
示例#18
0
 def visit_MaxBoundedRule(self, item):
     self.style(
         item,
         style(label='MaxBounded <=%d' % item.max, fillcolor=ORANGE)
     )
示例#19
0
 def visit_MinBoundedRule(self, item):
     self.style(
         item,
         style(label='MinBounded >=%d' % item.min, fillcolor=ORANGE)
     )
示例#20
0
 def visit_RepeatableOptionalRule(self, item):
     self.style(
         item,
         style(label='RepeatableOptional', fillcolor=ORANGE)
     )
示例#21
0
 def visit_InterpretationRule(self, item):
     self.style(item, style(label=item.interpretator.label,
                            fillcolor=GREEN))
示例#22
0
 def visit_ForwardRule(self, item):
     self.style(
         item,
         style(label='Forward', fillcolor=PURPLE)
     )
示例#23
0
 def visit_ForwardRule(self, item):
     self.style(item, style(label='Forward', fillcolor=PURPLE))
示例#24
0
 def visit_EmptyRule(self, item):
     self.style(
         item,
         style(label='Empty')
     )
示例#25
0
 def visit_Predicate(self, item):
     self.style(
         item,
         style(label=item.label)
     )
示例#26
0
 def visit_EmptyProduction(self, item):
     self.style(
         item,
         style(label='EmptyProduction')
     )
示例#27
0
 def visit_NamedRule(self, item):
     return style(label=item.name, fillcolor=RED)
示例#28
0
 def visit_Predicate(self, item):
     self.style(item, style(label=item.label))
示例#29
0
 def visit_EmptyRule(self, item):
     return style(label='Empty')
示例#30
0
 def visit_EmptyProduction(self, item):
     self.style(item, style(label='EmptyProduction'))
示例#31
0
 def visit_InterpretationNode(self, item):
     return style(label=item.label, fillcolor=GREEN)
示例#32
0
 def visit_OrRule(self, item):
     self.style(item, style(label='Or', fillcolor=BLUE))
示例#33
0
 def visit_PipelineRule(self, item):
     self.style(
         item,
         style(label=item.pipeline.label, fillcolor=PURPLE)
     )
示例#34
0
 def visit_OrRule(self, item):
     self.style(
         item,
         style(label='Or', fillcolor=BLUE)
     )
示例#35
0
 def visit_Leaf(self, item):
     self.style(
         item,
         style(label=item.label)
     )
示例#36
0
 def visit_BNFRule(self, item):
     self.style(
         item,
         style(label=item.label, fillcolor=GREEN)
     )
示例#37
0
 def visit_Production(self, item):
     self.graph.add_node(item, style(label='Production', fillcolor=BLUE))
     for index, child in enumerate(item.children):
         styling = (style(color=DARKGRAY)
                    if item.main > 0 and item.main == index else None)
         self.graph.add_edge(item, child, style=styling)
示例#38
0
 def visit_Leaf(self, item):
     self.style(
         item,
         style(label=item.label)
     )
示例#39
0
 def visit_PipelineProduction(self, item):
     self.style(item, style(label='PipelineProduction', fillcolor=BLUE))
示例#40
0
 def visit_PredicateBase(self, item):
     return style(label=item.label)
示例#41
0
 def visit_OptionalRule(self, item):
     self.style(item, style(label='Optional', fillcolor=ORANGE))
示例#42
0
 def visit_Production(self, item):
     return style(label='Production', fillcolor=BLUE)
示例#43
0
 def visit_NamedRule(self, item):
     self.style(item, style(label=item.name, fillcolor=RED))
示例#44
0
 def visit_Rule(self, item):
     return style(label='Rule', fillcolor=BLUE)
示例#45
0
 def visit_RelationRule(self, item):
     self.style(item, style(label=item.relation.label, fillcolor=PURPLE))
示例#46
0
 def visit_OrRule(self, item):
     return style(label='Or', fillcolor=BLUE)
示例#47
0
 def visit_EmptyRule(self, item):
     self.style(item, style(label='Empty'))
示例#48
0
 def visit_OptionalRule(self, item):
     return style(label='Optional', fillcolor=ORANGE)
示例#49
0
 def visit_BNFRule(self, item):
     self.style(item, style(label=item.label, fillcolor=GREEN))
 def visit_MinMaxBoundedRule(self, item):
     self.style(
         item,
         style(label='MinMaxBounded [{item.min}, {item.max}]'.format(
             item=item),
               fillcolor=ORANGE))