Ejemplo n.º 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
         )
Ejemplo n.º 2
0
 def visit_MinMaxBoundedRule(self, item):
     self.style(
         item,
         style(
             label='MinMaxBounded [item.min, item.max]'.format(item=item),
             fillcolor=ORANGE
         )
     )
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 7
0
 def visit_RepeatableOptionalRule(self, item):
     self.style(item, style(label='RepeatableOptional', fillcolor=ORANGE))
Ejemplo n.º 8
0
 def visit_Leaf(self, item):
     return style(label=item.label)
Ejemplo n.º 9
0
 def visit_OptionalRule(self, item):
     self.style(
         item,
         style(label='Optional', fillcolor=ORANGE)
     )
Ejemplo n.º 10
0
 def visit_ForwardRule(self, item):
     return style(label='Forward', fillcolor=PURPLE)
Ejemplo n.º 11
0
 def visit_Node(self, item):
     return style(label=item.label, fillcolor=BLUE)
Ejemplo n.º 12
0
 def visit_PipelineRule(self, item):
     self.style(item, style(label=item.pipeline.label, fillcolor=PURPLE))
Ejemplo n.º 13
0
 def visit_RepeatableOptionalRule(self, item):
     return style(label='RepeatableOptional', fillcolor=ORANGE)
Ejemplo n.º 14
0
 def visit_InterpretationRule(self, item):
     self.style(
         item,
         style(label=item.interpretator.label, fillcolor=GREEN)
     )
Ejemplo n.º 15
0
 def visit_RelationRule(self, item):
     self.style(
         item,
         style(label=item.relation.label, fillcolor=PURPLE)
     )
Ejemplo n.º 16
0
 def visit_PipelineProduction(self, item):
     self.style(
         item,
         style(label='PipelineProduction', fillcolor=BLUE)
     )
Ejemplo n.º 17
0
 def visit_NamedRule(self, item):
     self.style(
         item,
         style(label=item.name, fillcolor=RED)
     )
Ejemplo n.º 18
0
 def visit_MaxBoundedRule(self, item):
     self.style(
         item,
         style(label='MaxBounded <=%d' % item.max, fillcolor=ORANGE)
     )
Ejemplo n.º 19
0
 def visit_MinBoundedRule(self, item):
     self.style(
         item,
         style(label='MinBounded >=%d' % item.min, fillcolor=ORANGE)
     )
Ejemplo n.º 20
0
 def visit_RepeatableOptionalRule(self, item):
     self.style(
         item,
         style(label='RepeatableOptional', fillcolor=ORANGE)
     )
Ejemplo n.º 21
0
 def visit_InterpretationRule(self, item):
     self.style(item, style(label=item.interpretator.label,
                            fillcolor=GREEN))
Ejemplo n.º 22
0
 def visit_ForwardRule(self, item):
     self.style(
         item,
         style(label='Forward', fillcolor=PURPLE)
     )
Ejemplo n.º 23
0
 def visit_ForwardRule(self, item):
     self.style(item, style(label='Forward', fillcolor=PURPLE))
Ejemplo n.º 24
0
 def visit_EmptyRule(self, item):
     self.style(
         item,
         style(label='Empty')
     )
Ejemplo n.º 25
0
 def visit_Predicate(self, item):
     self.style(
         item,
         style(label=item.label)
     )
Ejemplo n.º 26
0
 def visit_EmptyProduction(self, item):
     self.style(
         item,
         style(label='EmptyProduction')
     )
Ejemplo n.º 27
0
 def visit_NamedRule(self, item):
     return style(label=item.name, fillcolor=RED)
Ejemplo n.º 28
0
 def visit_Predicate(self, item):
     self.style(item, style(label=item.label))
Ejemplo n.º 29
0
 def visit_EmptyRule(self, item):
     return style(label='Empty')
Ejemplo n.º 30
0
 def visit_EmptyProduction(self, item):
     self.style(item, style(label='EmptyProduction'))
Ejemplo n.º 31
0
 def visit_InterpretationNode(self, item):
     return style(label=item.label, fillcolor=GREEN)
Ejemplo n.º 32
0
 def visit_OrRule(self, item):
     self.style(item, style(label='Or', fillcolor=BLUE))
Ejemplo n.º 33
0
 def visit_PipelineRule(self, item):
     self.style(
         item,
         style(label=item.pipeline.label, fillcolor=PURPLE)
     )
Ejemplo n.º 34
0
 def visit_OrRule(self, item):
     self.style(
         item,
         style(label='Or', fillcolor=BLUE)
     )
Ejemplo n.º 35
0
 def visit_Leaf(self, item):
     self.style(
         item,
         style(label=item.label)
     )
Ejemplo n.º 36
0
 def visit_BNFRule(self, item):
     self.style(
         item,
         style(label=item.label, fillcolor=GREEN)
     )
Ejemplo n.º 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)
Ejemplo n.º 38
0
 def visit_Leaf(self, item):
     self.style(
         item,
         style(label=item.label)
     )
Ejemplo n.º 39
0
 def visit_PipelineProduction(self, item):
     self.style(item, style(label='PipelineProduction', fillcolor=BLUE))
Ejemplo n.º 40
0
 def visit_PredicateBase(self, item):
     return style(label=item.label)
Ejemplo n.º 41
0
 def visit_OptionalRule(self, item):
     self.style(item, style(label='Optional', fillcolor=ORANGE))
Ejemplo n.º 42
0
 def visit_Production(self, item):
     return style(label='Production', fillcolor=BLUE)
Ejemplo n.º 43
0
 def visit_NamedRule(self, item):
     self.style(item, style(label=item.name, fillcolor=RED))
Ejemplo n.º 44
0
 def visit_Rule(self, item):
     return style(label='Rule', fillcolor=BLUE)
Ejemplo n.º 45
0
 def visit_RelationRule(self, item):
     self.style(item, style(label=item.relation.label, fillcolor=PURPLE))
Ejemplo n.º 46
0
 def visit_OrRule(self, item):
     return style(label='Or', fillcolor=BLUE)
Ejemplo n.º 47
0
 def visit_EmptyRule(self, item):
     self.style(item, style(label='Empty'))
Ejemplo n.º 48
0
 def visit_OptionalRule(self, item):
     return style(label='Optional', fillcolor=ORANGE)
Ejemplo n.º 49
0
 def visit_BNFRule(self, item):
     self.style(item, style(label=item.label, fillcolor=GREEN))
Ejemplo n.º 50
0
 def visit_MinMaxBoundedRule(self, item):
     self.style(
         item,
         style(label='MinMaxBounded [{item.min}, {item.max}]'.format(
             item=item),
               fillcolor=ORANGE))