added project
This commit is contained in:
6
dvm/fdvm/trunk/Sage/lib/CMakeLists.txt
Normal file
6
dvm/fdvm/trunk/Sage/lib/CMakeLists.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
set(DVM_SAGE_INCLUDE_DIRS ${DVM_SAGE_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
set(DVM_SAGE_INCLUDE_DIRS ${DVM_SAGE_INCLUDE_DIRS} PARENT_SCOPE)
|
||||
|
||||
add_subdirectory(newsrc)
|
||||
add_subdirectory(oldsrc)
|
||||
55
dvm/fdvm/trunk/Sage/lib/Makefile
Normal file
55
dvm/fdvm/trunk/Sage/lib/Makefile
Normal file
@@ -0,0 +1,55 @@
|
||||
#######################################################################
|
||||
## pC++/Sage++ Copyright (C) 1993 ##
|
||||
## Indiana University University of Oregon University of Rennes ##
|
||||
#######################################################################
|
||||
|
||||
|
||||
# sage/lib/Makefile (phb)
|
||||
|
||||
SHELL = /bin/sh
|
||||
INSTALL = /bin/cp
|
||||
|
||||
# Flags passed down to Makefiles in subdirectories
|
||||
MFLAGS =
|
||||
|
||||
CC = gcc
|
||||
#CC=cc#ENDIF##USE_CC#
|
||||
|
||||
CXX = g++
|
||||
CXX = /usr/WorkShop/usr/bin/DCC
|
||||
LINKER = $(CC)
|
||||
|
||||
NOP = echo
|
||||
#C90#EXTRAOBJ=alloca-c90.o#ENDIF#
|
||||
#C90#NOP = @/bin/rm -f alloca-c90.o#ENDIF#
|
||||
|
||||
SUBDIR1 = oldsrc newsrc
|
||||
# Subdirectories to make resursively
|
||||
SUBDIR = ${SUBDIR1}
|
||||
|
||||
all: ${SUBDIR} $(EXTRAOBJ)
|
||||
|
||||
clean:
|
||||
$(NOP)
|
||||
for i in ${SUBDIR1}; do (cd $$i; $(MAKE) "MAKE=$(MAKE)" clean); done
|
||||
|
||||
install: FRC $(EXTRAOBJ)
|
||||
@for i in ${SUBDIR1}; do (cd $$i; \
|
||||
echo " *** COMPILING $$i DIRECTORY";\
|
||||
$(MAKE) "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" install); done
|
||||
|
||||
# If you are on a C90, you will need the gnu alloca()
|
||||
alloca-c90.o: alloca-c90.c
|
||||
$(CC) -c alloca-c90.c
|
||||
if [ -d c90 ] ; then true; \
|
||||
else mkdir c90 ;fi
|
||||
$(INSTALL) alloca-c90.o c90
|
||||
|
||||
.RECURSIVE: ${SUBDIR}
|
||||
|
||||
${SUBDIR}: FRC
|
||||
@echo " *** COMPILING $@ DIRECTORY"; cd $@; \
|
||||
$(MAKE) "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" all
|
||||
|
||||
FRC:
|
||||
|
||||
95
dvm/fdvm/trunk/Sage/lib/include/attributes.h
Normal file
95
dvm/fdvm/trunk/Sage/lib/include/attributes.h
Normal file
@@ -0,0 +1,95 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Defines the data structure for attributes in sage
|
||||
// attributes can be used to store any information for any statement, expression, symbol or types nodes
|
||||
// F. Bodin Indiana July 94.
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class SgAttribute{
|
||||
private:
|
||||
// the attribute data;
|
||||
int type; // a label;
|
||||
void *data; // the data;
|
||||
int dataSize; // the size of the data in bytes to allow data to be copied;
|
||||
SgAttribute *next; // to the next attribute of a statements (do that way or not??);
|
||||
// link to sage node, allow to go from an attribute to sage stuffs;
|
||||
typenode typeNode; // indicates if SgStatement, SgExpression, ... ptToSage is pointed to;
|
||||
void *ptToSage; // pointer to SgStatement, SgExpression, ... ;
|
||||
int fileNumber; // the file methods;
|
||||
// the methods to access the structure of an attributes;
|
||||
public:
|
||||
SgAttribute(int t, void *pt, int size, SgStatement &st, int filenum);
|
||||
SgAttribute(int t, void *pt, int size, SgSymbol &st, int filenum);
|
||||
SgAttribute(int t, void *pt, int size, SgExpression &st, int filenum);
|
||||
SgAttribute(int t, void *pt, int size, SgType &st, int filenum);
|
||||
SgAttribute(int t, void *pt, int size, SgLabel &st, int filenum); //Kataev 21.03.2013
|
||||
SgAttribute(int t, void *pt, int size, SgFile &st, int filenum); //Kataev 15.07.2013
|
||||
SgAttribute(const SgAttribute& copy)
|
||||
{
|
||||
type = copy.type;
|
||||
data = copy.data;
|
||||
dataSize = copy.dataSize;
|
||||
next = NULL;
|
||||
typeNode = copy.typeNode;
|
||||
ptToSage = copy.ptToSage;
|
||||
fileNumber = copy.fileNumber;
|
||||
}
|
||||
|
||||
~SgAttribute();
|
||||
int getAttributeType();
|
||||
void setAttributeType(int t);
|
||||
void *getAttributeData();
|
||||
void *setAttributeData(void *d);
|
||||
int getAttributeSize();
|
||||
void setAttributeSize(int s);
|
||||
typenode getTypeNode();
|
||||
void *getPtToSage();
|
||||
void setPtToSage(void *sa);
|
||||
void resetPtToSage();
|
||||
void setPtToSage(SgStatement &st);
|
||||
void setPtToSage(SgSymbol &st);
|
||||
void setPtToSage(SgExpression &st);
|
||||
void setPtToSage(SgType &st);
|
||||
void setPtToSage(SgLabel &st); //Kataev 21.03.2013
|
||||
void setPtToSage(SgFile &st); //Kataev 15.07.2013
|
||||
SgStatement *getStatement();
|
||||
SgExpression *getExpression();
|
||||
SgSymbol *getSgSymbol();
|
||||
SgType *getType();
|
||||
SgLabel *getLabel(); //Kataev 21.03.2013
|
||||
SgFile *getFile(); //Kataev 15.07.2013
|
||||
int getfileNumber();
|
||||
SgAttribute *copy();
|
||||
SgAttribute *getNext();
|
||||
void setNext(SgAttribute *s);
|
||||
int listLenght();
|
||||
SgAttribute *getInlist(int num);
|
||||
void save(FILE *file);
|
||||
void save(FILE *file, void (*savefunction)(void *dat,FILE *f));
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
// The ATTRIBUTE TYPE ALREADY USED
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define DEPENDENCE_ATTRIBUTE -1001
|
||||
#define INDUCTION_ATTRIBUTE -1002
|
||||
#define ACCESS_ATTRIBUTE -1003
|
||||
#define DEPGRAPH_ATTRIBUTE -1004
|
||||
#define USEDLIST_ATTRIBUTE -1005
|
||||
#define DEFINEDLIST_ATTRIBUTE -1006
|
||||
|
||||
#define NOGARBAGE_ATTRIBUTE -1007
|
||||
#define GARBAGE_ATTRIBUTE -1008
|
||||
|
||||
// store the annotation expression; it is then visible from the
|
||||
// garbage collection
|
||||
#define ANNOTATION_EXPR_ATTRIBUTE -1009
|
||||
|
||||
|
||||
|
||||
124
dvm/fdvm/trunk/Sage/lib/include/baseClasses.h
Normal file
124
dvm/fdvm/trunk/Sage/lib/include/baseClasses.h
Normal file
@@ -0,0 +1,124 @@
|
||||
// ----------------------------------
|
||||
// Darryl Brown
|
||||
// University of Oregon pC++/Sage++
|
||||
//
|
||||
// baseClasses.h - module for basic classes used by
|
||||
// breakpoint modules.
|
||||
//
|
||||
//
|
||||
// ----------------------------------
|
||||
|
||||
//if already included, skip this file...
|
||||
#ifdef BASE_CL_ALREADY_INCLUDED
|
||||
// do nothing;
|
||||
#else
|
||||
#define BASE_CL_ALREADY_INCLUDED 1
|
||||
|
||||
|
||||
// -------------------------------------------------------------;
|
||||
// this class is the base pointer type of all elements ;
|
||||
// stored in linked lists;
|
||||
class brk_basePtr {
|
||||
public:
|
||||
|
||||
virtual void print();
|
||||
// this function should be overridden by later classes.;
|
||||
virtual void print(int);
|
||||
// this function should be overridden by later classes.;
|
||||
virtual void printToBuf(int, char *);
|
||||
// this function should be overridden by later classes.;
|
||||
virtual void print(int t, FILE *fptr);
|
||||
// this function should be overridden by later classes.;
|
||||
virtual void printAll();
|
||||
// this function should be overridden by later classes.;
|
||||
virtual void printAll(int);
|
||||
// this function should be overridden by later classes.;
|
||||
#if 0
|
||||
virtual void printAll(int, FILE *);
|
||||
// this function should be overridden by later classes.;
|
||||
virtual void printAll(FILE *);
|
||||
// this function should be overridden by later classes.;
|
||||
#endif
|
||||
int (* userCompare)(brk_basePtr *, brk_basePtr *);
|
||||
// this function should be overridden by later classes.;
|
||||
virtual int compare(brk_basePtr *);
|
||||
// this function should be overridden by later classes.;
|
||||
brk_basePtr();
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// the nodes of the linked lists kept for children and parents of each class;
|
||||
class brk_ptrNode : public brk_basePtr {
|
||||
public:
|
||||
brk_ptrNode *next; // next node;
|
||||
brk_ptrNode *prev; // previous node;
|
||||
brk_basePtr *node; // the ptr to the hierarchy at this node;
|
||||
|
||||
// constructors;
|
||||
brk_ptrNode (void);
|
||||
brk_ptrNode (brk_basePtr *h);
|
||||
virtual int compare(brk_basePtr *);
|
||||
// compares this heirarchy with another alphabetically using className;
|
||||
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// the class implementing the linked list for
|
||||
class brk_linkedList : public brk_basePtr {
|
||||
|
||||
public:
|
||||
|
||||
brk_ptrNode *end; // end of list;
|
||||
brk_ptrNode *start; // start of list;
|
||||
brk_ptrNode *current; // pointer to current element in list,
|
||||
// used for traversal of list.;
|
||||
int length; // length of list;
|
||||
|
||||
// constructor;
|
||||
brk_linkedList();
|
||||
|
||||
// access functions;
|
||||
void push (brk_basePtr *h); // push hierarchy h onto front of list;
|
||||
void pushLast (brk_basePtr *h); // push hierarchy h onto back of list;
|
||||
brk_basePtr *pop (); // remove and return the first element in list;
|
||||
brk_basePtr *popLast (); // remove and return the last element in list;
|
||||
brk_basePtr *searchList (); // begin traversal of list;
|
||||
brk_basePtr *nextItem(); // give the next item in list during traversal;
|
||||
brk_basePtr *remove (int i); // remove & return the i-th element of list;
|
||||
brk_basePtr *getIth (int i); // return the i-th element of list;
|
||||
brk_basePtr *insert(int i, brk_basePtr * p);
|
||||
// insert *p at point i in list;
|
||||
brk_ptrNode *findMember (brk_basePtr *); // look for this element and
|
||||
// return the brk_ptrNode that points to it;
|
||||
int memberNum(brk_ptrNode *); // what order does this element fall in list;
|
||||
|
||||
virtual void print(int); // print all elements;
|
||||
virtual void print(int, FILE *ftpr); // print all elements;
|
||||
virtual void print(); // print all elements;
|
||||
virtual void printIth(int i); // print i-th element of list;
|
||||
virtual void printToBuf(int, char *);
|
||||
// this function should be overridden by later classes.;
|
||||
void sort (); // sorts the list, elements must have compare function.,;
|
||||
void sort(int (* compareFunc) (brk_basePtr *, brk_basePtr *));
|
||||
virtual void swap(brk_ptrNode *l, brk_ptrNode *r);
|
||||
// swaps these two basic elements
|
||||
};
|
||||
|
||||
|
||||
// ---------------------------------------------------
|
||||
// external declarations.
|
||||
// ---------------------------------------------------
|
||||
|
||||
extern char * brk_stringSave(char * str);
|
||||
extern int brk_strsame(char * str, char * str1);
|
||||
extern void brk_printtabs(int tabs);
|
||||
extern void brk_printtabs(int tabs, FILE *fptr);
|
||||
// here is the endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
588
dvm/fdvm/trunk/Sage/lib/include/bif_node.def
Normal file
588
dvm/fdvm/trunk/Sage/lib/include/bif_node.def
Normal file
@@ -0,0 +1,588 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
/* format description
|
||||
'_' stands for no.
|
||||
'e' stands for control end statement
|
||||
'd' declaration statement // what is not executable
|
||||
DEFNODECODE(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10)
|
||||
f1 : variant of the node
|
||||
f2 : string that gives the name (not used yet)
|
||||
f3 : kind of node (stmt, declaration); not used yet
|
||||
f4 : number of child (2 if blob list2, 1 if cp, 0 if leaf)
|
||||
f5 : type of the node BIFNODE...
|
||||
-------- particular info ---------------
|
||||
f6 : is a declaration node 'd' or executable 'e' ,'c' controlend
|
||||
f7 : is a declarator node if bif node 's' (for structure, union , enum)
|
||||
for low lewe node c indicate constant expression
|
||||
f8 : has a symbol associated 's' valid for bif and llnode
|
||||
f9 : is a control parent 'p' or a control end 'c'
|
||||
f10: not used yet
|
||||
*/
|
||||
|
||||
DEFNODECODE(GLOBAL,"nodetext",'s',1,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(PROG_HEDR,"nodetext",'s',1,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(PROC_HEDR,"nodetext",'s',1,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(PROS_HEDR,"nodetext",'s',1,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(BASIC_BLOCK,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(CONTROL_END,"nodetext",'s',0,BIFNODE, 'c','_','_','_','_')
|
||||
DEFNODECODE(IF_NODE,"nodetext",'s',2,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(WHERE_BLOCK_STMT,"nodetext",'s',2,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(ARITHIF_NODE,"nodetext",'s',0,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(LOGIF_NODE,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(FORALL_STAT,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(LOOP_NODE,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(FOR_NODE,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(PROCESS_DO_STAT,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(TRY_STAT,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(CATCH_STAT,"nodetext",'s',0,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(FORALL_NODE,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(WHILE_NODE,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(CDOALL_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SDOALL_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DOACROSS_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CDOACROSS_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(EXIT_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(GOTO_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ASSGOTO_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(COMGOTO_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PAUSE_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(STOP_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(ALLOCATE_STMT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DEALLOCATE_STMT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(NULLIFY_STMT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ASSIGN_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(POINTER_ASSIGN_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(M_ASSIGN_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(PROC_STAT,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PROS_STAT,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PROS_STAT_LCTN,"nodetext",'s',2,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PROS_STAT_SUBM,"nodetext",'s',2,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ASSLAB_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SUM_ACC,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MULT_ACC,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MAX_ACC,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MIN_ACC,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CAT_ACC,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OR_ACC,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(AND_ACC,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(READ_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(WRITE_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OTHERIO_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(BLOB,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SIZES,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
|
||||
|
||||
DEFNODECODE(FUNC_HEDR,"nodetext",'s',1,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(MODULE_STMT,"nodetext",'s',1,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(USE_STMT,"nodetext",'s',1,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(WHERE_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ALLDO_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(IDENTIFY,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FORMAT_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(STOP_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RETURN_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ELSEIF_NODE,"nodetext",'s',2,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ELSEWH_NODE,"nodetext",'s',2,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(INCLUDE_LINE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PREPROCESSOR_DIR,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
|
||||
/*NO_OPnodes*/
|
||||
DEFNODECODE(COMMENT_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(CONT_STAT,"nodetext",'s',0,BIFNODE, 'c','_','_','_','_')
|
||||
DEFNODECODE(VAR_DECL,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(VAR_DECL_90,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(PARAM_DECL,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(COMM_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(EQUI_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(IMPL_DECL,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(DATA_DECL,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(SAVE_DECL,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(ENTRY_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(STMTFN_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(DIM_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(PROCESSORS_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(BLOCK_DATA,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(EXTERN_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(INTRIN_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
|
||||
DEFNODECODE(ENUM_DECL,"nodetext",'d',1,BIFNODE, 'd','e','_','_','_')
|
||||
DEFNODECODE(CLASS_DECL,"nodetext",'d',1,BIFNODE, 'd','s','_','_','_')
|
||||
DEFNODECODE(TECLASS_DECL,"nodetext",'d',1,BIFNODE, 'd','s','_','_','_')
|
||||
DEFNODECODE(COLLECTION_DECL,"nodetext",'d',1,BIFNODE, 'd','s','_','_','_')
|
||||
DEFNODECODE(TEMPLATE_FUNDECL,"nodetext",'d',1,BIFNODE, 'd','s','_','_','_')
|
||||
DEFNODECODE(TEMPLATE_DECL,"nodetext",'d',1,BIFNODE, 'd','s','_','_','_')
|
||||
DEFNODECODE(UNION_DECL,"nodetext",'d',1,BIFNODE, 'd','u','_','_','_')
|
||||
DEFNODECODE(STRUCT_DECL,"nodetext",'d',1,BIFNODE, 'd','s','_','_','_')
|
||||
DEFNODECODE(DERIVED_CLASS_DECL,"nodetext",'d',1,BIFNODE,'d','_','_','_','_')
|
||||
DEFNODECODE(EXPR_STMT_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DO_WHILE_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SWITCH_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CASE_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DEFAULT_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BREAK_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CONTINUE_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RETURN_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ASM_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPAWN_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PARFOR_NODE,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PAR_NODE,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LABEL_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PROS_COMM,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(ATTR_DECL,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(NAMELIST_STAT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
|
||||
DEFNODECODE(PROCESSES_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PROCESSES_END,"nodetext",'s',0,BIFNODE, 'c','_','_','_','_')
|
||||
DEFNODECODE(INPORT_DECL,"nodetext",'d',2,BIFNODE, 'd','-','_','_','_')
|
||||
DEFNODECODE(OUTPORT_DECL,"nodetext",'d',2,BIFNODE, 'd','-','_','_','_')
|
||||
DEFNODECODE(CHANNEL_STAT,"nodetext",'s',1,BIFNODE, 'e','-','_','_','_')
|
||||
DEFNODECODE(MERGER_STAT,"nodetext",'s',1,BIFNODE, 'e','-','_','_','_')
|
||||
DEFNODECODE(MOVE_PORT,"nodetext",'s',1,BIFNODE, 'e','-','_','_','_')
|
||||
DEFNODECODE(SEND_STAT,"nodetext",'s',2,BIFNODE, 'e','-','_','_','_')
|
||||
DEFNODECODE(RECEIVE_STAT,"nodetext",'s',2,BIFNODE, 'e','-','_','_','_')
|
||||
DEFNODECODE(ENDCHANNEL_STAT,"nodetext",'s',1,BIFNODE, 'e','-','_','_','_')
|
||||
DEFNODECODE(PROBE_STAT,"nodetext",'s',1,BIFNODE, 'e','-','_','_','_')
|
||||
DEFNODECODE(INTENT_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(PRIVATE_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(PUBLIC_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(OPTIONAL_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(ALLOCATABLE_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(POINTER_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(TARGET_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(STATIC_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(MODULE_PROC_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(INTERFACE_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(INTERFACE_OPERATOR,"nodetext",'s',0,BIFNODE,'d','_','_','_','_')
|
||||
DEFNODECODE(INTERFACE_ASSIGNMENT,"nodetext",'s',0,BIFNODE,'d','_','_','_','_')
|
||||
DEFNODECODE(SEQUENCE_STMT,"nodetext",'s',0,BIFNODE, 'd','_','_','_','_')
|
||||
|
||||
/*****************variant tags for low level nodes********************/
|
||||
|
||||
DEFNODECODE(INT_VAL,"nodetext",'c',0,LLNODE, '_','c','_','_','_')
|
||||
DEFNODECODE(FLOAT_VAL,"nodetext",'c',0,LLNODE, '_','c','_','_','_')
|
||||
DEFNODECODE(DOUBLE_VAL,"nodetext",'c',0,LLNODE, '_','c','_','_','_')
|
||||
DEFNODECODE(BOOL_VAL,"nodetext",'c',0,LLNODE, '_','c','_','_','_')
|
||||
DEFNODECODE(CHAR_VAL,"nodetext",'c',0,LLNODE, '_','c','_','_','_')
|
||||
DEFNODECODE(STRING_VAL,"nodetext",'c',0,LLNODE, '_','c','_','_','_')
|
||||
DEFNODECODE(KEYWORD_VAL,"nodetext",'c',0,LLNODE, '_','c','_','_','_')
|
||||
DEFNODECODE(COMPLEX_VAL,"nodetext",'c',0,LLNODE, '_','c','_','_','_')
|
||||
|
||||
DEFNODECODE(CONST_REF,"nodetext",'r',0,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(VAR_REF,"nodetext",'r',0,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(ARRAY_REF,"nodetext",'r',1,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(PROCESSORS_REF,"nodetext",'r',1,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(RECORD_REF,"nodetext",'r',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(STRUCTURE_CONSTRUCTOR,"nodetext",'r',1,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(CONSTRUCTOR_REF,"nodetext",'r',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ENUM_REF,"nodetext",'r',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LABEL_REF,"nodetext",'r',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TYPE_OP,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PORT_TYPE_OP,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(INPORT_TYPE_OP,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OUTPORT_TYPE_OP,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TYPE_REF,"nodetext",'e',0,LLNODE, '_','_','s','_','_')
|
||||
|
||||
DEFNODECODE(VAR_LIST,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(EXPR_LIST,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RANGE_LIST,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CASE_CHOICE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DEF_CHOICE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(VARIANT_CHOICE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(DDOT,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(KEYWORD_ARG,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RANGE_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FORALL_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(UPPER_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LOWER_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(EQ_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(GT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(NOTEQL_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LTEQL_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(GTEQL_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(ADD_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SUBT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OR_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(MULT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DIV_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MOD_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(AND_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(EXP_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ARRAY_MULT,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CONCAT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(XOR_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(EQV_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(NEQV_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MINUS_OP,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(NOT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DEREF_OP,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RENAME_NODE,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ONLY_NODE,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(POINTST_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FUNCTION_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MINUSMINUS_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PLUSPLUS_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BITAND_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BITOR_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DIMENSION_OP,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ALLOCATABLE_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PARAMETER_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TARGET_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(STATIC_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SAVE_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(POINTER_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(INTRINSIC_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OPTIONAL_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(EXTERNAL_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PRIVATE_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PUBLIC_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(IN_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OUT_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(INOUT_OP,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LABEL_ARG,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(STAR_RANGE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(PROC_CALL,"nodetext",'e',2,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(PROS_CALL,"nodetext",'e',2,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(FUNC_CALL,"nodetext",'e',1,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(OVERLOADED_CALL,"nodetext",'e',1,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(THROW_OP,"nodetext",'e',1,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(DEFINED_OP,"nodetext",'e',2,LLNODE, '_','_','s','_','_')
|
||||
|
||||
DEFNODECODE(ACCESS_REF,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CONS,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACCESS,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(IOACCESS,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CONTROL_LIST,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SEQ,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPEC_PAIR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(COMM_LIST,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(STMT_STR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(EQUI_LIST,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(IMPL_TYPE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(STMTFN_DECL,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BIT_COMPLEMENT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(EXPR_IF,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(EXPR_IF_BODY,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FUNCTION_REF,"nodetext",'e',2,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(LSHIFT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RSHIFT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(UNARY_ADD_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SIZE_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(INTEGER_DIV_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SUB_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LE_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(GE_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(NE_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(CLASSINIT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CAST_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ADDRESS_OP,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(POINSTAT_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(COPY_NODE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(INIT_LIST,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(VECTOR_CONST,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BIT_NUMBER,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ARITH_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ARRAY_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(NEW_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DELETE_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(NAMELIST_LIST,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(INPORT_NAME,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(OUTPORT_NAME,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(FROMPORT_NAME,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(TOPORT_NAME,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(IOSTAT_STORE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(EMPTY_STORE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(ERR_LABEL,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(END_LABEL,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(DATA_IMPL_DO,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DATA_ELT,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DATA_SUBS,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DATA_RANGE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ICON_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
/* new tag for some expression */
|
||||
|
||||
DEFNODECODE(CEIL_DIV_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MAX_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BIF_SAVE_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MIN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BIF_ADDR_EXPR,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BIF_NOP_EXPR,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BIF_RTL_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TRUNC_MOD_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TRUNC_DIV_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FLOOR_DIV_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FLOOR_MOD_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CEIL_MOD_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ROUND_DIV_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ROUND_MOD_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RDIV_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(EXACT_DIV_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CONVERT_EXPR,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CONST_DECL,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ABS_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TRUTH_ANDIF_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TRUTH_AND_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TRUTH_NOT_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TRUTH_ORIF_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PREINCREMENT_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PREDECREMENT_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(COMPOUND_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FLOAT_EXPR,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BIT_IOR_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BIT_XOR_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(BIT_ANDTC_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TRUTH_OR_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FIX_TRUNC_EXPR,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RROTATE_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LROTATE_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RANGE_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(POSTDECREMENT_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(REFERENCE_TYPE,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FIX_FLOOR_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FIX_ROUND_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FIX_CEIL_EXPR ,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FUNCTION_DECL ,"nodetext",'d',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MODIFY_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(REFERENCE_EXPR,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RESULT_DECL,"nodetext",'d',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PARM_DECL,"nodetext",'d',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LEN_OP,"nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(THIS_NODE,"nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SCOPE_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PLUS_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MINUS_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(AND_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(IOR_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MULT_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DIV_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(MOD_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(XOR_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LSHIFT_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RSHIFT_ASSGN_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ARROWSTAR_OP,"nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DOTSTAR_OP, "nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(FORDECL_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OPERATOR_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ASSIGNMENT_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(KIND_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(LENGTH_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(RECURSIVE_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ELEMENTAL_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PURE_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
|
||||
/* DVM tags */
|
||||
DEFNODECODE(BLOCK_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(INDIRECT_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DERIVED_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(NEW_SPEC_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(REDUCTION_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SHADOW_RENEW_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SHADOW_START_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SHADOW_WAIT_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DIAG_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(REMOTE_ACCESS_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(TEMPLATE_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(PROCESSORS_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DYNAMIC_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ALIGN_OP, "nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DISTRIBUTE_OP, "nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SHADOW_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SHADOW_COMP_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(INDIRECT_ACCESS_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACROSS_OP, "nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(NEW_VALUE_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CONSISTENT_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(STAGE_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(COMMON_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_CALL_OP,"nodetext",'e',2,LLNODE, '_','_','s','_','_')
|
||||
DEFNODECODE(ACC_DEVICE_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_SHARED_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_CONSTANT_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_VALUE_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_HOST_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_GLOBAL_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_ATTRIBUTES_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_PRIVATE_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_CUDA_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_CUDA_BLOCK_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_PRIVATE_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_INOUT_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_IN_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_OUT_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_LOCAL_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_INLOCAL_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_TARGETS_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_ASYNC_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SHADOW_NAMES_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_TIE_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(ACC_CALL_STMT,"nodetext",'s',2,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(DVM_NEW_VALUE_DIR,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(ACC_ROUTINE_DIR,"nodetext",'s',1,BIFNODE, '_','_','_','_','_')
|
||||
|
||||
/* SAPFOR */
|
||||
DEFNODECODE(SPF_NOINLINE_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_FISSION_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_EXPAND_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_SHRINK_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_TYPE_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_VARLIST_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_EXCEPT_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_FILES_COUNT_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_INTERVAL_OP, "nodetext",'e',2,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_TIME_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_ITER_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_FLEXIBLE_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_PARAMETER_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_CODE_COVERAGE_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_UNROLL_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(SPF_ANALYSIS_DIR,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_PARALLEL_DIR,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_TRANSFORM_DIR,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_PARALLEL_REG_DIR,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_END_PARALLEL_REG_DIR,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(SPF_CHECKPOINT_DIR,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
|
||||
/* OpenMP Fortran tags */
|
||||
DEFNODECODE(OMP_NOWAIT, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_NUM_THREADS, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_IF, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_ORDERED, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_DEFAULT, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_SCHEDULE, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_PRIVATE, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_REDUCTION, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_FIRSTPRIVATE, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_LASTPRIVATE, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_SHARED, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_COPYIN, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_COPYPRIVATE, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_COLLAPSE, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_THREADPRIVATE, "nodetext",'e',0,LLNODE, '_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(OMP_PARALLEL_DIR,"nodetext",'s',0,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_PARALLEL_DIR,"nodetext",'s',0,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_DO_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_DO_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_SECTIONS_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_SECTIONS_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_SECTION_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_SINGLE_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_SINGLE_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_WORKSHARE_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_WORKSHARE_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_PARALLEL_DO_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_PARALLEL_DO_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_PARALLEL_SECTIONS_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_PARALLEL_SECTIONS_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_PARALLEL_WORKSHARE_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_PARALLEL_WORKSHARE_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_MASTER_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_MASTER_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_CRITICAL_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_CRITICAL_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_BARRIER_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_ATOMIC_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_FLUSH_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_ORDERED_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_END_ORDERED_DIR,"nodetext",'s',1,BIFNODE, 'e','_','_','_','_')
|
||||
DEFNODECODE(OMP_THREADPRIVATE_DIR, "nodetext",'d',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(RECORD_DECL,"nodetext",'d',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(FUNC_STAT,"nodetext",'d',0,BIFNODE, 'd','_','_','_','_')
|
||||
DEFNODECODE(POINTER_ASSIGN_STAT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(CYCLE_STMT,"nodetext",'s',0,BIFNODE, '_','_','_','_','_')
|
||||
DEFNODECODE(OMP_ONETHREAD_DIR,"nodetext",'s',1,BIFNODE, 'd','_','_','_','_')
|
||||
/*****************variant tags for symbol table entries********************/
|
||||
|
||||
DEFNODECODE(BIF_PARM_DECL,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(CONST_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(ENUM_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(FIELD_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(VARIABLE_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(TYPE_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(PROGRAM_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(PROCEDURE_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(PROCESS_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(VAR_FIELD,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(LABEL_VAR,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(FUNCTION_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(MEMBER_FUNC,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(CLASS_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(TECLASS_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(UNION_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(STRUCT_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(LABEL_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(COLLECTION_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(ROUTINE_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(CONSTRUCT_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(INTERFACE_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(MODULE_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(COMMON_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
DEFNODECODE(SPF_REGION_NAME,"nodetext",'r',0,SYMBNODE,'_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(DEFAULT,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_INT,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_FLOAT,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_DOUBLE,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_CHAR,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_BOOL,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_STRING,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_COMPLEX,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_DCOMPLEX,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_LONG,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(T_ENUM,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_SUBRANGE,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_LIST,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_ARRAY,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_RECORD,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_ENUM_FIELD,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_UNKNOWN,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_VOID,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_DESCRIPT,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_FUNCTION,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_POINTER,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_UNION,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_STRUCT,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_CLASS,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_TECLASS,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_DERIVED_CLASS,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_DERIVED_TYPE,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_COLLECTION,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_DERIVED_COLLECTION,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_MEMBER_POINTER,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_GATE,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_EVENT,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_SEQUENCE,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_DERIVED_TEMPLATE,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(T_REFERENCE,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
|
||||
DEFNODECODE(LOCAL,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(INPUT,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(OUTPUT,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
DEFNODECODE(IO,"nodetext",'t',0,TYPENODE,'_','_','_','_','_')
|
||||
|
||||
117
dvm/fdvm/trunk/Sage/lib/include/dependence.h
Normal file
117
dvm/fdvm/trunk/Sage/lib/include/dependence.h
Normal file
@@ -0,0 +1,117 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
|
||||
/* declaration for the dependencies computation and use in the toolbox */
|
||||
|
||||
/* on declare de macro d'acces aux dependence de donnee */
|
||||
|
||||
#define BIF_DEP_STRUCT1(NODE) ((NODE)->entry.Template.dep_ptr1)
|
||||
#define BIF_DEP_STRUCT2(NODE) ((NODE)->entry.Template.dep_ptr2)
|
||||
|
||||
#define FIRST_DEP_IN_PROJ(X) ((X)->head_dep)
|
||||
/* decription d'une dependance */
|
||||
|
||||
#define DEP_ID(DEP) ((DEP)->id)
|
||||
#define DEP_NEXT(DEP) ((DEP)->thread)
|
||||
#define DEP_TYPE(DEP) ((DEP)->type)
|
||||
#define DEP_DIRECTION(DEP) ((DEP)->direct)
|
||||
#define DEP_SYMB(DEP) ((DEP)->symbol)
|
||||
#define DEP_FROM_BIF(DEP) (((DEP)->from).stmt)
|
||||
#define DEP_FROM_LL(DEP) (((DEP)->from).refer)
|
||||
#define DEP_TO_BIF(DEP) (((DEP)->to).stmt)
|
||||
#define DEP_TO_LL(DEP) (((DEP)->to).refer)
|
||||
#define DEP_FROM_FWD(DEP) ((DEP)->from_fwd)
|
||||
#define DEP_FROM_BACK(DEP) ((DEP)->from_back)
|
||||
#define DEP_TO_FWD(DEP) ((DEP)->to_fwd)
|
||||
#define DEP_TO_BACK(DEP) ((DEP)->to_back)
|
||||
|
||||
|
||||
/* la forme normale de dependence de donnee est le vecteur de direction */
|
||||
|
||||
/* on rappel temporairement la forme des dep (sets.h)
|
||||
struct dep { data dependencies
|
||||
|
||||
int id; identification for reading/writing
|
||||
PTR_DEP thread;
|
||||
|
||||
char type; flow-, output-, or anti-dependence
|
||||
char direct[MAX_DEP]; direction/distance vector
|
||||
|
||||
PTR_SYMB symbol; symbol table entry
|
||||
struct ref from; tail of dependence
|
||||
struct ref to; head of dependence
|
||||
|
||||
PTR_DEP from_fwd, from_back; list of dependencies going to tail
|
||||
PTR_DEP to_fwd, to_back; list of dependencies going to head
|
||||
|
||||
} ;
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* pour la gestion memoire */
|
||||
struct chaining
|
||||
{
|
||||
char *zone;
|
||||
struct chaining *list;
|
||||
};
|
||||
|
||||
typedef struct chaining *ptchaining;
|
||||
|
||||
|
||||
struct stack_chaining
|
||||
{
|
||||
ptchaining first;
|
||||
ptchaining last;
|
||||
struct stack_chaining *prev;
|
||||
struct stack_chaining *next;
|
||||
int level;
|
||||
};
|
||||
|
||||
typedef struct stack_chaining *ptstack_chaining;
|
||||
|
||||
/* structure pour les graphes de dependence */
|
||||
#define MAXSUC 100
|
||||
|
||||
struct graph
|
||||
{
|
||||
int id; /* identificateur */
|
||||
int linenum;
|
||||
int mark;
|
||||
int order;
|
||||
PTR_BFND stmt;
|
||||
PTR_LLND expr;
|
||||
PTR_LLND from_expr[MAXSUC];
|
||||
PTR_LLND to_expr[MAXSUC];
|
||||
PTR_DEP dep_struct[MAXSUC];
|
||||
char *dep_vect[MAXSUC];
|
||||
char type[MAXSUC];
|
||||
struct graph *suc[MAXSUC]; /* next */
|
||||
struct graph *pred[MAXSUC]; /* next */
|
||||
struct graph *list; /* chaine les noeuds d'un graphe */
|
||||
};
|
||||
|
||||
typedef struct graph *PTR_GRAPH;
|
||||
|
||||
#define CHAIN_LIST(NODE) ((NODE)->list)
|
||||
#define GRAPH_ID(NODE) ((NODE)->id)
|
||||
#define GRAPH_ORDER(NODE) ((NODE)->order)
|
||||
#define GRAPH_MARK(NODE) ((NODE)->mark)
|
||||
#define GRAPH_LINE(NODE) ((NODE)->linenum)
|
||||
#define GRAPH_BIF(NODE) ((NODE)->stmt)
|
||||
#define GRAPH_LL(NODE) ((NODE)->expr)
|
||||
#define GRAPH_DEP(NODE) (((NODE)->dep_struct))
|
||||
#define GRAPH_VECT(NODE) (((NODE)->dep_vect))
|
||||
#define GRAPH_TYPE(NODE) ((NODE)->type)
|
||||
#define GRAPH_SUC(NODE) (((NODE)->suc))
|
||||
#define GRAPH_PRED(NODE) (((NODE)->pred))
|
||||
#define GRAPH_LL_FROM(NODE) (((NODE)->from_expr))
|
||||
#define GRAPH_LL_TO(NODE) (((NODE)->to_expr))
|
||||
|
||||
|
||||
#define NOT_ORDERED -1
|
||||
56
dvm/fdvm/trunk/Sage/lib/include/ext_ann.h
Normal file
56
dvm/fdvm/trunk/Sage/lib/include/ext_ann.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
extern char *Unparse_Annotation();
|
||||
extern PTR_LLND Parse_Annotation();
|
||||
extern Is_Annotation();
|
||||
extern Is_Annotation_Cont();
|
||||
extern char * Get_Annotation_String();
|
||||
extern char * Get_to_Next_Annotation_String();
|
||||
extern Init_Annotation();
|
||||
extern PTR_LLND Get_Define_Field();
|
||||
extern char * Get_Define_Label_Field();
|
||||
extern char * Get_Label_Field();
|
||||
extern PTR_LLND Get_ApplyTo_Field();
|
||||
extern PTR_LLND Get_ApplyToIf_Field();
|
||||
extern PTR_LLND Get_LocalVar_Field();
|
||||
extern PTR_LLND Get_Annotation_Field();
|
||||
extern char * Get_Annotation_Field_Label();
|
||||
extern char * Does_Annotation_Defines();
|
||||
extern int Set_The_Define_Field();
|
||||
extern int Get_Annotation_With_Label();
|
||||
extern Get_Scope_Of_Annotation();
|
||||
extern Propagate_defined_value();
|
||||
extern PTR_LLND Does_Annotation_Apply();
|
||||
extern PTR_LLND Get_Annotation_Field_List_For_Stmt();
|
||||
extern PTR_LLND Get_Annotation_List_For_Stmt();
|
||||
extern Get_Number_of_Annotation();
|
||||
extern PTR_BFND Get_Annotation_Bif();
|
||||
extern PTR_LLND Get_Annotation_Expr();
|
||||
extern char * Get_String_of_Annotation();
|
||||
extern PTR_CMNT Get_Annotation_Comment();
|
||||
extern int Is_Annotation_Defined();
|
||||
extern char * Annotation_Defines_string();
|
||||
extern int Annotation_Defines_string_Value();
|
||||
extern PTR_LLND Annotation_LLND[];
|
||||
extern PTR_TYPE global_int_annotation;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
29
dvm/fdvm/trunk/Sage/lib/include/ext_high.h
Normal file
29
dvm/fdvm/trunk/Sage/lib/include/ext_high.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
extern int tiling_p ();/*non implante, mais ne plante pas*/
|
||||
extern void tiling ();
|
||||
extern void strip_mining ();
|
||||
|
||||
extern PTR_BLOB Distribute_Loop ();
|
||||
extern PTR_BLOB Distribute_Loop_SCC ();
|
||||
extern Loop_Fusion ();
|
||||
extern Unroll_Loop ();
|
||||
extern Interchange_Loops ();
|
||||
|
||||
extern Compute_With_Maple ();
|
||||
extern Unimodular ();
|
||||
|
||||
extern Expand_Scalar ();
|
||||
extern PTR_BFND Scalar_Forward_Substitution ();
|
||||
|
||||
extern int Normalized ();
|
||||
extern Normalize_Loop ();
|
||||
|
||||
extern int Vectorize ();
|
||||
extern int Vectorize_Nest ();
|
||||
|
||||
extern Print_Property_For_Loop ();
|
||||
24
dvm/fdvm/trunk/Sage/lib/include/ext_lib.h
Normal file
24
dvm/fdvm/trunk/Sage/lib/include/ext_lib.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
|
||||
extern PTR_FILE cur_file;
|
||||
extern char *main_input_filename; /*not find in lib*/
|
||||
extern PTR_PROJ cur_proj; /* pointer to the project header */
|
||||
extern char *cunparse_bfnd();
|
||||
extern char *cunparse_llnd();
|
||||
extern char *funparse_bfnd();
|
||||
extern char *funparse_llnd();
|
||||
extern char *cunparse_blck();
|
||||
extern char *funparse_blck();
|
||||
extern PTR_SYMB Current_Proc_Graph_Symb; /*not find in lib*/
|
||||
|
||||
/*extern FILE *finput;
|
||||
extern FILE *outfile;*/
|
||||
|
||||
extern char node_code_type[];
|
||||
extern int node_code_length[];
|
||||
extern enum typenode node_code_kind[];
|
||||
268
dvm/fdvm/trunk/Sage/lib/include/ext_low.h
Normal file
268
dvm/fdvm/trunk/Sage/lib/include/ext_low.h
Normal file
@@ -0,0 +1,268 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/* DO NOT EDIT THIS FILE! */
|
||||
/* This file was automatically created by /u/sage/bin/mkCextern */
|
||||
/* Source file: /u/sage/project/sage/lib/newsrc/low_level.c */
|
||||
/* Created on Mon Jul 11 13:40:50 EST 1994 (phb) */
|
||||
extern POINTER newNode();
|
||||
extern PTR_BFND FindNearBifNode();
|
||||
extern PTR_BFND Get_Last_Node_Of_Project();
|
||||
extern PTR_BFND Get_bif_with_id();
|
||||
extern PTR_BFND GetcountInStmtNode1();
|
||||
extern PTR_BFND LibGetScopeForDeclare();
|
||||
extern PTR_BFND LibWhereIsSymbDeclare();
|
||||
extern PTR_BFND LibcreateCollectionWithType();
|
||||
extern PTR_BFND LibdeleteStmt();
|
||||
extern PTR_BFND LibextractStmt();
|
||||
extern PTR_BFND LibextractStmtBody();
|
||||
extern PTR_BFND LibfirstElementMethod();
|
||||
extern PTR_BFND LibgetInnermostLoop();
|
||||
extern PTR_BFND LibgetNextNestedLoop();
|
||||
extern PTR_BFND LibgetPreviousNestedLoop();
|
||||
extern PTR_BFND LiblastDeclaration();
|
||||
extern PTR_BFND LocalRedoBifNextChain();
|
||||
extern PTR_BFND Redo_Bif_Next_Chain_Internal();
|
||||
extern PTR_BFND childfInBlobList();
|
||||
extern PTR_BFND computeControlParent();
|
||||
extern PTR_BFND deleteBfnd();
|
||||
extern PTR_BFND deleteBfndFromBlobAndLabel();
|
||||
extern PTR_BFND duplicateOneStmt();
|
||||
extern PTR_BFND duplicateStmts();
|
||||
extern PTR_BFND duplicateStmtsBlock();
|
||||
extern PTR_BFND duplicateStmtsNoExtract();
|
||||
extern PTR_BFND extractBifSectionBetween();
|
||||
extern PTR_BFND getBodyOfSymb();
|
||||
extern PTR_BFND getFirstStmt();
|
||||
extern PTR_BFND getFuncScope();
|
||||
extern PTR_BFND getFunctionHeader();
|
||||
extern PTR_BFND getFunctionHeaderAllFile();
|
||||
extern PTR_BFND getFunctionNumHeader();
|
||||
extern PTR_BFND getGlobalFunctionHeader();
|
||||
extern PTR_BFND getLastNodeList();
|
||||
extern PTR_BFND getLastNodeOfStmt();
|
||||
extern PTR_BFND getLastNodeOfStmtNoControlEnd();
|
||||
extern PTR_BFND getMainProgram();
|
||||
extern PTR_BFND getNodeBefore();
|
||||
extern PTR_BFND getObjectStmt();
|
||||
extern PTR_BFND getScopeForLabel();
|
||||
extern PTR_BFND getStatementNumber();
|
||||
extern PTR_BFND getStructNumHeader();
|
||||
extern PTR_BFND getWhereToInsertInBfnd();
|
||||
extern PTR_BFND lastBifInBlobList();
|
||||
extern PTR_BFND lastBifInBlobList1();
|
||||
extern PTR_BFND lastBifInBlobList2();
|
||||
extern PTR_BFND makeDeclStmt();
|
||||
extern PTR_BFND makeDeclStmtWPar();
|
||||
extern PTR_BFND rec_num_near_search();
|
||||
extern PTR_BLOB appendBlob();
|
||||
extern PTR_BLOB deleteBfndFrom();
|
||||
extern PTR_BLOB getLabelUDChain();
|
||||
extern PTR_BLOB lastBlobInBlobList();
|
||||
extern PTR_BLOB lastBlobInBlobList1();
|
||||
extern PTR_BLOB lastBlobInBlobList2();
|
||||
extern PTR_BLOB lookForBifInBlobList();
|
||||
extern PTR_CMNT Get_cmnt_with_id();
|
||||
extern PTR_FILE GetFileWithNum();
|
||||
extern PTR_FILE GetPointerOnFile();
|
||||
extern PTR_LABEL Get_label_with_id();
|
||||
extern PTR_LABEL getLastLabel();
|
||||
extern PTR_LLND Follow_Llnd();
|
||||
extern PTR_LLND Follow_Llnd0();
|
||||
extern PTR_LLND Get_First_Parameter_For_Call();
|
||||
extern PTR_LLND Get_Second_Parameter_For_Call();
|
||||
extern PTR_LLND Get_Th_Parameter_For_Call();
|
||||
extern PTR_LLND Get_ll_with_id();
|
||||
extern PTR_LLND LibIsSymbolInExpression();
|
||||
extern PTR_LLND LibarrayRefs();
|
||||
extern PTR_LLND LibsymbRefs();
|
||||
extern PTR_LLND Make_Function_Call();
|
||||
extern PTR_LLND addLabelRefToExprList();
|
||||
extern PTR_LLND addSymbRefToExprList();
|
||||
extern PTR_LLND addToExprList();
|
||||
extern PTR_LLND addToList();
|
||||
extern PTR_LLND copyLlNode();
|
||||
extern PTR_LLND deleteNodeInExprList();
|
||||
extern PTR_LLND deleteNodeWithItemInExprList();
|
||||
extern PTR_LLND findPtrRefExp();
|
||||
extern PTR_LLND getPositionInExprList();
|
||||
extern PTR_LLND getPositionInList();
|
||||
extern PTR_LLND giveLlSymbInDeclList();
|
||||
extern PTR_LLND makeDeclExp();
|
||||
extern PTR_LLND makeDeclExpWPar();
|
||||
extern PTR_LLND makeInt();
|
||||
extern PTR_LLND newExpr();
|
||||
extern PTR_SYMB GetThOfFieldList();
|
||||
extern PTR_SYMB GetThOfFieldListForType();
|
||||
extern PTR_SYMB GetThParam();
|
||||
extern PTR_SYMB Get_Symb_with_id();
|
||||
extern PTR_SYMB doesClassInherit();
|
||||
extern PTR_SYMB duplicateParamList();
|
||||
extern PTR_SYMB duplicateSymbol();
|
||||
extern PTR_SYMB duplicateSymbolAcrossFiles();
|
||||
extern PTR_SYMB duplicateSymbolLevel1();
|
||||
extern PTR_SYMB duplicateSymbolLevel2();
|
||||
extern PTR_SYMB getClassNextFieldOrMember();
|
||||
extern PTR_SYMB getFieldOfStructWithName();
|
||||
extern PTR_SYMB getFirstFieldOfStruct();
|
||||
extern PTR_SYMB getSymbolWithName();
|
||||
extern PTR_SYMB getSymbolWithNameInScope();
|
||||
extern PTR_SYMB lookForNameInParamList();
|
||||
extern PTR_SYMB newSymbol();
|
||||
extern PTR_TYPE FollowTypeBaseAndDerived();
|
||||
extern PTR_TYPE GetAtomicType();
|
||||
extern PTR_TYPE Get_type_with_id();
|
||||
extern PTR_TYPE addToBaseTypeList();
|
||||
extern PTR_TYPE createDerivedCollectionType();
|
||||
extern PTR_TYPE duplicateType();
|
||||
extern PTR_TYPE duplicateTypeAcrossFiles();
|
||||
extern PTR_TYPE getDerivedTypeWithName();
|
||||
extern PTR_TYPE lookForInternalBasetype();
|
||||
extern PTR_TYPE lookForTypeDescript();
|
||||
extern char *allocateFreeListNodeExpression();
|
||||
extern char* Get_Function_Name_For_Call();
|
||||
extern char* Remove_Carriage_Return();
|
||||
extern char* UnparseTypeBuffer();
|
||||
extern char* filter();
|
||||
extern char* mymalloc();
|
||||
extern char* xmalloc();
|
||||
extern int Apply_To_Bif();
|
||||
extern int Check_Lang_C();
|
||||
extern int Check_Lang_Fortran();
|
||||
extern int GetFileNum();
|
||||
extern int GetFileNumWithPt();
|
||||
extern int Init_Tool_Box();
|
||||
extern int IsRefToSymb();
|
||||
extern int Is_String_Val_With_Val();
|
||||
extern int LibClanguage();
|
||||
extern int LibFortranlanguage();
|
||||
extern int LibIsSymbolInScope();
|
||||
extern int LibIsSymbolReferenced();
|
||||
extern int LibisEnddoLoop();
|
||||
extern int LibisMethodOfElement();
|
||||
extern int LibnumberOfFiles();
|
||||
extern int LibperfectlyNested();
|
||||
extern void Message();
|
||||
extern int Replace_String_In_Expression();
|
||||
extern int appendBfndListToList1();
|
||||
extern int appendBfndListToList2();
|
||||
extern int appendBfndToList();
|
||||
extern int appendBfndToList1();
|
||||
extern int appendBfndToList2();
|
||||
extern int arraySymbol();
|
||||
extern int blobListLength();
|
||||
extern int buildLinearRep();
|
||||
extern int buildLinearRepSign();
|
||||
extern int convertToEnddoLoop();
|
||||
extern int countInStmtNode1();
|
||||
extern int countInStmtNode2();
|
||||
extern int exprListLength();
|
||||
extern int findBif();
|
||||
extern int findBifInList1();
|
||||
extern int findBifInList2();
|
||||
extern int firstBfndInList1();
|
||||
extern int firstBfndInList2();
|
||||
extern int firstInBfndList2();
|
||||
extern int getElementEvaluate();
|
||||
extern int getLastLabelId();
|
||||
extern int getNumberOfFunction();
|
||||
extern int getNumberOfStruct();
|
||||
extern int getTypeNumDimension();
|
||||
extern int hasNodeASymb();
|
||||
extern int hasTypeBaseType();
|
||||
extern int hasTypeSymbol();
|
||||
extern int inScope();
|
||||
extern int insertBfndInList1();
|
||||
extern int insertBfndInList2();
|
||||
extern int insertBfndListIn();
|
||||
extern int insertBfndListInList1();
|
||||
extern int isABifNode();
|
||||
extern int isAControlEnd();
|
||||
extern int isADeclBif();
|
||||
extern int isAEnumDeclBif();
|
||||
extern int isALoNode();
|
||||
extern int isAStructDeclBif();
|
||||
extern int isASymbNode();
|
||||
extern int isATypeNode();
|
||||
extern int isAUnionDeclBif();
|
||||
extern int isAtomicType();
|
||||
extern int isElementType();
|
||||
extern int isEnumType();
|
||||
extern int isInStmt();
|
||||
extern int isIntegerType();
|
||||
extern int isItInSection();
|
||||
extern int isNodeAConst();
|
||||
extern int isPointerType();
|
||||
extern int isStructType();
|
||||
extern int isTypeEquivalent();
|
||||
extern int isUnionType();
|
||||
extern int lenghtOfFieldList();
|
||||
extern int lenghtOfFieldListForType();
|
||||
extern int lenghtOfParamList();
|
||||
extern int localToFunction();
|
||||
extern int lookForTypeInType();
|
||||
extern int makeLinearExpr();
|
||||
extern int makeLinearExpr_Sign();
|
||||
extern int numberOfBifsInBlobList();
|
||||
extern int open_proj_toolbox();
|
||||
extern int open_proj_files_toolbox();
|
||||
extern int patternMatchExpression();
|
||||
extern int pointerType();
|
||||
extern int replaceTypeInType();
|
||||
extern int sameName();
|
||||
extern int* evaluateExpression();
|
||||
extern void Count_Bif_Next_Chain();
|
||||
extern void LibAddComment();
|
||||
extern void LibSetAllComments();
|
||||
extern void LibconvertLogicIf();
|
||||
extern void LibreplaceSymbByExp();
|
||||
extern void LibreplaceSymbByExpInStmts();
|
||||
extern void LibreplaceWithStmt();
|
||||
extern void LibsaveDepFile();
|
||||
extern void Redo_Bif_Next_Chain();
|
||||
extern void Reset_Bif_Next();
|
||||
extern void Reset_Bif_Next_Chain();
|
||||
extern void Reset_Tool_Box();
|
||||
extern void SetCurrentFileTo();
|
||||
extern void UnparseBif();
|
||||
extern void UnparseLLND();
|
||||
extern void UnparseProgram();
|
||||
extern void addControlEndToList2();
|
||||
extern void addControlEndToStmt();
|
||||
extern void addElementEvaluate();
|
||||
extern void addSymbToFieldList();
|
||||
extern void allocateValueEvaluate();
|
||||
extern void appendSymbToArgList();
|
||||
extern void declareAVar();
|
||||
extern void declareAVarWPar();
|
||||
extern void duplicateAllSymbolDeclaredInStmt();
|
||||
extern void insertBfndBeforeIn();
|
||||
extern void insertSymbInArgList();
|
||||
extern void libFreeExpression();
|
||||
extern void make_a_malloc_stack();
|
||||
extern void myfree();
|
||||
extern void replaceSymbInExpression();
|
||||
extern void replaceSymbInExpressionSameName();
|
||||
extern void replaceSymbInStmts();
|
||||
extern void replaceSymbInStmtsSameName();
|
||||
extern void replaceTypeForSymb();
|
||||
extern void replaceTypeInExpression();
|
||||
extern void replaceTypeInStmts();
|
||||
extern void replaceTypeUsedInStmt();
|
||||
extern void resetDoVarForSymb();
|
||||
extern void resetFreeListForExpressionNode();
|
||||
extern void resetPresetEvaluate();
|
||||
extern void setFreeListForExpressionNode();
|
||||
extern void updateControlParent();
|
||||
extern void updateTypesAndSymbolsInBody();
|
||||
extern void writeDepFileInDebugdep();
|
||||
extern void updateTypeAndSymbolInStmts();
|
||||
extern void updateTypesAndSymbolsInBodyOfRoutine();
|
||||
extern PTR_SYMB duplicateSymbolOfRoutine();
|
||||
extern char* UnparseBif_Char();
|
||||
extern void UnparseProgram_ThroughAllocBuffer();
|
||||
|
||||
|
||||
64
dvm/fdvm/trunk/Sage/lib/include/ext_mid.h
Normal file
64
dvm/fdvm/trunk/Sage/lib/include/ext_mid.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
extern PTR_BFND Make_For_Loop ();
|
||||
extern PTR_LLND Loop_Set_Borne_Inf ();
|
||||
extern PTR_LLND Loop_Set_Borne_Sup ();
|
||||
extern PTR_LLND Loop_Set_Step ();
|
||||
extern PTR_SYMB Loop_Set_Index ();
|
||||
extern PTR_LLND Loop_Get_Borne_Inf ();
|
||||
extern PTR_LLND Loop_Get_Borne_Sup ();
|
||||
extern PTR_LLND Loop_Get_Step ();
|
||||
extern PTR_SYMB Loop_Get_Index ();
|
||||
|
||||
extern PTR_BFND Get_Scope_For_Declare ();
|
||||
extern PTR_BFND Get_Scope_For_Label ();
|
||||
|
||||
extern PTR_LLND Make_Array_Ref ();
|
||||
extern PTR_LLND Make_Array_Ref_With_Tab ();
|
||||
extern PTR_BFND Declare_Array ();
|
||||
|
||||
extern PTR_BFND Make_Procedure ();
|
||||
extern PTR_LLND Make_Function_Call ();
|
||||
extern PTR_LLND Make_Function_Call_bis ();
|
||||
extern PTR_BFND Make_Procedure_Call ();
|
||||
|
||||
extern PTR_LLND Make_Linear_Expression ();
|
||||
extern PTR_LLND Make_Linear_Expression_From_Int ();
|
||||
extern PTR_LLND Make_Linear_Expression_From_Int_List ();
|
||||
|
||||
extern PTR_BFND Make_Assign ();
|
||||
extern PTR_BFND Make_If_Then_Else ();
|
||||
extern int Declare_Scalar ();
|
||||
extern int Perfectly_Nested ();
|
||||
extern int Is_Good_Loop ();
|
||||
|
||||
extern PTR_BFND Extract_Loop_Body ();
|
||||
extern PTR_BFND Get_Next_Nested_Loop ();
|
||||
extern PTR_BFND Get_Internal_Loop ();
|
||||
extern PTR_BFND Get_Previous_Nested_Loop ();
|
||||
|
||||
extern PTR_BLOB Get_Label_UD_chain ();
|
||||
|
||||
extern int Convert_Loop ();
|
||||
extern int Loop_Conversion ();
|
||||
|
||||
extern PTR_SYMB Generate_Variable_Name ();
|
||||
extern PTR_SYMB Install_Variable ();
|
||||
|
||||
extern int Verif_No_Func ();
|
||||
extern int Verif_Assign ();
|
||||
extern int Verif_Assign_If ();
|
||||
|
||||
extern int Generate_Alternative_Code ();
|
||||
extern void Localize_Array_Section ();
|
||||
|
||||
extern int Check_Index ();
|
||||
extern int Check_Right_Assign ();
|
||||
extern int Check_Left_Assign ();
|
||||
extern int No_Dependent_Index ();
|
||||
extern int No_Basic_Induction ();
|
||||
extern int No_Def_Of_Induction ();
|
||||
271
dvm/fdvm/trunk/Sage/lib/include/extcxx_low.h
Normal file
271
dvm/fdvm/trunk/Sage/lib/include/extcxx_low.h
Normal file
@@ -0,0 +1,271 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/* DO NOT EDIT THIS FILE! */
|
||||
/* This file was automatically created by /u/sage/bin/mkC++extern */
|
||||
/* Source file: /u/sage/project/sage/lib/newsrc/low_level.c */
|
||||
/* Created on Tue Jul 12 12:46:22 EST 1994 (phb) */
|
||||
extern "C" {
|
||||
POINTER newNode(...);
|
||||
PTR_BFND FindNearBifNode(...);
|
||||
PTR_BFND Get_Last_Node_Of_Project(...);
|
||||
PTR_BFND Get_bif_with_id(...);
|
||||
PTR_BFND GetcountInStmtNode1(...);
|
||||
PTR_BFND LibGetScopeForDeclare(...);
|
||||
PTR_BFND LibWhereIsSymbDeclare(...);
|
||||
PTR_BFND LibcreateCollectionWithType(...);
|
||||
PTR_BFND LibdeleteStmt(...);
|
||||
PTR_BFND LibextractStmt(...);
|
||||
PTR_BFND LibextractStmtBody(...);
|
||||
PTR_BFND LibfirstElementMethod(...);
|
||||
PTR_BFND LibgetInnermostLoop(...);
|
||||
PTR_BFND LibgetNextNestedLoop(...);
|
||||
PTR_BFND LibgetPreviousNestedLoop(...);
|
||||
PTR_BFND LiblastDeclaration(...);
|
||||
PTR_BFND LocalRedoBifNextChain(...);
|
||||
PTR_BFND Redo_Bif_Next_Chain_Internal(...);
|
||||
PTR_BFND childfInBlobList(...);
|
||||
PTR_BFND computeControlParent(...);
|
||||
PTR_BFND deleteBfnd(...);
|
||||
PTR_BFND deleteBfndFromBlobAndLabel(...);
|
||||
PTR_BFND duplicateOneStmt(...);
|
||||
PTR_BFND duplicateStmts(...);
|
||||
PTR_BFND duplicateStmtsBlock(...);
|
||||
PTR_BFND duplicateStmtsNoExtract(...);
|
||||
PTR_BFND extractBifSectionBetween(...);
|
||||
PTR_BFND getBodyOfSymb(...);
|
||||
PTR_BFND getFirstStmt(...);
|
||||
PTR_BFND getFuncScope(...);
|
||||
PTR_BFND getFunctionHeader(...);
|
||||
PTR_BFND getFunctionHeaderAllFile(...);
|
||||
PTR_BFND getFunctionNumHeader(...);
|
||||
PTR_BFND getGlobalFunctionHeader(...);
|
||||
PTR_BFND getLastNodeList(...);
|
||||
PTR_BFND getLastNodeOfStmt(...);
|
||||
PTR_BFND getLastNodeOfStmtNoControlEnd(...);
|
||||
PTR_BFND getMainProgram(...);
|
||||
PTR_BFND getNodeBefore(...);
|
||||
PTR_BFND getObjectStmt(...);
|
||||
PTR_BFND getScopeForLabel(...);
|
||||
PTR_BFND getStatementNumber(...);
|
||||
PTR_BFND getStructNumHeader(...);
|
||||
PTR_BFND getWhereToInsertInBfnd(...);
|
||||
PTR_BFND lastBifInBlobList(...);
|
||||
PTR_BFND lastBifInBlobList1(...);
|
||||
PTR_BFND lastBifInBlobList2(...);
|
||||
PTR_BFND makeDeclStmt(...);
|
||||
PTR_BFND makeDeclStmtWPar(...);
|
||||
PTR_BFND rec_num_near_search(...);
|
||||
PTR_BLOB appendBlob(...);
|
||||
PTR_BLOB deleteBfndFrom(...);
|
||||
PTR_BLOB getLabelUDChain(...);
|
||||
PTR_BLOB lastBlobInBlobList(...);
|
||||
PTR_BLOB lastBlobInBlobList1(...);
|
||||
PTR_BLOB lastBlobInBlobList2(...);
|
||||
PTR_BLOB lookForBifInBlobList(...);
|
||||
PTR_CMNT Get_cmnt_with_id(...);
|
||||
PTR_FILE GetFileWithNum(...);
|
||||
PTR_FILE GetPointerOnFile(...);
|
||||
PTR_LABEL Get_label_with_id(...);
|
||||
PTR_LABEL getLastLabel(...);
|
||||
PTR_LLND Follow_Llnd(...);
|
||||
PTR_LLND Follow_Llnd0(...);
|
||||
PTR_LLND Get_First_Parameter_For_Call(...);
|
||||
PTR_LLND Get_Second_Parameter_For_Call(...);
|
||||
PTR_LLND Get_Th_Parameter_For_Call(...);
|
||||
PTR_LLND Get_ll_with_id(...);
|
||||
PTR_LLND LibIsSymbolInExpression(...);
|
||||
PTR_LLND LibarrayRefs(...);
|
||||
PTR_LLND LibsymbRefs(...);
|
||||
PTR_LLND Make_Function_Call(...);
|
||||
PTR_LLND addLabelRefToExprList(...);
|
||||
PTR_LLND addSymbRefToExprList(...);
|
||||
PTR_LLND addToExprList(...);
|
||||
PTR_LLND addToList(...);
|
||||
PTR_LLND copyLlNode(...);
|
||||
PTR_LLND deleteNodeInExprList(...);
|
||||
PTR_LLND deleteNodeWithItemInExprList(...);
|
||||
PTR_LLND findPtrRefExp(...);
|
||||
PTR_LLND getPositionInExprList(...);
|
||||
PTR_LLND getPositionInList(...);
|
||||
PTR_LLND giveLlSymbInDeclList(...);
|
||||
PTR_LLND makeDeclExp(...);
|
||||
PTR_LLND makeDeclExpWPar(...);
|
||||
PTR_LLND makeInt(...);
|
||||
PTR_LLND newExpr(...);
|
||||
PTR_SYMB GetThOfFieldList(...);
|
||||
PTR_SYMB GetThOfFieldListForType(...);
|
||||
PTR_SYMB GetThParam(...);
|
||||
PTR_SYMB Get_Symb_with_id(...);
|
||||
PTR_SYMB doesClassInherit(...);
|
||||
PTR_SYMB duplicateParamList(...);
|
||||
PTR_SYMB duplicateSymbol(...);
|
||||
PTR_SYMB duplicateSymbolAcrossFiles(...);
|
||||
PTR_SYMB duplicateSymbolLevel1(...);
|
||||
PTR_SYMB duplicateSymbolLevel2(...);
|
||||
PTR_SYMB getClassNextFieldOrMember(...);
|
||||
PTR_SYMB getFieldOfStructWithName(...);
|
||||
PTR_SYMB getFirstFieldOfStruct(...);
|
||||
PTR_SYMB getSymbolWithName(...);
|
||||
PTR_SYMB getSymbolWithNameInScope(...);
|
||||
PTR_SYMB lookForNameInParamList(...);
|
||||
PTR_SYMB newSymbol(...);
|
||||
PTR_SYMB duplicateSymbolOfRoutine(...);
|
||||
PTR_TYPE FollowTypeBaseAndDerived(...);
|
||||
PTR_TYPE GetAtomicType(...);
|
||||
PTR_TYPE Get_type_with_id(...);
|
||||
PTR_TYPE addToBaseTypeList(...);
|
||||
PTR_TYPE createDerivedCollectionType(...);
|
||||
PTR_TYPE duplicateType(...);
|
||||
PTR_TYPE duplicateTypeAcrossFiles(...);
|
||||
PTR_TYPE getDerivedTypeWithName(...);
|
||||
PTR_TYPE lookForInternalBasetype(...);
|
||||
PTR_TYPE lookForTypeDescript(...);
|
||||
char *allocateFreeListNodeExpression(...);
|
||||
char* Get_Function_Name_For_Call(...);
|
||||
char* Remove_Carriage_Return(...);
|
||||
char* UnparseTypeBuffer(...);
|
||||
char* filter(...);
|
||||
char* mymalloc(...);
|
||||
char* xmalloc(...);
|
||||
int Apply_To_Bif(...);
|
||||
int Check_Lang_C(...);
|
||||
int Check_Lang_Fortran(...);
|
||||
int GetFileNum(...);
|
||||
int GetFileNumWithPt(...);
|
||||
int Init_Tool_Box(...);
|
||||
int IsRefToSymb(...);
|
||||
int Is_String_Val_With_Val(...);
|
||||
int LibClanguage(...);
|
||||
int LibFortranlanguage(...);
|
||||
int LibIsSymbolInScope(...);
|
||||
int LibIsSymbolReferenced(...);
|
||||
int LibisEnddoLoop(...);
|
||||
int LibisMethodOfElement(...);
|
||||
int LibnumberOfFiles(...);
|
||||
int LibperfectlyNested(...);
|
||||
int Message(...);
|
||||
int Replace_String_In_Expression(...);
|
||||
int appendBfndListToList1(...);
|
||||
int appendBfndListToList2(...);
|
||||
int appendBfndToList(...);
|
||||
int appendBfndToList1(...);
|
||||
int appendBfndToList2(...);
|
||||
int arraySymbol(...);
|
||||
int blobListLength(...);
|
||||
int buildLinearRep(...);
|
||||
int buildLinearRepSign(...);
|
||||
int convertToEnddoLoop(...);
|
||||
int countInStmtNode1(...);
|
||||
int countInStmtNode2(...);
|
||||
int exprListLength(...);
|
||||
int findBif(...);
|
||||
int findBifInList1(...);
|
||||
int findBifInList2(...);
|
||||
int firstBfndInList1(...);
|
||||
int firstBfndInList2(...);
|
||||
int firstInBfndList2(...);
|
||||
int getElementEvaluate(...);
|
||||
int getLastLabelId(...);
|
||||
int getNumberOfFunction(...);
|
||||
int getNumberOfStruct(...);
|
||||
int getTypeNumDimension(...);
|
||||
int hasNodeASymb(...);
|
||||
int hasTypeBaseType(...);
|
||||
int hasTypeSymbol(...);
|
||||
int inScope(...);
|
||||
int insertBfndInList1(...);
|
||||
int insertBfndInList2(...);
|
||||
int insertBfndListIn(...);
|
||||
int insertBfndListInList1(...);
|
||||
int isABifNode(...);
|
||||
int isAControlEnd(...);
|
||||
int isADeclBif(...);
|
||||
int isAEnumDeclBif(...);
|
||||
int isALoNode(...);
|
||||
int isAStructDeclBif(...);
|
||||
int isASymbNode(...);
|
||||
int isATypeNode(...);
|
||||
int isAUnionDeclBif(...);
|
||||
int isAtomicType(...);
|
||||
int isElementType(...);
|
||||
int isEnumType(...);
|
||||
int isInStmt(...);
|
||||
int isIntegerType(...);
|
||||
int isItInSection(...);
|
||||
int isNodeAConst(...);
|
||||
int isPointerType(...);
|
||||
int isStructType(...);
|
||||
int isTypeEquivalent(...);
|
||||
int isUnionType(...);
|
||||
int lenghtOfFieldList(...);
|
||||
int lenghtOfFieldListForType(...);
|
||||
int lenghtOfParamList(...);
|
||||
int localToFunction(...);
|
||||
int lookForTypeInType(...);
|
||||
int makeLinearExpr(...);
|
||||
int makeLinearExpr_Sign(...);
|
||||
int numberOfBifsInBlobList(...);
|
||||
int open_proj_toolbox(...);
|
||||
int open_proj_files_toolbox(...);
|
||||
int patternMatchExpression(...);
|
||||
int pointerType(...);
|
||||
int replaceTypeInType(...);
|
||||
int sameName(...);
|
||||
int* evaluateExpression(...);
|
||||
void Count_Bif_Next_Chain(...);
|
||||
void LibAddComment(...);
|
||||
void LibSetAllComments(...);
|
||||
//Kolganov 15.11.2017
|
||||
void LibDelAllComments(...);
|
||||
void LibconvertLogicIf(...);
|
||||
void LibreplaceSymbByExp(...);
|
||||
void LibreplaceSymbByExpInStmts(...);
|
||||
void LibreplaceWithStmt(...);
|
||||
void LibsaveDepFile(...);
|
||||
void Redo_Bif_Next_Chain(...);
|
||||
void Reset_Bif_Next(...);
|
||||
void Reset_Bif_Next_Chain(...);
|
||||
void Reset_Tool_Box(...);
|
||||
void SetCurrentFileTo(...);
|
||||
void UnparseBif(...);
|
||||
void UnparseLLND(...);
|
||||
void UnparseProgram(...);
|
||||
void addControlEndToList2(...);
|
||||
void addControlEndToStmt(...);
|
||||
void addElementEvaluate(...);
|
||||
void addSymbToFieldList(...);
|
||||
void allocateValueEvaluate(...);
|
||||
void appendSymbToArgList(...);
|
||||
void declareAVar(...);
|
||||
void declareAVarWPar(...);
|
||||
void duplicateAllSymbolDeclaredInStmt(...);
|
||||
void insertBfndBeforeIn(...);
|
||||
void insertSymbInArgList(...);
|
||||
void libFreeExpression(...);
|
||||
void make_a_malloc_stack(...);
|
||||
void myfree(...);
|
||||
void replaceSymbInExpression(...);
|
||||
void replaceSymbInExpressionSameName(...);
|
||||
void replaceSymbInStmts(...);
|
||||
void replaceSymbInStmtsSameName(...);
|
||||
void replaceTypeForSymb(...);
|
||||
void replaceTypeInExpression(...);
|
||||
void replaceTypeInStmts(...);
|
||||
void replaceTypeUsedInStmt(...);
|
||||
void resetDoVarForSymb(...);
|
||||
void resetFreeListForExpressionNode(...);
|
||||
void resetPresetEvaluate(...);
|
||||
void setFreeListForExpressionNode(...);
|
||||
void updateControlParent(...);
|
||||
void updateTypesAndSymbolsInBody(...);
|
||||
void writeDepFileInDebugdep(...);
|
||||
void updateTypeAndSymbolInStmts(...);
|
||||
void updateTypesAndSymbolsInBodyOfRoutine(...);
|
||||
char* UnparseBif_Char(...);
|
||||
char *UnparseLLND_Char(...);
|
||||
void UnparseProgram_ThroughAllocBuffer(...);
|
||||
}
|
||||
9902
dvm/fdvm/trunk/Sage/lib/include/libSage++.h
Normal file
9902
dvm/fdvm/trunk/Sage/lib/include/libSage++.h
Normal file
File diff suppressed because it is too large
Load Diff
434
dvm/fdvm/trunk/Sage/lib/include/macro.h
Normal file
434
dvm/fdvm/trunk/Sage/lib/include/macro.h
Normal file
@@ -0,0 +1,434 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/* declaration pour la toolbox 19/12/91 */
|
||||
|
||||
/* The following include files are sigma include files */
|
||||
#include "defs.h"
|
||||
#include "bif.h"
|
||||
#include "ll.h"
|
||||
#include "symb.h"
|
||||
#include "sets.h"
|
||||
#include "db.h"
|
||||
#include "vparse.h"
|
||||
|
||||
#ifdef CPLUS_
|
||||
extern "C" PTR_FILE pointer_on_file_proj;
|
||||
#else
|
||||
extern PTR_FILE pointer_on_file_proj;
|
||||
#endif
|
||||
/* the following are names of constants used by the C parser to */
|
||||
/* add attributed to symbol table entries. */
|
||||
/* For symbptr->attr access with SYMB_ATTR(..) */
|
||||
/* note these are ALSO IN FILE vpc.h and we should find a single spot for them!! */
|
||||
#define ATT_CLUSTER 0
|
||||
#define ATT_GLOBAL 1
|
||||
#define PURE 8
|
||||
#define PRIVATE_FIELD 16
|
||||
#define PROTECTED_FIELD 32
|
||||
#define PUBLIC_FIELD 64
|
||||
#define ELEMENT_FIELD 128
|
||||
#define COLLECTION_FIELD 256
|
||||
#define CONSTRUCTOR 512
|
||||
#define DESTRUCTOR 1024
|
||||
#define PCPLUSPLUS_DOSUBSET 2048
|
||||
#define INVALID 4096
|
||||
#define SUBCOLLECTION 4096*2
|
||||
#define OVOPERATOR 4096*4
|
||||
|
||||
|
||||
/*
|
||||
* There are 3 types of macros:
|
||||
* the first type deals with bif nodes and are named BIF_XXX
|
||||
* the second type deals with symbol nodes and are named SYMB_XXX
|
||||
* the last type deasl with low level nodes and are named NODE_XXX
|
||||
*/
|
||||
|
||||
/* Macros for BIF NODE */
|
||||
#define DECL_SOURCE_LINE(FUNC) ((FUNC)->g_line)
|
||||
#define DECL_SOURCE_FILE(FUNC) (default_filename)
|
||||
/* give the code of a node */
|
||||
#define BIF_CODE(NODE) ((NODE)->variant)
|
||||
#define BIF_LINE(NODE) ((NODE)->g_line)
|
||||
#define BIF_LOCAL_LINE(NODE) ((NODE)->l_line)
|
||||
#define BIF_DECL_SPECS(NODE) ((NODE)->decl_specs)
|
||||
#define BIF_INDEX(NODE) ((NODE)->index)
|
||||
/* give the identifier */
|
||||
#define BIF_ID(NODE) ((NODE)->id)
|
||||
#define BIF_NEXT(NODE) ((NODE)->thread)
|
||||
#define BIF_CP(NODE) ((NODE)->control_parent)
|
||||
#define BIF_LABEL(NODE) ((NODE)->label)
|
||||
#define BIF_LL1(NODE) ((NODE)->entry.Template.ll_ptr1)
|
||||
#define BIF_LL2(NODE) ((NODE)->entry.Template.ll_ptr2)
|
||||
#define BIF_LL3(NODE) ((NODE)->entry.Template.ll_ptr3)
|
||||
#define BIF_SYMB(NODE) ((NODE)->entry.Template.symbol)
|
||||
#define BIF_BLOB1(NODE) ((NODE)->entry.Template.bl_ptr1)
|
||||
#define BIF_BLOB2(NODE) ((NODE)->entry.Template.bl_ptr2)
|
||||
#define BIF_FLOW(NODE) ((NODE)->entry.Template.bl_ptr1->ref)
|
||||
#define BIF_FLOW_TRUE(NODE) ((NODE)->entry.Template.bl_ptr1->ref)
|
||||
#define BIF_FLOW_FALSE_EXIST(NODE) ((NODE)->entry.Template.bl_ptr2)
|
||||
#define BIF_FLOW_FALSE(NODE) ((NODE)->entry.Template.bl_ptr2->ref)
|
||||
#define BIF_FILE_NAME(NODE) ((NODE)->filename)
|
||||
#define BIF_CMNT(NODE) ((NODE)->entry.Template.cmnt_ptr)
|
||||
#define BIF_LABEL_USE(NODE) ((NODE)->entry.Template.lbl_ptr)
|
||||
#define BIF_SETS(NODE) ((NODE)->entry.Template.sets)
|
||||
#define BIF_PROPLIST(NODE) ((NODE)->prop_list)
|
||||
/* seems to be useless not used that way???????*/
|
||||
#define BIF_PROPLIST_NAME(NODE) ((NODE)->prop_list.prop_name)
|
||||
#define BIF_PROPLIST_VAL(NODE) ((NODE)->prop_list.prop_val)
|
||||
#define BIF_PROPLIST_NEXT(NODE) ((NODE)->prop_list.next)
|
||||
|
||||
/* Macros for LOW LEVEL NODE*/
|
||||
|
||||
/* Give the code of the node */
|
||||
#define NODE_CODE(NODE) ((NODE)->variant)
|
||||
/* give the identifier */
|
||||
#define NODE_ID(NODE) ((NODE)->id)
|
||||
#define NODE_NEXT(NODE) ((NODE)->thread)
|
||||
#define NODE_CHAIN(NODE) ((NODE)->thread)
|
||||
#define NODE_TYPE(NODE) ((NODE)->type)
|
||||
#define NODE_STR(NODE) ((NODE)->entry.string_val)
|
||||
#define NODE_STRING_POINTER(NODE) ((NODE)->entry.string_val)
|
||||
#define NODE_IV(NODE) ((NODE)->entry.ival)
|
||||
|
||||
/* use for integer constant
|
||||
the boolean value is use if the constante is big
|
||||
(two integers) */
|
||||
#define NODE_INT_CST_LOW(NODE) ((NODE)->entry.ival)
|
||||
#define NODE_DOUBLE_CST(NODE) ((NODE)->entry.string_val)
|
||||
#define NODE_FLOAT_CST(NODE) ((NODE)->entry.string_val)
|
||||
#define NODE_CHAR_CST(NODE) ((NODE)->entry.cval)
|
||||
#define NODE_BOOL_CST(NODE) ((NODE)->entry.bval)
|
||||
/* la partie haute est dans les noeuds info
|
||||
A modifier par la suite */
|
||||
|
||||
|
||||
#define NODE_CV(NODE) ((NODE)->entry.cval)
|
||||
#define NODE_DV(NODE) ((NODE)->entry.dval)
|
||||
#define NODE_REAL_CST(NODE) ((NODE)->entry.dval)
|
||||
#define NODE_BV(NODE) ((NODE)->entry.bval)
|
||||
#define NODE_ARRAY_OP(NODE) ((NODE)->entry.array_op)
|
||||
#define NODE_TEMPLATE(NODE) ((NODE)->entry.Template)
|
||||
#define NODE_SYMB(NODE) ((NODE)->entry.Template.symbol)
|
||||
#define NODE_TEMPLATE_LL1(NODE) ((NODE)->entry.Template.ll_ptr1)
|
||||
#define NODE_TEMPLATE_LL2(NODE) ((NODE)->entry.Template.ll_ptr2)
|
||||
#define NODE_OPERAND0(NODE) ((NODE)->entry.Template.ll_ptr1)
|
||||
#define NODE_PURPOSE(NODE) ((NODE)->entry.Template.ll_ptr1)
|
||||
#define NODE_OPERAND1(NODE) ((NODE)->entry.Template.ll_ptr2)
|
||||
#define NODE_OPERAND2(NODE) bif_sorry("OPERAND2")
|
||||
#define NODE_VALUE(NODE) ((NODE)->entry.Template.ll_ptr2)
|
||||
#define NODE_STRING_LENGTH(NODE) (strlen((NODE)->entry.string_val))
|
||||
#define NODE_LABEL(NODE) ((NODE)->entry.label_list.lab_ptr)
|
||||
#define NODE_LIST_ITEM(NODE) ((NODE)->entry.list.item)
|
||||
#define NODE_LIST_NEXT(NODE) ((NODE)->entry.list.next)
|
||||
|
||||
/* For symbole NODE */
|
||||
#define SYMB_VAL(NODE) ((NODE)->entry.const_value)
|
||||
#define SYMB_DECLARED_NAME(NODE) ((NODE)->entry.member_func.declared_name)
|
||||
#define SYMB_CODE(NODE) ((NODE)->variant)
|
||||
#define SYMB_ID(NODE) ((NODE)->id)
|
||||
#define SYMB_IDENT(NODE) ((NODE)->ident)
|
||||
#define SYMB_PARENT(NODE) ((NODE)->parent)
|
||||
#define SYMB_DECL(NODE) ((NODE)->decl)
|
||||
#define SYMB_ATTR(NODE) ((NODE)->attr)
|
||||
#define SYMB_DOVAR(NODE) ((NODE)->dovar)
|
||||
#define SYMB_BLOC_NEXT(NODE) ((NODE)->next_symb)
|
||||
#define SYMB_NEXT(NODE) ((NODE)->thread)
|
||||
#define SYMB_LIST(NODE) ((NODE)->id_list)
|
||||
#define SYMB_TYPE(NODE) ((NODE)->type)
|
||||
#define SYMB_SCOPE(NODE) ((NODE)->scope)
|
||||
#define SYMB_UD_CHAIN(NODE) ((NODE)->ud_chain)
|
||||
#define SYMB_ENTRY(NODE) ((NODE)->entry)
|
||||
#define SYMB_NEXT_DECL(NODE) ((NODE)->entry.var_decl.next_in)
|
||||
#define SYMB_NEXT_FIELD(NODE) ((NODE)->entry.field.next)
|
||||
#define SYMB_RESTRICTED_BIT(NODE) ((NODE)->entry.field.restricted_bit)
|
||||
#define SYMB_BASE_NAME(NODE) ((NODE)->entry.Template.base_name)
|
||||
#define SYMB_FUNC_HEDR(NODE) ((NODE)->entry.func_decl.func_hedr)
|
||||
#define SYMB_FUNC_PARAM(NODE) ((NODE)->entry.proc_decl.in_list)
|
||||
#define SYMB_FUNC_NB_PARAM(NODE) ((NODE)->entry.proc_decl.num_input)
|
||||
#define SYMB_FUNC_OUTPUT(NODE) ((NODE)->entry.proc_decl.num_output)
|
||||
#define SYMB_FIELD_BASENAME(NODE) ((NODE)->entry.field.base_name)
|
||||
#define SYMB_FIELD_TAG(NODE) ((NODE)->entry.field.tag)
|
||||
#define SYMB_FIELD_DECLARED_NAME(NODE) ((NODE)->entry.field.declared_name)
|
||||
#define SYMB_FIELD_OFFSET(NODE) ((NODE)->entry.field.offset)
|
||||
#define SYMB_MEMBER_BASENAME(NODE) ((NODE)->entry.member_func.base_name)
|
||||
#define SYMB_MEMBER_NEXT(NODE) ((NODE)->entry.member_func.next)
|
||||
#define SYMB_MEMBER_HEADER(NODE) ((NODE)->entry.member_func.func_hedr)
|
||||
#define SYMB_MEMBER_LIST(NODE) ((NODE)->entry.member_func.symb_list)
|
||||
#define SYMB_MEMBER_PARAM(NODE) ((NODE)->entry.member_func.in_list)
|
||||
#define SYMB_MEMBER_TAG(NODE) ((NODE)->entry.member_func.tag)
|
||||
#define SYMB_MEMBER_OFFSET(NODE) ((NODE)->entry.member_func.offset)
|
||||
#define SYMB_MEMBER_DECLARED_NAME(NODE) ((NODE)->entry.member_func.declared_name)
|
||||
#define SYMB_MEMBER_OUTLIST(NODE) ((NODE)->entry.member_func.out_list)
|
||||
#define SYMB_MEMBER_NB_OUTPUT(NODE) ((NODE)->entry.member_func.num_output)
|
||||
#define SYMB_MEMBER_NB_IO(NODE) ((NODE)->entry.member_func.num_io)
|
||||
|
||||
/* for Template */
|
||||
#define SYMB_TEMPLATE_DUMMY1(NODE) ((NODE)->entry.Template.seen)
|
||||
#define SYMB_TEMPLATE_DUMMY2(NODE) ((NODE)->entry.Template.num_input)
|
||||
#define SYMB_TEMPLATE_DUMMY3(NODE) ((NODE)->entry.Template.num_output)
|
||||
#define SYMB_TEMPLATE_DUMMY4(NODE) ((NODE)->entry.Template.num_io)
|
||||
#define SYMB_TEMPLATE_DUMMY5(NODE) ((NODE)->entry.Template.in_list)
|
||||
#define SYMB_TEMPLATE_DUMMY6(NODE) ((NODE)->entry.Template.out_list)
|
||||
#define SYMB_TEMPLATE_DUMMY7(NODE) ((NODE)->entry.Template.symb_list)
|
||||
#define SYMB_TEMPLATE_DUMMY8(NODE) ((NODE)->entry.Template.local_size)
|
||||
#define SYMB_TEMPLATE_DUMMY9(NODE) ((NODE)->entry.Template.label_list)
|
||||
#define SYMB_TEMPLATE_DUMMY10(NODE) ((NODE)->entry.Template.func_hedr)
|
||||
#define SYMB_TEMPLATE_DUMMY11(NODE) ((NODE)->entry.Template.call_list)
|
||||
#define SYMB_TEMPLATE_DUMMY12(NODE) ((NODE)->entry.Template.tag)
|
||||
#define SYMB_TEMPLATE_DUMMY13(NODE) ((NODE)->entry.Template.offset)
|
||||
#define SYMB_TEMPLATE_DUMMY14(NODE) ((NODE)->entry.Template.declared_name)
|
||||
#define SYMB_TEMPLATE_DUMMY15(NODE) ((NODE)->entry.Template.next)
|
||||
#define SYMB_TEMPLATE_DUMMY16(NODE) ((NODE)->entry.Template.base_name)
|
||||
|
||||
|
||||
/* for BLOB NODE */
|
||||
|
||||
#define BLOB_NEXT(NODE) ((NODE)->next)
|
||||
#define BLOB_VALUE(NODE) ((NODE)->ref)
|
||||
#define HEAD_BLOB(NODE) ((NODE)->head_blob)
|
||||
|
||||
/* for type node */
|
||||
#define TYPE_CODE(NODE) ((NODE)->variant)
|
||||
#define TYPE_ID(NODE) ((NODE)->id)
|
||||
#define TYPE_SYMB(NODE) ((NODE)->name)
|
||||
#define TYPE_UD_CHAIN(NODE) ((NODE)->ud_chain)
|
||||
#define TYPE_LENGTH(NODE) ((NODE)->length)
|
||||
#define TYPE_BASE(NODE) ((NODE)->entry.Template.base_type)
|
||||
#define TYPE_RANGES(NODE) ((NODE)->entry.Template.ranges)
|
||||
#define TYPE_KIND_LEN(NODE) ((NODE)->entry.Template.kind_len)
|
||||
#define TYPE_QUOTE(NODE) ((NODE)->entry.Template.dummy1)
|
||||
#define TYPE_DIM(NODE) ((NODE)->entry.ar_decl.num_dimensions)
|
||||
#define TYPE_DECL_BASE(NODE) ((NODE)->entry.ar_decl.base_type)
|
||||
#define TYPE_DECL_RANGES(NODE) ((NODE)->entry.ar_decl.ranges)
|
||||
#define TYPE_NEXT(NODE) ((NODE)->thread)
|
||||
#define TYPE_DESCRIP(NODE) ((NODE)->entry.descriptive)
|
||||
#define TYPE_DESCRIP_BASE_TYPE(NODE) ((NODE)->entry.descriptive.base_type)
|
||||
#define TYPE_FIRST_FIELD(NODE) ((NODE)->entry.re_decl.first)
|
||||
#define TYPE_UNSIGNED(NODE) ((NODE)->entry.descriptive.signed_flag)
|
||||
#define TYPE_LONG_SHORT(NODE) ((NODE)->entry.descriptive.long_short_flag)
|
||||
#define TYPE_MODE_FLAG(NODE) ((NODE)->entry.descriptive.mod_flag)
|
||||
#define TYPE_STORAGE_FLAG(NODE) ((NODE)->entry.descriptive.storage_flag)
|
||||
#define TYPE_ACCESS_FLAG(NODE) ((NODE)->entry.descriptive.access_flag)
|
||||
#define TYPE_SYMB_DERIVE(NODE) ((NODE)->entry.derived_type.symbol)
|
||||
#define TYPE_SCOPE_SYMB_DERIVE(NODE) ((NODE)->entry.derived_type.scope_symbol)
|
||||
#define TYPE_COLL_BASE(NODE) ((NODE)->entry.col_decl.base_type)
|
||||
#define TYPE_COLL_ORI_CLASS(NODE) ((NODE)->entry.derived_class.original_class)
|
||||
#define TYPE_COLL_NUM_FIELDS(NODE) ((NODE)->entry.derived_class.num_fields)
|
||||
#define TYPE_COLL_RECORD_SIZE(NODE) ((NODE)->entry.derived_class.record_size)
|
||||
#define TYPE_COLL_FIRST_FIELD(NODE) ((NODE)->entry.derived_class.first)
|
||||
#define TYPE_COLL_NAME(NODE) ((NODE)->entry.col_decl.collection_name)
|
||||
#define TYPE_TEMPL_NAME(NODE) ((NODE)->entry.templ_decl.templ_name)
|
||||
#define TYPE_TEMPL_ARGS(NODE) ((NODE)->entry.templ_decl.args)
|
||||
/* sepcial case for enumeral type */
|
||||
#define TYPE_VALUES(NODE) ((NODE)->entry.Template.ranges) /* wrong, to verify */
|
||||
|
||||
/* To allow copies of type */
|
||||
#define TYPE_TEMPLATE_BASE(NODE) ((NODE)->entry.Template.base_type)
|
||||
#define TYPE_TEMPLATE_DUMMY1(NODE) ((NODE)->entry.Template.dummy1)
|
||||
#define TYPE_TEMPLATE_RANGES(NODE) ((NODE)->entry.Template.ranges)
|
||||
#define TYPE_TEMPLATE_DUMMY2(NODE) ((NODE)->entry.Template.dummy2)
|
||||
#define TYPE_TEMPLATE_DUMMY3(NODE) ((NODE)->entry.Template.dummy3)
|
||||
#define TYPE_TEMPLATE_DUMMY4(NODE) ((NODE)->entry.Template.dummy4)
|
||||
#define TYPE_TEMPLATE_DUMMY5(NODE) ((NODE)->entry.Template.dummy5)
|
||||
/* Other */
|
||||
#define FILE_OF_CURRENT_PROJ(PROJ) ((PROJ)->proj_name)
|
||||
#define FUNCT_NAME(FUNC) ((FUNC)->entry.Template.symbol->ident)
|
||||
#define FUNCT_SYMB(FUNC) ((FUNC)->entry.Template.symbol)
|
||||
#define FUNCT_FIRST_PAR(FUNC) ((FUNC)->entry.Template.symbol->entry.func_decl.in_list)
|
||||
|
||||
|
||||
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
|
||||
#define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
|
||||
#define CEIL(x,y) (((x) + (y) - 1) / (y))
|
||||
|
||||
/* extern pour Bif */
|
||||
|
||||
/* other type of low level node and decl */
|
||||
#define CEIL_DIV_EXPR 1000
|
||||
#define MAX_OP 1001
|
||||
#define BIF_PARM_DECL 1002
|
||||
#define BIF_SAVE_EXPR 1003
|
||||
#define MIN_OP 1004
|
||||
#define BIF_ADDR_EXPR 1005
|
||||
#define BIF_NOP_EXPR 1006
|
||||
#define BIF_RTL_EXPR 1007
|
||||
/* #define TRUNC_MOD_EXPR 1008 killed by dbg because in rid enum*/
|
||||
/* #define TRUNC_DIV_EXPR 1009 killed by dbg because in rid enum*/
|
||||
#define FLOOR_DIV_EXPR 1010
|
||||
#define FLOOR_MOD_EXPR 1011
|
||||
#define CEIL_MOD_EXPR 1012
|
||||
#define ROUND_DIV_EXPR 1013
|
||||
#define ROUND_MOD_EXPR 1014
|
||||
#define RDIV_EXPR 1015
|
||||
#define EXACT_DIV_EXPR 1016
|
||||
#define COND_EXPR EXPR_IF
|
||||
#define CONVERT_EXPR 1017
|
||||
/*#define MINUS_EXPR SUBT_OP removed by Beckman*/
|
||||
#define CONST_DECL 1018 /* to be modify */
|
||||
#define ABS_EXPR 1019
|
||||
#define BIT_NOT_EXPR BIT_COMPLEMENT_OP
|
||||
#define NEGATE_EXPR MINUS_OP
|
||||
#define TRUTH_ANDIF_EXPR 1020
|
||||
#define TRUTH_AND_EXPR 1021
|
||||
#define TRUTH_NOT_EXPR 1022
|
||||
#define TRUTH_ORIF_EXPR 1023
|
||||
#define POSTINCREMENT_EXPR PLUSPLUS_OP
|
||||
#define PREINCREMENT_EXPR 1024
|
||||
#define PREDECREMENT_EXPR 1025
|
||||
#define COMPOUND_EXPR 1026
|
||||
#define ENUMERAL_TYPE T_ENUM
|
||||
#define FLOAT_EXPR 1027
|
||||
/*#define RSHIFT_EXPR RSHIFT_OP
|
||||
#define LSHIFT_EXPR LSHIFT_OP removed by Pete Beckman*/
|
||||
/* #define BIT_IOR_EXPR 1028 killed by dbg because in rid enum*/
|
||||
/* #define BIT_XOR_EXPR 1029 killed by dbg because in rid enum*/
|
||||
#define BIT_ANDTC_EXPR 1030
|
||||
#define ERROR_MARK NULL
|
||||
#define TRUTH_OR_EXPR 1031
|
||||
#define FIX_TRUNC_EXPR 1032
|
||||
#define RROTATE_EXPR 1033
|
||||
#define LROTATE_EXPR 1034
|
||||
#define RANGE_EXPR 1035
|
||||
#define POSTDECREMENT_EXPR 1036
|
||||
#define COMPONENT_REF RECORD_REF /* NODE SYMB define for this node */
|
||||
#define INDIRECT_REF DEREF_OP
|
||||
#define REFERENCE_TYPE 1037
|
||||
/* #define CONSTRUCTOR 1038*/
|
||||
#define FIX_FLOOR_EXPR 1039
|
||||
#define FIX_ROUND_EXPR 1040
|
||||
#define FIX_CEIL_EXPR 1041
|
||||
#define FUNCTION_DECL 1042
|
||||
#define MODIFY_EXPR 1043
|
||||
#define REFERENCE_EXPR 1044
|
||||
#define RESULT_DECL 1045
|
||||
#define PARM_DECL 1046 /* not used */
|
||||
#define CALL_EXPR 1047
|
||||
#define INIT_EXPR 1048
|
||||
|
||||
|
||||
/* other type for type node */
|
||||
#define T_LITERAL 1100 /* not use */
|
||||
#define T_SIZE 1101
|
||||
#define LAST_CODE T_SIZE
|
||||
/* end other type of node */
|
||||
|
||||
/* definition for project */
|
||||
|
||||
#define PROJ_FIRST_SYMB() (pointer_on_file_proj->head_symb)
|
||||
#define PROJ_FIRST_TYPE() (pointer_on_file_proj->head_type)
|
||||
#define PROJ_FIRST_LLND() (pointer_on_file_proj->head_llnd)
|
||||
#define PROJ_FIRST_BIF() (pointer_on_file_proj->head_bfnd)
|
||||
#define PROJ_FIRST_CMNT() (pointer_on_file_proj->head_cmnt)
|
||||
#define PROJ_FIRST_LABEL() (pointer_on_file_proj->head_lab)
|
||||
|
||||
#define CUR_FILE_NUM_BIFS() (pointer_on_file_proj->num_bfnds)
|
||||
#define CUR_FILE_NUM_LLNDS() (pointer_on_file_proj->num_llnds)
|
||||
#define CUR_FILE_NUM_SYMBS() (pointer_on_file_proj->num_symbs)
|
||||
#define CUR_FILE_NUM_TYPES() (pointer_on_file_proj->num_types)
|
||||
#define CUR_FILE_NUM_LABEL() (pointer_on_file_proj->num_label)
|
||||
#define CUR_FILE_NUM_BLOBS() (pointer_on_file_proj->num_blobs)
|
||||
#define CUR_FILE_NUM_CMNT() (pointer_on_file_proj->num_cmnt)
|
||||
#define CUR_FILE_CUR_BFND() (pointer_on_file_proj->cur_bfnd)
|
||||
#define CUR_FILE_CUR_LLND() (pointer_on_file_proj->cur_llnd)
|
||||
#define CUR_FILE_CUR_SYMB() (pointer_on_file_proj->cur_symb)
|
||||
#define CUR_FILE_CUR_TYPE() (pointer_on_file_proj->cur_type)
|
||||
#define CUR_FILE_GLOBAL_BFND() (pointer_on_file_proj->global_bfnd)
|
||||
#define CUR_FILE_NAME() (pointer_on_file_proj->filename)
|
||||
#define CUR_FILE_HEAD_FILE() (pointer_on_file_proj->head_file)
|
||||
|
||||
|
||||
#define FILE_GLOBAL_BFND(FIL) ((FIL)->global_bfnd)
|
||||
#define FILE_FILENAME(FIL) ((FIL)->filename)
|
||||
#define FILE_LANGUAGE(FIL) ((FIL)->lang)
|
||||
|
||||
|
||||
#define CUR_PROJ_FILE_CHAIN() (cur_proj->file_chain) /* modified by Pete */
|
||||
#define CUR_PROJ_NAME() (cur_proj->proj_name) /* modified by Pete */
|
||||
|
||||
#define PROJ_FILE_CHAIN(PROJ) ((PROJ)->file_chain)
|
||||
|
||||
/* use as a general pointer */
|
||||
|
||||
typedef char *POINTER;
|
||||
enum typenode { BIFNODE, LLNODE, SYMBNODE, TYPENODE, BLOBNODE,
|
||||
BLOB1NODE, LABEL, FILENODE}; //add LABEL (Kataev 21.03.2013), FILE (Kataev 15.07.2013
|
||||
|
||||
|
||||
#define MAXTILE 10 /* nombre maximum de boucle que l'on peut tiler */
|
||||
#define MAX_STMT 100 /* nombre d'instruction d'une boucle */
|
||||
|
||||
|
||||
/**************** For Comment Nodes *****************************/
|
||||
|
||||
|
||||
#define CMNT_ID(NODE) ((NODE)->id)
|
||||
#define CMNT_TYPE(NODE) ((NODE)->type)
|
||||
#define CMNT_STRING(NODE) ((NODE)->string)
|
||||
#define CMNT_NEXT(NODE) ((NODE)->thread)
|
||||
#define CMNT_NEXT_ATTACH(NODE) ((NODE)->next)
|
||||
|
||||
|
||||
/**************** For LABEL NODES *****************************/
|
||||
|
||||
#define LABEL_ID(NODE) ((NODE)->id)
|
||||
#define LABEL_NEXT(NODE) ((NODE)->next)
|
||||
#define LABEL_UD_CHAIN(NODE) ((NODE)->ud_chain)
|
||||
#define LABEL_USED(NODE) ((NODE)->labused)
|
||||
#define LABEL_ILLEGAL(NODE) ((NODE)->labinacc)
|
||||
#define LABEL_DEFINED(NODE) ((NODE)->labdefined)
|
||||
#define LABEL_SCOPE(NODE) ((NODE)->scope)
|
||||
#define LABEL_BODY(NODE) ((NODE)->statbody)
|
||||
#define LABEL_SYMB(NODE) ((NODE)->label_name)
|
||||
#define LABEL_TYPE(NODE) ((NODE)->labtype)
|
||||
#define LABEL_STMTNO(NODE) ((NODE)->stateno)
|
||||
|
||||
|
||||
/**************** Misceallous ***********************************/
|
||||
|
||||
#define LABEL_KIND 100000 /* bigger than the variant of all kind of node*/
|
||||
#define BLOB_KIND 100001
|
||||
#define CMNT_KIND 100002
|
||||
|
||||
/************** For Sets Node ********************************/
|
||||
|
||||
#define SETS_GEN(NODE) ((NODE)->gen)
|
||||
#define SETS_INDEF(NODE) ((NODE)->in_def)
|
||||
#define SETS_USE(NODE) ((NODE)->use)
|
||||
#define SETS_INUSE(NODE) ((NODE)->in_use)
|
||||
#define SETS_OUTDEF(NODE) ((NODE)->out_def)
|
||||
#define SETS_OUTUSE(NODE) ((NODE)->out_use)
|
||||
#define SETS_ARRAYEF(NODE) ((NODE)->arefl)
|
||||
|
||||
#define SETS_REFL_SYMB(NODE) ((NODE)->id)
|
||||
#define SETS_REFL_NEXT(NODE) ((NODE)->next)
|
||||
#define SETS_REFL_NODE(NODE) ((NODE)->node)
|
||||
#define SETS_REFL_REF(NODE) ((NODE)->node->refer)
|
||||
#define SETS_REFL_STMT(NODE) ((NODE)->node->stmt)
|
||||
|
||||
/************** For HASH NODE ********************************/
|
||||
#define HASH_IDENT(NODE) ((NODE)->ident)
|
||||
|
||||
/************** For Special malloc ********************************/
|
||||
|
||||
|
||||
/* pour la gestion memoire */
|
||||
struct chaining
|
||||
{
|
||||
char *zone;
|
||||
struct chaining *list;
|
||||
};
|
||||
|
||||
typedef struct chaining *ptchaining;
|
||||
struct stack_chaining
|
||||
{
|
||||
ptchaining first;
|
||||
ptchaining last;
|
||||
struct stack_chaining *prev;
|
||||
struct stack_chaining *next;
|
||||
int level;
|
||||
};
|
||||
typedef struct stack_chaining *ptstack_chaining;
|
||||
123
dvm/fdvm/trunk/Sage/lib/include/sage++callgraph.h
Normal file
123
dvm/fdvm/trunk/Sage/lib/include/sage++callgraph.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
/* A class for creating a static call tree for C++ and pC++ */
|
||||
/* functions. usage: */
|
||||
/* include "sage++user.h" */
|
||||
/* include "sage++callgraph.h" */
|
||||
/* main(){ */
|
||||
/* SgProject project("myfile") */
|
||||
/* SgCallGraph CG; */
|
||||
/* Cg.GenCallTree(&(project->file(0))); */
|
||||
/* CG.computeClosures(); */
|
||||
/* the object then contains call info for that file. */
|
||||
/* see the public functions for data that can be extracted */
|
||||
/*******************************************************************/
|
||||
#define SGMOE_FUN 1
|
||||
#define SGNORMAL_FUN 0
|
||||
#define SGMOC_FUN 2
|
||||
#define SGMAX_HASH 541
|
||||
|
||||
class SgCallGraphFunRec;
|
||||
|
||||
typedef struct _SgCallSiteList{
|
||||
SgStatement *stmt;
|
||||
SgExpression *expr;
|
||||
struct _SgCallSiteList *next;
|
||||
}SgCallSiteList;
|
||||
|
||||
typedef struct _SgCallGraphFunRecList{
|
||||
SgStatement *stmt;
|
||||
SgExpression *expr;
|
||||
SgCallGraphFunRec *fr;
|
||||
struct _SgCallGraphFunRecList *next;
|
||||
}SgCallGraphFunRecList;
|
||||
|
||||
class SgCallGraphFunRec{
|
||||
public:
|
||||
int type; // either moe, normal or moc.
|
||||
SgStatement *body;
|
||||
SgCallSiteList *callSites; // pointer to tail of circular linked list
|
||||
SgSymbol *s;
|
||||
int Num_Call_Sites;
|
||||
SgCallGraphFunRecList *callList; // pointer to tail of circular linked list
|
||||
int Num_Call_List;
|
||||
int isCollection; // = 1 if this is a method of a collection
|
||||
int calledInPar; // = 1 if called in a parallel section
|
||||
int calledInSeq; // = 1 if called in sequentail main thread
|
||||
SgSymbol *className; // for member functions.
|
||||
int flag; // used for traversals.
|
||||
|
||||
int id; // serial number
|
||||
SgCallGraphFunRec *next; // used for linked list
|
||||
SgCallGraphFunRec *next_hash; // used for hash table collisions
|
||||
// used for next* functions
|
||||
SgCallSiteList *currentCallSite;
|
||||
SgCallSiteList *currentCallExpr;
|
||||
SgCallGraphFunRecList *currentFunCall;
|
||||
};
|
||||
|
||||
class SgCallGraph{
|
||||
|
||||
public:
|
||||
SgCallGraph(void) {}; // constructor
|
||||
void GenCallTree(SgFile *); // initialize and build the call tree
|
||||
void printFunctionEntry(SgSymbol *fname); // print info about fname
|
||||
int numberOfFunctionsInGraph(); // number of functions in the table.
|
||||
int numberOfCallSites(SgSymbol *fname); // number of call sites for funame
|
||||
int numberOfFunsCalledFrom(SgSymbol *fname); // how many call sites in fname
|
||||
|
||||
int isAMethodOfElement(SgSymbol* fname); // 1 if fname is a method of an element of a coll.
|
||||
int isACollectionFunc(SgSymbol* fname); // 1 if fname is a method of a collection (not MOE)
|
||||
int isCalledInSeq(SgSymbol* fname); // 1 if fname is called in a sequential sect.
|
||||
int isCalledInPar(SgSymbol* fname); // 1 if fname is called in parallel code
|
||||
void computeClosures();
|
||||
|
||||
SgSymbol *firstFunction(); // first function in callgraph
|
||||
SgSymbol *nextFunction(); // next function in callgraph
|
||||
int functionId(SgSymbol *fname); // id of fname
|
||||
SgStatement *functionBody(SgSymbol *fname); // body of fname
|
||||
SgStatement *firstCallSiteStmt(SgSymbol *fname); // stmt of first call of fname
|
||||
SgStatement *nextCallSiteStmt(SgSymbol *fname); // stmt of next call of fname
|
||||
SgExpression *firstCallSiteExpr(SgSymbol *fname); // expression of first call
|
||||
SgExpression *nextCallSiteExpr(SgSymbol *fname); // expression of next call
|
||||
SgSymbol *firstCalledFunction(SgSymbol *fname); // first function called in fname
|
||||
SgSymbol *nextCalledFunction(SgSymbol *fname); // next function called in fname
|
||||
SgStatement *SgCalledFunctionStmt(SgSymbol *fname); // get statement of current called function
|
||||
SgExpression *SgCalledFunctionExpr(SgSymbol *fname); // get expression of current called function
|
||||
|
||||
// obsolete functions:
|
||||
SgSymbol *function(int i); // i-th function in table (0 = first)
|
||||
SgStatement *functionBody(int i); // i-th function in table (0 = first)
|
||||
void printTableEntry(int); // print the i-th table entry.
|
||||
|
||||
SgStatement *callSiteStmt(SgSymbol *fname, int i); // stmt of i-th call of fname
|
||||
SgExpression *callSiteExpr(SgSymbol *fname, int i); // expression of i-th call
|
||||
SgSymbol *calledFunction(SgSymbol *fname, int i); // i-th function called in fname
|
||||
// end obsolete
|
||||
protected:
|
||||
SgCallGraphFunRec *FunListHead;
|
||||
int num_funs_in_table;
|
||||
SgCallGraphFunRec *hash_table[SGMAX_HASH];
|
||||
SgCallGraphFunRec *locateFunctionInTable(SgSymbol *);
|
||||
SgCallGraphFunRec *lookForFunctionOpForClass(SgSymbol *);
|
||||
void updateFunctionTableConnections(SgCallGraphFunRec *, SgStatement *, SgExpression *);
|
||||
void findFunctionCalls(SgStatement *, SgExpression *);
|
||||
void init();
|
||||
|
||||
void insertInHashTable(SgSymbol *, SgCallGraphFunRec *);
|
||||
unsigned long int hashSymbol(SgSymbol *);
|
||||
SgCallGraphFunRec *currentFun;
|
||||
};
|
||||
|
||||
SgType *findTrueType(SgExpression *);
|
||||
SgType *makeReducedType(SgType *);
|
||||
SgSymbol *firstFunction();
|
||||
SgSymbol *nextFunction();
|
||||
|
||||
|
||||
|
||||
216
dvm/fdvm/trunk/Sage/lib/include/sage++classhierarchy.h
Normal file
216
dvm/fdvm/trunk/Sage/lib/include/sage++classhierarchy.h
Normal file
@@ -0,0 +1,216 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
// ----------------------------------
|
||||
// Darryl Brown
|
||||
// University of Oregon pC++/Sage++
|
||||
//
|
||||
// sage++classhierarchy.h - the header file for the class classHierarchy.
|
||||
//
|
||||
// a class(es) for inspecting the class hierarchy
|
||||
// of a sage++ project.
|
||||
//
|
||||
// ----------------------------------
|
||||
|
||||
// ----------------------------------
|
||||
// To traverse the hierarcy of classes, the most obvious approach is
|
||||
// in the following example. This example searches the tree for a given
|
||||
// class name and a hierarchy to search. Note that this searches the whole
|
||||
// tree, not just the immediate children.
|
||||
//
|
||||
// classHierarchy *findHierarchy(char *name, classHierarchy *h) {
|
||||
// classHierarchy *tmp, *depth;
|
||||
//
|
||||
// // initialize searchlist of hierarchy immediate children...;
|
||||
// // this returns the first hierarchy in the child list...;
|
||||
// tmp = (classHierarchy *) h->children->searchList();
|
||||
//
|
||||
// while (tmp) {
|
||||
//
|
||||
// // if they are the same, return the current hierarchy...;
|
||||
// if (strcmp(name, tmp->className) == 0) {
|
||||
// return tmp;
|
||||
// } else {
|
||||
// // search tmps children recursively, if not NULL, return that value...;
|
||||
// if (depth = findHierarchy(name, tmp)) {
|
||||
// return depth;
|
||||
// }
|
||||
// }
|
||||
// // get next item in list;
|
||||
// tmp = (classHierarchy *) h->children->nextItem();
|
||||
// }
|
||||
// // if weve made it to here, it is not anywhere in the hierarchy,
|
||||
// // so return NULL;
|
||||
// return NULL;
|
||||
// }
|
||||
//
|
||||
// -------------------------------------------------------
|
||||
// There is also a list of the classMembers for each class. To traverse
|
||||
// that list, it is very similar, but more simple than the above example.
|
||||
// Here is an example of printing out each class member of a specific
|
||||
// member type (e.g. public function).
|
||||
//
|
||||
// virtual void printMemberType(memberType mt, classHierarchy *h) {
|
||||
// classMember *tmp;
|
||||
//
|
||||
// tmp = (classMember *) h->classMembers->searchList();
|
||||
//
|
||||
// while (tmp) {
|
||||
// if (tmp->typeVariant == mt) {
|
||||
// tmp->print();
|
||||
// }
|
||||
// tmp = (classMember *) h->classMembers->nextItem();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// Forward declarations;
|
||||
//
|
||||
class relationList;
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// Extern declarations
|
||||
//
|
||||
//
|
||||
extern int strToType(char *s);
|
||||
extern char *typeToStr(int ty);
|
||||
|
||||
|
||||
// --------------------
|
||||
// type of class members...;
|
||||
typedef enum {
|
||||
UNKNOWN_FUNC,
|
||||
PRIVATE_FUNC,
|
||||
PUBLIC_FUNC,
|
||||
PROTECTED_FUNC,
|
||||
ELEMENT_FUNC,
|
||||
UNKNOWN_VAR,
|
||||
PRIVATE_VAR,
|
||||
PUBLIC_VAR,
|
||||
PROTECTED_VAR,
|
||||
ELEMENT_VAR
|
||||
} memberType;
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// the main class for accessing the class hierarchy within a sage++
|
||||
// file.
|
||||
class classHierarchy : public brk_basePtr {
|
||||
|
||||
private:
|
||||
|
||||
// private functions
|
||||
virtual classHierarchy *findClassHierarchy(char *cl);
|
||||
//returns the hierarchy of the class with className cl;
|
||||
classHierarchy *pushOnTop(SgClassStmt *clSt);
|
||||
// creates a new hierarchy for clSt (a class declarative statement);
|
||||
// and puts it at the highest level of the hierarchy (exclusively ;
|
||||
// for classes with no superclasses) ;
|
||||
virtual classHierarchy * storeInClassHierarchy (SgClassStmt *clSt);
|
||||
// creates a new hierarchy for the class declarative statement clSt;
|
||||
// and stores it where it fits in the hierarchy of classes. It makes
|
||||
// use of the above two functions pushOnTop and findHierarchy.;
|
||||
void determineMembers(SgFile *aFile);
|
||||
// finds all members in a class, initializing publicVars, protectedVars,
|
||||
// privateVars, publicFuncs, protectedFuncs, and privateFuncs;
|
||||
void allocateLists();
|
||||
// allocates new relationList instances for member fields.;
|
||||
|
||||
public:
|
||||
|
||||
// members;
|
||||
relationList *parents; // linked list of parents ;
|
||||
relationList *children; // linked list of children ;
|
||||
relationList *classMembers; // linked list of class vars and funcs ;
|
||||
char *className; // contains the class name ;
|
||||
SgSymbol *classSymbol; // contains the Sage symbol for the name;
|
||||
SgClassStmt *declaration; // contains the Sage declaration of the class;
|
||||
|
||||
// constructors;
|
||||
classHierarchy(void);
|
||||
classHierarchy(char * cn);
|
||||
classHierarchy(SgSymbol * cs);
|
||||
classHierarchy(SgClassStmt * clSt);
|
||||
|
||||
// access functions;
|
||||
virtual void print(int tabs); // prints out this class after <tabs> tabs.;
|
||||
virtual void print(); // prints out this class after 0 tabs.;
|
||||
virtual void printAll(int tabs);
|
||||
// prints out this class after <tabs> tabs, as well as all descendants;
|
||||
virtual void printAllCollections(int tabs);
|
||||
// prints out this class if it is a collection ;
|
||||
// after <tabs> tabs, as well as all descendants;
|
||||
virtual void printAll();
|
||||
// prints out this class after 0 tabs, as well as all descendants;
|
||||
virtual void printMemberType(memberType mt);
|
||||
// prints out all member field/functions of type mt;
|
||||
classHierarchy *findMember (brk_basePtr *); // look for this element and
|
||||
// return the ptrNode that points to it;
|
||||
int numParents(); // returns the number of parents;
|
||||
int numChildren(); // returns the number of children ;
|
||||
void determineClassHierarchy(SgFile *aFile);
|
||||
// finds all classes in a file and stores them in a hierarchy. It makes
|
||||
// use of private functions. Typically, this is the only necessary
|
||||
// function to call when trying to find out a class hierarchy for a file.
|
||||
int numberOfDescendants (void);
|
||||
// returns the total number of all descendants;
|
||||
int numberOfParents (void);
|
||||
// returns the number of parents of this class;
|
||||
int numberOfChildren (void);
|
||||
// returns the number of direct children of this class;
|
||||
int isCollection();
|
||||
// returns true if it is a collection, false if not a collection,
|
||||
// or if it is not known.;
|
||||
char *fileName(); // returns file name where this class is defined if known,
|
||||
// NULL if not known.;
|
||||
int lineNumber(); // returns line number where this class is defined if known,
|
||||
// -1 if not known.;
|
||||
virtual int compare(brk_basePtr *);
|
||||
// compares this heirarchy with another alphabetically using className;
|
||||
void sort (); // sorts the list, elements must have compare function.,;
|
||||
void sort(int (* compareFunc) (brk_basePtr *, brk_basePtr *));
|
||||
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// the class implementing the linked list for
|
||||
class relationList : public brk_linkedList {
|
||||
|
||||
public:
|
||||
|
||||
// constructor;
|
||||
relationList();
|
||||
|
||||
// access functions;
|
||||
virtual void printAll(int tNum); // print all elements in list preceded by
|
||||
// tNum tabs AND print all descendants, incrementing tNum with each
|
||||
// generation;
|
||||
virtual void printAll(); // as above, with tNum = 0;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------------------;
|
||||
// For class variables & functions..;
|
||||
class classMember : public brk_basePtr {
|
||||
|
||||
public:
|
||||
|
||||
// class vars
|
||||
memberType typeVariant;
|
||||
SgStatement * declaration;
|
||||
SgSymbol * symbol;
|
||||
char * name;
|
||||
char * typeOf;
|
||||
SgType *memType;
|
||||
|
||||
// access functions
|
||||
classMember(SgSymbol *sym, memberType tv);
|
||||
classMember(SgStatement *decl, memberType tv);
|
||||
virtual void print();
|
||||
virtual void print(int);
|
||||
};
|
||||
|
||||
|
||||
34
dvm/fdvm/trunk/Sage/lib/include/sage++extern.h
Normal file
34
dvm/fdvm/trunk/Sage/lib/include/sage++extern.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
extern void **tablebfnd[];
|
||||
extern void **tablellnd[];
|
||||
extern void **tabletype[];
|
||||
extern void **tablesymbol[];
|
||||
extern void **tablelabel[];
|
||||
|
||||
extern int numtablebfnd[];
|
||||
extern int numtablellnd[];
|
||||
extern int numtabletype[];
|
||||
extern int numtablesymbol[];
|
||||
extern int numtablelabel[];
|
||||
|
||||
|
||||
extern void **fileTableClass;
|
||||
extern int allocatedForfileTableClass;
|
||||
extern void **bfndTableClass;
|
||||
extern int allocatedForbfndTableClass;
|
||||
extern void **llndTableClass;
|
||||
extern int allocatedForllndTableClass;
|
||||
extern void **typeTableClass;
|
||||
extern int allocatedFortypeTableClass;
|
||||
extern void **symbolTableClass;
|
||||
extern int allocatedForsymbolTableClass;
|
||||
extern void **labelTableClass;
|
||||
extern int allocatedForlabelTableClass;
|
||||
|
||||
extern SgProject *CurrentProject;
|
||||
|
||||
40
dvm/fdvm/trunk/Sage/lib/include/sage++proto.h
Normal file
40
dvm/fdvm/trunk/Sage/lib/include/sage++proto.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
|
||||
void SwitchToFile(int i);
|
||||
void ReallocatefileTableClass();
|
||||
void ReallocatebfndTableClass();
|
||||
void ResetbfndTableClass();
|
||||
void ReallocatellndTableClass();
|
||||
void ReallocatesymbolTableClass();
|
||||
void ReallocatelabelTableClass();
|
||||
void ReallocatetypeTableClass();
|
||||
void RemoveFromTableType(void * pt);
|
||||
void RemoveFromTableSymb(void * pt);
|
||||
void RemoveFromTableBfnd(void * pt);
|
||||
void RemoveFromTableFile(void * pt);
|
||||
void RemoveFromTableLlnd(void * pt);
|
||||
void RemoveFromTableLabel(void * pt);
|
||||
void SetMappingInTableForBfnd(PTR_BFND bif, void *pt);
|
||||
void SetMappingInTableForType(PTR_TYPE type, void *pt);
|
||||
void SetMappingInTableForSymb(PTR_SYMB symb, void *pt);
|
||||
void SetMappingInTableForLabel(PTR_LABEL lab, void *pt);
|
||||
void SetMappingInTableForLlnd(PTR_LLND ll, void *pt);
|
||||
void SetMappingInTableForFile(PTR_FILE file, void *pt);
|
||||
SgSymbol *GetMappingInTableForSymbol(PTR_SYMB symb);
|
||||
SgLabel *GetMappingInTableForLabel(PTR_LABEL lab);
|
||||
SgStatement *GetMappingInTableForBfnd(PTR_BFND bf);
|
||||
SgStatement *GetMappingInTableForBfnd(PTR_BFND bf);
|
||||
SgType *GetMappingInTableForType(PTR_TYPE t);
|
||||
SgExpression *GetMappingInTableForLlnd(PTR_LLND ll);
|
||||
SgFile *GetMappingInTableForFile(PTR_FILE file);
|
||||
SgStatement * BfndMapping(PTR_BFND bif);
|
||||
SgExpression * LlndMapping(PTR_LLND llin);
|
||||
SgSymbol * SymbMapping(PTR_SYMB symb);
|
||||
SgType * TypeMapping(PTR_TYPE ty);
|
||||
SgLabel * LabelMapping(PTR_LABEL label);
|
||||
|
||||
45
dvm/fdvm/trunk/Sage/lib/include/sage++user.h
Normal file
45
dvm/fdvm/trunk/Sage/lib/include/sage++user.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
#ifndef SAGEXXUSER_H
|
||||
#define SAGEXXUSER_H 1
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
// For C/C++ parser internals
|
||||
#include "vpc.h"
|
||||
|
||||
// For the fortran parser internals
|
||||
#include "f90.h"
|
||||
|
||||
// All the "C" functions from the Rennes toolbox
|
||||
#include "extcxx_low.h"
|
||||
|
||||
class SgProject;
|
||||
class SgFile;
|
||||
class SgStatement;
|
||||
class SgExpression;
|
||||
class SgLabel;
|
||||
class SgSymbol;
|
||||
class SgType;
|
||||
class SgUnaryExp;
|
||||
class SgClassSymb;
|
||||
class SgVarDeclStmt;
|
||||
class SgVarRefExp; /* ajm: I think they should all be here! @$!@ */
|
||||
|
||||
// All the externs (from libSage++.C) used in libSage++.h
|
||||
#include "sage++extern.h"
|
||||
|
||||
#define SORRY Message("Sorry, not implemented yet",0)
|
||||
|
||||
// Prototype definitions for all the functions in libSage++.C
|
||||
#include "sage++proto.h"
|
||||
|
||||
|
||||
// dont delete needed in libSage++.h
|
||||
#define USER
|
||||
#include "libSage++.h"
|
||||
|
||||
#endif /* ndef SAGEXXUSER_H */
|
||||
30
dvm/fdvm/trunk/Sage/lib/include/symb.def
Normal file
30
dvm/fdvm/trunk/Sage/lib/include/symb.def
Normal file
@@ -0,0 +1,30 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
DEFNODECODE(BIF_PARM_DECL,'_','_','_','_','_')
|
||||
DEFNODECODE(CONST_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(ENUM_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(FIELD_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(VARIABLE_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(TYPE_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(PROGRAM_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(PROCEDURE_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(PROCESS_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(VAR_FIELD,'_','_','_','_','_')
|
||||
DEFNODECODE(LABEL_VAR,'_','_','_','_','_')
|
||||
DEFNODECODE(FUNCTION_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(MEMBER_FUNC,'_','_','_','_','_')
|
||||
DEFNODECODE(CLASS_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(TECLASS_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(UNION_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(STRUCT_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(LABEL_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(COLLECTION_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(ROUTINE_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(CONSTRUCT_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(INTERFACE_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(MODULE_NAME,'_','_','_','_','_')
|
||||
DEFNODECODE(COMMON_NAME,'_','_','_','_','_')
|
||||
|
||||
69
dvm/fdvm/trunk/Sage/lib/include/type.def
Normal file
69
dvm/fdvm/trunk/Sage/lib/include/type.def
Normal file
@@ -0,0 +1,69 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
/* format is the following variant 'a'|'s'|'u'|'t'|'e'|'p'|'d'|'D'|'_',
|
||||
's'|'_', 'b'|'_','c'|'C'|'_', 'f'|'_'
|
||||
|
||||
_ stands for no
|
||||
-----------------------
|
||||
a stands for atomic type (T_INT and so on)
|
||||
u stands for union
|
||||
t stands for array
|
||||
s stands for structure (first field structure)
|
||||
e stands for enumeration
|
||||
p stands for pointer or reference
|
||||
d stands for derived
|
||||
D stands for descript type
|
||||
------------------
|
||||
s stands for symbol
|
||||
------------------
|
||||
b stands for bastype
|
||||
------------------
|
||||
c stands for class type
|
||||
C stand for collection type
|
||||
------------------
|
||||
f stands have a list of fields (should go to symbol also)
|
||||
|
||||
*/
|
||||
DEFNODECODE(DEFAULT, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_INT, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_FLOAT, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_DOUBLE, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_CHAR, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_BOOL, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_STRING, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_COMPLEX, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_DCOMPLEX, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_GATE, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_EVENT, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_SEQUENCE, 'a','_','_','_','_')
|
||||
|
||||
DEFNODECODE(T_ENUM, 'e','_','_','_','f')
|
||||
DEFNODECODE(T_SUBRANGE, '_','_','_','_','_')
|
||||
DEFNODECODE(T_LIST, '_','_','_','_','_')
|
||||
DEFNODECODE(T_ARRAY, 't','_','b','_','_')
|
||||
DEFNODECODE(T_RECORD, 's','_','_','_','f')
|
||||
DEFNODECODE(T_ENUM_FIELD, '_','_','_','_','_')
|
||||
DEFNODECODE(T_UNKNOWN, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_VOID, 'a','_','_','_','_')
|
||||
DEFNODECODE(T_DESCRIPT, 'D','_','b','_','_')
|
||||
DEFNODECODE(T_FUNCTION, '_','_','b','_','_')
|
||||
DEFNODECODE(T_POINTER, 'p','_','b','_','_')
|
||||
DEFNODECODE(T_UNION, 'u','_','_','_','f')
|
||||
DEFNODECODE(T_STRUCT, 's','_','_','_','f')
|
||||
DEFNODECODE(T_CLASS, 's','_','_','_','f')
|
||||
DEFNODECODE(T_TECLASS, 's','_','_','_','f')
|
||||
DEFNODECODE(T_DERIVED_CLASS, 'd','s','_','_','_')
|
||||
DEFNODECODE(T_DERIVED_TYPE, 'd','s','_','_','_')
|
||||
DEFNODECODE(T_COLLECTION, 's','_','_','_','f')
|
||||
DEFNODECODE(T_DERIVED_COLLECTION, 'd','s','_','_','_')
|
||||
DEFNODECODE(T_DERIVED_TEMPLATE, 'd','s','_','_','_')
|
||||
DEFNODECODE(T_REFERENCE, 'p','_','b','_','_')
|
||||
|
||||
DEFNODECODE(LOCAL, '_','_','_','_','_')
|
||||
DEFNODECODE(INPUT, '_','_','_','_','_')
|
||||
DEFNODECODE(OUTPUT, '_','_','_','_','_')
|
||||
DEFNODECODE(IO, '_','_','_','_','_')
|
||||
|
||||
1060
dvm/fdvm/trunk/Sage/lib/include/unparse.def
Normal file
1060
dvm/fdvm/trunk/Sage/lib/include/unparse.def
Normal file
File diff suppressed because it is too large
Load Diff
831
dvm/fdvm/trunk/Sage/lib/include/unparseC++.def
Normal file
831
dvm/fdvm/trunk/Sage/lib/include/unparseC++.def
Normal file
@@ -0,0 +1,831 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/***** *****/
|
||||
/***** UNPARSE.DEF: Bodin Francois Sepetmber 1992 *****/
|
||||
/***** with major changes by d. gannon summer 1993 *****/
|
||||
/***** Version C++ *****/
|
||||
/***** *****/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
DEFNODECODE(GLOBAL, "%SETFLAG(ARRAYREF)%UNSETFLAG(ARRAYREF)%SETFLAG(CLASSDECL)%UNSETFLAG(CLASSDECL)%SETFLAG(PAREN)%UNSETFLAG(PAREN)%SETFLAG(ELIST)%UNSETFLAG(ELIST)%SETFLAG(QUOTE)%BLOB1%UNSETFLAG(QUOTE)",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PROG_HEDR, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PROC_HEDR, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(BASIC_BLOCK, "%CMNT%PUTTAB{%NL%INCTAB%BLOB1%DECTAB%PUTTAB}%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(MODULE_STMT, "%CMNT%PUTTAB%NL%INCTAB%BLOB1%DECTAB%PUTTAB%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
/* 107 is value for FOR_NODE */
|
||||
DEFNODECODE(CONTROL_END, "",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(IF_NODE, "%CMNT%PUTTABif (%LL1) %NL%PUTTAB{%INCTAB%NL%BLOB1%DECTAB%PUTTAB}%NL%IF (%BLOB2 != %NULL)%PUTTABelse %NL%PUTTAB{%INCTAB%NL%BLOB2%DECTAB%PUTTAB}%NL%ENDIF",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ARITHIF_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(LOGIF_NODE, "%CMNT%PUTTABif (%LL1) %NL%PUTTAB%INCTAB%BLOB1%DECTAB%PUTTAB%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(LOOP_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(FOR_NODE, "%CMNT%PUTTABfor (%LL1 ; %LL2 ; %LL3)%NL%PUTTAB{%INCTAB%NL%BLOB1%DECTAB%PUTTAB}%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(FORALL_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(WHILE_NODE, "%CMNT%PUTTABwhile (%LL1)%NL%PUTTAB{%INCTAB%NL%BLOB1%DECTAB%PUTTAB}%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(TRY_STAT, "%CMNT%PUTTABtry {%INCTAB%NL%BLOB1%DECTAB%PUTTAB}%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(CATCH_STAT, "%CMNT%PUTTABcatch (%SETFLAG(VARDECL)%TMPLARGS%UNSETFLAG(VARDECL)){%INCTAB%NL%BLOB1%DECTAB%PUTTAB}%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(SDOALL_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DOACROSS_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(CDOACROSS_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(EXIT_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(GOTO_NODE, "%CMNT%PUTTABgoto %LL3;%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ASSGOTO_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(COMGOTO_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PAUSE_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(STOP_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(ASSIGN_STAT, "%CMNT%IF(%LABEL != %NULL)%LABEL%ENDIF%PUTTAB%LL1 = %LL2;%NL",
|
||||
's',0,BIFNODE)
|
||||
/*
|
||||
DEFNODECODE(ASSIGN_STAT, "%ERROR",
|
||||
's',0,BIFNODE) */
|
||||
DEFNODECODE(M_ASSIGN_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PROC_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ASSLAB_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(SUM_ACC, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(MULT_ACC, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(MAX_ACC, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(MIN_ACC, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(CAT_ACC, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(OR_ACC, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(AND_ACC, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(READ_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(WRITE_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PRINT_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(OTHERIO_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(BLOB, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(SIZES, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
/* podd 12.01.12 %CONSTRU deleted
|
||||
DEFNODECODE(FUNC_HEDR, "%CMNT%IF (%CHECKFLAG(CLASSDECL) != %NULL)%PROTECTION%ENDIF%PUTTAB%DECLSPEC%SYMBTYPE %IF (%CHECKFLAG(CLASSDECL) == %NULL)%SYMBSCOPE%IF(%LL3 != %NULL)<%TMPLARGS >%ENDIF%SYMBDC%ENDIF %SETFLAG(VARDECL)%FUNHD%UNSETFLAG(VARDECL)%CONSTRU%ENDIF%CNSTF{%INCTAB%NL%PUSHFLAG(CLASSDECL)%BLOB1%POPFLAG(CLASSDECL)%DECTAB%PUTTAB}%NL",
|
||||
's',0,BIFNODE)
|
||||
*/
|
||||
DEFNODECODE(FUNC_HEDR, "%CMNT%IF (%CHECKFLAG(CLASSDECL) != %NULL)%PROTECTION%ENDIF%PUTTAB%DECLSPEC%SYMBTYPE %IF (%CHECKFLAG(CLASSDECL) == %NULL)%SYMBSCOPE%IF(%LL3 != %NULL)<%TMPLARGS >%ENDIF%SYMBDC%ENDIF %SETFLAG(VARDECL)%FUNHD%UNSETFLAG(VARDECL)%ENDIF%CNSTF%NL%PUTTAB{%INCTAB%NL%PUSHFLAG(CLASSDECL)%BLOB1%POPFLAG(CLASSDECL)%DECTAB%PUTTAB}%NL%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(TEMPLATE_FUNDECL, "%CMNT%PUTTABtemplate <%SETFLAG(VARDECL)%TMPLARGS%UNSETFLAG(VARDECL) > %BLOB1",
|
||||
's',0,BIFNODE)
|
||||
|
||||
|
||||
DEFNODECODE(WHERE_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ALLDO_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(IDENTIFY, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(FORMAT_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(STOP_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(RETURN_STAT, "%CMNT%PUTTABreturn%IF (%LL1 != %NULL) %LL1%ENDIF;%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(ELSEIF_NODE, "%CMNT%DECTAB%PUTTAB}%NL%PUTTABelse if (%LL1) %NL%PUTTAB{%INCTAB%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
/*NO_OPnodes*/
|
||||
DEFNODECODE(COMMENT_STAT, "%CMNT%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(CONT_STAT, "%CMNT%PUTTABcontinue;%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(VAR_DECL, "%CMNT%SETFLAG(VARDECL)%IF (%CHECKFLAG(ENUM) == %NULL)%IF (%CHECKFLAG(CLASSDECL) != %NULL)%PROTECTION%ENDIF%PUTTAB%DECLSPEC%TYPE %ENDIF%LL1%IF (%CHECKFLAG(ENUM) == %NULL);%ENDIF%UNSETFLAG(VARDECL)%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PARAM_DECL, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(COMM_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(EQUI_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(IMPL_DECL, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DATA_DECL, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(SAVE_DECL, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(STMTFN_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DIM_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(EXTERN_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(INTRIN_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(ENUM_DECL, "%CMNT%PUTTAB%DECLSPEC%SETFLAG(ENUM)enum %SYMBID %IF (%BLOB1 != %NULL){%INCTAB%NL %BLOB1%DECTAB%PUTTAB}%LL1;%NL%ELSE%LL1;%NL%ENDIF%UNSETFLAG(ENUM)",
|
||||
'd',0,BIFNODE)
|
||||
/* the public: in the line below is to mask a dep2C++ bug */
|
||||
DEFNODECODE(CLASS_DECL, "%CMNT%INCLASSON%IF (%CHECKFLAG(CLASSDECL) != %NULL)%PROTECTION%ENDIF%PUSHFLAG(CLASSDECL)%PUTTAB%DECLSPEC%RIDPT%SETFLAG(CLASSDECL)class %SYMBID%IF (%LL2 !=%NULL):%SETFLAG(SUBCLASS)%LL2%UNSETFLAG(SUBCLASS)%ENDIF %IF (%BLOB1 != %NULL){%INCTAB%NLpublic:%NL%BLOB1 %NL%DECTAB%PUTTAB}%SETFLAG(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ELSE%SETFLAG(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ENDIF%UNSETFLAG(CLASSDECL)%POPFLAG(CLASSDECL)%IF (%CHECKFLAG(CLASSDECL) == %NULL)%INCLASSOFF",
|
||||
'd',0,BIFNODE)
|
||||
DEFNODECODE(TECLASS_DECL, "%CMNT%INCLASSON%IF (%CHECKFLAG(CLASSDECL) != %NULL)%PROTECTION%ENDIF%PUSHFLAG(CLASSDECL)%PUTTAB%DECLSPEC%RIDPT%SETFLAG(CLASSDECL)TEClass %SYMBID%IF (%LL2 !=%NULL):%SETFLAG(SUBCLASS)%LL2%UNSETFLAG(SUBCLASS)%ENDIF %IF (%BLOB1 != %NULL){%INCTAB%NLpublic:%NL%BLOB1 %NL%DECTAB%PUTTAB}%SETFLAG(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ELSE%SETFLAG(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ENDIF%UNSETFLAG(CLASSDECL)%POPFLAG(CLASSDECL)%INCLASSOFF",
|
||||
'd',0,BIFNODE)
|
||||
DEFNODECODE(UNION_DECL, "%CMNT%PUTTAB%DECLSPEC%RIDPTunion %SYMBID %IF (%BLOB1 != %NULL){%INCTAB%NL%BLOB1%NL%DECTAB%PUTTAB} %LL1;%NL%ELSE%LL1;%NL%ENDIF",
|
||||
'd',0,BIFNODE)
|
||||
DEFNODECODE(STRUCT_DECL, "%CMNT%PUTTAB%DECLSPEC%RIDPTstruct %SYMBID %IF (%LL2 !=%NULL):%SETFLAG(SUBCLASS)%LL2%UNSETFLAG(SUBCLASS)%ENDIF %IF (%BLOB1!=%NULL){%INCTAB%NL%BLOB1%DECTAB%PUTTAB} %SETFLAG(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ELSE%SETFLAG(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ENDIF",
|
||||
'd',0,BIFNODE)
|
||||
DEFNODECODE(EXTERN_C_STAT, "%CMNT%PUTTABextern \"C\" %IF (%BLOB1!=%NULL){%INCTAB%NL%BLOB1%DECTAB%PUTTAB}%NL%ENDIF",
|
||||
'd',0,BIFNODE)
|
||||
DEFNODECODE(DERIVED_CLASS_DECL, "%ERROR",
|
||||
'd',0,BIFNODE)
|
||||
DEFNODECODE(EXPR_STMT_NODE, "%CMNT%PUTTAB%LL1;%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DO_WHILE_NODE, "%CMNT%PUTTABdo {%NL%INCTAB%NL%BLOB1%DECTAB%PUTTAB} while (%LL1);%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(SWITCH_NODE, "%CMNT%PUTTABswitch (%LL1)%NL%PUTTAB{%NL%INCTAB%BLOB1%DECTAB%PUTTAB}%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(CASE_NODE, "%CMNT%PUTTABcase %LL1:%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DEFAULT_NODE, "%CMNT%PUTTABdefault:%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(BREAK_NODE, "%CMNT%PUTTABbreak;%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(CONTINUE_NODE, "%CMNT%PUTTABcontinue;%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(RETURN_NODE, "%CMNT%PUTTABreturn%IF (%LL1 != %NULL) %LL1%ENDIF;%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ASM_NODE, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(SPAWN_NODE, "%CMNT%PUTTABspawn %LL1;%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PARFOR_NODE, "%CMNT%PUTTABparfor (%LL1 ; %LL2 ; %LL3)%NL%PUTTAB{%INCTAB%NL%BLOB1%DECTAB%PUTTAB}%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PAR_NODE, "%CMNT%PUTTABpar%NL%PUTTAB{%INCTAB%NL%BLOB1%DECTAB%PUTTAB}%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(LABEL_STAT, "%CMNT%LABNAME:%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PROS_COMM, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ATTR_DECL, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(NAMELIST_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(OPEN_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(CLOSE_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ENDFILE_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(REWIND_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
/* DEFNODECODE(ENTRY_STAT, "%ERROR",
|
||||
's',0,BIFNODE) */
|
||||
DEFNODECODE(ENTRY_STAT, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(BLOCK_DATA, "%ERROR",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(COLLECTION_DECL, "%INCLASSON%CMNT%IF (%CHECKFLAG(CLASSDECL) != %NULL)%PROTECTION%ENDIF%PUSHFLAG(CLASSDECL)%PUTTAB%RIDPT%SETFLAG(CLASSDECL)Collection %SYMBID%IF (%LL2 !=%NULL):public %LL2%ENDIF %IF (%BLOB1 != %NULL){%INCTAB%NL%BLOB1 %NL%DECTAB%PUTTAB}%SETFLAG(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ELSE%SETFLAG(VARDECL)%LL1;%UNSETFLAG(VARDECL)%NL%ENDIF%UNSETFLAG(CLASSDECL)%POPFLAG(CLASSDECL)%INCLASSOFF",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(INCLUDE_LINE, "%CMNT#include %LL1%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(PREPROCESSOR_DIR, "%CMNT%LL1%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
/*****************variant tags for low level nodes********************/
|
||||
|
||||
/***** List of commands for LOW LEVEL NODES *****/
|
||||
/* %ERROR : Error ; syntax : %ERROR'message' */
|
||||
/* %NL : NewLine */
|
||||
/* %% : '%' (Percent Sign) */
|
||||
/* %TAB : Tab */
|
||||
/* %IF : If ; syntax : %IF (condition) then_bloc [%ELSE else_bloc] %ENDIF */
|
||||
/* %ELSE : Else */
|
||||
/* %ENDIF : End of If */
|
||||
/* %LL1 : Low Level Node 1 */
|
||||
/* %LL2 : Low Level Node 2 */
|
||||
/* %SYMBID : Symbol identifier */
|
||||
/* %TYPE : Type */
|
||||
/* %L1SYMBCST : Constant Value of Low Level Node Symbol */
|
||||
/* %INTVAL : Integer Value */
|
||||
/* %STATENO : Statement Number */
|
||||
/* %STRVAL : String Value */
|
||||
/* %BOOLVAL : Boolean Value */
|
||||
/* %CHARVAL : Char Value */
|
||||
/* %ORBPL1 : Openning Round Brackets on Precedence of Low Level Node 1 */
|
||||
/* %CRBPL1 : Closing Round Brackets on Precedence of Low Level Node 1 */
|
||||
/* %ORBPL2 : Openning Round Brackets on Precedence of Low Level Node 2 */
|
||||
/* %CRBPL2 : Closing Round Brackets on Precedence of Low Level Node 2 */
|
||||
/***********************************************/
|
||||
|
||||
/***** List of commands for evaluation in IF THEN ELSE ENDIF statements for LOW LEVEL NODE *****/
|
||||
/* %STRCST : String Constant in '' */
|
||||
/* %SYMBID : Symbol Identifier (string) */
|
||||
/* %SYMBOL : Symbol node (integer) */
|
||||
/* == : Equal (operation) */
|
||||
/* != : Different (operation) */
|
||||
/* %NULL : 0, Integer Constant (or false boolean) */
|
||||
/* %LL1 : Low Level Node 1 (integer) */
|
||||
/* %LL2 : Low Level Node 2 (integer) */
|
||||
/* %LABUSE : Label ptr (do end) (integer) */
|
||||
/* %L1CODE : Code (variant) of Low Level Node 1 (integer) */
|
||||
/* %L2CODE : Code (variant) of Low Level Node 2 (integer) */
|
||||
/* %INWRITE : In_Write_Statement (integer / boolean flag) */
|
||||
/* %INPARAM : In_Param_Statement (integer / boolean flag) */
|
||||
/* %INIMPLI : In_Impli_Statement (integer / boolean flag) */
|
||||
/************************************************************************************************/
|
||||
|
||||
/* CODES AYANT DISPARU :
|
||||
RENAME_NODE, ONLY_NODE, DEFAULT, LEN_OP, TARGET_OP,
|
||||
SAVE_OP, POINTER_OP, INTRINSIC_OP, INOUT_OP, OUT_OP,
|
||||
IN_OP, OPTIONAL_OP, EXTERNAL_OP, DIMENSION_OP, ALLOCATABLE_OP,
|
||||
PRIVATE_OP, PUBLIC_OP, PARAMETER_OP, MAXPARALLEL_OP, EXTEND_OP,
|
||||
ORDERED_OP, PAREN_OP, OVERLOADED_CALL, STRUCTURE_CONSTRUCTOR, INTERFACE_REF,
|
||||
TYPE_REF, KEYWORD_ARG,
|
||||
*/
|
||||
|
||||
DEFNODECODE(LEN_OP, "%IF (%LL1 != %NULL)*(%LL1)%ENDIF",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(INT_VAL, "%INTKIND",
|
||||
'c',0,LLNODE)
|
||||
DEFNODECODE(FLOAT_VAL, "%STRVAL",
|
||||
'c',0,LLNODE)
|
||||
DEFNODECODE(DOUBLE_VAL, "%STRVAL",
|
||||
'c',0,LLNODE)
|
||||
DEFNODECODE(BOOL_VAL, "%BOOLVAL",
|
||||
'c',0,LLNODE)
|
||||
DEFNODECODE(CHAR_VAL, "%IF (%INIMPLI == %NULL)'%ENDIF%CHARVAL%IF (%INIMPLI == %NULL)'%ENDIF",
|
||||
'c',0,LLNODE)
|
||||
DEFNODECODE(STRING_VAL, "%IF (%CHECKFLAG(QUOTE) != %NULL)\"%STRVAL\"%ELSE\"%STRVAL\"%ENDIF",
|
||||
'c',0,LLNODE)
|
||||
DEFNODECODE(KEYWORD_VAL, "%STRVAL",
|
||||
'c',0,LLNODE)
|
||||
DEFNODECODE(COMPLEX_VAL, "(%LL1, %LL2)",
|
||||
'c',0,LLNODE)
|
||||
|
||||
DEFNODECODE(CONST_REF, "%SYMBID",
|
||||
'r',2,LLNODE)
|
||||
DEFNODECODE(VAR_REF, "%IF(%CHECKFLAG(SUBCLASS) != %NULL)%DOPROC%ENDIF%SYMBID%IF(%LL2 != %NULL)%PUSHFLAG(PAREN)<%LL2 >%POPFLAG(PAREN)%ENDIF",
|
||||
'r',0,LLNODE)
|
||||
DEFNODECODE(ARRAY_REF, "%SYMBID%IF (%LL1 != %NULL)%PUSHFLAG(ARRAYREF)%SETFLAG(ARRAYREF)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(ARRAYREF)%UNSETFLAG(PAREN)%POPFLAG(PAREN)%POPFLAG(ARRAYREF)%ENDIF",
|
||||
'r',1,LLNODE)
|
||||
DEFNODECODE(RECORD_REF, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1.%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)",
|
||||
'r',2,LLNODE)
|
||||
DEFNODECODE(ENUM_REF, "%LL1",
|
||||
'r',2,LLNODE)
|
||||
DEFNODECODE(LABEL_REF, "%LABELNAME",
|
||||
'r',0,LLNODE)
|
||||
DEFNODECODE(TYPE_REF, "%TYPE",
|
||||
'r',0,LLNODE)
|
||||
DEFNODECODE(TYPE_OP, "%TYPE",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(THROW_OP, "throw %IF(%LL1 != %NULL)%LL1%ENDIF",
|
||||
'r',2,LLNODE)
|
||||
|
||||
DEFNODECODE(VAR_LIST, "%LL1%IF (%LL2 != %NULL), %LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(FORDECL_OP, "%VARLISTTY",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(EXPR_LIST,
|
||||
"%IF(%CHECKFLAG(PAREN)!=%NULL)%IF(%CHECKFLAG(ARRAYREF)!=%NULL)[%ELSE%IF(%CHECKFLAG(ELIST)==%NULL)(%ELSE, %ENDIF%ENDIF%ELSE%IF(%CHECKFLAG(ELIST) != %NULL), %ENDIF%ENDIF%PUSHFLAG(ARRAYREF)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%PUSHFLAG(ELIST)%LL1%POPFLAG(ELIST)%POPFLAG(ARRAYREF)%POPFLAG(PAREN)%IF(%CHECKFLAG(PARAM)!=%NULL) = %L1SYMBCST%ENDIF%IF(%CHECKFLAG(ARRAYREF)!=%NULL)]%ENDIF%IF(%LL2!=%NULL)%IF(%CHECKFLAG(ELIST)==%NULL)%SETFLAG(ELIST)%ENDIF%LL2%ENDIF%IF(%CHECKFLAG(PAREN) != %NULL)%IF(%LL2 == %NULL)%IF(%CHECKFLAG(ARRAYREF) == %NULL))%ENDIF%ENDIF%ENDIF%IF(%LL2 == %NULL)%IF(%CHECKFLAG(ELIST) != %NULL)%UNSETFLAG(ELIST)%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
|
||||
/* second way (wrong)
|
||||
DEFNODECODE(EXPR_LIST,
|
||||
"%IF (%CHECKFLAG(PAREN) != %NULL)%IF (%CHECKFLAG(ARRAYREF) != %NULL)[%ELSE(%ENDIF%ENDIF%PUSHFLAG(ARRAYREF)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%POPFLAG(ARRAYREF)%IF (%CHECKFLAG(PARAM) != %NULL) = %L1SYMBCST%ENDIF%IF (%LL2 != %NULL)%IF (%CHECKFLAG(ARRAYREF) != %NULL)][%ELSE,%ENDIF%LL2%ENDIF%POPFLAG(PAREN)%IF (%CHECKFLAG(PAREN) != %NULL)%IF (%CHECKFLAG(ARRAYREF) != %NULL)]%ELSE)%ENDIF%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
*/
|
||||
/*
|
||||
DEFNODECODE(EXPR_LIST, "%PUSHFLAG(ARRAYREF)%LL1%POPFLAG(ARRAYREF)%IF (%CHECKFLAG(PARAM) != %NULL) = %L1SYMBCST%ENDIF%ENDIF%IF (%LL2 != %NULL)%IF (%CHECKFLAG(ARRAYREF) != %NULL)][%ELSE,%ENDIF%LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
*/
|
||||
DEFNODECODE(RANGE_LIST, "%LL1%IF (%LL2 != %NULL), %LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(CASE_CHOICE, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(DEF_CHOICE, "%LL1%IF (%LL2 != %NULL):%LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(VARIANT_CHOICE, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(DDOT, "%LL1%IF (%INWRITE != %NULL),%ELSE%IF (%INIMPLI != %NULL)-%ELSE%IF (%CHECKFLAG(LOOP) != %NULL),%ELSE:%ENDIF%ENDIF%ENDIF%LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(RANGE_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(UPPER_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(LOWER_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(EQ_OP, "%ORBCPL1%LL1%CRBCPL1 == %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(LT_OP, "%ORBCPL1%LL1%CRBCPL1 < %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(GT_OP, "%ORBCPL1%LL1%CRBCPL1 > %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(NOTEQL_OP, "%ORBCPL1%LL1%CRBCPL1 != %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(LTEQL_OP, "%ORBCPL1%LL1%CRBCPL1 <= %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(GTEQL_OP, "%ORBCPL1%LL1%CRBCPL1 >= %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(ADD_OP, "%ORBCPL1%LL1%CRBCPL1 + %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(SUBT_OP, "%ORBCPL1%LL1%CRBCPL1 - %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(OR_OP, "%ORBCPL1%LL1%CRBCPL1 || %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(MULT_OP, "%ORBCPL1%LL1%CRBCPL1 * %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(DIV_OP, "%ORBCPL1%LL1%CRBCPL1 / %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(MOD_OP, "%ORBCPL1%LL1%CRBCPL1 %% %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(AND_OP, "%ORBCPL1%LL1%CRBCPL1 && %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(EXP_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(ARRAY_MULT, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
/*DEFNODECODE(CONCAT_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1//%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)",
|
||||
'e',2,LLNODE)*/
|
||||
DEFNODECODE(CONCAT_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(XOR_OP, "%ORBCPL1%LL1%CRBCPL1 ^ %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(EQV_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(NEQV_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(MINUS_OP, "(-%ORBCPL1%LL1%CRBCPL1)",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(NOT_OP, "!%ORBCPL1%LL1%CRBCPL1",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 = %PUSHFLAG(VARDECL)%LL2%POPFLAG(VARDECL)",
|
||||
'e',2,LLNODE)
|
||||
/*
|
||||
DEFNODECODE(DEREF_OP, "%IF (%CHECKFLAG(VARDECL) == %NULL)(*%LL1)%ELSE*%LL1%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
*/
|
||||
DEFNODECODE(DEREF_OP, "%IF (%CHECKFLAG(VARDECL) == %NULL)*%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(PAREN)%POPFLAG(PAREN)%ELSE*%CNSTCHK%LL1%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(ARROWSTAR_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(PAREN)%POPFLAG(PAREN)->*%LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(DOTSTAR_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(PAREN)%POPFLAG(PAREN).*%LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(POINTST_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(PAREN)%POPFLAG(PAREN)->%LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(SCOPE_OP, "%LL1::%LL2",
|
||||
'e',2,LLNODE)
|
||||
|
||||
/* should be
|
||||
DEFNODECODE(FUNCTION_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(PAREN)%IF (%CHECKFLAG(VARDECL) != %NULL)(%VARLISTTY)%ELSE%LL2%ENDIF%POPFLAG(PAREN)",
|
||||
'e',2,LLNODE)
|
||||
but the following works for now */
|
||||
|
||||
DEFNODECODE(FUNCTION_OP, "%PUSHFLAG(PAREN)(%LL1)%PUSHFLAG(FREF)%SETFLAG(FREF)%IF (%CHECKFLAG(VARDECL) != %NULL)(%VARLISTTY)%ELSE%IF(%LL2 != %NULL)%SETFLAG(PAREN)%LL2%UNSETFLAG(PAREN)%ELSE()%ENDIF%ENDIF%UNSETFLAG(FREF)%POPFLAG(FREF)%POPFLAG(PAREN)",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(MINUSMINUS_OP, "%IF (%LL2 != %NULL)%ORBCPL2%LL2%CRBCPL2%ENDIF--%IF (%LL1 != %NULL)%ORBCPL1%LL1%CRBCPL1%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(PLUSPLUS_OP, "%IF (%LL2 != %NULL)%ORBCPL2%LL2%CRBCPL2%ENDIF++%IF (%LL1 != %NULL)%ORBCPL1%LL1%CRBCPL1%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(BITAND_OP, "%ORBCPL1%LL1%CRBCPL1 & %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(BITOR_OP, "%ORBCPL1%LL1%CRBCPL1 | %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(PLUS_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 += %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(MINUS_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 -= %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(AND_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 &= %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(IOR_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 |= %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(MULT_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 *= %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(DIV_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 /= %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(MOD_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 %= %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(XOR_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 ^= %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(LSHIFT_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 <<= %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(RSHIFT_ASSGN_OP, "%ORBCPL1%LL1%CRBCPL1 >>= %LL2",
|
||||
'e',2,LLNODE)
|
||||
|
||||
|
||||
DEFNODECODE(STAR_RANGE, "*",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(PROC_CALL, "%SYMBID%IF(%LL1 != %NULL)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(PAREN)%POPFLAG(PAREN)%ELSE()%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FUNC_CALL, "%SYMBID%IF(%LL2 != %NULL)%PUSHFLAG(PAREN)<%LL2 >%POPFLAG(PAREN)%ENDIF%IF(%LL1 != %NULL)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(PAREN)%POPFLAG(PAREN)%ELSE()%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(ACC_CALL_OP, "%SYMBID%IF(%LL2 != %NULL)%PUSHFLAG(PAREN)<<<%LL2>>>%POPFLAG(PAREN)%ENDIF%IF(%LL1 != %NULL)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(PAREN)%POPFLAG(PAREN)%ELSE()%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(CONSTRUCTOR_REF, "(/%LL1/)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(ACCESS_REF, "%LL1%IF (%LL2 != %NULL) (%LL2)%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(CONS, "%LL1, %LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(ACCESS, "%LL1, FORALL = (%SYMBID = %LL2)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(IOACCESS, "%IF (%LL1 != %NULL)(%LL1, %ENDIF%SYMBID = %LL2%IF (%LL1 != %NULL))%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(CONTROL_LIST, "%LL1%IF (%LL2 != %NULL), %LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(SEQ, "%LL1%IF (%LL2 != %NULL):%LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(SPEC_PAIR, "%IF (%CHECKFLAG(PRINT) != %NULL)%LL2%ELSE%LL1 = %LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(COMM_LIST, "%IF (%SYMBOL != %NULL)/%SYMBID/%ENDIF%LL1%IF (%LL2 != %NULL), %LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(STMT_STR, "%STRVAL",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(EQUI_LIST, "(%LL1)%IF (%LL2 != %NULL), %LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(IMPL_TYPE, "%TYPE %IF (%LL1 != %NULL)(%LL1)%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(STMTFN_DECL, "%SYMBID (%VARLIST) = %LL1",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(BIT_COMPLEMENT_OP, "~%ORBCPL1%LL1%CRBCPL1",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(EXPR_IF, "(%LL1)?%LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(EXPR_IF_BODY, "%LL1:%LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FUNCTION_REF, "%SETFLAG(FREF)%SYMBID%IF (%CHECKFLAG(VARDECL) != %NULL)%IF(%CHECKFLAG(TMPLDEC) == %NULL)(%VARLISTTY)%CNSTF%PURE%ENDIF%ENDIF%UNSETFLAG(FREF)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(LSHIFT_OP, "%ORBCPL1%LL1%CRBCPL1 << %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(RSHIFT_OP, "%ORBCPL1%LL1%CRBCPL1 >> %ORBCPL2%LL2%CRBCPL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(UNARY_ADD_OP, "(+(%LL1))",
|
||||
'e',2,LLNODE)
|
||||
/*
|
||||
DEFNODECODE(SIZE_OP, "%IF(%CHECKFLAG(NEW) != %NULL)sizeof(%LL1)%ELSEsizeof %LL1",
|
||||
'e',2,LLNODE)
|
||||
*/
|
||||
DEFNODECODE(SIZE_OP, "sizeof(%LL1)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(INTEGER_DIV_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1/%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(SUB_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1-%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(LE_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1<=%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(GE_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1>=%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(NE_OP, "%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1!=%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(CLASSINIT_OP, "%LL1%IF(%LL2 != %NULL)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)%ELSE()%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
/*
|
||||
DEFNODECODE(CAST_OP, "%IF(%CHECKFLAG(NEW) != %NULL)%IF (%LL2 != %NULL)%PUSHFLAG(VARDECL)%SETFLAG(VARDECL)(%VARLISTTY)%UNSETFLAG(VARDECL)%POPFLAG(VARDECL)%ELSE%SETFLAG(CASTOP)%TYPE%UNSETFLAG(CASTOP)%ENDIF%IF (%LL1 != %NULL)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL1%UNSETFLAG(PAREN)%POPFLAG(PAREN)%ENDIF%ELSE%IF (%LL2 != %NULL)%TYPE%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)%ELSE%SETFLAG(CASTOP)(%TYPE)%UNSETFLAG(CASTOP)%PUSHFLAG(PAREN)%SETFLAG(PAREN) %LL1%UNSETFLAG(PAREN)%POPFLAG(PAREN)%ENDIF%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
*/
|
||||
DEFNODECODE(CAST_OP, "%IF (%LL2 != %NULL)%PUSHFLAG(VARDECL)%SETFLAG(VARDECL)(%VARLISTTY)%UNSETFLAG(VARDECL)%POPFLAG(VARDECL)%ELSE%SETFLAG(CASTOP)%TYPE%UNSETFLAG(CASTOP)%ENDIF%IF (%LL1 != %NULL)%ORBCPL1%LL1%CRBCPL1%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(ADDRESS_OP, "%IF (%CHECKFLAG(VARDECL) == %NULL)&%ORBCPL1%LL1%CRBCPL1%ELSE&%CNSTCHK%LL1%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
/*
|
||||
DEFNODECODE(ADDRESS_OP, "&(%LL1)",
|
||||
'e',2,LLNODE)
|
||||
*/
|
||||
DEFNODECODE(POINSTAT_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(COPY_NODE, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(INIT_LIST, "%PUSHFLAG(PAREN){%LL1}%POPFLAG(PAREN)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(VECTOR_CONST, "[%LL1]",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(BIT_NUMBER, "%LL1:%LL2",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(ARITH_ASSGN_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(ARRAY_OP, "%PUSHFLAG(PAREN)(%LL1)%POPFLAG(PAREN)%PUSHFLAG(ARRAYREF)%SETFLAG(ARRAYREF)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL2%UNSETFLAG(ARRAYREF)%UNSETFLAG(PAREN)%POPFLAG(PAREN)%POPFLAG(ARRAYREF)",
|
||||
'e',2,LLNODE)
|
||||
/*
|
||||
DEFNODECODE(NEW_OP, "%SETFLAG(NEW)new %LL1 %IF (%LL2 != %NULL)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL2%UNSETFLAG(PAREN)%POPFLAG(PAREN)%ENDIF%UNSETFLAG(NEW)",
|
||||
'e',2,LLNODE)
|
||||
*/
|
||||
DEFNODECODE(NEW_OP, "%SETFLAG(NEW)new %IF (%LL2 != %NULL)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%LL2 %UNSETFLAG(PAREN)%POPFLAG(PAREN)%ENDIF%LL1%UNSETFLAG(NEW)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(DELETE_OP, "%IF (%LL2 != %NULL)%SETFLAG(NEW)%ENDIFdelete %IF(%LL2 != %NULL) %LL2 %ENDIF %LL1%IF(%LL2 != %NULL) %UNSETFLAG(NEW)%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(NAMELIST_LIST, "%IF (%SYMBOL != %NULL)/%SYMBID/%ENDIF%LL1%IF (%LL2 != %NULL), %LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(THIS_NODE, "this %LL1",
|
||||
'e',2,LLNODE)
|
||||
|
||||
/* new tag for some expression
|
||||
these are tokens not expressions.
|
||||
I have killed them. dbg.
|
||||
|
||||
DEFNODECODE(CEIL_DIV_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(MAX_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(BIF_SAVE_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(MIN_OP, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(BIF_ADDR_EXPR, "%ERROR",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(BIF_NOP_EXPR, "%ERROR",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(BIF_RTL_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(TRUNC_MOD_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(TRUNC_DIV_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FLOOR_DIV_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FLOOR_MOD_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(CEIL_MOD_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(ROUND_DIV_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(ROUND_MOD_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(RDIV_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(EXACT_DIV_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(CONVERT_EXPR, "%ERROR",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(CONST_DECL, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(ABS_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(TRUTH_ANDIF_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(TRUTH_AND_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(TRUTH_NOT_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(TRUTH_ORIF_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(PREINCREMENT_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(PREDECREMENT_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(COMPOUND_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FLOAT_EXPR, "%ERROR",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(BIT_IOR_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(BIT_XOR_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(BIT_ANDTC_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(TRUTH_OR_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FIX_TRUNC_EXPR, "%ERROR",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(RROTATE_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(LROTATE_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(RANGE_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(POSTDECREMENT_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(REFERENCE_TYPE, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FIX_FLOOR_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FIX_ROUND_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FIX_CEIL_EXPR , "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(FUNCTION_DECL , "%ERROR",
|
||||
'd',2,LLNODE)
|
||||
DEFNODECODE(MODIFY_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(REFERENCE_EXPR, "%ERROR",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(RESULT_DECL, "%ERROR",
|
||||
'd',2,LLNODE)
|
||||
DEFNODECODE(PARM_DECL, "%ERROR",
|
||||
'd',2,LLNODE)
|
||||
*/
|
||||
|
||||
/*****************variant tags for symbol table entries********************/
|
||||
|
||||
DEFNODECODE(BIF_PARM_DECL, "%ERROR",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(CONST_NAME, "%ERROR",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(ENUM_NAME, "enum %SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(FIELD_NAME, "%ERROR",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(VARIABLE_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(TYPE_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(PROGRAM_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(PROCEDURE_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(VAR_FIELD, "%ERROR",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(LABEL_VAR, "%ERROR",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(FUNCTION_NAME, "%ERROR",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(MEMBER_FUNC, "%ERROR",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(CLASS_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(TECLASS_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(UNION_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(STRUCT_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(LABEL_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(COLLECTION_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(ROUTINE_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(CONSTRUCT_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(INTERFACE_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
DEFNODECODE(MODULE_NAME, "%SYMBID",
|
||||
'r',0,SYMBNODE)
|
||||
/*****************variant tags for type nodes********************/
|
||||
|
||||
/***** List of commands for TYPE NODES *****/
|
||||
/* %ERROR : Error ; syntax : %ERROR'message' */
|
||||
/* %NL : NewLine */
|
||||
/* %% : '%' (Percent Sign) */
|
||||
/* %TAB : Tab */
|
||||
/* %IF : If ; syntax : %IF (condition) then_bloc [%ELSE else_bloc] %ENDIF */
|
||||
/* %ELSE : Else */
|
||||
/* %ENDIF : End of If */
|
||||
/* %BASETYPE : Base Type Name Identifier */
|
||||
/* %NAMEID : Name Identifier */
|
||||
/* %TABNAME : Self Name from Table */
|
||||
/* %RANGES : Ranges */
|
||||
/* %RANGLL1 : Low Level Node 1 of Ranges */
|
||||
/*******************************************/
|
||||
|
||||
/***** List of commands for evaluation in IF THEN ELSE ENDIF statements for TYPE NODE *****/
|
||||
/* %STRCST : String Constant in '' */
|
||||
/* == : Equal (operation) */
|
||||
/* != : Different (operation) */
|
||||
/* %NULL : 0, Integer Constant (or false boolean) */
|
||||
/* %INIMPLI : In_Impli_Statement (integer / boolean flag) */
|
||||
/******************************************************************************************/
|
||||
|
||||
/* CODES AYANT DISPARU :
|
||||
T_SEQUENCE, T_EVENT, T_GATE,
|
||||
*/
|
||||
|
||||
DEFNODECODE(DEFAULT, "",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_INT, "%TABNAME",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_FLOAT, "%TABNAME",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_DOUBLE, "%TABNAME",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_CHAR, "%TABNAME",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_BOOL, "%TABNAME",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_STRING, "%TABNAME",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_COMPLEX, "%TABNAME",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_LONG, "%TABNAME",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_ENUM, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_SUBRANGE, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_LIST, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
/*
|
||||
DEFNODECODE(T_ARRAY, "%IF (%CHECKFLAG(CASTOP) == %NULL)%BASETYPE%ELSE%SUBTYPE [%RANGES]%ENDIF",
|
||||
't',0,TYPENODE)
|
||||
*/
|
||||
DEFNODECODE(T_ARRAY, "%IF (%CHECKFLAG(CASTOP) == %NULL)%BASETYPE%ELSE%SUBTYPE %PUSHFLAG(ARRAYREF)%SETFLAG(ARRAYREF)%PUSHFLAG(PAREN)%SETFLAG(PAREN)%PUSHFLAG(CASTOP)%PUSHFLAG(NEW)%RANGES%POPFLAG(NEW)%POPFLAG(CASTOP)%UNSETFLAG(PAREN)%UNSETFLAG(ARRAYREF)%POPFLAG(PAREN)%POPFLAG(ARRAYREF)%ENDIF",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_RECORD, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_ENUM_FIELD, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_UNKNOWN, "unknown",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_VOID, "void ",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_DESCRIPT, "%RIDPT%BASETYPE",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_FUNCTION, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_POINTER, "%FBASETYPE %IF (%CHECKFLAG(VARDECL) == %NULL)%STAR%ELSE%IF (%CHECKFLAG(CASTOP) != %NULL)%STAR%ELSE%IF (%CHECKFLAG(FREF) != %NULL)%STAR%ENDIF%ENDIF%ENDIF",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_UNION, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_STRUCT, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_CLASS, "--ERROR--CLASS NAME---",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_DERIVED_CLASS, "%SYMBID",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_DERIVED_TYPE, "%SYMBID",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_COLLECTION, "------ERROR-----T_COLLECTION",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(T_DERIVED_COLLECTION, "%SYMBID<%COLLBASE>",
|
||||
't',0,TYPENODE)
|
||||
/*
|
||||
DEFNODECODE(T_MEMBER_POINTER, "%COLLBASE %IF (%CHECKFLAG(VARDECL) == %NULL)%SYMBID::*%ELSE%IF (%CHECKFLAG(CASTOP) != %NULL)%SYMBID::*%ELSE%IF (%CHECKFLAG(FREF) != %NULL)%SYMBID::*%ENDIF%ENDIF%ENDIF",
|
||||
't',0,TYPENODE) i can't solve the problem with %SYMB. something
|
||||
to do with %SYMBID getting a T_CLASS where it expects a symbol
|
||||
*/
|
||||
|
||||
DEFNODECODE(T_MEMBER_POINTER, "%COLLBASE ", 't',0,TYPENODE)
|
||||
DEFNODECODE(T_DERIVED_TEMPLATE, "%SYMBID%SETFLAG(TMPLDEC)%PUSHFLAG(PAREN)<%TMPLARGS >%POPFLAG(PAREN)%UNSETFLAG(TMPLDEC)",
|
||||
't',0,TYPENODE)
|
||||
/*
|
||||
DEFNODECODE(T_REFERENCE, "%BASETYPE %IF (%CHECKFLAG(VARDECL) == %NULL)&%ELSE%IF (%CHECKFLAG(FREF) != %NULL)& %ENDIF%ENDIF",
|
||||
't',0,TYPENODE)
|
||||
*/
|
||||
DEFNODECODE(T_REFERENCE, "%FBASETYPE %IF (%CHECKFLAG(VARDECL) == %NULL)%STAR%ELSE%IF (%CHECKFLAG(CASTOP) != %NULL)%STAR%ELSE%IF (%CHECKFLAG(FREF) != %NULL)%STAR%ENDIF%ENDIF%ENDIF",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(LOCAL, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(INPUT, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(OUTPUT, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
DEFNODECODE(IO, "%ERROR",
|
||||
't',0,TYPENODE)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
436
dvm/fdvm/trunk/Sage/lib/include/unparseDVM.def
Normal file
436
dvm/fdvm/trunk/Sage/lib/include/unparseDVM.def
Normal file
@@ -0,0 +1,436 @@
|
||||
/*****************variant tags for DVM nodes*****************************/
|
||||
|
||||
DEFNODECODE(BLOCK_OP, "%IF(%LL1!=%NULL)WGT_BLOCK(%SYMBID,%LL1)%ELSE%IF(%LL2!=%NULL)MULT_BLOCK(%LL2)%ELSE%IF(%SYMBOL!=%NULL)GEN_BLOCK(%SYMBID)%ELSEBLOCK%ENDIF%ENDIF%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(INDIRECT_OP, "%IF(%LL1!=%NULL)DERIVED(%LL1)%ELSEINDIRECT(%SYMBID)%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(DERIVED_OP, "(%LL1) WITH %LL2",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(DUMMY_REF, "@%SYMBID%IF(%LL1!=%NULL)+%LL1%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(NEW_VALUE_OP, "%IF(%LL1!=%NULL) NEW(%LL1)%ELSE NEW%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(NEW_SPEC_OP, "NEW(%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(TEMPLATE_OP, "TEMPLATE",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(PROCESSORS_OP, "PROCESSORS",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(DYNAMIC_OP, "DYNAMIC",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(DIMENSION_OP, "%IF(%CHECKFLAG(DVM) != %NULL)DIMENSION%ELSEdimension%ENDIF(%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(SHADOW_OP, "SHADOW (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ALIGN_OP, "ALIGN %IF(%LL1!=%NULL) (%LL1)%ENDIF%IF(%LL2!=%NULL) WITH %LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(DISTRIBUTE_OP, "DISTRIBUTE%IF(%LL1!=%NULL) (%LL1)%ENDIF%IF(%LL2!=%NULL) ONTO %LL2%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(REMOTE_ACCESS_OP, "REMOTE_ACCESS (%IF (%SYMBOL == %NULL)%LL1%ELSE%SYMBID : %LL1 %ENDIF)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(INDIRECT_ACCESS_OP, "INDIRECT_ACCESS (%IF(%SYMBOL == %NULL)%LL1%ELSE%SYMBID : %LL1 %ENDIF)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ACROSS_OP, "ACROSS (%LL1)%IF(%LL2!=%NULL)(%LL2)%ENDIF",
|
||||
'e',2,LLNODE)
|
||||
|
||||
DEFNODECODE(SHADOW_RENEW_OP, "SHADOW_RENEW (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(SHADOW_START_OP, "SHADOW_START %SYMBID",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(SHADOW_WAIT_OP, "SHADOW_WAIT %SYMBID",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(SHADOW_COMP_OP, "SHADOW_COMPUTE %IF(%LL1!=%NULL)(%LL1)%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(REDUCTION_OP, "REDUCTION (%IF(%SYMBOL == %NULL)%LL1%ELSE%SYMBID : %LL1 %ENDIF)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(CONSISTENT_OP, "CONSISTENT (%IF(%SYMBOL == %NULL)%LL1%ELSE%SYMBID : %LL1 %ENDIF)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_PRIVATE_OP, "PRIVATE (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(STAGE_OP, "STAGE (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(COMMON_OP, "COMMON",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_CUDA_BLOCK_OP, "CUDA_BLOCK (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_TIE_OP, "TIE (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_CUDA_OP, "CUDA",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_HOST_OP, "HOST",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_ASYNC_OP, "ASYNC",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(PARALLEL_OP, "PARALLEL",
|
||||
'e',0,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_TARGETS_OP, "TARGETS (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_INLOCAL_OP, "INLOCAL (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_LOCAL_OP, "LOCAL%IF(%LL1!=%NULL) (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_OUT_OP, "OUT (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_INOUT_OP, "INOUT (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(ACC_IN_OP, "IN (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
|
||||
DEFNODECODE(DVM_NEW_VALUE_DIR, "%CMNT!DVM$%PUTTABCOMTNEW_VALUE%IF(%LL1!=%NULL) %LL1%ENDIF",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(HPF_TEMPLATE_STAT, "%CMNT!DVM$%PUTTABCOMTTEMPLATE%IF(%LL2!=%NULL), %LL2::%ENDIF %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_DYNAMIC_DIR, "%CMNT!DVM$%PUTTABCOMTDYNAMIC %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_INHERIT_DIR, "%CMNT!DVM$%PUTTABCOMTINHERIT %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(HPF_PROCESSORS_STAT, "%CMNT!DVM$%PUTTABCOMTPROCESSORS %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_SHADOW_DIR, "%CMNT!DVM$%PUTTABCOMTSHADOW %LL1( %LL2 )%NL",
|
||||
's',2,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_INDIRECT_GROUP_DIR, "%CMNT!DVM$%PUTTABCOMTINDIRECT_GROUP %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_REMOTE_GROUP_DIR, "%CMNT!DVM$%PUTTABCOMTREMOTE_GROUP %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_REDUCTION_GROUP_DIR, "%CMNT!DVM$%PUTTABCOMTREDUCTION_GROUP %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_CONSISTENT_DIR, "%CMNT!DVM$%PUTTABCOMTCONSISTENT %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_CONSISTENT_GROUP_DIR, "%CMNT!DVM$%PUTTABCOMTCONSISTENT_GROUP %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_DISTRIBUTE_DIR, "%CMNT!DVM$%PUTTABCOMTDISTRIBUTE%IF(%LL2!=%NULL) (%LL2)%ENDIF%IF(%LL3!=%NULL) ONTO %LL3 %ENDIF :: %LL1%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_REDISTRIBUTE_DIR, "%CMNT!DVM$%PUTTABCOMTREDISTRIBUTE (%LL2)%IF(%LL3!=%NULL) ONTO %LL3%ENDIF :: %LL1%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_ALIGN_DIR, "%CMNT!DVM$%PUTTABCOMTALIGN (%LL2) WITH %LL3 :: %LL1%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_REALIGN_DIR, "%CMNT!DVM$%PUTTABCOMTREALIGN (%LL2) WITH %LL3 :: %LL1%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_PARALLEL_ON_DIR, "%CMNT!DVM$%PUTTABCOMTPARALLEL (%LL3)%IF(%LL1!=%NULL) ON %LL1%ENDIF%IF(%LL2!=%NULL), %LL2%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_PARALLEL_TASK_DIR, "%CMNT!DVM$%PUTTABCOMTPARALLEL (%LL3)%IF(%LL1!=%NULL) ON %LL1%ENDIF%IF(%LL2!=%NULL), %LL2%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_SHADOW_START_DIR, "%CMNT!DVM$%PUTTABCOMTSHADOW_START %SYMBID%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_SHADOW_WAIT_DIR, "%CMNT!DVM$%PUTTABCOMTSHADOW_WAIT %SYMBID%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_SHADOW_GROUP_DIR, "%CMNT!DVM$%PUTTABCOMTSHADOW_GROUP %SYMBID ( %LL1 )%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_REDUCTION_START_DIR, "%CMNT!DVM$%PUTTABCOMTREDUCTION_START %SYMBID%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_REDUCTION_WAIT_DIR, "%CMNT!DVM$%PUTTABCOMTREDUCTION_WAIT %SYMBID%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_CONSISTENT_START_DIR, "%CMNT!DVM$%PUTTABCOMTCONSISTENT_START %SYMBID%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_CONSISTENT_WAIT_DIR, "%CMNT!DVM$%PUTTABCOMTCONSISTENT_WAIT %SYMBID%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_REMOTE_ACCESS_DIR, "%CMNT!DVM$%PUTTABCOMTREMOTE_ACCESS (%IF(%SYMBOL == %NULL)%LL1%ELSE%SYMBID : %LL1 %ENDIF)%NL",
|
||||
's',1,BIFNODE)
|
||||
DEFNODECODE(DVM_TASK_DIR, "%CMNT!DVM$%PUTTABCOMTTASK %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
DEFNODECODE(DVM_MAP_DIR, "%CMNT!DVM$%PUTTABCOMTMAP %LL1 %IF(%LL2 != %NULL)ONTO %LL2%ENDIF%IF(%LL3 != %NULL)BY %LL3%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
DEFNODECODE(DVM_PREFETCH_DIR, "%CMNT!DVM$%PUTTABCOMTPREFETCH %SYMBID%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_RESET_DIR, "%CMNT!DVM$%PUTTABCOMTRESET %SYMBID%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_DEBUG_DIR, "%CMNT!DVM$%PUTTABCOMTDEBUG %LL1 %IF(%LL2!=%NULL)(%LL2)%ENDIF%NL",
|
||||
's',2,BIFNODE)
|
||||
DEFNODECODE(DVM_ENDDEBUG_DIR, "%CMNT!DVM$%PUTTABCOMTEND DEBUG %LL1%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_INTERVAL_DIR, "%CMNT!DVM$%PUTTABCOMTINTERVAL %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
DEFNODECODE(DVM_EXIT_INTERVAL_DIR, "%CMNT!DVM$%PUTTABCOMTEXIT INTERVAL %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
DEFNODECODE(DVM_ENDINTERVAL_DIR, "%CMNT!DVM$%PUTTABCOMTEND INTERVAL%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_TRACEON_DIR, "%CMNT!DVM$%PUTTABCOMTTRACE ON%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_TRACEOFF_DIR, "%CMNT!DVM$%PUTTABCOMTTRACE OFF%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_BARRIER_DIR, "%CMNT!DVM$%PUTTABCOMTBARRIER%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_CHECK_DIR, "%CMNT!DVM$%PUTTABCOMTCHECK (%LL2) :: %LL1%NL",
|
||||
's',2,BIFNODE)
|
||||
DEFNODECODE(DVM_OWN_DIR, "%CMNT!DVM$%PUTTABCOMTOWN%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_ON_DIR, "%CMNT!DVM$%PUTTABCOMTON %LL1%IF(%LL2 != %NULL), %LL2%ENDIF%NL",
|
||||
's',2,BIFNODE)
|
||||
DEFNODECODE(DVM_END_ON_DIR, "%CMNT!DVM$%PUTTABCOMTEND ON%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_TASK_REGION_DIR, "%CMNT!DVM$%PUTTABCOMTTASK_REGION %SYMBID%IF(%LL2 != %NULL), %LL2%ENDIF%NL",
|
||||
's',2,BIFNODE)
|
||||
DEFNODECODE(DVM_END_TASK_REGION_DIR, "%CMNT!DVM$%PUTTABCOMTEND TASK_REGION%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(DVM_POINTER_DIR, "%CMNT!DVM$%PUTTABCOMT%LL3, POINTER(%LL2) :: %LL1%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_F90_DIR, "%CMNT!DVM$%PUTTABCOMTF90 %LL1 = %LL2%NL",
|
||||
's',2,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_ASYNCHRONOUS_DIR, "%CMNT!DVM$%PUTTABCOMTASYNCHRONOUS %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_ENDASYNCHRONOUS_DIR, "%CMNT!DVM$%PUTTABCOMTEND ASYNCHRONOUS%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_ASYNCWAIT_DIR, "%CMNT!DVM$%PUTTABCOMTASYNCWAIT %LL1%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_TEMPLATE_CREATE_DIR, "%CMNT!DVM$%PUTTABCOMTTEMPLATE_CREATE (%LL1)%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_TEMPLATE_DELETE_DIR, "%CMNT!DVM$%PUTTABCOMTTEMPLATE_DELETE (%LL1)%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_VAR_DECL, "%CMNT!DVM$%PUTTABCOMT%SETFLAG(VARLEN)%IF(%LL3 != %NULL)%SETFLAG(DVM)%LL3%UNSETFLAG(DVM):: %SETFLAG(PARAM)%LL1%UNSETFLAG(PARAM)%ELSE%SETFLAG(VARDECL) %LL1%UNSETFLAG(VARDECL)%ENDIF%IF (%CHECKFLAG(VARLEN) != %NULL)%UNSETFLAG(VARLEN)%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_HEAP_DIR, "%CMNT!DVM$%PUTTABCOMTHEAP %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_ASYNCID_DIR, "%CMNT!DVM$%PUTTABCOMTASYNCID%IF(%LL2 != %NULL), COMMON::%ENDIF %LL1%NL",
|
||||
's',2,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_NEW_VALUE_DIR, "%CMNT!DVM$%PUTTABCOMTNEW_VALUE%NL",
|
||||
's',0,BIFNODE)
|
||||
|
||||
DEFNODECODE(DVM_IO_MODE_DIR, "%CMNT!DVM$%PUTTABCOMTIO_MODE (%LL1)%NL",
|
||||
's',1,BIFNODE)
|
||||
DEFNODECODE(DVM_SHADOW_ADD_DIR, "%CMNT!DVM$%PUTTABCOMTSHADOW_ADD (%LL1 = %LL2)%IF(%LL3!=%NULLL) INCLUDE_TO %LL3%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
DEFNODECODE(DVM_LOCALIZE_DIR, "%CMNT!DVM$%PUTTABCOMTLOCALIZE (%LL1 => %LL2)%NL",
|
||||
's',2,BIFNODE)
|
||||
|
||||
DEFNODECODE(ACC_REGION_DIR, "%CMNT!DVM$%PUTTABCOMTREGION %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
DEFNODECODE(ACC_END_REGION_DIR, "%CMNT!DVM$%PUTTABCOMTEND REGION%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ACC_GET_ACTUAL_DIR, "%CMNT!DVM$%PUTTABCOMTGET_ACTUAL%IF(%LL1!=%NULL) (%LL1)%ENDIF%NL",
|
||||
's',1,BIFNODE)
|
||||
DEFNODECODE(ACC_ACTUAL_DIR, "%CMNT!DVM$%PUTTABCOMTACTUAL%IF(%LL1!=%NULL) (%LL1)%ENDIF%NL",
|
||||
's',1,BIFNODE)
|
||||
DEFNODECODE(ACC_CHECKSECTION_DIR, "%CMNT!DVM$%PUTTABCOMTHOSTSECTION%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ACC_END_CHECKSECTION_DIR,"%CMNT!DVM$%PUTTABCOMTEND HOSTSECTION%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(ACC_ROUTINE_DIR, "%CMNT!DVM$%PUTTABCOMTROUTINE %LL1%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_NOWAIT, "NOWAIT",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_PRIVATE, "PRIVATE (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_FIRSTPRIVATE, "FIRSTPRIVATE (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_LASTPRIVATE, "LASTPRIVATE (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_THREADPRIVATE, "/%LL1/",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_COPYIN, "COPYIN (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_SHARED, "SHARED (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_DEFAULT, "DEFAULT (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_ORDERED, "ORDERED",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_IF, "IF (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_NUM_THREADS, "NUM_THREADS (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_REDUCTION, "REDUCTION (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_COLLAPSE, "COLLAPSE (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_SCHEDULE, "SCHEDULE (%LL1%IF(%LL2!=%NULL),%LL2%ENDIF)",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(OMP_COPYPRIVATE, "COPYPRIVATE (%LL1)",
|
||||
'e',0,LLNODE)
|
||||
|
||||
|
||||
DEFNODECODE(OMP_PARALLEL_DIR, "!$OMP%PUTTABCOMTPARALLEL %IF(%LL1!=%NULL) %LL1%ENDIF%INCTAB%NL%BLOB1",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_PARALLEL_DIR, "!$OMP%DECTAB%PUTTABCOMTEND PARALLEL %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_SECTIONS_DIR, "!$OMP%PUTTABCOMTSECTIONS %IF(%LL1!=%NULL) %LL1%ENDIF%INCTAB%NL%BLOB1",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_SECTION_DIR, "!$OMP%PUTTABCOMTSECTION%INCTAB%NL%BLOB1%DECTAB",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_SECTIONS_DIR, "!$OMP%DECTAB%PUTTABCOMTEND SECTIONS %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_DO_DIR, "!$OMP%PUTTABCOMTDO %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_DO_DIR, "!$OMP%PUTTABCOMTEND DO %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_SINGLE_DIR, "!$OMP%PUTTABCOMTSINGLE %IF(%LL1!=%NULL) %LL1%ENDIF%INCTAB%NL%BLOB1",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_SINGLE_DIR, "!$OMP%DECTAB%PUTTABCOMTEND SINGLE %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_WORKSHARE_DIR, "!$OMP%PUTTABCOMTWORKSHARE %IF(%LL1!=%NULL) %LL1%ENDIF%INCTAB%NL%BLOB1",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_WORKSHARE_DIR, "!$OMP%DECTAB%PUTTABCOMTEND WORKSHARE %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_PARALLEL_DO_DIR, "!$OMP%PUTTABCOMTPARALLEL DO %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_PARALLEL_DO_DIR, "!$OMP%PUTTABCOMTEND PARALLEL DO %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_PARALLEL_SECTIONS_DIR, "!$OMP%PUTTABCOMTPARALLEL SECTIONS %IF(%LL1!=%NULL) %LL1%ENDIF%INCTAB%NL%BLOB1",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_PARALLEL_SECTIONS_DIR, "!$OMP%DECTAB%PUTTABCOMTEND PARALLEL SECTIONS %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_PARALLEL_WORKSHARE_DIR, "!$OMP%PUTTABCOMTPARALLEL WORKSHARE %IF(%LL1!=%NULL) %LL1%ENDIF%INCTAB%NL%BLOB1",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_PARALLEL_WORKSHARE_DIR, "!$OMP%DECTAB%PUTTABCOMTEND PARALLEL WORKSHARE %IF(%LL1!=%NULL) %LL1%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_THREADPRIVATE_DIR, "!$OMP%PUTTABCOMTTHREADPRIVATE %IF(%LL1!=%NULL) ( %LL1 )%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_MASTER_DIR, "!$OMP%PUTTABCOMTMASTER%INCTAB%NL%BLOB1",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_MASTER_DIR, "!$OMP%DECTAB%PUTTABCOMTEND MASTER%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_ORDERED_DIR, "!$OMP%PUTTABCOMTORDERED%INCTAB%NL%BLOB1",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_ORDERED_DIR, "!$OMP%DECTAB%PUTTABCOMTEND ORDERED%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_ATOMIC_DIR, "!$OMP%PUTTABCOMTATOMIC%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_BARRIER_DIR, "!$OMP%PUTTABCOMTBARRIER%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_CRITICAL_DIR, "!$OMP%PUTTABCOMTCRITICAL %IF(%LL1!=%NULL) ( %LL1 )%ENDIF%INCTAB%NL%BLOB1",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_END_CRITICAL_DIR, "!$OMP%DECTAB%PUTTABCOMTEND CRITICAL %IF(%LL1!=%NULL) ( %LL1 )%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(OMP_FLUSH_DIR, "!$OMP%PUTTABCOMTFLUSH %IF(%LL1!=%NULL) ( %LL1 )%ENDIF%NL",
|
||||
's',3,BIFNODE)
|
||||
|
||||
DEFNODECODE(RECORD_DECL, "%CMNT%PUTTABtype %IF (%LL1 != %NULL),%LL1::%ENDIF%SYMBID%INCTAB%NL%BLOB1%DECTAB",
|
||||
'd',0,BIFNODE)
|
||||
|
||||
|
||||
/*****************variant tags for SPF nodes*****************************/
|
||||
DEFNODECODE(SPF_ANALYSIS_DIR, "%CMNT!$SPF%PUTTABCOMTANALYSIS (%LL1)%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(SPF_PARALLEL_DIR, "%CMNT!$SPF%PUTTABCOMTPARALLEL (%LL1)%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(SPF_TRANSFORM_DIR, "%CMNT!$SPF%PUTTABCOMTTRANSFORM (%LL1)%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(SPF_PARALLEL_REG_DIR, "%CMNT!$SPF%PUTTABCOMTPARALLEL_REG %SYMBID %IF(%LL1 != %NULL), APPLY_REGION(%LL1)%ENDIF%IF(%LL2 != %NULL), APPLY_FRAGMENT(%LL2)%ENDIF%NL",
|
||||
's',2,BIFNODE)
|
||||
DEFNODECODE(SPF_END_PARALLEL_REG_DIR, "%CMNT!$SPF%PUTTABCOMTEND PARALLEL_REG%NL",
|
||||
's',0,BIFNODE)
|
||||
DEFNODECODE(SPF_CHECKPOINT_DIR, "%CMNT!$SPF%PUTTABCOMTCHECKPOINT (%LL1)%NL",
|
||||
's',1,BIFNODE)
|
||||
|
||||
DEFNODECODE(SPF_NOINLINE_OP, "NOINLINE",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(SPF_FISSION_OP, "FISSION (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(SPF_EXPAND_OP, "EXPAND %IF(%LL1 != %NULL)(%LL1)%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(SPF_SHRINK_OP, "SHRINK (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(SPF_TYPE_OP, "TYPE (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(SPF_VARLIST_OP, "VARLIST (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(SPF_EXCEPT_OP, "EXCEPT (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(SPF_FILES_COUNT_OP, "FILES_COUNT (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(SPF_INTERVAL_OP, "INTERVAL (%LL1, %LL2)",
|
||||
'e',2,LLNODE)
|
||||
DEFNODECODE(SPF_TIME_OP, "TIME",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(SPF_ITER_OP, "ITER",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(SPF_FLEXIBLE_OP, "FLEXIBLE",
|
||||
'e',0,LLNODE)
|
||||
DEFNODECODE(SPF_PARAMETER_OP, "PARAMETER (%LL1)",
|
||||
'e',1,LLNODE)
|
||||
DEFNODECODE(SPF_UNROLL_OP, "UNROLL %IF(%LL1 != %NULL)(%LL1)%ENDIF",
|
||||
'e',1,LLNODE)
|
||||
|
||||
|
||||
35
dvm/fdvm/trunk/Sage/lib/makefile.uni
Normal file
35
dvm/fdvm/trunk/Sage/lib/makefile.uni
Normal file
@@ -0,0 +1,35 @@
|
||||
#######################################################################
|
||||
## Copyright (C) 1999 ##
|
||||
## Keldysh Institute of Appllied Mathematics ##
|
||||
#######################################################################
|
||||
|
||||
# sage/lib/Makefile (phb)
|
||||
#
|
||||
# This makefile recursively calls MAKE in each subdirectory
|
||||
#
|
||||
|
||||
# What to compile
|
||||
SUBDIR=oldsrc newsrc
|
||||
|
||||
oldsrc:
|
||||
cd oldsrc; $(MAKE) "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" all
|
||||
|
||||
newsrc:
|
||||
cd newsrc; $(MAKE) "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" all
|
||||
|
||||
all: oldsrc newsrc
|
||||
@echo "****** DONE MAKING SUBDIRECTORIES $(SUBDIR) ******"
|
||||
|
||||
clean:
|
||||
@echo "****** RECURSIVELY CLEAN SUBDIRECTORIES $(SUBDIR) ******"
|
||||
cd oldsrc; $(MAKE) "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" clean
|
||||
cd newsrc; $(MAKE) "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" clean
|
||||
@echo "****** DONE CLEAN SUBDIRECTORIES $(SUBDIR) ******"
|
||||
|
||||
cleanall:
|
||||
@echo "****** RECURSIVELY CLEANALL SUBDIRECTORIES $(SUBDIR) ******"
|
||||
cd oldsrc; $(MAKE) "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" cleanall
|
||||
cd newsrc; $(MAKE) "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" cleanall
|
||||
@echo "****** DONE CLEANALL SUBDIRECTORIES $(SUBDIR) ******"
|
||||
|
||||
.PHONY: all clean cleanall oldsrc newsrc
|
||||
48
dvm/fdvm/trunk/Sage/lib/makefile.win
Normal file
48
dvm/fdvm/trunk/Sage/lib/makefile.win
Normal file
@@ -0,0 +1,48 @@
|
||||
#######################################################################
|
||||
## Copyright (C) 1999 ##
|
||||
## Keldysh Institute of Appllied Mathematics ##
|
||||
#######################################################################
|
||||
|
||||
|
||||
# sage/lib/Makefile (phb)
|
||||
|
||||
# Valentin Emelianov (4/01/99)
|
||||
|
||||
#
|
||||
# This makefile recursively calls MAKE in each subdirectory
|
||||
#
|
||||
|
||||
# What to compile
|
||||
SUBDIR=oldsrc newsrc
|
||||
|
||||
|
||||
all:
|
||||
@echo "****** RECURSIVELY MAKING SUBDIRECTORIES $(SUBDIR) ******"
|
||||
@cd oldsrc
|
||||
@$(MAKE) /nologo -f makefile.win "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" all
|
||||
@cd ..
|
||||
@cd newsrc
|
||||
@$(MAKE) /nologo -f makefile.win "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" all
|
||||
@cd ..
|
||||
@echo "****** DONE MAKING SUBDIRECTORIES $(SUBDIR) ******"
|
||||
|
||||
clean:
|
||||
@echo "****** RECURSIVELY CLEAN SUBDIRECTORIES $(SUBDIR) ******"
|
||||
@cd oldsrc
|
||||
@$(MAKE) /nologo -f makefile.win "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" clean
|
||||
@cd ..
|
||||
@cd newsrc
|
||||
@$(MAKE) /nologo -f makefile.win "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" clean
|
||||
@cd ..
|
||||
@echo "****** DONE CLEAN SUBDIRECTORIES $(SUBDIR) ******"
|
||||
|
||||
cleanall:
|
||||
@echo "****** RECURSIVELY CLEANALL SUBDIRECTORIES $(SUBDIR) ******"
|
||||
@cd oldsrc
|
||||
@$(MAKE) /nologo -f makefile.win "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" clean
|
||||
@cd ..
|
||||
@cd newsrc
|
||||
@$(MAKE) /nologo -f makefile.win "MAKE=$(MAKE)" "CC=$(CC)" "CXX=$(CXX)" "LINKER=$(LINKER)" clean
|
||||
@cd ..
|
||||
@echo "****** DONE CLEANALL SUBDIRECTORIES $(SUBDIR) ******"
|
||||
|
||||
16
dvm/fdvm/trunk/Sage/lib/newsrc/CMakeLists.txt
Normal file
16
dvm/fdvm/trunk/Sage/lib/newsrc/CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
set(SAGE_SOURCES low_level.c unparse.c)
|
||||
|
||||
if(MSVC_IDE)
|
||||
foreach(DIR ${DVM_SAGE_INCLUDE_DIRS})
|
||||
file(GLOB_RECURSE FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
"${DIR}/*.h" "${DIR}/*.def" "${DIR}/head" "${DIR}/tag")
|
||||
set(SAGE_HEADERS ${SAGE_HEADERS} ${FILES})
|
||||
endforeach()
|
||||
source_group("Header Files" FILES ${SAGE_HEADERS})
|
||||
endif()
|
||||
|
||||
add_library(sage ${SAGE_SOURCES} ${SAGE_HEADERS})
|
||||
|
||||
target_compile_definitions(sage PRIVATE SYS5)
|
||||
target_include_directories(sage PUBLIC "${DVM_SAGE_INCLUDE_DIRS}")
|
||||
set_target_properties(sage PROPERTIES FOLDER "${DVM_LIBRARY_FOLDER}")
|
||||
83
dvm/fdvm/trunk/Sage/lib/newsrc/Makefile
Normal file
83
dvm/fdvm/trunk/Sage/lib/newsrc/Makefile
Normal file
@@ -0,0 +1,83 @@
|
||||
#######################################################################
|
||||
## pC++/Sage++ Copyright (C) 1993 ##
|
||||
## Indiana University University of Oregon University of Rennes ##
|
||||
#######################################################################
|
||||
|
||||
|
||||
# sage/lib/newsrc/Makefile (phb)
|
||||
|
||||
LSX = .a
|
||||
|
||||
#HP_CFLAGS#CEXTRA = -Aa +z#ENDIF#
|
||||
#HP_CFLAGS#LSX = .sl#ENDIF#
|
||||
|
||||
SHELL = /bin/sh
|
||||
CONFIG_ARCH=iris4d
|
||||
|
||||
# ALPHA Sage new lib.a modified by Pete Beckman (2/1/93)
|
||||
|
||||
RANLIB_TEST = [ -f /usr/bin/ranlib ] || [ -f /bin/ranlib ]
|
||||
#NO_RANLIB#RANLIB_TEST = (exit 1)#ENDIF#
|
||||
|
||||
CC = gcc
|
||||
#CC=cc#ENDIF##USE_CC#
|
||||
|
||||
CXX = g++
|
||||
CXX = /usr/WorkShop/usr/bin/DCC
|
||||
OLDHEADERS = ../../h
|
||||
|
||||
#INSTALLDEST = ../$(CONFIG_ARCH)
|
||||
INSTALLDEST = ../../../libsage
|
||||
INSTALL = /bin/cp
|
||||
|
||||
# Directory in which include file can be found
|
||||
toolbox_include = ../include
|
||||
|
||||
INCLUDE = -I$(OLDHEADERS) -I../include
|
||||
CFLAGS = $(INCLUDE) -g -Wall $(CEXTRA)
|
||||
LDFLAGS =
|
||||
BISON= /usr/freeware/bin/bison
|
||||
BISON= bison
|
||||
TOOLBOX_SRC = comments.c low_level.c unparse.c toolsann.c annotate.tab.c
|
||||
|
||||
TOOLBOX_HDR = $(toolbox_include)/macro.h $(toolbox_include)/bif_node.def $(toolbox_include)/type.def $(toolbox_include)/symb.def
|
||||
|
||||
TOOLBOX_OBJ = low_level.o unparse.o
|
||||
|
||||
TOOLBOX_OBJ_ANN = comments.o toolsann.o annotate.tab.o
|
||||
|
||||
all: libsage$(LSX)
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o lib*$(LSX)
|
||||
|
||||
low_level.o: low_level.c $(TOOLBOX_HDR)
|
||||
|
||||
unparse.o: unparse.c $(TOOLBOX_HDR) $(toolbox_include)/unparse.def $(toolbox_include)/unparseC++.def
|
||||
|
||||
main.o : main.c
|
||||
|
||||
libsage : libsage$(LSX)
|
||||
|
||||
libsage.a: $(TOOLBOX_OBJ) $(TOOLBOX_HDR)
|
||||
/bin/rm -f libsage.a
|
||||
ar qc libsage.a $(TOOLBOX_OBJ)
|
||||
@if $(RANLIB_TEST) ; then ranlib libsage.a ; \
|
||||
else echo "\tNOTE: ranlib not required" ; fi
|
||||
|
||||
libsage.sl: $(TOOLBOX_OBJ) $(TOOLBOX_HDR)
|
||||
/bin/rm -f libsage.sl
|
||||
ld -b -s -o libsage.sl $(TOOLBOX_OBJ)
|
||||
|
||||
|
||||
install: $(INSTALLDEST)/libsage$(LSX)
|
||||
|
||||
$(INSTALLDEST)/libsage$(LSX): libsage$(LSX)
|
||||
if [ -d $(INSTALLDEST) ] ; then true; else mkdir $(INSTALLDEST) ;fi
|
||||
$(INSTALL) libsage$(LSX) $(INSTALLDEST)/libsage$(LSX)
|
||||
@if $(RANLIB_TEST) ; then ranlib $(INSTALLDEST)/libsage$(LSX) ; \
|
||||
else echo "\tNOTE: ranlib not required" ; fi
|
||||
|
||||
|
||||
|
||||
|
||||
3140
dvm/fdvm/trunk/Sage/lib/newsrc/annotate.tab.c
Normal file
3140
dvm/fdvm/trunk/Sage/lib/newsrc/annotate.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
75
dvm/fdvm/trunk/Sage/lib/newsrc/annotate.tab.h
Normal file
75
dvm/fdvm/trunk/Sage/lib/newsrc/annotate.tab.h
Normal file
@@ -0,0 +1,75 @@
|
||||
typedef union {
|
||||
int token ;
|
||||
char charv ;
|
||||
char *charp;
|
||||
PTR_BFND bfnode ;
|
||||
PTR_LLND ll_node ;
|
||||
PTR_SYMB symbol ;
|
||||
PTR_TYPE data_type ;
|
||||
PTR_HASH hash_entry ;
|
||||
PTR_LABEL label ;
|
||||
PTR_BLOB blob_ptr ;
|
||||
} YYSTYPE;
|
||||
#define IFDEFA 258
|
||||
#define APPLYTO 259
|
||||
#define ALABELT 260
|
||||
#define SECTIONT 261
|
||||
#define SPECIALAF 262
|
||||
#define FROMT 263
|
||||
#define TOT 264
|
||||
#define TOTLABEL 265
|
||||
#define TOFUNCTION 266
|
||||
#define DefineANN 267
|
||||
#define IDENTIFIER 268
|
||||
#define TYPENAME 269
|
||||
#define SCSPEC 270
|
||||
#define TYPESPEC 271
|
||||
#define TYPEMOD 272
|
||||
#define CONSTANT 273
|
||||
#define STRING 274
|
||||
#define ELLIPSIS 275
|
||||
#define SIZEOF 276
|
||||
#define ENUM 277
|
||||
#define STRUCT 278
|
||||
#define UNION 279
|
||||
#define IF 280
|
||||
#define ELSE 281
|
||||
#define WHILE 282
|
||||
#define DO 283
|
||||
#define FOR 284
|
||||
#define SWITCH 285
|
||||
#define CASE 286
|
||||
#define DEFAULT_TOKEN 287
|
||||
#define BREAK 288
|
||||
#define CONTINUE 289
|
||||
#define RETURN 290
|
||||
#define GOTO 291
|
||||
#define ASM 292
|
||||
#define CLASS 293
|
||||
#define PUBLIC 294
|
||||
#define FRIEND 295
|
||||
#define ACCESSWORD 296
|
||||
#define OVERLOAD 297
|
||||
#define OPERATOR 298
|
||||
#define COBREAK 299
|
||||
#define COLOOP 300
|
||||
#define COEXEC 301
|
||||
#define LOADEDOPR 302
|
||||
#define MULTIPLEID 303
|
||||
#define MULTIPLETYPENAME 304
|
||||
#define ASSIGN 305
|
||||
#define OROR 306
|
||||
#define ANDAND 307
|
||||
#define EQCOMPARE 308
|
||||
#define ARITHCOMPARE 309
|
||||
#define LSHIFT 310
|
||||
#define RSHIFT 311
|
||||
#define UNARY 312
|
||||
#define PLUSPLUS 313
|
||||
#define MINUSMINUS 314
|
||||
#define HYPERUNARY 315
|
||||
#define DOUBLEMARK 316
|
||||
#define POINTSAT 317
|
||||
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
1985
dvm/fdvm/trunk/Sage/lib/newsrc/annotate.y
Normal file
1985
dvm/fdvm/trunk/Sage/lib/newsrc/annotate.y
Normal file
File diff suppressed because it is too large
Load Diff
693
dvm/fdvm/trunk/Sage/lib/newsrc/comments.c
Normal file
693
dvm/fdvm/trunk/Sage/lib/newsrc/comments.c
Normal file
@@ -0,0 +1,693 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993,1995 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/* Created By Jenq-Kuen Lee April 14, 1988 */
|
||||
/* A Sub-program to help yylex() catch all the comments */
|
||||
/* A small finite automata used to identify the input token corresponding to */
|
||||
/* Bif node position */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "vparse.h"
|
||||
#include "vpc.h"
|
||||
#include "db.h"
|
||||
#include "vextern.h"
|
||||
#include "annotate.tab.h"
|
||||
|
||||
void reset_semicoln_handler();
|
||||
void reset();
|
||||
|
||||
int lastdecl_id; /* o if no main_type appeared */
|
||||
int left_paren ;
|
||||
static int cur_state ;
|
||||
int cur_counter;
|
||||
|
||||
struct {
|
||||
PTR_CMNT stack[MAX_NESTED_SIZE];
|
||||
int counter[MAX_NESTED_SIZE];
|
||||
int node_type[MAX_NESTED_SIZE];
|
||||
int automata_state[MAX_NESTED_SIZE];
|
||||
int top ;
|
||||
} comment_stack ;
|
||||
|
||||
|
||||
struct {
|
||||
PTR_CMNT stack[MAX_NESTED_SIZE + 1 ];
|
||||
int front ;
|
||||
int rear ;
|
||||
} comment_queue;
|
||||
|
||||
struct {
|
||||
int line_stack[MAX_NESTED_SIZE + 1 ];
|
||||
PTR_FNAME file_stack[MAX_NESTED_SIZE + 1 ];
|
||||
int front ;
|
||||
int rear ;
|
||||
int BUGGY[100]; /* This is included because some versions of
|
||||
gcc seemed to have bugs that overwrite
|
||||
previous fields without. */
|
||||
} line_queue;
|
||||
|
||||
|
||||
PTR_FNAME find_file_entry()
|
||||
{
|
||||
/* dummy, should not be use after cleaning */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void put_line_queue(line_offset,name)
|
||||
int line_offset ;
|
||||
char *name;
|
||||
{ PTR_FNAME find_file_entry();
|
||||
|
||||
if (line_queue.rear == MAX_NESTED_SIZE) line_queue.rear = 0;
|
||||
else line_queue.rear++;
|
||||
if (line_queue.rear == line_queue.front) Message("stack/queue overflow",0);
|
||||
line_queue.line_stack[line_queue.rear] = line_offset ;
|
||||
line_queue.file_stack[line_queue.rear] = find_file_entry(name);
|
||||
}
|
||||
|
||||
|
||||
PTR_FNAME
|
||||
fetch_line_queue(line_ptr )
|
||||
int *line_ptr;
|
||||
{
|
||||
if (line_queue.front == line_queue.rear)
|
||||
{ *line_ptr = line_queue.line_stack[line_queue.front] ;
|
||||
return(line_queue.file_stack[line_queue.front]);
|
||||
}
|
||||
if (line_queue.front == MAX_NESTED_SIZE) line_queue.front = 0;
|
||||
else line_queue.front++;
|
||||
*line_ptr = line_queue.line_stack[line_queue.front] ;
|
||||
return(line_queue.file_stack[line_queue.front]);
|
||||
}
|
||||
|
||||
|
||||
void push_state()
|
||||
{
|
||||
comment_stack.top++;
|
||||
comment_stack.stack[ comment_stack.top ] = cur_comment ;
|
||||
comment_stack.counter[ comment_stack.top ] = cur_counter ;
|
||||
comment_stack.automata_state[ comment_stack.top ] = cur_state ;
|
||||
}
|
||||
|
||||
void pop_state()
|
||||
{
|
||||
|
||||
cur_comment = comment_stack.stack[ comment_stack.top ] ;
|
||||
cur_counter = comment_stack.counter[ comment_stack.top ] ;
|
||||
cur_state = comment_stack.automata_state[ comment_stack.top ] ;
|
||||
comment_stack.top--;
|
||||
|
||||
}
|
||||
|
||||
void init_stack()
|
||||
{
|
||||
comment_stack.top = 0 ;
|
||||
comment_stack.automata_state[ comment_stack.top ] = ZERO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void automata_driver(value)
|
||||
int value ;
|
||||
{
|
||||
int shift_flag ;
|
||||
int temp_state ;
|
||||
|
||||
|
||||
|
||||
for (shift_flag = ON ; shift_flag==ON ; )
|
||||
{ shift_flag = OFF ;
|
||||
|
||||
switch(cur_state) {
|
||||
|
||||
case ZERO :
|
||||
|
||||
switch (value) {
|
||||
case IF :
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = IF_STATE;
|
||||
break ;
|
||||
case ELSE :
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = ELSE_EXPECTED_STATE ;
|
||||
break;
|
||||
case DO :
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = DO_STATE ;
|
||||
break;
|
||||
case FOR :
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = FOR_STATE ;
|
||||
break;
|
||||
case CASE :
|
||||
case DEFAULT_TOKEN:
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = CASE_STATE;
|
||||
break;
|
||||
case GOTO :
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = GOTO_STATE;
|
||||
break;
|
||||
case WHILE :
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = WHILE_STATE;
|
||||
break;
|
||||
case SWITCH:
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = SWITCH_STATE;
|
||||
break;
|
||||
case COEXEC :
|
||||
cur_state = COEXEC_STATE ;
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
break;
|
||||
case COLOOP:
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = COLOOP_STATE ;
|
||||
break;
|
||||
case RETURN:
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = RETURN_STATE ;
|
||||
break;
|
||||
case '}':
|
||||
pop_state();
|
||||
switch (cur_state) {
|
||||
case ELSE_EXPECTED_STATE:
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
break;
|
||||
case STATE_4:
|
||||
case BLOCK_STATE:
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
reset();
|
||||
reset_semicoln_handler();
|
||||
break;
|
||||
case IF_STATE_4:
|
||||
cur_state= ELSE_EXPECTED_STATE;
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
break;
|
||||
case DO_STATE_1:
|
||||
cur_state= DO_STATE_2;
|
||||
reset_semicoln_handler();
|
||||
break;
|
||||
case DO_STATE_2:
|
||||
case STATE_2:
|
||||
break;
|
||||
default:
|
||||
reset();
|
||||
reset_semicoln_handler();
|
||||
}
|
||||
|
||||
break ;
|
||||
|
||||
case '{':
|
||||
temp_state=comment_stack.automata_state[comment_stack.top];
|
||||
if (temp_state == STATE_ARG)
|
||||
comment_stack.automata_state[comment_stack.top]= STATE_4;
|
||||
else { cur_state = BLOCK_STATE ;
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
push_state();
|
||||
}
|
||||
reset();
|
||||
break ;
|
||||
case '(':
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = STATE_15;
|
||||
left_paren++;
|
||||
break;
|
||||
case IDENTIFIER:
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state = STATE_6 ;
|
||||
break;
|
||||
case ';':
|
||||
reset_semicoln_handler();
|
||||
break;
|
||||
default : /* other */
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
if (class_struct(value)) cur_state = STATE_10 ;
|
||||
else cur_state = STATE_1 ;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case STATE_1 :
|
||||
if (value == '(') { cur_state =STATE_15 ;
|
||||
left_paren++;
|
||||
}
|
||||
if (class_struct(value)) cur_state =STATE_10 ;
|
||||
if (value == IDENTIFIER) cur_state =STATE_2 ;
|
||||
if (value == OPERATOR) cur_state =STATE_4 ;
|
||||
if (value ==';') reset_semicoln_handler();
|
||||
break ;
|
||||
|
||||
case STATE_2 :
|
||||
if (value == '(') { cur_state = STATE_15 ;
|
||||
left_paren++;
|
||||
}
|
||||
if (value ==';') {
|
||||
reset();
|
||||
reset_semicoln_handler();
|
||||
}
|
||||
break;
|
||||
|
||||
case STATE_4:
|
||||
switch (value) {
|
||||
case '(':
|
||||
cur_state = STATE_15 ;
|
||||
left_paren++;
|
||||
break;
|
||||
case '{': /* cur_state = STATE_5; */
|
||||
push_state();
|
||||
reset();
|
||||
break;
|
||||
case '=':
|
||||
case ',':
|
||||
cur_state = STATE_12;
|
||||
break;
|
||||
case ';':
|
||||
reset_semicoln_handler();
|
||||
break;
|
||||
default:
|
||||
if (is_declare(value))
|
||||
{ cur_state = STATE_ARG ;
|
||||
push_state();
|
||||
reset();
|
||||
}
|
||||
else cur_state = STATE_12;
|
||||
}
|
||||
|
||||
break;
|
||||
case STATE_6:
|
||||
if (value == ':') cur_state = ZERO;
|
||||
else {
|
||||
if (value ==';') reset_semicoln_handler();
|
||||
else { cur_state = STATE_2;
|
||||
shift_flag = ON ;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case STATE_10 :
|
||||
if (value =='{')
|
||||
{ cur_state = STATE_2 ;
|
||||
push_state();
|
||||
reset();
|
||||
}
|
||||
if ((value == '=' )||(value ==',')) cur_state = STATE_12;
|
||||
if (value == '(' ) { cur_state = STATE_15;
|
||||
left_paren++;
|
||||
}
|
||||
if (value ==';') reset_semicoln_handler();
|
||||
break ;
|
||||
case STATE_12:
|
||||
if (value ==';') reset_semicoln_handler();
|
||||
break ;
|
||||
|
||||
case STATE_15 :
|
||||
if (value == '(') left_paren++ ;
|
||||
if (value == ')') left_paren--;
|
||||
if (left_paren == 0) cur_state = STATE_4 ;
|
||||
break ;
|
||||
case IF_STATE:
|
||||
if (value == '(') { left_paren++;
|
||||
cur_state = IF_STATE_2;
|
||||
}
|
||||
break;
|
||||
case IF_STATE_2:
|
||||
if (value == '(') left_paren++ ;
|
||||
if (value == ')') left_paren--;
|
||||
if (left_paren == 0) cur_state = IF_STATE_3 ;
|
||||
break ;
|
||||
case IF_STATE_3:
|
||||
if (value == ';') {
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
cur_state= ELSE_EXPECTED_STATE ;
|
||||
}
|
||||
if (value =='{') { cur_state= ELSE_EXPECTED_STATE ;
|
||||
push_state();
|
||||
cur_state = ZERO ; /* counter continuing */
|
||||
}
|
||||
if (cur_state == IF_STATE_3)
|
||||
{ cur_state = IF_STATE_4 ;
|
||||
push_state();
|
||||
reset();
|
||||
shift_flag = ON;
|
||||
}
|
||||
break;
|
||||
|
||||
case ELSE_EXPECTED_STATE:
|
||||
if (value == ELSE) cur_state = BLOCK_STATE ;
|
||||
else {
|
||||
reset();
|
||||
reset_semicoln_handler();
|
||||
shift_flag = ON ;
|
||||
}
|
||||
break;
|
||||
|
||||
case BLOCK_STATE:
|
||||
if (value ==';') {
|
||||
cur_state = BLOCK_STATE_WAITSEMI;
|
||||
push_state();
|
||||
reset_semicoln_handler();
|
||||
}
|
||||
if (value == '{') { push_state();
|
||||
reset();
|
||||
}
|
||||
if (cur_state == BLOCK_STATE)
|
||||
{
|
||||
cur_state = BLOCK_STATE_WAITSEMI;
|
||||
push_state();
|
||||
reset();
|
||||
shift_flag = ON ;
|
||||
}
|
||||
break;
|
||||
|
||||
case WHILE_STATE:
|
||||
if (value == '('){ left_paren++;
|
||||
cur_state = WHILE_STATE_2;
|
||||
}
|
||||
break;
|
||||
case WHILE_STATE_2:
|
||||
if (value == '(') left_paren++ ;
|
||||
if (value == ')') left_paren--;
|
||||
if (left_paren == 0) cur_state = BLOCK_STATE ;
|
||||
break ;
|
||||
|
||||
case FOR_STATE:
|
||||
if (value == '(') { left_paren++;
|
||||
cur_state = FOR_STATE_2;
|
||||
}
|
||||
break;
|
||||
case FOR_STATE_2:
|
||||
if (value == '(') left_paren++ ;
|
||||
if (value == ')') left_paren--;
|
||||
if (left_paren == 0) cur_state = BLOCK_STATE ;
|
||||
break ;
|
||||
|
||||
case COLOOP_STATE:
|
||||
if (value == '(') { left_paren++;
|
||||
cur_state = COLOOP_STATE_2;
|
||||
}
|
||||
break;
|
||||
case COLOOP_STATE_2:
|
||||
if (value == '(') left_paren++ ;
|
||||
if (value == ')') left_paren--;
|
||||
if (left_paren == 0) cur_state = BLOCK_STATE ;
|
||||
break ;
|
||||
|
||||
case COEXEC_STATE:
|
||||
if (value == '(') { left_paren++;
|
||||
cur_state = COEXEC_STATE_2;
|
||||
}
|
||||
break;
|
||||
case COEXEC_STATE_2:
|
||||
if (value == '(') left_paren++ ;
|
||||
if (value == ')') left_paren--;
|
||||
if (left_paren == 0) cur_state = BLOCK_STATE ;
|
||||
break ;
|
||||
|
||||
case SWITCH_STATE:
|
||||
if (value == '(') { left_paren++;
|
||||
cur_state = SWITCH_STATE_2;
|
||||
}
|
||||
break;
|
||||
case SWITCH_STATE_2:
|
||||
if (value == '(') left_paren++ ;
|
||||
if (value == ')') left_paren--;
|
||||
if (left_paren == 0) cur_state = BLOCK_STATE ;
|
||||
break ;
|
||||
|
||||
case CASE_STATE :
|
||||
if (value == ':') reset();
|
||||
break;
|
||||
case DO_STATE : /* Need More, some problem exists */
|
||||
if (value == ';') { cur_state = DO_STATE_2 ; }
|
||||
if (value == '{') { cur_state = DO_STATE_2 ;
|
||||
push_state();
|
||||
reset();
|
||||
}
|
||||
if (cur_state == DO_STATE)
|
||||
{ cur_state = DO_STATE_1 ;
|
||||
push_state();
|
||||
reset();
|
||||
shift_flag = ON;
|
||||
}
|
||||
break;
|
||||
case DO_STATE_2:
|
||||
if (value == WHILE) cur_state= DO_STATE_3 ;
|
||||
break ;
|
||||
case DO_STATE_3:
|
||||
if (value == '(') { cur_state = DO_STATE_4 ;
|
||||
left_paren++;
|
||||
}
|
||||
break;
|
||||
case DO_STATE_4:
|
||||
if (value == '(') left_paren++ ;
|
||||
if (value == ')') left_paren--;
|
||||
if (left_paren == 0) cur_state = DO_STATE_5 ;
|
||||
break ;
|
||||
case DO_STATE_5:
|
||||
if (value ==';')
|
||||
{
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
reset();
|
||||
reset_semicoln_handler();
|
||||
}
|
||||
break;
|
||||
case RETURN_STATE:
|
||||
if (value ==';') reset_semicoln_handler();
|
||||
if (value == '(') { left_paren++;
|
||||
cur_state = RETURN_STATE_2 ;
|
||||
}
|
||||
break;
|
||||
case RETURN_STATE_2:
|
||||
if (value == '(') left_paren++ ;
|
||||
if (value == ')') left_paren--;
|
||||
if (left_paren == 0) cur_state = RETURN_STATE_3 ;
|
||||
break ;
|
||||
case RETURN_STATE_3:
|
||||
if (value ==';') reset_semicoln_handler();
|
||||
break;
|
||||
case GOTO_STATE:
|
||||
if (value == IDENTIFIER) cur_state = GOTO_STATE_2 ;
|
||||
break;
|
||||
case GOTO_STATE_2:
|
||||
if (value ==';') reset_semicoln_handler();
|
||||
break;
|
||||
default:
|
||||
Message(" comments state un_expected...",0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class_struct(value)
|
||||
register int value ;
|
||||
{
|
||||
switch (value) {
|
||||
case ENUM :
|
||||
case CLASS:
|
||||
case STRUCT :
|
||||
case UNION: return(1);
|
||||
default : return(0);
|
||||
}
|
||||
}
|
||||
|
||||
declare_symb(value)
|
||||
register int value ;
|
||||
{
|
||||
switch (value) {
|
||||
case TYPENAME :
|
||||
case TYPESPEC:
|
||||
case TYPEMOD:
|
||||
case ACCESSWORD:
|
||||
case SCSPEC:
|
||||
case ENUM :
|
||||
case CLASS:
|
||||
case STRUCT :
|
||||
case UNION: return(1);
|
||||
default : return(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reset()
|
||||
{
|
||||
cur_state = 0 ;
|
||||
cur_counter = 0 ;
|
||||
cur_comment = (PTR_CMNT) NULL ;
|
||||
|
||||
/* put_line_queue(line_pos_1,line_pos_fname); */
|
||||
}
|
||||
|
||||
block_like(state)
|
||||
int state ;
|
||||
{
|
||||
|
||||
switch( state) {
|
||||
case BLOCK_STATE:
|
||||
case ZERO:
|
||||
case SWITCH_STATE:
|
||||
case FOR_STATE :
|
||||
case WHILE_STATE :
|
||||
case COEXEC_STATE :
|
||||
case COLOOP_STATE:
|
||||
case STATE_4: /* end of function_body */
|
||||
return(1);
|
||||
default: return(0);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
is_declare(value)
|
||||
int value ;
|
||||
{
|
||||
switch (value) {
|
||||
case TYPENAME:
|
||||
case TYPESPEC :
|
||||
case ACCESSWORD:
|
||||
case SCSPEC:
|
||||
case TYPEMOD:
|
||||
case ENUM:
|
||||
case UNION:
|
||||
case CLASS:
|
||||
case STRUCT: return(1);
|
||||
default : return(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* pop state until reach a stable state BLOCK_STATE or ZERO */
|
||||
void reset_semicoln_handler()
|
||||
{
|
||||
int sw,state;
|
||||
|
||||
for (sw=1; sw; )
|
||||
{
|
||||
if (keep_original(cur_state)) return;
|
||||
state = comment_stack.automata_state[comment_stack.top];
|
||||
switch (state) {
|
||||
case IF_STATE_4:
|
||||
pop_state();
|
||||
cur_state = ELSE_EXPECTED_STATE ;
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
break;
|
||||
case DO_STATE_1:
|
||||
pop_state();
|
||||
cur_state = DO_STATE_2 ;
|
||||
break;
|
||||
case BLOCK_STATE_WAITSEMI:
|
||||
put_line_queue(line_pos_1,line_pos_fname);
|
||||
pop_state();
|
||||
reset();
|
||||
break;
|
||||
default :
|
||||
reset();
|
||||
sw = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
keep_original(state)
|
||||
int state;
|
||||
{
|
||||
switch (state) {
|
||||
case ELSE_EXPECTED_STATE:
|
||||
case DO_STATE_2:
|
||||
case STATE_2:
|
||||
return(1);
|
||||
default:
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* is_at_decl_state() & is_look_ahead_of_identifier() */
|
||||
/* These two routines are used in yylex to identify if a TYPENAME is just */
|
||||
/* a IDENTIFIER */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
int
|
||||
is_at_decl_state()
|
||||
{
|
||||
|
||||
/* to see if it is inside (, ) */
|
||||
switch(cur_state) {
|
||||
case STATE_15:
|
||||
case IF_STATE_2:
|
||||
case WHILE_STATE_2:
|
||||
case FOR_STATE_2:
|
||||
case COLOOP_STATE_2:
|
||||
case COEXEC_STATE_2:
|
||||
case SWITCH_STATE_2:
|
||||
case DO_STATE_4:
|
||||
return(0);
|
||||
default:
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int is_look_ahead_of_identifier(c)
|
||||
char c;
|
||||
{
|
||||
switch (c) {
|
||||
case ':' :
|
||||
case '(':
|
||||
case '[':
|
||||
case ',':
|
||||
case ';':
|
||||
case '=':
|
||||
return(1);
|
||||
default:
|
||||
return(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void set_up_momentum(value,token)
|
||||
int value,token;
|
||||
{
|
||||
|
||||
if (lastdecl_id == 0)
|
||||
{
|
||||
/* check if main_type appears */
|
||||
switch (value) {
|
||||
case TYPESPEC:
|
||||
lastdecl_id = 1;
|
||||
break;
|
||||
case TYPEMOD:
|
||||
if ((token == (int)RID_LONG)||(token == (int)RID_SHORT)||
|
||||
(token==(int)RID_SIGNED)||(token==(int)RID_UNSIGNED))
|
||||
lastdecl_id = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* case for main_type already appear, then check if
|
||||
1. this is still a decl.
|
||||
2. reset it to wait for another decl stat. */
|
||||
switch (value) {
|
||||
case TYPESPEC:
|
||||
case TYPEMOD:
|
||||
case SCSPEC:
|
||||
break;
|
||||
default:
|
||||
lastdecl_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
9123
dvm/fdvm/trunk/Sage/lib/newsrc/low_level.c
Normal file
9123
dvm/fdvm/trunk/Sage/lib/newsrc/low_level.c
Normal file
File diff suppressed because it is too large
Load Diff
40
dvm/fdvm/trunk/Sage/lib/newsrc/makefile.uni
Normal file
40
dvm/fdvm/trunk/Sage/lib/newsrc/makefile.uni
Normal file
@@ -0,0 +1,40 @@
|
||||
#######################################################################
|
||||
## Copyright (C) 1999 ##
|
||||
## Keldysh Institute of Appllied Mathematics ##
|
||||
#######################################################################
|
||||
|
||||
# sage/lib/newsrc/makefile.sgi
|
||||
|
||||
LIBDIR = ../../../lib
|
||||
|
||||
OLDHEADERS = ../../h
|
||||
|
||||
# Directory in which include file can be found
|
||||
TOOLBOX_INCLUDE = ../include
|
||||
|
||||
INCL = -I$(OLDHEADERS) -I../include
|
||||
|
||||
TOOLBOX_SRC = low_level.c unparse.c
|
||||
|
||||
TOOLBOX_HDR = $(TOOLBOX_INCLUDE)/macro.h $(TOOLBOX_INCLUDE)/bif_node.def \
|
||||
$(TOOLBOX_INCLUDE)/type.def $(TOOLBOX_INCLUDE)/symb.def
|
||||
|
||||
CFLAGS = $(INCL) -c -DSYS5 -Wall
|
||||
|
||||
low_level.o: low_level.c $(TOOLBOX_HDR)
|
||||
|
||||
unparse.o: unparse.c $(TOOLBOX_HDR) $(TOOLBOX_INCLUDE)/unparse.def \
|
||||
$(TOOLBOX_INCLUDE)/unparseC++.def
|
||||
|
||||
TOOLBOX_OBJ = low_level.o unparse.o
|
||||
|
||||
$(LIBDIR)/libsage.a: $(TOOLBOX_OBJ) $(TOOLBOX_HDR)
|
||||
ar qc $(LIBDIR)/libsage.a $(TOOLBOX_OBJ)
|
||||
|
||||
all: $(LIBDIR)/libsage.a
|
||||
@echo "*** COMPILING LIBRARY newsrc DONE"
|
||||
|
||||
clean:
|
||||
rm -f $(TOOLBOX_OBJ)
|
||||
cleanall:
|
||||
rm -f $(TOOLBOX_OBJ)
|
||||
54
dvm/fdvm/trunk/Sage/lib/newsrc/makefile.win
Normal file
54
dvm/fdvm/trunk/Sage/lib/newsrc/makefile.win
Normal file
@@ -0,0 +1,54 @@
|
||||
#######################################################################
|
||||
## Copyright (C) 1999 ##
|
||||
## Keldysh Institute of Appllied Mathematics ##
|
||||
#######################################################################
|
||||
|
||||
# sage/lib/newsrc/makefile.win
|
||||
|
||||
OUTDIR = ../../../obj
|
||||
LIBDIR = ../../../lib
|
||||
|
||||
OLDHEADERS = ../../h
|
||||
|
||||
# Directory in which include file can be found
|
||||
TOOLBOX_INCLUDE = ../include
|
||||
|
||||
INCL = -I$(OLDHEADERS) -I../include
|
||||
|
||||
TOOLBOX_SRC = low_level.c unparse.c
|
||||
|
||||
TOOLBOX_HDR = $(TOOLBOX_INCLUDE)/macro.h $(TOOLBOX_INCLUDE)/bif_node.def \
|
||||
$(TOOLBOX_INCLUDE)/type.def $(TOOLBOX_INCLUDE)/symb.def
|
||||
|
||||
# -w don't issue warning now.
|
||||
#CFLAGS=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D SYS5 $(INCL) \
|
||||
# /Fp"$(OUTDIR)/newsrc.pch" /YX /Fo"$(OUTDIR)/" /Fd"$(OUTDIR)/" /c
|
||||
CFLAGS=/nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D SYS5 $(INCL) \
|
||||
/Fp"$(OUTDIR)/newsrc.pch" /Fo"$(OUTDIR)/" /Fd"$(OUTDIR)/" /c
|
||||
|
||||
.c{$(OUTDIR)/}.obj:
|
||||
$(CC) $(CFLAGS) $<
|
||||
|
||||
LIB32=$(LINKER) -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(LIBDIR)/libsage.lib"
|
||||
|
||||
|
||||
$(OUTDIR)/low_level.obj: low_level.c $(TOOLBOX_HDR)
|
||||
|
||||
$(OUTDIR)/unparse.obj: unparse.c $(TOOLBOX_HDR) $(TOOLBOX_INCLUDE)/unparse.def \
|
||||
$(TOOLBOX_INCLUDE)/unparseC++.def
|
||||
|
||||
TOOLBOX_OBJ = $(OUTDIR)/low_level.obj $(OUTDIR)/unparse.obj
|
||||
|
||||
$(LIBDIR)/libsage.lib: $(TOOLBOX_OBJ) $(TOOLBOX_HDR)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(TOOLBOX_OBJ)
|
||||
<<
|
||||
|
||||
all: $(LIBDIR)/libsage.lib
|
||||
@echo "*** COMPILING LIBRARY newsrc DONE"
|
||||
|
||||
|
||||
clean:
|
||||
|
||||
cleanall:
|
||||
1042
dvm/fdvm/trunk/Sage/lib/newsrc/toolsann.c
Normal file
1042
dvm/fdvm/trunk/Sage/lib/newsrc/toolsann.c
Normal file
File diff suppressed because it is too large
Load Diff
3257
dvm/fdvm/trunk/Sage/lib/newsrc/unparse.c
Normal file
3257
dvm/fdvm/trunk/Sage/lib/newsrc/unparse.c
Normal file
File diff suppressed because it is too large
Load Diff
18
dvm/fdvm/trunk/Sage/lib/oldsrc/CMakeLists.txt
Normal file
18
dvm/fdvm/trunk/Sage/lib/oldsrc/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
set(DB_SOURCES anal_ind.c db.c db_unp.c db_unp_vpc.c dbutils.c
|
||||
garb_coll.c glob_anal.c ker_fun.c list.c make_nodes.c mod_ref.c ndeps.c
|
||||
readnodes.c sets.c setutils.c symb_alg.c writenodes.c)
|
||||
|
||||
if(MSVC_IDE)
|
||||
foreach(DIR ${DVM_SAGE_INCLUDE_DIRS})
|
||||
file(GLOB_RECURSE FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
"${DIR}/*.h" "${DIR}/*.def" "${DIR}/head" "${DIR}/tag")
|
||||
set(DB_HEADERS ${DB_HEADERS} ${FILES})
|
||||
endforeach()
|
||||
source_group("Header Files" FILES ${DB_HEADERS})
|
||||
endif()
|
||||
|
||||
add_library(db ${DB_SOURCES} ${DB_HEADERS})
|
||||
|
||||
target_compile_definitions(db PRIVATE SYS5)
|
||||
target_include_directories(db PUBLIC "${DVM_SAGE_INCLUDE_DIRS}")
|
||||
set_target_properties(db PROPERTIES FOLDER "${DVM_LIBRARY_FOLDER}")
|
||||
123
dvm/fdvm/trunk/Sage/lib/oldsrc/Makefile
Normal file
123
dvm/fdvm/trunk/Sage/lib/oldsrc/Makefile
Normal file
@@ -0,0 +1,123 @@
|
||||
#######################################################################
|
||||
## pC++/Sage++ Copyright (C) 1993 ##
|
||||
## Indiana University University of Oregon University of Rennes ##
|
||||
#######################################################################
|
||||
|
||||
|
||||
# sage/lib/oldsrc/Makefile (phb)
|
||||
|
||||
LSX = .a
|
||||
|
||||
#HP_CFLAGS#CEXTRA = -Ae +z#ENDIF#
|
||||
#HP_CFLAGS#LSX = .sl#ENDIF#
|
||||
|
||||
SHELL = /bin/sh
|
||||
CONFIG_ARCH=iris4d
|
||||
|
||||
RANLIB_TEST = [ -f /usr/bin/ranlib ] || [ -f /bin/ranlib ]
|
||||
#NO_RANLIB#RANLIB_TEST = (exit 1)#ENDIF#
|
||||
|
||||
# Directory with all the include headers
|
||||
H = ../../h
|
||||
|
||||
#INSTALLDEST = ../$(CONFIG_ARCH)
|
||||
INSTALLDEST = ../../../libsage
|
||||
INSTALL = /bin/cp
|
||||
|
||||
CC = gcc
|
||||
#CC=cc#ENDIF##USE_CC#
|
||||
|
||||
CXX = g++
|
||||
CXX = /usr/WorkShop/usr/bin/DCC
|
||||
LINKER = $(CC)
|
||||
|
||||
CFLAGS = -g -Wall -I$H $(CEXTRA)
|
||||
|
||||
DEST = ${HOME}/bin
|
||||
|
||||
EXTHDRS = $H/bif.h $H/db.h $H/db.h $H/defs.h $H/dep.h \
|
||||
$H/dep_str.h $H/list.h $H/ll.h $H/sets.h $H/symb.h \
|
||||
$H/tag $H/vparse.h
|
||||
|
||||
OBJS = anal_ind.o db.o db_unp.o db_unp_vpc.o dbutils.o \
|
||||
garb_coll.o glob_anal.o ker_fun.o list.o \
|
||||
make_nodes.o mod_ref.o ndeps.o readnodes.o sets.o setutils.o \
|
||||
symb_alg.o writenodes.o
|
||||
|
||||
SRCS = anal_ind.c db.c db_unp.c db_unp_vpc.c dbutils.c \
|
||||
garb_coll.c glob_anal.c ker_fun.c list.c \
|
||||
make_nodes.c mod_ref.c ndeps.c readnodes.c sets.c setutils.c \
|
||||
symb_alg.c writenodes.c
|
||||
|
||||
|
||||
all: $(OBJS) libdb$(LSX)
|
||||
|
||||
libdb.a: $(OBJS)
|
||||
/bin/rm -f libdb.a
|
||||
ar qc libdb.a $(OBJS)
|
||||
@if $(RANLIB_TEST) ; then ranlib libdb.a ; \
|
||||
else echo "\tNOTE: ranlib not required" ; fi
|
||||
|
||||
libdb.sl: $(OBJS)
|
||||
/bin/rm -f libdb.sl
|
||||
ld -b -s -o libdb.sl $(OBJS)
|
||||
|
||||
clean:
|
||||
@/bin/rm -f $(OBJS) $(PROGRAM) *.dep libdb$(LSX)
|
||||
|
||||
index:
|
||||
ctags -wx $(HDRS) $(SRCS)
|
||||
|
||||
print:
|
||||
$(PRINT) $(HDRS) $(SRCS)
|
||||
|
||||
program: $(PROGRAM)
|
||||
|
||||
tags: $(HDRS) $(SRCS); ctags $(HDRS) $(SRCS)
|
||||
|
||||
install: $(INSTALLDEST)/libdb$(LSX)
|
||||
|
||||
$(INSTALLDEST)/libdb$(LSX): libdb$(LSX)
|
||||
if [ -d $(INSTALLDEST) ] ; then true; \
|
||||
else mkdir $(INSTALLDEST) ;fi
|
||||
$(INSTALL) libdb$(LSX) $(INSTALLDEST)
|
||||
@if $(RANLIB_TEST) ; then ranlib $(INSTALLDEST)/libdb$(LSX) ; \
|
||||
else echo "\tNOTE: ranlib not required" ; fi
|
||||
|
||||
###
|
||||
anal_ind.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
db.o: $H/db.h $H/defs.h \
|
||||
$H/tag $H/bif.h $H/ll.h $H/symb.h $H/sets.h
|
||||
db_unp.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
db_unp_vpc.o: $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h $H/db.h $H/vparse.h
|
||||
dbutils.o: $H/db.h \
|
||||
$H/defs.h $H/tag $H/bif.h $H/ll.h $H/symb.h $H/sets.h
|
||||
garb-coll.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
glob_anal.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
ker_fun.o: $H/defs.h $H/tag $H/bif.h $H/ll.h \
|
||||
$H/symb.h $H/sets.h
|
||||
list.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h $H/list.h
|
||||
make_nodes.o: $H/db.h $H/defs.h $H/tag \
|
||||
$H/bif.h $H/ll.h $H/symb.h $H/sets.h
|
||||
mod_ref.o: $H/defs.h $H/tag $H/bif.h $H/ll.h \
|
||||
$H/symb.h $H/sets.h $H/vparse.h $H/db.h
|
||||
ndeps.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
readnodes.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h $H/dep_str.h \
|
||||
$H/dep.h
|
||||
sets.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
setutils.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
symb_alg.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
writenodes.o: $H/db.h $H/defs.h $H/tag \
|
||||
$H/bif.h $H/ll.h $H/symb.h $H/sets.h $H/dep_str.h \
|
||||
$H/dep.h
|
||||
1031
dvm/fdvm/trunk/Sage/lib/oldsrc/anal_ind.c
Normal file
1031
dvm/fdvm/trunk/Sage/lib/oldsrc/anal_ind.c
Normal file
File diff suppressed because it is too large
Load Diff
2308
dvm/fdvm/trunk/Sage/lib/oldsrc/db.c
Normal file
2308
dvm/fdvm/trunk/Sage/lib/oldsrc/db.c
Normal file
File diff suppressed because it is too large
Load Diff
1956
dvm/fdvm/trunk/Sage/lib/oldsrc/db_unp.c
Normal file
1956
dvm/fdvm/trunk/Sage/lib/oldsrc/db_unp.c
Normal file
File diff suppressed because it is too large
Load Diff
10
dvm/fdvm/trunk/Sage/lib/oldsrc/db_unp_comm.c
Normal file
10
dvm/fdvm/trunk/Sage/lib/oldsrc/db_unp_comm.c
Normal file
@@ -0,0 +1,10 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
#define BUFLEN 50000
|
||||
|
||||
char buffer[BUFLEN], /* buffer to build the unparsed text */
|
||||
*bp; /* points to where next char goes in buffer */
|
||||
1924
dvm/fdvm/trunk/Sage/lib/oldsrc/db_unp_vpc.c
Normal file
1924
dvm/fdvm/trunk/Sage/lib/oldsrc/db_unp_vpc.c
Normal file
File diff suppressed because it is too large
Load Diff
961
dvm/fdvm/trunk/Sage/lib/oldsrc/dbutils.c
Normal file
961
dvm/fdvm/trunk/Sage/lib/oldsrc/dbutils.c
Normal file
@@ -0,0 +1,961 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* dbutils -- contains those utilities that will be used by *
|
||||
* the data base management routines *
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "compatible.h"
|
||||
#ifdef SYS5
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
# include "db.h"
|
||||
|
||||
/*
|
||||
* global references
|
||||
*/
|
||||
extern int language;
|
||||
extern PTR_FILE cur_file;
|
||||
|
||||
int read_nodes();
|
||||
|
||||
/*
|
||||
* Local variables
|
||||
*/
|
||||
static PTR_SYMB head_symb;
|
||||
static char *proj_filename;
|
||||
static int temp[200];
|
||||
static int *pt;
|
||||
|
||||
#ifdef __SPF
|
||||
extern void addToCollection(const int line, const char *file, void *pointer, int type);
|
||||
extern void removeFromCollection(void *pointer);
|
||||
#endif
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* alloc_blob -- allocate new space for structure blob *
|
||||
* *
|
||||
* output: *
|
||||
* Non-NULL - pointer to the newly allocated structure *
|
||||
* NULL - something was wrong *
|
||||
* *
|
||||
****************************************************************/
|
||||
PTR_BLOB
|
||||
alloc_blob()
|
||||
{
|
||||
void *p = calloc(1, sizeof(struct blob));
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,p, 0);
|
||||
#endif
|
||||
return ((PTR_BLOB)p);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* alloc_blob1 -- allocate new space for structure blob1 *
|
||||
* *
|
||||
* output: *
|
||||
* Non-NULL - pointer to the newly allocated structure *
|
||||
* NULL - something was wrong *
|
||||
* *
|
||||
****************************************************************/
|
||||
static PTR_BLOB1
|
||||
alloc_blob1()
|
||||
{
|
||||
void *p = calloc(1, sizeof(struct blob1));
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,p, 0);
|
||||
#endif
|
||||
return ((PTR_BLOB1) p);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* alloc_info -- allocate new space for structure obj_info *
|
||||
* *
|
||||
* output: *
|
||||
* Non-NULL - pointer to the newly allocated structure *
|
||||
* NULL - something was wrong *
|
||||
* *
|
||||
****************************************************************/
|
||||
static PTR_INFO
|
||||
alloc_info()
|
||||
{
|
||||
void *p = calloc(1, sizeof(struct obj_info));
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,p, 0);
|
||||
#endif
|
||||
return ((PTR_INFO) p);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* check_ref -- check if the variable whose id is "id" has *
|
||||
* referenced in this statement or not *
|
||||
* input: *
|
||||
* id -- the id of the variable to be checked *
|
||||
* *
|
||||
* output: *
|
||||
* 1, if it's been refereneced *
|
||||
* 0, if not and add it to the table *
|
||||
* *
|
||||
****************************************************************/
|
||||
int
|
||||
check_ref(id)
|
||||
int id;
|
||||
{
|
||||
int *p;
|
||||
|
||||
for(p = temp; p < pt;)
|
||||
if(*p++ == id)
|
||||
return(1);
|
||||
*pt++ = id;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* build_ref -- add "bif" to the reference chain of "symb" *
|
||||
* *
|
||||
* input: *
|
||||
* symb - the symb where the reference to be added *
|
||||
* bif - the statement that references symb *
|
||||
* *
|
||||
****************************************************************/
|
||||
void
|
||||
build_ref(symb, bif)
|
||||
PTR_SYMB symb;
|
||||
PTR_BFND bif;
|
||||
{
|
||||
register PTR_BLOB b, b1, b2;
|
||||
|
||||
b = alloc_blob();
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,b, 0);
|
||||
#endif
|
||||
b->ref = bif;
|
||||
if (symb->ud_chain == NULL)
|
||||
symb->ud_chain = b;
|
||||
else {
|
||||
for (b1 = b2 = symb->ud_chain; b1; b1 = b1->next)
|
||||
b2 = b1;
|
||||
b2->next = b;
|
||||
}
|
||||
b->next = NULL;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* make_blob1 -- make a new blob1 node *
|
||||
* *
|
||||
* input: *
|
||||
* tag - type of this blob1 node *
|
||||
* ref - pointer to the object it references *
|
||||
* next - link to the next blob1 node *
|
||||
* *
|
||||
****************************************************************/
|
||||
PTR_BLOB1
|
||||
make_blob1(tag, ref, next)
|
||||
int tag;
|
||||
PTR_BFND ref;
|
||||
PTR_BLOB1 next;
|
||||
{
|
||||
PTR_BLOB1 new;
|
||||
|
||||
new = alloc_blob1();
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,new, 0);
|
||||
#endif
|
||||
new->tag = tag;
|
||||
new->ref = (char *) ref;
|
||||
new->next = next;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* make_obj_info -- make a new obj_info node *
|
||||
* *
|
||||
* input: *
|
||||
* filename - name of the file where this obj_info *
|
||||
* resides *
|
||||
* g_line - ablosute line no. of the obj in the file *
|
||||
* l_line - line no. of the object relative to its *
|
||||
* parent objec *
|
||||
* source - the objec in the source form *
|
||||
* *
|
||||
****************************************************************/
|
||||
PTR_INFO
|
||||
make_obj_info(filename, g_line, l_line, source)
|
||||
char *filename;
|
||||
int g_line;
|
||||
int l_line;
|
||||
char *source;
|
||||
{
|
||||
register PTR_INFO new;
|
||||
|
||||
new = alloc_info();
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,new, 0);
|
||||
#endif
|
||||
new->filename = filename;
|
||||
new->g_line = g_line;
|
||||
new->l_line = l_line;
|
||||
new->source = source;
|
||||
return (new);
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* visit_llnd -- recursively visit the low level nodes and *
|
||||
* find those use and def info it references *
|
||||
* *
|
||||
* input: *
|
||||
* bif - the bif node to which the llnd belongs *
|
||||
* llnd - the low level node to be visit *
|
||||
* *
|
||||
****************************************************************/
|
||||
void
|
||||
visit_llnd(bif, llnd)
|
||||
PTR_BFND bif;
|
||||
PTR_LLND llnd;
|
||||
{
|
||||
if (llnd == NULL) return;
|
||||
|
||||
switch (llnd->variant) {
|
||||
case LABEL_REF:
|
||||
{
|
||||
}
|
||||
break;
|
||||
case CONST_REF :
|
||||
case VAR_REF :
|
||||
case ARRAY_REF :
|
||||
if(check_ref(llnd->entry.Template.symbol->id) == 0)
|
||||
build_ref(llnd->entry.Template.symbol, bif);
|
||||
break;
|
||||
case CONSTRUCTOR_REF :
|
||||
break;
|
||||
case ACCESS_REF :
|
||||
break;
|
||||
case CONS :
|
||||
break;
|
||||
case ACCESS :
|
||||
break;
|
||||
case IOACCESS :
|
||||
break;
|
||||
case PROC_CALL :
|
||||
case FUNC_CALL :
|
||||
visit_llnd(bif, llnd->entry.proc.param_list);
|
||||
break;
|
||||
case EXPR_LIST :
|
||||
visit_llnd(bif, llnd->entry.list.item);
|
||||
if (llnd->entry.list.next)
|
||||
visit_llnd(bif, llnd->entry.list.next);
|
||||
break;
|
||||
case EQUI_LIST :
|
||||
visit_llnd(bif, llnd->entry.list.item);
|
||||
if (llnd->entry.list.next) {
|
||||
visit_llnd(bif, llnd->entry.list.next);
|
||||
}
|
||||
break;
|
||||
case COMM_LIST :
|
||||
if (llnd->entry.Template.symbol) {
|
||||
/* addstr(llnd->entry.Template.symbol->ident);
|
||||
*/ }
|
||||
visit_llnd(bif, llnd->entry.list.item);
|
||||
if (llnd->entry.list.next)
|
||||
visit_llnd(bif, llnd->entry.list.next);
|
||||
break;
|
||||
case VAR_LIST :
|
||||
case RANGE_LIST :
|
||||
case CONTROL_LIST :
|
||||
visit_llnd(bif, llnd->entry.list.item);
|
||||
if (llnd->entry.list.next)
|
||||
visit_llnd(bif, llnd->entry.list.next);
|
||||
break;
|
||||
case DDOT :
|
||||
visit_llnd(bif, llnd->entry.binary_op.l_operand);
|
||||
if (llnd->entry.binary_op.r_operand)
|
||||
visit_llnd(bif, llnd->entry.binary_op.r_operand);
|
||||
break;
|
||||
case DEF_CHOICE :
|
||||
case SEQ :
|
||||
visit_llnd(bif, llnd->entry.seq.ddot);
|
||||
if (llnd->entry.seq.stride)
|
||||
visit_llnd(bif, llnd->entry.seq.stride);
|
||||
break;
|
||||
case SPEC_PAIR :
|
||||
visit_llnd(bif, llnd->entry.spec_pair.sp_label);
|
||||
visit_llnd(bif, llnd->entry.spec_pair.sp_value);
|
||||
break;
|
||||
case EQ_OP :
|
||||
case LT_OP :
|
||||
case GT_OP :
|
||||
case NOTEQL_OP :
|
||||
case LTEQL_OP :
|
||||
case GTEQL_OP :
|
||||
case ADD_OP :
|
||||
case SUBT_OP :
|
||||
case OR_OP :
|
||||
case MULT_OP :
|
||||
case DIV_OP :
|
||||
case MOD_OP :
|
||||
case AND_OP :
|
||||
case EXP_OP :
|
||||
case CONCAT_OP :
|
||||
visit_llnd(bif, llnd->entry.binary_op.l_operand);
|
||||
visit_llnd(bif, llnd->entry.binary_op.r_operand);
|
||||
break;
|
||||
case MINUS_OP :
|
||||
case NOT_OP :
|
||||
visit_llnd(bif, llnd->entry.unary_op.operand);
|
||||
break;
|
||||
case STAR_RANGE :
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* visit_bfnd -- visits the subtree "bif" and generates the *
|
||||
* use-definition info of the variables it *
|
||||
* references *
|
||||
* input: *
|
||||
* bif - the root of the tree to be visitd *
|
||||
* *
|
||||
* side effect: *
|
||||
* build the ud_chain at where the static variable *
|
||||
* "head_symb" points to *
|
||||
* *
|
||||
****************************************************************/
|
||||
void
|
||||
visit_bfnd(bif)
|
||||
PTR_BFND bif;
|
||||
{
|
||||
register PTR_BLOB b;
|
||||
|
||||
if(bif == NULL)
|
||||
return;
|
||||
pt = temp; /* reset the pointer */
|
||||
|
||||
switch(bif->variant) {
|
||||
case GLOBAL:
|
||||
case PROG_HEDR:
|
||||
case PROC_HEDR:
|
||||
case FUNC_HEDR:
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
visit_bfnd(b->ref);
|
||||
break;
|
||||
case FOR_NODE:
|
||||
build_ref(bif->entry.Template.symbol, bif); /* control var */
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr1); /* check range */
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr2); /* check incr */
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr3); /* where cond */
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
visit_bfnd(b->ref);
|
||||
break;
|
||||
case CDOALL_NODE:
|
||||
build_ref(bif->entry.Template.symbol, bif); /* control var */
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr1); /* check range */
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr2); /* check incr */
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr3); /* where cond */
|
||||
for (b = bif->entry.Template.bl_ptr2; b; b = b->next)
|
||||
visit_bfnd(b->ref);
|
||||
break;
|
||||
case WHILE_NODE:
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr1); /* check cond */
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
visit_bfnd(b->ref);
|
||||
break;
|
||||
case WHERE_NODE:
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr1); /* check cond */
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
visit_bfnd(b->ref);
|
||||
for (b = bif->entry.Template.bl_ptr2; b; b = b->next)
|
||||
visit_bfnd(b->ref);
|
||||
break;
|
||||
case IF_NODE:
|
||||
case ELSEIF_NODE:
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr1); /* check cond */
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
visit_bfnd(b->ref);
|
||||
for (b = bif->entry.Template.bl_ptr2; b; b = b->next)
|
||||
visit_bfnd(b->ref);
|
||||
break;
|
||||
case LOGIF_NODE:
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr1); /* check cond */
|
||||
visit_bfnd(bif->entry.Template.bl_ptr1->ref);
|
||||
break;
|
||||
case ARITHIF_NODE:
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr1); /* check cond */
|
||||
break;
|
||||
case ASSIGN_STAT:
|
||||
case IDENTIFY:
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr1); /* check l_val */
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr2); /* check r_val */
|
||||
break;
|
||||
case PROC_STAT:
|
||||
visit_llnd(bif, bif->entry.Template.ll_ptr1); /* check l_val */
|
||||
break;
|
||||
case CONT_STAT:
|
||||
case FORMAT_STAT:
|
||||
case GOTO_NODE:
|
||||
case ASSGOTO_NODE:
|
||||
case COMGOTO_NODE:
|
||||
case STOP_STAT:
|
||||
case VAR_DECL:
|
||||
case PARAM_DECL:
|
||||
case DIM_STAT:
|
||||
case EQUI_STAT:
|
||||
case DATA_DECL:
|
||||
case IMPL_DECL:
|
||||
case READ_STAT:
|
||||
case WRITE_STAT:
|
||||
case OTHERIO_STAT:
|
||||
case COMM_STAT:
|
||||
case CONTROL_END:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* cvisit_llnd -- recursively visit the low level nodes and *
|
||||
* find those use and def info it references *
|
||||
* for VPC++ *
|
||||
* *
|
||||
* input: *
|
||||
* bif - the bif node to which the llnd belongs *
|
||||
* llnd - the low level node to be visit *
|
||||
* *
|
||||
****************************************************************/
|
||||
void
|
||||
cvisit_llnd(bif,llnd)
|
||||
PTR_BFND bif;
|
||||
PTR_LLND llnd;
|
||||
|
||||
{
|
||||
if (!llnd) return;
|
||||
|
||||
switch (llnd->variant) {
|
||||
case INT_VAL :
|
||||
case STMT_STR :
|
||||
case FLOAT_VAL :
|
||||
case DOUBLE_VAL :
|
||||
case STRING_VAL :
|
||||
case BOOL_VAL :
|
||||
case CHAR_VAL :
|
||||
break;
|
||||
case CONST_REF :
|
||||
case ENUM_REF :
|
||||
break;
|
||||
case VAR_REF :
|
||||
if(check_ref(llnd->entry.Template.symbol->id) == 0)
|
||||
build_ref(llnd->entry.Template.symbol, bif);
|
||||
break;
|
||||
case POINTST_OP : /* New added for VPC */
|
||||
case RECORD_REF: /* Need More */
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
/* Need More work for pointer combined with structure */
|
||||
break ;
|
||||
case ARRAY_OP :
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case ARRAY_REF :
|
||||
if(check_ref(llnd->entry.Template.symbol->id) == 0)
|
||||
build_ref(llnd->entry.Template.symbol, bif);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
break;
|
||||
case CONSTRUCTOR_REF :
|
||||
break;
|
||||
case ACCESS_REF :
|
||||
break;
|
||||
case CONS :
|
||||
break;
|
||||
case ACCESS :
|
||||
break;
|
||||
case IOACCESS :
|
||||
break;
|
||||
case PROC_CALL :
|
||||
case FUNC_CALL :
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
break;
|
||||
case EXPR_LIST :
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case EQUI_LIST :
|
||||
break;
|
||||
case COMM_LIST :
|
||||
break;
|
||||
case VAR_LIST :
|
||||
case CONTROL_LIST :
|
||||
break;
|
||||
case RANGE_LIST :
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case DDOT :
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case COPY_NODE :
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case VECTOR_CONST : /* NEW ADDED FOR VPC++ */
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
break;
|
||||
case INIT_LIST:
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
break ;
|
||||
case BIT_NUMBER:
|
||||
break ;
|
||||
case DEF_CHOICE :
|
||||
case SEQ :
|
||||
break;
|
||||
case SPEC_PAIR :
|
||||
break;
|
||||
case MOD_OP :
|
||||
break;
|
||||
case ASSGN_OP : /* New added for VPC */
|
||||
case ARITH_ASSGN_OP: /* New added for VPC */
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case EQ_OP :
|
||||
case LT_OP :
|
||||
case GT_OP :
|
||||
case NOTEQL_OP :
|
||||
case LTEQL_OP :
|
||||
case GTEQL_OP :
|
||||
case ADD_OP :
|
||||
case SUBT_OP :
|
||||
case OR_OP :
|
||||
case MULT_OP :
|
||||
case DIV_OP :
|
||||
case AND_OP :
|
||||
case EXP_OP :
|
||||
case LE_OP : /* New added for VPC *//*Duplicated*/
|
||||
case GE_OP : /* New added for VPC *//*Duplicated*/
|
||||
case NE_OP : /* New added for VPC *//*Duplicated*/
|
||||
case BITAND_OP : /* New added for VPC */
|
||||
case BITOR_OP : /* New added for VPC */
|
||||
case LSHIFT_OP : /* New added for VPC */
|
||||
case RSHIFT_OP : /* New added for VPC */
|
||||
case INTEGER_DIV_OP : /* New added for VPC */
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case FUNCTION_OP:
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case ADDRESS_OP : /* New added for VPC */
|
||||
case SIZE_OP : /* New added for VPC */
|
||||
break;
|
||||
case DEREF_OP :
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
break;
|
||||
case SUB_OP : /* duplicated unary minus */
|
||||
case MINUS_OP : /* unary operations */
|
||||
case UNARY_ADD_OP : /* New added for VPC */
|
||||
case BIT_COMPLEMENT_OP : /* New added for VPC */
|
||||
case NOT_OP :
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
break;
|
||||
case MINUSMINUS_OP: /* New added for VPC */
|
||||
case PLUSPLUS_OP : /* New added for VPC */
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case STAR_RANGE :
|
||||
break;
|
||||
case CLASSINIT_OP : /* New added for VPC */
|
||||
break ;
|
||||
case CAST_OP : /* New added for VPC */
|
||||
break;
|
||||
case EXPR_IF : /* New added for VPC */
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case EXPR_IF_BODY : /* New added for VPC */
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif,llnd->entry.Template.ll_ptr2);
|
||||
break;
|
||||
case FUNCTION_REF : /* New added for VPC */
|
||||
break ;
|
||||
case LABEL_REF: /* Fortran Version, For VPC we need more */
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* cvisit_bfnd -- visits the subtree "bif" and generates the *
|
||||
* use-definition info of the variables it *
|
||||
* references for VPC++ *
|
||||
* input: *
|
||||
* bif - the root of the tree to be visitd *
|
||||
* *
|
||||
* side effect: *
|
||||
* build the ud_chain at where the static variable *
|
||||
* "head_symb" points to *
|
||||
* *
|
||||
****************************************************************/
|
||||
void
|
||||
cvisit_bfnd(bif)
|
||||
PTR_BFND bif;
|
||||
|
||||
{
|
||||
register PTR_BLOB b;
|
||||
void cvisit_llnd();
|
||||
|
||||
if (!bif) return;
|
||||
pt = temp; /* reset the pointer */
|
||||
|
||||
switch (bif->variant) {
|
||||
case GLOBAL :
|
||||
case PROG_HEDR :
|
||||
case PROC_HEDR :
|
||||
case FUNC_HEDR :
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
break;
|
||||
case IF_NODE :
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1); /* check cond */
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
for (b = bif->entry.Template.bl_ptr2; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
break;
|
||||
case LOGIF_NODE :
|
||||
case ARITHIF_NODE:
|
||||
case WHERE_NODE :
|
||||
break;
|
||||
case FOR_NODE :
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr2);
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr3);
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
break;
|
||||
case FORALL_NODE :
|
||||
case WHILE_NODE :
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1);
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
break;
|
||||
case ASSIGN_STAT:
|
||||
case IDENTIFY:
|
||||
case PROC_STAT :
|
||||
case SAVE_DECL:
|
||||
case CONT_STAT:
|
||||
case FORMAT_STAT:
|
||||
break;
|
||||
case LABEL_STAT:
|
||||
break;
|
||||
case GOTO_NODE:
|
||||
break;
|
||||
case ASSGOTO_NODE:
|
||||
case COMGOTO_NODE:
|
||||
case STOP_STAT:
|
||||
break;
|
||||
case RETURN_STAT:
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1);
|
||||
break;
|
||||
case PARAM_DECL :
|
||||
case DIM_STAT:
|
||||
case EQUI_STAT:
|
||||
case DATA_DECL:
|
||||
case READ_STAT:
|
||||
case WRITE_STAT:
|
||||
case OTHERIO_STAT:
|
||||
case COMM_STAT:
|
||||
case CONTROL_END:
|
||||
break;
|
||||
case CLASS_DECL: /* New added for VPC */
|
||||
break;
|
||||
case ENUM_DECL : /* New added for VPC */
|
||||
case UNION_DECL: /* New added for VPC */
|
||||
case STRUCT_DECL: /* New added for VPC */
|
||||
break;
|
||||
case DERIVED_CLASS_DECL: /* Need More for VPC */
|
||||
case VAR_DECL:
|
||||
break;
|
||||
case EXPR_STMT_NODE: /* New added for VPC */
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1);
|
||||
break ;
|
||||
case DO_WHILE_NODE: /* New added for VPC */
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1);
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
break;
|
||||
case SWITCH_NODE : /* New added for VPC */
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1);
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
break ;
|
||||
case CASE_NODE : /* New added for VPC */
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1);
|
||||
break ;
|
||||
case DEFAULT_NODE: /* New added for VPC */
|
||||
break;
|
||||
case BASIC_BLOCK :
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
break ;
|
||||
case BREAK_NODE : /* New added for VPC */
|
||||
break;
|
||||
case CONTINUE_NODE: /* New added for VPC */
|
||||
break;
|
||||
case RETURN_NODE : /* New added for VPC */
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1);
|
||||
break;
|
||||
case ASM_NODE : /* New added for VPC */
|
||||
break; /* Need More */
|
||||
case SPAWN_NODE : /* New added for VPC */
|
||||
break;
|
||||
case PARFOR_NODE : /* New added for VPC */
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr1);
|
||||
cvisit_llnd(bif, bif->entry.Template.ll_ptr2);
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
break;
|
||||
case PAR_NODE : /* New added for VPC */
|
||||
for (b = bif->entry.Template.bl_ptr1; b; b = b->next)
|
||||
cvisit_bfnd(b->ref);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* gen_udchain -- visits the bif tree of the given "proj" *
|
||||
* and generates the use-definition info the *
|
||||
* proj has referenced *
|
||||
* *
|
||||
* input: *
|
||||
* proj -- the project to be visited *
|
||||
* *
|
||||
****************************************************************/
|
||||
void
|
||||
gen_udchain(proj)
|
||||
PTR_FILE proj;
|
||||
{
|
||||
if(proj->head_bfnd == NULL)
|
||||
return;
|
||||
|
||||
proj_filename = (char *) calloc(strlen(proj->filename), sizeof(char));
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,proj_filename, 0);
|
||||
#endif
|
||||
head_symb = proj->head_symb;
|
||||
switch (language) {
|
||||
case ForSrc:
|
||||
visit_bfnd(proj->global_bfnd);
|
||||
break;
|
||||
case CSrc:
|
||||
cvisit_bfnd(proj->global_bfnd);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
dump_udchain(proj)
|
||||
PTR_FILE proj;
|
||||
{
|
||||
register PTR_SYMB s;
|
||||
register PTR_BLOB b;
|
||||
|
||||
if(proj->global_bfnd)
|
||||
for (s = proj->head_symb; s; s = s->thread) {
|
||||
if (s->ud_chain) {
|
||||
fprintf(stderr, "Variable \"%s\" referenced at line(s) -- ",
|
||||
s->ident);
|
||||
for(b = s->ud_chain; b; b = b->next)
|
||||
fprintf(stderr, "%d%s", b->ref->g_line,
|
||||
(b->next? ", ": "\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
clean_hash_tbl(fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
register PTR_HASH h, h1, h2;
|
||||
|
||||
for (h = *(fi->hash_tbl); h < *(fi->hash_tbl)+hashMax; h++)
|
||||
if (h) {
|
||||
for (h1 = h->next_entry; h1; h1 = h2) {
|
||||
h2 = h1->next_entry;
|
||||
#ifdef __SPF
|
||||
removeFromCollection(h1);
|
||||
#endif
|
||||
free(h1);
|
||||
}
|
||||
h = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
free_dep(fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
register PTR_BLOB bl1, bl2;
|
||||
register PTR_BFND bf;
|
||||
|
||||
clean_hash_tbl(fi);
|
||||
for (bf = fi->global_bfnd; bf; bf = bf->thread) {
|
||||
for (bl1 = bf->entry.Template.bl_ptr1; bl1; bl1 = bl2) {
|
||||
bl2 = bl1->next;
|
||||
#ifdef __SPF
|
||||
removeFromCollection(bl1);
|
||||
#endif
|
||||
free(bl1);
|
||||
}
|
||||
for (bl1 = bf->entry.Template.bl_ptr2; bl1; bl1 = bl2) {
|
||||
bl2 = bl1->next;
|
||||
#ifdef __SPF
|
||||
removeFromCollection(bl1);
|
||||
#endif
|
||||
free(bl1);
|
||||
}
|
||||
}
|
||||
|
||||
if (fi->num_bfnds)
|
||||
{
|
||||
#ifdef __SPF
|
||||
removeFromCollection(fi->head_bfnd);
|
||||
#endif
|
||||
free(fi->head_bfnd);
|
||||
}
|
||||
|
||||
if (fi->num_llnds)
|
||||
{
|
||||
#ifdef __SPF
|
||||
removeFromCollection(fi->head_llnd);
|
||||
#endif
|
||||
free(fi->head_llnd);
|
||||
}
|
||||
|
||||
if (fi->num_symbs) {
|
||||
register PTR_SYMB s;
|
||||
|
||||
for (s = fi->head_symb; s; s = s)
|
||||
{
|
||||
#ifdef __SPF
|
||||
removeFromCollection(s->ident);
|
||||
#endif
|
||||
free(s->ident);
|
||||
}
|
||||
#ifdef __SPF
|
||||
removeFromCollection(fi->head_symb);
|
||||
#endif
|
||||
free(fi->head_symb);
|
||||
}
|
||||
|
||||
if (fi->num_label)
|
||||
{
|
||||
#ifdef __SPF
|
||||
removeFromCollection(fi->head_lab);
|
||||
#endif
|
||||
free(fi->head_lab);
|
||||
}
|
||||
|
||||
if (fi->num_types)
|
||||
{
|
||||
#ifdef __SPF
|
||||
removeFromCollection(fi->head_type);
|
||||
#endif
|
||||
free(fi->head_type);
|
||||
}
|
||||
|
||||
if (fi->num_dep)
|
||||
{
|
||||
#ifdef __SPF
|
||||
removeFromCollection(fi->head_dep);
|
||||
#endif
|
||||
free(fi->head_dep);
|
||||
}
|
||||
|
||||
if (fi->num_cmnt) {
|
||||
register PTR_CMNT c;
|
||||
|
||||
for (c = fi->head_cmnt; c; c = c->next)
|
||||
{
|
||||
#ifdef __SPF
|
||||
removeFromCollection(c->string);
|
||||
#endif
|
||||
free(c->string);
|
||||
}
|
||||
#ifdef __SPF
|
||||
removeFromCollection(fi->head_cmnt);
|
||||
#endif
|
||||
free(fi->head_cmnt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
replace_dep(filename)
|
||||
char *filename;
|
||||
{
|
||||
PTR_FILE fi;
|
||||
PTR_BLOB bl;
|
||||
extern PTR_PROJ cur_proj;
|
||||
|
||||
for (bl = cur_proj->file_chain; bl; bl = bl->next) {
|
||||
fi = (PTR_FILE) bl->ref;
|
||||
if (!strcmp(fi->filename, filename)) {
|
||||
#ifdef __SPF
|
||||
removeFromCollection(fi);
|
||||
#endif
|
||||
free_dep(fi);
|
||||
read_nodes(fi);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
229
dvm/fdvm/trunk/Sage/lib/oldsrc/garb_coll.c
Normal file
229
dvm/fdvm/trunk/Sage/lib/oldsrc/garb_coll.c
Normal file
@@ -0,0 +1,229 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "db.h"
|
||||
|
||||
|
||||
|
||||
PTR_LLND free_ll_list = NULL;
|
||||
static int num_marked;
|
||||
int num_ll_allocated = 0;
|
||||
|
||||
|
||||
static void
|
||||
mark_llnd(p)
|
||||
PTR_LLND p;
|
||||
{
|
||||
if(p == NULL || p->id == -1)
|
||||
return;
|
||||
p->id = -1; num_marked++;
|
||||
mark_llnd(p->entry.Template.ll_ptr1);
|
||||
mark_llnd(p->entry.Template.ll_ptr2);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mark_refl(p)
|
||||
PTR_REFL p;
|
||||
{
|
||||
for (; p; p = p->next)
|
||||
if(p->node != NULL)
|
||||
mark_llnd(p->node->refer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mark_arefl(p)
|
||||
PTR_AREF p;
|
||||
{
|
||||
for (; p; p = p->next){
|
||||
mark_llnd(p->decl_ranges);
|
||||
mark_llnd(p->use_bnd0);
|
||||
mark_llnd(p->mod_bnd0);
|
||||
mark_llnd(p->use_bnd1);
|
||||
mark_llnd(p->mod_bnd1);
|
||||
mark_llnd(p->use_bnd2);
|
||||
mark_llnd(p->mod_bnd2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mark_sets(s)
|
||||
struct sets *s;
|
||||
{
|
||||
if(s == NULL) return;
|
||||
|
||||
mark_refl(s->gen);
|
||||
mark_refl(s->in_def);
|
||||
mark_refl(s->use);
|
||||
mark_refl(s->in_use);
|
||||
mark_refl(s->out_def);
|
||||
mark_refl(s->out_use);
|
||||
mark_arefl(s->arefl);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mark_depnds(p)
|
||||
PTR_DEP p;
|
||||
{
|
||||
int depcnt;
|
||||
depcnt = 0;
|
||||
|
||||
for (; p != NULL; p = p->thread){
|
||||
mark_llnd(p->to.refer);
|
||||
mark_llnd(p->from.refer);
|
||||
depcnt++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mark_symb(fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
PTR_SYMB s;
|
||||
|
||||
for (s = fi->head_symb; s; s = s->thread) {
|
||||
if (s->variant == CONST_NAME)
|
||||
mark_llnd(s->entry.const_value);
|
||||
else if(s->variant == FIELD_NAME)
|
||||
mark_llnd(s->entry.field.restricted_bit);
|
||||
else if(s->variant == VAR_FIELD)
|
||||
mark_llnd(s->entry.variant_field.variant_list);
|
||||
else if (s->variant == PROCEDURE_NAME ||
|
||||
s->variant == FUNCTION_NAME)
|
||||
mark_llnd(s->entry.proc_decl.call_list);
|
||||
else if(s->variant == MEMBER_FUNC)
|
||||
mark_llnd(s->entry.member_func.call_list);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mark_type(fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
PTR_TYPE s;
|
||||
for (s = fi->head_type; s; s = s->thread) {
|
||||
if(s->variant == T_ARRAY)
|
||||
mark_llnd(s->entry.ar_decl.ranges);
|
||||
else if(s->variant == T_DESCRIPT ||
|
||||
s->variant == T_POINTER ||
|
||||
s->variant == T_LIST ||
|
||||
s->variant == T_FUNCTION)
|
||||
mark_llnd(s->entry.Template.ranges);
|
||||
else if(s->variant == T_SUBRANGE){
|
||||
mark_llnd(s->entry.subrange.lower);
|
||||
mark_llnd(s->entry.subrange.upper);
|
||||
}
|
||||
else{
|
||||
mark_llnd(s->entry.Template.ranges);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
mark_bfnd(b)
|
||||
PTR_BFND b;
|
||||
{
|
||||
PTR_BLOB bl;
|
||||
|
||||
if(b == NULL) return;
|
||||
|
||||
mark_llnd(b->entry.Template.ll_ptr1);
|
||||
mark_llnd(b->entry.Template.ll_ptr2);
|
||||
mark_llnd(b->entry.Template.ll_ptr3);
|
||||
mark_sets(b->entry.Template.sets);
|
||||
|
||||
for (bl = b->entry.Template.bl_ptr1; bl; bl = bl->next)
|
||||
mark_bfnd(bl->ref);
|
||||
|
||||
for (bl = b->entry.Template.bl_ptr2; bl; bl = bl->next)
|
||||
mark_bfnd(bl->ref);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
collect_garbage(fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
PTR_LLND p, t;
|
||||
int count;
|
||||
|
||||
p = free_ll_list;
|
||||
count = 0;
|
||||
while(p != NULL){
|
||||
count++;
|
||||
p = p->thread;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
for (p = fi->head_llnd; p && p != fi->cur_llnd; p = p->thread){
|
||||
p->id = 0;
|
||||
count++;
|
||||
}
|
||||
|
||||
fi->cur_llnd->id = 0; count++;
|
||||
|
||||
num_marked = 0;
|
||||
mark_bfnd(fi->head_bfnd);
|
||||
/* printf("num marked from bfnd = %d\n", num_marked); */
|
||||
|
||||
num_marked = 0;
|
||||
mark_depnds(fi->head_dep);
|
||||
/* printf("num marked from deps= %d\n", num_marked); */
|
||||
|
||||
num_marked = 0;
|
||||
mark_symb(fi);
|
||||
/* printf("num marked from symb= %d\n", num_marked); */
|
||||
|
||||
num_marked = 0;
|
||||
mark_type(fi);
|
||||
/* printf("num marked from type= %d\n", num_marked); */
|
||||
|
||||
num_marked = 0;
|
||||
p = fi->head_llnd;
|
||||
fi->cur_llnd = fi->head_llnd;
|
||||
count = 1;
|
||||
p->id = count++; p = p->thread;
|
||||
fi->cur_llnd->thread = NULL;
|
||||
|
||||
while(p != NULL){
|
||||
if(p->id == -1){ /*touched */
|
||||
fi->cur_llnd->thread = p;
|
||||
fi->cur_llnd = p;
|
||||
p = p->thread;
|
||||
fi->cur_llnd->id = count++;
|
||||
fi->cur_llnd->thread = NULL;
|
||||
} else if(p->id == 0) {
|
||||
t = p; p = p->thread;
|
||||
t->id = -2; num_marked++;
|
||||
t->thread= free_ll_list;
|
||||
t->entry.Template.ll_ptr1 = NULL;
|
||||
t->entry.Template.ll_ptr2 = NULL;
|
||||
t->entry.Template.symbol = NULL;
|
||||
t->variant = 800;
|
||||
free_ll_list = t;
|
||||
}
|
||||
else { printf("error in garbage collection\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
fi->num_llnds = count -1 ;
|
||||
num_ll_allocated = 0;
|
||||
printf(" total llnodes = %d garbage collected = %d\n",count, num_marked);
|
||||
}
|
||||
|
||||
int num_of_llnds(fi)
|
||||
PTR_FILE fi;
|
||||
{ return fi->num_llnds; }
|
||||
494
dvm/fdvm/trunk/Sage/lib/oldsrc/glob_anal.c
Normal file
494
dvm/fdvm/trunk/Sage/lib/oldsrc/glob_anal.c
Normal file
@@ -0,0 +1,494 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/* file: glob_anal.c */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "db.h"
|
||||
#ifdef SYS5
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#define MAX_FUNS 500
|
||||
|
||||
#ifdef __SPF
|
||||
extern void addToCollection(const int line, const char *file, void *pointer, int type);
|
||||
#endif
|
||||
|
||||
void *malloc();
|
||||
void bind_call_site_info();
|
||||
|
||||
static PTR_FILE current_file;
|
||||
|
||||
extern PTR_FILE cur_file;
|
||||
extern int debug;
|
||||
|
||||
typedef struct call_list *PTR_CALLS;
|
||||
typedef struct function_decl *PTR_FUNCS;
|
||||
|
||||
struct call_list {
|
||||
char *name;
|
||||
int funs_number; /* set to the index in the funs table */
|
||||
/* -1 if the function is unknown */
|
||||
PTR_LLND used, modified;
|
||||
PTR_BFND call_site; /* statement which holds call to this fun */
|
||||
PTR_CALLS next;
|
||||
};
|
||||
|
||||
|
||||
struct function_decl {
|
||||
PTR_FILE file; /* file object where this function was
|
||||
* defined */
|
||||
PTR_SYMB name; /* point to the symbol table of this functin */
|
||||
PTR_BFND fun; /* point to the BIF node of this functio */
|
||||
int is_done;
|
||||
PTR_LLND used, modified;
|
||||
PTR_CALLS calls;
|
||||
} funs[MAX_FUNS];
|
||||
|
||||
int num_of_funs = 0;
|
||||
|
||||
static int now;
|
||||
static int val[MAX_FUNS], /* keep the depth-first numbering */
|
||||
ival[MAX_FUNS]; /* keep the inverse calling numbering */
|
||||
|
||||
|
||||
/*
|
||||
* visit does the depth-first numbering for nodes
|
||||
* for the call graph
|
||||
*
|
||||
* the array "val" keep the depth-first visiting numbering
|
||||
* while the array "ival" is the inverse of "val", i.e. is
|
||||
* the reverse calling sequence
|
||||
*/
|
||||
static void visit(k)
|
||||
int k;
|
||||
{
|
||||
PTR_CALLS p;
|
||||
|
||||
ival[now] = k;
|
||||
val[k] = now++;
|
||||
for (p = funs[k].calls; p; p = p->next) /* for each adjacent node */
|
||||
if (val[p->funs_number] < 0)/* haven't visited yet */
|
||||
visit(p->funs_number);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* dfs does the depth-first search of the call graph
|
||||
*/
|
||||
static void dfs()
|
||||
{
|
||||
int k;
|
||||
|
||||
now = 0; /* keep track of the numbering */
|
||||
for (k = 0; k < num_of_funs; k++) /* initialize to be un-read */
|
||||
val[k] = -1;
|
||||
for (k = 0; k < num_of_funs; k++) /* now do the depth-first search */
|
||||
if (val[k] < 0)
|
||||
visit(k);
|
||||
}
|
||||
|
||||
|
||||
void reset_llnd(p)
|
||||
PTR_LLND p;
|
||||
{
|
||||
if (p == NULL)
|
||||
return;
|
||||
if (p->variant == VAR_REF) {
|
||||
p->entry.Template.ll_ptr1 = NULL;
|
||||
}
|
||||
reset_llnd(p->entry.Template.ll_ptr1);
|
||||
reset_llnd(p->entry.Template.ll_ptr2);
|
||||
}
|
||||
|
||||
|
||||
void reset_scalar_propogation(b)
|
||||
PTR_BFND b;
|
||||
{
|
||||
PTR_BLOB bl;
|
||||
|
||||
if (b == NULL)
|
||||
return;
|
||||
if ((b->variant != FUNC_HEDR) && (b->variant != PROC_HEDR)) {
|
||||
reset_llnd(b->entry.Template.ll_ptr1);
|
||||
reset_llnd(b->entry.Template.ll_ptr2);
|
||||
reset_llnd(b->entry.Template.ll_ptr3);
|
||||
}
|
||||
for (bl = b->entry.Template.bl_ptr1; bl; bl = bl->next)
|
||||
reset_scalar_propogation(bl->ref);
|
||||
|
||||
for (bl = b->entry.Template.bl_ptr2; bl; bl = bl->next)
|
||||
reset_scalar_propogation(bl->ref);
|
||||
}
|
||||
|
||||
|
||||
/* make_fun_decl initialized an entry in the funs table for a function at */
|
||||
/* statement b */
|
||||
static void make_fun_decl(f, b)
|
||||
PTR_FILE f;
|
||||
PTR_BFND b;
|
||||
{
|
||||
PTR_FUNCS i;
|
||||
PTR_LLND make_llnd();
|
||||
|
||||
i = funs + num_of_funs++;
|
||||
if (num_of_funs > MAX_FUNS) {
|
||||
fprintf(stderr, "Too many functions!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* b's ll_ptr3 points to an expr list whose ll_ptr1 is the pre global */
|
||||
/* analysis use set and whose ll_ptr2 will be the post analysis use set */
|
||||
if (b->entry.Template.ll_ptr3 == NULL) { /* summary of use info */
|
||||
fprintf(stderr, "bad initial analysis. run vcc or cfp again\n");
|
||||
b->entry.Template.ll_ptr3 = make_llnd(cur_file,EXPR_LIST,NULL, NULL, NULL);
|
||||
}
|
||||
if (b->entry.Template.ll_ptr2 == NULL) { /* summary of mod info */
|
||||
fprintf(stderr, "bad initial analysis. run vcc or cfp again\n");
|
||||
b->entry.Template.ll_ptr2 = make_llnd(cur_file,EXPR_LIST, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
i->file = f;
|
||||
i->name = b->entry.Template.symbol;
|
||||
i->fun = b;
|
||||
i->is_done = 0;
|
||||
i->used = b->entry.Template.ll_ptr3->entry.Template.ll_ptr1;
|
||||
i->modified = b->entry.Template.ll_ptr2->entry.Template.ll_ptr1;
|
||||
i->calls = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* call this function with the project_object */
|
||||
/* to build the list of functions. */
|
||||
static void make_fun_list(proj)
|
||||
PTR_PROJ proj;
|
||||
{
|
||||
PTR_FILE f;
|
||||
PTR_BLOB b1, b;
|
||||
PTR_BFND p;
|
||||
PTR_REFL make_name_list();
|
||||
PTR_SETS alloc_sets();
|
||||
/* Scan through all files in the project */
|
||||
for (b1 = proj->file_chain; b1; b1 = b1->next) {
|
||||
f = (PTR_FILE) b1->ref;
|
||||
for (b = f->global_bfnd->entry.Template.bl_ptr1; b; b = b->next)
|
||||
if (b->ref->variant == FUNC_HEDR ||
|
||||
b->ref->variant == PROC_HEDR ||
|
||||
b->ref->variant == PROG_HEDR) {
|
||||
make_fun_decl(f, b->ref);
|
||||
p = b->ref;
|
||||
if (p->entry.Template.sets == NULL)
|
||||
p->entry.Template.sets = alloc_sets();
|
||||
p->entry.Template.sets->out_use = NULL;
|
||||
p->entry.Template.sets->in_use = NULL;
|
||||
p->entry.Template.sets->out_def = NULL;
|
||||
p->entry.Template.sets->in_def = NULL;
|
||||
p->entry.Template.sets->gen = NULL;
|
||||
p->entry.Template.sets->use = NULL;
|
||||
/* set in_def to be a ref list of all */
|
||||
/* parameters to this proc. this is */
|
||||
/* used in the global analysis phase */
|
||||
p->entry.Template.sets->in_def =
|
||||
make_name_list(
|
||||
p->entry.Template.symbol->entry.proc_decl.in_list
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* find_by_name searches the funs list for the function whose name is */
|
||||
/* given by the char string s */
|
||||
static int find_by_name(PTR_FILE f, char *s)
|
||||
/*PTR_FILE f;*/
|
||||
/*char *s;*/
|
||||
{
|
||||
int i;
|
||||
|
||||
f = f; /* make lint happy, f unused */
|
||||
for (i = 0; i < num_of_funs; i++)
|
||||
if ( /* funs[i].file == f && */ (!strcmp(s, funs[i].name->ident)))
|
||||
return i;
|
||||
for (i = 0; i < num_of_funs; i++)
|
||||
if (!strcmp(s, funs[i].name->ident))
|
||||
return i;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
PTR_BFND find_fun_by_name(s)
|
||||
char *s;
|
||||
{
|
||||
int i;
|
||||
i = find_by_name(NULL, s);
|
||||
if (i < 0)
|
||||
return NULL;
|
||||
return funs[i].fun;
|
||||
}
|
||||
|
||||
|
||||
/* get_fun_number takes a pointer to a symbol table entry and looks */
|
||||
/* it up in the funs table and returns the index. like the others */
|
||||
/* it returns -1 if nothing is found that matches s. */
|
||||
/*static int get_fun_number(f, s)
|
||||
PTR_FILE f;
|
||||
PTR_SYMB s;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < num_of_funs; i++)
|
||||
if (funs[i].file == f && funs[i].name == s)
|
||||
return i;
|
||||
return (-1);
|
||||
}*/
|
||||
|
||||
|
||||
/* append_to_call_list takes the symbol table pointer of a function */
|
||||
/* that calls another function whose name is given by a char string */
|
||||
/* and appends the name of the called function to the calls list of */
|
||||
/* the funs entry for the calling function. */
|
||||
static void append_to_call_list(calling_fun, called_fun_ident, bf)
|
||||
int calling_fun;
|
||||
char *called_fun_ident;
|
||||
PTR_BFND bf;
|
||||
{
|
||||
int called_fun;
|
||||
PTR_CALLS p;
|
||||
PTR_BFND b;
|
||||
|
||||
called_fun = find_by_name(funs[calling_fun].file, called_fun_ident);
|
||||
if (called_fun == -1) {
|
||||
fprintf(stderr, "Called \"%s\" function not in the project\n",
|
||||
called_fun_ident);
|
||||
return;
|
||||
}
|
||||
|
||||
b = funs[calling_fun].fun;
|
||||
p = (PTR_CALLS) malloc(sizeof(struct call_list));
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,p, 0);
|
||||
#endif
|
||||
p->name = b->entry.Template.symbol->ident;
|
||||
p->funs_number = called_fun;
|
||||
p->call_site = bf;
|
||||
p->used = NULL;
|
||||
p->modified = NULL;
|
||||
p->next = funs[calling_fun].calls;
|
||||
funs[calling_fun].calls = p;
|
||||
}
|
||||
|
||||
|
||||
static void func_call_in_llnd(ll, i, bf)
|
||||
PTR_LLND ll;
|
||||
int i;
|
||||
PTR_BFND bf;
|
||||
{
|
||||
if (ll == NULL)
|
||||
return;
|
||||
if (ll->variant == FUNC_CALL ||
|
||||
ll->variant == PROC_CALL ||
|
||||
ll->variant == FUNCTION_REF)
|
||||
append_to_call_list(i, ll->entry.Template.symbol->ident, bf);
|
||||
|
||||
/* NOTE: the following code is "tag" dependent */
|
||||
if (ll->variant >= VAR_LIST && ll->variant < CONST_NAME) {
|
||||
func_call_in_llnd(ll->entry.Template.ll_ptr1, i, bf);
|
||||
func_call_in_llnd(ll->entry.Template.ll_ptr2, i, bf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void func_call_in_bfnd(bl, i)
|
||||
PTR_BLOB bl;
|
||||
int i;
|
||||
{
|
||||
PTR_BFND bf;
|
||||
PTR_BLOB bl1;
|
||||
|
||||
for (bl1 = bl; bl1; bl1 = bl1->next) {
|
||||
bf = bl1->ref;
|
||||
if (bf->variant == PROC_CALL ||
|
||||
bf->variant == FUNC_CALL ||
|
||||
bf->variant == PROC_STAT)
|
||||
append_to_call_list(i, bf->entry.Template.symbol->ident, bf);
|
||||
func_call_in_llnd(bf->entry.Template.ll_ptr1, i, bf);
|
||||
func_call_in_llnd(bf->entry.Template.ll_ptr2, i, bf);
|
||||
func_call_in_llnd(bf->entry.Template.ll_ptr3, i, bf);
|
||||
|
||||
func_call_in_bfnd(bf->entry.Template.bl_ptr1, i);
|
||||
func_call_in_bfnd(bf->entry.Template.bl_ptr2, i);
|
||||
}
|
||||
}
|
||||
|
||||
static void rec_list_cgraph(i)
|
||||
int i;
|
||||
{
|
||||
func_call_in_bfnd(funs[i].fun->entry.Template.bl_ptr1, i);
|
||||
}
|
||||
|
||||
|
||||
void BuildCallGraph()
|
||||
{
|
||||
int i;
|
||||
fprintf(stderr, "\n the call graph is:\n");
|
||||
for (i = 0; i < num_of_funs; i++) {
|
||||
rec_list_cgraph(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ready_for_analysis returns
|
||||
*
|
||||
* 0 if not ready
|
||||
* 1 if it is ready
|
||||
* 2 if analysis is done.
|
||||
*/
|
||||
static int ready_for_analysis(i)
|
||||
int i;
|
||||
{
|
||||
PTR_CALLS calls;
|
||||
|
||||
if (funs[i].is_done == 0) {
|
||||
for (calls = funs[i].calls; calls; calls = calls->next)
|
||||
if (calls->funs_number > -1 &&
|
||||
funs[calls->funs_number].is_done == 0)
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
return (2);
|
||||
}
|
||||
|
||||
|
||||
static PTR_LLND link_ll_chain(list, elist)
|
||||
PTR_LLND list, elist;
|
||||
{
|
||||
PTR_LLND p;
|
||||
|
||||
p = list;
|
||||
while (p != NULL && p->entry.Template.ll_ptr2 != NULL)
|
||||
p = p->entry.Template.ll_ptr2;
|
||||
if (p != NULL)
|
||||
p->entry.Template.ll_ptr2 = elist;
|
||||
else
|
||||
list = elist;
|
||||
return (list);
|
||||
}
|
||||
|
||||
|
||||
static PTR_LLND link_ll_set_list(b, s)
|
||||
PTR_LLND s;
|
||||
PTR_BFND b;
|
||||
{
|
||||
PTR_REFL rl, build_refl(), remove_locals_from_list();
|
||||
PTR_LLND link_set_list();
|
||||
|
||||
rl = build_refl(b, s);
|
||||
rl = remove_locals_from_list(rl);
|
||||
return (link_set_list(rl));
|
||||
}
|
||||
|
||||
|
||||
static void use_mod(c)
|
||||
PTR_CALLS c;
|
||||
{
|
||||
PTR_BFND b;
|
||||
PTR_LLND used, modified;
|
||||
|
||||
b = c->call_site;
|
||||
bind_call_site_info(b, &used, &modified);
|
||||
c->used = link_ll_set_list(b, used);
|
||||
c->modified = link_ll_set_list(b, modified);
|
||||
}
|
||||
|
||||
|
||||
static void compute_use_mod()
|
||||
{
|
||||
int modified = 1;
|
||||
PTR_CALLS calls;
|
||||
PTR_LLND use, mod;
|
||||
int i, j;
|
||||
|
||||
while (modified) {
|
||||
modified = 0;
|
||||
for (j = num_of_funs - 1; j >= 0; j--) {
|
||||
i = ival[j];
|
||||
if (ready_for_analysis(i) == 1) {
|
||||
if (debug) {
|
||||
fprintf(stderr, "_______________________________\n");
|
||||
fprintf(stderr, "doing global analysis for %s\n", funs[i].name->ident);
|
||||
}
|
||||
calls = funs[i].calls;
|
||||
current_file = funs[i].file;
|
||||
while (calls != NULL) {
|
||||
if (calls->funs_number > -1 &&
|
||||
funs[calls->funs_number].is_done == 1)
|
||||
use_mod(calls);
|
||||
calls = calls->next;
|
||||
}
|
||||
funs[i].is_done = 1;
|
||||
/* now link results together */
|
||||
use = funs[i].used;
|
||||
mod = funs[i].modified;
|
||||
calls = funs[i].calls;
|
||||
while (calls != NULL) {
|
||||
if (calls->funs_number > -1 &&
|
||||
funs[calls->funs_number].is_done == 1) {
|
||||
use = link_ll_chain(use, calls->used);
|
||||
mod = link_ll_chain(mod, calls->modified);
|
||||
}
|
||||
calls = calls->next;
|
||||
}
|
||||
use = link_ll_set_list(funs[i].fun, use);
|
||||
mod = link_ll_set_list(funs[i].fun, mod);
|
||||
funs[i].used = link_ll_set_list(funs[i].fun, use);
|
||||
funs[i].modified = link_ll_set_list(funs[i].fun, mod);
|
||||
funs[i].fun->entry.Template.ll_ptr3
|
||||
->entry.Template.ll_ptr2 = funs[i].used;
|
||||
funs[i].fun->entry.Template.ll_ptr2
|
||||
->entry.Template.ll_ptr2 = funs[i].modified;
|
||||
modified = 1;
|
||||
}
|
||||
} /* end for */
|
||||
} /* end while */
|
||||
|
||||
modified = 0;
|
||||
for (i = 0; i < num_of_funs; i++) {
|
||||
if (ready_for_analysis(i) == 2) {
|
||||
funs[i].fun->entry.Template.ll_ptr3
|
||||
->entry.Template.ll_ptr2 = funs[i].used;
|
||||
funs[i].fun->entry.Template.ll_ptr2
|
||||
->entry.Template.ll_ptr2 = funs[i].modified;
|
||||
}
|
||||
else
|
||||
modified = 1;
|
||||
}
|
||||
if (modified && debug)
|
||||
fprintf(stderr, "; cycle in call graph. no global analysis\n");
|
||||
current_file = NULL;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* GlobalAnal -- does the inter-procedural analysis for the *
|
||||
* given project *
|
||||
* *
|
||||
* Input: *
|
||||
* proj - the pointer to the project to be analized *
|
||||
* *
|
||||
* Output: *
|
||||
* none *
|
||||
* *
|
||||
****************************************************************/
|
||||
void GlobalAnal(proj)
|
||||
PTR_PROJ proj;
|
||||
{
|
||||
make_fun_list(proj); /* gather all the functions declared */
|
||||
BuildCallGraph(); /* build the call graph */
|
||||
dfs(); /* do the depth-first search */
|
||||
compute_use_mod(); /* do the inter-procedural analysis now */
|
||||
}
|
||||
433
dvm/fdvm/trunk/Sage/lib/oldsrc/ker_fun.c
Normal file
433
dvm/fdvm/trunk/Sage/lib/oldsrc/ker_fun.c
Normal file
@@ -0,0 +1,433 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/* file: ker_fun.c */
|
||||
|
||||
/**********************************************************************/
|
||||
/* This file contains the routines called in sets.c that do all cache*/
|
||||
/* analysis and estimation routines. */
|
||||
/**********************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
#include "bif.h"
|
||||
#include "ll.h"
|
||||
#include "symb.h"
|
||||
#include "sets.h"
|
||||
|
||||
#define PLUS 2
|
||||
#define ZPLUS 3
|
||||
#define MINUS 4
|
||||
#define ZMINUS 5
|
||||
#define PLUSMINUS 6
|
||||
#define NODEP -1
|
||||
|
||||
#ifdef __SPF
|
||||
extern void addToCollection(const int line, const char *file, void *pointer, int type);
|
||||
#endif
|
||||
|
||||
extern int show_deps;
|
||||
|
||||
void *malloc();
|
||||
PTR_SETS alloc_sets();
|
||||
PTR_REFL alloc_ref();
|
||||
int disp_refl();
|
||||
PTR_REFL copy_refl();
|
||||
PTR_REFL union_refl();
|
||||
int **a_array;
|
||||
int a_allocd = 0;
|
||||
int x[20]; /* a temporary used to compute the vector c */
|
||||
int c[20]; /* such that h(c) = dist */
|
||||
int gcd();
|
||||
int make_induct_list();
|
||||
int comp_ker();
|
||||
int find_mults();
|
||||
|
||||
int unif_gen(sor, des, vec, troub, source, destin)
|
||||
int vec[], troub[];
|
||||
struct ref *sor;
|
||||
struct ref *des;
|
||||
struct subscript *source;
|
||||
struct subscript *destin;
|
||||
{
|
||||
PTR_SYMB sor_ind_l[MAX_NEST_DEPTH], des_ind_l[MAX_NEST_DEPTH];
|
||||
struct subscript il_lo[MAX_NEST_DEPTH];
|
||||
struct subscript il_hi[MAX_NEST_DEPTH];
|
||||
PTR_LLND ll, tl;
|
||||
int arr_dim, uniform;
|
||||
int v[AR_DIM_MAX];
|
||||
int r, i, j, sd, dd, depth;
|
||||
|
||||
/* the a array that is used here is allocated once and used */
|
||||
/* again in future calls */
|
||||
|
||||
if (a_allocd == 0) {
|
||||
a_allocd = 1;
|
||||
a_array = (int **)malloc(MAX_NEST_DEPTH * (sizeof(int *)));
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,a_array, 0);
|
||||
#endif
|
||||
for (i = 0; i < MAX_NEST_DEPTH; i++)
|
||||
{
|
||||
a_array[i] = (int *)malloc((AR_DIM_MAX + MAX_NEST_DEPTH) * (sizeof(int)));
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,a_array[i], 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
for (i = 0; i < MAX_NEST_DEPTH; i++) {
|
||||
sor_ind_l[i] = NULL;
|
||||
des_ind_l[i] = NULL;
|
||||
}
|
||||
|
||||
|
||||
dd = make_induct_list(des->stmt, des_ind_l, il_lo, il_hi);
|
||||
sd = make_induct_list(sor->stmt, sor_ind_l, il_lo, il_hi);
|
||||
|
||||
depth = (sd < dd) ? sd : dd;
|
||||
|
||||
i = 0;
|
||||
while ((i < depth) && (des_ind_l[i] == sor_ind_l[i]))
|
||||
i++;
|
||||
if (i < depth)
|
||||
depth = i;
|
||||
|
||||
arr_dim = 0;
|
||||
/* compute the dimension of the array */
|
||||
ll = sor->refer;
|
||||
if (ll->variant == ARRAY_REF) {
|
||||
tl = ll->entry.array_ref.index;
|
||||
while (tl != NULL) {
|
||||
if ((tl->variant == VAR_LIST) ||
|
||||
(tl->variant == EXPR_LIST) ||
|
||||
(tl->variant == RANGE_LIST)) {
|
||||
tl = tl->entry.list.next;
|
||||
arr_dim++;
|
||||
}
|
||||
}
|
||||
}
|
||||
uniform = 1;
|
||||
for (i = 0; i < arr_dim; i++) {
|
||||
if (source[i].decidable != destin[i].decidable)
|
||||
uniform = 0;
|
||||
v[i] = source[i].offset - destin[i].offset;
|
||||
for (j = 0; j < depth; j++)
|
||||
if (source[i].coefs[j] != destin[i].coefs[j])
|
||||
uniform = 0;
|
||||
}
|
||||
if (uniform == 1) {
|
||||
r = comp_ker(arr_dim, depth, source, a_array, sor_ind_l, v, vec, troub);
|
||||
}
|
||||
/* else if (show_deps) fprintf(stderr, "not uniform\n"); */
|
||||
return (uniform);
|
||||
|
||||
}
|
||||
|
||||
/* comp_ker is a function that takes the matrix "h" associated with */
|
||||
/* a uniformly generated (potential) dependence and a offest vector "dist" */
|
||||
/* and computes the distance vector "vec" and a trouble vector "troub" */
|
||||
/* the matrix is associated with the access function of an array reference */
|
||||
/* where the array is of dimension "adim" and the depth of nesting is */
|
||||
/* depth. The "a" array is a matrix that is allocated by the caller and */
|
||||
/* upon return contains a factorization of "h". The array is "depth" rows */
|
||||
/* by dept+adim columns but is viewed as its transpose mathematically. */
|
||||
/* It should be allocated as MAX_NEST_DEPTH by AR_DIM_MAX+MAX_NEST_DEPTH */
|
||||
/* In other words "a" is first initialized as
|
||||
|
||||
|<- depth ->|
|
||||
-------| |
|
||||
^ | |
|
||||
adim | h |
|
||||
v | |
|
||||
-------|-----------| where rows in C are columns.
|
||||
^ | |
|
||||
depth | I |
|
||||
v | |
|
||||
--------------------
|
||||
|
||||
A factoriation takes place which converts this to the form where the
|
||||
h component is now the matrix L and the Identity block I is now a square
|
||||
matrix B such that
|
||||
L = hB
|
||||
|
||||
and L is lower triangular and B and L are integer valued.
|
||||
|
||||
What this means is that
|
||||
if dist = Lx, for some x then let c be such that c = Bx and we have
|
||||
dist = Lx = hBx = hc. (note x and c are global and returned by side effect.)
|
||||
and c is the distance vector.
|
||||
|
||||
Furturemore, comp_ker returns the dimension of ker(h) and the right hand
|
||||
dim(ker(h)) columns of B form a basis of the kernel.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
int comp_ker(adim, depth, sa, a, sor_ind_l, dist, vec, troub)
|
||||
int adim, depth;
|
||||
struct subscript *sa;
|
||||
int **a;
|
||||
PTR_SYMB sor_ind_l[];
|
||||
int dist[];
|
||||
int vec[], troub[];
|
||||
{
|
||||
int i, j, k, piv_row, piv_col, cols_done, m, mval, cur_x;
|
||||
int nosolution;
|
||||
int p, q, r, s, z;
|
||||
int *tmp;
|
||||
|
||||
sor_ind_l = sor_ind_l; /* make lint happy, sor_ind_l not used */
|
||||
|
||||
/* h components in first adim rows of matrix */
|
||||
for (i = 0; i < adim; i++) {
|
||||
for (j = 0; j < depth; j++)
|
||||
a[j][i] = sa[i].coefs[j];
|
||||
}
|
||||
|
||||
/* depth by depth square identity in second block of matrix */
|
||||
for (i = adim; i < adim + depth; i++) {
|
||||
for (j = 0; j < depth; j++)
|
||||
if ((i - adim) == j)
|
||||
a[j][i] = 1;
|
||||
else
|
||||
a[j][i] = 0;
|
||||
}
|
||||
/* if(show_deps) print_a_arr(adim+depth,depth); */
|
||||
/* The following is a factorization of the array H from the */
|
||||
/* function h (stored as the upper part of a ) into a lower */
|
||||
/* triangluar matrix L and a matrix B such that L = HB */
|
||||
/* now do column operations to reduce top to lower triangular */
|
||||
/* remember that a is transposed to use pointers for columns */
|
||||
/* for each row ... */
|
||||
cols_done = 0;
|
||||
for (i = 0; i < adim; i++) {
|
||||
piv_row = i;
|
||||
piv_col = cols_done;
|
||||
while ((a[piv_col][piv_row] == 0) && (piv_col < depth))
|
||||
piv_col++;
|
||||
if (piv_col < depth) {
|
||||
m = piv_col;
|
||||
mval = a[m][piv_row];
|
||||
mval = mval * mval;
|
||||
k = 0;
|
||||
/* pick min non-zero term on row to right of cols_done */
|
||||
for (j = cols_done; j < depth; j++)
|
||||
if ((a[j][piv_row] != 0) &&
|
||||
((a[j][piv_row] * a[j][piv_row]) < mval)) {
|
||||
m = j;
|
||||
mval = a[j][piv_row] * a[j][piv_row];
|
||||
}
|
||||
/* now move col m to col cols_done */
|
||||
tmp = a[m];
|
||||
a[m] = a[cols_done];
|
||||
a[cols_done] = tmp;
|
||||
/* now eliminate rest of row */
|
||||
for (j = cols_done + 1; j < depth; j++)
|
||||
if (a[j][piv_row] != 0) {
|
||||
find_mults(a[cols_done][piv_row],
|
||||
a[j][piv_row], &p, &q, &r, &s);
|
||||
for (k = 0; k < adim + depth; k++) {
|
||||
z = a[cols_done][k] * p + a[j][k] * q;
|
||||
a[j][k] = a[cols_done][k] * r
|
||||
+ a[j][k] * s;
|
||||
a[cols_done][k] = z;
|
||||
}
|
||||
if (a[cols_done][piv_row] == 0) {
|
||||
tmp = a[j];
|
||||
a[j] = a[cols_done];
|
||||
a[cols_done] = tmp;
|
||||
}
|
||||
}
|
||||
cols_done++;
|
||||
}
|
||||
}
|
||||
/* reduce system by gcd of each column */
|
||||
for (j = 0; j < depth; j++) {
|
||||
z = gcd(depth + adim, a[j]);
|
||||
if (z != 1 && z != 0) {
|
||||
for (k = 0; k < adim + depth; k++)
|
||||
a[j][k] = a[j][k] / z;
|
||||
}
|
||||
}
|
||||
|
||||
/* now back solve for x in dist = Lx */
|
||||
nosolution = 0;
|
||||
cur_x = 0;
|
||||
for (j = 0; (j < adim && cur_x < depth); j++) {
|
||||
z = 0;
|
||||
for (k = 0; k < cur_x; k++)
|
||||
z = z + a[k][j] * x[k];
|
||||
if (a[cur_x][j] == 0) {
|
||||
if (z != dist[j]) {
|
||||
nosolution = 1;
|
||||
}
|
||||
/* this equation is consistent, so skip it */
|
||||
}
|
||||
else {
|
||||
r = (dist[j] - z) / a[cur_x][j];
|
||||
if (r * a[cur_x][j] != dist[j] - z) {
|
||||
nosolution = 1;
|
||||
}
|
||||
x[cur_x] = r;
|
||||
cur_x++;
|
||||
}
|
||||
}
|
||||
for (j = cur_x; j < depth; j++) x[j] = 0;
|
||||
|
||||
|
||||
/* the following is a double check on the solution */
|
||||
|
||||
for (j = 0; j < adim; j++) {
|
||||
z = 0;
|
||||
for (k = 0; k < depth; k++)
|
||||
z = z + a[k][j] * x[k];
|
||||
if (z != dist[j])
|
||||
nosolution = 1;
|
||||
}
|
||||
/* if there is no solution then there is no dependence! */
|
||||
if (nosolution) {
|
||||
troub[0] = 1;
|
||||
return (depth - cols_done);
|
||||
}
|
||||
/* because L = HB where B is the lower block of a */
|
||||
/* and dist = Lx we have dist = HBx, so if c = Bx, dist = Hc */
|
||||
for (j = 0; j < depth; j++) {
|
||||
c[j] = 0;
|
||||
for (k = 0; k < depth; k++)
|
||||
c[j] = c[j] + a[k][j + adim] * x[k];
|
||||
}
|
||||
/* to compute vec and troub, we start by setting */
|
||||
/* vec to c. (if ker(h) =0) we are done then */
|
||||
for (j = 0; j < depth; j++)
|
||||
vec[j + 1] = c[j];
|
||||
/* we now modify by the leading terms of the ker basis */
|
||||
for (j = cols_done; j < depth; j++) {
|
||||
/* find leading non-zero */
|
||||
z = -1;
|
||||
for (k = 0; k < depth; k++)
|
||||
if (z == -1 && a[j][k + adim] != 0)
|
||||
z = k;
|
||||
if (z > -1) {
|
||||
troub[z + 1] = PLUS;
|
||||
}
|
||||
}
|
||||
z = 100;
|
||||
for (j = 1; j < depth + 1; j++) {
|
||||
if (troub[j] == PLUS || vec[j] > 0)
|
||||
z = j;
|
||||
if (troub[j] != PLUS && vec[j] < 0 && z == 100) {
|
||||
troub[0] = 1;
|
||||
/* fprintf(stderr, " reject - wrong direction \n"); */
|
||||
return (depth - cols_done);
|
||||
}
|
||||
if (z < j && troub[j] == PLUS && vec[j] < 0)
|
||||
troub[j] = ZPLUS;
|
||||
}
|
||||
|
||||
/* print_a_arr(adim+depth,depth); */
|
||||
return (depth - cols_done);
|
||||
}
|
||||
|
||||
static int myabs(x)
|
||||
int x;
|
||||
{
|
||||
if (x < 0)
|
||||
return (-x);
|
||||
else
|
||||
return (x);
|
||||
}
|
||||
|
||||
int eval_h(c, depth, i, val)
|
||||
int c[];
|
||||
int depth, i, val;
|
||||
{
|
||||
depth = depth; /* make lint happy, depth unused */
|
||||
|
||||
return (c[i] * val);
|
||||
}
|
||||
|
||||
int find_mults(a, b, p1, q1, r1, s1)
|
||||
int a, b;
|
||||
int *p1;
|
||||
int *q1;
|
||||
int *r1;
|
||||
int *s1;
|
||||
{
|
||||
/* upon return : a*p+b*q or a*r+b*s is 0 */
|
||||
int p, q, r, s, olda, oldb;
|
||||
|
||||
olda = a;
|
||||
oldb = b;
|
||||
p = 1;
|
||||
q = 0;
|
||||
r = 0;
|
||||
s = 1;
|
||||
while (a * b != 0) {
|
||||
if (a == b) {
|
||||
r = r - p;
|
||||
s = s - q;
|
||||
b = 0;
|
||||
}
|
||||
else if (a == -b) {
|
||||
r = r + p;
|
||||
s = s + q;
|
||||
b = 0;
|
||||
}
|
||||
else if (myabs(a) < myabs(b)) {
|
||||
if (a * b > 0) { /* same sign */
|
||||
r = r - p;
|
||||
s = s - q;
|
||||
b = b - a;
|
||||
}
|
||||
else {
|
||||
r = r + p;
|
||||
s = s + q;
|
||||
b = b + a;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (a * b > 0) {
|
||||
p = p - r;
|
||||
q = q - s;
|
||||
a = a - b;
|
||||
}
|
||||
else {
|
||||
p = p + r;
|
||||
q = q + s;
|
||||
a = a + b;
|
||||
}
|
||||
}
|
||||
} /* end while */
|
||||
|
||||
if ((a != (olda * p + oldb * q)) || (b != (olda * r + oldb * s)))
|
||||
fprintf(stderr, " reduce failed!\n");
|
||||
*p1 = p;
|
||||
*q1 = q;
|
||||
*r1 = r;
|
||||
*s1 = s;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void print_a_arr(rows, cols)
|
||||
int rows, cols;
|
||||
{
|
||||
int i, j;
|
||||
for (i = 0; i < rows; i++) {
|
||||
fprintf(stderr, " | ");
|
||||
for (j = 0; j < cols; j++) {
|
||||
fprintf(stderr, " %d ", a_array[j][i]);
|
||||
if (j == cols - 1)
|
||||
fprintf(stderr, " |\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
655
dvm/fdvm/trunk/Sage/lib/oldsrc/list.c
Normal file
655
dvm/fdvm/trunk/Sage/lib/oldsrc/list.c
Normal file
@@ -0,0 +1,655 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "db.h"
|
||||
#include "list.h"
|
||||
|
||||
/* the following declarations are temporary fixes until we */
|
||||
/* decide how to deal with numbering and write nodes. */
|
||||
|
||||
#ifdef __SPF
|
||||
extern void addToCollection(const int line, const char *file, void *pointer, int type);
|
||||
#endif
|
||||
|
||||
struct bfnd cbfnd;
|
||||
struct dep cdep;
|
||||
|
||||
static LIST lis_array;
|
||||
static int list_not_ready = 1;
|
||||
|
||||
/* end of declaration hack */
|
||||
|
||||
extern PTR_FILE cur_file;
|
||||
|
||||
PTR_BFND make_bfnd();
|
||||
PTR_BLOB make_blob();
|
||||
PTR_LLND make_llnd();
|
||||
PTR_LLND copy_llnd();
|
||||
PTR_SYMB make_symb();
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* List manipuliation functions alloc_list(), push_llnd() *
|
||||
* push_symb(), free_list() to be used by make_expr() *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
LIST
|
||||
alloc_list(type)
|
||||
int type;
|
||||
{
|
||||
int i;
|
||||
|
||||
if(list_not_ready){
|
||||
lis_array = (LIST) calloc(NUMLIS, sizeof(struct lis_node));
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,lis_array, 0);
|
||||
#endif
|
||||
for(i = 0; i < NUMLIS; i++)
|
||||
lis_array[i].variant = UNUSED;
|
||||
list_not_ready = 0;
|
||||
}
|
||||
for(i = 0; i < NUMLIS; i++)
|
||||
if(lis_array[i].variant == UNUSED){
|
||||
lis_array[i].variant = type;
|
||||
return(&lis_array[i]);
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
/* push the low level node llnd on the front of list lis */
|
||||
LIST
|
||||
push_llnd(llnd, lis)
|
||||
PTR_LLND llnd;
|
||||
LIST lis;
|
||||
{
|
||||
LIST nl;
|
||||
|
||||
nl = alloc_list(LLNDE);
|
||||
nl->entry.llnd = llnd;
|
||||
nl->next = lis;
|
||||
return(nl);
|
||||
}
|
||||
|
||||
|
||||
/* push the symb node symb on the front of list lis */
|
||||
LIST
|
||||
push_symb(symb, lis)
|
||||
PTR_SYMB symb;
|
||||
LIST lis;
|
||||
{
|
||||
LIST nl;
|
||||
|
||||
nl = alloc_list(SYMNDE);
|
||||
nl->entry.symb = symb;
|
||||
nl->next = lis;
|
||||
return(nl);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
free_list(lis)
|
||||
LIST lis;
|
||||
{
|
||||
LIST nxt;
|
||||
|
||||
while(lis != NULL){
|
||||
lis->variant = UNUSED;
|
||||
nxt = lis->next;
|
||||
lis->next = NULL;
|
||||
lis = nxt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* blob list manipulation routines car, cdr, append. *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
#define car(bl_list) bl_list->ref
|
||||
#define cdr(bl_list) bl_list->next
|
||||
|
||||
PTR_BLOB
|
||||
cons( bif, bl_list)
|
||||
PTR_BFND bif;
|
||||
PTR_BLOB bl_list;
|
||||
{
|
||||
return (make_blob(cur_file, bif, bl_list));
|
||||
}
|
||||
|
||||
|
||||
/* append without copy -- not standard lisp append */
|
||||
PTR_BLOB
|
||||
append(bl_list, bif)
|
||||
PTR_BLOB bl_list;
|
||||
PTR_BFND bif;
|
||||
{
|
||||
PTR_BLOB b;
|
||||
|
||||
if (bl_list == NULL)
|
||||
return(make_blob(cur_file, bif, NULL));
|
||||
|
||||
for (b = bl_list; b->next; b = b->next)
|
||||
;
|
||||
b->next = make_blob(cur_file, bif, NULL);
|
||||
return(bl_list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* get_r_follow_node recursively checks source and all of its decendents until
|
||||
* it finds the ith dependence. It returns the node on the same level as
|
||||
* source.
|
||||
*/
|
||||
PTR_BFND
|
||||
get_r_follow_node(par,source,bfptr,j,i)
|
||||
PTR_BFND bfptr, par, source;
|
||||
int *j;
|
||||
int i;
|
||||
{
|
||||
PTR_DEP p;
|
||||
PTR_BFND targ;
|
||||
PTR_BLOB b;
|
||||
PTR_BFND child, final;
|
||||
|
||||
p = bfptr->entry.Template.dep_ptr1;
|
||||
while(( p != NULL) && ( *j <= i)) {
|
||||
if((p->to.stmt != source) &&
|
||||
((p->type == 0) ||(p->type == 1) ||(p->type == 2))
|
||||
){
|
||||
if( *j == i){
|
||||
targ = p->to.stmt;
|
||||
while(targ != NULL && targ->variant != GLOBAL &&
|
||||
targ->control_parent != par) targ = targ->control_parent;
|
||||
if(targ->variant == GLOBAL) return(NULL);
|
||||
else if (targ == source) p = p->from_fwd;
|
||||
else return( targ);
|
||||
}
|
||||
else {
|
||||
p =p->from_fwd;
|
||||
*j = (*j)+1;
|
||||
}
|
||||
}
|
||||
else p =p->from_fwd;
|
||||
}
|
||||
if(p == NULL && (bfptr->variant == FOR_NODE || bfptr->variant == FORALL_NODE || bfptr->variant == IF_NODE)){
|
||||
b = bfptr->entry.Template.bl_ptr1;
|
||||
while(b != NULL && *j <=i){
|
||||
child = b->ref;
|
||||
final = get_r_follow_node(par,source,child,j,i);
|
||||
if(final != NULL && final != source) return(final);
|
||||
b = b->next;
|
||||
}
|
||||
}
|
||||
if(p == NULL && bfptr->variant == IF_NODE){
|
||||
b = bfptr->entry.Template.bl_ptr2;
|
||||
while(b != NULL && *j <=i){
|
||||
child = b->ref;
|
||||
final = get_r_follow_node(par,source,child,j,i);
|
||||
if(final != NULL && final != source) return(final);
|
||||
b = b->next;
|
||||
}
|
||||
}
|
||||
/* if *j <= i then we are not there yet but out of dependences and childern so return null */
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
/* returns pointer to i-th bf-node following *bfptr in dep order */
|
||||
PTR_BFND
|
||||
get_follow_node(bfptr,i)
|
||||
PTR_BFND bfptr;
|
||||
int i;
|
||||
{
|
||||
PTR_BFND par = bfptr->control_parent,
|
||||
source = bfptr;
|
||||
int j = 0;
|
||||
|
||||
return(get_r_follow_node(par,source,bfptr,&j,i));
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* MAKE functions: make_expr(), *
|
||||
* mk_llnd(), *
|
||||
* make_ddnd(), *
|
||||
* mk_symb(), *
|
||||
* make_asign() *
|
||||
* make_for() & mkloop() *
|
||||
* make_cntlend() *
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
PTR_LLND
|
||||
mk_llnd(PTR_LLND p)
|
||||
/* PTR_LLND p;*/
|
||||
{
|
||||
PTR_LLND nd;
|
||||
|
||||
nd = make_llnd(cur_file, 0, NULL, NULL, NULL);
|
||||
if (p != NULL){
|
||||
nd->variant = p->variant;
|
||||
nd->type = p->type;
|
||||
nd->entry.Template.symbol = p->entry.Template.symbol;
|
||||
nd->entry.Template.ll_ptr1 = p->entry.Template.ll_ptr1;
|
||||
nd->entry.Template.ll_ptr2 = p->entry.Template.ll_ptr2;
|
||||
} else
|
||||
nd->variant = VAR_REF;
|
||||
return(nd);
|
||||
}
|
||||
|
||||
|
||||
PTR_SYMB
|
||||
mk_symb(name,p)
|
||||
char *name;
|
||||
PTR_SYMB p;
|
||||
{
|
||||
PTR_SYMB nd;
|
||||
|
||||
nd = make_symb(cur_file, 0, name);
|
||||
if (p != NULL){
|
||||
nd->variant = p->variant;
|
||||
nd->type = p->type;
|
||||
nd->next_symb = p->next_symb;
|
||||
p->next_symb = nd;
|
||||
nd->parent = p->parent;
|
||||
} else {
|
||||
nd->variant = VARIABLE_NAME;
|
||||
nd->type = NULL;
|
||||
nd->next_symb = NULL;
|
||||
nd->parent = NULL;
|
||||
}
|
||||
nd->entry.var_decl.local = LOCAL;
|
||||
nd->outer = NULL;
|
||||
nd->id_list = NULL;
|
||||
|
||||
return(nd);
|
||||
}
|
||||
|
||||
|
||||
static LIST lispt;
|
||||
|
||||
/* op = one of ADD_OP SUBT_OP MULT_OP DIV_OP (or other binary ops) */
|
||||
PTR_LLND
|
||||
make_oper(op)
|
||||
int op;
|
||||
{
|
||||
PTR_LLND nd;
|
||||
|
||||
nd = mk_llnd(NULL);
|
||||
nd->variant = op;
|
||||
return(nd);
|
||||
}
|
||||
|
||||
|
||||
PTR_LLND
|
||||
make_arref(ar,index)
|
||||
PTR_SYMB ar;
|
||||
PTR_LLND index;
|
||||
{
|
||||
PTR_LLND nd;
|
||||
|
||||
nd = mk_llnd(NULL);
|
||||
nd->variant = ARRAY_REF;
|
||||
nd->entry.array_ref.symbol = ar;
|
||||
nd->entry.array_ref.index = index;
|
||||
nd->entry.array_ref.array_elt = NULL;
|
||||
return(nd);
|
||||
}
|
||||
|
||||
|
||||
PTR_LLND
|
||||
make_int(i)
|
||||
int i;
|
||||
{
|
||||
PTR_LLND nd;
|
||||
|
||||
nd = mk_llnd(NULL);
|
||||
nd->variant = INT_VAL;
|
||||
nd->entry.ival = i;
|
||||
return(nd);
|
||||
}
|
||||
|
||||
|
||||
PTR_LLND
|
||||
hmake_expr()
|
||||
{
|
||||
LIST lis;
|
||||
PTR_LLND nd;
|
||||
|
||||
if (lispt == NULL)
|
||||
return(NULL);
|
||||
|
||||
lis = lispt;
|
||||
lispt = lis->next;
|
||||
if (lis->variant == SYMNDE){
|
||||
nd = mk_llnd(NULL);
|
||||
if(lis->entry.symb->variant == VARIABLE_NAME)
|
||||
nd->variant = VAR_REF;
|
||||
else
|
||||
fprintf(stderr, "wrong symbol type in make_expr");
|
||||
nd->entry.Template.symbol = lis->entry.symb;
|
||||
return(nd);
|
||||
} else if(lis->variant == LLNDE){
|
||||
nd = lis->entry.llnd;
|
||||
switch (nd->variant) {
|
||||
case DDOT :
|
||||
case EQ_OP :
|
||||
case LT_OP :
|
||||
case GT_OP :
|
||||
case NOTEQL_OP :
|
||||
case LTEQL_OP :
|
||||
case GTEQL_OP :
|
||||
case ADD_OP :
|
||||
case SUBT_OP :
|
||||
case OR_OP :
|
||||
case MULT_OP :
|
||||
case DIV_OP :
|
||||
case MOD_OP :
|
||||
case AND_OP :
|
||||
case EXP_OP :
|
||||
if (nd->entry.binary_op.l_operand == NULL){
|
||||
nd->entry.binary_op.l_operand =
|
||||
hmake_expr();
|
||||
nd->entry.binary_op.r_operand =
|
||||
hmake_expr();
|
||||
}
|
||||
break;
|
||||
case MINUS_OP :
|
||||
case NOT_OP :
|
||||
if (nd->entry.unary_op.operand == NULL){
|
||||
nd->entry.unary_op.operand =
|
||||
hmake_expr();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return(nd);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* this routine creates a low level expression tree from the preorder
|
||||
* list of llnds and symbol pointers then deletes the list
|
||||
*/
|
||||
PTR_LLND
|
||||
make_expr(lis)
|
||||
LIST lis;
|
||||
{
|
||||
LIST L;
|
||||
PTR_LLND n;
|
||||
|
||||
L = lis;
|
||||
lispt = lis;
|
||||
n = hmake_expr();
|
||||
free_list(L);
|
||||
return(n);
|
||||
}
|
||||
|
||||
|
||||
PTR_BFND
|
||||
make_asign(lhs,rhs)
|
||||
PTR_LLND lhs,rhs;
|
||||
{
|
||||
return(make_bfnd(cur_file, ASSIGN_STAT, NULL, lhs, rhs, NULL));
|
||||
}
|
||||
|
||||
|
||||
PTR_BFND
|
||||
make_for(index,range)
|
||||
PTR_SYMB index;
|
||||
PTR_LLND range;
|
||||
{
|
||||
return(make_bfnd(cur_file, FOR_NODE, index, range, NULL, NULL));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* make a for_node like *p
|
||||
* this is a special version used by distribute
|
||||
*/
|
||||
PTR_BFND
|
||||
mkloop(p)
|
||||
PTR_BFND p;
|
||||
{
|
||||
PTR_BFND newp;
|
||||
|
||||
/* we should be making new copies of the following structures! */
|
||||
newp = make_bfnd(cur_file,
|
||||
FOR_NODE,
|
||||
p->entry.Template.symbol,
|
||||
p->entry.Template.ll_ptr1,
|
||||
p->entry.Template.ll_ptr2,
|
||||
p->entry.Template.ll_ptr3);
|
||||
|
||||
newp->entry.Template.bf_ptr1 = p->entry.Template.bf_ptr1;
|
||||
newp->entry.Template.cmnt_ptr = p->entry.Template.cmnt_ptr;
|
||||
|
||||
newp->filename = p->filename;
|
||||
return(newp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
PTR_BFND
|
||||
make_cntlend(par)
|
||||
PTR_BFND par;
|
||||
{
|
||||
PTR_BFND b;
|
||||
|
||||
b = make_bfnd(cur_file, CONTROL_END, NULL, NULL, NULL, NULL);
|
||||
b->control_parent = par;
|
||||
return(b);
|
||||
}
|
||||
|
||||
|
||||
static int modified = 0;
|
||||
|
||||
/* create a NEW low level node tree with cvar replaced by newref */
|
||||
PTR_LLND
|
||||
replace_ref(lnd,cvar,newref)
|
||||
PTR_LLND lnd;
|
||||
PTR_SYMB cvar;
|
||||
PTR_LLND newref;
|
||||
{
|
||||
PTR_LLND pllnd, rtnval;
|
||||
|
||||
if (lnd == NULL) return(NULL);
|
||||
|
||||
pllnd = mk_llnd(lnd);
|
||||
rtnval = pllnd;
|
||||
|
||||
switch (pllnd->variant) {
|
||||
case CONST_REF:
|
||||
case VAR_REF :
|
||||
case ENUM_REF :
|
||||
if( pllnd->entry.Template.symbol==cvar){
|
||||
/* replace with subtree consisting of newref */
|
||||
modified = 1;
|
||||
rtnval = copy_llnd(newref);
|
||||
}
|
||||
break;
|
||||
case ARRAY_REF:
|
||||
pllnd->entry.array_ref.index =
|
||||
replace_ref(pllnd->entry.array_ref.index,cvar,newref);
|
||||
if (pllnd->entry.array_ref.array_elt != NULL) {
|
||||
pllnd->entry.array_ref.array_elt =
|
||||
replace_ref(pllnd->entry.array_ref.array_elt,cvar,newref);
|
||||
}
|
||||
break;
|
||||
case RECORD_REF:
|
||||
if (pllnd->entry.record_ref.rec_field != NULL) {
|
||||
pllnd->entry.record_ref.rec_field =
|
||||
replace_ref(pllnd->entry.record_ref.rec_field,cvar,newref);
|
||||
}
|
||||
break;
|
||||
case PROC_CALL :
|
||||
case FUNC_CALL :
|
||||
pllnd->entry.proc.param_list =
|
||||
replace_ref(pllnd->entry.proc.param_list,cvar,newref);
|
||||
break;
|
||||
case VAR_LIST :
|
||||
case EXPR_LIST :
|
||||
case RANGE_LIST :
|
||||
pllnd->entry.list.item =
|
||||
replace_ref(pllnd->entry.list.item,cvar,newref);
|
||||
if (pllnd->entry.list.next != NULL) {
|
||||
pllnd->entry.list.next =
|
||||
replace_ref(pllnd->entry.list.next,cvar,newref);
|
||||
}
|
||||
break;
|
||||
|
||||
case CASE_CHOICE:
|
||||
case DDOT :
|
||||
pllnd->entry.binary_op.l_operand =
|
||||
replace_ref(pllnd->entry.binary_op.l_operand,cvar,newref);
|
||||
pllnd->entry.binary_op.r_operand =
|
||||
replace_ref(pllnd->entry.binary_op.r_operand,cvar,newref);
|
||||
break;
|
||||
/* binary ops */
|
||||
case EQ_OP :
|
||||
case LT_OP :
|
||||
case GT_OP :
|
||||
case NOTEQL_OP :
|
||||
case LTEQL_OP :
|
||||
case GTEQL_OP :
|
||||
case ADD_OP :
|
||||
case SUBT_OP :
|
||||
case OR_OP :
|
||||
case MULT_OP :
|
||||
case DIV_OP :
|
||||
case MOD_OP :
|
||||
case AND_OP :
|
||||
case EXP_OP :
|
||||
pllnd->entry.binary_op.l_operand =
|
||||
replace_ref(pllnd->entry.binary_op.l_operand,cvar,newref);
|
||||
pllnd->entry.binary_op.r_operand =
|
||||
replace_ref(pllnd->entry.binary_op.r_operand,cvar,newref);
|
||||
break;
|
||||
case MINUS_OP:
|
||||
case NOT_OP :
|
||||
pllnd->entry.unary_op.operand =
|
||||
replace_ref(pllnd->entry.unary_op.operand,cvar,newref);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return(rtnval);
|
||||
}
|
||||
|
||||
|
||||
/* routine to make double dot node low..hi from an expression */
|
||||
PTR_LLND
|
||||
make_ddnd(pllnd,cvar,low,hi)
|
||||
PTR_LLND pllnd,low,hi;
|
||||
PTR_SYMB cvar;
|
||||
{
|
||||
PTR_LLND tmp, dotnd;
|
||||
|
||||
tmp = replace_ref(pllnd,cvar,low);
|
||||
if(modified){
|
||||
dotnd = mk_llnd(NULL);
|
||||
dotnd->variant = DDOT;
|
||||
dotnd->entry.Template.symbol = NULL;
|
||||
dotnd->entry.Template.ll_ptr1 = tmp;
|
||||
dotnd->entry.Template.ll_ptr2 =
|
||||
replace_ref(pllnd,cvar,hi);
|
||||
return(dotnd);
|
||||
}
|
||||
else return(pllnd);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* create a new ddot node for every array-ref in expression containing
|
||||
* a reference to cvar
|
||||
*/
|
||||
void
|
||||
expand_ref(pllnd,cvar,low,hi)
|
||||
PTR_LLND pllnd;
|
||||
PTR_SYMB cvar;
|
||||
PTR_LLND low,hi;
|
||||
{
|
||||
if (pllnd == NULL) return;
|
||||
|
||||
switch (pllnd->variant) {
|
||||
case ARRAY_REF:
|
||||
/* [ */
|
||||
modified = 0; /* set changed flag */
|
||||
if((pllnd->entry.array_ref.index->variant != EXPR_LIST) &&
|
||||
(pllnd->entry.array_ref.index->variant != RANGE_LIST))
|
||||
pllnd->entry.array_ref.index =
|
||||
make_ddnd(pllnd->entry.array_ref.index,cvar,low,hi);
|
||||
else expand_ref(pllnd->entry.array_ref.index,cvar,low,hi);
|
||||
|
||||
/* otherwise this is a scalar reference and should */
|
||||
/* not be changed here. In any case reset flag */
|
||||
modified = 0;
|
||||
/* ] */
|
||||
break;
|
||||
case RECORD_REF:
|
||||
if (pllnd->entry.record_ref.rec_field != NULL)
|
||||
expand_ref(pllnd->entry.record_ref.rec_field,cvar,low,hi);
|
||||
break;
|
||||
case PROC_CALL:
|
||||
case FUNC_CALL:
|
||||
expand_ref(pllnd->entry.proc.param_list,cvar,low,hi);
|
||||
break;
|
||||
case VAR_LIST :
|
||||
case EXPR_LIST:
|
||||
case RANGE_LIST:
|
||||
/* the other place where something can happen is here *
|
||||
* if we have a[i,j] and we are vectorizing j then this *
|
||||
* should be a[i,low..hi], unless it is i we are after */
|
||||
modified = 0;
|
||||
pllnd->entry.list.item =
|
||||
make_ddnd(pllnd->entry.list.item,cvar,low,hi);
|
||||
modified = 0;
|
||||
if (pllnd->entry.list.next != NULL) {
|
||||
/* pllnd->entry.list.next = */
|
||||
expand_ref(pllnd->entry.list.next,cvar,low,hi);
|
||||
modified = 0;
|
||||
}
|
||||
break;
|
||||
case EQ_OP :
|
||||
case LT_OP :
|
||||
case GT_OP :
|
||||
case NOTEQL_OP:
|
||||
case LTEQL_OP:
|
||||
case GTEQL_OP:
|
||||
case ADD_OP :
|
||||
case SUBT_OP:
|
||||
case OR_OP :
|
||||
case MULT_OP:
|
||||
case DIV_OP :
|
||||
case MOD_OP :
|
||||
case AND_OP :
|
||||
case EXP_OP :
|
||||
expand_ref(pllnd->entry.binary_op.l_operand,cvar,low,hi);
|
||||
expand_ref(pllnd->entry.binary_op.r_operand,cvar,low,hi);
|
||||
break;
|
||||
case MINUS_OP:
|
||||
expand_ref(pllnd->entry.unary_op.operand,cvar,low,hi);
|
||||
break;
|
||||
case NOT_OP :
|
||||
expand_ref(pllnd->entry.unary_op.operand,cvar,low,hi);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
641
dvm/fdvm/trunk/Sage/lib/oldsrc/make_nodes.c
Normal file
641
dvm/fdvm/trunk/Sage/lib/oldsrc/make_nodes.c
Normal file
@@ -0,0 +1,641 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "db.h"
|
||||
#include "compatible.h"
|
||||
#ifdef SYS5
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#ifdef __SPF
|
||||
extern void addToCollection(const int line, const char *file, void *pointer, int type);
|
||||
#endif
|
||||
|
||||
#define ALLOC(x) (struct x *) chkalloc(sizeof(struct x))
|
||||
#define LABUNKNOWN 0
|
||||
|
||||
/*
|
||||
* External references
|
||||
*/
|
||||
extern PTR_FILE cur_file;
|
||||
|
||||
/*
|
||||
* copyn -- makes a copy of a string with known length
|
||||
*
|
||||
* input:
|
||||
* n - length of the string "s"
|
||||
* s - the string to be copied
|
||||
*
|
||||
* output:
|
||||
* pointer to the new string
|
||||
*/
|
||||
char *
|
||||
copyn(int n, char *s)
|
||||
/* int n; */
|
||||
/* char *s; */
|
||||
{
|
||||
char *p, *q;
|
||||
|
||||
p = q = (char *) calloc(1, (unsigned) n);
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,p, 0);
|
||||
#endif
|
||||
while (--n >= 0)
|
||||
*q++ = *s++;
|
||||
return (p);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* copys -- makes a copy of a string
|
||||
*
|
||||
* input:
|
||||
* s - string to be copied
|
||||
*
|
||||
* output:
|
||||
* pointer to the new string
|
||||
*/
|
||||
char *
|
||||
copys(s)
|
||||
char *s;
|
||||
{
|
||||
return (copyn(strlen(s) + 1, s));
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
chkalloc(int n)
|
||||
/* int n; */
|
||||
{
|
||||
char *p;
|
||||
|
||||
if ((p = (char *)calloc(1, (unsigned)n)) != 0)
|
||||
{
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,p, 0);
|
||||
#endif
|
||||
return (p);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
PTR_BFND
|
||||
alloc_bfndnt (fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
register PTR_BFND new;
|
||||
|
||||
new = ALLOC (bfnd);
|
||||
new->id = ++(fi->num_bfnds);
|
||||
new->thread = BFNULL;
|
||||
return (new);
|
||||
}
|
||||
|
||||
PTR_BFND
|
||||
alloc_bfnd (fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
register PTR_BFND new;
|
||||
|
||||
new = ALLOC (bfnd);
|
||||
new->id = ++(fi->num_bfnds);
|
||||
new->thread = BFNULL;
|
||||
if (fi->num_bfnds == 1)
|
||||
fi->head_bfnd = new;
|
||||
else
|
||||
fi->cur_bfnd->thread = new;
|
||||
fi->cur_bfnd = new;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
PTR_LLND
|
||||
alloc_llnd (fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
register PTR_LLND new;
|
||||
|
||||
new = ALLOC (llnd);
|
||||
new->id = ++(fi->num_llnds);
|
||||
new->thread = LLNULL;
|
||||
if (fi->num_llnds == 1)
|
||||
fi->head_llnd = new;
|
||||
else
|
||||
fi->cur_llnd->thread = new;
|
||||
fi->cur_llnd = new;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
PTR_TYPE
|
||||
alloc_type (fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
PTR_TYPE new;
|
||||
|
||||
new = (PTR_TYPE) calloc (1, sizeof (struct data_type));
|
||||
#ifdef __SPF
|
||||
addToCollection(__LINE__, __FILE__,new, 0);
|
||||
#endif
|
||||
new->id = ++(fi->num_types);
|
||||
new->thread = TYNULL;
|
||||
if (fi->num_types == 1)
|
||||
fi->head_type = new;
|
||||
else
|
||||
fi->cur_type->thread = new;
|
||||
fi->cur_type = new;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
PTR_SYMB
|
||||
alloc_symb (fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
PTR_SYMB new;
|
||||
|
||||
if (fi->cur_symb && (fi->cur_symb->variant == 0))
|
||||
return (fi->cur_symb);
|
||||
new = ALLOC (symb);
|
||||
new->id = ++(fi->num_symbs);
|
||||
new->thread = SMNULL;
|
||||
if (fi->num_symbs == 1)
|
||||
fi->head_symb = new;
|
||||
else
|
||||
fi->cur_symb->thread = new;
|
||||
fi->cur_symb = new;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
PTR_LABEL
|
||||
alloc_lab (fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
PTR_LABEL new;
|
||||
|
||||
new = ALLOC (Label);
|
||||
new->id = ++(fi->num_label);
|
||||
new->next = LBNULL;
|
||||
if (fi->num_label == 1)
|
||||
fi->head_lab = new;
|
||||
else
|
||||
fi->cur_lab->next = new;
|
||||
fi->cur_lab = new;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
PTR_DEP
|
||||
alloc_dep (fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
PTR_DEP new;
|
||||
|
||||
new = ALLOC (dep);
|
||||
new->id = ++(fi->num_dep);
|
||||
new->thread = NULL;
|
||||
if (fi->num_dep == 1)
|
||||
fi->head_dep = new;
|
||||
else
|
||||
fi->cur_dep->thread = new;
|
||||
fi->cur_dep = new;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Make a BIF node
|
||||
*/
|
||||
PTR_BFND
|
||||
make_bfnd (PTR_FILE fi, int node_type, PTR_SYMB symb_ptr, PTR_LLND ll1, PTR_LLND ll2, PTR_LLND ll3)
|
||||
/* PTR_FILE fi; */
|
||||
/* int node_type; */
|
||||
/* PTR_SYMB symb_ptr; */
|
||||
/* PTR_LLND ll1, ll2, ll3; */
|
||||
{
|
||||
register PTR_BFND new_bfnd;
|
||||
|
||||
new_bfnd = alloc_bfnd (fi); /* should set up id field */
|
||||
new_bfnd->variant = node_type;
|
||||
new_bfnd->filename = NULL;
|
||||
new_bfnd->entry.Template.symbol = symb_ptr;
|
||||
new_bfnd->entry.Template.ll_ptr1 = ll1;
|
||||
new_bfnd->entry.Template.ll_ptr2 = ll2;
|
||||
new_bfnd->entry.Template.ll_ptr3 = ll3;
|
||||
new_bfnd->entry.Template.cmnt_ptr = NULL;
|
||||
fi->cur_bfnd = new_bfnd;
|
||||
return (new_bfnd);
|
||||
}
|
||||
|
||||
PTR_BFND
|
||||
make_bfndnt (fi, node_type, symb_ptr, ll1, ll2, ll3)
|
||||
PTR_FILE fi;
|
||||
int node_type;
|
||||
PTR_SYMB symb_ptr;
|
||||
PTR_LLND ll1, ll2, ll3;
|
||||
{
|
||||
register PTR_BFND new_bfnd;
|
||||
|
||||
new_bfnd = alloc_bfndnt (fi); /* should set up id field */
|
||||
new_bfnd->variant = node_type;
|
||||
new_bfnd->filename = NULL;
|
||||
new_bfnd->entry.Template.symbol = symb_ptr;
|
||||
new_bfnd->entry.Template.ll_ptr1 = ll1;
|
||||
new_bfnd->entry.Template.ll_ptr2 = ll2;
|
||||
new_bfnd->entry.Template.ll_ptr3 = ll3;
|
||||
new_bfnd->entry.Template.cmnt_ptr = NULL;
|
||||
fi->cur_bfnd = new_bfnd;
|
||||
return (new_bfnd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a new low level node
|
||||
*/
|
||||
PTR_LLND
|
||||
make_llnd (PTR_FILE fi, int node_type, PTR_LLND ll1, PTR_LLND ll2, PTR_SYMB symb_ptr)
|
||||
/* PTR_FILE fi; */
|
||||
/* int node_type; */
|
||||
/* PTR_LLND ll1, ll2; */
|
||||
/* PTR_SYMB symb_ptr; */
|
||||
{
|
||||
PTR_LLND new_llnd;
|
||||
|
||||
new_llnd = alloc_llnd (fi); /* should set up id field */
|
||||
|
||||
new_llnd->variant = node_type;
|
||||
new_llnd->type = TYNULL;
|
||||
new_llnd->entry.Template.ll_ptr1 = ll1;
|
||||
new_llnd->entry.Template.ll_ptr2 = ll2;
|
||||
switch (node_type) {
|
||||
case INT_VAL:
|
||||
/* new_llnd->entry.ival = (int) symb_ptr; */
|
||||
break;
|
||||
case BOOL_VAL:
|
||||
/* new_llnd->entry.bval = (int) symb_ptr; */
|
||||
break;
|
||||
default:
|
||||
new_llnd->entry.Template.symbol = symb_ptr;
|
||||
break;
|
||||
}
|
||||
return (new_llnd);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Make a new low level node for label
|
||||
*/
|
||||
PTR_LLND
|
||||
make_llnd_label (fi, node_type, lab)
|
||||
PTR_FILE fi;
|
||||
int node_type;
|
||||
PTR_LABEL lab;
|
||||
{
|
||||
PTR_LLND new_llnd;
|
||||
|
||||
new_llnd = alloc_llnd (fi); /* should set up id field */
|
||||
|
||||
new_llnd->variant = node_type;
|
||||
new_llnd->type = TYNULL;
|
||||
new_llnd->entry.label_list.lab_ptr = lab;
|
||||
new_llnd->entry.label_list.null_1 = LLNULL;
|
||||
new_llnd->entry.label_list.next = LLNULL;
|
||||
return (new_llnd);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Make a new symb node
|
||||
*/
|
||||
PTR_SYMB
|
||||
make_symb (fi, node_type, string)
|
||||
PTR_FILE fi;
|
||||
int node_type;
|
||||
char *string;
|
||||
{
|
||||
PTR_SYMB new_symb;
|
||||
|
||||
new_symb = alloc_symb (fi);
|
||||
new_symb->variant = node_type;
|
||||
new_symb->ident = copys (string);
|
||||
return (new_symb);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Make a new type node
|
||||
*/
|
||||
PTR_TYPE
|
||||
make_type (fi, node_type)
|
||||
PTR_FILE fi;
|
||||
int node_type;
|
||||
{
|
||||
PTR_TYPE new_type;
|
||||
|
||||
new_type = alloc_type (fi);
|
||||
new_type->entry.Template.ranges = NULL;
|
||||
new_type->variant = node_type;
|
||||
return (new_type);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Make a new label node for Fortran. VPC has its own get_labe
|
||||
*/
|
||||
PTR_LABEL
|
||||
make_label (fi, l)
|
||||
PTR_FILE fi;
|
||||
long l;
|
||||
{
|
||||
PTR_LABEL new_lab;
|
||||
PTR_BFND this_scope;
|
||||
int num;/*podd*/
|
||||
num = fi->cur_bfnd ? fi->cur_bfnd->g_line : 0; /*podd*/
|
||||
if (l <= 0 || l > 99999) {
|
||||
/* fprintf (stderr, "Error 038 on line %d of %s: Label out of range\n", num, fi->filename); */
|
||||
l = 0;
|
||||
}
|
||||
this_scope = NULL;
|
||||
for (new_lab = fi->head_lab; new_lab; new_lab = new_lab->next)
|
||||
if (new_lab->stateno == l && new_lab->scope == this_scope)
|
||||
return (new_lab);
|
||||
|
||||
new_lab = alloc_lab (fi);
|
||||
|
||||
new_lab->stateno = l;
|
||||
new_lab->scope = this_scope;
|
||||
new_lab->labused = NO;
|
||||
new_lab->labdefined = NO;
|
||||
new_lab->labinacc = NO;
|
||||
new_lab->labtype = LABUNKNOWN;
|
||||
new_lab->statbody = BFNULL;
|
||||
return (new_lab);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Make a DEP node
|
||||
*/
|
||||
PTR_DEP
|
||||
make_dep(fi, sym,t,lls,lld,bns,bnd,dv)
|
||||
PTR_FILE fi;
|
||||
PTR_SYMB sym; /* symbol for variable name */
|
||||
char t; /* type: 0=flow 1=anti 2 = output */
|
||||
PTR_LLND lls, lld; /* term source and destination */
|
||||
PTR_BFND bns, bnd; /* biff nd source and destination */
|
||||
char *dv; /* dep. vector: 1="=" 2="<" 4=">" ? */
|
||||
{
|
||||
int i;
|
||||
PTR_DEP d;
|
||||
|
||||
if ((d = alloc_dep(fi)) == NULL)
|
||||
return NULL;
|
||||
d->type = t;
|
||||
d->symbol = sym;
|
||||
d->from.stmt = bns; d->from.refer = lls;
|
||||
d->to.stmt = bnd; d->to.refer = lld;
|
||||
for(i=0; i < MAX_DEP; i++) d->direct[i] = 0;
|
||||
for(i=0; i < MAX_NEST_DEPTH; i++) d->direct[i] = dv[i];
|
||||
|
||||
return(d);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* alloc_blob *
|
||||
*------------------------------------------------------*/
|
||||
PTR_BLOB
|
||||
alloc_blob1(fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
PTR_BLOB new;
|
||||
|
||||
new = ALLOC(blob);
|
||||
++(fi->num_blobs);
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
PTR_CMNT
|
||||
alloc_cmnt (fi)
|
||||
PTR_FILE fi;
|
||||
{
|
||||
PTR_CMNT new;
|
||||
|
||||
new = ALLOC (cmnt);
|
||||
new->id = ++(fi->num_cmnt);
|
||||
new->thread = CMNULL;
|
||||
if (fi->num_cmnt == 1)
|
||||
fi->head_cmnt = new;
|
||||
else
|
||||
fi->cur_cmnt->thread = new;
|
||||
fi->cur_cmnt = new;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------*
|
||||
* make_blob *
|
||||
*------------------------------------------------------*/
|
||||
PTR_BLOB
|
||||
make_blob (fi, ref, next)
|
||||
PTR_FILE fi;
|
||||
PTR_BFND ref;
|
||||
PTR_BLOB next;
|
||||
{
|
||||
PTR_BLOB new;
|
||||
|
||||
new = alloc_blob1(fi);
|
||||
new->ref = ref;
|
||||
new->next = next;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
PTR_CMNT
|
||||
make_comment (fi, s, t)
|
||||
PTR_FILE fi;
|
||||
char *s;
|
||||
int t;
|
||||
{
|
||||
PTR_CMNT new;
|
||||
|
||||
new = alloc_cmnt(fi);
|
||||
new->string = copys (s);
|
||||
new->type = t;
|
||||
return (new);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MakeBfnd (node_type, symb_ptr, ll1, ll2, ll3)
|
||||
int node_type;
|
||||
PTR_SYMB symb_ptr;
|
||||
PTR_LLND ll1, ll2, ll3;
|
||||
{
|
||||
PTR_BFND b;
|
||||
|
||||
b = make_bfnd (cur_file, node_type, symb_ptr, ll1, ll2, ll3);
|
||||
fprintf(stderr, "%d\n", b->id);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MakeLlnd (node_type, ll1, ll2, symb_ptr)
|
||||
int node_type;
|
||||
PTR_LLND ll1, ll2;
|
||||
PTR_SYMB symb_ptr;
|
||||
{
|
||||
PTR_LLND l;
|
||||
|
||||
l = make_llnd (cur_file, node_type, ll1, ll2, symb_ptr);
|
||||
fprintf(stderr, "%d\n", l->id);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Makellnd_label (node_type, lab)
|
||||
int node_type;
|
||||
PTR_LABEL lab;
|
||||
{
|
||||
make_llnd_label (cur_file, node_type, lab);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MakeSymb (node_type, string)
|
||||
int node_type;
|
||||
char *string;
|
||||
{
|
||||
PTR_SYMB s;
|
||||
|
||||
s = make_symb (cur_file, node_type, string);
|
||||
fprintf(stderr, "%d\n", s->id);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Maketype (node_type)
|
||||
int node_type;
|
||||
{
|
||||
PTR_TYPE t;
|
||||
t = make_type (cur_file, node_type);
|
||||
fprintf(stderr, "%d\n", t->id);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MakeLabel (l)
|
||||
long l;
|
||||
{
|
||||
PTR_LABEL l1;
|
||||
|
||||
l1 = make_label (cur_file, l);
|
||||
fprintf(stderr, "%d\n",l1->id);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MakeBlob (ref, next)
|
||||
PTR_BFND ref;
|
||||
PTR_BLOB next;
|
||||
{
|
||||
make_blob (cur_file, ref, next);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MakeComment (s, t)
|
||||
char *s;
|
||||
int t;
|
||||
{
|
||||
PTR_CMNT c;
|
||||
|
||||
c = make_comment (cur_file, s, t);
|
||||
fprintf(stderr, "%d\n",c->id);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* declare variable can be used to create a new variable in the
|
||||
* symbol table that is "like" another variable. For example
|
||||
* if x is in a statement b and you wish to make a new variable
|
||||
* with id x_new that is an array of the same type as x (which
|
||||
* is a scalar), this function creates the new varaible and
|
||||
* creates a declartion for it at the appropriate scope level
|
||||
*/
|
||||
PTR_SYMB
|
||||
declare_variable (id, like, dimension, scope)
|
||||
char *id; /* identifier for new variable */
|
||||
PTR_SYMB like; /* the Template variable */
|
||||
int dimension; /* if > 1 then this is an array */
|
||||
/* version of Template variable */
|
||||
PTR_BFND scope; /* pointer to a statment that is */
|
||||
/* in the block where this is to */
|
||||
/* be declared */
|
||||
{
|
||||
PTR_LLND expr_list, reference;
|
||||
PTR_BFND decl_stmt;
|
||||
PTR_LLND dimen_expr;
|
||||
PTR_SYMB new_var;
|
||||
|
||||
if (like == NULL) {
|
||||
fprintf (stderr, "no Template in declare_varaible\n");
|
||||
return (NULL);
|
||||
}
|
||||
if (id == NULL) {
|
||||
fprintf (stderr, "no id in declare_variable\n");
|
||||
return (NULL);
|
||||
}
|
||||
if (scope == NULL) {
|
||||
fprintf (stderr, "no scope in declare_varaible\n");
|
||||
return (NULL);
|
||||
}
|
||||
new_var = make_symb (cur_file, VARIABLE_NAME, id);
|
||||
if (dimension <= 1) {
|
||||
if (like->type == NULL) {
|
||||
fprintf (stderr, "problems with type of like in declare_variable\n");
|
||||
return (NULL);
|
||||
}
|
||||
new_var->type = like->type;
|
||||
if (like->type->variant == T_ARRAY) {
|
||||
dimen_expr = make_llnd (cur_file, INT_VAL, NULL, NULL, NULL);
|
||||
dimen_expr = like->type->entry.ar_decl.ranges ->
|
||||
entry.Template.ll_ptr1;
|
||||
reference = make_llnd (cur_file, ARRAY_REF, dimen_expr,
|
||||
NULL, new_var);
|
||||
} else
|
||||
reference = make_llnd (cur_file, VAR_REF, NULL, NULL, new_var);
|
||||
} else {
|
||||
dimen_expr = make_llnd (cur_file, INT_VAL, NULL, NULL, NULL);
|
||||
dimen_expr->entry.ival = dimension;
|
||||
reference = make_llnd (cur_file, ARRAY_REF, dimen_expr, NULL, new_var);
|
||||
new_var->type = make_type (cur_file, T_ARRAY);
|
||||
new_var->type->entry.ar_decl.base_type = like->type;
|
||||
new_var->type->entry.ar_decl.num_dimensions = 1;
|
||||
new_var->type->entry.ar_decl.ranges = dimen_expr;
|
||||
}
|
||||
expr_list = make_llnd (cur_file, EXPR_LIST, reference, NULL, NULL);
|
||||
decl_stmt = make_bfnd (cur_file, VAR_DECL, NULL, expr_list, NULL, NULL);
|
||||
scope = scope->control_parent;
|
||||
while (scope != NULL &&
|
||||
scope->variant != GLOBAL && scope->variant != PROC_HEDR &&
|
||||
scope->variant != PROG_HEDR && scope->variant != FUNC_HEDR &&
|
||||
scope->variant != FOR_NODE && scope->variant != CDOALL_NODE &&
|
||||
scope->variant != PARFOR_NODE && scope->variant != PAR_NODE)
|
||||
scope = scope->control_parent;
|
||||
if (scope == NULL || scope->variant == GLOBAL) {
|
||||
fprintf(stderr, "bad scope in declare_variable \n");
|
||||
return (NULL);
|
||||
}
|
||||
scope->entry.Template.bl_ptr1 = make_blob (cur_file, decl_stmt,
|
||||
scope->entry.Template.bl_ptr1);
|
||||
return (new_var);
|
||||
}
|
||||
83
dvm/fdvm/trunk/Sage/lib/oldsrc/makefile.uni
Normal file
83
dvm/fdvm/trunk/Sage/lib/oldsrc/makefile.uni
Normal file
@@ -0,0 +1,83 @@
|
||||
#######################################################################
|
||||
## Copyright (C) 1999 ##
|
||||
## Keldysh Institute of Appllied Mathematics ##
|
||||
#######################################################################
|
||||
|
||||
# sage/lib/oldsrc/makefile.sgi
|
||||
|
||||
LIBDIR = ../../../lib
|
||||
|
||||
OLDHEADERS = ../../h
|
||||
H = ../../h
|
||||
# Directory in which include file can be found
|
||||
TOOLBOX_INCLUDE = ../include
|
||||
|
||||
INCL = -I$(OLDHEADERS) -I../include
|
||||
|
||||
CFLAGS = $(INCL) -c -DSYS5 -Wall
|
||||
|
||||
EXTHDRS = $H/bif.h $H/db.h $H/db.h $H/defs.h $H/dep.h \
|
||||
$H/dep_str.h $H/list.h $H/ll.h $H/sets.h $H/symb.h \
|
||||
$H/tag $H/vparse.h
|
||||
|
||||
OBJS = anal_ind.o db.o db_unp.o \
|
||||
db_unp_vpc.o dbutils.o garb_coll.o \
|
||||
glob_anal.o ker_fun.o list.o \
|
||||
make_nodes.o mod_ref.o ndeps.o \
|
||||
readnodes.o sets.o setutils.o \
|
||||
symb_alg.o writenodes.o
|
||||
|
||||
SRCS = anal_ind.c db.c db_unp.c db_unp_vpc.c dbutils.c \
|
||||
garb_coll.c glob_anal.c ker_fun.c list.c \
|
||||
make_nodes.c mod_ref.c ndeps.c readnodes.c sets.c setutils.c \
|
||||
symb_alg.c writenodes.c
|
||||
|
||||
$(LIBDIR)/libdb.a: $(OBJS)
|
||||
ar qc $(LIBDIR)/libdb.a $(OBJS)
|
||||
|
||||
all: $(LIBDIR)/libdb.a
|
||||
@echo "*** COMPILING LIBRARY oldsrc DONE"
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS)
|
||||
|
||||
cleanall:
|
||||
rm -f $(OBJS)
|
||||
|
||||
###
|
||||
anal_ind.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
db.o: $(H)/db.h $(H)/defs.h \
|
||||
$(H)/tag $(H)/bif.h $(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
db_unp.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
db_unp_vpc.o: $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h $(H)/db.h $(H)/vparse.h
|
||||
dbutils.o: $(H)/db.h \
|
||||
$(H)/defs.h $(H)/tag $(H)/bif.h $(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
garb-coll.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
glob_anal.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
ker_fun.o: $(H)/defs.h $(H)/tag $(H)/bif.h $(H)/ll.h \
|
||||
$(H)/symb.h $(H)/sets.h
|
||||
list.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h $(H)/list.h
|
||||
make_nodes.o: $(H)/db.h $(H)/defs.h $(H)/tag \
|
||||
$(H)/bif.h $(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
mod_ref.o: $(H)/defs.h $(H)/tag $(H)/bif.h $(H)/ll.h \
|
||||
$(H)/symb.h $(H)/sets.h $(H)/vparse.h $(H)/db.h
|
||||
ndeps.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
readnodes.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h $(H)/dep_str.h \
|
||||
$(H)/dep.h
|
||||
sets.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
setutils.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
symb_alg.o: $(H)/db.h $(H)/defs.h $(H)/tag $(H)/bif.h \
|
||||
$(H)/ll.h $(H)/symb.h $(H)/sets.h
|
||||
writenodes.o: $(H)/db.h $(H)/defs.h $(H)/tag \
|
||||
$(H)/bif.h $(H)/ll.h $(H)/symb.h $(H)/sets.h $(H)/dep_str.h \
|
||||
$(H)/dep.h
|
||||
96
dvm/fdvm/trunk/Sage/lib/oldsrc/makefile.win
Normal file
96
dvm/fdvm/trunk/Sage/lib/oldsrc/makefile.win
Normal file
@@ -0,0 +1,96 @@
|
||||
#######################################################################
|
||||
## Copyright (C) 1999 ##
|
||||
## Keldysh Institute of Appllied Mathematics ##
|
||||
#######################################################################
|
||||
|
||||
# sage/lib/oldsrc/makefile.win
|
||||
|
||||
|
||||
OUTDIR = ..\..\..\obj
|
||||
LIBDIR = ..\..\..\lib
|
||||
|
||||
OLDHEADERS = ..\..\h
|
||||
|
||||
# Directory in which include file can be found
|
||||
TOOLBOX_INCLUDE = ../include
|
||||
|
||||
INCL = -I$(OLDHEADERS) -I../include
|
||||
|
||||
# -w don't issue warning now.
|
||||
#CFLAGS=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D SYS5 $(INCL) \
|
||||
# /Fp"$(OUTDIR)/oldsrc.pch" /YX /Fo"$(OUTDIR)/" /Fd"$(OUTDIR)/" /c
|
||||
CFLAGS=/nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D SYS5 $(INCL) \
|
||||
/Fp"$(OUTDIR)/oldsrc.pch" /Fo"$(OUTDIR)/" /Fd"$(OUTDIR)/" /c
|
||||
|
||||
.c{$(OUTDIR)/}.obj:
|
||||
$(CC) $(CFLAGS) $<
|
||||
|
||||
LIB32=$(LINKER) -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(LIBDIR)/libdb.lib"
|
||||
|
||||
|
||||
EXTHDRS = $H/bif.h $H/db.h $H/db.h $H/defs.h $H/dep.h \
|
||||
$H/dep_str.h $H/list.h $H/ll.h $H/sets.h $H/symb.h \
|
||||
$H/tag $H/vparse.h
|
||||
|
||||
OBJS = $(OUTDIR)/anal_ind.obj $(OUTDIR)/db.obj $(OUTDIR)/db_unp.obj \
|
||||
$(OUTDIR)/db_unp_vpc.obj $(OUTDIR)/dbutils.obj $(OUTDIR)/garb_coll.obj \
|
||||
$(OUTDIR)/glob_anal.obj $(OUTDIR)/ker_fun.obj $(OUTDIR)/list.obj \
|
||||
$(OUTDIR)/make_nodes.obj $(OUTDIR)/mod_ref.obj $(OUTDIR)/ndeps.obj \
|
||||
$(OUTDIR)/readnodes.obj $(OUTDIR)/sets.obj $(OUTDIR)/setutils.obj \
|
||||
$(OUTDIR)/symb_alg.obj $(OUTDIR)/writenodes.obj
|
||||
|
||||
SRCS = anal_ind.c db.c db_unp.c db_unp_vpc.c dbutils.c \
|
||||
garb_coll.c glob_anal.c ker_fun.c list.c \
|
||||
make_nodes.c mod_ref.c ndeps.c readnodes.c sets.c setutils.c \
|
||||
symb_alg.c writenodes.c
|
||||
|
||||
$(LIBDIR)/libdb.lib: $(OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(OBJS)
|
||||
<<
|
||||
|
||||
all: $(LIBDIR)/libdb.lib
|
||||
@echo "*** COMPILING LIBRARY oldsrc DONE"
|
||||
|
||||
clean:
|
||||
|
||||
cleanall:
|
||||
|
||||
###
|
||||
anal_ind.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
db.o: $H/db.h $H/defs.h \
|
||||
$H/tag $H/bif.h $H/ll.h $H/symb.h $H/sets.h
|
||||
db_unp.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
db_unp_vpc.o: $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h $H/db.h $H/vparse.h
|
||||
dbutils.o: $H/db.h \
|
||||
$H/defs.h $H/tag $H/bif.h $H/ll.h $H/symb.h $H/sets.h
|
||||
garb-coll.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
glob_anal.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
ker_fun.o: $H/defs.h $H/tag $H/bif.h $H/ll.h \
|
||||
$H/symb.h $H/sets.h
|
||||
list.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h $H/list.h
|
||||
make_nodes.o: $H/db.h $H/defs.h $H/tag \
|
||||
$H/bif.h $H/ll.h $H/symb.h $H/sets.h
|
||||
mod_ref.o: $H/defs.h $H/tag $H/bif.h $H/ll.h \
|
||||
$H/symb.h $H/sets.h $H/vparse.h $H/db.h
|
||||
ndeps.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
readnodes.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h $H/dep_str.h \
|
||||
$H/dep.h
|
||||
sets.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
setutils.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
symb_alg.o: $H/db.h $H/defs.h $H/tag $H/bif.h \
|
||||
$H/ll.h $H/symb.h $H/sets.h
|
||||
writenodes.o: $H/db.h $H/defs.h $H/tag \
|
||||
$H/bif.h $H/ll.h $H/symb.h $H/sets.h $H/dep_str.h \
|
||||
$H/dep.h
|
||||
540
dvm/fdvm/trunk/Sage/lib/oldsrc/mod_ref.c
Normal file
540
dvm/fdvm/trunk/Sage/lib/oldsrc/mod_ref.c
Normal file
@@ -0,0 +1,540 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/* file: mod_ref.c */
|
||||
|
||||
/* Modified by Jenq-Kuen Lee Feb 24,1988 */
|
||||
/* The simple un-parser for VPC++ */
|
||||
# include "db.h"
|
||||
# include "vparse.h"
|
||||
|
||||
#define BLOB1_NULL (PTR_BLOB1)NULL
|
||||
#define R_VALUE 0
|
||||
#define L_VALUE 1
|
||||
|
||||
extern PCF UnparseBfnd[];
|
||||
extern PTR_BLOB1 chain_blob1();
|
||||
extern PTR_BLOB1 make_blob1();
|
||||
extern char *cunparse_llnd();
|
||||
extern PTR_FILE cur_file;
|
||||
|
||||
static void ccheck_bfnd();
|
||||
static void ccheck_llnd();
|
||||
void print_out();
|
||||
void test_mod_ref();
|
||||
int is_i_code();
|
||||
|
||||
static void ccheck_bfnd(pbf, ref_list, mod_list)
|
||||
PTR_BFND pbf;
|
||||
PTR_BLOB1 *ref_list, *mod_list;
|
||||
{
|
||||
PTR_BLOB1 list_r, list_m;
|
||||
|
||||
*ref_list = BLOB1_NULL;
|
||||
*mod_list = BLOB1_NULL;
|
||||
if (!pbf)
|
||||
return;
|
||||
|
||||
switch (pbf->variant) {
|
||||
case GLOBAL:
|
||||
break;
|
||||
case PROG_HEDR:
|
||||
case PROC_HEDR:
|
||||
break;
|
||||
case FUNC_HEDR:
|
||||
break;
|
||||
case IF_NODE:
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case LOGIF_NODE:
|
||||
case ARITHIF_NODE:
|
||||
case WHERE_NODE:
|
||||
break;
|
||||
case FOR_NODE:
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr3, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case FORALL_NODE:
|
||||
case WHILE_NODE:
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case ASSIGN_STAT:
|
||||
case IDENTIFY:
|
||||
case PROC_STAT:
|
||||
case SAVE_DECL:
|
||||
case CONT_STAT:
|
||||
case FORMAT_STAT:
|
||||
break;
|
||||
case LABEL_STAT:
|
||||
break;
|
||||
case GOTO_NODE:
|
||||
break;
|
||||
case ASSGOTO_NODE:
|
||||
case COMGOTO_NODE:
|
||||
case STOP_STAT:
|
||||
break;
|
||||
case RETURN_STAT:
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case PARAM_DECL:
|
||||
case DIM_STAT:
|
||||
case EQUI_STAT:
|
||||
case DATA_DECL:
|
||||
case READ_STAT:
|
||||
case WRITE_STAT:
|
||||
case OTHERIO_STAT:
|
||||
case COMM_STAT:
|
||||
case CONTROL_END:
|
||||
break;
|
||||
case CLASS_DECL: /* New added for VPC */
|
||||
break;
|
||||
case ENUM_DECL: /* New added for VPC */
|
||||
case UNION_DECL: /* New added for VPC */
|
||||
case STRUCT_DECL: /* New added for VPC */
|
||||
break;
|
||||
case DERIVED_CLASS_DECL: /* Need More for VPC */
|
||||
case VAR_DECL:
|
||||
break;
|
||||
case EXPR_STMT_NODE: /* New added for VPC */
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case DO_WHILE_NODE: /* New added for VPC */
|
||||
/* Need study */
|
||||
break;
|
||||
case SWITCH_NODE: /* New added for VPC */
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case CASE_NODE: /* New added for VPC */
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case DEFAULT_NODE: /* New added for VPC */
|
||||
break;
|
||||
case BASIC_BLOCK:
|
||||
break;
|
||||
case BREAK_NODE: /* New added for VPC */
|
||||
break;
|
||||
case CONTINUE_NODE: /* New added for VPC */
|
||||
break;
|
||||
case RETURN_NODE: /* New added for VPC */
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case ASM_NODE: /* New added for VPC */
|
||||
break; /* Need More */
|
||||
case SPAWN_NODE: /* New added for CC++ */
|
||||
break;
|
||||
case PARFOR_NODE: /* New added for CC++ */
|
||||
ccheck_llnd(pbf->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case PAR_NODE: /* New added for CC++ */
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "bad bfnd case\n");
|
||||
break; /* don't know what to do at this point */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void ccheck_llnd(pllnd, ref_list, mod_list, type)
|
||||
PTR_LLND pllnd;
|
||||
PTR_BLOB1 *ref_list, *mod_list;
|
||||
int type;
|
||||
{
|
||||
PTR_BLOB1 list_r, list_m;
|
||||
|
||||
*ref_list = (PTR_BLOB1) NULL;
|
||||
*mod_list = (PTR_BLOB1) NULL;
|
||||
if (pllnd == NULL)
|
||||
return;
|
||||
|
||||
switch (pllnd->variant) {
|
||||
case INT_VAL:
|
||||
case STMT_STR:
|
||||
case FLOAT_VAL:
|
||||
case DOUBLE_VAL:
|
||||
case STRING_VAL:
|
||||
case BOOL_VAL:
|
||||
case CHAR_VAL:
|
||||
break;
|
||||
case CONST_REF:
|
||||
case ENUM_REF:
|
||||
break;
|
||||
case VAR_REF:
|
||||
if (type == L_VALUE) {
|
||||
*ref_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
*mod_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
}
|
||||
else {
|
||||
*ref_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
*mod_list = (PTR_BLOB1) NULL;
|
||||
}
|
||||
break;
|
||||
case POINTST_OP: /* New added for VPC */
|
||||
case RECORD_REF: /* Need More */
|
||||
if (type == L_VALUE) {
|
||||
*ref_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
*mod_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
}
|
||||
else {
|
||||
*ref_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
*mod_list = (PTR_BLOB1) NULL;
|
||||
}
|
||||
/* Need more */
|
||||
break;
|
||||
case ARRAY_OP:
|
||||
*ref_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
if (type == L_VALUE)
|
||||
*mod_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
else
|
||||
*mod_list = BLOB1_NULL;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case ARRAY_REF:
|
||||
*ref_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
if (type == L_VALUE)
|
||||
*mod_list = make_blob1(IsObj, pllnd, (PTR_BLOB1) NULL);
|
||||
else
|
||||
*mod_list = BLOB1_NULL;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case CONSTRUCTOR_REF:
|
||||
break;
|
||||
case ACCESS_REF:
|
||||
break;
|
||||
case CONS:
|
||||
break;
|
||||
case ACCESS:
|
||||
break;
|
||||
case IOACCESS:
|
||||
break;
|
||||
case PROC_CALL:
|
||||
case FUNC_CALL:
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case EXPR_LIST:
|
||||
if (type == R_VALUE) {
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
}
|
||||
else {
|
||||
if (pllnd->entry.Template.ll_ptr2) {
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, L_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
}
|
||||
else {
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, L_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EQUI_LIST:
|
||||
break;
|
||||
case COMM_LIST:
|
||||
break;
|
||||
case VAR_LIST:
|
||||
case CONTROL_LIST:
|
||||
break;
|
||||
case RANGE_LIST:
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case DDOT:
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case COPY_NODE:
|
||||
break;
|
||||
case VECTOR_CONST: /* NEW ADDED FOR VPC++ */
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case INIT_LIST:
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case BIT_NUMBER:
|
||||
break;
|
||||
case DEF_CHOICE:
|
||||
case SEQ:
|
||||
break;
|
||||
case SPEC_PAIR:
|
||||
break;
|
||||
case MOD_OP:
|
||||
break;
|
||||
|
||||
case ASSGN_OP: /* New added for VPC */
|
||||
case ARITH_ASSGN_OP: /* New added for VPC */
|
||||
case PLUS_ASSGN_OP:
|
||||
case MINUS_ASSGN_OP:
|
||||
case AND_ASSGN_OP:
|
||||
case IOR_ASSGN_OP:
|
||||
case MULT_ASSGN_OP:
|
||||
case DIV_ASSGN_OP:
|
||||
case MOD_ASSGN_OP:
|
||||
case XOR_ASSGN_OP:
|
||||
case LSHIFT_ASSGN_OP:
|
||||
case RSHIFT_ASSGN_OP:
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, L_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case EQ_OP:
|
||||
case LT_OP:
|
||||
case GT_OP:
|
||||
case NOTEQL_OP:
|
||||
case LTEQL_OP:
|
||||
case GTEQL_OP:
|
||||
case ADD_OP:
|
||||
case SUBT_OP:
|
||||
case OR_OP:
|
||||
case MULT_OP:
|
||||
case DIV_OP:
|
||||
case AND_OP:
|
||||
case EXP_OP:
|
||||
case LE_OP: /* New added for VPC *//* Duplicated */
|
||||
case GE_OP: /* New added for VPC *//* Duplicated */
|
||||
case NE_OP: /* New added for VPC *//* Duplicated */
|
||||
case BITAND_OP: /* New added for VPC */
|
||||
case BITOR_OP: /* New added for VPC */
|
||||
case LSHIFT_OP: /* New added for VPC */
|
||||
case RSHIFT_OP: /* New added for VPC */
|
||||
case NEW_OP:
|
||||
case DELETE_OP:
|
||||
case THIS_NODE:
|
||||
case SCOPE_OP:
|
||||
case INTEGER_DIV_OP: /* New added for VPC */
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case ADDRESS_OP: /* New added for VPC */
|
||||
case SIZE_OP: /* New added for VPC */
|
||||
break;
|
||||
case DEREF_OP:
|
||||
break;
|
||||
case SUB_OP: /* duplicated unary minus */
|
||||
case MINUS_OP: /* unary operations */
|
||||
case UNARY_ADD_OP: /* New added for VPC */
|
||||
case BIT_COMPLEMENT_OP: /* New added for VPC */
|
||||
case NOT_OP:
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
break;
|
||||
case MINUSMINUS_OP: /* New added for VPC */
|
||||
case PLUSPLUS_OP: /* New added for VPC */
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, L_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, L_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case STAR_RANGE:
|
||||
break;
|
||||
case CLASSINIT_OP: /* New added for VPC */
|
||||
break;
|
||||
case CAST_OP: /* New added for VPC */
|
||||
break;
|
||||
case FUNCTION_OP:
|
||||
case EXPR_IF: /* New added for VPC */
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case EXPR_IF_BODY: /* New added for VPC */
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr1, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = list_r;
|
||||
*mod_list = list_m;
|
||||
ccheck_llnd(pllnd->entry.Template.ll_ptr2, &list_r, &list_m, R_VALUE);
|
||||
*ref_list = chain_blob1(*ref_list, list_r);
|
||||
*mod_list = chain_blob1(*mod_list, list_m);
|
||||
break;
|
||||
case FUNCTION_REF: /* New added for VPC */
|
||||
break;
|
||||
case LABEL_REF: /* Fortran Version, For VPC we need more */
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "ccheck_llnd -- bad llnd ptr %d!\n", pllnd->variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Very important routine to see a given bif node of a function is
|
||||
* local-variable declaration or argument declaration
|
||||
* return 1 ---TRUE
|
||||
* 0 False
|
||||
*/
|
||||
int is_param_decl_interface(var_bf, functor)
|
||||
PTR_BFND var_bf;
|
||||
PTR_SYMB functor;
|
||||
{
|
||||
PTR_LLND flow_ptr, lpr;
|
||||
PTR_SYMB s;
|
||||
|
||||
switch (var_bf->variant) {
|
||||
case VAR_DECL:
|
||||
case ENUM_DECL:
|
||||
case CLASS_DECL:
|
||||
case UNION_DECL:
|
||||
case STRUCT_DECL:
|
||||
case DERIVED_CLASS_DECL:
|
||||
lpr = var_bf->entry.Template.ll_ptr1;
|
||||
for (flow_ptr = lpr; flow_ptr; flow_ptr=flow_ptr->entry.Template.ll_ptr1) {
|
||||
if ((flow_ptr->variant == VAR_REF) ||
|
||||
(flow_ptr->variant == ARRAY_REF) ||
|
||||
(flow_ptr->variant == FUNCTION_REF))
|
||||
break;
|
||||
}
|
||||
if (!flow_ptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (s = functor->entry.member_func.in_list; s;) {
|
||||
if (flow_ptr->entry.Template.symbol == s)
|
||||
return (1);
|
||||
s = s->entry.var_decl.next_in;
|
||||
}
|
||||
return (0);
|
||||
|
||||
default:
|
||||
return (0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
PTR_BLOB1 chain_blob1(b1, b2)
|
||||
PTR_BLOB1 b1, b2;
|
||||
{
|
||||
PTR_BLOB1 oldptr, temptr;
|
||||
|
||||
if (!b1)
|
||||
return (b2);
|
||||
if (!b2)
|
||||
return (b1);
|
||||
for (oldptr = temptr = b1; temptr; temptr = temptr->next)
|
||||
oldptr = temptr;
|
||||
|
||||
oldptr->next = b2;
|
||||
return (b1);
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------*/
|
||||
/* The following code for testing ccheck_bfnd and ccheck_llnd */
|
||||
void print_out(list, type)
|
||||
PTR_BLOB1 list;
|
||||
int type;
|
||||
{
|
||||
PTR_BLOB1 b;
|
||||
char *source_ptr;
|
||||
|
||||
if (!list)
|
||||
return;
|
||||
if (type == R_VALUE)
|
||||
fprintf(stderr, "------ reference ---------------------------------------------\n");
|
||||
else
|
||||
fprintf(stderr, "------ modified ---------------------------------------------\n");
|
||||
for (b = list; b; b = b->next) {
|
||||
source_ptr = (UnparseBfnd[cur_file->lang])(b->ref);
|
||||
fprintf(stderr, "%s\n", source_ptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void test_mod_ref(pbf)
|
||||
PTR_BFND pbf;
|
||||
{
|
||||
PTR_BLOB b;
|
||||
PTR_BLOB1 list_r, list_m;
|
||||
|
||||
if (!pbf)
|
||||
return;
|
||||
ccheck_bfnd(pbf, &list_r, &list_m);
|
||||
|
||||
if (is_i_code(pbf)) {
|
||||
for (b = pbf->entry.Template.bl_ptr1; b; b = b->next)
|
||||
test_mod_ref(b->ref);
|
||||
for (b = pbf->entry.Template.bl_ptr2; b; b = b->next)
|
||||
test_mod_ref(b->ref);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int is_i_code(pbf)
|
||||
PTR_BFND pbf;
|
||||
{
|
||||
switch (pbf->variant) {
|
||||
case ENUM_DECL:
|
||||
case STRUCT_DECL:
|
||||
case UNION_DECL:
|
||||
return (0);
|
||||
default:
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
1076
dvm/fdvm/trunk/Sage/lib/oldsrc/ndeps.c
Normal file
1076
dvm/fdvm/trunk/Sage/lib/oldsrc/ndeps.c
Normal file
File diff suppressed because it is too large
Load Diff
1124
dvm/fdvm/trunk/Sage/lib/oldsrc/readnodes.c
Normal file
1124
dvm/fdvm/trunk/Sage/lib/oldsrc/readnodes.c
Normal file
File diff suppressed because it is too large
Load Diff
1818
dvm/fdvm/trunk/Sage/lib/oldsrc/sets.c
Normal file
1818
dvm/fdvm/trunk/Sage/lib/oldsrc/sets.c
Normal file
File diff suppressed because it is too large
Load Diff
2518
dvm/fdvm/trunk/Sage/lib/oldsrc/setutils.c
Normal file
2518
dvm/fdvm/trunk/Sage/lib/oldsrc/setutils.c
Normal file
File diff suppressed because it is too large
Load Diff
1050
dvm/fdvm/trunk/Sage/lib/oldsrc/symb_alg.c
Normal file
1050
dvm/fdvm/trunk/Sage/lib/oldsrc/symb_alg.c
Normal file
File diff suppressed because it is too large
Load Diff
1018
dvm/fdvm/trunk/Sage/lib/oldsrc/writenodes.c
Normal file
1018
dvm/fdvm/trunk/Sage/lib/oldsrc/writenodes.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user