"for example" is more appropriate than "that is"

This commit is contained in:
Bill Currie 2002-09-16 15:42:11 +00:00
parent 3b09f34532
commit 412db7e27d
7 changed files with 14 additions and 2 deletions

2
NEWS
View file

@ -17,7 +17,7 @@ Changes from 0.3.0
* Object-oriented runtime system, in the style of Objective-C. * Object-oriented runtime system, in the style of Objective-C.
* Runtime fixups of built-in functions whose builtin number is * Runtime fixups of built-in functions whose builtin number is
zero. If a built-in function is available to the engine, with zero. If a built-in function is available to the engine, with
the same name given in the source code (i.e. the same name given in the source code (e.g.
"void (void) coredump = #0;"), the engine will set the value "void (void) coredump = #0;"), the engine will set the value
to the actual number used by the engine. to the actual number used by the engine.
* Debugging support (needs compiler support, which qfcc * Debugging support (needs compiler support, which qfcc

View file

@ -52,6 +52,7 @@ typedef struct def_s {
unsigned global:1; // globally declared def unsigned global:1; // globally declared def
unsigned external:1; // externally declared def unsigned external:1; // externally declared def
unsigned local:1; // function local def unsigned local:1; // function local def
unsigned system:1; // system def
string_t file; // source file string_t file; // source file
int line; // source line int line; // source line
@ -98,6 +99,7 @@ typedef struct scope_s {
typedef enum { typedef enum {
st_none, st_none,
st_global, st_global,
st_system,
st_extern, st_extern,
st_static, st_static,
st_local st_local

View file

@ -75,6 +75,7 @@ typedef struct qfo_def_s {
#define QFOD_GLOBAL (1u<<3) #define QFOD_GLOBAL (1u<<3)
#define QFOD_EXTERNAL (1u<<4) #define QFOD_EXTERNAL (1u<<4)
#define QFOD_LOCAL (1u<<5) #define QFOD_LOCAL (1u<<5)
#define QFOD_SYSTEM (1u<<6)
typedef struct qfo_func_s { typedef struct qfo_func_s {
string_t name; string_t name;

View file

@ -151,6 +151,9 @@ set_storage_bits (def_t *def, storage_class_t storage)
switch (storage) { switch (storage) {
case st_none: case st_none:
break; break;
case st_system:
def->system = 1;
// fall through
case st_global: case st_global:
def->global = 1; def->global = 1;
def->external = 0; def->external = 0;
@ -240,6 +243,7 @@ get_def (type_t *type, const char *name, scope_t *scope,
case st_none: case st_none:
case st_global: case st_global:
case st_local: case st_local:
case st_system:
space = scope->space; space = scope->space;
break; break;
case st_extern: case st_extern:

View file

@ -134,6 +134,8 @@ flags (def_t *d)
flags |= QFOD_EXTERNAL; flags |= QFOD_EXTERNAL;
if (d->local) if (d->local)
flags |= QFOD_LOCAL; flags |= QFOD_LOCAL;
if (d->system)
flags |= QFOD_SYSTEM;
return flags; return flags;
} }
@ -538,6 +540,7 @@ qfo_to_progs (qfo_t *qfo, pr_info_t *pr)
pd->global = (qd->flags & QFOD_GLOBAL) != 0; pd->global = (qd->flags & QFOD_GLOBAL) != 0;
pd->external = (qd->flags & QFOD_EXTERNAL) != 0; pd->external = (qd->flags & QFOD_EXTERNAL) != 0;
pd->local = (qd->flags & QFOD_LOCAL) != 0; pd->local = (qd->flags & QFOD_LOCAL) != 0;
pd->system = (qd->flags & QFOD_SYSTEM) != 0;
pd->file = qd->file; pd->file = qd->file;
pd->line = qd->line; pd->line = qd->line;
} }

View file

@ -301,6 +301,7 @@ static keyword_t keywords[] = {
{"@argv", ARGV, 0, 0, PROG_VERSION}, {"@argv", ARGV, 0, 0, PROG_VERSION},
{"@extern", EXTERN, 0, 1, PROG_ID_VERSION}, {"@extern", EXTERN, 0, 1, PROG_ID_VERSION},
{"@static", STATIC, 0, 1, PROG_ID_VERSION}, {"@static", STATIC, 0, 1, PROG_ID_VERSION},
{"@system", SYSTEM, 0, 1, PROG_ID_VERSION},
{"@sizeof", SIZEOF, 0, 0, PROG_VERSION}, {"@sizeof", SIZEOF, 0, 0, PROG_VERSION},
}; };

View file

@ -128,7 +128,7 @@ void free_local_inits (hashtab_t *def_list);
%token LOCAL RETURN WHILE DO IF ELSE FOR BREAK CONTINUE ELLIPSIS NIL %token LOCAL RETURN WHILE DO IF ELSE FOR BREAK CONTINUE ELLIPSIS NIL
%token IFBE IFB IFAE IFA %token IFBE IFB IFAE IFA
%token SWITCH CASE DEFAULT STRUCT UNION ENUM TYPEDEF SUPER SELF THIS %token SWITCH CASE DEFAULT STRUCT UNION ENUM TYPEDEF SUPER SELF THIS
%token ARGC ARGV EXTERN STATIC SIZEOF %token ARGC ARGV EXTERN STATIC SYSTEM SIZEOF
%token ELE_START %token ELE_START
%token <type> TYPE %token <type> TYPE
%token CLASS DEFS ENCODE END IMPLEMENTATION INTERFACE PRIVATE PROTECTED %token CLASS DEFS ENCODE END IMPLEMENTATION INTERFACE PRIVATE PROTECTED
@ -223,6 +223,7 @@ simple_def
storage_class storage_class
: EXTERN { current_storage = st_extern; } : EXTERN { current_storage = st_extern; }
| STATIC { current_storage = st_static; } | STATIC { current_storage = st_static; }
| SYSTEM { current_storage = st_system; }
; ;
struct_defs struct_defs