[Synopsis-changes] Synopsis/Synopsis/demo/Mixed synopsis.py,NONE,1.1 Makefile,1.10,1.11

Stefan Seefeld stefan at synopsis.fresco.org
Wed Nov 19 16:23:26 UTC 2003


Update of /cvs/synopsis/Synopsis/demo/Mixed
In directory frida:/tmp/cvs-serv14539/demo/Mixed

Modified Files:
	Makefile 
Added Files:
	synopsis.py 
Log Message:
more working demos

--- NEW FILE: synopsis.py ---
#! /usr/bin/env python

from Synopsis.process import process
from Synopsis.Processor import *
from Synopsis.Parsers import Cxx
from Synopsis.Parsers import IDL
from Synopsis.Processors import *
from Synopsis.Formatters import HTML
from Synopsis.Formatters.HTML import Page
from Synopsis.Formatters.HTML.Pages import *
from Synopsis.Formatters import TexInfo

class Cxx2IDL(TypeMapper):
    """this processor maps a C++ external reference to an IDL interface
    if the name either starts with 'POA_' or ends in '_ptr'"""

    def visitUnknown(self, unknown):

        name = unknown.name()
        if unknown.language() != "C++": return
        if name[0][0:4] == "POA_":
            interface = map(None, name)
            interface[0] = interface[0][4:]
            unknown.resolve("IDL", name, tuple(interface))
            if self.verbose:
               print "mapping", string.join(name, "::"), "to", string.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, tuple(interface))
            if self.verbose:
               print "mapping", string.join(name, "::"), "to", string.join(interface, "::")

idl = Composite(IDL.Parser(),
                Unduplicator(),     # remove duplicate and forward declarations
                EmptyNS(),          # skip empty namespaces
                SSDComments(),      # filter out any non-'//.' comments
                CommentStripper())  # strip any 'suspicious' comments

cxx = Composite(Cxx.Parser(preprocessor = 'c++',
                           cppflags = ['-I.', '-D__x86__']),
                Cxx2IDL(),          # map to interface to hide the skeletons
                Unduplicator(),     # remove duplicate and forward declarations
                EmptyNS(),          # skip empty namespaces
                SSDComments(),      # filter out any non-'//.' comments
                CommentStripper())  # strip any 'suspicious' comments

format_idl = HTML.Formatter(stylesheet_file = '../html.css',
                            toc_out = 'interface.toc',
                            pages = [FramesIndex(),
                                     Scope(),
                                     ModuleListing(),
                                     ModuleIndexer(),
                                     FileListing(),
                                     FileIndexer(),
                                     FileDetails(),
                                     InheritanceGraph(),
                                     NameIndex()])

format_cxx = HTML.Formatter(stylesheet_file = '../html.css',
                            toc_in = ['interface.toc|../interface'],
                            pages = [FramesIndex(),
                                     Scope(),
                                     ModuleListing(),
                                     ModuleIndexer(),
                                     FileListing(),
                                     FileIndexer(),
                                     FileDetails(),
                                     InheritanceGraph(),
                                     NameIndex()])

process(idl = idl,
        cxx = cxx,
        format_idl = format_idl,
        format_cxx = format_cxx)

Index: Makefile
===================================================================
RCS file: /cvs/synopsis/Synopsis/demo/Mixed/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -d -r1.10 -r1.11
--- Makefile	21 Jul 2002 09:34:35 -0000	1.10
+++ Makefile	19 Nov 2003 16:23:23 -0000	1.11
@@ -1,5 +1,5 @@
-omniidl		:= omniidl -nf -bcxx
-synopsis	:= ../../bin/synopsis -v -c config.py
+synopsis	:= python synopsis.py
+omniidl	:= omniidl
 
 #
 # adapt to your environent...
@@ -8,25 +8,25 @@ CPPFLAGS	:= -I. -I/usr/local/include -Wp
 
 all:	interface implementation
 
+interface interface.toc: Storage.syn
+	$(synopsis) format_idl --output=interface $<
+	touch $@
+
+implementation: StorableImpl.syn FactoryImpl.syn interface.toc
+	$(synopsis) format_cxx --output=$@ StorableImpl.syn FactoryImpl.syn
+	touch $@
+
 Storage.hh:	Storage.idl
-		$(omniidl) $?
+		$(omniidl) -nf -bcxx $?
 
-Storage.syn:	Storage.idl
-		$(synopsis) -Wc,parser=IDL,linker=Linker -o $@ $<
+Storage.syn: Storage.idl
+		$(synopsis) idl --output=$@ $<
 
 StorableImpl.syn:	StorableImpl.hh Storage.hh
-		$(synopsis) -Wc,parser=C++,linker=Mapping $(CPPFLAGS) -o $@ $<
+		$(synopsis) cxx --output=$@ $<
 
 FactoryImpl.syn:	FactoryImpl.hh Storage.hh
-		$(synopsis) -Wc,parser=C++,linker=Mapping $(CPPFLAGS) -o $@ $<
-
-interface interface.toc:	Storage.syn
-		$(synopsis) -Wc,formatter=Interface -o interface $<
-		touch $@
-
-implementation: StorableImpl.syn FactoryImpl.syn interface.toc
-		$(synopsis) -Wc,formatter=Implementation -o $@ StorableImpl.syn FactoryImpl.syn
-		touch $@
+		$(synopsis) cxx --output=$@ $<
 
 clean:
 	rm -rf Storage.hh StorageSK.cc *.syn interface interface.toc implementation *.pyc *.pyo





More information about the Synopsis-changes mailing list