summaryrefslogtreecommitdiff
path: root/sandbox/davidg/pysource_reader/nodes.py
blob: 6aae3bdb648d6e861056d8957c7944d9e9c6889c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#! /usr/bin/env python

"""
:Author: David Goodger
:Contact: goodger@users.sourceforge.net
:Revision: $Revision$
:Date: $Date$
:Copyright: This module has been placed in the public domain.

"""

from dps import nodes
from dps.nodes import Element, TextElement, Structural, Component, Inline


# =====================
#  Structural Elements
# =====================

class package_section(Structural, Element): pass
class module_section(Structural, Element): pass
class class_section(Structural, Element): pass
class method_section(Structural, Element): pass
class function_section(Structural, Element): pass
class module_attribute_section(Structural, Element): pass
class class_attribute_section(Structural, Element): pass
class instance_attribute_section(Structural, Element): pass

# Structural Support Elements
# ---------------------------

class inheritance_list(Component, Element): pass
class parameter_list(Component, Element): pass
class parameter_item(Component, Element): pass
class optional_parameters(Component, Element): pass
class parameter_tuple(Component, Element): pass
class parameter_default(Component, TextElement): pass
class initial_value(Component, TextElement): pass


# =================
#  Inline Elements
# =================

class package(Component, Inline, TextElement): pass
class module(Component, Inline, TextElement): pass


class inline_class(Component, Inline, TextElement):

    tagname = 'class'


class method(Component, Inline, TextElement): pass
class function(Component, Inline, TextElement): pass
class variable(Inline, TextElement): pass
class parameter(Component, Inline, TextElement): pass
class type(Inline, TextElement): pass
class class_attribute(Component, Inline, TextElement): pass
class module_attribute(Component, Inline, TextElement): pass
class instance_attribute(Component, Inline, TextElement): pass
class exception_class(Inline, TextElement): pass
class warning_class(Inline, TextElement): pass


class SpecificVisitor(nodes.SpecificVisitor):

    """
    """

    def visit_class_attribute(self, node, ancestry): pass
    def visit_class_attribute_section(self, node, ancestry): pass
    def visit_class_section(self, node, ancestry): pass
    def visit_exception_class(self, node, ancestry): pass
    def visit_function(self, node, ancestry): pass
    def visit_function_section(self, node, ancestry): pass
    def visit_inheritance_list(self, node, ancestry): pass
    def visit_initial_value(self, node, ancestry): pass
    def visit_inline_class(self, node, ancestry): pass
    def visit_instance_attribute(self, node, ancestry): pass
    def visit_instance_attribute_section(self, node, ancestry): pass
    def visit_method(self, node, ancestry): pass
    def visit_method_section(self, node, ancestry): pass
    def visit_module(self, node, ancestry): pass
    def visit_module_attribute(self, node, ancestry): pass
    def visit_module_attribute_section(self, node, ancestry): pass
    def visit_module_section(self, node, ancestry): pass
    def visit_optional_parameters(self, node, ancestry): pass
    def visit_package(self, node, ancestry): pass
    def visit_package_section(self, node, ancestry): pass
    def visit_parameter(self, node, ancestry): pass
    def visit_parameter_default(self, node, ancestry): pass
    def visit_parameter_item(self, node, ancestry): pass
    def visit_parameter_list(self, node, ancestry): pass
    def visit_parameter_tuple(self, node, ancestry): pass
    def visit_type(self, node, ancestry): pass
    def visit_variable(self, node, ancestry): pass
    def visit_warning_class(self, node, ancestry): pass