cleanup and doxify files in include/express
This commit is contained in:
+14
-35
@@ -1,10 +1,8 @@
|
||||
#ifndef ALGORITHM_H
|
||||
#define ALGORITHM_H
|
||||
|
||||
/* $Id: alg.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Algorithm
|
||||
/** **********************************************************************
|
||||
** Module: Algorithm \file alg.h
|
||||
** Description: This module implements the Algorithm abstraction. An
|
||||
** algorithm can be a procedure, a function, or a rule. It consists
|
||||
** of a name, a return type (for functions and rules), a list of
|
||||
@@ -69,50 +67,47 @@ typedef struct Where_ * Where;
|
||||
/* hidden type definitions */
|
||||
/***************************/
|
||||
|
||||
/* each formal tag has one of these structs allocated to it */
|
||||
/* As each (real) call is resolved, the tag->type is temporarily borrowed */
|
||||
/** each formal tag has one of these structs allocated to it
|
||||
* As each (real) call is resolved, the tag->type is temporarily borrowed
|
||||
*/
|
||||
struct tag {
|
||||
char * name;
|
||||
Type type;
|
||||
};
|
||||
|
||||
/* location of fulltext of algorithm in source file */
|
||||
/** location of fulltext of algorithm in source file */
|
||||
struct FullText {
|
||||
char * filename;
|
||||
unsigned int start, end;
|
||||
};
|
||||
|
||||
/* 'parameters' are lists of lists of (type) expressions */
|
||||
/** 'parameters' are lists of lists of (type) expressions */
|
||||
struct Procedure_ {
|
||||
int pcount; /* # of parameters */
|
||||
int tag_count; /* # of different parameter tags */
|
||||
int pcount; /**< # of parameters */
|
||||
int tag_count; /**< # of different parameter tags */
|
||||
Linked_List parameters;
|
||||
Linked_List body;
|
||||
struct FullText text;
|
||||
int builtin; /* builtin if true */
|
||||
int builtin; /**< builtin if true */
|
||||
};
|
||||
|
||||
struct Function_ {
|
||||
int pcount; /* # of parameters */
|
||||
int tag_count; /* # of different parameter/return value tags */
|
||||
int pcount; /**< # of parameters */
|
||||
int tag_count; /**< # of different parameter/return value tags */
|
||||
Linked_List parameters;
|
||||
Linked_List body;
|
||||
Type return_type;
|
||||
struct FullText text;
|
||||
int builtin; /* builtin if true */
|
||||
int builtin; /**< builtin if true */
|
||||
};
|
||||
|
||||
struct Rule_ {
|
||||
Linked_List parameters;
|
||||
Linked_List body;
|
||||
struct FullText text;
|
||||
/*
|
||||
Linked_List where;
|
||||
moved to Scope - DEL 22-Jul-1993
|
||||
*/
|
||||
};
|
||||
|
||||
/* define a where clause */
|
||||
/** define a where clause */
|
||||
struct Where_ {
|
||||
Symbol * label;
|
||||
Expression expr;
|
||||
@@ -175,19 +170,9 @@ GLOBAL SCL_EXPRESS_EXPORT struct freelist_head WHERE_fl;
|
||||
#define FUNCget_return_type(f) ((f)->u.func->return_type)
|
||||
#define RULEget_where(r) ((r)->where)
|
||||
#define RULEput_where(r,w) ((r)->where = (w))
|
||||
/*
|
||||
#define RULEget_where_clause(r) ((r)->u.rule->where)
|
||||
*/
|
||||
#define WHEREget_label(w) ((w)->label)
|
||||
#define WHEREget_expression(w) ((w)->expr)
|
||||
|
||||
#if 0
|
||||
extern void ALGput_parameters PROTO( ( Algorithm, Linked_List ) );
|
||||
extern void ALGput_body PROTO( ( Algorithm, Linked_List ) );
|
||||
extern void FUNCput_return_type PROTO( ( Algorithm, Type ) );
|
||||
extern void RULEput_where_clause PROTO( ( Algorithm, Linked_List ) );
|
||||
#endif
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
@@ -196,11 +181,5 @@ extern SCL_EXPRESS_EXPORT Scope ALGcreate PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT void ALGinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ALGput_full_text PROTO( ( Scope, int, int ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(ALGORITHM_C)
|
||||
#endif /* supports_inline_functions || defined(ALGORITHM_C) */
|
||||
|
||||
#endif /* ALGORITHM_H */
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef BASIC_H
|
||||
#define BASIC_H
|
||||
|
||||
/* $Id: basic.h,v 1.8 1997/10/22 16:06:28 sauderd Exp $ */
|
||||
|
||||
/*
|
||||
* This work was supported by the United States Government, and is
|
||||
@@ -146,12 +145,6 @@ typedef int ( *intFuncptr )();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* pacify IBM's c89 */
|
||||
#if !defined(_POSIX_SOURCE)
|
||||
#define _POSIX_SOURCE
|
||||
#endif
|
||||
|
||||
#endif /* */
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#ifndef CASE_ITEM_H
|
||||
#define CASE_ITEM_H
|
||||
|
||||
/* $Id: caseitem.h,v 1.3 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Case_Item
|
||||
/** **********************************************************************
|
||||
** Module: Case_Item \file caseitem.h
|
||||
** Description: This module implements the Case_Item abstraction. A
|
||||
** case item represents a single branch in a case statement; it
|
||||
** thus consists of a list of labels and a statement to execute
|
||||
@@ -99,11 +97,4 @@ GLOBAL SCL_EXPRESS_EXPORT struct freelist_head CASE_IT_fl;
|
||||
extern SCL_EXPRESS_EXPORT Case_Item CASE_ITcreate PROTO( ( Linked_List, struct Statement_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT void CASE_ITinitialize PROTO( ( void ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(CASE_ITEM_C)
|
||||
#endif /* supports_inline_functions || defined(CASE_ITEM_C) */
|
||||
|
||||
#endif /*CASE_ITEM_H*/
|
||||
|
||||
+5
-15
@@ -1,10 +1,8 @@
|
||||
#ifndef DICTIONARY_H
|
||||
#define DICTIONARY_H
|
||||
|
||||
/* $Id: dict.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Dictionary
|
||||
/** **********************************************************************
|
||||
** Module: Dictionary \file dict.h
|
||||
** Description: This module implements the dictionary abstraction. A
|
||||
** dictionary is a repository for a number of objects, all of which
|
||||
** can be named using the same function. A dictionary is limited to
|
||||
@@ -80,8 +78,7 @@ typedef HashEntry DictionaryEntry;
|
||||
#include "decstart.h"
|
||||
#endif /*DICTIONARY_C*/
|
||||
|
||||
GLOBAL SCL_EXPRESS_EXPORT char DICT_type; /* set as a side-effect of DICT lookup routines */
|
||||
/* to type of object found */
|
||||
GLOBAL SCL_EXPRESS_EXPORT char DICT_type; /**< set as a side-effect of DICT lookup routines to type of object found */
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -90,12 +87,12 @@ GLOBAL SCL_EXPRESS_EXPORT char DICT_type; /* set as a side-effect of DICT looku
|
||||
/*******************************/
|
||||
|
||||
#define DICTcreate(estimated_max_size) HASHcreate(estimated_max_size)
|
||||
/* should really can DICTdo_init and rename do_type_init to do_init! */
|
||||
/** should really can DICTdo_init and rename do_type_init to do_init! */
|
||||
#define DICTdo_init(dict,de) HASHlistinit((dict),(de))
|
||||
#define DICTdo_type_init(dict,de,t) HASHlistinit_by_type((dict),(de),(t))
|
||||
#define DICTdo_end(hash_entry) HASHlistend(hash_entry)
|
||||
|
||||
/* modify dictionary entry in-place */
|
||||
/** modify dictionary entry in-place */
|
||||
#define DICTchange(e,obj,sym,typ) { \
|
||||
(e)->data = (obj); \
|
||||
(e)->symbol = (sym); \
|
||||
@@ -117,11 +114,4 @@ extern SCL_EXPRESS_EXPORT Generic DICTlookup_symbol PROTO( ( Dictionary, ch
|
||||
extern SCL_EXPRESS_EXPORT Generic DICTdo PROTO( ( DictionaryEntry * ) );
|
||||
extern SCL_EXPRESS_EXPORT void DICTprint PROTO( ( Dictionary ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(DICTIONARY_C)
|
||||
#endif /*supports_inline_functions || defined(DICTIONARY_C)*/
|
||||
|
||||
#endif /*DICTIONARY_H*/
|
||||
|
||||
+14
-44
@@ -1,10 +1,8 @@
|
||||
#ifndef ENTITY_H
|
||||
#define ENTITY_H
|
||||
|
||||
/* $Id: entity.h,v 1.12 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Entity
|
||||
/** **********************************************************************
|
||||
** Module: Entity \file entity.h
|
||||
** Description: This module represents Express entity definitions. An
|
||||
** entity definition consists of a name, a list of attributes, a
|
||||
** collection of uniqueness sets, a specification of the entity's
|
||||
@@ -86,25 +84,18 @@ typedef struct Scope_ * Entity;
|
||||
/***************************/
|
||||
|
||||
struct Entity_ {
|
||||
Linked_List supertype_symbols; /* linked list of original symbols*/
|
||||
/* as generated by parser */
|
||||
Linked_List supertypes; /* linked list of supertypes (as entities) */
|
||||
Linked_List subtypes; /* simple list of subtypes */
|
||||
/* useful for simple lookups */
|
||||
Expression subtype_expression; /* DAG of subtypes, with complete */
|
||||
/* information including, OR, AND, and ONEOF */
|
||||
Linked_List attributes; /* explicit attributes */
|
||||
int inheritance; /* total number of attributes */
|
||||
/* inherited from supertypes */
|
||||
int attribute_count;
|
||||
Linked_List unique; /* list of identifiers that are unique */
|
||||
Linked_List instances; /* hook for applications */
|
||||
int mark; /* usual hack - prevent traversing sub/super */
|
||||
/* graph twice */
|
||||
bool abstract;/* is this an abstract supertype? */
|
||||
Type type; /* type pointing back to ourself */
|
||||
/* Useful to have when evaluating */
|
||||
/* expressions involving entities */
|
||||
Linked_List supertype_symbols; /**< linked list of original symbols as generated by parser */
|
||||
Linked_List supertypes; /**< linked list of supertypes (as entities) */
|
||||
Linked_List subtypes; /**< simple list of subtypes useful for simple lookups */
|
||||
Expression subtype_expression; /**< DAG of subtypes, with complete information including, OR, AND, and ONEOF */
|
||||
Linked_List attributes; /**< explicit attributes */
|
||||
int inheritance; /**< total number of attributes inherited from supertypes */
|
||||
int attribute_count;
|
||||
Linked_List unique; /**< list of identifiers that are unique */
|
||||
Linked_List instances; /**< hook for applications */
|
||||
int mark; /**< usual hack - prevent traversing sub/super graph twice */
|
||||
bool abstract; /**< is this an abstract supertype? */
|
||||
Type type; /**< type pointing back to ourself, useful to have when evaluating expressions involving entities */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -173,25 +164,4 @@ extern SCL_EXPRESS_EXPORT void ENTITYadd_instance PROTO( ( Entity, Generic )
|
||||
extern SCL_EXPRESS_EXPORT int ENTITYget_initial_offset PROTO( ( Entity ) );
|
||||
extern SCL_EXPRESS_EXPORT bool ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
|
||||
|
||||
#if 0
|
||||
extern void ENTITYdelete_instance PROTO( ( Entity, Generic ) );
|
||||
extern bool ENTITYhas_subtype PROTO( ( Entity, Entity ) );
|
||||
extern Entity ENTITYget_supertype PROTO( ( Entity, String ) );
|
||||
extern Entity ENTITYget_subtype PROTO( ( Entity, String ) );
|
||||
extern bool ENTITYhas_immediate_subtype PROTO( ( Entity, Entity ) );
|
||||
extern Expression ENTITYget_subtype_expression PROTO( ( Entity ) );
|
||||
extern int ENTITYget_attribute_offset PROTO( ( Entity, Variable ) );
|
||||
extern int ENTITYget_named_attribute_offset PROTO( ( Entity, String ) );
|
||||
extern Linked_List ENTITYget_uniqueness_list PROTO( ( Entity ) );
|
||||
extern Linked_List ENTITYget_constraints PROTO( ( Entity ) );
|
||||
extern Linked_List ENTITYget_instances PROTO( ( Entity ) );
|
||||
#endif /*0*/
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(ENTITY_C)
|
||||
#endif /* supports_inline_functions || defined(ENTITY_C) */
|
||||
|
||||
#endif /* ENTITY_H */
|
||||
|
||||
+29
-33
@@ -1,4 +1,3 @@
|
||||
/* $Id: expbasic.h,v 1.7 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/*
|
||||
* This software was developed by U.S. Government employees as part of
|
||||
@@ -72,84 +71,81 @@ typedef char * Binary;
|
||||
#define UNRESOLVED 0x0
|
||||
#define RESOLVED 0x1
|
||||
#define RESOLVE_FAILED 0x2
|
||||
#define RESOLVE_IN_PROGRESS 0x4 /* only if actively being resolved */
|
||||
/* not if it's just between passes */
|
||||
#define RESOLVE_IN_PROGRESS 0x4 /**< only if actively being resolved not if it's just between passes */
|
||||
|
||||
/* used during rename resolution to catch recursive USE/REFs */
|
||||
/** used during rename resolution to catch recursive USE/REFs */
|
||||
#define is_resolve_in_progress_raw(x) ((x)->resolved & RESOLVE_IN_PROGRESS)
|
||||
#define resolve_in_progress_raw(x) (x)->resolved |= RESOLVE_IN_PROGRESS
|
||||
#define resolve_not_in_progress_raw(x) (x)->resolved &= ~RESOLVE_IN_PROGRESS
|
||||
|
||||
/* and type resolution to catch recursive types (A = B and B = A) */
|
||||
/** and type resolution to catch recursive types (A = B and B = A) */
|
||||
#define resolve_in_progress(x) (x)->symbol.resolved |= RESOLVE_IN_PROGRESS
|
||||
|
||||
/* test/set whether anything has failed resolution */
|
||||
/** test/set whether anything has failed resolution */
|
||||
#define is_resolve_failed(x) ((x)->symbol.resolved & RESOLVE_FAILED)
|
||||
#define is_resolve_failed_raw(x) ((x)->resolved & RESOLVE_FAILED)
|
||||
#define resolve_failed(x) (x)->symbol.resolved |= RESOLVE_FAILED
|
||||
#define resolve_failed_raw(x) (x)->resolved |= RESOLVE_FAILED
|
||||
|
||||
/* test/set whether anything has succeeded resolution */
|
||||
/** test/set whether anything has succeeded resolution */
|
||||
#define is_resolved(x) ((x)->symbol.resolved & RESOLVED)
|
||||
|
||||
/* test possibility of future resolution */
|
||||
/** test possibility of future resolution */
|
||||
#define is_resolvable(x) (!is_not_resolvable(x))
|
||||
#define is_not_resolvable(x) ((x)->symbol.resolved & (RESOLVE_FAILED|RESOLVED|RESOLVE_IN_PROGRESS))
|
||||
|
||||
/* mark something resolved */
|
||||
/** mark something resolved */
|
||||
#define resolved_all(x) x->symbol.resolved = RESOLVED
|
||||
|
||||
|
||||
/* define the object types that can appear in a symbol table */
|
||||
/* basically anything that is usefully named, but that cannot be */
|
||||
/* differentiated from another type when handed a generic pointer */
|
||||
/* Entity, schema and alg can be differentiated but it is just very */
|
||||
/* useful to be able to differentiate this way. */
|
||||
#define OBJ_ANY '*' /* Matches anything - special to DICT funcs */
|
||||
#define OBJ_EXPRESS '!' /* I can't figure out the mnemonic either! */
|
||||
/** define the object types that can appear in a symbol table
|
||||
* basically anything that is usefully named, but that cannot be
|
||||
* differentiated from another type when handed a generic pointer
|
||||
* Entity, schema and alg can be differentiated but it is just very
|
||||
* useful to be able to differentiate this way. */
|
||||
#define OBJ_ANY '*' /**< Matches anything - special to DICT funcs */
|
||||
#define OBJ_EXPRESS '!' /**< I can't figure out the mnemonic either! */
|
||||
#define OBJ_PASS '#'
|
||||
|
||||
/* The following are all odd-ball scopes, that aren't ever looked up by */
|
||||
/* type - but the data structures might as well be descriptive */
|
||||
/** The following are all odd-ball scopes, that aren't ever looked up by
|
||||
* type - but the data structures might as well be descriptive */
|
||||
#define OBJ_INCREMENT '+'
|
||||
#define OBJ_ALIAS 'a'
|
||||
#define OBJ_QUERY 'q' /* isn't even stored anywhere! */
|
||||
#define OBJ_QUERY 'q' /**< isn't even stored anywhere! */
|
||||
|
||||
#define OBJ_PROCEDURE 'p'
|
||||
#define OBJ_RENAME 'n'
|
||||
#define OBJ_RULE 'r'
|
||||
#define OBJ_FUNCTION 'f'
|
||||
#define OBJ_TAG 'g' /* a type, but only when used as a type tag */
|
||||
#define OBJ_TAG 'g' /**< a type, but only when used as a type tag */
|
||||
#define OBJ_ENTITY 'e'
|
||||
#define OBJ_SCHEMA 's'
|
||||
#define OBJ_TYPE 't'
|
||||
#define OBJ_UNKNOWN 'u' /*things that won't ever be looked up by type*/
|
||||
#define OBJ_UNKNOWN 'u' /**< things that won't ever be looked up by type*/
|
||||
#define OBJ_VARIABLE 'v'
|
||||
#define OBJ_WHERE 'w'
|
||||
#define OBJ_EXPRESSION 'x' /* so far only enums get looked up by name & */
|
||||
#define OBJ_ENUM 'x' /* appear this way, perhaps they should be */
|
||||
/* variables? */
|
||||
#define OBJ_AMBIG_ENUM 'z' /* enumerations of the same name which are */
|
||||
/* visible in the same scope when qualified */
|
||||
/* z is of no mnemonic significance (so far) */
|
||||
#define OBJ_EXPRESSION 'x' /**< so far only enums get looked up by name & */
|
||||
#define OBJ_ENUM 'x' /**< appear this way, perhaps they should be variables? */
|
||||
#define OBJ_AMBIG_ENUM 'z' /**< enumerations of the same name which are
|
||||
* visible in the same scope when qualified
|
||||
* z is of no mnemonic significance (so far) */
|
||||
#define IS_ENUM(x) (((x) == OBJ_ENUM) || ((x) == OBJ_AMBIG_ENUM))
|
||||
|
||||
/* these represent a different way of selecting classes of objects */
|
||||
/* these are particularly useful when looking for multiple types concurrently */
|
||||
/** these represent a different way of selecting classes of objects
|
||||
* these are particularly useful when looking for multiple types concurrently */
|
||||
#define OBJ_TYPE_BITS 0x1
|
||||
#define OBJ_ENTITY_BITS 0x2
|
||||
#define OBJ_FUNCTION_BITS 0x4
|
||||
#define OBJ_PROCEDURE_BITS 0x8
|
||||
#define OBJ_PASS_BITS 0x10 /* i.e., EXPRESSpass */
|
||||
#define OBJ_PASS_BITS 0x10 /**< i.e., EXPRESSpass */
|
||||
#define OBJ_RULE_BITS 0x20
|
||||
#define OBJ_EXPRESSION_BITS 0x40 /* as above, only used for */
|
||||
/* finding enums */
|
||||
#define OBJ_EXPRESSION_BITS 0x40 /**< as above, only used for finding enums */
|
||||
#define OBJ_SCHEMA_BITS 0x80
|
||||
#define OBJ_VARIABLE_BITS 0x100
|
||||
#define OBJ_WHERE_BITS 0x200
|
||||
|
||||
#define OBJ_ANYTHING_BITS 0x0fffffff
|
||||
#define OBJ_UNFINDABLE_BITS 0x10000000 /* should never be found */
|
||||
#define OBJ_UNFINDABLE_BITS 0x10000000 /**< should never be found */
|
||||
#define OBJ_ALGORITHM_BITS (OBJ_FUNCTION_BITS | OBJ_PROCEDURE_BITS | \
|
||||
OBJ_RULE_BITS)
|
||||
#define OBJ_SCOPE_BITS (OBJ_ALGORITHM_BITS | OBJ_ENTITY_BITS | \
|
||||
|
||||
+25
-33
@@ -1,10 +1,8 @@
|
||||
#ifndef EXPRESSION_H
|
||||
#define EXPRESSION_H
|
||||
|
||||
/* $Id: expr.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Expression
|
||||
/** **********************************************************************
|
||||
** Module: Expression \file expr.h
|
||||
** Description: This module implements the Expression abstraction.
|
||||
** Several types of expressions are supported: identifiers,
|
||||
** literals, operations (arithmetic, logical, array indexing,
|
||||
@@ -86,7 +84,7 @@ typedef enum {
|
||||
OP_NOT, OP_NOT_EQUAL, OP_OR,
|
||||
OP_PLUS, OP_REAL_DIV, OP_SUBCOMPONENT,
|
||||
OP_TIMES, OP_XOR, OP_UNKNOWN,
|
||||
OP_LAST /* must be last - used only to size tables */
|
||||
OP_LAST /**< must be last - used only to size tables */
|
||||
} Op_Code;
|
||||
|
||||
typedef struct Qualified_Attr Qualified_Attr;
|
||||
@@ -118,7 +116,7 @@ typedef Literal Aggregate_Literal, Integer_Literal,
|
||||
/* expression types */
|
||||
|
||||
struct Qualified_Attr {
|
||||
struct Expression_ * complex; /* complex entity instance */
|
||||
struct Expression_ * complex; /**< complex entity instance */
|
||||
Symbol * entity;
|
||||
Symbol * attribute;
|
||||
};
|
||||
@@ -132,22 +130,20 @@ struct Op_Subexpression {
|
||||
|
||||
struct Query_ {
|
||||
Variable local;
|
||||
Expression aggregate; /* set from which to test */
|
||||
Expression expression; /* logical expression */
|
||||
Expression aggregate; /**< set from which to test */
|
||||
Expression expression; /**< logical expression */
|
||||
struct Scope_ * scope;
|
||||
};
|
||||
|
||||
struct Funcall {
|
||||
struct Scope_ * function; /* can also be an entity because entities */
|
||||
/* can be called as functions */
|
||||
struct Scope_ * function; /**< can also be an entity because entities can be called as functions */
|
||||
Linked_List list;
|
||||
};
|
||||
|
||||
union expr_union {
|
||||
int integer;
|
||||
float real;
|
||||
/* char *string; find string name in symbol in Expression */
|
||||
char * attribute; /* inverse .... for 'attr' */
|
||||
char * attribute; /**< inverse .... for 'attr' */
|
||||
char * binary;
|
||||
int logical;
|
||||
bool boolean;
|
||||
@@ -157,35 +153,31 @@ union expr_union {
|
||||
/* if etype == aggregate, list of expressions */
|
||||
/* if etype == funcall, 1st element of list is funcall or entity */
|
||||
/* remaining elements are parameters */
|
||||
Linked_List list; /* aggregates (bags, lists, sets, arrays) */
|
||||
/* or lists for oneof expressions */
|
||||
Expression expression; /* derived value in derive attrs, or*/
|
||||
/* initializer in local vars, or */
|
||||
/* enumeration tags */
|
||||
/* or oneof value */
|
||||
struct Scope_ * entity; /* used by subtype exp, group expr */
|
||||
/* and self expr, some funcall's and any */
|
||||
/* expr that results in an entity */
|
||||
Variable variable; /* attribute reference */
|
||||
Linked_List list; /**< aggregates (bags, lists, sets, arrays) or lists for oneof expressions */
|
||||
Expression expression; /**< derived value in derive attrs, or
|
||||
* initializer in local vars, or
|
||||
* enumeration tags
|
||||
* or oneof value */
|
||||
struct Scope_ * entity; /**< used by subtype exp, group expr
|
||||
* and self expr, some funcall's and any
|
||||
* expr that results in an entity */
|
||||
Variable variable; /**< attribute reference */
|
||||
};
|
||||
|
||||
/** The difference between 'type' and 'return_type' is illustrated
|
||||
* by "func(a)". Here, 'type' is Type_Function while 'return_type'
|
||||
* might be Type_Integer (assuming func returns an integer). */
|
||||
struct Expression_ {
|
||||
Symbol symbol; /* contains things like funcall names */
|
||||
/* string names, binary values, */
|
||||
/* enumeration names */
|
||||
Symbol symbol; /**< contains things like funcall names, string names, binary values, enumeration names */
|
||||
Type type;
|
||||
Type return_type; /* type of value returned by expression */
|
||||
/* The difference between 'type' and 'return_type' is */
|
||||
/* illustrated by "func(a)". Here, 'type' is Type_Function */
|
||||
/* while 'return_type' might be Type_Integer (assuming func */
|
||||
/* returns an integer). */
|
||||
Type return_type; /**< type of value returned by expression */
|
||||
struct Op_Subexpression e;
|
||||
union expr_union u;
|
||||
};
|
||||
|
||||
/* indexed by the op enumeration values */
|
||||
/** indexed by the op enumeration values */
|
||||
struct EXPop_entry {
|
||||
char * token; /* literal token, e.g., "<>" */
|
||||
char * token; /**< literal token, e.g., "<>" */
|
||||
Type( *resolve ) PROTO( ( Expression, struct Scope_ * ) );
|
||||
};
|
||||
|
||||
@@ -245,7 +237,7 @@ GLOBAL SCL_EXPRESS_EXPORT struct freelist_head QUAL_ATTR_fl;
|
||||
#define FCALLget_parameters(e) ((e)->u.funcall.list)
|
||||
#define FCALLput_function(expr,func) ((e)->u.funcall.function = (func))
|
||||
#define FCALLget_function(e) ((e)->u.funcall.function)
|
||||
/* assumes the function is not an entity-function! */
|
||||
/** assumes the function is not an entity-function! */
|
||||
#define FCALLget_algorithm(e) ((e)->u.funcall.function->u.function->body)
|
||||
|
||||
#define INT_LITget_value(e) ((e)->u.integer)
|
||||
|
||||
+34
-47
@@ -1,8 +1,6 @@
|
||||
#ifndef EXPRESS_H
|
||||
#define EXPRESS_H
|
||||
|
||||
/* $Id: express.h,v 1.13 1997/01/21 19:16:42 dar Exp $ */
|
||||
|
||||
/*
|
||||
* Express package manager.
|
||||
*
|
||||
@@ -83,7 +81,7 @@ typedef struct Scope_ * Express;
|
||||
struct Express_ {
|
||||
FILE * file;
|
||||
char * filename;
|
||||
char * basename; /* name of file but without directory or .exp suffix */
|
||||
char * basename; /**< name of file but without directory or .exp suffix */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -114,11 +112,11 @@ GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSfail ) PROTO( ( Express ) ) INITIALL
|
||||
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSsucceed ) PROTO( ( Express ) ) INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSbackend ) PROTO( ( Express ) ) INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * EXPRESSprogram_name;
|
||||
extern char EXPRESSgetopt_options[256]; /* initialized elsewhere */
|
||||
extern char EXPRESSgetopt_options[256]; /**< initialized elsewhere */
|
||||
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSgetopt ) PROTO( ( int, char * ) ) INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT bool EXPRESSignore_duplicate_schemas INITIALLY( false );
|
||||
|
||||
GLOBAL SCL_EXPRESS_EXPORT Dictionary EXPRESSbuiltins; /* procedures/functions */
|
||||
GLOBAL SCL_EXPRESS_EXPORT Dictionary EXPRESSbuiltins; /**< procedures/functions */
|
||||
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bail_out INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_syntax INITIALLY( ERROR_none );
|
||||
@@ -130,42 +128,42 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_warn_unsupported_lang_feat;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_NVL;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_USEDIN;
|
||||
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ABS INITIALLY( "ABS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ABS INITIALLY( "ABS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ABSTRACT INITIALLY( "ABSTRACT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ACOS INITIALLY( "ACOS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_AGGREGATE INITIALLY( "AGGREGATE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ALIAS INITIALLY( "ALIAS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_AND INITIALLY( "AND" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_AND INITIALLY( "AND" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ANDOR INITIALLY( "ANDOR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ARRAY INITIALLY( "ARRAY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_AS INITIALLY( "AS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_AS INITIALLY( "AS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ASIN INITIALLY( "ASIN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ATAN INITIALLY( "ATAN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BAG INITIALLY( "BAG" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BAG INITIALLY( "BAG" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BEGIN INITIALLY( "BEGIN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BINARY INITIALLY( "BINARY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BLENGTH INITIALLY( "BLENGTH" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BOOLEAN INITIALLY( "BOOLEAN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BY INITIALLY( "BY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BY INITIALLY( "BY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_CASE INITIALLY( "CASE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONST_E INITIALLY( "CONST_E" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONSTANT INITIALLY( "CONSTANT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONTEXT INITIALLY( "CONTEXT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_COS INITIALLY( "COS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_COS INITIALLY( "COS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_DERIVE INITIALLY( "DERIVE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_DIV INITIALLY( "DIV" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_DIV INITIALLY( "DIV" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ELSE INITIALLY( "ELSE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END INITIALLY( "END" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END INITIALLY( "END" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_ALIAS INITIALLY( "END_ALIAS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CASE INITIALLY( "END_CASE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CONSTANT INITIALLY( "END_CONSTANT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CONSTANT INITIALLY( "END_CONSTANT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CONTEXT INITIALLY( "END_CONTEXT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_ENTITY INITIALLY( "END_ENTITY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_FUNCTION INITIALLY( "END_FUNCTION" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_FUNCTION INITIALLY( "END_FUNCTION" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_IF INITIALLY( "END_IF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_LOCAL INITIALLY( "END_LOCAL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_MODEL INITIALLY( "END_MODEL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_PROCEDURE INITIALLY( "END_PROCEDURE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_PROCEDURE INITIALLY( "END_PROCEDURE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_REPEAT INITIALLY( "END_REPEAT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_RULE INITIALLY( "END_RULE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_SCHEMA INITIALLY( "END_SCHEMA" );
|
||||
@@ -174,18 +172,18 @@ GLOBAL SCL_EXPRESS_EXPORT char * KW_ENTITY INITIALLY( "ENTITY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ENUMERATION INITIALLY( "ENUMERATION" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ESCAPE INITIALLY( "ESCAPE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_EXISTS INITIALLY( "EXISTS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_EXP INITIALLY( "EXP" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_EXP INITIALLY( "EXP" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FALSE INITIALLY( "FALSE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FIXED INITIALLY( "FIXED" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FOR INITIALLY( "FOR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FOR INITIALLY( "FOR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FORMAT INITIALLY( "FORMAT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FROM INITIALLY( "FROM" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FUNCTION INITIALLY( "FUNCTION" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_GENERIC INITIALLY( "GENERIC" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_HIBOUND INITIALLY( "HIBOUND" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_HIINDEX INITIALLY( "HIINDEX" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_IF INITIALLY( "IF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_IN INITIALLY( "IN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_IF INITIALLY( "IF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_IN INITIALLY( "IN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_INCLUDE INITIALLY( "INCLUDE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_INSERT INITIALLY( "INSERT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_INTEGER INITIALLY( "INTEGER" );
|
||||
@@ -195,23 +193,23 @@ GLOBAL SCL_EXPRESS_EXPORT char * KW_LIKE INITIALLY( "LIKE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LIST INITIALLY( "LIST" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOBOUND INITIALLY( "LOBOUND" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOCAL INITIALLY( "LOCAL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG INITIALLY( "LOG" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG INITIALLY( "LOG" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG10 INITIALLY( "LOG10" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG2 INITIALLY( "LOG2" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOGICAL INITIALLY( "LOGICAL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOINDEX INITIALLY( "LOINDEX" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_MOD INITIALLY( "MOD" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_MOD INITIALLY( "MOD" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_MODEL INITIALLY( "MODEL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_NOT INITIALLY( "NOT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_NOT INITIALLY( "NOT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_NUMBER INITIALLY( "NUMBER" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_NVL INITIALLY( "NVL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ODD INITIALLY( "ODD" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OF INITIALLY( "OF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_NVL INITIALLY( "NVL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ODD INITIALLY( "ODD" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OF INITIALLY( "OF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ONEOF INITIALLY( "ONEOF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OPTIONAL INITIALLY( "OPTIONAL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OR INITIALLY( "OR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OR INITIALLY( "OR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OTHERWISE INITIALLY( "OTHERWISE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_PI INITIALLY( "PI" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_PI INITIALLY( "PI" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_PROCEDURE INITIALLY( "PROCEDURE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_QUERY INITIALLY( "QUERY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_REAL INITIALLY( "REAL" );
|
||||
@@ -224,32 +222,32 @@ GLOBAL SCL_EXPRESS_EXPORT char * KW_RULE INITIALLY( "RULE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SCHEMA INITIALLY( "SCHEMA" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SELECT INITIALLY( "SELECT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SELF INITIALLY( "SELF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SET INITIALLY( "SET" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SIN INITIALLY( "SIN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SET INITIALLY( "SET" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SIN INITIALLY( "SIN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SIZEOF INITIALLY( "SIZEOF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SKIP INITIALLY( "SKIP" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SQRT INITIALLY( "SQRT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_STRING INITIALLY( "STRING" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SUBTYPE INITIALLY( "SUBTYPE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SUPERTYPE INITIALLY( "SUPERTYPE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TAN INITIALLY( "TAN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TAN INITIALLY( "TAN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_THEN INITIALLY( "THEN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TO INITIALLY( "TO" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TO INITIALLY( "TO" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TRUE INITIALLY( "TRUE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TYPE INITIALLY( "TYPE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TYPEOF INITIALLY( "TYPEOF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNIQUE INITIALLY( "UNIQUE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNKNOWN INITIALLY( "UNKNOWN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNTIL INITIALLY( "UNTIL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_USE INITIALLY( "USE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_USE INITIALLY( "USE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_USEDIN INITIALLY( "USEDIN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE INITIALLY( "VALUE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE_IN INITIALLY( "VALUE_IN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE_UNIQUE INITIALLY( "VALUE_UNIQUE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VAR INITIALLY( "VAR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE_UNIQUE INITIALLY( "VALUE_UNIQUE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VAR INITIALLY( "VAR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_WHERE INITIALLY( "WHERE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_WHILE INITIALLY( "WHILE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_XOR INITIALLY( "XOR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_XOR INITIALLY( "XOR" );
|
||||
|
||||
#undef GLOBAL
|
||||
#undef INITIALLY
|
||||
@@ -263,14 +261,6 @@ GLOBAL SCL_EXPRESS_EXPORT char * KW_XOR INITIALLY( "XOR" );
|
||||
#define EXPRESSput_basename(e,n) ((e)->u.express->basename = (n))
|
||||
#define EXPRESSput_filename(e,n) ((e)->u.express->filename = (n))
|
||||
|
||||
/********************/
|
||||
/* Inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(EXPRESS_C)
|
||||
|
||||
#endif /*supports_inline_functions || defined(EXPRESS_C)*/
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
@@ -283,9 +273,6 @@ extern SCL_EXPRESS_EXPORT char * EXPRESSversion PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int EXPRESS_fail PROTO( ( Express ) );
|
||||
extern SCL_EXPRESS_EXPORT int EXPRESS_succeed PROTO( ( Express ) );
|
||||
extern void EXPRESSinit_init PROTO( ( void ) );
|
||||
#if 0
|
||||
extern void EXPRESSdump_model PROTO( ( Express ) );
|
||||
#endif /*0*/
|
||||
extern SCL_EXPRESS_EXPORT void build_complex( Express );
|
||||
|
||||
#endif /*EXPRESS_H*/
|
||||
|
||||
+21
-28
@@ -1,9 +1,8 @@
|
||||
#ifndef HASH_H
|
||||
#define HASH_H
|
||||
|
||||
/* $Id: hash.h,v 1.6 1997/10/22 16:36:49 sauderd Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
/** **********************************************************************
|
||||
* \file hash.h
|
||||
** Hash_Table: Hash_Table
|
||||
** Description:
|
||||
**
|
||||
@@ -90,9 +89,9 @@
|
||||
#define HASH_NULL (Hash_Table)NULL
|
||||
|
||||
#define SEGMENT_SIZE 256
|
||||
#define SEGMENT_SIZE_SHIFT 8 /* log2(SEGMENT_SIZE) */
|
||||
#define SEGMENT_SIZE_SHIFT 8 /**< log2(SEGMENT_SIZE) */
|
||||
#define DIRECTORY_SIZE 256
|
||||
#define DIRECTORY_SIZE_SHIFT 8 /* log2(DIRECTORY_SIZE) */
|
||||
#define DIRECTORY_SIZE_SHIFT 8 /**< log2(DIRECTORY_SIZE) */
|
||||
#define PRIME1 37
|
||||
#define PRIME2 1048583
|
||||
#define MAX_LOAD_FACTOR 5
|
||||
@@ -124,42 +123,39 @@ typedef struct Element_ {
|
||||
char * key;
|
||||
char * data;
|
||||
struct Element_ * next;
|
||||
Symbol * symbol;/* for debugging hash conflicts */
|
||||
char type; /* user-supplied type */
|
||||
Symbol * symbol; /**< for debugging hash conflicts */
|
||||
char type; /**< user-supplied type */
|
||||
} * Element;
|
||||
|
||||
typedef Element * Segment;
|
||||
|
||||
typedef struct Hash_Table_ {
|
||||
#if 0
|
||||
int in_use; /* If someone is traversing the hash table */
|
||||
int in_use; /**< If someone is traversing the hash table */
|
||||
#endif
|
||||
unsigned int p; /* Next bucket to be split */
|
||||
unsigned int maxp; /* upper bound on p during expansion */
|
||||
long KeyCount; /* current # keys */
|
||||
unsigned int SegmentCount; /* current # segments */
|
||||
unsigned int p; /**< Next bucket to be split */
|
||||
unsigned int maxp; /**< upper bound on p during expansion */
|
||||
long KeyCount; /**< current # keys */
|
||||
unsigned int SegmentCount; /**< current # segments */
|
||||
unsigned int MinLoadFactor;
|
||||
unsigned int MaxLoadFactor;
|
||||
Segment Directory[DIRECTORY_SIZE];
|
||||
} * Hash_Table;
|
||||
|
||||
typedef struct {
|
||||
unsigned int i; /* segment index (i think) */
|
||||
unsigned int j; /* key index in segment (ditto) */
|
||||
Element p; /* usually the next element to be returned */
|
||||
unsigned int i; /**< segment index (i think) */
|
||||
unsigned int j; /**< key index in segment (ditto) */
|
||||
Element p; /**< usually the next element to be returned */
|
||||
Hash_Table table;
|
||||
char type;
|
||||
Element e; /* originally thought of as a place for */
|
||||
/* the caller of HASHlist to temporarily stash the return value */
|
||||
/* to allow the caller (i.e., DICTdo) to be macroized, but now */
|
||||
/* conveniently used by HASHlist, which both stores the ultimate */
|
||||
/* value here as well as returns it via the return value of HASHlist */
|
||||
Element e; /**< originally thought of as a place for
|
||||
* the caller of HASHlist to temporarily stash the return value
|
||||
* to allow the caller (i.e., DICTdo) to be macroized, but now
|
||||
* conveniently used by HASHlist, which both stores the ultimate
|
||||
* value here as well as returns it via the return value of HASHlist
|
||||
*/
|
||||
} HashEntry;
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
/****************/
|
||||
|
||||
/********************/
|
||||
/* global variables */
|
||||
/********************/
|
||||
@@ -186,7 +182,7 @@ GLOBAL SCL_EXPRESS_EXPORT struct freelist_head HASH_Element_fl;
|
||||
** Fast arithmetic, relying on powers of 2
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
The centerline compiler was having problems with MUL and DIV. Where DIV
|
||||
was called like this DIV(NewAddress, SEGMENT_SIZE) it is now being called like
|
||||
DIV(NewAddress, SEGMENT_SIZE_SHIFT). The compiler was mentioning some kind of
|
||||
@@ -220,8 +216,5 @@ extern SCL_EXPRESS_EXPORT Element HASHsearch PROTO( ( Hash_Table, Element, Acti
|
||||
extern SCL_EXPRESS_EXPORT void HASHlistinit PROTO( ( Hash_Table, HashEntry * ) );
|
||||
extern SCL_EXPRESS_EXPORT void HASHlistinit_by_type PROTO( ( Hash_Table, HashEntry *, char ) );
|
||||
extern SCL_EXPRESS_EXPORT Element HASHlist PROTO( ( HashEntry * ) );
|
||||
#if 0
|
||||
extern void HASHlistend PROTO( ( HashEntry * ) );
|
||||
#endif
|
||||
|
||||
#endif /*HASH_H*/
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef LEX_ACTIONS_H
|
||||
#define LEX_ACTIONS_H
|
||||
|
||||
/* $Id: lexact.h,v 1.5 1995/04/05 13:55:40 clark dec96 $ */
|
||||
|
||||
/*
|
||||
* This software was developed by U.S. Government employees as part of
|
||||
* their official duties and is not subject to copyright.
|
||||
|
||||
+11
-17
@@ -1,8 +1,6 @@
|
||||
#ifndef LINKED_LIST_H
|
||||
#define LINKED_LIST_H
|
||||
|
||||
/* $Id: linklist.h,v 1.3 1997/01/21 19:15:23 dar Exp $ */
|
||||
|
||||
/*
|
||||
* This work was supported by the United States Government, and is
|
||||
* not subject to copyright.
|
||||
@@ -48,10 +46,6 @@
|
||||
|
||||
typedef struct Linked_List_ * Linked_List;
|
||||
|
||||
#ifdef __STDC__
|
||||
#else /* old C */
|
||||
#endif /*__STDC__*/
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
/****************/
|
||||
@@ -98,22 +92,22 @@ GLOBAL SCL_EXPRESS_EXPORT Linked_List LINK__l; /* for LISTcreate_with macro
|
||||
#define LIST_new() (struct Linked_List_ *)MEM_new(&LIST_fl)
|
||||
#define LIST_destroy(x) MEM_destroy(&LIST_fl,(Freelist *)(Generic)x)
|
||||
|
||||
/* following could be optimized */
|
||||
/** following could be optimized */
|
||||
#define LISTcreate_with(x) (LINK__l = LISTcreate()),\
|
||||
LISTadd(LINK__l,x),\
|
||||
LINK_l)
|
||||
|
||||
/* accessing links */
|
||||
/** accessing links */
|
||||
#define LINKdata(link) (link)->data
|
||||
#define LINKnext(link) (link)->next
|
||||
#define LINKprev(link) (link)->prev
|
||||
|
||||
/* iteration */
|
||||
#define LISTdo(list, elt, type) \
|
||||
{struct Linked_List_ * __l = (list); \
|
||||
type elt; \
|
||||
Link __p; \
|
||||
if (__l) { \
|
||||
/** iteration */
|
||||
#define LISTdo(list, elt, type) \
|
||||
{struct Linked_List_ * __l = (list); \
|
||||
type elt; \
|
||||
Link __p; \
|
||||
if (__l) { \
|
||||
for (__p = __l->mark; (__p = __p->next) != __l->mark; ) { \
|
||||
(elt) = (type)((__p)->data);
|
||||
|
||||
@@ -122,13 +116,14 @@ GLOBAL SCL_EXPRESS_EXPORT Linked_List LINK__l; /* for LISTcreate_with macro
|
||||
Link link; \
|
||||
if (__i != LIST_NULL) { \
|
||||
for ((link) = __i->mark; ((link) = (link)->next) != __i->mark; ) {
|
||||
|
||||
#define LISTod }}}
|
||||
|
||||
/* accessing */
|
||||
/** accessing */
|
||||
#define LISTpeek_first(list) \
|
||||
(((struct Linked_List_*)list)->mark->next->data)
|
||||
|
||||
/* function aliases */
|
||||
/** function aliases */
|
||||
#define LISTadd(list, item) LISTadd_last(list, item)
|
||||
#define LISTadd_all(list, items) \
|
||||
LISTdo(items, e, Generic) \
|
||||
@@ -141,7 +136,6 @@ GLOBAL SCL_EXPRESS_EXPORT Linked_List LINK__l; /* for LISTcreate_with macro
|
||||
|
||||
extern SCL_EXPRESS_EXPORT void LISTinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List LISTcreate PROTO( ( void ) );
|
||||
/*extern Linked_List LISTcreate_with PROTO((Generic));*/
|
||||
extern SCL_EXPRESS_EXPORT Linked_List LISTcopy PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTadd_first PROTO( ( Linked_List, Generic ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTadd_last PROTO( ( Linked_List, Generic ) );
|
||||
|
||||
+13
-15
@@ -1,8 +1,6 @@
|
||||
#ifndef MEMORY_H
|
||||
#define MEMORY_H
|
||||
|
||||
/* $Id: memory.h,v 1.5 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/*
|
||||
* This work was supported by the United States Government, and is
|
||||
* not subject to copyright.
|
||||
@@ -31,29 +29,29 @@
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
/* mem.h - defs for fixed size block memory allocator */
|
||||
|
||||
/** \file memory.h - defs for fixed size block memory allocator */
|
||||
|
||||
typedef long Align;
|
||||
|
||||
union freelist {
|
||||
union freelist * next; /* next block on freelist */
|
||||
char memory; /* user data */
|
||||
Align aligner; /* force alignment of blocks */
|
||||
union freelist * next; /**< next block on freelist */
|
||||
char memory; /**< user data */
|
||||
Align aligner; /**< force alignment of blocks */
|
||||
};
|
||||
|
||||
typedef union freelist Freelist;
|
||||
|
||||
struct freelist_head {
|
||||
int size_elt; /* size of a single elt */
|
||||
int size_elt; /**< size of a single elt */
|
||||
#ifndef NOSTAT
|
||||
int alloc; /* # of allocations */
|
||||
int alloc; /**< # of allocations */
|
||||
int dealloc;
|
||||
int create; /* number of calls to create a new freelist */
|
||||
Generic max; /* end of freelist */
|
||||
int create; /**< number of calls to create a new freelist */
|
||||
Generic max; /**< end of freelist */
|
||||
#endif
|
||||
int size; /* size of a single elt incl. next ptr */
|
||||
int bytes; /* if we run out, allocate memory by this
|
||||
many bytes */
|
||||
int size; /**< size of a single elt incl. next ptr */
|
||||
int bytes; /**< if we run out, allocate memory by this many bytes */
|
||||
Freelist * freelist;
|
||||
#if SPACE_PROFILE
|
||||
int count;
|
||||
@@ -77,8 +75,8 @@ char * nnew();
|
||||
|
||||
extern int yylineno;
|
||||
|
||||
/* CALLOC grabs and initializes to all 0s space for the indicated */
|
||||
/* number of instances of the indicated type */
|
||||
/** CALLOC grabs and initializes to all 0s space for the indicated
|
||||
* number of instances of the indicated type */
|
||||
#define CALLOC(ptr, num, type) \
|
||||
if (((ptr) = (type*)calloc((num), (unsigned)sizeof(type)))==NULL) { \
|
||||
fprintf(stderr,"fedex: out of space");\
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
/* constants */
|
||||
/*************/
|
||||
|
||||
/* each object has an index - current the index is a mnemonic character */
|
||||
/* hence the array is rather sparse, but the extra slop is only a hundred */
|
||||
/* or so bytes, so it's nothing to sweat about */
|
||||
/** each object has an index - current the index is a mnemonic character
|
||||
* hence the array is rather sparse, but the extra slop is only a hundred
|
||||
* or so bytes, so it's nothing to sweat about */
|
||||
#define MAX_OBJECT_TYPES 127 /* really could be a LOT less */
|
||||
|
||||
/*****************/
|
||||
@@ -69,9 +69,8 @@
|
||||
|
||||
struct Object {
|
||||
struct Symbol_ * ( *get_symbol )();
|
||||
char * type; /* should complete the phrase "X is ..." */
|
||||
/* i.e., "an entity", "a type", "of unknown type" */
|
||||
int bits; /* a bitwise selector of a type, i.e. OBJ_XX_BITS */
|
||||
char * type; /**< should complete the phrase "X is ..." - i.e., "an entity", "a type", "of unknown type" */
|
||||
int bits; /**< a bitwise selector of a type, i.e. OBJ_XX_BITS */
|
||||
};
|
||||
|
||||
/****************/
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RESOLVE_H
|
||||
#define RESOLVE_H
|
||||
|
||||
/* $Id: resolve.h,v 1.6 1994/11/10 19:20:03 clark dec96 $ */
|
||||
|
||||
/*
|
||||
* This software was developed by U.S. Government employees as part of
|
||||
* their official duties and is not subject to copyright.
|
||||
@@ -74,7 +72,6 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_group INITIALLY( ERROR_
|
||||
|
||||
/* cheaper doing the check here, then inside the function call. Return */
|
||||
/* immediately for RESOLVED, FAILED_TO_RESOLVE, and RESOLVE_IN_PROGRESS */
|
||||
/*#define TYPEresolve(t,s) if (is_resolvable((*(t)))) TYPE_resolve((t),(s))*/
|
||||
#define TYPEresolve(t,s) if (is_resolvable((*(t)))) TYPE_resolve((t))
|
||||
#define VARresolve_types(v,s) if (is_resolvable((v)->name)) VAR_resolve_types((v),(s))
|
||||
#define VARresolve_expressions(v,s) if (is_resolvable((v)->name)) VAR_resolve_expressions((v),(s))
|
||||
@@ -88,7 +85,6 @@ extern SCL_EXPRESS_EXPORT void RESOLVEinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEresolve_expressions_statements PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEresolve_subsupers PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEresolve_types PROTO( ( Scope ) );
|
||||
/*extern void TYPE_resolve PROTO((Type *,Scope));*/
|
||||
extern SCL_EXPRESS_EXPORT void TYPE_resolve PROTO( ( Type * ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXP_resolve PROTO( ( Expression, Scope, Type ) );
|
||||
extern SCL_EXPRESS_EXPORT void ALGresolve PROTO( ( Scope ) );
|
||||
|
||||
+20
-40
@@ -1,10 +1,8 @@
|
||||
#ifndef SCHEMA_H
|
||||
#define SCHEMA_H
|
||||
|
||||
/* $Id: schema.h,v 1.11 1997/02/25 19:49:01 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Schema
|
||||
/** **********************************************************************
|
||||
** Module: Schema \file schema.h
|
||||
** Description: This module implements the Schema abstraction, which
|
||||
** basically amounts to a named symbol table.
|
||||
** Constants:
|
||||
@@ -48,10 +46,6 @@
|
||||
* prettied up interface to print_objects_when_running
|
||||
*/
|
||||
|
||||
/*************/
|
||||
/* constants */
|
||||
/*************/
|
||||
|
||||
/*****************/
|
||||
/* packages used */
|
||||
/*****************/
|
||||
@@ -61,11 +55,6 @@
|
||||
#include "symbol.h"
|
||||
#include "scope.h"
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
/************/
|
||||
|
||||
/*typedef struct Scope *Schema;*/
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
@@ -87,30 +76,28 @@ typedef struct Rename {
|
||||
Schema schema;
|
||||
struct Symbol_ * old;
|
||||
struct Symbol_ * nnew;
|
||||
Generic object; /* once object has been looked up */
|
||||
char type; /* drat, need to remember this */
|
||||
/* once renames have been resolved to avoid */
|
||||
/* looking them up in the dictionary again */
|
||||
Generic object; /**< once object has been looked up */
|
||||
char type; /**< drat, need to remember this once renames have been
|
||||
* resolved to avoid looking them up in the dictionary again */
|
||||
enum rename_type rename_type;
|
||||
int userdata; /* generic for user */
|
||||
int userdata; /**< generic for user */
|
||||
} Rename;
|
||||
|
||||
struct Schema_ {
|
||||
Linked_List rules;
|
||||
#if 0
|
||||
struct Express_ * express;
|
||||
#endif
|
||||
Linked_List reflist;
|
||||
Linked_List uselist;
|
||||
/* dictionarys into which are entered renames for each specific */
|
||||
/* object specified in a rename clause (even if it uses the same */
|
||||
/* name */
|
||||
/** \var refdict, usedict
|
||||
* dictionarys into which are entered renames for each specific
|
||||
* object specified in a rename clause (even if it uses the same
|
||||
* name */
|
||||
Dictionary refdict;
|
||||
Dictionary usedict;
|
||||
/* lists of schemas that are fully ref/use'd */
|
||||
/* entries can be 0 if schemas weren't found during RENAMEresolve */
|
||||
Linked_List use_schemas;
|
||||
Linked_List ref_schemas;
|
||||
|
||||
Linked_List use_schemas; /**< lists of schemas that are fully use'd
|
||||
* entries can be 0 if schemas weren't found during RENAMEresolve */
|
||||
Linked_List ref_schemas; /**< lists of schemas that are fully ref'd
|
||||
* entries can be 0 if schemas weren't found during RENAMEresolve */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -159,11 +146,11 @@ GLOBAL SCL_EXPRESS_EXPORT int __SCOPE_search_id INITIALLY( 0 );
|
||||
|
||||
extern SCL_EXPRESS_EXPORT Variable VARfind PROTO( ( Scope, char *, int ) );
|
||||
extern SCL_EXPRESS_EXPORT Schema SCHEMAcreate PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAadd_use PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAadd_reference PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_use PROTO( ( Schema, Rename * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_reference PROTO( ( Schema, Rename * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAadd_use PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAadd_reference PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_use PROTO( ( Schema, Rename * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_reference PROTO( ( Schema, Rename * ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic SCHEMAfind PROTO( ( Schema, char * name, int search_refs ) );
|
||||
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_tiny PROTO( ( char ) );
|
||||
@@ -171,13 +158,6 @@ extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_nostab PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_use PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_ref PROTO( ( Scope ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(SCHEMA_C)
|
||||
#endif /* supports_inline_functions || defined(SCHEMA_C) */
|
||||
|
||||
#endif /* SCHEMA_H */
|
||||
|
||||
|
||||
|
||||
+10
-37
@@ -1,10 +1,8 @@
|
||||
#ifndef SCOPE_H
|
||||
#define SCOPE_H
|
||||
|
||||
/* $Id: scope.h,v 1.10 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Scope
|
||||
/** **********************************************************************
|
||||
** Module: Scope \file scope.h
|
||||
** Description: This module implements a hierarchical (i.e., scoped)
|
||||
** symbol table. The symbol table can store definitions of entities,
|
||||
** types, algorithms, and variables, as well as containing a list
|
||||
@@ -47,12 +45,6 @@
|
||||
|
||||
#define SCOPE_NULL (Scope)0
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
/************/
|
||||
|
||||
/*typedef struct Scope *Scope;*/
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
/****************/
|
||||
@@ -86,14 +78,13 @@
|
||||
#define SCOPE_FIND_ANYTHING OBJ_ANYTHING_BITS
|
||||
|
||||
struct Scope_ {
|
||||
Symbol symbol;
|
||||
char type; /* see above */
|
||||
ClientData clientData; /* user may use this for any purpose */
|
||||
int search_id; /* key to avoid searching this scope twice */
|
||||
Dictionary symbol_table,enum_table;
|
||||
Symbol symbol;
|
||||
char type; /* see above */
|
||||
ClientData clientData; /**< user may use this for any purpose */
|
||||
int search_id; /**< key to avoid searching this scope twice */
|
||||
Dictionary symbol_table,enum_table;
|
||||
struct Scope_ * superscope;
|
||||
union {
|
||||
/* struct Constant *constant;*/
|
||||
struct Procedure_ * proc;
|
||||
struct Function_ * func;
|
||||
struct Rule_ * rule;
|
||||
@@ -102,10 +93,10 @@ struct Scope_ {
|
||||
struct Express_ * express;
|
||||
struct Increment_ * incr;
|
||||
struct TypeHead_ * type;
|
||||
/* no, query owns a scope rather than scope owning a query */
|
||||
/* struct Query *query;*/
|
||||
/* no, query owns a scope rather than scope owning a query
|
||||
* struct Query *query; */
|
||||
} u;
|
||||
Linked_List where; /* optional where clause */
|
||||
Linked_List where; /**< optional where clause */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -129,9 +120,6 @@ struct Scope_ {
|
||||
#define SCOPEget_symbol(scope) (&(scope)->symbol)
|
||||
#define SCOPEput_name(scope,name) ((scope)->symbol.name = name)
|
||||
#define SCOPEget_name(scope) ((scope)->symbol.name)
|
||||
/* get_superscope's' for backward compat */
|
||||
#define SCOPEget_superscope(scope) ((scope)->superscope)
|
||||
#define SCOPEget_superscope(scope) ((scope)->superscope)
|
||||
#define SCOPEget_resolved(scope) ((scope)->symbol.resolved)
|
||||
|
||||
#define SCOPEget_clientData(s) ((s)->clientData)
|
||||
@@ -151,24 +139,9 @@ struct Scope_ {
|
||||
/***********************/
|
||||
|
||||
extern SCL_EXPRESS_EXPORT struct Symbol_ * SCOPE_get_symbol PROTO( ( Generic ) );
|
||||
/*extern struct Scope * SCOPEget_nearest_enclosing_entity PROTO((Scope));*/
|
||||
extern SCL_EXPRESS_EXPORT void SCOPE_get_entities PROTO( ( Scope, Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities_superclass_order PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic SCOPEfind PROTO( ( Scope, char *, int ) );
|
||||
|
||||
#if 0
|
||||
extern Linked_List SCOPEget_types PROTO( ( Scope ) );
|
||||
extern Linked_List SCOPEget_variables PROTO( ( Scope ) );
|
||||
extern Linked_List SCOPEget_algorithms PROTO( ( Scope ) );
|
||||
extern Linked_List SCOPEget_constants PROTO( ( Scope ) );
|
||||
#endif
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(SCOPE_C)
|
||||
|
||||
#endif /* supports_inline_functions || defined(SCOPE_C) */
|
||||
#endif /* SCOPE_H */
|
||||
|
||||
+11
-21
@@ -1,10 +1,8 @@
|
||||
#ifndef STATEMENT_H
|
||||
#define STATEMENT_H
|
||||
|
||||
/* $Id: stmt.h,v 1.3 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Statement
|
||||
/** **********************************************************************
|
||||
** Module: Statement \file stmt.h
|
||||
** Description: This module implements the Statement abstraction. A
|
||||
** statement is, in effect, a typeless Expression. Due to the
|
||||
** existence of complex language constructs, however, it often is
|
||||
@@ -95,9 +93,8 @@ typedef struct Scope_ * Increment;
|
||||
/* these should probably all be expression types */
|
||||
|
||||
struct Statement_ {
|
||||
Symbol symbol; /* can hold pcall or alias name */
|
||||
/* but otherwise is not used for anything */
|
||||
int type; /* one of STMT_XXX above */
|
||||
Symbol symbol; /**< can hold pcall or alias name but otherwise is not used for anything */
|
||||
int type; /**< one of STMT_XXX above */
|
||||
/* hey, is there nothing in common beside symbol and private data?? */
|
||||
union u_statement {
|
||||
struct Alias_ * alias;
|
||||
@@ -115,7 +112,7 @@ struct Statement_ {
|
||||
struct Alias_ {
|
||||
struct Scope_ * scope;
|
||||
struct Variable_ * variable;
|
||||
Linked_List statements; /* list of statements */
|
||||
Linked_List statements; /**< list of statements */
|
||||
};
|
||||
|
||||
struct Assignment_ {
|
||||
@@ -134,18 +131,18 @@ struct Compound_Statement_ {
|
||||
|
||||
struct Conditional_ {
|
||||
Expression test;
|
||||
Linked_List code; /* list of statements */
|
||||
Linked_List otherwise; /* list of statements */
|
||||
Linked_List code; /**< list of statements */
|
||||
Linked_List otherwise; /**< list of statements */
|
||||
};
|
||||
|
||||
struct Loop_ {
|
||||
struct Scope_ * scope; /* scope for increment control */
|
||||
struct Scope_ * scope; /**< scope for increment control */
|
||||
Expression while_expr;
|
||||
Expression until_expr;
|
||||
Linked_List statements; /* list of statements */
|
||||
Linked_List statements; /**< list of statements */
|
||||
};
|
||||
|
||||
/* this is an element in the optional Loop scope */
|
||||
/** this is an element in the optional Loop scope */
|
||||
struct Increment_ {
|
||||
Expression init;
|
||||
Expression end;
|
||||
@@ -154,7 +151,7 @@ struct Increment_ {
|
||||
|
||||
struct Procedure_Call_ {
|
||||
struct Scope_ * procedure;
|
||||
Linked_List parameters; /* list of expressions */
|
||||
Linked_List parameters; /**< list of expressions */
|
||||
};
|
||||
|
||||
struct Return_Statement_ {
|
||||
@@ -249,11 +246,4 @@ extern SCL_EXPRESS_EXPORT void STMTinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT struct Scope_ * INCR_CTLcreate PROTO( ( Symbol *, Expression start,
|
||||
Expression end, Expression increment ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(STATEMENT_C)
|
||||
#endif /* supports_inline_functions || defined(STATEMENT_C) */
|
||||
|
||||
#endif /*STATEMENT_H*/
|
||||
|
||||
@@ -99,11 +99,5 @@ GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SYMBOL_fl;
|
||||
extern SCL_EXPRESS_EXPORT void SYMBOLinitialize( void );
|
||||
SCL_EXPRESS_EXPORT Symbol * SYMBOLcreate( char * name, int line, char * filename );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(SYMBOL_C)
|
||||
#endif /* supports_inline_functions || defined(SYMBOL_C) */
|
||||
|
||||
#endif /* SYMBOL_H */
|
||||
|
||||
+32
-71
@@ -1,10 +1,8 @@
|
||||
#ifndef TYPE_H
|
||||
#define TYPE_H
|
||||
|
||||
/* $Id: type.h,v 1.14 1997/09/19 18:25:10 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Type
|
||||
/** **********************************************************************
|
||||
** Module: Type \file type.h
|
||||
** Description: This module implements the type abstraction. It is
|
||||
** rather unpleasant, since this abstraction is quite well suited
|
||||
** to an object-oriented environment with inheritance.
|
||||
@@ -55,16 +53,16 @@
|
||||
/*************/
|
||||
|
||||
#define TYPE_NULL (Type)0
|
||||
/* since we can't evaluate true size of many aggregates, prepare */
|
||||
/* to grow them by chunks of this size */
|
||||
|
||||
/** since we can't evaluate true size of many aggregates,
|
||||
* prepare to grow them by chunks of this size */
|
||||
#define AGGR_CHUNK_SIZE 30
|
||||
|
||||
/* these are all orthogonal types */
|
||||
/** these are all orthogonal types */
|
||||
enum type_enum {
|
||||
unknown_ = 0, /* 0 catches uninit. errors */
|
||||
special_, /* placeholder, given meaning by it's owner, */
|
||||
/* such as Type_Dont_Care, Type_Bad, Type_User_Def */
|
||||
runtime_, /* cannot be further determined until runtime */
|
||||
unknown_ = 0, /**< 0 catches uninit. errors */
|
||||
special_, /**< placeholder, given meaning by it's owner, such as Type_Dont_Care, Type_Bad, Type_User_Def */
|
||||
runtime_, /**< cannot be further determined until runtime */
|
||||
integer_,
|
||||
real_,
|
||||
string_,
|
||||
@@ -77,32 +75,29 @@ enum type_enum {
|
||||
generic_,
|
||||
|
||||
/* aggregates */
|
||||
aggregate_, /* as a formal */
|
||||
aggregate_, /**< as a formal */
|
||||
array_,
|
||||
bag_,
|
||||
set_,
|
||||
list_,
|
||||
last_aggregate_,/* not real, just for easier computation */
|
||||
last_aggregate_,/**< not real, just for easier computation */
|
||||
|
||||
oneof_,
|
||||
|
||||
/* while they are really used for different */
|
||||
/* purposes, it might be worth considering */
|
||||
/* collapsing entity_ and entity_list_ */
|
||||
entity_, /* single entity */
|
||||
entity_list_, /* linked list of entities */
|
||||
/** while they are really used for different purposes, it might be worth considering collapsing entity_ and entity_list_ */
|
||||
entity_, /**< single entity */
|
||||
entity_list_, /**< linked list of entities */
|
||||
enumeration_,
|
||||
select_,
|
||||
reference_, /* something only defined by a base type, i.e., a */
|
||||
/* type reference */
|
||||
reference_, /**< something only defined by a base type, i.e., a type reference */
|
||||
query_,
|
||||
op_, /* something with an operand */
|
||||
inverse_, /* is? an inverse */
|
||||
op_, /**< something with an operand */
|
||||
inverse_, /**< is? an inverse */
|
||||
|
||||
identifier_, /* simple identifier in an expression */
|
||||
attribute_, /* attribute reference (i.e., expr->u.variable) */
|
||||
derived_,/*?*/
|
||||
funcall_, /* a function call and actual parameters */
|
||||
identifier_, /**< simple identifier in an expression */
|
||||
attribute_, /**< attribute reference (i.e., expr->u.variable) */
|
||||
derived_, /**< ?*/
|
||||
funcall_, /**< a function call and actual parameters */
|
||||
|
||||
self_
|
||||
};
|
||||
@@ -115,13 +110,11 @@ enum type_enum {
|
||||
#include "expbasic.h" /* get basic definitions */
|
||||
#include "symbol.h"
|
||||
#include "object.h"
|
||||
/*#include "scope.h"*/
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
/************/
|
||||
|
||||
/*typedef struct Scope *Type;*/
|
||||
typedef struct TypeHead_ * TypeHead;
|
||||
typedef struct TypeBody_ * TypeBody;
|
||||
typedef enum type_enum TypeType;
|
||||
@@ -146,9 +139,8 @@ typedef enum type_enum Class;
|
||||
/***************************/
|
||||
|
||||
struct TypeHead_ {
|
||||
Type head; /* if we are a defined type */
|
||||
/* this is who we point to */
|
||||
struct TypeBody_ * body; /* true type, ignoring defined types */
|
||||
Type head; /**< if we are a defined type this is who we point to */
|
||||
struct TypeBody_ * body; /**< true type, ignoring defined types */
|
||||
#if 0
|
||||
/* if we are concerned about memory (over time) uncomment this and */
|
||||
/* other references to refcount in parser and TYPEresolve. It is */
|
||||
@@ -159,30 +151,25 @@ struct TypeHead_ {
|
||||
|
||||
struct TypeBody_ {
|
||||
#if 1
|
||||
struct TypeHead_ * head; /* for debugging only */
|
||||
struct TypeHead_ * head; /**< for debugging only */
|
||||
#endif
|
||||
enum type_enum type; /* bits describing this type, int, real, etc */
|
||||
enum type_enum type; /**< bits describing this type, int, real, etc */
|
||||
struct {
|
||||
unsigned unique : 1;
|
||||
unsigned optional : 1;
|
||||
unsigned fixed : 1;
|
||||
unsigned shared : 1; /* type is shared */
|
||||
unsigned repeat : 1; /* expression is a repeat count*/
|
||||
unsigned encoded : 1; /* encoded string */
|
||||
unsigned shared : 1; /**< type is shared */
|
||||
unsigned repeat : 1; /**< expression is a repeat count*/
|
||||
unsigned encoded : 1; /**< encoded string */
|
||||
} flags;
|
||||
Type base; /* underlying base type if any */
|
||||
/* can also contain true type if this type */
|
||||
/* is a type reference */
|
||||
Type tag; /* optional tag */
|
||||
Type base; /**< underlying base type if any can also contain true type if this type is a type reference */
|
||||
Type tag; /**< optional tag */
|
||||
/* a lot of the stuff below can be unionized */
|
||||
Expression precision;
|
||||
Linked_List list; /* used by select_types */
|
||||
/* and composed types, such as for a */
|
||||
/* list of entities in an instance */
|
||||
/* Dictionary enumeration; *//* only used by enumerations */
|
||||
Linked_List list; /**< used by select_types and composed types, such as for a list of entities in an instance */
|
||||
Expression upper;
|
||||
Expression lower;
|
||||
struct Scope_ * entity; /* only used by entity types */
|
||||
struct Scope_ * entity; /**< only used by entity types */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -253,7 +240,6 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
#define TYPEis_oneof(t) ((t)->u.type->body->type == oneof_)
|
||||
#define TYPEis_entity(t) ((t)->u.type->body->type == entity_)
|
||||
#define TYPEis_enumeration(t) ((t)->u.type->body->type == enumeration_)
|
||||
/*#define TYPEis_aggregate(t) ((t)->u.type->body->type >= aggregate_ && (t)->u.type->body->type < last_aggregate_)*/
|
||||
#define TYPEis_aggregate(t) ((t)->u.type->body->base)
|
||||
#define TYPEis_aggregate_raw(t) ((t)->u.type->body->type == aggregate_)
|
||||
#define TYPEis_array(t) ((t)->u.type->body->type == array_)
|
||||
@@ -289,7 +275,6 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
#define COMP_TYPEput_items(t,lis) ((t)->u.type->body->list = (lis))
|
||||
#define COMP_TYPEadd_items(t,lis) LISTadd_all((t)->u.type->body->list, (lis));
|
||||
|
||||
/*#define ENUM_TYPEput_items(type,list) COMP_TYPEput_items(type, list)*/
|
||||
#define ENUM_TYPEget_items(t) ((t)->symbol_table)
|
||||
#define TYPEget_optional(t) ((t)->u.type->body->flags.optional)
|
||||
#define TYPEget_unique(t) ((t)->u.type->body->flags.unique)
|
||||
@@ -302,9 +287,6 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
|
||||
#define TYPEget_enum_tags(t) ((t)->symbol_table)
|
||||
|
||||
/* for backwards compatibility */
|
||||
#define AGGR_TYPEget_base_type TYPEget_base_type
|
||||
|
||||
#define TYPEget_clientData(t) ((t)->clientData)
|
||||
#define TYPEput_clientData(t,d) ((t)->clientData = (d))
|
||||
|
||||
@@ -318,34 +300,13 @@ extern SCL_EXPRESS_EXPORT Type TYPEcreate PROTO( ( enum type_enum ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_from_body_anonymously PROTO( ( TypeBody ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_name PROTO( ( struct Symbol_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_nostab PROTO( ( struct Symbol_ *, Scope, char ) );
|
||||
/*extern Type TYPEcreate_typedef PROTO((Type, TypeBody,
|
||||
Scope,struct Symbol *));*/
|
||||
extern SCL_EXPRESS_EXPORT TypeBody TYPEBODYcreate PROTO( ( enum type_enum ) );
|
||||
/*extern Type TYPEcopy_shallow PROTO((Type));*/
|
||||
extern SCL_EXPRESS_EXPORT void TYPEinitialize PROTO( ( void ) );
|
||||
|
||||
#if 0
|
||||
extern Dictionary TYPEget_enum_tags PROTO( ( Type ) );
|
||||
#endif
|
||||
extern SCL_EXPRESS_EXPORT bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
|
||||
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_user_defined_type PROTO( ( Type, Scope, struct Symbol_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_user_defined_tag PROTO( ( Type, Scope, struct Symbol_ * ) );
|
||||
|
||||
#if 0
|
||||
extern int TYPEget_size PROTO( ( Type ) );
|
||||
extern bool TYPEcompatible PROTO( ( Type, Type ) );
|
||||
extern Expression SZD_TYPEget_precision PROTO( ( Sized_Type ) );
|
||||
extern bool SZD_TYPEget_varying PROTO( ( Sized_Type ) );
|
||||
extern Expression TYPE_REFget_full_name PROTO( ( Type_Reference * ) );
|
||||
#endif /*0*/
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(TYPE_C)
|
||||
#endif /* supports_inline_functions || defined(TYPE_C) */
|
||||
|
||||
#endif /* TYPE_H */
|
||||
|
||||
+14
-46
@@ -1,10 +1,8 @@
|
||||
#ifndef VARIABLE_H
|
||||
#define VARIABLE_H
|
||||
|
||||
/* $Id: variable.h,v 1.10 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Variable
|
||||
/** **********************************************************************
|
||||
** Module: Variable \file variable.h
|
||||
** Description: This module implements the Variable abstraction. A
|
||||
** Variable consists of a name, a type, a reference class, and
|
||||
** some flags, e.g. 'optional', 'variable'. It is used to represent
|
||||
@@ -78,26 +76,23 @@ typedef struct Variable_ * Variable;
|
||||
/***************************/
|
||||
|
||||
struct Variable_ {
|
||||
/* Symbol is inside of 'name' below */
|
||||
Expression name;
|
||||
Type type;
|
||||
Expression initializer; /* or 'derived' */
|
||||
int offset;
|
||||
Expression name; /**< Symbol is inside of 'name' below */
|
||||
Type type;
|
||||
Expression initializer; /**< or 'derived' */
|
||||
int offset;
|
||||
|
||||
struct {
|
||||
int optional : 1; /* OPTIONAL keyword */
|
||||
int var : 1; /* VAR keyword */
|
||||
int constant : 1; /* from CONSTANT...END_CONSTANT */
|
||||
int unique : 1; /* appears in UNIQUE list */
|
||||
int parameter : 1; /* is a formal parameter */
|
||||
int attribute : 1; /* is an attribute (rule parameters */
|
||||
/* are marked this way, too) */
|
||||
int optional : 1; /**< OPTIONAL keyword */
|
||||
int var : 1; /**< VAR keyword */
|
||||
int constant : 1; /**< from CONSTANT...END_CONSTANT */
|
||||
int unique : 1; /**< appears in UNIQUE list */
|
||||
int parameter : 1; /**< is a formal parameter */
|
||||
int attribute : 1; /**< is an attribute (rule parameters are marked this way, too) */
|
||||
} flags;
|
||||
|
||||
#define query_symbol inverse_symbol
|
||||
Symbol * inverse_symbol; /* entity symbol */
|
||||
Variable inverse_attribute; /* attribute related by */
|
||||
/* inverse relationship */
|
||||
Symbol * inverse_symbol; /**< entity symbol */
|
||||
Variable inverse_attribute; /**< attribute related by inverse relationship */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -133,8 +128,6 @@ GLOBAL SCL_EXPRESS_EXPORT struct freelist_head VAR_fl;
|
||||
|
||||
#define VARis_derived(v) ((v)->initializer != 0)
|
||||
#define VARget_inverse(v) ((v)->inverse_attribute)
|
||||
/* for backwards compatibility */
|
||||
#define VARget_derived VARis_derived
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
@@ -144,29 +137,4 @@ extern SCL_EXPRESS_EXPORT Variable VARcreate PROTO( ( Expression, Type ) );
|
||||
extern SCL_EXPRESS_EXPORT void VARinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT char * VARget_simple_name PROTO( ( Variable ) );
|
||||
|
||||
#if 0
|
||||
extern void VARput_type PROTO( ( Variable *, Type ) );
|
||||
extern void VARput_initializer PROTO( ( Variable *, Expression ) );
|
||||
extern void VARput_derived PROTO( ( Variable *, Boolean ) );
|
||||
extern void VARput_optional PROTO( ( Variable *, Boolean ) );
|
||||
extern void VARput_variable PROTO( ( Variable *, Boolean ) );
|
||||
extern void VARput_reference PROTO( ( Variable *, Expression ) );
|
||||
/*Mextern void VARput_offset PROTO((Variable *, int));*/
|
||||
extern void VARput_inverse PROTO( ( Variable *, Symbol * ) );
|
||||
/*M extern Type VARget_type PROTO((Variable *));*/
|
||||
/*Mextern Boolean VARget_derived PROTO((Variable *));*/
|
||||
extern Boolean VARget_optional PROTO( ( Variable * ) );
|
||||
extern Boolean VARget_variable PROTO( ( Variable * ) );
|
||||
extern Expression VARget_reference PROTO( ( Variable * ) );
|
||||
/*Mextern int VARget_offset PROTO((Variable *));*/
|
||||
#endif /*0*/
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(VARIABLE_C)
|
||||
|
||||
#endif /* supports_inline_functions || defined(VARIABLE_C) */
|
||||
|
||||
#endif /* VARIABLE_H */
|
||||
|
||||
Reference in New Issue
Block a user