cvsuser     03/07/03 03:04:16

  Modified:    .        MANIFEST MANIFEST.detailed
               config/gen core_pmcs.pl
               include/parrot chartype.h datatypes.h encoding.h
                        exceptions.h interpreter.h io.h longopt.h
                        resources.h string.h warnings.h
               lib/Parrot/Configure RunSteps.pm
  Added:       config/gen parrot_include.pl
               runtime/parrot/include README
  Log:
  runtime includes for parrot - 1
  
  Revision  Changes    Path
  1.361     +2 -0      parrot/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /cvs/public/parrot/MANIFEST,v
  retrieving revision 1.360
  retrieving revision 1.361
  diff -u -w -r1.360 -r1.361
  --- MANIFEST  2 Jul 2003 13:37:18 -0000       1.360
  +++ MANIFEST  3 Jul 2003 10:03:33 -0000       1.361
  @@ -105,6 +105,7 @@
   config/gen/makefiles/scheme.in
   config/gen/myconfig.pl
   config/gen/myconfig/myconfig.in
  +config/gen/parrot_include.pl
   config/gen/platform.pl
   config/gen/platform/ansi.c
   config/gen/platform/ansi.h
  @@ -1786,6 +1787,7 @@
   res_lea.c
   resources.c
   runops_cores.c
  +runtime/parropt/include/README
   rx.c
   rx.ops
   rxstacks.c
  
  
  
  1.33      +2 -0      parrot/MANIFEST.detailed
  
  Index: MANIFEST.detailed
  ===================================================================
  RCS file: /cvs/public/parrot/MANIFEST.detailed,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -w -r1.32 -r1.33
  --- MANIFEST.detailed 2 Jul 2003 13:37:18 -0000       1.32
  +++ MANIFEST.detailed 3 Jul 2003 10:03:33 -0000       1.33
  @@ -104,6 +104,7 @@
   []           config/gen/makefiles/scheme.in
   []           config/gen/myconfig.pl
   []           config/gen/myconfig/myconfig.in
  +[]           config/gen/parrot_include.pl
   []           config/gen/platform.pl
   []           config/gen/platform/ansi.c
   []           config/gen/platform/ansi.h
  @@ -1785,6 +1786,7 @@
   []           res_lea.c
   []           resources.c
   []           runops_cores.c
  +[devel]include       runtime/parrot/include/README
   []           rx.c
   []           rx.ops
   []           rxstacks.c
  
  
  
  1.7       +3 -0      parrot/config/gen/core_pmcs.pl
  
  Index: core_pmcs.pl
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/core_pmcs.pl,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- core_pmcs.pl      20 May 2003 08:37:12 -0000      1.6
  +++ core_pmcs.pl      3 Jul 2003 10:03:37 -0000       1.7
  @@ -25,6 +25,7 @@
    * Automatically generated by config/gen/core_pmcs.pl
    */
   
  +/* &gen_from_enum(pmctypes.pasm) subst(s/enum_class_(\\w+)/\$1/e) */
   enum {
   END
   
  @@ -34,6 +35,8 @@
       print OUT <<"END";
       enum_class_max
   };
  +
  +/* &end_gen */
   END
   
       close OUT;
  
  
  
  1.1                  parrot/config/gen/parrot_include.pl
  
  Index: parrot_include.pl
  ===================================================================
  package Configure::Step;
  
  use strict;
  use vars qw($description @args);
  use Parrot::Configure::Step ':gen';
  
  $description="Generating runtime/parrot/include ... ";
  
  my @files = qw(
      include/parrot/chartype.h
      include/parrot/core_pmcs.h
      include/parrot/datatypes.h
      include/parrot/encoding.h
      include/parrot/exceptions.h
      include/parrot/interpreter.h
      include/parrot/io.h
      include/parrot/longopt.h
      include/parrot/resources.h
      include/parrot/string.h
      include/parrot/warnings.h
  );
  my $destdir = 'runtime/parrot/include';
  
  @args=();
  
  sub runstep {
      for my $f (@files) {
        my $in_def = ''; # in #define='def', in enum='enum'
        my ($inc, $prefix, $last_val, $subst, %values);
        open F, "<$f" or die "Can't open $f\n";
        while (<F>) {
            if (m!
                &gen_from_(enum|def)\((.*?)\)
                (\s+prefix\((\w+)\))?
                (\s+subst\((s/.*?/.*?/\w*)\))?
                !x
            ) {
                $inc = $2;
                print "$2 ";
                $prefix = ($4 || '');
                $subst = ($6 || '');
                $in_def = $1;
                $last_val = -1;
                %values = ();
                open INC, ">$inc.tmp" or die "Can't write $inc.tmp";
                print INC <<"EOF";
  # DO NOT EDIT THIS FILE.
  #
  # This file is generated automatically from
  # $f by config/gen/parrot_include.pl
  #
  # Any changes made here will be lost.
  #
  EOF
                next;
            }
            if (/&end_gen/) {
                close INC;
                move_if_diff("$inc.tmp", "$destdir/$inc");
                $in_def = '';
                next;
            }
            if ($in_def eq 'def') {
                if (/#define\s+(\w+)\s+(-?\w+)/) {
                    local $_ = "$prefix$1\t$2";
                    eval $subst if ($subst ne '');
                    print INC ".constant $_\n";
                }
            }
            elsif ($in_def eq 'enum') {
                if (/(\w+)\s+=\s+(-?\w+)/) {
                    local $_;
                    if (defined($values{$2})) {
                        $_ = "$prefix$1\t" . $values{$2};
                        $last_val = $values{$2};
                    }
                    else {
                        $_ = "$prefix$1\t$2";
                        $last_val = $2;
                    }
                    $values{$1} = $2;
                    eval $subst if ($subst ne '');
                    print INC ".constant $_\n";
                }
                elsif (/^\s+(\w+)\s*(?!=)/) {
                    $last_val++;
                    $values{$1} = $last_val;
                    local $_ = "$prefix$1\t$last_val";
                    eval $subst if ($subst ne '');
                    print INC ".constant $_\n";
                }
            }
  
        }
        if ($in_def ne '') {
            die "Missing '&end_gen' in $f\n";
        }
        close(F);
      }
  }
  
  1;
  
  
  
  1.14      +4 -1      parrot/include/parrot/chartype.h
  
  Index: chartype.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/chartype.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -r1.13 -r1.14
  --- chartype.h        6 Nov 2002 08:52:19 -0000       1.13
  +++ chartype.h        3 Jul 2003 10:03:57 -0000       1.14
  @@ -1,7 +1,7 @@
   /* chartype.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: chartype.h,v 1.13 2002/11/06 08:52:19 leo Exp $
  + *     $Id: chartype.h,v 1.14 2003/07/03 10:03:57 leo Exp $
    *  Overview:
    *     This is the api header for the string character type subsystem
    *  Data Structure and Algorithms:
  @@ -15,11 +15,14 @@
   
   typedef Parrot_UInt (*Parrot_CharType_Transcoder)(Parrot_UInt c);
   
  +/* &gen_from_enum(chartypes.pasm) subst(s/enum_(\w+)/uc($1)/e) */
   enum {
       enum_chartype_usascii,
       enum_chartype_unicode,
       enum_chartype_MAX
   };
  +
  +/* &end_gen */
   
   struct parrot_chartype_t {
       INTVAL index;
  
  
  
  1.4       +4 -1      parrot/include/parrot/datatypes.h
  
  Index: datatypes.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/datatypes.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- datatypes.h       8 Nov 2002 15:00:51 -0000       1.3
  +++ datatypes.h       3 Jul 2003 10:03:57 -0000       1.4
  @@ -3,7 +3,7 @@
    *  Copyright: (c) 2002 Leopold Toetsch <[EMAIL PROTECTED]>
    *  License:  Artistic/GPL, see README and LICENSES for details
    *  CVS Info
  - *     $Id: datatypes.h,v 1.3 2002/11/08 15:00:51 leo Exp $
  + *     $Id: datatypes.h,v 1.4 2003/07/03 10:03:57 leo Exp $
    *  Overview:
    *     Parrot and native data types enums and type names.
    *
  @@ -15,6 +15,7 @@
   #if !defined(PARROT_DATATYPES_H_GUARD)
   #define PARROT_DATATYPES_H_GUARD
   
  +/* &gen_from_enum(datatypes.pasm) subst(s/enum_type_(\w+)/uc("DATATYPE_$1")/e) */
   typedef enum {
       enum_type_undef,            /* illegal */
       enum_first_type = -100,
  @@ -63,6 +64,8 @@
       enum_last_type              /* + one */
   
   } PARROT_DATA_TYPES;
  +
  +/* &end_gen */
   
   #if defined(INSIDE_GLOBAL_SETUP)
   const char *datatype_names[] = {
  
  
  
  1.17      +4 -1      parrot/include/parrot/encoding.h
  
  Index: encoding.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/encoding.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -w -r1.16 -r1.17
  --- encoding.h        14 May 2003 06:54:56 -0000      1.16
  +++ encoding.h        3 Jul 2003 10:03:57 -0000       1.17
  @@ -1,7 +1,7 @@
   /* encoding.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: encoding.h,v 1.16 2003/05/14 06:54:56 sfink Exp $
  + *     $Id: encoding.h,v 1.17 2003/07/03 10:03:57 leo Exp $
    *  Overview:
    *     This is the api header for the string encoding subsystem
    *  Data Structure and Algorithms:
  @@ -13,6 +13,7 @@
   #if !defined(PARROT_ENCODING_H_GUARD)
   #define PARROT_ENCODING_H_GUARD
   
  +/* &gen_from_enum(encodings.pasm) subst(s/enum_(\w+)/uc($1)/e) */
   enum {
       enum_encoding_singlebyte,
       enum_encoding_utf8,
  @@ -20,6 +21,8 @@
       enum_encoding_utf32,
       enum_encoding_MAX
   };
  +
  +/* &end_gen */
   
   struct parrot_encoding_t {
       INTVAL index;
  
  
  
  1.25      +9 -1      parrot/include/parrot/exceptions.h
  
  Index: exceptions.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/exceptions.h,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -w -r1.24 -r1.25
  --- exceptions.h      21 Jan 2003 10:10:41 -0000      1.24
  +++ exceptions.h      3 Jul 2003 10:03:57 -0000       1.25
  @@ -1,7 +1,7 @@
   /* exceptions.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: exceptions.h,v 1.24 2003/01/21 10:10:41 leo Exp $
  + *     $Id: exceptions.h,v 1.25 2003/07/03 10:03:57 leo Exp $
    *  Overview:
    *     define the internal interpreter exceptions
    *  Data Structure and Algorithms:
  @@ -23,6 +23,8 @@
           do_panic(interpreter, message, __FILE__, __LINE__)
   
   /* Exception Types */
  +/* &gen_from_def(except_types.pasm) prefix(EXCEPTION_) */
  +
   #define NO_REG_FRAMES 1
   #define SUBSTR_OUT_OF_STRING 1
   #define ORD_OUT_OF_STRING 1
  @@ -54,6 +56,10 @@
   #define ILL_INHERIT 2
   #define NO_PREV_CS 3
   
  +/* &end_gen */
  +
  +/* &gen_from_enum(except_severity.pasm) subst(s/(\w+)/uc($1)/e) */
  +
   typedef enum {
       EXCEPT_normal = 0,
       EXCEPT_warning = 1,
  @@ -62,6 +68,8 @@
       EXCEPT_fatal = 4,
       EXCEPT_doomed = 5
   } exception_severity;
  +
  +/* &end_gen */
   
   /* Right now there's nothing special for the jump buffer, but there might be one 
later, so we wrap it in a struct so that we can expand it later */
   struct parrot_exception_t {
  
  
  
  1.74      +8 -1      parrot/include/parrot/interpreter.h
  
  Index: interpreter.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/interpreter.h,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -w -r1.73 -r1.74
  --- interpreter.h     2 Jul 2003 07:58:55 -0000       1.73
  +++ interpreter.h     3 Jul 2003 10:03:57 -0000       1.74
  @@ -1,7 +1,7 @@
   /* interpreter.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: interpreter.h,v 1.73 2003/07/02 07:58:55 leo Exp $
  + *     $Id: interpreter.h,v 1.74 2003/07/03 10:03:57 leo Exp $
    *  Overview:
    *     The interpreter api handles running the operations
    *  Data Structure and Algorithms:
  @@ -16,6 +16,7 @@
   /* These should be visible to embedders. */
   
   /* General flags */
  +/* &gen_from_enum(interpflags.pasm) prefix(INTERPFLAG_) */
   typedef enum {
       NO_FLAGS             = 0x00,
       PARROT_DEBUG_FLAG    = 0x01,  /* We're debugging */
  @@ -31,6 +32,8 @@
       PARROT_DESTROY_FLAG  = 0x400  /* the last interpreter shall cleanup */
   } Parrot_Interp_flag;
   
  +/* &end_gen */
  +
   struct Parrot_Interp;
   
   typedef struct Parrot_Interp *Parrot_Interp;
  @@ -185,6 +188,8 @@
   #define PCONST(i) PF_CONST(interpreter->code, (i))
   #define PNCONST   PF_NCONST(interpreter->code)
   
  +/* &gen_from_def(sysinfo.pasm) prefix(SYSINFO_) */
  +
   #define PARROT_INTSIZE               1
   #define PARROT_FLOATSIZE             2
   #define PARROT_POINTERSIZE           3
  @@ -193,6 +198,8 @@
   #define PARROT_OS_VERSION_NUMBER     6
   #define CPU_ARCH                     7
   #define CPU_TYPE                     8
  +
  +/* &end_gen */
   
   struct Parrot_Interp *make_interpreter(Interp_flags);
   void Parrot_init(Parrot_Interp, void*);
  
  
  
  1.34      +7 -1      parrot/include/parrot/io.h
  
  Index: io.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/io.h,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -w -r1.33 -r1.34
  --- io.h      1 Jul 2003 15:41:05 -0000       1.33
  +++ io.h      3 Jul 2003 10:03:57 -0000       1.34
  @@ -1,7 +1,7 @@
   /* io.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: io.h,v 1.33 2003/07/01 15:41:05 dan Exp $
  + *     $Id: io.h,v 1.34 2003/07/03 10:03:57 leo Exp $
    *  Overview:
    *      Parrot IO subsystem
    *  Data Structure and Algorithms:
  @@ -50,10 +50,14 @@
   #  define STDERR_FILENO 2
   #endif
   
  +/* &gen_from_def(stdio.pasm) */
  +
   #define PIO_STDIN_FILENO 0
   #define PIO_STDOUT_FILENO 1
   #define PIO_STDERR_FILENO 2
   
  +/* &end_gen */
  +
   #ifndef O_ACCMODE
   #  define O_ACCMODE 0003
   #endif
  @@ -69,12 +73,14 @@
   
   #define PIO_NR_OPEN 256         /* Size of an "IO handle table" */
   
  +/* &gen_from_enum(iotypes.pasm) */
   enum {
       PIO_TYPE_FILE,
       PIO_TYPE_PIPE,
       PIO_TYPE_SOCKET,
       PIO_TYPE_MAX
   };
  +/* &end_gen */
   
   /* IO object flags */
   #define PIO_F_READ      00000001
  
  
  
  1.5       +4 -2      parrot/include/parrot/longopt.h
  
  Index: longopt.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/longopt.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- longopt.h 2 Jul 2003 16:39:14 -0000       1.4
  +++ longopt.h 3 Jul 2003 10:03:57 -0000       1.5
  @@ -1,7 +1,7 @@
   /* longopt.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: longopt.h,v 1.4 2003/07/02 16:39:14 leo Exp $
  + *     $Id: longopt.h,v 1.5 2003/07/03 10:03:57 leo Exp $
    *  Overview:
    *     Command line option parsing (for pre-initialized code)
    *  Data Structure and Algorithms:
  @@ -19,10 +19,12 @@
    */
   typedef const char* longopt_string_t;
   
  +/* &gen_from_enum(longopt.pasm) subst(s/(\w+)/uc($1)/e) */
   typedef enum {
       OPTION_required_FLAG = 0x1,
       OPTION_optional_FLAG = 0x2
   } OPTION_flags;
  +/* &end_gen */
   
   struct longopt_opt_decl {
       int               opt_short;
  
  
  
  1.43      +5 -1      parrot/include/parrot/resources.h
  
  Index: resources.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/resources.h,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -w -r1.42 -r1.43
  --- resources.h       6 Jun 2003 08:29:48 -0000       1.42
  +++ resources.h       3 Jul 2003 10:03:57 -0000       1.43
  @@ -1,7 +1,7 @@
   /* register.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: resources.h,v 1.42 2003/06/06 08:29:48 leo Exp $
  + *     $Id: resources.h,v 1.43 2003/07/03 10:03:57 leo Exp $
    *  Overview:
    *     Defines the resource allocation API
    *  Data Structure and Algorithms:
  @@ -70,6 +70,8 @@
       struct Stash *parent_stash;
   };
   
  +/* &gen_from_def(interpinfo.pasm) prefix(INTERPINFO_) */
  +
   #define TOTAL_MEM_ALLOC 1
   #define DOD_RUNS 2
   #define COLLECT_RUNS 3
  @@ -80,6 +82,8 @@
   #define HEADER_ALLOCS_SINCE_COLLECT 8
   #define MEM_ALLOCS_SINCE_COLLECT 9
   #define TOTAL_COPIED 10
  +
  +/* &end_gen */
   
   #endif /* PARROT_RESOURCES_H */
   
  
  
  
  1.53      +5 -1      parrot/include/parrot/string.h
  
  Index: string.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/string.h,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -w -r1.52 -r1.53
  --- string.h  11 Dec 2002 14:50:46 -0000      1.52
  +++ string.h  3 Jul 2003 10:03:57 -0000       1.53
  @@ -1,7 +1,7 @@
   /* string.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: string.h,v 1.52 2002/12/11 14:50:46 leo Exp $
  + *     $Id: string.h,v 1.53 2003/07/03 10:03:57 leo Exp $
    *  Overview:
    *     This is the api header for the string subsystem
    *  Data Structure and Algorithms:
  @@ -37,6 +37,9 @@
   
   
   /* stringinfo parameters */
  +
  +/* &gen_from_def(stringinfo.pasm) */
  +
   #define STRINGINFO_HEADER   1
   #define STRINGINFO_STRSTART 2
   #define STRINGINFO_BUFLEN   3
  @@ -44,6 +47,7 @@
   #define STRINGINFO_BUFUSED  5
   #define STRINGINFO_STRLEN   6
   
  +/* &end_gen */
   #define STRING struct parrot_string_t
   
   #endif
  
  
  
  1.12      +3 -0      parrot/include/parrot/warnings.h
  
  Index: warnings.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/warnings.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -r1.11 -r1.12
  --- warnings.h        28 Jun 2003 11:25:17 -0000      1.11
  +++ warnings.h        3 Jul 2003 10:03:57 -0000       1.12
  @@ -4,6 +4,7 @@
   /* These should be visible to embedders. */
   
   /* Warning flags */
  +/* &gen_from_enum(warnings.pasm)  */
   typedef enum {
       PARROT_WARNINGS_ALL_FLAG      = 0xFF,
       PARROT_WARNINGS_NONE_FLAG     = 0x00,
  @@ -11,6 +12,8 @@
       PARROT_WARNINGS_IO_FLAG       = 0x02,
       PARROT_WARNINGS_PLATFORM_FLAG = 0x04
   } Warnings_classes;
  +
  +/* &end_gen */
   
   #define PARROT_WARNINGS_on(interp, flag) do { \
       (interp)->ctx.warns = buffer_unmake_COW(interp, (interp)->ctx.warns); \
  
  
  
  1.20      +3 -2      parrot/lib/Parrot/Configure/RunSteps.pm
  
  Index: RunSteps.pm
  ===================================================================
  RCS file: /cvs/public/parrot/lib/Parrot/Configure/RunSteps.pm,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -w -r1.19 -r1.20
  --- RunSteps.pm       23 May 2003 16:30:42 -0000      1.19
  +++ RunSteps.pm       3 Jul 2003 10:04:06 -0000       1.20
  @@ -37,6 +37,7 @@
        gen/platform.pl
        gen/libparrot_def.pl
       gen/core_pmcs.pl
  +     gen/parrot_include.pl
   );
   
   sub runsteps {
  
  
  
  1.1                  parrot/runtime/parrot/include/README
  
  Index: README
  ===================================================================
  This directory contains (mostly autogenerated) include files
  with constants defined somewhere in the interpreter.
  s. config/gen/parrot_include.pl for details.
  
  Also some other useful code pieces might go here.
  
  
  

Reply via email to