Пример #1
0
def make_node_list(dir_name):
    node_list = []
    parser = BlinkIDLParser(debug=False)
    for idl_file in find_idl_files(dir_name):
        definitions = parse_file(parser, idl_file)
        node_list.append(definitions)
    return node_list
Пример #2
0
def make_node_idlfname_list(dir_name):
    node_and_idlfname = []
    parser = BlinkIDLParser(debug=False)
    for idl_file in find_idl_files(dir_name):
        definitions = parse_file(parser, idl_file)
        node_and_idlfname.append((definitions,os.path.basename(idl_file)))
    return node_and_idlfname
Пример #3
0
def main(dir_name):
    node_and_idlfname = []
    def_basename = {}
    for idl_file in find_idl_files(dir_name):
        parser = BlinkIDLParser(debug=False)
        definitions = parse_file(parser, idl_file)
        node_and_idlfname.append([definitions, os.path.basename(idl_file)])
    return node_and_idlfname
Пример #4
0
def get_interface_nodes(dir_path):
    parser = BlinkIDLParser(debug=False)
    class_name = 'Interface'
    for node_path in get_idl_files(dir_path):
        definitions = parse_file(parser, node_path)
        for definition in definitions.GetChildren():
            if definition.GetClass() == class_name:
                yield definition
Пример #5
0
    def __init__(self, interfaces_info=None, outputdir=''):
        self.extended_attribute_validator = IDLExtendedAttributeValidator()
        self.interfaces_info = interfaces_info

        if interfaces_info:
            self.interface_dependency_resolver = InterfaceDependencyResolver(interfaces_info, self)
        else:
            self.interface_dependency_resolver = None

        self.parser = BlinkIDLParser(outputdir=outputdir)
Пример #6
0
def get_definitions(paths):
    """Returns a generator of IDL node.
    Args:
      paths: list of IDL file path
    Returns:
      a generator which yields IDL node objects
    """
    parser = BlinkIDLParser()
    for path in paths:
        definitions = parse_file(parser, path)
        for definition in definitions.GetChildren():
            yield definition
Пример #7
0
 def __init__(self):
     super(BlinkConverter, self).__init__(BlinkIDLParser())
 def test_missing_semicolon_between_definitions(self):
     # No semicolon after enum definition.
     text = '''enum TestEnum { "value" } dictionary TestDictionary {};'''
     parser = BlinkIDLParser()
     parser.ParseText(filename='', data=text)
     self.assertGreater(parser.GetErrors(), 0)
Пример #9
0
 def setUp(self):
     parser = BlinkIDLParser()
     path = os.path.join(
         testdata_path, utilities.read_file_to_list(_FILE)[0])
     definitions = parse_file(parser, path)
     self.definition = definitions.GetChildren()[0]
def main(args):
    parser = BlinkIDLParser(debug=True)
    definitions = parse_file(parser, args[0])
    print '=== Tree ==='
    _dump_tree(definitions)
Пример #11
0
 def setUp(self):
     parser = BlinkIDLParser()
     path = utilities.read_file_to_list(_FILE)[0]
     definitions = parse_file(parser, path)
     self.definition = definitions.GetChildren()[0]