cvsuser     03/07/10 03:48:00

  Modified:    .        MANIFEST core.ops exceptions.c
  Log:
  exceptions-1: classes, ops, prototypes
  
  Revision  Changes    Path
  1.369     +2 -0      parrot/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /cvs/public/parrot/MANIFEST,v
  retrieving revision 1.368
  retrieving revision 1.369
  diff -u -w -r1.368 -r1.369
  --- MANIFEST  8 Jul 2003 21:42:08 -0000       1.368
  +++ MANIFEST  10 Jul 2003 10:48:00 -0000      1.369
  @@ -29,6 +29,8 @@
   classes/csub.pmc                                  []
   classes/default.pmc                               []
   classes/eval.pmc                                  []
  +classes/exception.pmc                             []
  +classes/exception_handler.pmc                     []
   classes/genclass.pl                               []
   classes/intlist.pmc                               []
   classes/iterator.pmc                              []
  
  
  
  1.301     +45 -0     parrot/core.ops
  
  Index: core.ops
  ===================================================================
  RCS file: /cvs/public/parrot/core.ops,v
  retrieving revision 1.300
  retrieving revision 1.301
  diff -u -w -r1.300 -r1.301
  --- core.ops  9 Jul 2003 19:31:03 -0000       1.300
  +++ core.ops  10 Jul 2003 10:48:00 -0000      1.301
  @@ -1085,6 +1085,51 @@
   }
   ########################################
   
  +=item Exception handling
  +
  +=over 4
  +
  +=item B<set_eh>(in PMC)
  +
  +Push the exception handler in $1 on the control stack.
  +
  +=item B<clear_eh>()
  +
  +Clear out the most recently placed exception.
  +
  +=item B<throw>(in PMC)
  +
  +Throw the exception in $1.
  +
  +=item B<rethrow>(in PMC)
  +
  +Only valid inside an exception handler. Rethrow the exception $1.
  +
  +=back
  +
  +=cut
  +
  +inline op set_eh(in PMC) {
  +  push_exception(interpreter, $1);
  +  goto NEXT();
  +}
  +
  +inline op clear_eh() {
  +  pop_exception(interpreter);
  +  goto NEXT();
  +}
  +
  +inline op throw(in PMC) {
  +  throw_exception(interpreter, $1);
  +  restart NEXT();
  +}
  +
  +inline op rethrow(in PMC) {
  +  rethrow_exception(interpreter, $1);
  +  goto NEXT();
  +}
  +
  +########################################
   =item B<set_addr>(out INT, in INT)
   
   Sets register $1 to the current address plus the offset $2.
  
  
  
  1.13      +21 -1     parrot/exceptions.c
  
  Index: exceptions.c
  ===================================================================
  RCS file: /cvs/public/parrot/exceptions.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -w -r1.12 -r1.13
  --- exceptions.c      10 Jul 2003 08:40:48 -0000      1.12
  +++ exceptions.c      10 Jul 2003 10:48:00 -0000      1.13
  @@ -1,7 +1,7 @@
   /* exceptions.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: exceptions.c,v 1.12 2003/07/10 08:40:48 leo Exp $
  + *     $Id: exceptions.c,v 1.13 2003/07/10 10:48:00 leo Exp $
    *  Overview:
    *     define the internal interpreter exceptions
    *  Data Structure and Algorithms:
  @@ -81,6 +81,26 @@
       fprintf(stderr, "\nDumping Core...\n");
   
       dumpcore();
  +}
  +
  +void
  +push_exception(Parrot_Interp interpreter, PMC *handler)
  +{
  +}
  +
  +void
  +pop_exception(Parrot_Interp interpreter)
  +{
  +}
  +
  +void
  +throw_exception(Parrot_Interp interpreter, PMC *handler)
  +{
  +}
  +
  +void
  +rethrow_exception(Parrot_Interp interpreter, PMC *handler)
  +{
   }
   
   /*
  
  
  

Reply via email to