コード例 #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
ファイル: transformators.py プロジェクト: vitalyvels/yargy
 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))
コード例 #50
0
 def visit_MinMaxBoundedRule(self, item):
     self.style(
         item,
         style(label='MinMaxBounded [{item.min}, {item.max}]'.format(
             item=item),
               fillcolor=ORANGE))