Update of /cvsroot/pygccxml/source/pygccxml/parser
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19663
Modified Files:
__init__.py project_reader.py
Log Message:
Started adding doc strings.
Index: __init__.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/parser/__init__.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** __init__.py 6 Mar 2006 14:31:41 -0000 1.18
--- __init__.py 8 Mar 2006 08:38:53 -0000 1.19
***************
*** 4,7 ****
--- 4,9 ----
# http://www.boost.org/LICENSE_1_0.txt)
+ """Parser sub-package.
+ """
from config import config_t
***************
*** 28,31 ****
--- 30,45 ----
, compilation_mode=COMPILATION_MODE.FILE_BY_FILE
, cache=None ):
+ """Parse header files.
+
+ @param files: The header files that should be parsed
+ @type files: list of str
+ @param config: Configuration object or None
+ @type config: L{config_t}
+ @param compilation_mode: Determines whether the files are parsed individually or as one single chunk
+ @type compilation_mode: L{COMPILATION_MODE}
+ @param cache: Declaration cache (None=no cache)
+ @type cache: L{cache_base_t} or str
+ @returns: Declarations
+ """
if not config:
Index: project_reader.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/parser/project_reader.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** project_reader.py 6 Mar 2006 04:52:08 -0000 1.24
--- project_reader.py 8 Mar 2006 08:38:53 -0000 1.25
***************
*** 74,78 ****
--- 74,99 ----
class project_reader_t:
+ """Parses header files and returns the contained declarations.
+ """
def __init__( self, config, cache=None, decl_factory=None):
+ """Constructor.
+
+ config is a configuration object that contains the parameters
+ for invoking gccxml. cache specifies the cache to use for
+ caching declarations between separate runs. By default, no
+ cache is used. decl_factory is an object that must provide
+ the same interface than
+ L{decl_factory_t<declarations.decl_factory_t>}, i.e. there must
+ be a set of C{create_*} methods that return an instance of an
+ appropriate declaration class. By default, the declaration
+ classes defined in the L{declarations} package are used.
+
+ @param config: Configuration object
+ @type config: L{config_t}
+ @param cache: Declaration cache (None=no cache)
+ @type cache: L{cache_base_t} or str
+ @param decl_factory: Custom declaration factory object or None
+ @type decl_factory: decl_factory_t
+ """
self.__config = config
self.__dcache = None
***************
*** 88,91 ****
--- 109,120 ----
def read_files( self, files, compilation_mode=COMPILATION_MODE.FILE_BY_FILE):
+ """Parse header files.
+
+ @param files: The header files that should be parsed
+ @type files: list of str
+ @param compilation_mode: Determines whether the files are parsed individually or as one single chunk
+ @type compilation_mode: L{COMPILATION_MODE}
+ @returns: Declarations
+ """
if compilation_mode == COMPILATION_MODE.ALL_AT_ONCE:
return self.__parse_all_at_once(files)
***************
*** 166,169 ****
--- 195,204 ----
def read_string(self, content):
+ """Parse a string containing C/C++ source code.
+
+ @param content: C/C++ source code.
+ @type content: str
+ @returns: Declarations
+ """
reader = source_reader.source_reader_t( self.__config, None, self.__decl_factory )
return reader.read_string( content )
|