コード例 #1
0
ファイル: synopsis.py プロジェクト: stefanseefeld/synopsis
#

from Synopsis.process import process
from Synopsis.Processor import Processor, Parameter, Composite
from Synopsis.Parsers import Cxx
from Synopsis.Parsers import Python
from Synopsis.Processors import Linker
from Synopsis.Processors import Comments
from Synopsis.Formatters import DocBook

cxx = Cxx.Parser(base_path='../src')

ss = Comments.Translator(filter = Comments.SSFilter(),
                         processor = Comments.Grouper())
ssd_prev = Comments.Translator(filter = Comments.SSDFilter(),
                               processor = Composite(Comments.Previous(),
                                                     Comments.Grouper()))
javadoc = Comments.Translator(markup='javadoc',
                              filter = Comments.JavaFilter(),
                              processor = Comments.Grouper())
rst = Comments.Translator(markup='rst',
                          filter = Comments.SSDFilter(),
                          processor = Comments.Grouper())

process(cxx_ss = Composite(cxx, ss),
        cxx_ssd_prev = Composite(cxx, ssd_prev),
        cxx_javadoc = Composite(cxx, javadoc),
        cxx_rst = Composite(cxx, rst),
        link = Linker(),
        docbook = DocBook.Formatter())
コード例 #2
0
ファイル: synopsis.py プロジェクト: tinyserver/siege
        def name_cmp(a,b):
            a, b = a.name, b.name
            res = cmp(a[-1],b[-1])
            if res == 0: res = cmp(a,b)
            return res
        for items in dict.values():
            items.sort(name_cmp)
        
        return dict

process(cp_sg=Composite(c, sg),
        c_sg=Composite(c_nopriv, sg),
        link=Linker(),
        html=HTML.Formatter(title='SIEGE Reference Manual', index=[FileTree()], content=[
                            Scope(parts=[
                                Summary(),
                                Detail()
                                ]),
                            Source(),
                            Directory(src_dir=srcdir, base_path=srcdir),
                            XRef(),
                            FileDetails(),
                            FileIndex(),
                            #FileListing(),
                            #InheritanceTree(),
                            #InheritanceGraph(),
                            SGNameIndex(private=['`', '_', 'sgm'], prefix=['_', 'SG_', 'SG', 'sg'])]),
        dump=Dump.Formatter()
        #
        )
コード例 #3
0
        for items in dict.values():
            items.sort(name_cmp)

        return dict


process(
    cp_sg=Composite(c, sg),
    c_sg=Composite(c_nopriv, sg),
    link=Linker(),
    html=HTML.Formatter(
        title='SIEGE Reference Manual',
        index=[FileTree()],
        content=[
            Scope(parts=[Summary(), Detail()]),
            Source(),
            Directory(src_dir=srcdir, base_path=srcdir),
            XRef(),
            FileDetails(),
            FileIndex(),
            #FileListing(),
            #InheritanceTree(),
            #InheritanceGraph(),
            SGNameIndex(private=['`', '_', 'sgm'],
                        prefix=['_', 'SG_', 'SG', 'sg'])
        ]),
    dump=Dump.Formatter()
    #
)
コード例 #4
0
ファイル: synopsis.py プロジェクト: stefanseefeld/synopsis
        if unknown.language != "C++": return
        if name[0][0:4] == "POA_":
            interface = map(None, name)
            interface[0] = interface[0][4:]
            unknown.resolve("IDL", name, QName(interface))
            if self.verbose:
               print 'mapping', '::'.join(name), 'to', '::'.join(interface)
        elif name[-1][-4:] == "_ptr" or name[-1][-4:] == "_var":
            interface = map(None, name)
            interface[-1] = interface[-1][:-4]
            unknown.resolve("IDL", name, QName(interface))
            if self.verbose:
               print 'mapping', '::'.join(name), 'to', '::'.join(interface)

idl = Composite(IDL.Parser(),
                Linker(Comments.Translator(filter = Comments.SSDFilter(),
                                           processor = Comments.Grouper())))

cxx = Composite(Cxx.Parser(cppflags = ['-I', '.']),
                Linker(Cxx2IDL(),
                       Comments.Translator(filter = Comments.SSDFilter(),
                                           processor = Comments.Grouper())))

format_idl = HTML.Formatter(toc_out = 'interface.toc')
format_cxx = HTML.Formatter(toc_in = ['interface.toc|../interface'])

process(idl = idl,
        cxx = cxx,
        format_idl = format_idl,
        format_cxx = format_cxx)
コード例 #5
0
ファイル: synopsis.py プロジェクト: stefanseefeld/synopsis
from Synopsis.Parsers import Cxx
from Synopsis.Processors import *
from Synopsis.Processors import Comments
from Synopsis.Formatters import HTML
from Synopsis.Formatters.HTML.DirectoryLayout import *
from Synopsis.Formatters.HTML.Views import *
from Synopsis.Formatters import Dot

cxx = Cxx.Parser(base_path='../src/', sxr_prefix='sxr')

ss = Comments.Translator(filter = Comments.SSFilter(),
                         processor = Comments.Grouper())
ssd_prev = Comments.Translator(filter = Comments.SSDFilter(),
                               processor = Composite(Comments.Previous(),
                                                     Comments.Grouper()))
javadoc = Comments.Translator(markup='javadoc',
                              filter = Comments.JavaFilter(),
                              processor = Comments.Grouper())
rst = Comments.Translator(markup='rst',
                          filter = Comments.SSDFilter(),
                          processor = Comments.Grouper())

html = HTML.Formatter(sxr_prefix = 'sxr')

