Commit Graph

6 Commits (2c0181d6253def8584edbd7cbd04d5c3ec81e011)

Author SHA1 Message Date
dionisos 55889fd691 Exception usage cleanup. Use exceptions to terminate the parser in all cases.
Also protect pointers with auto_ptr to ensure cleanup.

Note: Before this change exceptions *could* occur, but all pointer-referenced
memory would be leaked.

* tparse/tparse.h: Change #include-s to C++ names.
  (RCSParseError):  Change to be a public descendant of exception. Use
  string datatype to ensure automatic cleanup. Implement a destructor
  as required by exception.
  (RCSExpected):  Use string datatype to ensure automatic cleanup. Add
  constructor for expected characters.
  (Branche): Removed.  Replaced with std::list<>.
  (Sink): Change method definition to reflect switch to exceptions.
  (TokenParser::match):  Add method for matching characters.
  (TokenParser::semicol, TokenParser::matchsemicol): Removed.
  Obsolete because we're now able to match single characters.
  (tparseParser):  Change method definition to reflect the switch
  to exceptions.
  (tparseParser::parse):  Adapt to changed method definitions.

* tparse/tparse.cpp: Change #include-s to C++ names.
  (TokenParser::get): Space changes and conversion to auto_ptr.
  (tparseParser::parse_rcs_admin,
   tparseParser::parse_rcs_description,
   tparseParser::parse_rcs_deltatext): Conversion to auto_ptr and exceptions.
  (tparseParser::parse_rcs_tree): Conversion to auto_ptr and exceptions. Also
  adjust for removal of Branche class.

* tparse/tparsemodule.h:  Include Python.h, since
  we,re actually using python types.

* tparse/tparsemodule.cpp (pyobject, pystring):
  New classes.  Used to anchor python objects ensuring their refcounts
  are decremented.
  (chkpy):  New.  Function to check python return value and act appropriately.
  (initparse):  Correctly anchor python strings.
  (rcstoken_to_pystring):  Removed.  Now integrated into the pystring class.
  (PythonSink):  Claim ownership for the duration of the instance lifetime.
  Also adjust all methods for the switch to exceptions.
  (tparse):  Adapt to the switch to exceptions.  Also prevent memory leakage
  when an exception occurs.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1060 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-01 13:56:23 +00:00
cmpilato 04426fdf30 * viewcvs/tparse/tparse.cpp
* viewcvs/tparse/tparse.h
* viewcvs/tparse/tparsemodule.cpp
* viewcvs/tparse/tparsemodule.h
  Massive tparse reindenting, reformatting, and spacing /
  capitalization fixes in messages.  Patch by Max Bowsher
  <maxb@ukf.net> (tweaked a little by cmpilato to ensure lines < 80
  characters).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@820 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-06 02:52:08 +00:00
lbruand 718b506a9f * Removed debugging statments from the (C++) Sink class.
* Changed INSTALL to reflect the move of rcsparse to lib/vclib/ccvs/rcsparse.
  * Now when tparse cannot import common.py, it fails.
  * Added check for sink being of common.Sink class.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@482 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-13 18:19:12 +00:00
lbruand 87f43f02d5 Support for parser exceptions RCS*
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@476 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-11 20:13:50 +00:00
lbruand fdb39468d3 added INSTALL file and various small modif.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@454 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-27 13:57:29 +00:00
lbruand a163e8b5b8 Initial revision of the C++ RCS parser.
VS: ----------------------------------------------------------------------


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@453 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-25 17:36:15 +00:00