idl-parser 0.0.10__py2.7.egg
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- EGG-INFO/PKG-INFO +109 -0
- EGG-INFO/SOURCES.txt +17 -0
- EGG-INFO/dependency_links.txt +1 -0
- EGG-INFO/top_level.txt +1 -0
- EGG-INFO/zip-safe +1 -0
- idl_parser/__init__.py +7 -0
- idl_parser/__init__.pyc +0 -0
- idl_parser/const.py +50 -0
- idl_parser/const.pyc +0 -0
- idl_parser/enum.py +114 -0
- idl_parser/enum.pyc +0 -0
- idl_parser/interface.py +207 -0
- idl_parser/interface.pyc +0 -0
- idl_parser/module.py +259 -0
- idl_parser/module.pyc +0 -0
- idl_parser/node.py +115 -0
- idl_parser/node.pyc +0 -0
- idl_parser/parser.py +274 -0
- idl_parser/parser.pyc +0 -0
- idl_parser/struct.py +145 -0
- idl_parser/struct.pyc +0 -0
- idl_parser/token_buffer.py +25 -0
- idl_parser/token_buffer.pyc +0 -0
- idl_parser/type.py +249 -0
- idl_parser/type.pyc +0 -0
- idl_parser/typedef.py +85 -0
- idl_parser/typedef.pyc +0 -0
EGG-INFO/PKG-INFO
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 1.1
|
|
2
|
+
Name: idl-parser
|
|
3
|
+
Version: 0.0.10
|
|
4
|
+
Summary: Very simple OMG IDL (Interface Definition Language) parser. This parses IDL files and outputs intermediate class objects.
|
|
5
|
+
Home-page: http://www.sugarsweetrobotics.com/
|
|
6
|
+
Author: ysuga
|
|
7
|
+
Author-email: ysuga@ysuga.net
|
|
8
|
+
License: GPLv3
|
|
9
|
+
Download-URL: https://github.com/sugarsweetrobotics/idl_parser
|
|
10
|
+
Description: idl_parser
|
|
11
|
+
============
|
|
12
|
+
|
|
13
|
+
|Travis Build Status| |Coverage Status|
|
|
14
|
+
|
|
15
|
+
Description
|
|
16
|
+
-----------
|
|
17
|
+
|
|
18
|
+
OMG IDL file parser. This library just parse IDL files, and output intermidiate type objects.
|
|
19
|
+
|
|
20
|
+
Example
|
|
21
|
+
-----------
|
|
22
|
+
|
|
23
|
+
.. code:: python
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
example for idl_parser package
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
from idl_parser import parser
|
|
30
|
+
parser_ = parser.IDLParser()
|
|
31
|
+
idl_str = """
|
|
32
|
+
module my_module {
|
|
33
|
+
struct Time {
|
|
34
|
+
long sec;
|
|
35
|
+
long usec;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
typedef sequence<double> DoubleSeq;
|
|
39
|
+
|
|
40
|
+
struct TimedDoubleSeq {
|
|
41
|
+
Time tm;
|
|
42
|
+
DoubleSeq data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
enum RETURN_VALUE {
|
|
46
|
+
RETURN_OK,
|
|
47
|
+
RETURN_FAILED,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
interface DataGetter {
|
|
51
|
+
RETURN_VALUE getData(out TimedDoubleSeq data);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
};
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
global_module = parser_.load(idl_str)
|
|
58
|
+
my_module = global_module.module_by_name('my_module')
|
|
59
|
+
dataGetter = my_module.interface_by_name('DataGetter')
|
|
60
|
+
print 'DataGetter interface'
|
|
61
|
+
for m in dataGetter.methods:
|
|
62
|
+
print '- method:'
|
|
63
|
+
print ' name:', m.name
|
|
64
|
+
print ' returns:', m.returns.name
|
|
65
|
+
print ' arguments:'
|
|
66
|
+
for a in m.arguments:
|
|
67
|
+
print ' name:', a.name
|
|
68
|
+
print ' type:', a.type
|
|
69
|
+
print ' direction:', a.direction
|
|
70
|
+
|
|
71
|
+
doubleSeq = my_module.typedef_by_name('DoubleSeq')
|
|
72
|
+
print 'typedef %s %s' % (doubleSeq.type.name, doubleSeq.name)
|
|
73
|
+
|
|
74
|
+
timedDoubleSeq = my_module.struct_by_name('TimedDoubleSeq')
|
|
75
|
+
print 'TimedDoubleSeq'
|
|
76
|
+
for m in timedDoubleSeq.members:
|
|
77
|
+
print '- member:'
|
|
78
|
+
print ' name:', m.name
|
|
79
|
+
print ' type:', m.type.name
|
|
80
|
+
|
|
81
|
+
How to install
|
|
82
|
+
---------------
|
|
83
|
+
|
|
84
|
+
sudo pip install idl_parser
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
Copyright
|
|
88
|
+
------------
|
|
89
|
+
|
|
90
|
+
- author: Yuki Suga
|
|
91
|
+
|
|
92
|
+
- copyright: Yuki Suga @ ssr.tokyo
|
|
93
|
+
|
|
94
|
+
- license: GPLv3
|
|
95
|
+
|
|
96
|
+
.. |Travis Build Status| image:: https://travis-ci.org/sugarsweetrobotics/idl_parser.svg?branch=master
|
|
97
|
+
:target: https://travis-ci.org/sugarsweetrobotics/idl_parser
|
|
98
|
+
|
|
99
|
+
.. |Coverage Status| image:: https://coveralls.io/repos/github/sugarsweetrobotics/idl_parser/badge.svg?branch=master :target: https://coveralls.io/github/sugarsweetrobotics/idl_parser?branch=master
|
|
100
|
+
|
|
101
|
+
Platform: UNKNOWN
|
|
102
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
103
|
+
Classifier: Environment :: Console
|
|
104
|
+
Classifier: Intended Audience :: Developers
|
|
105
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
106
|
+
Classifier: Natural Language :: English
|
|
107
|
+
Classifier: Operating System :: OS Independent
|
|
108
|
+
Classifier: Programming Language :: Python
|
|
109
|
+
Classifier: Topic :: Scientific/Engineering
|
EGG-INFO/SOURCES.txt
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
README.rst
|
|
2
|
+
setup.py
|
|
3
|
+
idl_parser/__init__.py
|
|
4
|
+
idl_parser/const.py
|
|
5
|
+
idl_parser/enum.py
|
|
6
|
+
idl_parser/interface.py
|
|
7
|
+
idl_parser/module.py
|
|
8
|
+
idl_parser/node.py
|
|
9
|
+
idl_parser/parser.py
|
|
10
|
+
idl_parser/struct.py
|
|
11
|
+
idl_parser/token_buffer.py
|
|
12
|
+
idl_parser/type.py
|
|
13
|
+
idl_parser/typedef.py
|
|
14
|
+
idl_parser.egg-info/PKG-INFO
|
|
15
|
+
idl_parser.egg-info/SOURCES.txt
|
|
16
|
+
idl_parser.egg-info/dependency_links.txt
|
|
17
|
+
idl_parser.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
EGG-INFO/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
idl_parser
|
EGG-INFO/zip-safe
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
idl_parser/__init__.py
ADDED
idl_parser/__init__.pyc
ADDED
|
Binary file
|
idl_parser/const.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import os, sys, traceback
|
|
2
|
+
|
|
3
|
+
from . import node
|
|
4
|
+
sep = '::'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class IDLConst(node.IDLNode):
|
|
8
|
+
|
|
9
|
+
def __init__(self, name, typename, value, parent, filepath=None):
|
|
10
|
+
super(IDLConst, self).__init__('IDLConst', name, parent)
|
|
11
|
+
self._typename = typename
|
|
12
|
+
self._verbose = True
|
|
13
|
+
self._value = value
|
|
14
|
+
self._filepath= filepath
|
|
15
|
+
|
|
16
|
+
def to_simple_dic(self, quiet=False, full_path=False, recursive=False, member_only=False):
|
|
17
|
+
name = self.full_path if full_path else self.name
|
|
18
|
+
if quiet:
|
|
19
|
+
return 'const %s %s = %s' % (self.typename, name, self.value)
|
|
20
|
+
dic = { 'const %s' % name : { 'type' : self.typename,
|
|
21
|
+
'value' : self.value } }
|
|
22
|
+
return dic
|
|
23
|
+
|
|
24
|
+
def to_dic(self):
|
|
25
|
+
dic = { 'name' : self.name,
|
|
26
|
+
'filepath' : self.filepath,
|
|
27
|
+
'classname' : self.classname,
|
|
28
|
+
'typename' : self.typename,
|
|
29
|
+
'value' : self.value }
|
|
30
|
+
return dic
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def typename(self):
|
|
34
|
+
return self._typename
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def type(self):
|
|
38
|
+
return self.root_node.find_types(self.typename)[0]
|
|
39
|
+
@property
|
|
40
|
+
def value(self):
|
|
41
|
+
return self._value
|
|
42
|
+
|
|
43
|
+
@property
|
|
44
|
+
def value_string(self):
|
|
45
|
+
return self._value
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def full_path(self):
|
|
49
|
+
return self.parent.full_path + sep + self.name
|
|
50
|
+
|
idl_parser/const.pyc
ADDED
|
Binary file
|
idl_parser/enum.py
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import os, sys, traceback
|
|
2
|
+
|
|
3
|
+
from . import node
|
|
4
|
+
sep = '::'
|
|
5
|
+
|
|
6
|
+
class IDLEnumValue(node.IDLNode):
|
|
7
|
+
def __init__(self, value, parent):
|
|
8
|
+
super(IDLEnumValue, self).__init__('IDLEnumValue', '', parent)
|
|
9
|
+
self._verbose = True
|
|
10
|
+
self._value = value
|
|
11
|
+
|
|
12
|
+
def parse_blocks(self, blocks, filepath=None):
|
|
13
|
+
self._filepath = filepath
|
|
14
|
+
if len(blocks) == 1:
|
|
15
|
+
self._name = blocks[0]
|
|
16
|
+
else:
|
|
17
|
+
sys.stdout.write('Unkown Enum format %s\n' % blocks)
|
|
18
|
+
#name, type = self._name_and_type(blocks)
|
|
19
|
+
#self._name = name
|
|
20
|
+
#self._type = type
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def full_path(self):
|
|
24
|
+
return self.full_path + '.' + self.name
|
|
25
|
+
|
|
26
|
+
def to_simple_dic(self):
|
|
27
|
+
dic = {self.name : self.value }
|
|
28
|
+
return dic
|
|
29
|
+
|
|
30
|
+
def to_dic(self):
|
|
31
|
+
dic = { 'name' : self.name,
|
|
32
|
+
'filepath' : self.filepath,
|
|
33
|
+
'classname' : self.classname,
|
|
34
|
+
'value' : self.value }
|
|
35
|
+
return dic
|
|
36
|
+
@property
|
|
37
|
+
def value(self):
|
|
38
|
+
return self._value
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class IDLEnum(node.IDLNode):
|
|
44
|
+
|
|
45
|
+
def __init__(self, name, parent):
|
|
46
|
+
super(IDLEnum, self).__init__('IDLEnum', name, parent)
|
|
47
|
+
self._verbose = True
|
|
48
|
+
self._values = []
|
|
49
|
+
|
|
50
|
+
def to_simple_dic(self, quiet=False, full_path=False, recursive=False, member_only=False):
|
|
51
|
+
name = self.full_path if full_path else self.name
|
|
52
|
+
if quiet:
|
|
53
|
+
return 'enum %s' % name
|
|
54
|
+
dic = { 'enum %s' % name : [v.to_simple_dic() for v in self.values] }
|
|
55
|
+
return dic
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def to_dic(self):
|
|
59
|
+
dic = { 'name' : self.name,
|
|
60
|
+
'classname' : self.classname,
|
|
61
|
+
'values' : [v.to_dic() for v in self.values] }
|
|
62
|
+
return dic
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def full_path(self):
|
|
66
|
+
return self.parent.full_path + sep + self.name
|
|
67
|
+
|
|
68
|
+
def parse_tokens(self, token_buf, filepath=None):
|
|
69
|
+
self._filepath = filepath
|
|
70
|
+
self._counter = 0
|
|
71
|
+
kakko = token_buf.pop()
|
|
72
|
+
if not kakko == '{':
|
|
73
|
+
if self._verbose: sys.stdout.write('# Error. No kakko "{".\n')
|
|
74
|
+
raise InvalidIDLSyntaxError()
|
|
75
|
+
|
|
76
|
+
block_tokens = []
|
|
77
|
+
while True:
|
|
78
|
+
token = token_buf.pop()
|
|
79
|
+
if token == None:
|
|
80
|
+
if self._verbose: sys.stdout.write('# Error. No kokka "}".\n')
|
|
81
|
+
raise InvalidIDLSyntaxError()
|
|
82
|
+
|
|
83
|
+
elif token == '}':
|
|
84
|
+
token = token_buf.pop()
|
|
85
|
+
if not token == ';':
|
|
86
|
+
if self._verbose: sys.stdout.write('# Error. No semi-colon after "}".\n')
|
|
87
|
+
raise InvalidIDLSyntaxError()
|
|
88
|
+
|
|
89
|
+
if len(block_tokens) > 0:
|
|
90
|
+
self._parse_block(block_tokens)
|
|
91
|
+
break
|
|
92
|
+
|
|
93
|
+
if token == ',':
|
|
94
|
+
self._parse_block(block_tokens)
|
|
95
|
+
block_tokens = []
|
|
96
|
+
continue
|
|
97
|
+
block_tokens.append(token)
|
|
98
|
+
|
|
99
|
+
def _parse_block(self, blocks):
|
|
100
|
+
v = IDLEnumValue(self._counter, self)
|
|
101
|
+
self._counter = self._counter+ 1
|
|
102
|
+
v.parse_blocks(blocks, self.filepath)
|
|
103
|
+
self._values.append(v)
|
|
104
|
+
|
|
105
|
+
@property
|
|
106
|
+
def values(self):
|
|
107
|
+
return self._values
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def value_by_name(self, name):
|
|
111
|
+
for m in self.values:
|
|
112
|
+
if m.name == name:
|
|
113
|
+
return m
|
|
114
|
+
return None
|
idl_parser/enum.pyc
ADDED
|
Binary file
|
idl_parser/interface.py
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
from . import node
|
|
2
|
+
|
|
3
|
+
from . import type as idl_type
|
|
4
|
+
|
|
5
|
+
sep = '::'
|
|
6
|
+
|
|
7
|
+
class IDLArgument(node.IDLNode):
|
|
8
|
+
def __init__(self, parent):
|
|
9
|
+
super(IDLArgument, self).__init__('IDLArgument', '', parent)
|
|
10
|
+
self._verbose = True
|
|
11
|
+
self._dir = 'in'
|
|
12
|
+
self._type = None
|
|
13
|
+
|
|
14
|
+
def parse_blocks(self, blocks, filepath=None):
|
|
15
|
+
self._filepath= filepath
|
|
16
|
+
directions = ['in', 'out', 'inout']
|
|
17
|
+
self._dir = 'in'
|
|
18
|
+
if blocks[0] in directions:
|
|
19
|
+
self._dir = blocks[0]
|
|
20
|
+
blocks.pop(0)
|
|
21
|
+
pass
|
|
22
|
+
argument_name, argument_type = self._name_and_type(blocks)
|
|
23
|
+
self._name = argument_name
|
|
24
|
+
self._type = idl_type.IDLType(argument_type, self)
|
|
25
|
+
|
|
26
|
+
def to_simple_dic(self):
|
|
27
|
+
dic = '%s %s %s' % (self.direction, self.type, self.name)
|
|
28
|
+
return dic
|
|
29
|
+
|
|
30
|
+
def to_dic(self):
|
|
31
|
+
dic = { 'name' : self.name,
|
|
32
|
+
'classname' : self.classname,
|
|
33
|
+
'type' : str(self.type),
|
|
34
|
+
'direction' : self.direction,
|
|
35
|
+
'filepath' : self.filepath }
|
|
36
|
+
return dic
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def direction(self):
|
|
40
|
+
return self._dir
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def type(self):
|
|
44
|
+
return self._type
|
|
45
|
+
|
|
46
|
+
def post_process(self):
|
|
47
|
+
#self._type = self.refine_typename(self.type)
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class IDLMethod(node.IDLNode):
|
|
52
|
+
def __init__(self, parent):
|
|
53
|
+
super(IDLMethod, self).__init__('IDLValue', '', parent)
|
|
54
|
+
self._verbose = True
|
|
55
|
+
self._returns = None
|
|
56
|
+
self._arguments = []
|
|
57
|
+
|
|
58
|
+
def parse_blocks(self, blocks, filepath=None):
|
|
59
|
+
self._filepath=filepath
|
|
60
|
+
|
|
61
|
+
if blocks[0] == 'oneway':
|
|
62
|
+
self._oneway = True
|
|
63
|
+
blocks.pop(0)
|
|
64
|
+
else:
|
|
65
|
+
self._oneway = False
|
|
66
|
+
|
|
67
|
+
self._returns = idl_type.IDLType(blocks[0], self)
|
|
68
|
+
self._name = blocks[1]
|
|
69
|
+
self._arguments = []
|
|
70
|
+
|
|
71
|
+
if not blocks[2] == '(':
|
|
72
|
+
print(' -- Invalid Interface Token (%s)' % interface_name)
|
|
73
|
+
print( blocks)
|
|
74
|
+
|
|
75
|
+
index = 3
|
|
76
|
+
argument_blocks = []
|
|
77
|
+
while True:
|
|
78
|
+
if index == len(blocks):
|
|
79
|
+
break
|
|
80
|
+
token = blocks[index]
|
|
81
|
+
if token == ',' or token == ')':
|
|
82
|
+
if len(argument_blocks) == 0:
|
|
83
|
+
break
|
|
84
|
+
|
|
85
|
+
a = IDLArgument(self)
|
|
86
|
+
self._arguments.append(a)
|
|
87
|
+
a.parse_blocks(argument_blocks, self.filepath)
|
|
88
|
+
|
|
89
|
+
argument_blocks = []
|
|
90
|
+
else:
|
|
91
|
+
argument_blocks.append(token)
|
|
92
|
+
index = index + 1
|
|
93
|
+
|
|
94
|
+
def to_simple_dic(self):
|
|
95
|
+
return {self.name : {
|
|
96
|
+
'returns' : str(self.returns),
|
|
97
|
+
'params' : [a.to_simple_dic() for a in self.arguments]}}
|
|
98
|
+
|
|
99
|
+
def to_dic(self):
|
|
100
|
+
dic = { 'name' : self.name,
|
|
101
|
+
'filepath' : self.filepath,
|
|
102
|
+
'classname' : self.classname,
|
|
103
|
+
'returns' : str(self._returns),
|
|
104
|
+
'arguments' : [a.to_dic() for a in self.arguments]}
|
|
105
|
+
return dic
|
|
106
|
+
|
|
107
|
+
@property
|
|
108
|
+
def returns(self):
|
|
109
|
+
return self._returns
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def arguments(self):
|
|
113
|
+
return self._arguments
|
|
114
|
+
|
|
115
|
+
def argument_by_name(self, name):
|
|
116
|
+
for a in self.arguments:
|
|
117
|
+
if a.name == name:
|
|
118
|
+
return a
|
|
119
|
+
|
|
120
|
+
return None
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def forEachArgument(self, func):
|
|
124
|
+
for a in self.arguments:
|
|
125
|
+
func(a)
|
|
126
|
+
|
|
127
|
+
def post_process(self):
|
|
128
|
+
#self._returns = self.refine_typename(self.returns)
|
|
129
|
+
#self.forEachArgument(lambda a : a.post_process())
|
|
130
|
+
pass
|
|
131
|
+
|
|
132
|
+
class IDLInterface(node.IDLNode):
|
|
133
|
+
|
|
134
|
+
def __init__(self, name, parent):
|
|
135
|
+
super(IDLInterface, self).__init__('IDLInterface', name, parent)
|
|
136
|
+
self._verbose = True
|
|
137
|
+
self._methods = []
|
|
138
|
+
|
|
139
|
+
@property
|
|
140
|
+
def full_path(self):
|
|
141
|
+
return self.parent.full_path + sep + self.name
|
|
142
|
+
|
|
143
|
+
def to_simple_dic(self, quiet=False, full_path=False, recursive=False, member_only=False):
|
|
144
|
+
if quiet:
|
|
145
|
+
return 'interface %s' % self.name
|
|
146
|
+
dic = { 'interface ' + self.name : [m.to_simple_dic() for m in self.methods] }
|
|
147
|
+
return dic
|
|
148
|
+
|
|
149
|
+
def to_dic(self):
|
|
150
|
+
dic = { 'name' : self.name,
|
|
151
|
+
'filepath' : self.filepath,
|
|
152
|
+
'classname' : self.classname,
|
|
153
|
+
'methods' : [m.to_dic() for m in self.methods] }
|
|
154
|
+
return dic
|
|
155
|
+
|
|
156
|
+
def parse_tokens(self, token_buf, filepath=None):
|
|
157
|
+
self._filepath=filepath
|
|
158
|
+
kakko = token_buf.pop()
|
|
159
|
+
if not kakko == '{':
|
|
160
|
+
if self._verbose: sys.stdout.write('# Error. No kakko "{".\n')
|
|
161
|
+
raise InvalidIDLSyntaxError()
|
|
162
|
+
|
|
163
|
+
block_tokens = []
|
|
164
|
+
while True:
|
|
165
|
+
|
|
166
|
+
token = token_buf.pop()
|
|
167
|
+
if token == None:
|
|
168
|
+
if self._verbose: sys.stdout.write('# Error. No kokka "}".\n')
|
|
169
|
+
raise InvalidIDLSyntaxError()
|
|
170
|
+
|
|
171
|
+
elif token == '}':
|
|
172
|
+
token = token_buf.pop()
|
|
173
|
+
if not token == ';':
|
|
174
|
+
if self._verbose: sys.stdout.write('# Error. No semi-colon after "}".\n')
|
|
175
|
+
raise InvalidIDLSyntaxError()
|
|
176
|
+
break
|
|
177
|
+
|
|
178
|
+
if token == ';':
|
|
179
|
+
self._parse_block(block_tokens)
|
|
180
|
+
block_tokens = []
|
|
181
|
+
continue
|
|
182
|
+
block_tokens.append(token)
|
|
183
|
+
self._post_process()
|
|
184
|
+
|
|
185
|
+
def _post_process(self):
|
|
186
|
+
self.forEachMethod(lambda m : m.post_process())
|
|
187
|
+
|
|
188
|
+
def _parse_block(self, blocks):
|
|
189
|
+
v = IDLMethod(self)
|
|
190
|
+
v.parse_blocks(blocks, self.filepath)
|
|
191
|
+
self._methods.append(v)
|
|
192
|
+
|
|
193
|
+
@property
|
|
194
|
+
def methods(self):
|
|
195
|
+
return self._methods
|
|
196
|
+
|
|
197
|
+
def method_by_name(self, name):
|
|
198
|
+
for m in self.methods:
|
|
199
|
+
if name == m.name:
|
|
200
|
+
return m
|
|
201
|
+
return None
|
|
202
|
+
|
|
203
|
+
def forEachMethod(self, func):
|
|
204
|
+
for m in self.methods:
|
|
205
|
+
func(m)
|
|
206
|
+
|
|
207
|
+
|
idl_parser/interface.pyc
ADDED
|
Binary file
|