process(cxx_ss = Composite(cxx, ss),
        cxx_ssd_prev = Composite(cxx, ssd_prev),
        cxx_javadoc = Composite(cxx, javadoc),
        cxx_rst = Composite(cxx, rst),
        link = Linker(sxr_prefix='sxr'),
        html = html)
コード例 #6
0
ファイル: synopsis.py プロジェクト: stefanseefeld/synopsis
#
# Copyright (C) 2006 Stefan Seefeld
# All rights reserved.
# Licensed to the public under the terms of the GNU LGPL (>= 2),
# see the file COPYING for details.
#

from Synopsis.process import process
from Synopsis.Processor import Processor, Parameter, Composite
from Synopsis.Parsers import Cpp
from Synopsis.Parsers import Cxx
from Synopsis.Formatters import Dot

cpp = Cpp.Parser(base_path='../src/', flags=['-I../src'], primary_file_only = False)
cxx = Cxx.Parser(base_path='../src/', cppflags=['-I../src'], primary_file_only = False)
dot = Dot.Formatter(format='png', bgcolor='#ffcc99')

process(files = Composite(cpp, Dot.Formatter(type = 'file', format = 'png', bgcolor='#8beb82')),
        classes = Composite(cxx, dot),
        cxx = cxx,
        dot = dot)
コード例 #7
0
ファイル: synopsis.py プロジェクト: stefanseefeld/synopsis
# see the file COPYING for details.
#

from Synopsis.process import process
from Synopsis.Processor import Processor, Parameter, Composite
from Synopsis.Parsers import Cxx
from Synopsis.Processors import *
from Synopsis.Processors import Comments
from Synopsis.Formatters import SXR

cxx = Cxx.Parser(base_path='../src/', sxr_prefix='sxr',)

ss = Comments.Translator(filter = Comments.SSFilter(),
                         processor = Comments.Grouper())
ssd_prev = Comments.Translator(filter = Comments.SSDFilter(),
                               processor = Composite(Comments.Previous(),
                                                     Comments.Grouper()))
javadoc = Comments.Translator(markup='javadoc',
                              filter = Comments.JavaFilter(),
                              processor = Comments.Grouper())
rst = Comments.Translator(markup='rst',
                          filter = Comments.SSDFilter(),
                          processor = Comments.Grouper())

process(cxx_ss = Composite(cxx, ss),
        cxx_ssd_prev = Composite(cxx, ssd_prev),
        cxx_javadoc = Composite(cxx, javadoc),
        cxx_rst = Composite(cxx, rst),
        link = Linker(sxr_prefix='sxr'),
        sxr = SXR.Formatter(src_dir = '../src/', sxr_prefix='sxr'))
コード例 #8
0
ファイル: synopsis.py プロジェクト: stefanseefeld/synopsis
#
# Copyright (C) 2006 Stefan Seefeld
# All rights reserved.
# Licensed to the public under the terms of the GNU LGPL (>= 2),
# see the file COPYING for details.
#

from Synopsis.process import process
from Synopsis.Processor import *
from Synopsis.Parsers import IDL
from Synopsis.Processors import Linker
from Synopsis.Processors import Comments
from Synopsis.Formatters import HTML

parser = Composite(IDL.Parser(cppflags=['-I.'], base_path='.'),
                   Comments.Translator(filter = Comments.SSDFilter(),
                                       processor = Comments.Grouper()))
linker = Linker()

format = HTML.Formatter()

process(parse = parser,
        link = linker,
        format = format)
コード例 #9
0
ファイル: synopsis.py プロジェクト: stefanseefeld/synopsis
        # merge in IR from 'input' parameter if given
        self.ir = self.merge_input(ir)

        print 'this processor is harmless...', self.parameter
      
        # write to output (if given) and return IR
        return self.output_and_return_ir()

cxx = Cxx.Parser(base_path='../src')

ss = Comments.Translator(filter = Comments.SSFilter(),
                         processor = Comments.Grouper())
ssd_prev = Comments.Translator(filter = Comments.SSDFilter(),
                               processor = Composite(Comments.Previous(),
                                                     Comments.Grouper()))
javadoc = Comments.Translator(markup='javadoc',
                              filter = Comments.JavaFilter(),
                              processor = Comments.Grouper())
rst = Comments.Translator(markup='rst',
                          filter = Comments.SSDFilter(),
                          processor = Comments.Grouper())

process(cxx_ss = Composite(cxx, ss),
        cxx_ssd_prev = Composite(cxx, ssd_prev),
        cxx_javadoc = Composite(cxx, javadoc),
        cxx_rst = Composite(cxx, rst),
        link = Linker(),
        html = HTML.Formatter(),
        dot = Dot.Formatter(),
        joker = Joker(parameter = '(-;'))
コード例 #10
0
ファイル: synopsis.py プロジェクト: saksham21/boost.xml
linker = Linker(# filter out header guards
                MacroFilter(pattern = r'^boost_(.*)_hpp_$'),
                # filter out 'detail' namespace
                ModuleFilter(modules = [('boost', 'xml', 'dom', 'detail')]),
                # translate documentation
                Comments.Translator(markup = 'rst',
                                    filter = Comments.SSDFilter(),
                                    processor = Comments.Grouper()))

html = HTML.Formatter(title = 'Boost XML Reference Manual',
                      content = [Scope(),
                                 FileDetails(),
                                 InheritanceTree(),
                                 InheritanceGraph(),
                                 Source(prefix = 'links'),
                                 NameIndex(),
                                 XRef(xref_file = 'bxl.xref')])

sxr = SXR.Formatter(url = '/sxr.cgi',
                    src_dir = '../src',
                    xref_prefix='xref',
                    syntax_prefix='links')

process(parse = parser,
        xref = xref,
        link = linker,
        dump = Dump.Formatter(),
        html = html,
        sxr = sxr)