added project
This commit is contained in:
33
dvm/fdvm/trunk/parser/CMakeLists.txt
Normal file
33
dvm/fdvm/trunk/parser/CMakeLists.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
set(PARSE_SOURCES cftn.c errors.c gram1.tab.c hash.c init.c lexfdvm.c lists.c
|
||||
low_hpf.c misc.c stat.c sym.c types.c unparse_hpf.c)
|
||||
|
||||
set_source_files_properties(gram1.tab.c PROPERTIES COMPILE_DEFINITIONS YYDEBUG)
|
||||
|
||||
if(MSVC_IDE)
|
||||
file(GLOB_RECURSE PARSE_HEADERS RELATIVE
|
||||
${CMAKE_CURRENT_SOURCE_DIR} *.h)
|
||||
set(PARSE_HEADERS ${PARSE_HEADERS} head tag tokens)
|
||||
source_group("Header Files" FILES ${PARSE_HEADERS})
|
||||
foreach(DIR ${DVM_FORTRAN_INCLUDE_DIRS})
|
||||
file(GLOB_RECURSE FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${DIR}/*.h")
|
||||
set(PARSE_HEADERS ${PARSE_HEADERS} ${FILES})
|
||||
endforeach()
|
||||
file(GLOB_RECURSE PARSE_GRAMMERS RELATIVE
|
||||
${CMAKE_CURRENT_SOURCE_DIR} *.gram *.y)
|
||||
source_group("Grammer Files" FILES ${PARSE_GRAMMERS})
|
||||
endif()
|
||||
|
||||
add_executable(parse ${PARSE_SOURCES} ${PARSE_HEADERS} ${PARSE_GRAMMERS})
|
||||
|
||||
add_dependencies(parse db sage sage++)
|
||||
target_link_libraries(parse db sage sage++)
|
||||
target_compile_definitions(parse PRIVATE SYS5)
|
||||
if (WIN32)
|
||||
target_compile_definitions(parse PRIVATE WIN)
|
||||
endif()
|
||||
target_include_directories(parse PRIVATE "${DVM_FORTRAN_INCLUDE_DIRS}")
|
||||
set_target_properties(parse PROPERTIES FOLDER "${DVM_TOOL_FOLDER}"
|
||||
RUNTIME_OUTPUT_DIRECTORY ${DVM_BIN_DIR}
|
||||
COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>
|
||||
PDB_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>
|
||||
)
|
||||
196
dvm/fdvm/trunk/parser/Makefile
Normal file
196
dvm/fdvm/trunk/parser/Makefile
Normal file
@@ -0,0 +1,196 @@
|
||||
#echo#######################################################################
|
||||
# Makefile for Fortran DVM front-end
|
||||
#
|
||||
# HDR traditional header files.
|
||||
# HDRg header files generated by programs.
|
||||
# SRC traditional source files.
|
||||
# SRCg source files generated by programs.
|
||||
# OBJS object files required to load the program.
|
||||
#
|
||||
|
||||
#PATH=$PATH/usr/freeware/lib:
|
||||
SHELL = /bin/sh
|
||||
CONFIG_ARCH=iris4d
|
||||
#!!
|
||||
SAGEROOT=../Sage
|
||||
LIBDIR = ../libsage
|
||||
#LIBDIR = $(SAGEROOT)/lib/$(CONFIG_ARCH)
|
||||
#LIBDIR = /usr/people/podd/oldsrc
|
||||
LIBINCLUDE = $(SAGEROOT)/lib/include
|
||||
HINCLUDE =$(SAGEROOT)/h
|
||||
DVMINCLUDE = ../include
|
||||
#INSTALLDEST = $(SAGEROOT)/bin/$(CONFIG_ARCH)
|
||||
INSTALLDEST = ../bin
|
||||
INSTALL = /bin/cp
|
||||
#!!
|
||||
|
||||
CC = gcc
|
||||
#USE_CC#CC=cc#ENDIF#
|
||||
|
||||
CXX = /usr/WorkShop/usr/DCC
|
||||
|
||||
LINKER = $(CC)
|
||||
|
||||
|
||||
|
||||
LINTFLAGS = -azhx -I$(HINCLUDE)
|
||||
|
||||
#C90#EXTRAOBJS=../lib/c90/alloca-c90.o#ENDIF#
|
||||
#MIPS_CC#CEXTRA = -Wf,-XNg800#ENDIF#
|
||||
#HP-ALLOCA#LDLIBS = -lPW#ENDIF#
|
||||
#HP_CFLAGS#CEXTRA = -Aa#ENDIF#
|
||||
|
||||
CFLAGS = -g -Wall -I$(DVMINCLUDE) -I$(HINCLUDE) -I$(LIBINCLUDE) $(CFEXTRA) $(CEXTRA) -DSYS5
|
||||
|
||||
LIBS = $(LIBDIR)/libdb.a
|
||||
#HP_CFLAGS#LIBS = $(LIBDIR)/libdb.sl#ENDIF#
|
||||
|
||||
# Comment the following line out if you don't use bison
|
||||
#YACC = /usr/local/bin/bison
|
||||
YACC = bison
|
||||
#YACC = yacc
|
||||
# Tells bison to be yacc-compatible and generates y.tab.h and y.tab.c
|
||||
YFLAGS = -vd
|
||||
#!!
|
||||
EXECUTABLES = parse
|
||||
|
||||
# Directory in which include file can be found
|
||||
TOOLBOX_HDR = $(LIBINCLUDE)/macro.h $(LIBINCLUDE)/bif_node.def $(LIBINCLUDE)/type.def $(LIBINCLUDE)/symb.def
|
||||
FDVM = $(DVMINCLUDE)/dvm_tag.h
|
||||
|
||||
|
||||
HDR = $(DVMINCLUDE)/inc.h $(HINCLUDE)/defs.h $(DVMINCLUDE)/fdvm.h $(HINCLUDE)/bif.h \
|
||||
$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
|
||||
$(DVMINCLUDE)/extern.h $(HINCLUDE)/sets.h tag tokens
|
||||
|
||||
HDRg = tag.h tokdefs.h
|
||||
|
||||
HDRS = $(HDR) $(HDRg)
|
||||
# !!
|
||||
SRC = cftn.c init.c hash.c lexfdvm.c lists.c\
|
||||
misc.c stat.c errors.c types.c sym.c\
|
||||
low_hpf.c unparse_hpf.c
|
||||
#!!
|
||||
SRCg = gram.tab.c
|
||||
|
||||
SRCS = $(SRC) $(SRCg)
|
||||
#!!
|
||||
OBJS = cftn.o errors.o hash.o init.o lexfdvm.o lists.o\
|
||||
misc.o stat.o types.o gram1.tab.o sym.o\
|
||||
low_hpf.o unparse_hpf.o
|
||||
|
||||
all: $(EXECUTABLES)
|
||||
|
||||
install: $(INSTALLDEST)/parse
|
||||
|
||||
$(INSTALLDEST)/parse: parse
|
||||
@echo Installing $? in $(INSTALLDEST)
|
||||
if [ -d $(INSTALLDEST) ] ; then true; \
|
||||
else mkdir $(INSTALLDEST) ;fi
|
||||
@$(INSTALL) $? $(INSTALLDEST)
|
||||
|
||||
|
||||
$(EXECUTABLES) : $(OBJS) $(LIBS)
|
||||
@echo -n "Loading $(EXECUTABLES) ... "
|
||||
$(LINKER) $(LDFLAGS) $(OBJS) $(EXTRAOBJS) $(LIBS) \
|
||||
-o $(EXECUTABLES) $(LDLIBS)
|
||||
@echo "done"
|
||||
# !!
|
||||
gram1.tab.o: gram1.tab.c
|
||||
$(CC) $(CFLAGS) -DYYDEBUG -c gram1.tab.c
|
||||
#!!
|
||||
gram1.tab.c: tokdefs.h ftn.gram fdvm.gram fomp.gram facc.gram fspf.gram
|
||||
( sed < tokdefs.h "s/#define/%token/"; cat ftn.gram fdvm.gram fomp.gram facc.gram fspf.gram) > gram1.y
|
||||
$(YACC) $(YFLAGS) gram1.y
|
||||
|
||||
tokdefs.h: tokens
|
||||
grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs.h
|
||||
|
||||
tag.h: head tag
|
||||
( cat head; \
|
||||
sed < tag \
|
||||
'/#defin/s/\([^ ]*\) \([^ ]*\)\(.*\)/ tag \[ \2 \] = \"\2\";/')\
|
||||
> tag.h
|
||||
|
||||
lint:
|
||||
lint $(LINTFLAGS) $(SRCS) $(SAGEROOT)/lib/llib-llibdb.ln
|
||||
|
||||
clean:
|
||||
@rm -f $(OBJS)
|
||||
@rm -f $(EXECUTABLES)
|
||||
@rm -f *.dep
|
||||
cleaninstall:
|
||||
/bin/rm -f $(OBJS)
|
||||
/bin/rm -f $(EXECUTABLES)
|
||||
/bin/rm -f *.dep
|
||||
|
||||
realclean:
|
||||
@rm -f $(HDRg) gram1.tab.c
|
||||
|
||||
ci:
|
||||
ci -u -f $(SRC) $(HDR) ftn.gram
|
||||
|
||||
tags: $(HDRS) $(SRC) ftn.gram; @etags $(HDRS) $(SRC) ftn.gram
|
||||
|
||||
update: $(HDR) $(SRC) ftn.gram
|
||||
@update $?
|
||||
@touch update
|
||||
###
|
||||
cftn.o: $(HINCLUDE)/db.h $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/bif.h \
|
||||
$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h
|
||||
ftn.gram: $(DVMINCLUDE)/extern.h $(HINCLUDE)/defines.h $(HINCLUDE)/defs.h \
|
||||
$(DVMINCLUDE)/fdvm.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h \
|
||||
$(HINCLUDE)/sets.h
|
||||
commsym.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
|
||||
$(HINCLUDE)/bif.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/ll.h \
|
||||
$(HINCLUDE)/sets.h
|
||||
errors.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(DVMINCLUDE)/extern.h \
|
||||
$(HINCLUDE)/db.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/sets.h
|
||||
exec.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag
|
||||
gram.o: $(HINCLUDE)/defs.h \
|
||||
$(HINCLUDE)/tag $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h \
|
||||
$(HINCLUDE)/sets.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/defines.h
|
||||
hash.o: $(HINCLUDE)/defs.h $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h $(DVMINCLUDE)/extern.h \
|
||||
$(HINCLUDE)/db.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/sets.h $(HINCLUDE)/tag
|
||||
init.o: $(DVMINCLUDE)/inc.h $(HINCLUDE)/defs.h $(HINCLUDE)/bif.h $(HINCLUDE)/defines.h \
|
||||
$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h $(HINCLUDE)/db.h $(HINCLUDE)/tag
|
||||
# !!
|
||||
lexfdvm.o: $(DVMINCLUDE)/extern.h
|
||||
lists.o:$(HINCLUDE)/defs.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/bif.h
|
||||
misc.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/defines.h $(HINCLUDE)/db.h \
|
||||
$(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h
|
||||
stat.o: $(HINCLUDE)/defs.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h\
|
||||
$(HINCLUDE)/sets.h $(HINCLUDE)/defines.h $(DVMINCLUDE)/extern.h
|
||||
sym.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
|
||||
$(HINCLUDE)/bif.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/ll.h \
|
||||
$(HINCLUDE)/sets.h $(DVMINCLUDE)/fdvm.h
|
||||
types.o:$(HINCLUDE)/defs.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h
|
||||
|
||||
low_hpf.o: low_hpf.c $(FDVM) $(TOOLBOX_HDR)
|
||||
unparse_hpf.o: unparse_hpf.c $(FDVM) $(TOOLBOX_HDR) $(DVMINCLUDE)/unparse.hpf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
918
dvm/fdvm/trunk/parser/cftn.c
Normal file
918
dvm/fdvm/trunk/parser/cftn.c
Normal file
@@ -0,0 +1,918 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
/*
|
||||
* main.c --- Calls parser, dependence graph analyzer, subscript analyzer.
|
||||
* Opens and closes the files that are needed.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "compatible.h"
|
||||
#ifdef SYS5
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN
|
||||
#define SLASH_ "\\"
|
||||
#else
|
||||
#define SLASH_ "/"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "db.h"
|
||||
#include "defines.h"
|
||||
#include "version.h"
|
||||
#include "fdvm_version.h"
|
||||
typedef FILE *FILEP;
|
||||
|
||||
#ifdef __SPF
|
||||
#ifndef __SPF_BUILT_IN_PARSER
|
||||
void addToCollection(const int line, const char *file, void *pointer, int type) { }
|
||||
void removeFromCollection(void *pointer) { }
|
||||
#else
|
||||
#define HPF_program HPF_program_
|
||||
#define OMP_program OMP_program_
|
||||
#define ACC_program ACC_program_
|
||||
#define deb_mpi deb_mpi_
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int yylineno, yyleng, yylisting, yylonglines, yydebug;
|
||||
extern int parstate;
|
||||
extern char * infname;
|
||||
extern int errcnt, prflag, errline, num_files;
|
||||
extern PTR_BFND global_bfnd;
|
||||
extern PTR_BLOB head_blob;
|
||||
extern PTR_FNAME head_file,cur_thread_file;
|
||||
extern int num_bfnds; /* total # of bif nodes */
|
||||
extern int num_llnds; /* total # of low level nodes */
|
||||
extern int num_symbs; /* total # of symbol nodes */
|
||||
extern int num_types; /* total # of types nodes */
|
||||
extern int num_blobs; /* total # of blob nodes */
|
||||
extern int num_sets; /* total # of set nodes */
|
||||
extern int num_cmnt;
|
||||
extern int num_def; /* total # of dependncy nodes */
|
||||
extern int num_dep;
|
||||
extern int num_label; /* total # of label nodes */
|
||||
extern PTR_BFND head_bfnd, /* start of bfnd chain */
|
||||
cur_bfnd; /* poextern int to current bfnd */
|
||||
|
||||
extern PTR_LLND head_llnd, cur_llnd;
|
||||
extern PTR_SYMB head_symb, cur_symb;
|
||||
extern PTR_TYPE head_type, cur_type;
|
||||
extern PTR_LABEL head_label, cur_label;
|
||||
extern PTR_FNAME head_file,cur_thread_file;
|
||||
extern PTR_BLOB head_blob, cur_blob;
|
||||
extern PTR_SETS head_sets, cur_sets;
|
||||
extern PTR_DEF head_def, cur_def;
|
||||
extern PTR_DEFLST head_deflst, cur_deflst;
|
||||
extern PTR_DEP head_dep, cur_dep, pre_dep;
|
||||
extern PTR_CMNT head_cmnt, cur_cmnt;
|
||||
extern PTR_CMNT cur_comment;
|
||||
PTR_TYPE global_unknown = NULL;
|
||||
|
||||
int _filbuf();
|
||||
PTR_SETS build_sets();
|
||||
int relink();
|
||||
int write_nodes();
|
||||
int fclose();
|
||||
int inilex();
|
||||
int dbginilex();
|
||||
int yyparse();
|
||||
|
||||
PTR_BFND get_bfnd();
|
||||
void fatalstr(), initialize(), errstr(), release_nodes(), close_files();
|
||||
void errstr_fatal(), err_fatal();
|
||||
void make_file_list();
|
||||
char *copys();
|
||||
char *getenv();
|
||||
int system();
|
||||
void free();
|
||||
void exit();
|
||||
void err();
|
||||
char* chkalloc();
|
||||
int UnparseFDVMProgram();
|
||||
void PrepareSourceFileForDebug (); /*OMP*/
|
||||
|
||||
extern int language;
|
||||
extern int warn_all;
|
||||
/*int language = ForSrc;*/
|
||||
FILE *outf;
|
||||
static char *defeditor = "/usr/ucb/vi +%d %s";
|
||||
int show_deps = 0; /* set to 1 by -sd flag */
|
||||
int garb_collect = 1; /* disabled by -c flag */
|
||||
/*static int dep = 0;*/
|
||||
static int dvm_debug = 0; /*set to 1 by -d1 ...-d4 flags */
|
||||
/*int only_debug = 0; */ /*set to 1 by -s flag */
|
||||
/*int level_debug = 0; */ /*set to 1 by -d1 flag, to 2 by -d2 flag and so on */
|
||||
/*int perf_analysis =0; */ /*set to 1 by -e1 flag, to 2 by -e2 flag and so on */
|
||||
static int v_print = 0; /*set to 1 by -v flag */
|
||||
/*int warn_all = 0; */ /*set to 1 by -w flag */
|
||||
int HPF;
|
||||
extern int HPF_VERSION;
|
||||
int HPF_program;
|
||||
int OMP_program; /*OMP*/
|
||||
int ACC_program; /*ACC*/
|
||||
int SAPFOR; /*SPF*/
|
||||
int free_form;
|
||||
int source_form_by_option;
|
||||
int ftn_std;
|
||||
int d_line;
|
||||
int deb_mpi;
|
||||
int extend_source;
|
||||
int nchars_per_line;
|
||||
char *outname;
|
||||
PTR_FILE fi;
|
||||
extern PTR_FILE cur_file;
|
||||
struct include_dir {
|
||||
struct include_dir *next;
|
||||
char *dir_name;
|
||||
}; /*list of directories for "include"*/
|
||||
struct include_dir *incl_first = NULL; /*set by -I flag */
|
||||
struct include_dir *incl_last;
|
||||
|
||||
int is_integer_value(str)
|
||||
char *str;
|
||||
{
|
||||
if(!str)
|
||||
return 0;
|
||||
for( ; *str != '\0'; str++)
|
||||
if (! isdigit(*str))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void gen_out_name(const char *filename)
|
||||
{
|
||||
register int i;
|
||||
char *q, *r;
|
||||
|
||||
if (!filename)
|
||||
return;
|
||||
|
||||
outname = (char *)malloc((unsigned)(strlen(filename) + 4));
|
||||
strcpy(outname, filename);
|
||||
|
||||
for (i = strlen(filename) - 1; i >= 0; i--)
|
||||
{
|
||||
if (filename[i] == '.')
|
||||
{
|
||||
q = &(outname[i + 1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i < 0) {
|
||||
q = &(outname[strlen(filename)]);
|
||||
*q++ = '.';
|
||||
}
|
||||
/*else if (!strcmp(q,"hpf"))*/
|
||||
|
||||
else if ((q[0] == 'h' || q[0] == 'H') && (q[1] == 'p' || q[1] == 'P') && (q[2] == 'f' || q[2] == 'F') && (q[3] == '\0'))
|
||||
HPF_program = 1;
|
||||
/* else if ((q[0] == 'f' || q[0] == 'F') && (q[1] == 'd' || q[1] == 'D') && (q[2] == 'v' || q[2] == 'V') && (q[3] =='\0'))
|
||||
; */
|
||||
/* else if (deb_mpi && ( ((q[0] == 'f' || q[0] == 'F') && q[1] == '\0') || ((q[0] == 'f' || q[0] == 'F') && q[1] == '9' && q[2] == '0' && q[3] == '\0' ) )) */
|
||||
/* else if (deb_mpi && (!strcmp(q,"f") || !strcmp(q,"F") || !strcmp(q,"f90") || !strcmp(q,"F90") ) ) */
|
||||
/* else if (deb_mpi || ftn_std )
|
||||
; */
|
||||
/* else
|
||||
errstr_fatal("Invalid source file %s ", filename, 300);
|
||||
*/
|
||||
|
||||
#if 0 /* OBSOLETE */
|
||||
for (i = strlen(p), q = outname; i; i--)
|
||||
if ((*q++ = *p++) == '.') {
|
||||
dot = 1;
|
||||
break;
|
||||
}
|
||||
#endif /* OBSOLETE */
|
||||
|
||||
r = q;
|
||||
if (yylisting)
|
||||
{
|
||||
*q++ = 'l';
|
||||
*q++ = 's';
|
||||
*q++ = 't';
|
||||
*q = '\0';
|
||||
if ((outf = fopen(outname, "w")) == NULL)
|
||||
errstr_fatal("Can't open file %s for write", outname, 6);
|
||||
}
|
||||
|
||||
if (HPF)
|
||||
{
|
||||
*r++ = 'h';
|
||||
*r++ = 'p';
|
||||
*r++ = 'f';
|
||||
}
|
||||
else
|
||||
{
|
||||
*r++ = 'd';
|
||||
*r++ = 'e';
|
||||
*r++ = 'p';
|
||||
}
|
||||
*r = '\0';
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
SourceFormByName (filename)
|
||||
char *filename;
|
||||
{
|
||||
register int i;
|
||||
char *q;
|
||||
|
||||
for (i = strlen(filename)-1 ; i >= 0 ; i --)
|
||||
{
|
||||
if ( filename[i] == '.' )
|
||||
{
|
||||
q = &(filename[i+1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i<0)
|
||||
return(0); /* fix source form by default */
|
||||
|
||||
else if (!strcmp(q,"f90") || !strcmp(q,"F90") )
|
||||
return(1); /* free source form by default */
|
||||
else
|
||||
return(0); /* fix source form by default */
|
||||
|
||||
}
|
||||
|
||||
|
||||
void add_include_list(dirname)
|
||||
char *dirname;
|
||||
{
|
||||
struct include_dir *in;
|
||||
char *namep = (char *) malloc((unsigned)(strlen(dirname)+1));
|
||||
(void)strcpy(namep, dirname);
|
||||
in = (struct include_dir *) chkalloc(sizeof(struct include_dir));
|
||||
in->next = NULL;
|
||||
in->dir_name = namep;
|
||||
if(!incl_first) {
|
||||
incl_first = in;
|
||||
incl_last = in;
|
||||
}
|
||||
else {
|
||||
incl_last->next = in;
|
||||
incl_last = in;
|
||||
}
|
||||
}
|
||||
|
||||
FILE * open_include_file(name)
|
||||
char *name;
|
||||
{
|
||||
char *whole_name,*p;
|
||||
FILE *fincl;
|
||||
struct include_dir *incld;
|
||||
for(p=name; (*p != '\0'); p++)
|
||||
if(*p == *SLASH_){
|
||||
fincl = fopen(name, "r");
|
||||
return(fincl);
|
||||
}
|
||||
|
||||
for(incld=incl_first; incld; incld=incld->next) {
|
||||
whole_name =(char *) malloc((unsigned)(strlen(incld->dir_name)+strlen(name)+2));
|
||||
strcpy(whole_name,incld->dir_name);
|
||||
strcat(whole_name,SLASH_);
|
||||
strcat(whole_name,name);
|
||||
fincl = fopen(whole_name, "r");
|
||||
if(fincl)
|
||||
return(fincl);
|
||||
}
|
||||
fincl = fopen(name, "r");
|
||||
return(fincl);
|
||||
}
|
||||
|
||||
void FragmentList(char *str)
|
||||
{
|
||||
cur_num:
|
||||
if(!isdigit(*str)) {
|
||||
(void)fprintf (stderr, "Warning 002: invalid option argument %s is ignored\n", str);
|
||||
return;
|
||||
}
|
||||
for(str++; (*str != '\0' && *str != ',' && *str != '-'); str++)
|
||||
if(!isdigit(*str)) {
|
||||
(void)fprintf (stderr, "Warning 002: invalid option argument %s is ignored\n", str);
|
||||
return;
|
||||
}
|
||||
if(*str == '\0')
|
||||
return;
|
||||
str = str+1;
|
||||
goto cur_num;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __SPF_BUILT_IN_PARSER
|
||||
int parse_file(int argc, char* argv[], char* proj_name)
|
||||
#else
|
||||
int main(int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
#ifndef __SPF_BUILT_IN_PARSER
|
||||
char *proj_name = "dvm.proj";
|
||||
#endif
|
||||
FILE *fproj;
|
||||
int k;
|
||||
int fromfile = (argv != 0); /* Flag to see if read from a file */
|
||||
void procinit();
|
||||
char *input_file = NULL;
|
||||
char *debug_file;/*OMP*/
|
||||
char *output_file = NULL;
|
||||
int gendeps();
|
||||
int collect_garbage();
|
||||
int no = 0;
|
||||
int ad = 0;
|
||||
HPF = 0;
|
||||
warn_all = 0;
|
||||
HPF_program = 0;
|
||||
OMP_program = 0; /*OMP*/
|
||||
ACC_program = 0; /*ACC*/
|
||||
SAPFOR = 0; /*SPF*/
|
||||
/* free_form = 0; */
|
||||
source_form_by_option = 0;
|
||||
ftn_std = 0;
|
||||
d_line = 0;
|
||||
deb_mpi = 0;
|
||||
extend_source = 0;
|
||||
nchars_per_line = 72 - 6;
|
||||
#ifdef __SPF
|
||||
int noProject = 0;
|
||||
#endif
|
||||
argv++;
|
||||
|
||||
while ((argc > 1) && (*argv)[0] == '-')
|
||||
{
|
||||
if ((*argv)[1] == 'D')
|
||||
yydebug = 1;
|
||||
else if ((*argv)[1] == 'I')
|
||||
add_include_list((*argv) + 2);
|
||||
else if (!strcmp(argv[0], "-o")) {
|
||||
output_file = argv[1]; no++;
|
||||
argv++;
|
||||
argc--;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-a")) {
|
||||
proj_name = argv[1]; ad++;
|
||||
argv++;
|
||||
argc--;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-d_line"))
|
||||
d_line = 1;
|
||||
else if (!strcmp(argv[0], "-dc"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-dbif1"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-dbif2"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-dnoind"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-dvmLoopAnalysisEC")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-dvmLoopAnalysis")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-dvmPrivateAnalysis")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-dvmIrregAnalysis")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-speedL0")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-speedL1")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-byFunUnparse"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-dmpi"))
|
||||
deb_mpi = 1;
|
||||
else if (!strcmp(argv[0], "-dperf"))
|
||||
dvm_debug = 5;
|
||||
else if (!strcmp(argv[0], "-emp"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-extend_source")) {
|
||||
extend_source = 132;
|
||||
nchars_per_line = extend_source - 6;
|
||||
}
|
||||
else if (((*argv)[1] == 'd') || ((*argv)[1] == 'e')) {
|
||||
if ((*argv)[1] == 'd') {
|
||||
switch ((*argv)[2]) {
|
||||
case '0': dvm_debug = 0; break; /*OMP*/
|
||||
case '1': dvm_debug = 1; break; /*OMP*/
|
||||
case '2': dvm_debug = 2; break; /*OMP*/
|
||||
case '3': dvm_debug = 3; break; /*OMP*/
|
||||
case '4': dvm_debug = 4; break; /*OMP*/
|
||||
/*case '5':*/
|
||||
break;
|
||||
default:
|
||||
goto ERR;
|
||||
}
|
||||
}
|
||||
else if ((*argv)[1] == 'e') { /*OMP*/
|
||||
switch ((*argv)[2]) { /*OMP*/
|
||||
case '0': /*OMP*/
|
||||
case '1': /*OMP*/
|
||||
case '2': /*OMP*/
|
||||
case '3': /*OMP*/
|
||||
case '4': /*OMP*/
|
||||
/*case '5':*/
|
||||
break;/*OMP*/
|
||||
default: /*OMP*/
|
||||
goto ERR; /*OMP*/
|
||||
} /*OMP*/
|
||||
}
|
||||
if ((*argv)[3] == ':')
|
||||
FragmentList(*argv + 4);
|
||||
else if ((*argv)[3] != '\0')
|
||||
goto ERR;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-spf"))
|
||||
SAPFOR = 1;
|
||||
else if (!strcmp(argv[0], "-p"))
|
||||
HPF = 0;
|
||||
else if (!strcmp(argv[0], "-s"))
|
||||
HPF = 0;
|
||||
else if (!strcmp(argv[0], "-v"))
|
||||
v_print = 1;
|
||||
else if (!strcmp(argv[0], "-w"))
|
||||
warn_all = 1;
|
||||
else if (!strcmp(argv[0], "-t8"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-t4"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-r8"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-i8"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-bind0"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-bind1"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-mp")) /*OMP*/
|
||||
OMP_program = 1;
|
||||
else if (!strncmp(argv[0], "-bufio", 6)) {
|
||||
if ((*argv)[6] == '\0' || (!is_integer_value(*argv + 6)))
|
||||
goto ERR;
|
||||
}
|
||||
else if (!strncmp(argv[0], "-bufUnparser", 12)) {
|
||||
if ((*argv)[12] == '\0' || (!is_integer_value(*argv + 12)))
|
||||
goto ERR;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-ioRTS"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-read_all"))
|
||||
;
|
||||
else if (!strncmp(argv[0], "-collapse", 9)) {
|
||||
if ((*argv)[9] == '\0' || (!is_integer_value(*argv + 9)))
|
||||
goto ERR;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-Obase"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-Oloop_range"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-hpf")) {
|
||||
HPF = 1;
|
||||
HPF_VERSION = 2;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-hpf1")) {
|
||||
HPF = 1;
|
||||
HPF_VERSION = 1;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-hpf2")) {
|
||||
HPF = 1;
|
||||
HPF_VERSION = 2;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-f90")) {
|
||||
free_form = 1;
|
||||
source_form_by_option = 1;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-FR")) {
|
||||
free_form = 1;
|
||||
source_form_by_option = 1;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-FI")) {
|
||||
free_form = 0;
|
||||
source_form_by_option = 1;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-ffo"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-upcase"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-noLimitLine"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-noRemote"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-lgstd"))
|
||||
ftn_std = 1;
|
||||
//else if (!strcmp(argv[0],"-ta"))
|
||||
// ACC_program= 1;
|
||||
else if (!strcmp(argv[0], "-noH"))
|
||||
;
|
||||
else if (!strcmp(argv[0], "-C_Cuda")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-FTN_Cuda") || !strcmp(argv[0], "-F_Cuda")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-noCudaType")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-noCuda")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-noPureFunc")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-no_blocks_info")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-noBI")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-cacheIdx")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-Ohost")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-noOhost")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-Opl2")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-Opl")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-oneThread")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-noTfm")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-autoTfm")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-gpuO0")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-gpuO1")) /*ACC*/
|
||||
;
|
||||
else if (!strcmp(argv[0], "-rtc")) /*ACC*/
|
||||
;
|
||||
else if ((*argv)[1] == 'H')
|
||||
{
|
||||
if ((*argv)[2] == 's' && (*argv)[3] == 'h' && (*argv)[4] == 'w')
|
||||
{
|
||||
if (!is_integer_value(*argv + 5))
|
||||
goto ERR;
|
||||
}
|
||||
else if (!strcmp(*argv + 2, "nora"))
|
||||
;
|
||||
else if (!strcmp(*argv + 2, "oneq"))
|
||||
;
|
||||
else if (!strcmp(*argv + 2, "onlyl"))
|
||||
;
|
||||
else
|
||||
goto ERR;
|
||||
}
|
||||
else if (!strcmp(argv[0], "-ver"))
|
||||
{
|
||||
(void)fprintf(stderr, "parser version is \"%s\"\n", VERSION_NUMBER_INT);
|
||||
#ifdef __SPF_BUILT_IN_PARSER
|
||||
return 0;
|
||||
#else
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
#ifdef __SPF
|
||||
else if (!strcmp(argv[0], "-noProject"))
|
||||
noProject = 1;
|
||||
#endif
|
||||
/* else if (!strcmp(argv[0],"-l"))
|
||||
* yylisting = 1;
|
||||
*/
|
||||
else
|
||||
ERR: (void)fprintf(stderr, "Warning 001: unknown option %s is ignored\n", argv[0]);
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
|
||||
retry:
|
||||
if (*argv)
|
||||
{
|
||||
input_file = *argv;
|
||||
if (output_file)
|
||||
gen_out_name(output_file);
|
||||
else
|
||||
gen_out_name(input_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*input_file = "stdin";*/
|
||||
/*(void)fprintf(stderr,"fdvm: Error: no source file specified\n");
|
||||
exit (1);
|
||||
*/
|
||||
err_fatal("no source file specified", 3);
|
||||
}
|
||||
|
||||
if (!source_form_by_option)
|
||||
free_form = SourceFormByName(input_file);
|
||||
|
||||
if (output_file && !strcmp(input_file, output_file))
|
||||
err_fatal("Output file has the same name as source file", 334);
|
||||
|
||||
if (argc > 2) {
|
||||
/*
|
||||
(void)fprintf(stderr,"fdvm: Error: illegal command line format\n");
|
||||
exit (1);
|
||||
*/
|
||||
err_fatal("illegal command line format", 4);
|
||||
}
|
||||
/* if(perf_analysis && dvm_debug)
|
||||
err_fatal("conflicting options -e and -d");
|
||||
*/
|
||||
if (HPF_program && HPF) {
|
||||
(void)fprintf(stderr, "Warning: option -hpf%d is ignored\n", HPF_VERSION);
|
||||
HPF = 0;
|
||||
}
|
||||
if (free_form && extend_source) {
|
||||
(void)fprintf(stderr, "Warning: option -extend_source is ignored\n");
|
||||
extend_source= 0;
|
||||
}
|
||||
language = ForSrc;
|
||||
yylonglines = 1;
|
||||
prflag = 1;
|
||||
cur_file = fi = (PTR_FILE)calloc(1, (unsigned)sizeof(struct file_obj));
|
||||
fi->lang = language;
|
||||
initialize();
|
||||
if ((OMP_program == 1) && (dvm_debug > 0)) {/*OMP*/
|
||||
debug_file = (char *)malloc((unsigned)(strlen(input_file) + 5));/*OMP*/
|
||||
sprintf(debug_file, "dbg_%s", input_file);/*OMP*/
|
||||
PrepareSourceFileForDebug(input_file, debug_file); /*OMP*/
|
||||
make_file_list(input_file);/*OMP*/
|
||||
if (dbginilex(copys(input_file), copys(debug_file))) { /*OMP*/
|
||||
err_fatal("Compiler bug (Error in inilex)", 0); /*OMP*/
|
||||
} /*OMP*/
|
||||
}/*OMP*/ else {
|
||||
make_file_list(input_file);
|
||||
|
||||
if (inilex(copys(*argv ? *argv : ""))) {
|
||||
/* (void)printf("Error in inilex\n");
|
||||
exit(1); */
|
||||
err_fatal("Compiler bug (Error in inilex)", 0);
|
||||
/*goto finish;*/
|
||||
}
|
||||
}/*OMP*/
|
||||
procinit();
|
||||
|
||||
if (v_print) {
|
||||
(void)fprintf(stderr, "***** Fortran DVM %s *****\n", COMPILER_VERSION);
|
||||
(void)fprintf(stderr, "\n<<<<< Parsing %s >>>>>\n", input_file);
|
||||
}
|
||||
/* parsing */
|
||||
if ((k = yyparse())) {
|
||||
/*(void)printf("Bad parse, return code %d\n", k);*/
|
||||
(void)err("Compiler bug", 0);
|
||||
#ifdef __SPF_BUILT_IN_PARSER
|
||||
release_nodes();
|
||||
close_files();
|
||||
return 1;
|
||||
#else
|
||||
exit(1);
|
||||
#endif
|
||||
/*goto finish;*/
|
||||
}
|
||||
if (parstate != OUTSIDE) {
|
||||
infname = input_file;
|
||||
err("Missing final end statement or unclosed construct", 8);
|
||||
(void)fprintf(stderr, "%d error(s)\n", errcnt);
|
||||
#ifdef __SPF_BUILT_IN_PARSER
|
||||
release_nodes();
|
||||
close_files();
|
||||
return 1;
|
||||
#else
|
||||
exit(1);
|
||||
#endif
|
||||
/*goto finish;*/
|
||||
}
|
||||
global_bfnd->filename = head_file; /*podd 18.04.99*/
|
||||
/*global_bfnd->filename = cur_thread_file;*/ /*podd 18.04.99*/
|
||||
if (errcnt) {
|
||||
(void)fprintf(stderr, "%d error(s)\n", errcnt);
|
||||
#ifdef __SPF_BUILT_IN_PARSER
|
||||
release_nodes();
|
||||
close_files();
|
||||
return 1;
|
||||
#else
|
||||
exit(1);
|
||||
#endif
|
||||
if (fromfile) {
|
||||
int ans;
|
||||
|
||||
(void)printf("Do you want to invoke editor? [y/n] ");
|
||||
while ((ans = getchar()) == '\n');
|
||||
if (ans == 'y' || ans == 'Y') {
|
||||
char *edtcmd;
|
||||
char cmd[50];
|
||||
|
||||
edtcmd = getenv("FOREDIT");
|
||||
if (!edtcmd) edtcmd = defeditor;
|
||||
(void)sprintf(cmd, edtcmd, errline, *argv);
|
||||
(void)system(cmd);
|
||||
release_nodes();
|
||||
close_files();
|
||||
goto retry;
|
||||
}
|
||||
#ifdef __SPF_BUILT_IN_PARSER
|
||||
release_nodes();
|
||||
close_files();
|
||||
return 1;
|
||||
#else
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
if (dep) {
|
||||
(void)build_sets(0, global_bfnd,NULL,NULL,1);
|
||||
(void)build_sets(0, global_bfnd,NULL,NULL,2);
|
||||
(void)gendeps(global_bfnd);
|
||||
(void)relink(fi);
|
||||
printf("garbage collecting\n");
|
||||
|
||||
if (garb_collect) (void)collect_garbage(fi);
|
||||
}
|
||||
*/
|
||||
if (yylisting)
|
||||
(void)fprintf(outf, "%s\n", input_file);
|
||||
if (!global_bfnd->thread) /*null program (only global_bfnd is)*/
|
||||
{
|
||||
err_fatal("null program", 7);
|
||||
}
|
||||
|
||||
#ifndef __SPF_BUILT_IN_PARSER
|
||||
if (HPF)
|
||||
{
|
||||
FILE *hpfout;
|
||||
if (no <= 1)
|
||||
output_file = outname;
|
||||
if ((hpfout = fopen(output_file, "w")) == NULL) {
|
||||
/* (void) fprintf(stderr,"Can't open file %s for write\n",output_file);*/
|
||||
/*UnparseFDVMProgram(stdout,cur_file);*/
|
||||
/* exit(1);*/
|
||||
errstr_fatal("Can't open file %s for write", output_file, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (v_print)
|
||||
(void)fprintf(stderr, "\n<<<<< Generating HPF program %s >>>>>\n", output_file);
|
||||
errcnt = UnparseFDVMProgram(hpfout, cur_file);
|
||||
(void)fclose(hpfout);
|
||||
if (errcnt) {
|
||||
(void)fprintf(stderr, "%d error(s)\n", errcnt);
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
if (v_print)
|
||||
(void)fprintf(stderr, "\n***** Done *****\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (HPF)
|
||||
return -1;
|
||||
#endif
|
||||
write_nodes(cur_file, outname);
|
||||
|
||||
#ifdef __SPF
|
||||
if (noProject == 0)
|
||||
#endif
|
||||
{
|
||||
fproj = ad ? fopen(proj_name, "a") : fopen(proj_name, "w");
|
||||
if (fproj == NULL) {
|
||||
/* (void) fprintf(stderr,"Can't open file %s for write\n",proj_name);
|
||||
exit(1); */
|
||||
errstr_fatal("Can't open file %s for write", proj_name, 6);
|
||||
}
|
||||
(void)fprintf(fproj, "%s\n", outname);
|
||||
(void)fclose(fproj);
|
||||
}
|
||||
/* finish:*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void clf(p)
|
||||
FILEP *p;
|
||||
{
|
||||
void fatal();
|
||||
|
||||
if (p && *p && *p != stdout) {
|
||||
if (ferror(*p))
|
||||
fatal("writing error", 329);
|
||||
(void)fclose(*p);
|
||||
}
|
||||
*p = (FILEP)NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
make_file_list(filename)
|
||||
char *filename;
|
||||
{
|
||||
char *namep = (char *) malloc((unsigned)(strlen(filename)+1));
|
||||
PTR_FNAME this = (PTR_FNAME) malloc((unsigned)sizeof(struct file_name));
|
||||
PTR_FNAME p;
|
||||
|
||||
(void)strcpy(namep, filename);
|
||||
this->id = fi->num_files = ++num_files;
|
||||
this->name = namep;
|
||||
this->next = (PTR_FNAME)NULL;
|
||||
if (head_file == (PTR_FNAME)NULL)
|
||||
fi->head_file = head_file = this;
|
||||
else {
|
||||
for (p = head_file; p->next != NULL; p = p->next)
|
||||
;
|
||||
p->next = this;
|
||||
}
|
||||
cur_thread_file = this;
|
||||
}
|
||||
|
||||
void PrepareSourceFileForDebug (input_file, debug_file) /*OMP*/
|
||||
char *input_file; /*OMP*/
|
||||
char *debug_file; /*OMP*/
|
||||
{ /*OMP*/
|
||||
FILE * pFile;
|
||||
long lSize;
|
||||
char sInclude[] = "\r\n include 'dbg_init.h'";
|
||||
/*int count = 0;*/
|
||||
char * buffer;
|
||||
size_t result;
|
||||
pFile = fopen ("dbg_init.h", "r");
|
||||
if (pFile==NULL) {
|
||||
pFile = fopen ("dbg_init.h", "w");
|
||||
fprintf (pFile, " subroutine DBG_Init_Handles ()\n");
|
||||
fprintf (pFile, " include 'dbg_vars.h'\n");
|
||||
fprintf (pFile, " end subroutine DBG_Init_Handles");
|
||||
|
||||
}
|
||||
fclose (pFile);
|
||||
pFile = fopen ("dbg_vars.h", "r");
|
||||
if (pFile==NULL) {
|
||||
pFile = fopen ("dbg_vars.h", "w");
|
||||
fprintf (pFile, " dimension idyn_mp(1)\n");
|
||||
fprintf (pFile, " dimension istat_mp(1)\n");
|
||||
fprintf (pFile, " common /DBG_STAT/ istat_mp\n");
|
||||
fprintf (pFile, " common /DBG_DYN/ idyn_mp\n");
|
||||
fprintf (pFile, "C$OMP THREADPRIVATE (/DBG_DYN/)\n");
|
||||
fprintf (pFile, " common /DBG_THREAD/ ithreadid\n");
|
||||
fprintf (pFile, "C$OMP THREADPRIVATE (/DBG_THREAD/)");
|
||||
}
|
||||
fclose (pFile);
|
||||
pFile = fopen (input_file, "rb" );
|
||||
if (pFile==NULL) {return;}
|
||||
/* obtain file size:*/
|
||||
fseek (pFile , 0 , SEEK_END);
|
||||
lSize = ftell (pFile);
|
||||
rewind (pFile);
|
||||
/* allocate memory to contain the whole file:*/
|
||||
buffer = (char*) malloc (sizeof(char)*(lSize + sizeof(sInclude)));
|
||||
if (buffer == NULL) {fprintf (stderr, "PrepareSourceFileForDebug: not engough memory!\n"); exit (1);}
|
||||
/* copy the file into the buffer:*/
|
||||
result = fread (buffer,1,lSize,pFile);
|
||||
/* the whole file is now loaded in the memory buffer. */
|
||||
fclose (pFile);
|
||||
pFile = fopen (debug_file, "wb" );
|
||||
if (pFile==NULL) {fprintf (stderr, "PrepareSourceFileForDebug: can not open %s file!\n", debug_file); exit (1);}
|
||||
strcpy (buffer+lSize, sInclude);
|
||||
result = fwrite (buffer,1,lSize + sizeof(sInclude),pFile);
|
||||
fclose (pFile);
|
||||
free (buffer);
|
||||
} /*OMP*/
|
||||
|
||||
int DoDebugInclude (char *fname) {/*OMP*/
|
||||
FILE * pFile;
|
||||
long lSize;
|
||||
int count = 0;
|
||||
char * buffer;
|
||||
char * beg = NULL;
|
||||
size_t result;
|
||||
pFile = fopen (fname, "rb" );
|
||||
if (pFile==NULL) {return 0;}
|
||||
/* obtain file size:*/
|
||||
fseek (pFile , 0 , SEEK_END);
|
||||
lSize = ftell (pFile);
|
||||
rewind (pFile);
|
||||
/* allocate memory to contain the whole file:*/
|
||||
buffer = (char*) malloc (sizeof(char)*lSize);
|
||||
if (buffer == NULL) {fprintf (stderr, "DoDebugInclude: not engough memory!\n"); exit (1);}
|
||||
/* copy the file into the buffer:*/
|
||||
result = fread (buffer,1,lSize,pFile);
|
||||
/* the whole file is now loaded in the memory buffer. */
|
||||
fclose (pFile);
|
||||
beg = buffer;
|
||||
while (beg != NULL) {
|
||||
beg = strstr (beg, "call DBG_Get_Handle");
|
||||
if (beg != NULL) {
|
||||
beg++;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
free (buffer);
|
||||
fprintf (stderr, "%d",count);
|
||||
return count;
|
||||
}
|
||||
|
||||
352
dvm/fdvm/trunk/parser/errors.c
Normal file
352
dvm/fdvm/trunk/parser/errors.c
Normal file
@@ -0,0 +1,352 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
/*
|
||||
* errors.c
|
||||
*
|
||||
* Miscellaneous error routines
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "defs.h"
|
||||
#include "symb.h"
|
||||
#include "extern.h"
|
||||
|
||||
#define MAX_PARSER_ERRORS 1000
|
||||
|
||||
static char buff[100];
|
||||
|
||||
#ifdef __SPF_BUILT_IN_PARSER
|
||||
extern void ExitFromParser(const int c);
|
||||
#endif
|
||||
|
||||
void format_num (int num, char num3s[])
|
||||
{
|
||||
if(num>99)
|
||||
sprintf(num3s,"%3d",num);
|
||||
else if(num>9)
|
||||
sprintf(num3s,"0%2d",num);
|
||||
else
|
||||
sprintf(num3s,"00%1d",num);
|
||||
}
|
||||
|
||||
int
|
||||
error_limit()
|
||||
{
|
||||
if (! errcnt)
|
||||
errline = yylineno;
|
||||
if (errcnt++ == MAX_PARSER_ERRORS)
|
||||
(void)fprintf(stderr, "!!! Too many errors !!!\n");
|
||||
|
||||
if (errcnt > MAX_PARSER_ERRORS)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* fatal -- print the fatal error message then exit
|
||||
*
|
||||
* input:
|
||||
* s - the message to be printed out
|
||||
* num - error message number
|
||||
*/
|
||||
void fatal(char* s, int num)
|
||||
{
|
||||
char num3s[4];
|
||||
format_num(num, num3s);
|
||||
(void)fprintf(stderr, "Error %s on line %d of %s: %s\n", num3s, yylineno, infname, s);
|
||||
#ifdef __SPF_BUILT_IN_PARSER
|
||||
ExitFromParser(3);
|
||||
#else
|
||||
exit(3);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* fatalstr -- sets up the error message according to the given format
|
||||
* then call "fatal" to print it out
|
||||
*
|
||||
* input:
|
||||
* t - a string that specifies the output format
|
||||
* s - a string that contents the error messaged to be formatted
|
||||
* num - error message number
|
||||
*/
|
||||
void
|
||||
fatalstr(t, s, num)
|
||||
char *t, *s;
|
||||
int num;
|
||||
{
|
||||
(void)sprintf(buff, t, s);
|
||||
fatal(buff,num);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* fatali -- formats a fatal error message which contains a number
|
||||
* then call "fatal" to print it
|
||||
*
|
||||
* input:
|
||||
* t - a string that specifies the output format
|
||||
* d - an integer to be converted according to t
|
||||
*/
|
||||
void
|
||||
fatali(t, d)
|
||||
char *t;
|
||||
int d;
|
||||
{
|
||||
(void)sprintf(buff, t, d);
|
||||
fatal(buff,0);
|
||||
}
|
||||
|
||||
/*
|
||||
* err_fatal -- print the fatal error message then exit
|
||||
*
|
||||
* input:
|
||||
* s - the message to be printed out
|
||||
*/
|
||||
void err_fatal(char* s, int num)
|
||||
{
|
||||
char num3s[4];
|
||||
format_num(num, num3s);
|
||||
(void)fprintf(stderr, "Error %s: %s\n", num3s, s);
|
||||
#ifdef __SPF_BUILT_IN_PARSER
|
||||
ExitFromParser(3);
|
||||
#else
|
||||
exit(3);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* errstr_fatal -- sets up the error message according to the given format
|
||||
* then call "fatal" to print it out
|
||||
*
|
||||
* input:
|
||||
* t - a string that specifies the output format
|
||||
* s - a string that contents the error messaged to be formatted
|
||||
*/
|
||||
void
|
||||
errstr_fatal(t, s, num)
|
||||
char *t, *s;
|
||||
int num;
|
||||
{
|
||||
(void)sprintf(buff, t, s);
|
||||
err_fatal(buff, num);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* warn1 -- formats a warning message then call "warn" to print it out
|
||||
*
|
||||
* input:
|
||||
* s - string that specifies the conversion format
|
||||
* t - string that to be converted according to s
|
||||
* n - warning message number
|
||||
*/
|
||||
void
|
||||
warn1(s, t, num)
|
||||
char *s, *t;
|
||||
int num;
|
||||
{
|
||||
void warn();
|
||||
|
||||
(void)sprintf(buff, s, t);
|
||||
warn(buff,num);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* warn -- print the warning message if specified
|
||||
*
|
||||
* input:
|
||||
* s - string to be printed
|
||||
* num - warning message number
|
||||
*/
|
||||
void
|
||||
warn(s, num)
|
||||
char *s;
|
||||
int num;
|
||||
{char num3s[4];
|
||||
format_num(num,num3s);
|
||||
if (!nowarnflag) {
|
||||
++nwarn;
|
||||
(void)fprintf(stderr, "Warning %s on line %d of %s: %s\n", num3s,yylineno, infname, s);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* warn_line -- prints the error message and does the bookkeeping
|
||||
*
|
||||
* input:
|
||||
* s - string to be printed out
|
||||
* num - warning message number
|
||||
* ln - string number
|
||||
*/
|
||||
void
|
||||
warn_line(s, num, ln)
|
||||
char *s;
|
||||
int num, ln;
|
||||
{ char num3s[4];
|
||||
format_num(num,num3s);
|
||||
if (!nowarnflag) {
|
||||
++nwarn;
|
||||
(void)fprintf(stderr,"Warning %s on line %d of %s: %s\n", num3s,ln,infname, s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* errstr -- formats the non-fatal error message then call "err" to print it
|
||||
*
|
||||
* input:
|
||||
* s - string that specifies the conversion format
|
||||
* t - string that to be formated according to s
|
||||
* num - error message number
|
||||
*/
|
||||
void
|
||||
errstr(s, t, num)
|
||||
char *s, *t;
|
||||
int num;
|
||||
{
|
||||
void err();
|
||||
(void)sprintf(buff, s, t);
|
||||
err(buff,num);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* erri -- formats an error number then prints it out
|
||||
*
|
||||
* input:
|
||||
* s - string that specifies the output format
|
||||
* t - number to be formatted
|
||||
* num - error message number
|
||||
*/
|
||||
void
|
||||
erri(s, t, num)
|
||||
char *s;
|
||||
int t,num;
|
||||
{
|
||||
void err();
|
||||
|
||||
(void)sprintf(buff, s, t);
|
||||
err(buff,num);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* err -- prints the error message and does the bookkeeping
|
||||
*
|
||||
* input:
|
||||
* s - string to be printed out
|
||||
* num - error message number
|
||||
*/
|
||||
void
|
||||
err(s, num)
|
||||
char *s;
|
||||
int num;
|
||||
{ char num3s[4];
|
||||
format_num(num,num3s);
|
||||
if (error_limit())
|
||||
return;
|
||||
(void)fprintf(stderr,"Error %s on line %d of %s: %s\n", num3s,yylineno,infname, s);
|
||||
}
|
||||
/*
|
||||
* err_line -- prints the error message and does the bookkeeping
|
||||
*
|
||||
* input:
|
||||
* s - string to be printed out
|
||||
* num - error message number
|
||||
* ln - string number
|
||||
*/
|
||||
void
|
||||
err_line(s, num, ln)
|
||||
char *s;
|
||||
int num, ln;
|
||||
{ char num3s[4];
|
||||
format_num(num,num3s);
|
||||
if (error_limit())
|
||||
return;
|
||||
(void)fprintf(stderr,"Error %s on line %d of %s: %s\n", num3s,ln,infname, s);
|
||||
}
|
||||
|
||||
/*
|
||||
* errg -- prints the error message (without line number)
|
||||
*
|
||||
* input:
|
||||
* s - string to be printed out
|
||||
* num - error message number
|
||||
*/
|
||||
void
|
||||
errg(s, num)
|
||||
char *s;
|
||||
int num;
|
||||
{ char num3s[4];
|
||||
format_num(num,num3s);
|
||||
if (error_limit())
|
||||
return;
|
||||
(void)fprintf(stderr,"Error %s: %s\n", num3s, s);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* yyerror -- the error handling routine called by yacc
|
||||
*
|
||||
* input:
|
||||
* s - the error message to be printed
|
||||
*/
|
||||
void
|
||||
yyerror(s)
|
||||
char *s;
|
||||
|
||||
{
|
||||
err(s,14); /* 14 - syntax error */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* dclerr -- prints the error message when find error in declaration part
|
||||
*
|
||||
* input:
|
||||
* s - error message string
|
||||
* v - pointer to the symble table entry
|
||||
*/
|
||||
void
|
||||
dclerr(s, v)
|
||||
char *s;
|
||||
PTR_SYMB v;
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
if (v) {
|
||||
(void)sprintf(buf,"Declaration error for %s: %s",v->ident, s);
|
||||
err(buf,0);
|
||||
} else
|
||||
errstr("Declaration error: %s", s,0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* execerr -- prints error message for executable part
|
||||
*
|
||||
* input:
|
||||
* s - the error message string1
|
||||
* n - the error message string2
|
||||
*/
|
||||
void
|
||||
execerr(s, n)
|
||||
char *s, *n;
|
||||
{
|
||||
char buf1[100], buf2[100];
|
||||
|
||||
/*(void)sprintf(buf1, "Execution error: %s", s);*/
|
||||
(void)sprintf(buf1, "%s", s);
|
||||
(void)sprintf(buf2, buf1, n);
|
||||
err(buf2,0);
|
||||
}
|
||||
|
||||
111
dvm/fdvm/trunk/parser/facc.gram
Normal file
111
dvm/fdvm/trunk/parser/facc.gram
Normal file
@@ -0,0 +1,111 @@
|
||||
acc_directive: acc_region
|
||||
| acc_end_region
|
||||
| acc_checksection
|
||||
| acc_end_checksection
|
||||
| acc_get_actual
|
||||
| acc_actual
|
||||
| acc_routine
|
||||
;
|
||||
|
||||
acc_region: ACC_REGION end_spec opt_clause
|
||||
{ $$ = get_bfnd(fi,ACC_REGION_DIR,SMNULL,$3,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
acc_checksection: ACC_CHECKSECTION end_spec
|
||||
{ $$ = get_bfnd(fi,ACC_CHECKSECTION_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
acc_get_actual: ACC_GET_ACTUAL end_spec LEFTPAR acc_var_list RIGHTPAR
|
||||
{ $$ = get_bfnd(fi,ACC_GET_ACTUAL_DIR,SMNULL,$4,LLNULL,LLNULL);}
|
||||
| ACC_GET_ACTUAL end_spec LEFTPAR RIGHTPAR
|
||||
{ $$ = get_bfnd(fi,ACC_GET_ACTUAL_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
|
||||
| ACC_GET_ACTUAL end_spec
|
||||
{ $$ = get_bfnd(fi,ACC_GET_ACTUAL_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
acc_actual: ACC_ACTUAL end_spec LEFTPAR acc_var_list RIGHTPAR
|
||||
{ $$ = get_bfnd(fi,ACC_ACTUAL_DIR,SMNULL,$4,LLNULL,LLNULL);}
|
||||
| ACC_ACTUAL end_spec LEFTPAR RIGHTPAR
|
||||
{ $$ = get_bfnd(fi,ACC_ACTUAL_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
|
||||
| ACC_ACTUAL end_spec
|
||||
{ $$ = get_bfnd(fi,ACC_ACTUAL_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
opt_clause: needkeyword keywordoff
|
||||
{ $$ = LLNULL;}
|
||||
| acc_clause_list
|
||||
{ $$ = $1; }
|
||||
;
|
||||
|
||||
acc_clause_list: acc_clause
|
||||
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
|
||||
| acc_clause_list COMMA acc_clause
|
||||
{ $$ = set_ll_list($1,$3,EXPR_LIST); }
|
||||
;
|
||||
|
||||
acc_clause: needkeyword data_clause
|
||||
{ $$ = $2;}
|
||||
|
||||
| needkeyword async_clause
|
||||
{ $$ = $2;}
|
||||
|
||||
| needkeyword targets_clause
|
||||
{ $$ = $2;}
|
||||
;
|
||||
|
||||
|
||||
data_clause: INOUT LEFTPAR acc_var_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,ACC_INOUT_OP,$3,LLNULL,SMNULL);}
|
||||
| IN LEFTPAR acc_var_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,ACC_IN_OP,$3,LLNULL,SMNULL);}
|
||||
| OUT LEFTPAR acc_var_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,ACC_OUT_OP,$3,LLNULL,SMNULL);}
|
||||
| ACC_LOCAL LEFTPAR acc_var_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,ACC_LOCAL_OP,$3,LLNULL,SMNULL);}
|
||||
| ACC_INLOCAL LEFTPAR acc_var_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,ACC_INLOCAL_OP,$3,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
targets_clause: ACC_TARGETS LEFTPAR computer_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,ACC_TARGETS_OP,$3,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
async_clause: ACC_ASYNC
|
||||
{ $$ = make_llnd(fi,ACC_ASYNC_OP,LLNULL,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
|
||||
acc_var_list: variable_list
|
||||
{ $$ = $1;}
|
||||
;
|
||||
|
||||
computer_list: computer
|
||||
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
|
||||
| computer_list COMMA computer
|
||||
{ $$ = set_ll_list($1,$3,EXPR_LIST); }
|
||||
;
|
||||
|
||||
computer: needkeyword ACC_HOST
|
||||
{ $$ = make_llnd(fi,ACC_HOST_OP, LLNULL,LLNULL,SMNULL);}
|
||||
| needkeyword ACC_CUDA
|
||||
{ $$ = make_llnd(fi,ACC_CUDA_OP, LLNULL,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
acc_end_region: ACC_END_REGION
|
||||
{ $$ = get_bfnd(fi,ACC_END_REGION_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
acc_end_checksection: ACC_END_CHECKSECTION
|
||||
{ $$ = get_bfnd(fi,ACC_END_CHECKSECTION_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
acc_routine: ACC_ROUTINE in_dcl opt_targets_clause
|
||||
{ $$ = get_bfnd(fi,ACC_ROUTINE_DIR,SMNULL,$3,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
opt_targets_clause: needkeyword keywordoff
|
||||
{ $$ = LLNULL; }
|
||||
| needkeyword targets_clause
|
||||
{ $$ = $2;}
|
||||
;
|
||||
|
||||
2257
dvm/fdvm/trunk/parser/fdvm.gram
Normal file
2257
dvm/fdvm/trunk/parser/fdvm.gram
Normal file
File diff suppressed because it is too large
Load Diff
644
dvm/fdvm/trunk/parser/fomp.gram
Normal file
644
dvm/fdvm/trunk/parser/fomp.gram
Normal file
@@ -0,0 +1,644 @@
|
||||
omp_specification_directive: omp_threadprivate_directive
|
||||
;
|
||||
omp_execution_directive: omp_parallel_begin_directive
|
||||
| omp_parallel_end_directive
|
||||
| omp_sections_begin_directive
|
||||
| omp_sections_end_directive
|
||||
| omp_section_directive
|
||||
| omp_do_begin_directive
|
||||
| omp_do_end_directive
|
||||
| omp_single_begin_directive
|
||||
| omp_single_end_directive
|
||||
| omp_workshare_begin_directive
|
||||
| omp_workshare_end_directive
|
||||
| omp_parallel_do_begin_directive
|
||||
| omp_parallel_do_end_directive
|
||||
| omp_parallel_sections_begin_directive
|
||||
| omp_parallel_sections_end_directive
|
||||
| omp_parallel_workshare_begin_directive
|
||||
| omp_parallel_workshare_end_directive
|
||||
| omp_master_begin_directive
|
||||
| omp_master_end_directive
|
||||
| omp_ordered_begin_directive
|
||||
| omp_ordered_end_directive
|
||||
| omp_barrier_directive
|
||||
| omp_atomic_directive
|
||||
| omp_flush_directive
|
||||
| omp_critical_begin_directive
|
||||
| omp_critical_end_directive
|
||||
;
|
||||
|
||||
ompdvm_onethread: OMPDVM_ONETHREAD end_spec
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_ONETHREAD_DIR,SMNULL,LLNULL,LLNULL,LLNULL);
|
||||
};
|
||||
|
||||
|
||||
omp_parallel_end_directive: OMPDVM_ENDPARALLEL end_spec
|
||||
{
|
||||
$$ = make_endparallel();
|
||||
};
|
||||
|
||||
|
||||
omp_parallel_begin_directive: OMPDVM_PARALLEL end_spec opt_key_word parallel_clause_list
|
||||
{
|
||||
$$ = make_parallel();
|
||||
$$->entry.Template.ll_ptr1 = $4;
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_PARALLEL end_spec opt_key_word
|
||||
{
|
||||
$$ = make_parallel();
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
parallel_clause_list: opt_comma opt_key_word parallel_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($3,LLNULL,EXPR_LIST);
|
||||
}
|
||||
| parallel_clause_list opt_comma opt_key_word parallel_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($1,$4,EXPR_LIST);
|
||||
}
|
||||
;
|
||||
|
||||
parallel_clause: ompprivate_clause
|
||||
| ompreduction_clause
|
||||
| ompshared_clause
|
||||
| ompdefault_clause
|
||||
| ompfirstprivate_clause
|
||||
| omplastprivate_clause
|
||||
| ompcopyin_clause
|
||||
| ompif_clause
|
||||
| ompnumthreads_clause
|
||||
;
|
||||
|
||||
omp_variable_list_in_par: op_slash_1 LEFTPAR op_slash_0 omp_variable_list RIGHTPAR
|
||||
{
|
||||
$$ = $4;
|
||||
};
|
||||
|
||||
ompprivate_clause: PRIVATE omp_variable_list_in_par
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_PRIVATE,$2,LLNULL,SMNULL);
|
||||
};
|
||||
|
||||
ompfirstprivate_clause: OMPDVM_FIRSTPRIVATE omp_variable_list_in_par
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_FIRSTPRIVATE,$2,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
omplastprivate_clause: OMPDVM_LASTPRIVATE omp_variable_list_in_par
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_LASTPRIVATE,$2,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
ompcopyin_clause: OMPDVM_COPYIN omp_variable_list_in_par
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_COPYIN,$2,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
ompshared_clause: OMPDVM_SHARED omp_variable_list_in_par
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_SHARED,$2,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
ompdefault_clause: DEFAULT_CASE LEFTPAR needkeyword def_expr RIGHTPAR
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_DEFAULT,$4,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
def_expr: PRIVATE
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "private";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| OMPDVM_SHARED
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "shared";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| OMPDVM_NONE
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "none";
|
||||
$$->type = global_string;
|
||||
}
|
||||
;
|
||||
ompif_clause: OMPDVM_IF LEFTPAR expr RIGHTPAR
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_IF,$3,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
ompnumthreads_clause: OMPDVM_NUM_THREADS LEFTPAR expr RIGHTPAR
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_NUM_THREADS,$3,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
ompreduction_clause: REDUCTION LEFTPAR ompreduction RIGHTPAR
|
||||
{
|
||||
PTR_LLND q;
|
||||
q = set_ll_list($3,LLNULL,EXPR_LIST);
|
||||
$$ = make_llnd(fi,OMP_REDUCTION,q,LLNULL,SMNULL);
|
||||
};
|
||||
|
||||
ompreduction: opt_key_word ompreduction_op COLON ompreduction_vars
|
||||
{$$ = make_llnd(fi,DDOT,$2,$4,SMNULL);}
|
||||
;
|
||||
|
||||
ompreduction_vars: variable_list;
|
||||
|
||||
ompreduction_op: PLUS
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "+";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| MINUS
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "-";
|
||||
$$->type = global_string;
|
||||
}
|
||||
|
||||
| ASTER
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "*";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| SLASH
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "/";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| MIN
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "min";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| MAX
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "max";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| OR
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) ".or.";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| AND
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) ".and.";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| EQV
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) ".eqv.";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| NEQV
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) ".neqv.";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| IAND
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "iand";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| IEOR
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "ieor";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| IOR
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "ior";
|
||||
$$->type = global_string;
|
||||
}
|
||||
| UNKNOWN
|
||||
{ err("Illegal reduction operation name", 70);
|
||||
errcnt--;
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "unknown";
|
||||
$$->type = global_string;
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
omp_sections_begin_directive: OMPDVM_SECTIONS end_spec opt_key_word sections_clause_list
|
||||
{
|
||||
$$ = make_sections($4);
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_SECTIONS end_spec opt_key_word
|
||||
{
|
||||
$$ = make_sections(LLNULL);
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
sections_clause_list: opt_comma opt_key_word sections_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($3,LLNULL,EXPR_LIST);
|
||||
}
|
||||
| sections_clause_list opt_comma opt_key_word sections_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($1,$4,EXPR_LIST);
|
||||
}
|
||||
;
|
||||
|
||||
sections_clause: ompprivate_clause
|
||||
| ompreduction_clause
|
||||
| ompfirstprivate_clause
|
||||
| omplastprivate_clause
|
||||
;
|
||||
|
||||
omp_sections_end_directive: OMPDVM_ENDSECTIONS end_spec opt_key_word ompnowait_clause
|
||||
{
|
||||
PTR_LLND q;
|
||||
$$ = make_endsections();
|
||||
q = set_ll_list($4,LLNULL,EXPR_LIST);
|
||||
$$->entry.Template.ll_ptr1 = q;
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_ENDSECTIONS end_spec opt_key_word
|
||||
{
|
||||
$$ = make_endsections();
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
omp_section_directive: OMPDVM_SECTION end_spec
|
||||
{
|
||||
$$ = make_ompsection();
|
||||
};
|
||||
|
||||
|
||||
omp_do_begin_directive: OMPDVM_DO end_spec opt_key_word do_clause_list
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_DO_DIR,SMNULL,$4,LLNULL,LLNULL);
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_DO end_spec opt_key_word
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_DO_DIR,SMNULL,LLNULL,LLNULL,LLNULL);
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
omp_do_end_directive: OMPDVM_ENDDO end_spec opt_key_word ompnowait_clause
|
||||
{
|
||||
PTR_LLND q;
|
||||
q = set_ll_list($4,LLNULL,EXPR_LIST);
|
||||
$$ = get_bfnd(fi,OMP_END_DO_DIR,SMNULL,q,LLNULL,LLNULL);
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_ENDDO end_spec opt_key_word
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_END_DO_DIR,SMNULL,LLNULL,LLNULL,LLNULL);
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
do_clause_list: opt_comma opt_key_word do_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($3,LLNULL,EXPR_LIST);
|
||||
}
|
||||
| do_clause_list opt_comma opt_key_word do_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($1,$4,EXPR_LIST);
|
||||
}
|
||||
;
|
||||
|
||||
do_clause: ompprivate_clause
|
||||
| ompreduction_clause
|
||||
| ompfirstprivate_clause
|
||||
| omplastprivate_clause
|
||||
| ompschedule_clause
|
||||
| ompordered_clause
|
||||
;
|
||||
|
||||
ompordered_clause: OMPDVM_ORDERED
|
||||
{
|
||||
/*$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "ORDERED";
|
||||
$$->type = global_string;*/
|
||||
$$ = make_llnd(fi,OMP_ORDERED,LLNULL,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
ompschedule_clause: OMPDVM_SCHEDULE LEFTPAR needkeyword ompschedule_op COMMA expr RIGHTPAR
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_SCHEDULE,$4,$6,SMNULL);
|
||||
}
|
||||
| OMPDVM_SCHEDULE LEFTPAR needkeyword ompschedule_op RIGHTPAR
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_SCHEDULE,$4,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
ompschedule_op: STATIC
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "STATIC";
|
||||
$$->type = global_string;
|
||||
|
||||
}
|
||||
| DYNAMIC
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "DYNAMIC";
|
||||
$$->type = global_string;
|
||||
|
||||
}
|
||||
| OMPDVM_GUIDED
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "GUIDED";
|
||||
$$->type = global_string;
|
||||
|
||||
}
|
||||
| OMPDVM_RUNTIME
|
||||
{
|
||||
$$ = make_llnd(fi,KEYWORD_VAL,LLNULL,LLNULL,SMNULL);
|
||||
$$->entry.string_val = (char *) "RUNTIME";
|
||||
$$->type = global_string;
|
||||
|
||||
}
|
||||
;
|
||||
|
||||
omp_single_begin_directive: OMPDVM_SINGLE end_spec opt_key_word single_clause_list
|
||||
{
|
||||
$$ = make_single();
|
||||
$$->entry.Template.ll_ptr1 = $4;
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_SINGLE end_spec opt_key_word
|
||||
{
|
||||
$$ = make_single();
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
single_clause_list: opt_comma opt_key_word single_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($3,LLNULL,EXPR_LIST);
|
||||
}
|
||||
| single_clause_list opt_comma opt_key_word single_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($1,$4,EXPR_LIST);
|
||||
}
|
||||
;
|
||||
|
||||
single_clause: ompprivate_clause
|
||||
| ompfirstprivate_clause
|
||||
;
|
||||
|
||||
omp_single_end_directive: OMPDVM_ENDSINGLE end_spec opt_key_word end_single_clause_list
|
||||
{
|
||||
$$ = make_endsingle();
|
||||
$$->entry.Template.ll_ptr1 = $4;
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_ENDSINGLE end_spec opt_key_word
|
||||
{
|
||||
$$ = make_endsingle();
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
end_single_clause_list: opt_comma opt_key_word end_single_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($3,LLNULL,EXPR_LIST);
|
||||
}
|
||||
| end_single_clause_list opt_comma opt_key_word end_single_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($1,$4,EXPR_LIST);
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
end_single_clause: ompnowait_clause
|
||||
| ompcopyprivate_clause
|
||||
;
|
||||
|
||||
ompcopyprivate_clause: OMPDVM_COPYPRIVATE omp_variable_list_in_par
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_COPYPRIVATE,$2,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
ompnowait_clause: OMPDVM_NOWAIT
|
||||
{
|
||||
$$ = make_llnd(fi,OMP_NOWAIT,LLNULL,LLNULL,SMNULL);
|
||||
}
|
||||
;
|
||||
|
||||
omp_workshare_begin_directive: OMPDVM_WORKSHARE end_spec
|
||||
{
|
||||
$$ = make_workshare();
|
||||
};
|
||||
|
||||
omp_workshare_end_directive: OMPDVM_ENDWORKSHARE end_spec opt_key_word ompnowait_clause
|
||||
{
|
||||
PTR_LLND q;
|
||||
$$ = make_endworkshare();
|
||||
q = set_ll_list($4,LLNULL,EXPR_LIST);
|
||||
$$->entry.Template.ll_ptr1 = q;
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_ENDWORKSHARE end_spec opt_key_word
|
||||
{
|
||||
$$ = make_endworkshare();
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
omp_parallel_do_begin_directive: OMPDVM_PARALLELDO end_spec opt_key_word paralleldo_clause_list
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_PARALLEL_DO_DIR,SMNULL,$4,LLNULL,LLNULL);
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_PARALLELDO end_spec opt_key_word
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_PARALLEL_DO_DIR,SMNULL,LLNULL,LLNULL,LLNULL);
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
;
|
||||
|
||||
paralleldo_clause_list: opt_comma opt_key_word paralleldo_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($3,LLNULL,EXPR_LIST);
|
||||
}
|
||||
| paralleldo_clause_list opt_comma opt_key_word paralleldo_clause opt_key_word
|
||||
{
|
||||
$$ = set_ll_list($1,$4,EXPR_LIST);
|
||||
}
|
||||
;
|
||||
|
||||
paralleldo_clause: ompprivate_clause
|
||||
| ompreduction_clause
|
||||
| ompshared_clause
|
||||
| ompdefault_clause
|
||||
| ompfirstprivate_clause
|
||||
| omplastprivate_clause
|
||||
| ompcopyin_clause
|
||||
| ompif_clause
|
||||
| ompnumthreads_clause
|
||||
| ompschedule_clause
|
||||
| ompordered_clause
|
||||
;
|
||||
|
||||
|
||||
omp_parallel_do_end_directive: OMPDVM_ENDPARALLELDO end_spec
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_END_PARALLEL_DO_DIR,SMNULL,LLNULL,LLNULL,LLNULL);
|
||||
};
|
||||
|
||||
omp_parallel_sections_begin_directive: OMPDVM_PARALLELSECTIONS end_spec opt_key_word parallel_clause_list
|
||||
{
|
||||
$$ = make_parallelsections($4);
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_PARALLELSECTIONS end_spec opt_key_word
|
||||
{
|
||||
$$ = make_parallelsections(LLNULL);
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
|
||||
omp_parallel_sections_end_directive: OMPDVM_ENDPARALLELSECTIONS end_spec
|
||||
{
|
||||
$$ = make_endparallelsections();
|
||||
};
|
||||
|
||||
omp_parallel_workshare_begin_directive: OMPDVM_PARALLELWORKSHARE end_spec opt_key_word parallel_clause_list
|
||||
{
|
||||
$$ = make_parallelworkshare();
|
||||
$$->entry.Template.ll_ptr1 = $4;
|
||||
opt_kwd_ = NO;
|
||||
}
|
||||
| OMPDVM_PARALLELWORKSHARE end_spec opt_key_word
|
||||
{
|
||||
$$ = make_parallelworkshare();
|
||||
opt_kwd_ = NO;
|
||||
};
|
||||
|
||||
omp_parallel_workshare_end_directive: OMPDVM_ENDPARALLELWORKSHARE end_spec
|
||||
{
|
||||
$$ = make_endparallelworkshare();
|
||||
};
|
||||
|
||||
omp_threadprivate_directive: OMPDVM_THREADPRIVATE in_dcl omp_variable_list_in_par
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_THREADPRIVATE_DIR, SMNULL, $3, LLNULL, LLNULL);
|
||||
};
|
||||
|
||||
omp_master_begin_directive: OMPDVM_MASTER end_spec
|
||||
{
|
||||
$$ = make_master();
|
||||
};
|
||||
|
||||
omp_master_end_directive: OMPDVM_ENDMASTER end_spec
|
||||
{
|
||||
$$ = make_endmaster();
|
||||
};
|
||||
omp_ordered_begin_directive: OMPDVM_ORDERED end_spec
|
||||
{
|
||||
$$ = make_ordered();
|
||||
};
|
||||
|
||||
omp_ordered_end_directive: OMPDVM_ENDORDERED end_spec
|
||||
{
|
||||
$$ = make_endordered();
|
||||
};
|
||||
|
||||
omp_barrier_directive: OMPDVM_BARRIER end_spec
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_BARRIER_DIR,SMNULL,LLNULL,LLNULL,LLNULL);
|
||||
};
|
||||
omp_atomic_directive: OMPDVM_ATOMIC end_spec
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_ATOMIC_DIR,SMNULL,LLNULL,LLNULL,LLNULL);
|
||||
};
|
||||
|
||||
omp_flush_directive: OMPDVM_FLUSH end_spec omp_variable_list_in_par
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_FLUSH_DIR,SMNULL,$3,LLNULL,LLNULL);
|
||||
}
|
||||
| OMPDVM_FLUSH end_spec
|
||||
{
|
||||
$$ = get_bfnd(fi,OMP_FLUSH_DIR,SMNULL,LLNULL,LLNULL,LLNULL);
|
||||
}
|
||||
;
|
||||
|
||||
omp_critical_begin_directive: OMPDVM_CRITICAL end_spec LEFTPAR ident RIGHTPAR
|
||||
{
|
||||
$$ = make_critical();
|
||||
$$->entry.Template.ll_ptr1 = $4;
|
||||
}
|
||||
| OMPDVM_CRITICAL end_spec
|
||||
{
|
||||
$$ = make_critical();
|
||||
}
|
||||
;
|
||||
|
||||
omp_critical_end_directive: OMPDVM_ENDCRITICAL end_spec LEFTPAR ident RIGHTPAR
|
||||
{
|
||||
$$ = make_endcritical();
|
||||
$$->entry.Template.ll_ptr1 = $4;
|
||||
}
|
||||
| OMPDVM_ENDCRITICAL end_spec
|
||||
{
|
||||
$$ = make_endcritical();
|
||||
}
|
||||
;
|
||||
|
||||
omp_common_var: SLASH name op_slash_1 SLASH op_slash_0
|
||||
{
|
||||
PTR_SYMB s;
|
||||
PTR_LLND l;
|
||||
s = make_common($2);
|
||||
l = make_llnd(fi,VAR_REF, LLNULL, LLNULL, s);
|
||||
$$ = make_llnd(fi,OMP_THREADPRIVATE, l, LLNULL, SMNULL);
|
||||
};
|
||||
|
||||
|
||||
omp_variable_list: omp_common_var
|
||||
{
|
||||
$$ = set_ll_list($1,LLNULL,EXPR_LIST);
|
||||
}
|
||||
| ident
|
||||
{
|
||||
$$ = set_ll_list($1,LLNULL,EXPR_LIST);
|
||||
}
|
||||
| omp_variable_list COMMA omp_common_var
|
||||
{
|
||||
$$ = set_ll_list($1,$3,EXPR_LIST);
|
||||
}
|
||||
| omp_variable_list COMMA ident
|
||||
{
|
||||
$$ = set_ll_list($1,$3,EXPR_LIST);
|
||||
}
|
||||
;
|
||||
|
||||
op_slash_1 : {
|
||||
operator_slash = 1;
|
||||
};
|
||||
op_slash_0 : {
|
||||
operator_slash = 0;
|
||||
};
|
||||
|
||||
194
dvm/fdvm/trunk/parser/fspf.gram
Normal file
194
dvm/fdvm/trunk/parser/fspf.gram
Normal file
@@ -0,0 +1,194 @@
|
||||
spf_directive: spf_analysis
|
||||
| spf_parallel
|
||||
| spf_transform
|
||||
| spf_parallel_reg
|
||||
| spf_end_parallel_reg
|
||||
| spf_checkpoint
|
||||
;
|
||||
|
||||
spf_analysis: SPF_ANALYSIS in_unit LEFTPAR analysis_spec_list RIGHTPAR
|
||||
{ $$ = get_bfnd(fi,SPF_ANALYSIS_DIR,SMNULL,$4,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
spf_parallel: SPF_PARALLEL in_unit LEFTPAR parallel_spec_list RIGHTPAR
|
||||
{ $$ = get_bfnd(fi,SPF_PARALLEL_DIR,SMNULL,$4,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
spf_transform: SPF_TRANSFORM in_unit LEFTPAR transform_spec_list RIGHTPAR
|
||||
{ $$ = get_bfnd(fi,SPF_TRANSFORM_DIR,SMNULL,$4,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
spf_parallel_reg: SPF_PARALLEL_REG in_unit region_name
|
||||
{ $$ = get_bfnd(fi,SPF_PARALLEL_REG_DIR,$3,LLNULL,LLNULL,LLNULL);}
|
||||
| SPF_PARALLEL_REG in_unit region_name COMMA needkeyword SPF_APPLY_REGION LEFTPAR characteristic_list RIGHTPAR opt_clause_apply_fragment
|
||||
{ $$ = get_bfnd(fi,SPF_PARALLEL_REG_DIR,$3,$8,$10,LLNULL);}
|
||||
| SPF_PARALLEL_REG in_unit region_name COMMA needkeyword SPF_APPLY_FRAGMENT LEFTPAR characteristic_list RIGHTPAR opt_clause_apply_region
|
||||
{ $$ = get_bfnd(fi,SPF_PARALLEL_REG_DIR,$3,$10,$8,LLNULL);}
|
||||
;
|
||||
|
||||
characteristic_list: characteristic
|
||||
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
|
||||
| characteristic_list COMMA characteristic
|
||||
{ $$ = set_ll_list($1,$3,EXPR_LIST); }
|
||||
;
|
||||
|
||||
characteristic: needkeyword SPF_CODE_COVERAGE
|
||||
{ $$ = make_llnd(fi,SPF_CODE_COVERAGE_OP,LLNULL,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
opt_clause_apply_fragment:
|
||||
{ $$ = LLNULL;}
|
||||
| COMMA needkeyword SPF_APPLY_FRAGMENT LEFTPAR characteristic_list RIGHTPAR
|
||||
{ $$ = $5;}
|
||||
;
|
||||
|
||||
opt_clause_apply_region:
|
||||
{ $$ = LLNULL;}
|
||||
| COMMA needkeyword SPF_APPLY_REGION LEFTPAR characteristic_list RIGHTPAR
|
||||
{ $$ = $5;}
|
||||
;
|
||||
|
||||
spf_end_parallel_reg: SPF_END_PARALLEL_REG in_unit
|
||||
{ $$ = get_bfnd(fi,SPF_END_PARALLEL_REG_DIR,SMNULL,LLNULL,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
analysis_spec_list: analysis_spec
|
||||
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
|
||||
| analysis_spec_list COMMA analysis_spec
|
||||
{ $$ = set_ll_list($1,$3,EXPR_LIST); }
|
||||
;
|
||||
|
||||
analysis_spec: analysis_reduction_spec
|
||||
| analysis_private_spec
|
||||
| analysis_parameter_spec
|
||||
;
|
||||
|
||||
analysis_reduction_spec: needkeyword REDUCTION LEFTPAR reduction_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,REDUCTION_OP,$4,LLNULL,SMNULL); }
|
||||
;
|
||||
|
||||
analysis_private_spec: needkeyword PRIVATE LEFTPAR variable_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,ACC_PRIVATE_OP,$4,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
analysis_parameter_spec: needkeyword PARAMETER LEFTPAR spf_parameter_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_PARAMETER_OP,$4,LLNULL,SMNULL);}
|
||||
;
|
||||
spf_parameter_list: spf_parameter
|
||||
{ $$ = set_ll_list($1, LLNULL, EXPR_LIST); }
|
||||
| spf_parameter_list COMMA spf_parameter
|
||||
{ $$ = set_ll_list($1, $3, EXPR_LIST); }
|
||||
;
|
||||
|
||||
spf_parameter: array_element EQUAL expr
|
||||
{ $$ = make_llnd(fi, ASSGN_OP, $1, $3, SMNULL); }
|
||||
;
|
||||
|
||||
parallel_spec_list: parallel_spec
|
||||
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
|
||||
| parallel_spec_list COMMA parallel_spec
|
||||
{ $$ = set_ll_list($1,$3,EXPR_LIST); }
|
||||
;
|
||||
|
||||
parallel_spec: parallel_shadow_spec
|
||||
| parallel_across_spec
|
||||
| parallel_remote_access_spec
|
||||
;
|
||||
|
||||
parallel_shadow_spec: needkeyword SHADOW LEFTPAR shadow_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SHADOW_OP,$4,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
parallel_across_spec: needkeyword ACROSS LEFTPAR shadow_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,ACROSS_OP,$4,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
parallel_remote_access_spec: needkeyword REMOTE_ACCESS_SPEC LEFTPAR remote_data_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,REMOTE_ACCESS_OP,$4,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
transform_spec_list: transform_spec
|
||||
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
|
||||
| transform_spec_list COMMA transform_spec
|
||||
{ $$ = set_ll_list($1,$3,EXPR_LIST); }
|
||||
;
|
||||
|
||||
transform_spec: needkeyword SPF_NOINLINE
|
||||
{ $$ = make_llnd(fi,SPF_NOINLINE_OP,LLNULL,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_FISSION LEFTPAR ident_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_FISSION_OP,$4,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_EXPAND
|
||||
{ $$ = make_llnd(fi,SPF_EXPAND_OP,LLNULL,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_EXPAND LEFTPAR ident_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_EXPAND_OP,$4,LLNULL,SMNULL);}
|
||||
/* | needkeyword SPF_SHRINK LEFTPAR ident LEFTPAR digit_list RIGHTPAR RIGHTPAR */
|
||||
| needkeyword SPF_SHRINK LEFTPAR array_element_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_SHRINK_OP,$4,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_UNROLL
|
||||
{ $$ = make_llnd(fi,SPF_UNROLL_OP,LLNULL,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_UNROLL LEFTPAR unroll_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_UNROLL_OP,$4,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
unroll_list: expr COMMA expr COMMA expr
|
||||
{
|
||||
$$ = set_ll_list($1, $3, EXPR_LIST);
|
||||
$$ = set_ll_list($$, $5, EXPR_LIST);
|
||||
}
|
||||
;
|
||||
|
||||
region_name: name
|
||||
{ $$ = make_parallel_region($1);}
|
||||
;
|
||||
|
||||
array_element_list: array_element
|
||||
{ $$ = set_ll_list($1, LLNULL, EXPR_LIST); }
|
||||
| array_element_list COMMA array_element
|
||||
{ $$ = set_ll_list($1, $3, EXPR_LIST); }
|
||||
;
|
||||
|
||||
spf_checkpoint: SPF_CHECKPOINT in_unit LEFTPAR checkpoint_spec_list RIGHTPAR
|
||||
{ $$ = get_bfnd(fi,SPF_CHECKPOINT_DIR,SMNULL,$4,LLNULL,LLNULL);}
|
||||
;
|
||||
|
||||
checkpoint_spec_list: checkpoint_spec
|
||||
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
|
||||
| checkpoint_spec_list COMMA checkpoint_spec
|
||||
{ $$ = set_ll_list($1,$3,EXPR_LIST); }
|
||||
;
|
||||
|
||||
checkpoint_spec: needkeyword TYPE LEFTPAR spf_type_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_TYPE_OP,$4,LLNULL,SMNULL);}
|
||||
| needkeyword VARLIST LEFTPAR ident_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_VARLIST_OP,$4,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_EXCEPT LEFTPAR ident_list RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_EXCEPT_OP,$4,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_FILES_COUNT LEFTPAR expr RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_FILES_COUNT_OP,$4,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_INTERVAL LEFTPAR interval_spec COMMA expr RIGHTPAR
|
||||
{ $$ = make_llnd(fi,SPF_INTERVAL_OP,$4,$6,SMNULL);}
|
||||
;
|
||||
|
||||
spf_type_list: spf_type
|
||||
{ $$ = set_ll_list($1,LLNULL,EXPR_LIST); }
|
||||
| spf_type_list COMMA spf_type
|
||||
{ $$ = set_ll_list($1,$3,EXPR_LIST); }
|
||||
;
|
||||
|
||||
spf_type: needkeyword ACC_ASYNC
|
||||
{ $$ = make_llnd(fi,ACC_ASYNC_OP, LLNULL,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_FLEXIBLE
|
||||
{ $$ = make_llnd(fi,SPF_FLEXIBLE_OP, LLNULL,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
interval_spec: needkeyword SPF_TIME
|
||||
{ $$ = make_llnd(fi,SPF_TIME_OP, LLNULL,LLNULL,SMNULL);}
|
||||
| needkeyword SPF_ITER
|
||||
{ $$ = make_llnd(fi,SPF_ITER_OP, LLNULL,LLNULL,SMNULL);}
|
||||
;
|
||||
|
||||
in_unit:
|
||||
{ if(position==IN_OUTSIDE)
|
||||
err("Misplaced SPF-directive",103);
|
||||
}
|
||||
;
|
||||
4589
dvm/fdvm/trunk/parser/ftn.gram
Normal file
4589
dvm/fdvm/trunk/parser/ftn.gram
Normal file
File diff suppressed because it is too large
Load Diff
14332
dvm/fdvm/trunk/parser/gram1.tab.c
Normal file
14332
dvm/fdvm/trunk/parser/gram1.tab.c
Normal file
File diff suppressed because it is too large
Load Diff
780
dvm/fdvm/trunk/parser/gram1.tab.h
Normal file
780
dvm/fdvm/trunk/parser/gram1.tab.h
Normal file
@@ -0,0 +1,780 @@
|
||||
/* A Bison parser, made by GNU Bison 2.3. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
PERCENT = 1,
|
||||
AMPERSAND = 2,
|
||||
ASTER = 3,
|
||||
CLUSTER = 4,
|
||||
COLON = 5,
|
||||
COMMA = 6,
|
||||
DASTER = 7,
|
||||
DEFINED_OPERATOR = 8,
|
||||
DOT = 9,
|
||||
DQUOTE = 10,
|
||||
GLOBAL_A = 11,
|
||||
LEFTAB = 12,
|
||||
LEFTPAR = 13,
|
||||
MINUS = 14,
|
||||
PLUS = 15,
|
||||
POINT_TO = 16,
|
||||
QUOTE = 17,
|
||||
RIGHTAB = 18,
|
||||
RIGHTPAR = 19,
|
||||
AND = 20,
|
||||
DSLASH = 21,
|
||||
EQV = 22,
|
||||
EQ = 23,
|
||||
EQUAL = 24,
|
||||
FFALSE = 25,
|
||||
GE = 26,
|
||||
GT = 27,
|
||||
LE = 28,
|
||||
LT = 29,
|
||||
NE = 30,
|
||||
NEQV = 31,
|
||||
NOT = 32,
|
||||
OR = 33,
|
||||
TTRUE = 34,
|
||||
SLASH = 35,
|
||||
XOR = 36,
|
||||
REFERENCE = 37,
|
||||
AT = 38,
|
||||
ACROSS = 39,
|
||||
ALIGN_WITH = 40,
|
||||
ALIGN = 41,
|
||||
ALLOCATABLE = 42,
|
||||
ALLOCATE = 43,
|
||||
ARITHIF = 44,
|
||||
ASSIGNMENT = 45,
|
||||
ASSIGN = 46,
|
||||
ASSIGNGOTO = 47,
|
||||
ASYNCHRONOUS = 48,
|
||||
ASYNCID = 49,
|
||||
ASYNCWAIT = 50,
|
||||
BACKSPACE = 51,
|
||||
BAD_CCONST = 52,
|
||||
BAD_SYMBOL = 53,
|
||||
BARRIER = 54,
|
||||
BLOCKDATA = 55,
|
||||
BLOCK = 56,
|
||||
BOZ_CONSTANT = 57,
|
||||
BYTE = 58,
|
||||
CALL = 59,
|
||||
CASE = 60,
|
||||
CHARACTER = 61,
|
||||
CHAR_CONSTANT = 62,
|
||||
CHECK = 63,
|
||||
CLOSE = 64,
|
||||
COMMON = 65,
|
||||
COMPLEX = 66,
|
||||
COMPGOTO = 67,
|
||||
CONSISTENT_GROUP = 68,
|
||||
CONSISTENT_SPEC = 69,
|
||||
CONSISTENT_START = 70,
|
||||
CONSISTENT_WAIT = 71,
|
||||
CONSISTENT = 72,
|
||||
CONSTRUCT_ID = 73,
|
||||
CONTAINS = 74,
|
||||
CONTINUE = 75,
|
||||
CORNER = 76,
|
||||
CYCLE = 77,
|
||||
DATA = 78,
|
||||
DEALLOCATE = 79,
|
||||
HPF_TEMPLATE = 80,
|
||||
DEBUG = 81,
|
||||
DEFAULT_CASE = 82,
|
||||
DEFINE = 83,
|
||||
DERIVED = 84,
|
||||
DIMENSION = 85,
|
||||
DISTRIBUTE = 86,
|
||||
DOWHILE = 87,
|
||||
DOUBLEPRECISION = 88,
|
||||
DOUBLECOMPLEX = 89,
|
||||
DP_CONSTANT = 90,
|
||||
DVM_POINTER = 91,
|
||||
DYNAMIC = 92,
|
||||
ELEMENTAL = 93,
|
||||
ELSE = 94,
|
||||
ELSEIF = 95,
|
||||
ELSEWHERE = 96,
|
||||
ENDASYNCHRONOUS = 97,
|
||||
ENDDEBUG = 98,
|
||||
ENDINTERVAL = 99,
|
||||
ENDUNIT = 100,
|
||||
ENDDO = 101,
|
||||
ENDFILE = 102,
|
||||
ENDFORALL = 103,
|
||||
ENDIF = 104,
|
||||
ENDINTERFACE = 105,
|
||||
ENDMODULE = 106,
|
||||
ENDON = 107,
|
||||
ENDSELECT = 108,
|
||||
ENDTASK_REGION = 109,
|
||||
ENDTYPE = 110,
|
||||
ENDWHERE = 111,
|
||||
ENTRY = 112,
|
||||
EXIT = 113,
|
||||
EOLN = 114,
|
||||
EQUIVALENCE = 115,
|
||||
ERROR = 116,
|
||||
EXTERNAL = 117,
|
||||
F90 = 118,
|
||||
FIND = 119,
|
||||
FORALL = 120,
|
||||
FORMAT = 121,
|
||||
FUNCTION = 122,
|
||||
GATE = 123,
|
||||
GEN_BLOCK = 124,
|
||||
HEAP = 125,
|
||||
HIGH = 126,
|
||||
IDENTIFIER = 127,
|
||||
IMPLICIT = 128,
|
||||
IMPLICITNONE = 129,
|
||||
INCLUDE_TO = 130,
|
||||
INCLUDE = 131,
|
||||
INDEPENDENT = 132,
|
||||
INDIRECT_ACCESS = 133,
|
||||
INDIRECT_GROUP = 134,
|
||||
INDIRECT = 135,
|
||||
INHERIT = 136,
|
||||
INQUIRE = 137,
|
||||
INTERFACEASSIGNMENT = 138,
|
||||
INTERFACEOPERATOR = 139,
|
||||
INTERFACE = 140,
|
||||
INTRINSIC = 141,
|
||||
INTEGER = 142,
|
||||
INTENT = 143,
|
||||
INTERVAL = 144,
|
||||
INOUT = 145,
|
||||
IN = 146,
|
||||
INT_CONSTANT = 147,
|
||||
LABEL = 148,
|
||||
LABEL_DECLARE = 149,
|
||||
LET = 150,
|
||||
LOCALIZE = 151,
|
||||
LOGICAL = 152,
|
||||
LOGICALIF = 153,
|
||||
LOOP = 154,
|
||||
LOW = 155,
|
||||
MAXLOC = 156,
|
||||
MAX = 157,
|
||||
MAP = 158,
|
||||
MINLOC = 159,
|
||||
MIN = 160,
|
||||
MODULE_PROCEDURE = 161,
|
||||
MODULE = 162,
|
||||
MULT_BLOCK = 163,
|
||||
NAMEEQ = 164,
|
||||
NAMELIST = 165,
|
||||
NEW_VALUE = 166,
|
||||
NEW = 167,
|
||||
NULLIFY = 168,
|
||||
OCTAL_CONSTANT = 169,
|
||||
ONLY = 170,
|
||||
ON = 171,
|
||||
ON_DIR = 172,
|
||||
ONTO = 173,
|
||||
OPEN = 174,
|
||||
OPERATOR = 175,
|
||||
OPTIONAL = 176,
|
||||
OTHERWISE = 177,
|
||||
OUT = 178,
|
||||
OWN = 179,
|
||||
PARALLEL = 180,
|
||||
PARAMETER = 181,
|
||||
PAUSE = 182,
|
||||
PLAINDO = 183,
|
||||
PLAINGOTO = 184,
|
||||
POINTER = 185,
|
||||
POINTERLET = 186,
|
||||
PREFETCH = 187,
|
||||
PRINT = 188,
|
||||
PRIVATE = 189,
|
||||
PRODUCT = 190,
|
||||
PROGRAM = 191,
|
||||
PUBLIC = 192,
|
||||
PURE = 193,
|
||||
RANGE = 194,
|
||||
READ = 195,
|
||||
REALIGN_WITH = 196,
|
||||
REALIGN = 197,
|
||||
REAL = 198,
|
||||
REAL_CONSTANT = 199,
|
||||
RECURSIVE = 200,
|
||||
REDISTRIBUTE_NEW = 201,
|
||||
REDISTRIBUTE = 202,
|
||||
REDUCTION_GROUP = 203,
|
||||
REDUCTION_START = 204,
|
||||
REDUCTION_WAIT = 205,
|
||||
REDUCTION = 206,
|
||||
REMOTE_ACCESS_SPEC = 207,
|
||||
REMOTE_ACCESS = 208,
|
||||
REMOTE_GROUP = 209,
|
||||
RESET = 210,
|
||||
RESULT = 211,
|
||||
RETURN = 212,
|
||||
REWIND = 213,
|
||||
SAVE = 214,
|
||||
SECTION = 215,
|
||||
SELECT = 216,
|
||||
SEQUENCE = 217,
|
||||
SHADOW_ADD = 218,
|
||||
SHADOW_COMPUTE = 219,
|
||||
SHADOW_GROUP = 220,
|
||||
SHADOW_RENEW = 221,
|
||||
SHADOW_START_SPEC = 222,
|
||||
SHADOW_START = 223,
|
||||
SHADOW_WAIT_SPEC = 224,
|
||||
SHADOW_WAIT = 225,
|
||||
SHADOW = 226,
|
||||
STAGE = 227,
|
||||
STATIC = 228,
|
||||
STAT = 229,
|
||||
STOP = 230,
|
||||
SUBROUTINE = 231,
|
||||
SUM = 232,
|
||||
SYNC = 233,
|
||||
TARGET = 234,
|
||||
TASK = 235,
|
||||
TASK_REGION = 236,
|
||||
THEN = 237,
|
||||
TO = 238,
|
||||
TRACEON = 239,
|
||||
TRACEOFF = 240,
|
||||
TRUNC = 241,
|
||||
TYPE = 242,
|
||||
TYPE_DECL = 243,
|
||||
UNDER = 244,
|
||||
UNKNOWN = 245,
|
||||
USE = 246,
|
||||
VIRTUAL = 247,
|
||||
VARIABLE = 248,
|
||||
WAIT = 249,
|
||||
WHERE = 250,
|
||||
WHERE_ASSIGN = 251,
|
||||
WHILE = 252,
|
||||
WITH = 253,
|
||||
WRITE = 254,
|
||||
COMMENT = 255,
|
||||
WGT_BLOCK = 256,
|
||||
HPF_PROCESSORS = 257,
|
||||
IOSTAT = 258,
|
||||
ERR = 259,
|
||||
END = 260,
|
||||
OMPDVM_ATOMIC = 261,
|
||||
OMPDVM_BARRIER = 262,
|
||||
OMPDVM_COPYIN = 263,
|
||||
OMPDVM_COPYPRIVATE = 264,
|
||||
OMPDVM_CRITICAL = 265,
|
||||
OMPDVM_ONETHREAD = 266,
|
||||
OMPDVM_DO = 267,
|
||||
OMPDVM_DYNAMIC = 268,
|
||||
OMPDVM_ENDCRITICAL = 269,
|
||||
OMPDVM_ENDDO = 270,
|
||||
OMPDVM_ENDMASTER = 271,
|
||||
OMPDVM_ENDORDERED = 272,
|
||||
OMPDVM_ENDPARALLEL = 273,
|
||||
OMPDVM_ENDPARALLELDO = 274,
|
||||
OMPDVM_ENDPARALLELSECTIONS = 275,
|
||||
OMPDVM_ENDPARALLELWORKSHARE = 276,
|
||||
OMPDVM_ENDSECTIONS = 277,
|
||||
OMPDVM_ENDSINGLE = 278,
|
||||
OMPDVM_ENDWORKSHARE = 279,
|
||||
OMPDVM_FIRSTPRIVATE = 280,
|
||||
OMPDVM_FLUSH = 281,
|
||||
OMPDVM_GUIDED = 282,
|
||||
OMPDVM_LASTPRIVATE = 283,
|
||||
OMPDVM_MASTER = 284,
|
||||
OMPDVM_NOWAIT = 285,
|
||||
OMPDVM_NONE = 286,
|
||||
OMPDVM_NUM_THREADS = 287,
|
||||
OMPDVM_ORDERED = 288,
|
||||
OMPDVM_PARALLEL = 289,
|
||||
OMPDVM_PARALLELDO = 290,
|
||||
OMPDVM_PARALLELSECTIONS = 291,
|
||||
OMPDVM_PARALLELWORKSHARE = 292,
|
||||
OMPDVM_RUNTIME = 293,
|
||||
OMPDVM_SECTION = 294,
|
||||
OMPDVM_SECTIONS = 295,
|
||||
OMPDVM_SCHEDULE = 296,
|
||||
OMPDVM_SHARED = 297,
|
||||
OMPDVM_SINGLE = 298,
|
||||
OMPDVM_THREADPRIVATE = 299,
|
||||
OMPDVM_WORKSHARE = 300,
|
||||
OMPDVM_NODES = 301,
|
||||
OMPDVM_IF = 302,
|
||||
IAND = 303,
|
||||
IEOR = 304,
|
||||
IOR = 305,
|
||||
ACC_REGION = 306,
|
||||
ACC_END_REGION = 307,
|
||||
ACC_CHECKSECTION = 308,
|
||||
ACC_END_CHECKSECTION = 309,
|
||||
ACC_GET_ACTUAL = 310,
|
||||
ACC_ACTUAL = 311,
|
||||
ACC_TARGETS = 312,
|
||||
ACC_ASYNC = 313,
|
||||
ACC_HOST = 314,
|
||||
ACC_CUDA = 315,
|
||||
ACC_LOCAL = 316,
|
||||
ACC_INLOCAL = 317,
|
||||
ACC_CUDA_BLOCK = 318,
|
||||
ACC_ROUTINE = 319,
|
||||
ACC_TIE = 320,
|
||||
BY = 321,
|
||||
IO_MODE = 322,
|
||||
CP_CREATE = 323,
|
||||
CP_LOAD = 324,
|
||||
CP_SAVE = 325,
|
||||
CP_WAIT = 326,
|
||||
FILES = 327,
|
||||
VARLIST = 328,
|
||||
STATUS = 329,
|
||||
EXITINTERVAL = 330,
|
||||
TEMPLATE_CREATE = 331,
|
||||
TEMPLATE_DELETE = 332,
|
||||
SPF_ANALYSIS = 333,
|
||||
SPF_PARALLEL = 334,
|
||||
SPF_TRANSFORM = 335,
|
||||
SPF_NOINLINE = 336,
|
||||
SPF_PARALLEL_REG = 337,
|
||||
SPF_END_PARALLEL_REG = 338,
|
||||
SPF_EXPAND = 339,
|
||||
SPF_FISSION = 340,
|
||||
SPF_SHRINK = 341,
|
||||
SPF_CHECKPOINT = 342,
|
||||
SPF_EXCEPT = 343,
|
||||
SPF_FILES_COUNT = 344,
|
||||
SPF_INTERVAL = 345,
|
||||
SPF_TIME = 346,
|
||||
SPF_ITER = 347,
|
||||
SPF_FLEXIBLE = 348,
|
||||
SPF_APPLY_REGION = 349,
|
||||
SPF_APPLY_FRAGMENT = 350,
|
||||
SPF_CODE_COVERAGE = 351,
|
||||
SPF_UNROLL = 352,
|
||||
BINARY_OP = 355,
|
||||
UNARY_OP = 356
|
||||
};
|
||||
#endif
|
||||
/* Tokens. */
|
||||
#define PERCENT 1
|
||||
#define AMPERSAND 2
|
||||
#define ASTER 3
|
||||
#define CLUSTER 4
|
||||
#define COLON 5
|
||||
#define COMMA 6
|
||||
#define DASTER 7
|
||||
#define DEFINED_OPERATOR 8
|
||||
#define DOT 9
|
||||
#define DQUOTE 10
|
||||
#define GLOBAL_A 11
|
||||
#define LEFTAB 12
|
||||
#define LEFTPAR 13
|
||||
#define MINUS 14
|
||||
#define PLUS 15
|
||||
#define POINT_TO 16
|
||||
#define QUOTE 17
|
||||
#define RIGHTAB 18
|
||||
#define RIGHTPAR 19
|
||||
#define AND 20
|
||||
#define DSLASH 21
|
||||
#define EQV 22
|
||||
#define EQ 23
|
||||
#define EQUAL 24
|
||||
#define FFALSE 25
|
||||
#define GE 26
|
||||
#define GT 27
|
||||
#define LE 28
|
||||
#define LT 29
|
||||
#define NE 30
|
||||
#define NEQV 31
|
||||
#define NOT 32
|
||||
#define OR 33
|
||||
#define TTRUE 34
|
||||
#define SLASH 35
|
||||
#define XOR 36
|
||||
#define REFERENCE 37
|
||||
#define AT 38
|
||||
#define ACROSS 39
|
||||
#define ALIGN_WITH 40
|
||||
#define ALIGN 41
|
||||
#define ALLOCATABLE 42
|
||||
#define ALLOCATE 43
|
||||
#define ARITHIF 44
|
||||
#define ASSIGNMENT 45
|
||||
#define ASSIGN 46
|
||||
#define ASSIGNGOTO 47
|
||||
#define ASYNCHRONOUS 48
|
||||
#define ASYNCID 49
|
||||
#define ASYNCWAIT 50
|
||||
#define BACKSPACE 51
|
||||
#define BAD_CCONST 52
|
||||
#define BAD_SYMBOL 53
|
||||
#define BARRIER 54
|
||||
#define BLOCKDATA 55
|
||||
#define BLOCK 56
|
||||
#define BOZ_CONSTANT 57
|
||||
#define BYTE 58
|
||||
#define CALL 59
|
||||
#define CASE 60
|
||||
#define CHARACTER 61
|
||||
#define CHAR_CONSTANT 62
|
||||
#define CHECK 63
|
||||
#define CLOSE 64
|
||||
#define COMMON 65
|
||||
#define COMPLEX 66
|
||||
#define COMPGOTO 67
|
||||
#define CONSISTENT_GROUP 68
|
||||
#define CONSISTENT_SPEC 69
|
||||
#define CONSISTENT_START 70
|
||||
#define CONSISTENT_WAIT 71
|
||||
#define CONSISTENT 72
|
||||
#define CONSTRUCT_ID 73
|
||||
#define CONTAINS 74
|
||||
#define CONTINUE 75
|
||||
#define CORNER 76
|
||||
#define CYCLE 77
|
||||
#define DATA 78
|
||||
#define DEALLOCATE 79
|
||||
#define HPF_TEMPLATE 80
|
||||
#define DEBUG 81
|
||||
#define DEFAULT_CASE 82
|
||||
#define DEFINE 83
|
||||
#define DERIVED 84
|
||||
#define DIMENSION 85
|
||||
#define DISTRIBUTE 86
|
||||
#define DOWHILE 87
|
||||
#define DOUBLEPRECISION 88
|
||||
#define DOUBLECOMPLEX 89
|
||||
#define DP_CONSTANT 90
|
||||
#define DVM_POINTER 91
|
||||
#define DYNAMIC 92
|
||||
#define ELEMENTAL 93
|
||||
#define ELSE 94
|
||||
#define ELSEIF 95
|
||||
#define ELSEWHERE 96
|
||||
#define ENDASYNCHRONOUS 97
|
||||
#define ENDDEBUG 98
|
||||
#define ENDINTERVAL 99
|
||||
#define ENDUNIT 100
|
||||
#define ENDDO 101
|
||||
#define ENDFILE 102
|
||||
#define ENDFORALL 103
|
||||
#define ENDIF 104
|
||||
#define ENDINTERFACE 105
|
||||
#define ENDMODULE 106
|
||||
#define ENDON 107
|
||||
#define ENDSELECT 108
|
||||
#define ENDTASK_REGION 109
|
||||
#define ENDTYPE 110
|
||||
#define ENDWHERE 111
|
||||
#define ENTRY 112
|
||||
#define EXIT 113
|
||||
#define EOLN 114
|
||||
#define EQUIVALENCE 115
|
||||
#define ERROR 116
|
||||
#define EXTERNAL 117
|
||||
#define F90 118
|
||||
#define FIND 119
|
||||
#define FORALL 120
|
||||
#define FORMAT 121
|
||||
#define FUNCTION 122
|
||||
#define GATE 123
|
||||
#define GEN_BLOCK 124
|
||||
#define HEAP 125
|
||||
#define HIGH 126
|
||||
#define IDENTIFIER 127
|
||||
#define IMPLICIT 128
|
||||
#define IMPLICITNONE 129
|
||||
#define INCLUDE_TO 130
|
||||
#define INCLUDE 131
|
||||
#define INDEPENDENT 132
|
||||
#define INDIRECT_ACCESS 133
|
||||
#define INDIRECT_GROUP 134
|
||||
#define INDIRECT 135
|
||||
#define INHERIT 136
|
||||
#define INQUIRE 137
|
||||
#define INTERFACEASSIGNMENT 138
|
||||
#define INTERFACEOPERATOR 139
|
||||
#define INTERFACE 140
|
||||
#define INTRINSIC 141
|
||||
#define INTEGER 142
|
||||
#define INTENT 143
|
||||
#define INTERVAL 144
|
||||
#define INOUT 145
|
||||
#define IN 146
|
||||
#define INT_CONSTANT 147
|
||||
#define LABEL 148
|
||||
#define LABEL_DECLARE 149
|
||||
#define LET 150
|
||||
#define LOCALIZE 151
|
||||
#define LOGICAL 152
|
||||
#define LOGICALIF 153
|
||||
#define LOOP 154
|
||||
#define LOW 155
|
||||
#define MAXLOC 156
|
||||
#define MAX 157
|
||||
#define MAP 158
|
||||
#define MINLOC 159
|
||||
#define MIN 160
|
||||
#define MODULE_PROCEDURE 161
|
||||
#define MODULE 162
|
||||
#define MULT_BLOCK 163
|
||||
#define NAMEEQ 164
|
||||
#define NAMELIST 165
|
||||
#define NEW_VALUE 166
|
||||
#define NEW 167
|
||||
#define NULLIFY 168
|
||||
#define OCTAL_CONSTANT 169
|
||||
#define ONLY 170
|
||||
#define ON 171
|
||||
#define ON_DIR 172
|
||||
#define ONTO 173
|
||||
#define OPEN 174
|
||||
#define OPERATOR 175
|
||||
#define OPTIONAL 176
|
||||
#define OTHERWISE 177
|
||||
#define OUT 178
|
||||
#define OWN 179
|
||||
#define PARALLEL 180
|
||||
#define PARAMETER 181
|
||||
#define PAUSE 182
|
||||
#define PLAINDO 183
|
||||
#define PLAINGOTO 184
|
||||
#define POINTER 185
|
||||
#define POINTERLET 186
|
||||
#define PREFETCH 187
|
||||
#define PRINT 188
|
||||
#define PRIVATE 189
|
||||
#define PRODUCT 190
|
||||
#define PROGRAM 191
|
||||
#define PUBLIC 192
|
||||
#define PURE 193
|
||||
#define RANGE 194
|
||||
#define READ 195
|
||||
#define REALIGN_WITH 196
|
||||
#define REALIGN 197
|
||||
#define REAL 198
|
||||
#define REAL_CONSTANT 199
|
||||
#define RECURSIVE 200
|
||||
#define REDISTRIBUTE_NEW 201
|
||||
#define REDISTRIBUTE 202
|
||||
#define REDUCTION_GROUP 203
|
||||
#define REDUCTION_START 204
|
||||
#define REDUCTION_WAIT 205
|
||||
#define REDUCTION 206
|
||||
#define REMOTE_ACCESS_SPEC 207
|
||||
#define REMOTE_ACCESS 208
|
||||
#define REMOTE_GROUP 209
|
||||
#define RESET 210
|
||||
#define RESULT 211
|
||||
#define RETURN 212
|
||||
#define REWIND 213
|
||||
#define SAVE 214
|
||||
#define SECTION 215
|
||||
#define SELECT 216
|
||||
#define SEQUENCE 217
|
||||
#define SHADOW_ADD 218
|
||||
#define SHADOW_COMPUTE 219
|
||||
#define SHADOW_GROUP 220
|
||||
#define SHADOW_RENEW 221
|
||||
#define SHADOW_START_SPEC 222
|
||||
#define SHADOW_START 223
|
||||
#define SHADOW_WAIT_SPEC 224
|
||||
#define SHADOW_WAIT 225
|
||||
#define SHADOW 226
|
||||
#define STAGE 227
|
||||
#define STATIC 228
|
||||
#define STAT 229
|
||||
#define STOP 230
|
||||
#define SUBROUTINE 231
|
||||
#define SUM 232
|
||||
#define SYNC 233
|
||||
#define TARGET 234
|
||||
#define TASK 235
|
||||
#define TASK_REGION 236
|
||||
#define THEN 237
|
||||
#define TO 238
|
||||
#define TRACEON 239
|
||||
#define TRACEOFF 240
|
||||
#define TRUNC 241
|
||||
#define TYPE 242
|
||||
#define TYPE_DECL 243
|
||||
#define UNDER 244
|
||||
#define UNKNOWN 245
|
||||
#define USE 246
|
||||
#define VIRTUAL 247
|
||||
#define VARIABLE 248
|
||||
#define WAIT 249
|
||||
#define WHERE 250
|
||||
#define WHERE_ASSIGN 251
|
||||
#define WHILE 252
|
||||
#define WITH 253
|
||||
#define WRITE 254
|
||||
#define COMMENT 255
|
||||
#define WGT_BLOCK 256
|
||||
#define HPF_PROCESSORS 257
|
||||
#define IOSTAT 258
|
||||
#define ERR 259
|
||||
#define END 260
|
||||
#define OMPDVM_ATOMIC 261
|
||||
#define OMPDVM_BARRIER 262
|
||||
#define OMPDVM_COPYIN 263
|
||||
#define OMPDVM_COPYPRIVATE 264
|
||||
#define OMPDVM_CRITICAL 265
|
||||
#define OMPDVM_ONETHREAD 266
|
||||
#define OMPDVM_DO 267
|
||||
#define OMPDVM_DYNAMIC 268
|
||||
#define OMPDVM_ENDCRITICAL 269
|
||||
#define OMPDVM_ENDDO 270
|
||||
#define OMPDVM_ENDMASTER 271
|
||||
#define OMPDVM_ENDORDERED 272
|
||||
#define OMPDVM_ENDPARALLEL 273
|
||||
#define OMPDVM_ENDPARALLELDO 274
|
||||
#define OMPDVM_ENDPARALLELSECTIONS 275
|
||||
#define OMPDVM_ENDPARALLELWORKSHARE 276
|
||||
#define OMPDVM_ENDSECTIONS 277
|
||||
#define OMPDVM_ENDSINGLE 278
|
||||
#define OMPDVM_ENDWORKSHARE 279
|
||||
#define OMPDVM_FIRSTPRIVATE 280
|
||||
#define OMPDVM_FLUSH 281
|
||||
#define OMPDVM_GUIDED 282
|
||||
#define OMPDVM_LASTPRIVATE 283
|
||||
#define OMPDVM_MASTER 284
|
||||
#define OMPDVM_NOWAIT 285
|
||||
#define OMPDVM_NONE 286
|
||||
#define OMPDVM_NUM_THREADS 287
|
||||
#define OMPDVM_ORDERED 288
|
||||
#define OMPDVM_PARALLEL 289
|
||||
#define OMPDVM_PARALLELDO 290
|
||||
#define OMPDVM_PARALLELSECTIONS 291
|
||||
#define OMPDVM_PARALLELWORKSHARE 292
|
||||
#define OMPDVM_RUNTIME 293
|
||||
#define OMPDVM_SECTION 294
|
||||
#define OMPDVM_SECTIONS 295
|
||||
#define OMPDVM_SCHEDULE 296
|
||||
#define OMPDVM_SHARED 297
|
||||
#define OMPDVM_SINGLE 298
|
||||
#define OMPDVM_THREADPRIVATE 299
|
||||
#define OMPDVM_WORKSHARE 300
|
||||
#define OMPDVM_NODES 301
|
||||
#define OMPDVM_IF 302
|
||||
#define IAND 303
|
||||
#define IEOR 304
|
||||
#define IOR 305
|
||||
#define ACC_REGION 306
|
||||
#define ACC_END_REGION 307
|
||||
#define ACC_CHECKSECTION 308
|
||||
#define ACC_END_CHECKSECTION 309
|
||||
#define ACC_GET_ACTUAL 310
|
||||
#define ACC_ACTUAL 311
|
||||
#define ACC_TARGETS 312
|
||||
#define ACC_ASYNC 313
|
||||
#define ACC_HOST 314
|
||||
#define ACC_CUDA 315
|
||||
#define ACC_LOCAL 316
|
||||
#define ACC_INLOCAL 317
|
||||
#define ACC_CUDA_BLOCK 318
|
||||
#define ACC_ROUTINE 319
|
||||
#define ACC_TIE 320
|
||||
#define BY 321
|
||||
#define IO_MODE 322
|
||||
#define CP_CREATE 323
|
||||
#define CP_LOAD 324
|
||||
#define CP_SAVE 325
|
||||
#define CP_WAIT 326
|
||||
#define FILES 327
|
||||
#define VARLIST 328
|
||||
#define STATUS 329
|
||||
#define EXITINTERVAL 330
|
||||
#define TEMPLATE_CREATE 331
|
||||
#define TEMPLATE_DELETE 332
|
||||
#define SPF_ANALYSIS 333
|
||||
#define SPF_PARALLEL 334
|
||||
#define SPF_TRANSFORM 335
|
||||
#define SPF_NOINLINE 336
|
||||
#define SPF_PARALLEL_REG 337
|
||||
#define SPF_END_PARALLEL_REG 338
|
||||
#define SPF_EXPAND 339
|
||||
#define SPF_FISSION 340
|
||||
#define SPF_SHRINK 341
|
||||
#define SPF_CHECKPOINT 342
|
||||
#define SPF_EXCEPT 343
|
||||
#define SPF_FILES_COUNT 344
|
||||
#define SPF_INTERVAL 345
|
||||
#define SPF_TIME 346
|
||||
#define SPF_ITER 347
|
||||
#define SPF_FLEXIBLE 348
|
||||
#define SPF_APPLY_REGION 349
|
||||
#define SPF_APPLY_FRAGMENT 350
|
||||
#define SPF_CODE_COVERAGE 351
|
||||
#define SPF_UNROLL 352
|
||||
#define BINARY_OP 355
|
||||
#define UNARY_OP 356
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
#line 435 "gram1.y"
|
||||
{
|
||||
int token;
|
||||
char charv;
|
||||
char *charp;
|
||||
PTR_BFND bf_node;
|
||||
PTR_LLND ll_node;
|
||||
PTR_SYMB symbol;
|
||||
PTR_TYPE data_type;
|
||||
PTR_HASH hash_entry;
|
||||
PTR_LABEL label;
|
||||
}
|
||||
/* Line 1489 of yacc.c. */
|
||||
#line 773 "gram1.tab.h"
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
8147
dvm/fdvm/trunk/parser/gram1.y
Normal file
8147
dvm/fdvm/trunk/parser/gram1.y
Normal file
File diff suppressed because it is too large
Load Diff
284
dvm/fdvm/trunk/parser/hash.c
Normal file
284
dvm/fdvm/trunk/parser/hash.c
Normal file
@@ -0,0 +1,284 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
/*
|
||||
* hash.c -- hash table routines
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "compatible.h"
|
||||
#ifdef SYS5
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "defs.h"
|
||||
#include "symb.h"
|
||||
#include "defines.h"
|
||||
#include "bif.h"
|
||||
#include "extern.h"
|
||||
|
||||
extern int parstate;
|
||||
extern PTR_BFND cur_bfnd, pred_bfnd, global_bfnd;
|
||||
extern PTR_TYPE vartype, global_default, impltype[];
|
||||
extern void make_prog_header();
|
||||
PTR_TYPE install_array();
|
||||
PTR_LLND make_llnd();
|
||||
PTR_SYMB make_symb();
|
||||
char *chkalloc();
|
||||
void free();
|
||||
void errstr();
|
||||
|
||||
PTR_HASH hash_table[hashMax];
|
||||
|
||||
|
||||
/*
|
||||
* init_hash -- initialize the hash table
|
||||
*/
|
||||
void
|
||||
init_hash()
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < hashMax; i++)
|
||||
hash_table[i] = HSNULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Hash(string) -- compute hash value of string.
|
||||
*/
|
||||
int
|
||||
hash(string)
|
||||
register char *string;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; *string;)
|
||||
i += *string++;
|
||||
return (i % hashMax);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* look_up(string) -- lookup string in the hash table and
|
||||
* install it if not there
|
||||
*/
|
||||
PTR_HASH
|
||||
look_up(string, decl_type)
|
||||
register char *string;
|
||||
int decl_type;
|
||||
{
|
||||
int i;
|
||||
register PTR_HASH entry;
|
||||
PTR_BFND cur_scope(), p;
|
||||
|
||||
i = hash(string);
|
||||
p = cur_scope();
|
||||
for (entry = hash_table[i]; entry; entry = entry->next_entry) {
|
||||
if (!strcmp(string, entry->ident) && (entry->id_attr)) {
|
||||
if ((entry->id_attr->scope == p) ||
|
||||
((entry->id_attr->variant==FUNCTION_NAME) &&
|
||||
(p->variant==FUNC_HEDR) &&
|
||||
(p->entry.Template.symbol==entry->id_attr)))
|
||||
return (entry);
|
||||
if (decl_type == SOFT) {
|
||||
for (p=cur_scope(); NEW_SCOPE(p); p = p->control_parent) {
|
||||
if (entry->id_attr->scope == p)
|
||||
return (entry);
|
||||
}
|
||||
if (entry->id_attr->scope == p)
|
||||
return (entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
entry = (struct hash_entry *) chkalloc(sizeof(struct hash_entry));
|
||||
entry->ident = copys(string);
|
||||
entry->next_entry = hash_table[i];
|
||||
hash_table[i] = entry;
|
||||
return (entry);
|
||||
}
|
||||
|
||||
|
||||
PTR_HASH
|
||||
correct_symtab(h, type)
|
||||
PTR_HASH h;
|
||||
int type;
|
||||
{
|
||||
int i;
|
||||
PTR_HASH entry;
|
||||
|
||||
i = hash(h->ident);
|
||||
for (entry = hash_table[i]; entry; entry = entry->next_entry) {
|
||||
if (!strcmp(h->ident, entry->ident)
|
||||
&& ( !(entry->id_attr)
|
||||
||(entry->id_attr->variant==type))
|
||||
&& (h != entry))
|
||||
break;
|
||||
}
|
||||
if (!entry) return h;
|
||||
if (hash_table[i] != h) {
|
||||
fprintf (stderr, "Bug in correct_symtab\n");
|
||||
return h;
|
||||
}
|
||||
hash_table[i] = hash_table[i]->next_entry;
|
||||
#ifdef __SPF
|
||||
removeFromCollection(h);
|
||||
#endif
|
||||
free((char *)h);
|
||||
return hash_table[i];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Checks whether the "name" is installed and installs as a SOFT
|
||||
* entry if not.
|
||||
*/
|
||||
PTR_LLND
|
||||
check_and_install(h, d, ndim)
|
||||
PTR_HASH h;
|
||||
PTR_LLND d;
|
||||
int ndim;
|
||||
{
|
||||
PTR_BFND cur_scope();
|
||||
PTR_SYMB install_entry();
|
||||
PTR_TYPE p = NULL;
|
||||
PTR_SYMB s;
|
||||
PTR_LLND r;
|
||||
void set_type(), err();
|
||||
|
||||
/* Check if the variable is already declared */
|
||||
if ((s = h->id_attr) && (s->scope == cur_scope()) && s->type) {
|
||||
if (d && s->type->variant != T_ARRAY) {
|
||||
p = install_array(d, s->type, ndim);
|
||||
s->type = p;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (h->id_attr && h->id_attr->type)
|
||||
p = h->id_attr->type;
|
||||
else if (!undeftype)
|
||||
p = impltype[*h->ident - 'a'];
|
||||
else
|
||||
err("Variable type unknown",327);
|
||||
if (d)
|
||||
p = install_array(d, p, ndim);
|
||||
s = install_entry(h, SOFT);
|
||||
set_type(s, p, LOCAL);
|
||||
}
|
||||
if (d) {
|
||||
r = p->entry.ar_decl.ranges
|
||||
= make_llnd(fi,ARRAY_REF, d, LLNULL, s);
|
||||
}
|
||||
else
|
||||
r = make_llnd(fi,VAR_REF, LLNULL, LLNULL, s);
|
||||
return make_llnd(fi,EXPR_LIST, r, LLNULL, SMNULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* install_entry takes a pointer to a hash entry and
|
||||
* makes another symbol table entry for the same id
|
||||
*/
|
||||
PTR_SYMB
|
||||
install_entry(entry, decl_type)
|
||||
PTR_HASH entry;
|
||||
int decl_type;
|
||||
{
|
||||
register PTR_SYMB symb_ptr;
|
||||
PTR_BFND cur_scope();
|
||||
PTR_BFND p;
|
||||
void err();
|
||||
|
||||
if (decl_type == HARD && entry->id_attr &&
|
||||
entry->id_attr->scope != cur_scope())
|
||||
entry = look_up(entry->ident, HARD);
|
||||
if ((entry->id_attr) && ((entry->id_attr->scope == cur_scope()) ||
|
||||
((entry->id_attr->variant==FUNCTION_NAME) &&
|
||||
(entry->id_attr->scope->variant==FUNC_HEDR))))
|
||||
{
|
||||
if (entry->id_attr->decl == SOFT) {
|
||||
entry->id_attr->decl = decl_type;
|
||||
return(entry->id_attr);
|
||||
}
|
||||
if (decl_type == SOFT)
|
||||
return(entry->id_attr);
|
||||
/* else */
|
||||
errstr("Redeclaration of identifier: %s",entry->id_attr->ident,328);
|
||||
/*(void)fprintf(stderr, "id: %s\n", entry->id_attr->ident);*/
|
||||
return (SMNULL);
|
||||
}
|
||||
symb_ptr = make_symb(fi,DEFAULT, entry->ident);
|
||||
for (p=cur_scope();
|
||||
NEW_SCOPE(p) && (decl_type==SOFT);
|
||||
p = p->control_parent)
|
||||
;
|
||||
symb_ptr->scope = p;
|
||||
symb_ptr->outer = entry->id_attr;
|
||||
symb_ptr->parent = entry;
|
||||
symb_ptr->decl = decl_type;
|
||||
entry->id_attr = symb_ptr;
|
||||
symb_ptr->id_list = SMNULL;
|
||||
return (symb_ptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
PTR_SYMB
|
||||
get_proc_symbol(entry)
|
||||
PTR_HASH entry;
|
||||
{
|
||||
register PTR_SYMB symb_ptr;
|
||||
PTR_BFND cur_scope();
|
||||
|
||||
symb_ptr = make_symb(fi, PROCEDURE_NAME, entry->ident);
|
||||
symb_ptr->scope = global_bfnd;
|
||||
symb_ptr->outer = entry->id_attr;
|
||||
symb_ptr->parent = entry;
|
||||
entry->id_attr = symb_ptr;
|
||||
return (symb_ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
PTR_BFND
|
||||
cur_scope()
|
||||
{
|
||||
register PTR_BFND p;
|
||||
*/
|
||||
/* Takes cares of main program unit begining without a PROGRAM
|
||||
statement. After rewrite of statement processing has been done,
|
||||
strengthen ( weaken? ) the test.
|
||||
*/
|
||||
/*
|
||||
if ((pred_bfnd->variant == GLOBAL) && (parstate == OUTSIDE))
|
||||
{
|
||||
make_prog_header();
|
||||
return (pred_bfnd);
|
||||
}
|
||||
|
||||
for (p = pred_bfnd;
|
||||
(p->variant != PROG_HEDR) &&
|
||||
(p->variant != PROC_HEDR) &&
|
||||
(p->variant != PROS_HEDR) &&
|
||||
(p->variant != FUNC_HEDR) &&
|
||||
(p->variant != BLOCK_DATA) &&
|
||||
(p->variant != FORALL_NODE) &&
|
||||
(p->variant != GLOBAL) &&
|
||||
(p->variant != CDOALL_NODE) &&
|
||||
(p->variant != SDOALL_NODE) &&
|
||||
(p->variant != DOACROSS_NODE) &&
|
||||
(p->variant != STRUCT_DECL);
|
||||
p = p->control_parent);
|
||||
;
|
||||
|
||||
return (p);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
2
dvm/fdvm/trunk/parser/head
Normal file
2
dvm/fdvm/trunk/parser/head
Normal file
@@ -0,0 +1,2 @@
|
||||
/* don't modify this file directly, it is made by a clever 'sed'
|
||||
script using "tag". Run make tag.h to regenerate this file */
|
||||
281
dvm/fdvm/trunk/parser/init.c
Normal file
281
dvm/fdvm/trunk/parser/init.c
Normal file
@@ -0,0 +1,281 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
#include "inc.h"
|
||||
#include "defines.h"
|
||||
#include "db.h"
|
||||
|
||||
extern int yylineno;
|
||||
extern PTR_FILE fi;
|
||||
|
||||
|
||||
/* In the following "set" means set the value to YES, or 1 */
|
||||
#ifndef __SPF_BUILT_IN_PARSER
|
||||
int debug;
|
||||
#endif
|
||||
int errline; /* line number of 1st error */
|
||||
int inioctl; /* set if processing I/O control stmt */
|
||||
int needkwd; /* set if stmt needs keyword */
|
||||
int optkwd; /* set if stmt needs optional keyword */
|
||||
int implkwd; /* set if processing IMPLICIT statement */
|
||||
/*!!!*/
|
||||
int opt_kwd_; /* set if stmt needs optional keyword (fdvm.gram)*/
|
||||
int opt_in_out; /* set if stmt needs keyword IN or OUT*/
|
||||
int as_op_kwd_; /* set if stmt needs keyword ASSIGNMENT or OPERATOR */
|
||||
int opt_kwd_hedr; /* set if stmt needs after type specification */
|
||||
int opt_kwd_r; /* set if stmt needs optional keyword followed by '(' (fdvm.gram)*/
|
||||
int optcorner; /* set if stmt needs optional keyword CORNER(fdvm.gram)*/
|
||||
int optcall; /* set if stmt needs optional "call" */
|
||||
int opt_l_s; /* set if stmt needs optional "location"
|
||||
or "submachine" */
|
||||
int colon_flag; /* set if stmt needs keyword followed by
|
||||
colon. */
|
||||
int is_openmp_stmt = 0; /* set if OpenMP stmt*/ /*OMP*/
|
||||
int operator_slash; /*OMP*/
|
||||
|
||||
int nioctl;
|
||||
int data_stat;
|
||||
extern int yydebug;
|
||||
long yystno = 0;
|
||||
int yyleng ;
|
||||
char yyquote ;
|
||||
int yylisting = 0; /* set if listing to stdio required */
|
||||
int yylonglines = 0; /* set if non-standard line length allowed */
|
||||
int prflag;
|
||||
int dorange; /* current do range label */
|
||||
int undeftype = NO; /* set if IMPLICIT NONE */
|
||||
int maxdim = 15; /* max allowable number of dimensions */
|
||||
int nowarnflag = NO; /* set if don't want warning messages */
|
||||
int shiftcase = YES; /* convert variable to lower case */
|
||||
int num_files;
|
||||
char intonly; /* set if only integer param allowed */
|
||||
#if __SPF_BUILT_IN_PARSER && !_WIN32
|
||||
extern int warn_all; /* set if -w option specified*/
|
||||
#else
|
||||
int warn_all; /* set if -w option specified*/
|
||||
#endif
|
||||
int errcnt = 0; /* error count */
|
||||
int nwarn = 0; /* number of warning */
|
||||
int mod_offset; /* line no offset of current module */
|
||||
|
||||
int num_bfnds; /* total # of bif nodes */
|
||||
int num_llnds; /* total # of low level nodes */
|
||||
int num_symbs; /* total # of symbol nodes */
|
||||
int num_types; /* total # of types nodes */
|
||||
int num_blobs; /* total # of blob nodes */
|
||||
int num_sets; /* total # of set nodes */
|
||||
int num_cmnt;
|
||||
int num_def; /* total # of dependncy nodes */
|
||||
int num_dep;
|
||||
int num_deflst;
|
||||
int num_label; /* total # of label nodes */
|
||||
|
||||
PTR_LLND first_unresolved_call = LLNULL, last_unresolved_call = LLNULL;
|
||||
|
||||
PTR_SYMB global_list;
|
||||
|
||||
PTR_BFND head_bfnd, /* start of bfnd chain */
|
||||
cur_bfnd, /* point to current bfnd */
|
||||
pred_bfnd, /* used in finding the predecessor */
|
||||
last_bfnd;
|
||||
|
||||
PTR_LLND head_llnd, cur_llnd;
|
||||
PTR_SYMB head_symb, cur_symb;
|
||||
PTR_TYPE head_type, cur_type;
|
||||
PTR_LABEL head_label, cur_label, thislabel;
|
||||
PTR_BLOB head_blob, cur_blob;
|
||||
PTR_SETS head_sets, cur_sets;
|
||||
PTR_DEF head_def, cur_def;
|
||||
PTR_FNAME head_file, cur_thread_file, the_file;
|
||||
PTR_DEFLST head_deflst, cur_deflst;
|
||||
PTR_DEP head_dep, cur_dep, pre_dep;
|
||||
PTR_CMNT head_cmnt, cur_cmnt;
|
||||
PTR_BFND global_bfnd;
|
||||
PTR_SYMB star_symb;
|
||||
PTR_TYPE vartype;
|
||||
PTR_CMNT comments;
|
||||
#if __SPF_BUILT_IN_PARSER && !_WIN32
|
||||
extern PTR_CMNT cur_comment;
|
||||
#else
|
||||
PTR_CMNT cur_comment;
|
||||
#endif
|
||||
|
||||
PTR_TYPE make_type();
|
||||
PTR_SYMB make_symb();
|
||||
PTR_BFND get_bfnd();
|
||||
PTR_BLOB make_blob();
|
||||
void init_hash();
|
||||
void init_scope_table();
|
||||
|
||||
PTR_TYPE global_int, global_float, global_double, global_char, global_string;
|
||||
PTR_TYPE global_bool, global_complex, global_dcomplex, global_gate,
|
||||
global_event, global_sequence,global_default,global_string_2;
|
||||
|
||||
char yytext[1000]; /* text consumed for current lexeme */
|
||||
char *infname;
|
||||
|
||||
#if __SPF_BUILT_IN_PARSER && !_WIN32
|
||||
extern char saveall; /* set if "SAVE ALL" */
|
||||
extern int privateall; /* set if "PRIVATE ALL" */
|
||||
#else
|
||||
char saveall; /* set if "SAVE ALL" */
|
||||
int privateall; /* set if "PRIVATE ALL" */
|
||||
#endif
|
||||
char substars; /* set if * parameters seen */
|
||||
int blklevel; /* current block level */
|
||||
int parstate; /* current parser's state */
|
||||
|
||||
PTR_TYPE impltype[26]; /* implicit type for 'a' to 'z' */
|
||||
|
||||
int procno; /* procedure # in current file */
|
||||
int proctype; /* procedure type */
|
||||
char *procname; /* procedure name */
|
||||
|
||||
int procclass;
|
||||
int nentry; /* # of entries */
|
||||
char multitype;
|
||||
|
||||
/*
|
||||
* General initialization routine
|
||||
*/
|
||||
void
|
||||
initialize()
|
||||
{
|
||||
errcnt = 0; /* error count */
|
||||
nwarn = 0; /* number of warning */
|
||||
parstate = OUTSIDE; /* current parser's state */
|
||||
yylineno = 0; /* global line no from lex */
|
||||
mod_offset = 0;
|
||||
num_files = 0;
|
||||
num_bfnds = 0; /* total # of bif nodes */
|
||||
num_llnds = 0; /* total # of low level nodes */
|
||||
num_symbs = 0; /* total # of symbol nodes */
|
||||
num_types = 0; /* total # of types nodes */
|
||||
num_blobs = 0; /* total # of blob nodes */
|
||||
num_sets = 0; /* total # of set nodes */
|
||||
num_cmnt = 0;
|
||||
num_def = 0; /* total # of dependncy nodes */
|
||||
num_dep = 0;
|
||||
num_deflst = 0;
|
||||
num_label = 0; /* total # of label nodes */
|
||||
global_list = (PTR_SYMB) NULL;
|
||||
head_bfnd = BFNULL;
|
||||
cur_bfnd = BFNULL;
|
||||
pred_bfnd = BFNULL; /* used in finding the predecessor */
|
||||
last_bfnd = BFNULL;
|
||||
|
||||
head_llnd = LLNULL;
|
||||
cur_llnd = LLNULL;
|
||||
head_symb = SMNULL;
|
||||
cur_symb = SMNULL;
|
||||
head_cmnt = CMNULL;
|
||||
cur_cmnt = CMNULL;
|
||||
head_type = TYNULL;
|
||||
cur_type = TYNULL;
|
||||
head_label = LBNULL;
|
||||
cur_label = LBNULL;
|
||||
thislabel = LBNULL;
|
||||
head_blob = BLNULL;
|
||||
cur_blob = BLNULL;
|
||||
head_sets = (PTR_SETS)NULL;
|
||||
cur_sets = (PTR_SETS)NULL;
|
||||
head_file = (PTR_FNAME)NULL;
|
||||
head_def = (PTR_DEF)NULL;
|
||||
cur_def = (PTR_DEF)NULL;
|
||||
head_deflst = (PTR_DEFLST)NULL;
|
||||
cur_deflst = (PTR_DEFLST)NULL;
|
||||
head_dep = (PTR_DEP)NULL;
|
||||
cur_dep = (PTR_DEP)NULL;
|
||||
pre_dep = (PTR_DEP)NULL;
|
||||
global_bfnd = BFNULL;
|
||||
comments = CMNULL;
|
||||
cur_comment = CMNULL;
|
||||
global_int = make_type(fi,T_INT);
|
||||
global_float = make_type(fi,T_FLOAT);
|
||||
global_double = make_type(fi,T_DOUBLE);
|
||||
global_char = make_type(fi,T_CHAR);
|
||||
global_string = make_type(fi,T_STRING);
|
||||
global_bool = make_type(fi,T_BOOL);
|
||||
global_complex = make_type(fi,T_COMPLEX);
|
||||
global_dcomplex = make_type(fi,T_DCOMPLEX);
|
||||
global_gate = make_type(fi,T_GATE);
|
||||
global_event = make_type(fi,T_EVENT);
|
||||
global_sequence = make_type(fi,T_SEQUENCE);
|
||||
global_default = make_type(fi,DEFAULT);
|
||||
global_string_2 = make_type(fi,T_STRING);
|
||||
global_string_2->entry.Template.dummy1=2;
|
||||
|
||||
star_symb = make_symb(fi,DEFAULT, "*");
|
||||
fi->global_bfnd = global_bfnd = get_bfnd(fi,GLOBAL, SMNULL, LLNULL, LLNULL, LLNULL);
|
||||
global_bfnd->filename=(PTR_FNAME)NULL;/*later we put something there*/
|
||||
cur_blob = global_bfnd->entry.Template.bl_ptr1
|
||||
= make_blob (fi,BFNULL, BLNULL);
|
||||
pred_bfnd = global_bfnd;
|
||||
init_hash();
|
||||
init_scope_table();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set implicit type and length for each alphabetic chars in the range c1 - c2
|
||||
*/
|
||||
void
|
||||
setimpl(type, c1, c2)
|
||||
PTR_TYPE type;
|
||||
int c1, c2;
|
||||
{
|
||||
register int i;
|
||||
char buff[100];
|
||||
void err();
|
||||
|
||||
if (c1 == 0 || c2 == 0)
|
||||
return;
|
||||
|
||||
if (c1 > c2) {
|
||||
(void)sprintf(buff, "characters out of order in implicit:%c-%c", c1, c2);
|
||||
err(buff);
|
||||
} else {
|
||||
for (i = c1; i <= c2; ++i) {
|
||||
impltype[i - 'a'] = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialization routine for each new program unit
|
||||
*/
|
||||
void
|
||||
procinit()
|
||||
{
|
||||
parstate = OUTSIDE;
|
||||
blklevel = 1;
|
||||
saveall = NO;
|
||||
privateall = 0;
|
||||
substars = NO;
|
||||
nwarn = 0;
|
||||
thislabel = LBNULL;
|
||||
needkwd = 0;
|
||||
/*!!!*/
|
||||
opt_kwd_ = 0;
|
||||
opt_kwd_r = 0;
|
||||
optcorner = 0;
|
||||
|
||||
++procno;
|
||||
proctype = T_UNKNOWN;
|
||||
procname = "MAIN_ ";
|
||||
nentry = 0;
|
||||
multitype = NO;
|
||||
blklevel = 1;
|
||||
dorange = 0;
|
||||
|
||||
if (undeftype)
|
||||
setimpl(global_default, 'a', 'z');
|
||||
else {
|
||||
setimpl(global_float, 'a', 'z');
|
||||
setimpl(global_int, 'i', 'n');
|
||||
}
|
||||
}
|
||||
|
||||
3303
dvm/fdvm/trunk/parser/lexfdvm.c
Normal file
3303
dvm/fdvm/trunk/parser/lexfdvm.c
Normal file
File diff suppressed because it is too large
Load Diff
108
dvm/fdvm/trunk/parser/lists.c
Normal file
108
dvm/fdvm/trunk/parser/lists.c
Normal file
@@ -0,0 +1,108 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
#include "bif.h"
|
||||
#include "ll.h"
|
||||
#include "symb.h"
|
||||
#include "db.h"
|
||||
|
||||
extern PTR_TYPE global_default;
|
||||
extern PTR_LLND make_llnd();
|
||||
extern PTR_FILE fi;
|
||||
|
||||
void errstr();
|
||||
|
||||
/*
|
||||
* set_ll_list attaches a new node to a given old_list and
|
||||
* makes sure that the old_list is of the same type as ll_type
|
||||
*/
|
||||
PTR_LLND
|
||||
set_ll_list(old_list, node, ll_type)
|
||||
PTR_LLND old_list, node;
|
||||
int ll_type;
|
||||
{
|
||||
register PTR_LLND temp, new;
|
||||
|
||||
if (!node) { /* the first item in the list */
|
||||
new = make_llnd(fi,ll_type, old_list, LLNULL, SMNULL);
|
||||
new->type = global_default;
|
||||
return (new);
|
||||
}
|
||||
if (old_list->variant != ll_type) { /* first two items */
|
||||
new = make_llnd(fi,ll_type, old_list,
|
||||
make_llnd(fi,ll_type, node, LLNULL, SMNULL),
|
||||
SMNULL);
|
||||
new->type = global_default;
|
||||
new->entry.Template.ll_ptr2->type = global_default;
|
||||
return (new);
|
||||
}
|
||||
new = make_llnd(fi,ll_type, node, LLNULL, SMNULL);
|
||||
for (temp = old_list;
|
||||
temp->entry.Template.ll_ptr2;
|
||||
temp = temp->entry.Template.ll_ptr2)
|
||||
;
|
||||
temp->entry.Template.ll_ptr2 = new;
|
||||
new->type = global_default;
|
||||
return (old_list);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* set_id_list takes an old id list and runs down the list attaching new
|
||||
* id at the end
|
||||
*/
|
||||
PTR_SYMB
|
||||
set_id_list(old_list, id)
|
||||
PTR_SYMB old_list, id;
|
||||
{
|
||||
register PTR_SYMB temp;
|
||||
|
||||
if (!id)
|
||||
return (old_list);
|
||||
if(id->id_list) {
|
||||
errstr("'%s' is a duplicate dummy argument",id->ident,121); /*podd 9.03.00*/
|
||||
return(old_list);
|
||||
}
|
||||
for (temp = old_list; temp->id_list; temp = temp->id_list)
|
||||
;
|
||||
|
||||
temp->id_list = id;
|
||||
return (old_list);
|
||||
}
|
||||
|
||||
PTR_LLND
|
||||
add_to_lowLevelList(ele, oldList)
|
||||
PTR_LLND ele, oldList;
|
||||
{
|
||||
register PTR_LLND temp;
|
||||
|
||||
if (!ele)
|
||||
return (oldList);
|
||||
|
||||
for (temp = oldList; temp->entry.list.next; temp = temp->entry.list.next)
|
||||
;
|
||||
|
||||
temp->entry.list.next = ele;
|
||||
return (oldList);
|
||||
}
|
||||
|
||||
PTR_LLND
|
||||
add_to_lowList(ele, oldList)
|
||||
PTR_LLND ele, oldList;
|
||||
{
|
||||
register PTR_LLND temp;
|
||||
|
||||
if (!ele)
|
||||
return (oldList);
|
||||
|
||||
for (temp = oldList; temp->entry.Template.ll_ptr2; temp = temp->entry.Template.ll_ptr2)
|
||||
;
|
||||
|
||||
temp->entry.Template.ll_ptr2 = ele;
|
||||
|
||||
return (oldList);
|
||||
}
|
||||
1077
dvm/fdvm/trunk/parser/low_hpf.c
Normal file
1077
dvm/fdvm/trunk/parser/low_hpf.c
Normal file
File diff suppressed because it is too large
Load Diff
99
dvm/fdvm/trunk/parser/makefile.uni
Normal file
99
dvm/fdvm/trunk/parser/makefile.uni
Normal file
@@ -0,0 +1,99 @@
|
||||
#######################################################################
|
||||
## Copyright (C) 1999 ##
|
||||
## Keldysh Institute of Appllied Mathematics ##
|
||||
#######################################################################
|
||||
|
||||
# dvm/fdvm/parser/makefile.uni
|
||||
|
||||
# HDR traditional header files.
|
||||
# HDRg header files generated by programs.
|
||||
# SRC traditional source files.
|
||||
# SRCg source files generated by programs.
|
||||
# OBJS object files required to load the program.
|
||||
#
|
||||
|
||||
BINDIR = ../../bin
|
||||
LIBDIR = ../lib
|
||||
|
||||
SAGEROOT = ../Sage
|
||||
LIBINCLUDE = $(SAGEROOT)/lib/include
|
||||
HINCLUDE = $(SAGEROOT)/h
|
||||
DVMINCLUDE = ../include
|
||||
EXECUTABLES = parse
|
||||
|
||||
INCL = -I. -I$(DVMINCLUDE) -I$(LIBINCLUDE) -I$(HINCLUDE)
|
||||
|
||||
# -w don't issue warning now.
|
||||
CFLAGS=$(INCL) -c -DSYS5 -Wall
|
||||
|
||||
$(OUTDIR)/%.o:%.c
|
||||
$(CC) $(CFLAGS) -o $(OUTDIR)/$*.o $<
|
||||
|
||||
gram1.tab.o: gram1.tab.c
|
||||
$(CC) $(CFLAGS) -DYYDEBUG gram1.tab.c
|
||||
LIBS = $(LIBDIR)/libdb.a
|
||||
FDVM = $(DVMINCLUDE)/dvm_tag.h
|
||||
HDR = $(DVMINCLUDE)/inc.h $(HINCLUDE)/defs.h $(DVMINCLUDE)/fdvm.h $(HINCLUDE)/bif.h \
|
||||
$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
|
||||
$(DVMINCLUDE)/extern.h $(HINCLUDE)/sets.h tag tokens
|
||||
TOOLBOX_HDR = $(LIBINCLUDE)/macro.h $(LIBINCLUDE)/bif_node.def $(LIBINCLUDE)/type.def $(LIBINCLUDE)/symb.def
|
||||
HDRg = tag.h tokdefs.h
|
||||
|
||||
HDRS = $(HDR) $(HDRg)
|
||||
# !!
|
||||
SRC = cftn.c init.c hash.c lexfdvm.c lists.c misc.c stat.c errors.c types.c sym.c \
|
||||
low_hpf.c unparse_hpf.c
|
||||
#!!
|
||||
SRCg = gram.tab.c
|
||||
|
||||
SRCS = $(SRC) $(SRCg)
|
||||
#!!
|
||||
OBJS = cftn.o errors.o hash.o init.o \
|
||||
lexfdvm.o lists.o misc.o stat.o \
|
||||
types.o gram1.tab.o sym.o low_hpf.o unparse_hpf.o
|
||||
|
||||
$(BINDIR)/$(EXECUTABLES): $(OBJS)
|
||||
$(LINKER) -o $(BINDIR)/$(EXECUTABLES) $(OBJS) $(LIBS)
|
||||
|
||||
all: $(BINDIR)/$(EXECUTABLES)
|
||||
@echo "****** COMPILING EXECUTABLE $(EXECUTABLES) DONE ******"
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS)
|
||||
cleanall:
|
||||
rm -f $(OBJS)
|
||||
|
||||
# ***********************************************************
|
||||
|
||||
###
|
||||
cftn.o: $(HINCLUDE)/db.h $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/bif.h \
|
||||
$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h
|
||||
ftn.gram: $(DVMINCLUDE)/extern.h $(HINCLUDE)/defines.h $(HINCLUDE)/defs.h \
|
||||
$(DVMINCLUDE)/fdvm.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h \
|
||||
$(HINCLUDE)/sets.h
|
||||
commsym.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
|
||||
$(HINCLUDE)/bif.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/ll.h \
|
||||
$(HINCLUDE)/sets.h
|
||||
errors.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(DVMINCLUDE)/extern.h \
|
||||
$(HINCLUDE)/db.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/sets.h
|
||||
exec.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag
|
||||
gram.o: $(HINCLUDE)/defs.h \
|
||||
$(HINCLUDE)/tag $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h \
|
||||
$(HINCLUDE)/sets.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/defines.h
|
||||
hash.o: $(HINCLUDE)/defs.h $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h $(DVMINCLUDE)/extern.h \
|
||||
$(HINCLUDE)/db.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/sets.h $(HINCLUDE)/tag
|
||||
init.o: $(DVMINCLUDE)/inc.h $(HINCLUDE)/defs.h $(HINCLUDE)/bif.h $(HINCLUDE)/defines.h \
|
||||
$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h $(HINCLUDE)/db.h $(HINCLUDE)/tag
|
||||
# !!
|
||||
lexfdvm.o: $(DVMINCLUDE)/extern.h
|
||||
lists.o: $(HINCLUDE)/defs.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/bif.h
|
||||
misc.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/defines.h $(HINCLUDE)/db.h \
|
||||
$(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h
|
||||
stat.o: $(HINCLUDE)/defs.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h\
|
||||
$(HINCLUDE)/sets.h $(HINCLUDE)/defines.h $(DVMINCLUDE)/extern.h
|
||||
sym.o: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
|
||||
$(HINCLUDE)/bif.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/ll.h \
|
||||
$(HINCLUDE)/sets.h $(DVMINCLUDE)/fdvm.h
|
||||
types.o: $(HINCLUDE)/defs.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h
|
||||
low_hpf.o: $(FDVM) $(TOOLBOX_HDR)
|
||||
unparse_hpf.o: $(FDVM) $(TOOLBOX_HDR) $(DVMINCLUDE)/unparse.hpf
|
||||
129
dvm/fdvm/trunk/parser/makefile.win
Normal file
129
dvm/fdvm/trunk/parser/makefile.win
Normal file
@@ -0,0 +1,129 @@
|
||||
#######################################################################
|
||||
## Copyright (C) 1999 ##
|
||||
## Keldysh Institute of Appllied Mathematics ##
|
||||
#######################################################################
|
||||
|
||||
# dvm/fdvm/parser/makefile.win
|
||||
|
||||
# HDR traditional header files.
|
||||
# HDRg header files generated by programs.
|
||||
# SRC traditional source files.
|
||||
# SRCg source files generated by programs.
|
||||
# OBJS object files required to load the program.
|
||||
#
|
||||
|
||||
OUTDIR = ..\obj
|
||||
BINDIR = ..\..\bin
|
||||
LIBDIR = ..\lib
|
||||
|
||||
SAGEROOT =../Sage
|
||||
LIBINCLUDE = $(SAGEROOT)/lib/include
|
||||
HINCLUDE = $(SAGEROOT)/h
|
||||
FDVMINCL = ../include
|
||||
EXECUTABLES = parse
|
||||
|
||||
INCL = -I. -I$(FDVMINCL) -I$(LIBINCLUDE) -I$(HINCLUDE)
|
||||
TOOLBOX_HDR = $(LIBINCLUDE)/macro.h $(LIBINCLUDE)/bif_node.def $(LIBINCLUDE)/type.def $(LIBINCLUDE)/symb.def
|
||||
FDVM = $(DVMINCLUDE)/dvm_tag.h
|
||||
# -w don't issue warning now.
|
||||
#CFLAGS=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" \
|
||||
# /D "YYDEBUG" /D "MSDOS" /D "SYS5" /D "WIN" $(INCL) \
|
||||
# /Fp"$(OUTDIR)/newsrc.pch" /YX /Fo"$(OUTDIR)/" /Fd"$(OUTDIR)/" /c
|
||||
CFLAGS=/nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" \
|
||||
/D "YYDEBUG" /D "MSDOS" /D "SYS5" /D "WIN" $(INCL) \
|
||||
/Fp"$(OUTDIR)/newsrc.pch" /Fo"$(OUTDIR)/" /Fd"$(OUTDIR)/" /c
|
||||
|
||||
|
||||
|
||||
.c{$(OUTDIR)/}.obj:
|
||||
echo $(CC) $(CFLAGS) $<
|
||||
$(CC) $(CFLAGS) $<
|
||||
|
||||
$(OUTDIR)/gram1.tab.obj: gram1.tab.c
|
||||
$(CC) $(CFLAGS) /D "YYDEBUG" -c gram1.tab.c
|
||||
|
||||
LINK=$(LINKER)
|
||||
|
||||
LINK_FLAGS=/nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)\$(EXECUTABLES).pdb" /out:"$(BINDIR)\$(EXECUTABLES).exe"
|
||||
|
||||
LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)\$(EXECUTABLES).pdb" /out:"$(BINDIR)\$(EXECUTABLES).exe"
|
||||
|
||||
|
||||
LIBS = $(LIBDIR)/libdb.lib
|
||||
|
||||
HDR = $(DVMINCLUDE)/inc.h $(HINCLUDE)/defs.h $(DVMINCLUDE)/fdvm.h $(HINCLUDE)/bif.h \
|
||||
$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
|
||||
$(DVMINCLUDE)/extern.h $(HINCLUDE)/sets.h tag tokens
|
||||
|
||||
HDRg = tag.h tokdefs.h
|
||||
|
||||
HDRS = $(HDR) $(HDRg)
|
||||
# !!
|
||||
SRC = cftn.c init.c hash.c lexfdvm.c lists.c\
|
||||
misc.c stat.c errors.c types.c sym.c low_hpf.c unparse_hpf.c
|
||||
#!!
|
||||
SRCg = gram.tab.c
|
||||
|
||||
SRCS = $(SRC) $(SRCg)
|
||||
#!!
|
||||
OBJS = $(OUTDIR)/cftn.obj $(OUTDIR)/errors.obj $(OUTDIR)/hash.obj $(OUTDIR)/init.obj \
|
||||
$(OUTDIR)/lexfdvm.obj $(OUTDIR)/lists.obj $(OUTDIR)/misc.obj $(OUTDIR)/stat.obj \
|
||||
$(OUTDIR)/types.obj $(OUTDIR)/gram1.tab.obj $(OUTDIR)/sym.obj \
|
||||
$(OUTDIR)/low_hpf.obj $(OUTDIR)/unparse_hpf.obj
|
||||
|
||||
|
||||
$(BINDIR)/$(EXECUTABLES).exe: $(OBJS)
|
||||
$(LINK) @<<
|
||||
$(LINK_FLAGS) $(OBJS) $(LIBS)
|
||||
<<
|
||||
|
||||
all: $(BINDIR)/$(EXECUTABLES).exe
|
||||
@echo "*** COMPILING EXECUTABLE $(EXECUTABLES) DONE"
|
||||
|
||||
clean:
|
||||
|
||||
cleanall:
|
||||
|
||||
# ***********************************************************
|
||||
|
||||
###
|
||||
cftn.obj: $(HINCLUDE)/db.h $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/bif.h \
|
||||
$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h
|
||||
ftn.gram: $(DVMINCLUDE)/extern.h $(HINCLUDE)/defines.h $(HINCLUDE)/defs.h \
|
||||
$(DVMINCLUDE)/fdvm.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h \
|
||||
$(HINCLUDE)/sets.h
|
||||
commsym.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
|
||||
$(HINCLUDE)/bif.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/ll.h \
|
||||
$(HINCLUDE)/sets.h
|
||||
errors.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(DVMINCLUDE)/extern.h \
|
||||
$(HINCLUDE)/db.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/sets.h
|
||||
exec.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/tag
|
||||
gram.obj: $(HINCLUDE)/defs.h \
|
||||
$(HINCLUDE)/tag $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h \
|
||||
$(HINCLUDE)/sets.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/defines.h
|
||||
hash.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h $(DVMINCLUDE)/extern.h \
|
||||
$(HINCLUDE)/db.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/sets.h $(HINCLUDE)/tag
|
||||
init.obj: $(DVMINCLUDE)/inc.h $(HINCLUDE)/defs.h $(HINCLUDE)/bif.h $(HINCLUDE)/defines.h \
|
||||
$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h $(HINCLUDE)/db.h $(HINCLUDE)/tag
|
||||
# !!
|
||||
lexfdvm.obj: $(DVMINCLUDE)/extern.h
|
||||
lists.obj:$(HINCLUDE)/defs.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/bif.h
|
||||
misc.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/defines.h $(HINCLUDE)/db.h \
|
||||
$(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h
|
||||
stat.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h\
|
||||
$(HINCLUDE)/sets.h $(HINCLUDE)/defines.h $(DVMINCLUDE)/extern.h
|
||||
sym.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
|
||||
$(HINCLUDE)/bif.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/ll.h \
|
||||
$(HINCLUDE)/sets.h $(DVMINCLUDE)/fdvm.h
|
||||
types.obj:$(HINCLUDE)/defs.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h
|
||||
low_hpf.obj: $(FDVM) $(TOOLBOX_HDR)
|
||||
unparse_hpf.obj: $(FDVM) $(TOOLBOX_HDR) $(DVMINCLUDE)/unparse.hpf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
208
dvm/fdvm/trunk/parser/misc.c
Normal file
208
dvm/fdvm/trunk/parser/misc.c
Normal file
@@ -0,0 +1,208 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
/*
|
||||
* misc.c
|
||||
*
|
||||
* Misellanious help routines
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "defines.h"
|
||||
#include <ctype.h>
|
||||
#include "db.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
extern int blklevel;
|
||||
extern void warn1();
|
||||
extern PTR_BFND cur_scope();
|
||||
PTR_LABEL make_label();
|
||||
extern PTR_FILE fi;
|
||||
void free();
|
||||
|
||||
extern PTR_CMNT comments;
|
||||
extern PTR_FNAME cur_thread_file;
|
||||
extern PTR_FNAME the_file;
|
||||
extern int yylineno;
|
||||
extern int mod_offset;
|
||||
extern PTR_BFND last_bfnd;
|
||||
extern PTR_BFND head_bfnd, last_bfnd;
|
||||
extern PTR_LLND head_llnd;
|
||||
extern PTR_SYMB head_symb;
|
||||
extern PTR_TYPE head_type;
|
||||
extern PTR_LABEL head_label;
|
||||
|
||||
/*
|
||||
* eqn -- checks if first n characters of two strings are the same
|
||||
*
|
||||
* input:
|
||||
* n - length to be checked
|
||||
* a - string1
|
||||
* b - string2
|
||||
*
|
||||
* output:
|
||||
* YES if the first n characters are same. NO, otherwise.
|
||||
*/
|
||||
int
|
||||
eqn(n, a, b)
|
||||
register int n;
|
||||
register unsigned char *a, *b;
|
||||
{
|
||||
while (--n >= 0)
|
||||
if ((isupper(*a) ? tolower(*a++) : *a++) != *b++)
|
||||
return (NO);
|
||||
return (YES);
|
||||
}
|
||||
|
||||
/*
|
||||
* StringConcatenation -- concatenate strings
|
||||
*/
|
||||
char *StringConcatenation(char *s1, char*s2)
|
||||
{
|
||||
char *res = (char*)malloc(strlen(s1)+strlen(s2)+1);
|
||||
res[0] = '\0';
|
||||
strcat(res, s1);
|
||||
strcat(res, s2);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* convci - converts an ASCII string to binary
|
||||
*
|
||||
* input:
|
||||
* n - length of the string
|
||||
* s - the string to be converted
|
||||
*
|
||||
* output:
|
||||
* the converted long value
|
||||
*/
|
||||
long
|
||||
convci(n, s)
|
||||
register int n;
|
||||
register char *s;
|
||||
{
|
||||
register long sum;
|
||||
|
||||
sum = 0;
|
||||
while (n-- > 0)
|
||||
sum = 10 * sum + (*s++ - '0');
|
||||
return (sum);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* convic -- converts a long integer to ASCII string
|
||||
*
|
||||
* input:
|
||||
* n - the number to be converted
|
||||
*
|
||||
* output:
|
||||
* the converted string
|
||||
*/
|
||||
char *
|
||||
convic(n)
|
||||
long n;
|
||||
{
|
||||
static char s[20];
|
||||
register char *t;
|
||||
|
||||
s[19] = '\0';
|
||||
t = s + 19;
|
||||
|
||||
do {
|
||||
*--t = '0' + n % 10;
|
||||
n /= 10;
|
||||
} while (n > 0);
|
||||
|
||||
return (t);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get a BIF node
|
||||
*/
|
||||
PTR_BFND
|
||||
get_bfnd(fid,node_type, symb_ptr, ll1, ll2, ll3)
|
||||
PTR_FILE fid;
|
||||
int node_type;
|
||||
PTR_SYMB symb_ptr;
|
||||
PTR_LLND ll1, ll2, ll3;
|
||||
{
|
||||
PTR_BFND new_bfnd, make_bfnd();
|
||||
|
||||
new_bfnd = make_bfnd(fid, node_type, symb_ptr, ll1, ll2, ll3);
|
||||
new_bfnd->filename = the_file;
|
||||
/*new_bfnd->filename = cur_thread_file;*/ /*podd 18.04.99*/
|
||||
new_bfnd->entry.Template.cmnt_ptr = comments;
|
||||
new_bfnd->entry.Template.bl_ptr1 = BLNULL;
|
||||
new_bfnd->entry.Template.bl_ptr2 = BLNULL;
|
||||
new_bfnd->g_line = yylineno;
|
||||
new_bfnd->l_line = yylineno - mod_offset;
|
||||
last_bfnd = new_bfnd;
|
||||
return (new_bfnd);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
release_nodes()
|
||||
{
|
||||
register PTR_BFND p1 = head_bfnd;
|
||||
register PTR_LLND p2 = head_llnd;
|
||||
register PTR_SYMB p3 = head_symb;
|
||||
register PTR_TYPE p4 = head_type;
|
||||
register PTR_LABEL p5 =head_label;
|
||||
register PTR_BFND t1;
|
||||
register PTR_LLND t2;
|
||||
register PTR_SYMB t3;
|
||||
register PTR_TYPE t4;
|
||||
register PTR_LABEL t5;
|
||||
|
||||
while (p1) {
|
||||
t1 = p1;
|
||||
p1 = p1->thread;
|
||||
#ifdef __SPF
|
||||
removeFromCollection(t1);
|
||||
#endif
|
||||
free ((char *)t1);
|
||||
}
|
||||
|
||||
while (p2) {
|
||||
t2 = p2;
|
||||
p2 = p2->thread;
|
||||
#ifdef __SPF
|
||||
removeFromCollection(t2);
|
||||
#endif
|
||||
free ((char *)t2);
|
||||
}
|
||||
|
||||
while (p3) {
|
||||
t3 = p3;
|
||||
p3 = p3->thread;
|
||||
#ifdef __SPF
|
||||
removeFromCollection(t3);
|
||||
#endif
|
||||
free ((char *)t3);
|
||||
}
|
||||
|
||||
while (p4) {
|
||||
t4 = p4;
|
||||
p4 = p4->thread;
|
||||
#ifdef __SPF
|
||||
removeFromCollection(t4);
|
||||
#endif
|
||||
free ((char *)t4);
|
||||
}
|
||||
|
||||
while (p5) {
|
||||
t5 = p5;
|
||||
p5 = p5->next;
|
||||
#ifdef __SPF
|
||||
removeFromCollection(t5);
|
||||
#endif
|
||||
free ((char *)t5);
|
||||
}
|
||||
}
|
||||
|
||||
1448
dvm/fdvm/trunk/parser/stat.c
Normal file
1448
dvm/fdvm/trunk/parser/stat.c
Normal file
File diff suppressed because it is too large
Load Diff
2004
dvm/fdvm/trunk/parser/sym.c
Normal file
2004
dvm/fdvm/trunk/parser/sym.c
Normal file
File diff suppressed because it is too large
Load Diff
621
dvm/fdvm/trunk/parser/tag
Normal file
621
dvm/fdvm/trunk/parser/tag
Normal file
@@ -0,0 +1,621 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
/******************* variant tags for bif nodes **********************/
|
||||
|
||||
#define GLOBAL 100
|
||||
#define PROG_HEDR 101
|
||||
#define PROC_HEDR 102
|
||||
#define BASIC_BLOCK 103
|
||||
#define CONTROL_END 104
|
||||
#define IF_NODE 105
|
||||
#define LOOP_NODE 106
|
||||
#define FOR_NODE 107
|
||||
#define FORALL_NODE 108
|
||||
#define WHILE_NODE 109
|
||||
#define EXIT_NODE 110
|
||||
#define ASSIGN_STAT 111
|
||||
#define M_ASSIGN_STAT 112
|
||||
#define PROC_STAT 113
|
||||
#define SUM_ACC 114 /* accumulation statements */
|
||||
#define MULT_ACC 115
|
||||
#define MAX_ACC 116
|
||||
#define MIN_ACC 117
|
||||
#define CAT_ACC 118
|
||||
#define OR_ACC 119
|
||||
#define AND_ACC 120
|
||||
#define READ_STAT 121
|
||||
#define WRITE_STAT 122
|
||||
#define OTHERIO_STAT 123
|
||||
#define CDOALL_NODE 124
|
||||
#define SDOALL_NODE 125
|
||||
#define DOACROSS_NODE 126
|
||||
#define CDOACROSS_NODE 127
|
||||
#define DVM_INTERVAL_DIR 128 /* DVM-F */
|
||||
#define DVM_ENDINTERVAL_DIR 129 /* DVM-F */
|
||||
#define FUNC_HEDR 130
|
||||
#define WHERE_NODE 131
|
||||
#define ALLDO_NODE 132
|
||||
#define IDENTIFY 133
|
||||
#define FORMAT_STAT 134
|
||||
#define STOP_STAT 135
|
||||
#define RETURN_STAT 136
|
||||
#define ELSEIF_NODE 137
|
||||
#define ARITHIF_NODE 138
|
||||
#define GOTO_NODE 139
|
||||
#define ASSGOTO_NODE 140
|
||||
#define COMGOTO_NODE 141
|
||||
#define PAUSE_NODE 142
|
||||
#define STOP_NODE 143
|
||||
#define ASSLAB_STAT 144
|
||||
#define LOGIF_NODE 145
|
||||
#define DVM_DEBUG_DIR 146 /* DVM-F */
|
||||
#define DVM_ENDDEBUG_DIR 147 /* DVM-F */
|
||||
#define DVM_TRACEON_DIR 148 /* DVM-F */
|
||||
#define DVM_TRACEOFF_DIR 149 /* DVM-F */
|
||||
#define BLOB 150
|
||||
#define SIZES 151
|
||||
#define COMMENT_STAT 152
|
||||
#define CONT_STAT 153
|
||||
#define VAR_DECL 154
|
||||
#define PARAM_DECL 155
|
||||
#define COMM_STAT 156
|
||||
#define EQUI_STAT 157
|
||||
#define IMPL_DECL 158
|
||||
#define DATA_DECL 159
|
||||
#define SAVE_DECL 160
|
||||
#define ENTRY_STAT 162
|
||||
#define STMTFN_STAT 163
|
||||
#define DIM_STAT 164
|
||||
#define BLOCK_DATA 165
|
||||
#define EXTERN_STAT 166
|
||||
#define INTRIN_STAT 167
|
||||
#define ENUM_DECL 168 /* New added for VPC */
|
||||
#define CLASS_DECL 169 /* New added for VPC */
|
||||
#define UNION_DECL 170 /* New added for VPC */
|
||||
#define STRUCT_DECL 171 /* New added for VPC */
|
||||
#define DERIVED_CLASS_DECL 172 /* New added for VPC */
|
||||
#define EXPR_STMT_NODE 173 /* New added for VPC */
|
||||
#define DO_WHILE_NODE 174 /* New added for VPC */
|
||||
#define SWITCH_NODE 175 /* New added for VPC */
|
||||
#define CASE_NODE 176 /* New added for VPC */
|
||||
#define DEFAULT_NODE 177 /* New added for VPC */
|
||||
#define BREAK_NODE 178 /* New added for VPC */
|
||||
#define CONTINUE_NODE 179 /* New added for VPC */
|
||||
#define RETURN_NODE 180 /* New added for VPC */
|
||||
#define ASM_NODE 181 /* New added for VPC */
|
||||
#define SPAWN_NODE 182 /* New added for CC++ */
|
||||
#define PARFOR_NODE 183 /* New added for CC++ */
|
||||
#define PAR_NODE 184 /* New added for CC++ */
|
||||
#define LABEL_STAT 185 /* New added for VPC */
|
||||
#define PROS_COMM 186 /* Fortran M */
|
||||
#define ATTR_DECL 187 /* attribute declaration */
|
||||
#define NAMELIST_STAT 188
|
||||
#define FUTURE_STMT 189 /* NEW added for VPC */
|
||||
#define COLLECTION_DECL 190 /* NEW added for PC++ */
|
||||
#define TEMPLATE_DECL 191 /* added by dbg for templates */
|
||||
#define TEMPLATE_FUNDECL 192 /* added by dbg for template function*/
|
||||
#define TECLASS_DECL 193 /* added for pC++ */
|
||||
#define ELSEWH_NODE 194 /*F95*/
|
||||
#define STATIC_STMT 195 /*F95*/
|
||||
#define INCLUDE_LINE 196 /*F95*/
|
||||
#define PREPROCESSOR_DIR 197 /*C,C++*/
|
||||
#define PRINT_STAT 200
|
||||
#define BACKSPACE_STAT 201
|
||||
#define REWIND_STAT 202
|
||||
#define ENDFILE_STAT 203
|
||||
#define INQUIRE_STAT 204
|
||||
#define OPEN_STAT 205
|
||||
#define CLOSE_STAT 206
|
||||
#define EXTERN_C_STAT 207 /* Added by PHB for 'extern "C" {}' */
|
||||
#define INCLUDE_STAT 208
|
||||
#define TRY_STAT 209 /* added by dbg for C++ exceptions */
|
||||
#define CATCH_STAT 210 /* moreexcpt handling (part of try) */
|
||||
#define DVM_PARALLEL_ON_DIR 211 /* DVM-F */
|
||||
#define DVM_SHADOW_START_DIR 212 /* DVM-F */
|
||||
#define DVM_SHADOW_GROUP_DIR 213 /* DVM-F */
|
||||
#define DVM_SHADOW_WAIT_DIR 214 /* DVM-F */
|
||||
#define DVM_REDUCTION_START_DIR 215 /* DVM-F */
|
||||
#define DVM_REDUCTION_GROUP_DIR 216 /* DVM-F */
|
||||
#define DVM_REDUCTION_WAIT_DIR 217 /* DVM-F */
|
||||
#define DVM_DYNAMIC_DIR 218 /* DVM-F */
|
||||
#define DVM_ALIGN_DIR 219 /* DVM-F */
|
||||
#define DVM_REALIGN_DIR 220 /* DVM-F */
|
||||
#define DVM_REALIGN_NEW_DIR 221 /* DVM-F */
|
||||
#define DVM_REMOTE_ACCESS_DIR 222 /* DVM-F */
|
||||
#define HPF_INDEPENDENT_DIR 223 /* HPF */
|
||||
#define DVM_SHADOW_DIR 224 /* DVM-F */
|
||||
#define PARDO_NODE 225 /* Following added for PCF Fortran */
|
||||
#define PARSECTIONS_NODE 226
|
||||
#define SECTION_NODE 227
|
||||
#define GUARDS_NODE 228
|
||||
#define LOCK_NODE 229
|
||||
#define UNLOCK_NODE 230
|
||||
#define CRITSECTION_NODE 231
|
||||
#define POST_NODE 232
|
||||
#define WAIT_NODE 233
|
||||
#define CLEAR_NODE 234
|
||||
#define POSTSEQ_NODE 235
|
||||
#define WAITSEQ_NODE 236
|
||||
#define SETSEQ_NODE 237
|
||||
#define ASSIGN_NODE 238
|
||||
#define RELEASE_NODE 239
|
||||
#define PRIVATE_NODE 240
|
||||
#define SCOMMON_NODE 241
|
||||
#define PARREGION_NODE 242
|
||||
#define PDO_NODE 243
|
||||
#define PSECTIONS_NODE 244
|
||||
#define SINGLEPROCESS_NODE 245
|
||||
#define SKIPPASTEOF_NODE 246
|
||||
#define DVM_NEW_VALUE_DIR 247 /* DVM-F */
|
||||
#define DVM_VAR_DECL 248 /* DVM-F */
|
||||
#define DVM_POINTER_DIR 249 /* DVM-F */
|
||||
#define INTENT_STMT 250 /* Added for Fortran 90 */
|
||||
#define OPTIONAL_STMT 251
|
||||
#define PUBLIC_STMT 252
|
||||
#define PRIVATE_STMT 253
|
||||
#define ALLOCATABLE_STMT 254
|
||||
#define POINTER_STMT 255
|
||||
#define TARGET_STMT 256
|
||||
#define ALLOCATE_STMT 257
|
||||
#define NULLIFY_STMT 258
|
||||
#define DEALLOCATE_STMT 259
|
||||
#define SEQUENCE_STMT 260
|
||||
#define CYCLE_STMT 261
|
||||
#define EXIT_STMT 262
|
||||
#define CONTAINS_STMT 263
|
||||
#define WHERE_BLOCK_STMT 264
|
||||
#define MODULE_STMT 265
|
||||
#define USE_STMT 266
|
||||
#define INTERFACE_STMT 267
|
||||
#define MODULE_PROC_STMT 268
|
||||
#define OVERLOADED_ASSIGN_STAT 269
|
||||
#define POINTER_ASSIGN_STAT 270
|
||||
#define OVERLOADED_PROC_STAT 271
|
||||
#define DECOMPOSITION_STMT 275
|
||||
#define ALIGN_STMT 276
|
||||
#define DVM_DISTRIBUTE_DIR 277 /* DVM-F */
|
||||
#define REDUCE_STMT 278
|
||||
#define PROS_HEDR 279 /* Fortran M */
|
||||
#define PROS_STAT 280 /* Fortran M */
|
||||
#define PROS_STAT_LCTN 281 /* Fortran M */
|
||||
#define PROS_STAT_SUBM 282 /* Fortran M */
|
||||
#define PROCESSES_STAT 283 /* Fortran M */
|
||||
#define PROCESSES_END 284 /* Fortran M */
|
||||
#define PROCESS_DO_STAT 285 /* Fortran M */
|
||||
#define PROCESSORS_STAT 286 /* Fortran M */
|
||||
#define CHANNEL_STAT 287 /* Fortran M */
|
||||
#define MERGER_STAT 288 /* Fortran M */
|
||||
#define MOVE_PORT 289 /* Fortran M */
|
||||
#define SEND_STAT 290 /* Fortran M */
|
||||
#define RECEIVE_STAT 291 /* Fortran M */
|
||||
#define ENDCHANNEL_STAT 292 /* Fortran M */
|
||||
#define PROBE_STAT 293 /* Fortran M */
|
||||
#define INPORT_DECL 294 /* Fortran M */
|
||||
#define OUTPORT_DECL 295 /* Fortran M */
|
||||
#define HPF_TEMPLATE_STAT 296 /* HPF */
|
||||
#define HPF_ALIGN_STAT 297 /* HPF */
|
||||
#define HPF_PROCESSORS_STAT 298 /* HPF */
|
||||
#define DVM_REDISTRIBUTE_DIR 299 /* DVM-F */
|
||||
#define DVM_TASK_REGION_DIR 605 /* DVM-F */
|
||||
#define DVM_END_TASK_REGION_DIR 606 /* DVM-F */
|
||||
#define DVM_ON_DIR 607 /* DVM-F */
|
||||
#define DVM_END_ON_DIR 608 /* DVM-F */
|
||||
#define DVM_TASK_DIR 609 /* DVM-F */
|
||||
#define DVM_MAP_DIR 610 /* DVM-F */
|
||||
#define DVM_PARALLEL_TASK_DIR 611 /* DVM-F */
|
||||
#define DVM_INHERIT_DIR 612 /* DVM-F */
|
||||
#define DVM_INDIRECT_GROUP_DIR 613 /* DVM-F */
|
||||
#define DVM_INDIRECT_ACCESS_DIR 614 /* DVM-F */
|
||||
#define DVM_REMOTE_GROUP_DIR 615 /* DVM-F */
|
||||
#define DVM_RESET_DIR 616 /* DVM-F */
|
||||
#define DVM_PREFETCH_DIR 617 /* DVM-F */
|
||||
#define DVM_OWN_DIR 618 /* DVM-F */
|
||||
#define DVM_HEAP_DIR 619 /* DVM-F */
|
||||
#define DVM_ASYNCID_DIR 620 /* DVM-F */
|
||||
#define DVM_ASYNCHRONOUS_DIR 621 /* DVM-F */
|
||||
#define DVM_ENDASYNCHRONOUS_DIR 622 /* DVM-F */
|
||||
#define DVM_ASYNCWAIT_DIR 623 /* DVM-F */
|
||||
#define DVM_F90_DIR 624 /* DVM-F */
|
||||
#define DVM_BARRIER_DIR 625 /* DVM-F */
|
||||
#define FORALL_STAT 626 /* F95 */
|
||||
#define DVM_CONSISTENT_GROUP_DIR 627 /* DVM-F */
|
||||
#define DVM_CONSISTENT_START_DIR 628 /* DVM-F */
|
||||
#define DVM_CONSISTENT_WAIT_DIR 629 /* DVM-F */
|
||||
#define DVM_CONSISTENT_DIR 630 /* DVM-F */
|
||||
#define DVM_CHECK_DIR 631 /* DVM-F */
|
||||
#define DVM_IO_MODE_DIR 632 /* DVM-F */
|
||||
#define DVM_LOCALIZE_DIR 633 /* DVM-F */
|
||||
#define DVM_SHADOW_ADD_DIR 634 /* DVM-F */
|
||||
#define DVM_CP_CREATE_DIR 635 /* DVM-F */
|
||||
#define DVM_CP_LOAD_DIR 636 /* DVM-F */
|
||||
#define DVM_CP_SAVE_DIR 637 /* DVM-F */
|
||||
#define DVM_CP_WAIT_DIR 638 /* DVM-F */
|
||||
#define DVM_EXIT_INTERVAL_DIR 639 /* DVM-F */
|
||||
#define DVM_TEMPLATE_CREATE_DIR 640 /* DVM-F */
|
||||
#define DVM_TEMPLATE_DELETE_DIR 641 /* DVM-F */
|
||||
|
||||
/***************** variant tags for low level nodes ********************/
|
||||
|
||||
#define INT_VAL 300
|
||||
#define FLOAT_VAL 301
|
||||
#define DOUBLE_VAL 302
|
||||
#define BOOL_VAL 303
|
||||
#define CHAR_VAL 304
|
||||
#define STRING_VAL 305
|
||||
#define CONST_REF 306
|
||||
#define VAR_REF 307
|
||||
#define ARRAY_REF 308
|
||||
#define RECORD_REF 309 /* diff struct between Blaze and VPC++ */
|
||||
#define ENUM_REF 310
|
||||
#define VAR_LIST 311
|
||||
#define EXPR_LIST 312
|
||||
#define RANGE_LIST 313
|
||||
#define CASE_CHOICE 314
|
||||
#define DEF_CHOICE 315
|
||||
#define VARIANT_CHOICE 316
|
||||
#define COMPLEX_VAL 317
|
||||
#define LABEL_REF 318
|
||||
#define KEYWORD_VAL 319 /* Strings to be printed with quotes */
|
||||
#define DDOT 324
|
||||
#define RANGE_OP 325
|
||||
#define UPPER_OP 326
|
||||
#define LOWER_OP 327
|
||||
#define EQ_OP 328
|
||||
#define LT_OP 329
|
||||
#define GT_OP 330
|
||||
#define NOTEQL_OP 331
|
||||
#define LTEQL_OP 332
|
||||
#define GTEQL_OP 333
|
||||
#define ADD_OP 334
|
||||
#define SUBT_OP 335
|
||||
#define OR_OP 336
|
||||
#define MULT_OP 337
|
||||
#define DIV_OP 338
|
||||
#define MOD_OP 339
|
||||
#define AND_OP 340
|
||||
#define EXP_OP 341
|
||||
#define ARRAY_MULT 342
|
||||
#define CONCAT_OP 343 /* cancatenation of strings */
|
||||
#define XOR_OP 344 /* .XOR. in fortran */
|
||||
#define EQV_OP 345 /* .EQV. in fortran */
|
||||
#define NEQV_OP 346 /* .NEQV. in fortran */
|
||||
#define MINUS_OP 350 /* unary operations */
|
||||
#define NOT_OP 351
|
||||
#define ASSGN_OP 352 /* New ADDED For VPC */
|
||||
#define DEREF_OP 353 /* New ADDED For VPC */
|
||||
#define POINTST_OP 354 /* New ADDED For VPC */ /* ptr->x */
|
||||
#define FUNCTION_OP 355 /* New ADDED For VPC */ /* (*DD)() */
|
||||
#define MINUSMINUS_OP 356 /* New ADDED For VPC */
|
||||
#define PLUSPLUS_OP 357 /* New ADDED For VPC */
|
||||
#define BITAND_OP 358 /* New ADDED For VPC */
|
||||
#define BITOR_OP 359 /* New ADDED For VPC */
|
||||
#define STAR_RANGE 360 /* operations with no operands 360.. */
|
||||
#define PROC_CALL 370
|
||||
#define FUNC_CALL 371
|
||||
#define CONSTRUCTOR_REF 380
|
||||
#define ACCESS_REF 381
|
||||
#define CONS 382
|
||||
#define ACCESS 383
|
||||
#define IOACCESS 384
|
||||
#define CONTROL_LIST 385
|
||||
#define SEQ 386
|
||||
#define SPEC_PAIR 387
|
||||
#define COMM_LIST 388
|
||||
#define STMT_STR 389
|
||||
#define EQUI_LIST 390
|
||||
#define IMPL_TYPE 391
|
||||
#define STMTFN_DECL 392
|
||||
#define BIT_COMPLEMENT_OP 393
|
||||
#define EXPR_IF 394
|
||||
#define EXPR_IF_BODY 395
|
||||
#define FUNCTION_REF 396
|
||||
#define LSHIFT_OP 397
|
||||
#define RSHIFT_OP 398
|
||||
#define UNARY_ADD_OP 399
|
||||
#define SIZE_OP 400
|
||||
#define INTEGER_DIV_OP 401
|
||||
#define SUB_OP 402
|
||||
#define LE_OP 403 /* New added for VPC */
|
||||
#define GE_OP 404 /* New added for VPC */
|
||||
#define NE_OP 405 /* New added for VPC */
|
||||
#define CLASSINIT_OP 406 /* New added for VPC */
|
||||
#define CAST_OP 407 /* New added for VPC */
|
||||
#define ADDRESS_OP 408 /* New added for VPC */
|
||||
#define POINSTAT_OP 409 /* New added for VPC */
|
||||
#define COPY_NODE 410 /* New added for VPC */
|
||||
#define INIT_LIST 411 /* New added for VPC */
|
||||
#define VECTOR_CONST 412 /* New added for VPC */
|
||||
#define BIT_NUMBER 413 /* New added for VPC */
|
||||
#define ARITH_ASSGN_OP 414 /* New added for VPC */
|
||||
#define ARRAY_OP 415 /* New added for VPC */
|
||||
#define NEW_OP 416 /* New added for VPC */
|
||||
#define DELETE_OP 417 /* New added for VPC */
|
||||
#define NAMELIST_LIST 418
|
||||
#define THIS_NODE 419 /* New added for VPC */
|
||||
#define SCOPE_OP 420 /* New added for VPC */
|
||||
#define PLUS_ASSGN_OP 421 /* New added for VPC */
|
||||
#define MINUS_ASSGN_OP 422 /* New added for VPC */
|
||||
#define AND_ASSGN_OP 423 /* New added for VPC */
|
||||
#define IOR_ASSGN_OP 424 /* New added for VPC */
|
||||
#define MULT_ASSGN_OP 425 /* New added for VPC */
|
||||
#define DIV_ASSGN_OP 426 /* New added for VPC */
|
||||
#define MOD_ASSGN_OP 427 /* New added for VPC */
|
||||
#define XOR_ASSGN_OP 428 /* New added for VPC */
|
||||
#define LSHIFT_ASSGN_OP 429 /* New added for VPC */
|
||||
#define RSHIFT_ASSGN_OP 430 /* New added for VPC */
|
||||
#define ORDERED_OP 431 /* Following added for PCF FORTRAN */
|
||||
#define EXTEND_OP 432
|
||||
#define MAXPARALLEL_OP 433
|
||||
#define SAMETYPE_OP 434
|
||||
#define TYPE_REF 450 /* Added for FORTRAN 90 */
|
||||
#define STRUCTURE_CONSTRUCTOR 451
|
||||
#define ARRAY_CONSTRUCTOR 452
|
||||
#define SECTION_REF 453
|
||||
#define VECTOR_SUBSCRIPT 454
|
||||
#define SECTION_OPERANDS 455
|
||||
#define KEYWORD_ARG 456
|
||||
#define OVERLOADED_CALL 457
|
||||
#define INTERFACE_REF 458
|
||||
#define RENAME_NODE 459
|
||||
#define TYPE_NODE 460
|
||||
#define PAREN_OP 461
|
||||
#define PARAMETER_OP 462
|
||||
#define PUBLIC_OP 463
|
||||
#define PRIVATE_OP 464
|
||||
#define ALLOCATABLE_OP 465
|
||||
#define DIMENSION_OP 466
|
||||
#define EXTERNAL_OP 467
|
||||
#define IN_OP 468
|
||||
#define OUT_OP 469
|
||||
#define INOUT_OP 470
|
||||
#define INTRINSIC_OP 471
|
||||
#define POINTER_OP 472
|
||||
#define OPTIONAL_OP 473
|
||||
#define SAVE_OP 474
|
||||
#define TARGET_OP 475
|
||||
#define ONLY_NODE 476
|
||||
#define LEN_OP 477
|
||||
#define TYPE_OP 479
|
||||
#define DOTSTAR_OP 480 /* C++ .* operator */
|
||||
#define ARROWSTAR_OP 481 /* C++ ->* operator */
|
||||
#define FORDECL_OP 482 /* C++ for(int i; needs a new op */
|
||||
#define THROW_OP 483 /* C++ throw operator */
|
||||
#define PROCESSORS_REF 484 /* Fortran M */
|
||||
#define PORT_TYPE_OP 485 /* Fortran M */
|
||||
#define INPORT_TYPE_OP 486 /* Fortran M */
|
||||
#define OUTPORT_TYPE_OP 487 /* Fortran M */
|
||||
#define INPORT_NAME 488 /* Fortran M */
|
||||
#define OUTPORT_NAME 489 /* Fortran M */
|
||||
#define FROMPORT_NAME 490 /* Fortran M */
|
||||
#define TOPORT_NAME 491 /* Fortran M */
|
||||
#define IOSTAT_STORE 492 /* Fortran M */
|
||||
#define EMPTY_STORE 493 /* Fortran M */
|
||||
#define ERR_LABEL 494 /* Fortran M */
|
||||
#define END_LABEL 495 /* Fortran M */
|
||||
#define PROS_CALL 496 /* Fortran M */
|
||||
#define STATIC_OP 497 /* F95*/
|
||||
#define LABEL_ARG 498
|
||||
#define DATA_IMPL_DO 700 /* Fortran M */
|
||||
#define DATA_ELT 701 /* Fortran M */
|
||||
#define DATA_SUBS 702 /* Fortran M */
|
||||
#define DATA_RANGE 703 /* Fortran M */
|
||||
#define ICON_EXPR 704 /* Fortran M */
|
||||
#define BLOCK_OP 705 /* DVM-F */
|
||||
#define NEW_SPEC_OP 706 /* DVM-F */
|
||||
#define REDUCTION_OP 707 /* DVM-F */
|
||||
#define SHADOW_RENEW_OP 708 /* DVM-F */
|
||||
#define SHADOW_START_OP 709 /* DVM-F */
|
||||
#define SHADOW_WAIT_OP 710 /* DVM-F */
|
||||
#define DIAG_OP 711 /* DVM-F */
|
||||
#define REMOTE_ACCESS_OP 712 /* DVM-F */
|
||||
#define TEMPLATE_OP 713 /* DVM-F */
|
||||
#define PROCESSORS_OP 714 /* DVM-F */
|
||||
#define DYNAMIC_OP 715 /* DVM-F */
|
||||
#define ALIGN_OP 716 /* DVM-F */
|
||||
#define DISTRIBUTE_OP 717 /* DVM-F */
|
||||
#define SHADOW_OP 718 /* DVM-F */
|
||||
#define INDIRECT_ACCESS_OP 719 /* DVM-F */
|
||||
#define ACROSS_OP 720 /* DVM-F */
|
||||
#define NEW_VALUE_OP 721 /* DVM-F */
|
||||
#define SHADOW_COMP_OP 722 /* DVM-F */
|
||||
#define STAGE_OP 723 /* DVM-F */
|
||||
#define FORALL_OP 724 /* F95 */
|
||||
#define CONSISTENT_OP 725 /* DVM-F */
|
||||
#define INTERFACE_OPERATOR 726 /* F95 */
|
||||
#define INTERFACE_ASSIGNMENT 727 /* F95 */
|
||||
#define VAR_DECL_90 728 /* F95 */
|
||||
#define ASSIGNMENT_OP 729 /* F95 */
|
||||
#define OPERATOR_OP 730 /* F95 */
|
||||
#define KIND_OP 731 /* F95 */
|
||||
#define LENGTH_OP 732 /* F95 */
|
||||
#define RECURSIVE_OP 733 /* F95 */
|
||||
#define ELEMENTAL_OP 734 /* F95 */
|
||||
#define PURE_OP 735 /* F95 */
|
||||
#define DEFINED_OP 736 /* F95 */
|
||||
#define PARALLEL_OP 737 /*DVM-F */
|
||||
#define INDIRECT_OP 738 /*DVM-F */
|
||||
#define DERIVED_OP 739 /*DVM-F */
|
||||
#define DUMMY_REF 740 /*DVM-F */
|
||||
#define COMMON_OP 741 /*DVM-F */
|
||||
#define SHADOW_NAMES_OP 742 /*DVM-F */
|
||||
|
||||
/***************** variant tags for symbol table entries ********************/
|
||||
|
||||
#define CONST_NAME 500 /* constant types */
|
||||
#define ENUM_NAME 501
|
||||
#define FIELD_NAME 502
|
||||
#define VARIABLE_NAME 503
|
||||
#define TYPE_NAME 504
|
||||
#define PROGRAM_NAME 505
|
||||
#define PROCEDURE_NAME 506
|
||||
#define VAR_FIELD 507
|
||||
#define LABEL_VAR 508 /* dest of assigned goto stmt */
|
||||
#define FUNCTION_NAME 509
|
||||
#define MEMBER_FUNC 510 /* new added for VPC */
|
||||
#define CLASS_NAME 511 /* new added for VPC */
|
||||
#define UNION_NAME 512 /* new added for VPC */
|
||||
#define STRUCT_NAME 513 /* new added for VPC */
|
||||
#define LABEL_NAME 514 /* new added for VPC */
|
||||
#define COLLECTION_NAME 515 /* new added for VPC */
|
||||
#define ROUTINE_NAME 516 /*added for external statement*/
|
||||
#define CONSTRUCT_NAME 517
|
||||
#define INTERFACE_NAME 518
|
||||
#define MODULE_NAME 519
|
||||
#define TEMPLATE_CL_NAME 520
|
||||
#define TEMPLATE_FN_NAME 521
|
||||
#define TECLASS_NAME 522
|
||||
#define SHADOW_GROUP_NAME 523 /* DVM_F */
|
||||
#define REDUCTION_GROUP_NAME 524 /* DVM_F */
|
||||
#define REF_GROUP_NAME 525 /* DVM_F */
|
||||
#define ASYNC_ID 526 /* DVM_F */
|
||||
#define CONSISTENT_GROUP_NAME 527 /* DVM_F */
|
||||
#define NAMELIST_NAME 528
|
||||
#define COMMON_NAME 529 /* name of a common block (add Kataev N.A., 02.04.2014)*/
|
||||
|
||||
#define DEFAULT 550
|
||||
#define T_INT 551 /* scalar types */
|
||||
#define T_FLOAT 552
|
||||
#define T_DOUBLE 553
|
||||
#define T_CHAR 554
|
||||
#define T_BOOL 555
|
||||
#define T_STRING 556
|
||||
#define T_ENUM 557
|
||||
#define T_SUBRANGE 558
|
||||
#define T_LIST 559
|
||||
#define T_ARRAY 560
|
||||
#define T_RECORD 561
|
||||
#define T_ENUM_FIELD 562
|
||||
#define T_UNKNOWN 563
|
||||
#define T_COMPLEX 564
|
||||
#define T_VOID 565 /* New one for VPC */
|
||||
#define T_DESCRIPT 566 /* New one for VPC */
|
||||
#define T_FUNCTION 567 /* New one for VPC */
|
||||
#define T_POINTER 568 /* New one for VPC */
|
||||
#define T_UNION 569 /* New one for VPC */
|
||||
#define T_STRUCT 570 /* New one for VPC */
|
||||
#define T_CLASS 571 /* New one for VPC */
|
||||
#define T_DERIVED_CLASS 572 /* New one for VPC */
|
||||
#define T_DERIVED_TYPE 573 /* New one for VPC */
|
||||
#define T_COLLECTION 574 /* New one for PC++*/
|
||||
#define T_DERIVED_COLLECTION 575 /* New one for PC++*/
|
||||
#define T_REFERENCE 576 /* New one for PC++*/
|
||||
#define T_DERIVED_TEMPLATE 577 /* template type T<A,3,4> */
|
||||
#define T_MEMBER_POINTER 578 /* need for C::* (ptr to memb ) */
|
||||
#define T_TECLASS 579 /* new one for pC++*/
|
||||
#define T_GATE 580 /* added for PCF FORTRAN */
|
||||
#define T_EVENT 581
|
||||
#define T_SEQUENCE 582
|
||||
#define T_DCOMPLEX 583
|
||||
#define T_LONG 584
|
||||
#define BY_USE 599 /* Fortran 90 */
|
||||
#define LOCAL 600 /* variable type */
|
||||
#define INPUT 601
|
||||
#define OUTPUT 602
|
||||
#define IO 603
|
||||
#define PROCESS_NAME 604 /* Fortran M */
|
||||
|
||||
#define OMP_PRIVATE 801 /* OpenMP Fortran */
|
||||
#define OMP_SHARED 802 /* OpenMP Fortran */
|
||||
#define OMP_FIRSTPRIVATE 803 /* OpenMP Fortran */
|
||||
#define OMP_LASTPRIVATE 804 /* OpenMP Fortran */
|
||||
#define OMP_THREADPRIVATE 805 /* OpenMP Fortran */
|
||||
#define OMP_COPYIN 806 /* OpenMP Fortran */
|
||||
#define OMP_COPYPRIVATE 807 /* OpenMP Fortran */
|
||||
#define OMP_DEFAULT 808 /* OpenMP Fortran */
|
||||
#define OMP_ORDERED 809 /* OpenMP Fortran */
|
||||
#define OMP_SCHEDULE 810 /* OpenMP Fortran */
|
||||
#define OMP_REDUCTION 811 /* OpenMP Fortran */
|
||||
#define OMP_IF 812 /* OpenMP Fortran */
|
||||
#define OMP_NUM_THREADS 813 /* OpenMP Fortran */
|
||||
#define OMP_NOWAIT 814 /* OpenMP Fortran */
|
||||
#define OMP_PARALLEL_DIR 820 /* OpenMP Fortran */
|
||||
#define OMP_END_PARALLEL_DIR 821 /* OpenMP Fortran */
|
||||
#define OMP_DO_DIR 822 /* OpenMP Fortran */
|
||||
#define OMP_END_DO_DIR 823 /* OpenMP Fortran */
|
||||
#define OMP_SECTIONS_DIR 824 /* OpenMP Fortran */
|
||||
#define OMP_END_SECTIONS_DIR 825 /* OpenMP Fortran */
|
||||
#define OMP_SECTION_DIR 826 /* OpenMP Fortran */
|
||||
#define OMP_SINGLE_DIR 827 /* OpenMP Fortran */
|
||||
#define OMP_END_SINGLE_DIR 828 /* OpenMP Fortran */
|
||||
#define OMP_WORKSHARE_DIR 829 /* OpenMP Fortran */
|
||||
#define OMP_END_WORKSHARE_DIR 830 /* OpenMP Fortran */
|
||||
#define OMP_PARALLEL_DO_DIR 831 /* OpenMP Fortran */
|
||||
#define OMP_END_PARALLEL_DO_DIR 832 /* OpenMP Fortran */
|
||||
#define OMP_PARALLEL_SECTIONS_DIR 833 /* OpenMP Fortran */
|
||||
#define OMP_END_PARALLEL_SECTIONS_DIR 834 /* OpenMP Fortran */
|
||||
#define OMP_PARALLEL_WORKSHARE_DIR 835 /* OpenMP Fortran */
|
||||
#define OMP_END_PARALLEL_WORKSHARE_DIR 836 /* OpenMP Fortran */
|
||||
#define OMP_MASTER_DIR 837 /* OpenMP Fortran */
|
||||
#define OMP_END_MASTER_DIR 838 /* OpenMP Fortran */
|
||||
#define OMP_CRITICAL_DIR 839 /* OpenMP Fortran */
|
||||
#define OMP_END_CRITICAL_DIR 840 /* OpenMP Fortran */
|
||||
#define OMP_BARRIER_DIR 841 /* OpenMP Fortran */
|
||||
#define OMP_ATOMIC_DIR 842 /* OpenMP Fortran */
|
||||
#define OMP_FLUSH_DIR 843 /* OpenMP Fortran */
|
||||
#define OMP_ORDERED_DIR 844 /* OpenMP Fortran */
|
||||
#define OMP_END_ORDERED_DIR 845 /* OpenMP Fortran */
|
||||
#define RECORD_DECL 846 /* OpenMP Fortran */
|
||||
#define FUNC_STAT 847 /* OpenMP Fortran */
|
||||
#define OMP_ONETHREAD_DIR 848 /* OpenMP Fortran */
|
||||
#define OMP_THREADPRIVATE_DIR 849 /* OpenMP Fortran */
|
||||
#define OMP_DEFAULT_SECTION_DIR 850 /* OpenMP Fortran */
|
||||
#define OMP_COLLAPSE 851 /* OpenMP Fortran */
|
||||
|
||||
#define ACC_REGION_DIR 900 /* ACC Fortran */
|
||||
#define ACC_END_REGION_DIR 901 /* ACC Fortran */
|
||||
#define ACC_CALL_STMT 907 /* ACC Fortran */
|
||||
#define ACC_KERNEL_HEDR 908 /* ACC Fortran */
|
||||
#define ACC_GET_ACTUAL_DIR 909 /* ACC Fortran */
|
||||
#define ACC_ACTUAL_DIR 910 /* ACC Fortran */
|
||||
#define ACC_CHECKSECTION_DIR 911 /* ACC Fortran */
|
||||
#define ACC_END_CHECKSECTION_DIR 912 /* ACC Fortran */
|
||||
#define ACC_ROUTINE_DIR 913 /* ACC Fortran */
|
||||
|
||||
#define ACC_TIE_OP 930 /* ACC Fortran */
|
||||
#define ACC_INLOCAL_OP 931 /* ACC Fortran */
|
||||
#define ACC_INOUT_OP 932 /* ACC Fortran */
|
||||
#define ACC_IN_OP 933 /* ACC Fortran */
|
||||
#define ACC_OUT_OP 934 /* ACC Fortran */
|
||||
#define ACC_LOCAL_OP 935 /* ACC Fortran */
|
||||
#define ACC_PRIVATE_OP 936 /* ACC Fortran */
|
||||
#define ACC_DEVICE_OP 937 /* ACC Fortran */
|
||||
#define ACC_CUDA_OP 938 /* ACC Fortran */
|
||||
#define ACC_HOST_OP 939 /* ACC Fortran */
|
||||
|
||||
#define ACC_GLOBAL_OP 940 /* ACC Fortran */
|
||||
#define ACC_ATTRIBUTES_OP 941 /* ACC Fortran */
|
||||
#define ACC_VALUE_OP 942 /* ACC Fortran */
|
||||
#define ACC_SHARED_OP 943 /* ACC Fortran */
|
||||
#define ACC_CONSTANT_OP 944 /* ACC Fortran */
|
||||
#define ACC_USES_OP 945 /* ACC Fortran */
|
||||
#define ACC_CALL_OP 946 /* ACC Fortran */
|
||||
#define ACC_CUDA_BLOCK_OP 947 /* ACC Fortran */
|
||||
|
||||
#define ACC_TARGETS_OP 948 /* ACC Fortran */
|
||||
#define ACC_ASYNC_OP 949 /* ACC Fortran */
|
||||
|
||||
#define SPF_ANALYSIS_DIR 950 /* SAPFOR */
|
||||
#define SPF_PARALLEL_DIR 951 /* SAPFOR */
|
||||
#define SPF_TRANSFORM_DIR 952 /* SAPFOR */
|
||||
#define SPF_NOINLINE_OP 953 /* SAPFOR */
|
||||
#define SPF_PARALLEL_REG_DIR 954 /* SAPFOR */
|
||||
#define SPF_END_PARALLEL_REG_DIR 955 /* SAPFOR */
|
||||
#define SPF_REGION_NAME 956 /* SAPFOR */
|
||||
#define SPF_EXPAND_OP 957 /* SAPFOR */
|
||||
#define SPF_FISSION_OP 958 /* SAPFOR */
|
||||
#define SPF_SHRINK_OP 959 /* SAPFOR */
|
||||
#define SPF_CHECKPOINT_DIR 960 /* SAPFOR */
|
||||
#define SPF_TYPE_OP 961 /* SAPFOR */
|
||||
#define SPF_VARLIST_OP 962 /* SAPFOR */
|
||||
#define SPF_EXCEPT_OP 963 /* SAPFOR */
|
||||
#define SPF_FILES_COUNT_OP 964 /* SAPFOR */
|
||||
#define SPF_INTERVAL_OP 965 /* SAPFOR */
|
||||
#define SPF_TIME_OP 966 /* SAPFOR */
|
||||
#define SPF_ITER_OP 967 /* SAPFOR */
|
||||
#define SPF_FLEXIBLE_OP 968 /* SAPFOR */
|
||||
#define SPF_PARAMETER_OP 969 /* SAPFOR */
|
||||
#define SPF_CODE_COVERAGE_OP 970 /* SAPFOR */
|
||||
#define SPF_UNROLL_OP 971 /* SAPFOR */
|
||||
623
dvm/fdvm/trunk/parser/tag.h
Normal file
623
dvm/fdvm/trunk/parser/tag.h
Normal file
@@ -0,0 +1,623 @@
|
||||
/* don't modify this file directly, it is made by a clever 'sed'
|
||||
script using "tag". Run make tag.h to regenerate this file */
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
/******************* variant tags for bif nodes **********************/
|
||||
|
||||
tag [ GLOBAL ] = "GLOBAL";
|
||||
tag [ PROG_HEDR ] = "PROG_HEDR";
|
||||
tag [ PROC_HEDR ] = "PROC_HEDR";
|
||||
tag [ BASIC_BLOCK ] = "BASIC_BLOCK";
|
||||
tag [ CONTROL_END ] = "CONTROL_END";
|
||||
tag [ IF_NODE ] = "IF_NODE";
|
||||
tag [ LOOP_NODE ] = "LOOP_NODE";
|
||||
tag [ FOR_NODE ] = "FOR_NODE";
|
||||
tag [ FORALL_NODE ] = "FORALL_NODE";
|
||||
tag [ WHILE_NODE ] = "WHILE_NODE";
|
||||
tag [ EXIT_NODE ] = "EXIT_NODE";
|
||||
tag [ ASSIGN_STAT ] = "ASSIGN_STAT";
|
||||
tag [ M_ASSIGN_STAT ] = "M_ASSIGN_STAT";
|
||||
tag [ PROC_STAT ] = "PROC_STAT";
|
||||
tag [ SUM_ACC ] = "SUM_ACC";
|
||||
tag [ MULT_ACC ] = "MULT_ACC";
|
||||
tag [ MAX_ACC ] = "MAX_ACC";
|
||||
tag [ MIN_ACC ] = "MIN_ACC";
|
||||
tag [ CAT_ACC ] = "CAT_ACC";
|
||||
tag [ OR_ACC ] = "OR_ACC";
|
||||
tag [ AND_ACC ] = "AND_ACC";
|
||||
tag [ READ_STAT ] = "READ_STAT";
|
||||
tag [ WRITE_STAT ] = "WRITE_STAT";
|
||||
tag [ OTHERIO_STAT ] = "OTHERIO_STAT";
|
||||
tag [ CDOALL_NODE ] = "CDOALL_NODE";
|
||||
tag [ SDOALL_NODE ] = "SDOALL_NODE";
|
||||
tag [ DOACROSS_NODE ] = "DOACROSS_NODE";
|
||||
tag [ CDOACROSS_NODE ] = "CDOACROSS_NODE";
|
||||
tag [ DVM_INTERVAL_DIR ] = "DVM_INTERVAL_DIR";
|
||||
tag [ DVM_ENDINTERVAL_DIR ] = "DVM_ENDINTERVAL_DIR";
|
||||
tag [ FUNC_HEDR ] = "FUNC_HEDR";
|
||||
tag [ WHERE_NODE ] = "WHERE_NODE";
|
||||
tag [ ALLDO_NODE ] = "ALLDO_NODE";
|
||||
tag [ IDENTIFY ] = "IDENTIFY";
|
||||
tag [ FORMAT_STAT ] = "FORMAT_STAT";
|
||||
tag [ STOP_STAT ] = "STOP_STAT";
|
||||
tag [ RETURN_STAT ] = "RETURN_STAT";
|
||||
tag [ ELSEIF_NODE ] = "ELSEIF_NODE";
|
||||
tag [ ARITHIF_NODE ] = "ARITHIF_NODE";
|
||||
tag [ GOTO_NODE ] = "GOTO_NODE";
|
||||
tag [ ASSGOTO_NODE ] = "ASSGOTO_NODE";
|
||||
tag [ COMGOTO_NODE ] = "COMGOTO_NODE";
|
||||
tag [ PAUSE_NODE ] = "PAUSE_NODE";
|
||||
tag [ STOP_NODE ] = "STOP_NODE";
|
||||
tag [ ASSLAB_STAT ] = "ASSLAB_STAT";
|
||||
tag [ LOGIF_NODE ] = "LOGIF_NODE";
|
||||
tag [ DVM_DEBUG_DIR ] = "DVM_DEBUG_DIR";
|
||||
tag [ DVM_ENDDEBUG_DIR ] = "DVM_ENDDEBUG_DIR";
|
||||
tag [ DVM_TRACEON_DIR ] = "DVM_TRACEON_DIR";
|
||||
tag [ DVM_TRACEOFF_DIR ] = "DVM_TRACEOFF_DIR";
|
||||
tag [ BLOB ] = "BLOB";
|
||||
tag [ SIZES ] = "SIZES";
|
||||
tag [ COMMENT_STAT ] = "COMMENT_STAT";
|
||||
tag [ CONT_STAT ] = "CONT_STAT";
|
||||
tag [ VAR_DECL ] = "VAR_DECL";
|
||||
tag [ PARAM_DECL ] = "PARAM_DECL";
|
||||
tag [ COMM_STAT ] = "COMM_STAT";
|
||||
tag [ EQUI_STAT ] = "EQUI_STAT";
|
||||
tag [ IMPL_DECL ] = "IMPL_DECL";
|
||||
tag [ DATA_DECL ] = "DATA_DECL";
|
||||
tag [ SAVE_DECL ] = "SAVE_DECL";
|
||||
tag [ ENTRY_STAT ] = "ENTRY_STAT";
|
||||
tag [ STMTFN_STAT ] = "STMTFN_STAT";
|
||||
tag [ DIM_STAT ] = "DIM_STAT";
|
||||
tag [ BLOCK_DATA ] = "BLOCK_DATA";
|
||||
tag [ EXTERN_STAT ] = "EXTERN_STAT";
|
||||
tag [ INTRIN_STAT ] = "INTRIN_STAT";
|
||||
tag [ ENUM_DECL ] = "ENUM_DECL";
|
||||
tag [ CLASS_DECL ] = "CLASS_DECL";
|
||||
tag [ UNION_DECL ] = "UNION_DECL";
|
||||
tag [ STRUCT_DECL ] = "STRUCT_DECL";
|
||||
tag [ DERIVED_CLASS_DECL ] = "DERIVED_CLASS_DECL";
|
||||
tag [ EXPR_STMT_NODE ] = "EXPR_STMT_NODE";
|
||||
tag [ DO_WHILE_NODE ] = "DO_WHILE_NODE";
|
||||
tag [ SWITCH_NODE ] = "SWITCH_NODE";
|
||||
tag [ CASE_NODE ] = "CASE_NODE";
|
||||
tag [ DEFAULT_NODE ] = "DEFAULT_NODE";
|
||||
tag [ BREAK_NODE ] = "BREAK_NODE";
|
||||
tag [ CONTINUE_NODE ] = "CONTINUE_NODE";
|
||||
tag [ RETURN_NODE ] = "RETURN_NODE";
|
||||
tag [ ASM_NODE ] = "ASM_NODE";
|
||||
tag [ SPAWN_NODE ] = "SPAWN_NODE";
|
||||
tag [ PARFOR_NODE ] = "PARFOR_NODE";
|
||||
tag [ PAR_NODE ] = "PAR_NODE";
|
||||
tag [ LABEL_STAT ] = "LABEL_STAT";
|
||||
tag [ PROS_COMM ] = "PROS_COMM";
|
||||
tag [ ATTR_DECL ] = "ATTR_DECL";
|
||||
tag [ NAMELIST_STAT ] = "NAMELIST_STAT";
|
||||
tag [ FUTURE_STMT ] = "FUTURE_STMT";
|
||||
tag [ COLLECTION_DECL ] = "COLLECTION_DECL";
|
||||
tag [ TEMPLATE_DECL ] = "TEMPLATE_DECL";
|
||||
tag [ TEMPLATE_FUNDECL ] = "TEMPLATE_FUNDECL";
|
||||
tag [ TECLASS_DECL ] = "TECLASS_DECL";
|
||||
tag [ ELSEWH_NODE ] = "ELSEWH_NODE";
|
||||
tag [ STATIC_STMT ] = "STATIC_STMT";
|
||||
tag [ INCLUDE_LINE ] = "INCLUDE_LINE";
|
||||
tag [ PREPROCESSOR_DIR ] = "PREPROCESSOR_DIR";
|
||||
tag [ PRINT_STAT ] = "PRINT_STAT";
|
||||
tag [ BACKSPACE_STAT ] = "BACKSPACE_STAT";
|
||||
tag [ REWIND_STAT ] = "REWIND_STAT";
|
||||
tag [ ENDFILE_STAT ] = "ENDFILE_STAT";
|
||||
tag [ INQUIRE_STAT ] = "INQUIRE_STAT";
|
||||
tag [ OPEN_STAT ] = "OPEN_STAT";
|
||||
tag [ CLOSE_STAT ] = "CLOSE_STAT";
|
||||
tag [ EXTERN_C_STAT ] = "EXTERN_C_STAT";
|
||||
tag [ INCLUDE_STAT ] = "INCLUDE_STAT";
|
||||
tag [ TRY_STAT ] = "TRY_STAT";
|
||||
tag [ CATCH_STAT ] = "CATCH_STAT";
|
||||
tag [ DVM_PARALLEL_ON_DIR ] = "DVM_PARALLEL_ON_DIR";
|
||||
tag [ DVM_SHADOW_START_DIR ] = "DVM_SHADOW_START_DIR";
|
||||
tag [ DVM_SHADOW_GROUP_DIR ] = "DVM_SHADOW_GROUP_DIR";
|
||||
tag [ DVM_SHADOW_WAIT_DIR ] = "DVM_SHADOW_WAIT_DIR";
|
||||
tag [ DVM_REDUCTION_START_DIR ] = "DVM_REDUCTION_START_DIR";
|
||||
tag [ DVM_REDUCTION_GROUP_DIR ] = "DVM_REDUCTION_GROUP_DIR";
|
||||
tag [ DVM_REDUCTION_WAIT_DIR ] = "DVM_REDUCTION_WAIT_DIR";
|
||||
tag [ DVM_DYNAMIC_DIR ] = "DVM_DYNAMIC_DIR";
|
||||
tag [ DVM_ALIGN_DIR ] = "DVM_ALIGN_DIR";
|
||||
tag [ DVM_REALIGN_DIR ] = "DVM_REALIGN_DIR";
|
||||
tag [ DVM_REALIGN_NEW_DIR ] = "DVM_REALIGN_NEW_DIR";
|
||||
tag [ DVM_REMOTE_ACCESS_DIR ] = "DVM_REMOTE_ACCESS_DIR";
|
||||
tag [ HPF_INDEPENDENT_DIR ] = "HPF_INDEPENDENT_DIR";
|
||||
tag [ DVM_SHADOW_DIR ] = "DVM_SHADOW_DIR";
|
||||
tag [ PARDO_NODE ] = "PARDO_NODE";
|
||||
tag [ PARSECTIONS_NODE ] = "PARSECTIONS_NODE";
|
||||
tag [ SECTION_NODE ] = "SECTION_NODE";
|
||||
tag [ GUARDS_NODE ] = "GUARDS_NODE";
|
||||
tag [ LOCK_NODE ] = "LOCK_NODE";
|
||||
tag [ UNLOCK_NODE ] = "UNLOCK_NODE";
|
||||
tag [ CRITSECTION_NODE ] = "CRITSECTION_NODE";
|
||||
tag [ POST_NODE ] = "POST_NODE";
|
||||
tag [ WAIT_NODE ] = "WAIT_NODE";
|
||||
tag [ CLEAR_NODE ] = "CLEAR_NODE";
|
||||
tag [ POSTSEQ_NODE ] = "POSTSEQ_NODE";
|
||||
tag [ WAITSEQ_NODE ] = "WAITSEQ_NODE";
|
||||
tag [ SETSEQ_NODE ] = "SETSEQ_NODE";
|
||||
tag [ ASSIGN_NODE ] = "ASSIGN_NODE";
|
||||
tag [ RELEASE_NODE ] = "RELEASE_NODE";
|
||||
tag [ PRIVATE_NODE ] = "PRIVATE_NODE";
|
||||
tag [ SCOMMON_NODE ] = "SCOMMON_NODE";
|
||||
tag [ PARREGION_NODE ] = "PARREGION_NODE";
|
||||
tag [ PDO_NODE ] = "PDO_NODE";
|
||||
tag [ PSECTIONS_NODE ] = "PSECTIONS_NODE";
|
||||
tag [ SINGLEPROCESS_NODE ] = "SINGLEPROCESS_NODE";
|
||||
tag [ SKIPPASTEOF_NODE ] = "SKIPPASTEOF_NODE";
|
||||
tag [ DVM_NEW_VALUE_DIR ] = "DVM_NEW_VALUE_DIR";
|
||||
tag [ DVM_VAR_DECL ] = "DVM_VAR_DECL";
|
||||
tag [ DVM_POINTER_DIR ] = "DVM_POINTER_DIR";
|
||||
tag [ INTENT_STMT ] = "INTENT_STMT";
|
||||
tag [ OPTIONAL_STMT ] = "OPTIONAL_STMT";
|
||||
tag [ PUBLIC_STMT ] = "PUBLIC_STMT";
|
||||
tag [ PRIVATE_STMT ] = "PRIVATE_STMT";
|
||||
tag [ ALLOCATABLE_STMT ] = "ALLOCATABLE_STMT";
|
||||
tag [ POINTER_STMT ] = "POINTER_STMT";
|
||||
tag [ TARGET_STMT ] = "TARGET_STMT";
|
||||
tag [ ALLOCATE_STMT ] = "ALLOCATE_STMT";
|
||||
tag [ NULLIFY_STMT ] = "NULLIFY_STMT";
|
||||
tag [ DEALLOCATE_STMT ] = "DEALLOCATE_STMT";
|
||||
tag [ SEQUENCE_STMT ] = "SEQUENCE_STMT";
|
||||
tag [ CYCLE_STMT ] = "CYCLE_STMT";
|
||||
tag [ EXIT_STMT ] = "EXIT_STMT";
|
||||
tag [ CONTAINS_STMT ] = "CONTAINS_STMT";
|
||||
tag [ WHERE_BLOCK_STMT ] = "WHERE_BLOCK_STMT";
|
||||
tag [ MODULE_STMT ] = "MODULE_STMT";
|
||||
tag [ USE_STMT ] = "USE_STMT";
|
||||
tag [ INTERFACE_STMT ] = "INTERFACE_STMT";
|
||||
tag [ MODULE_PROC_STMT ] = "MODULE_PROC_STMT";
|
||||
tag [ OVERLOADED_ASSIGN_STAT ] = "OVERLOADED_ASSIGN_STAT";
|
||||
tag [ POINTER_ASSIGN_STAT ] = "POINTER_ASSIGN_STAT";
|
||||
tag [ OVERLOADED_PROC_STAT ] = "OVERLOADED_PROC_STAT";
|
||||
tag [ DECOMPOSITION_STMT ] = "DECOMPOSITION_STMT";
|
||||
tag [ ALIGN_STMT ] = "ALIGN_STMT";
|
||||
tag [ DVM_DISTRIBUTE_DIR ] = "DVM_DISTRIBUTE_DIR";
|
||||
tag [ REDUCE_STMT ] = "REDUCE_STMT";
|
||||
tag [ PROS_HEDR ] = "PROS_HEDR";
|
||||
tag [ PROS_STAT ] = "PROS_STAT";
|
||||
tag [ PROS_STAT_LCTN ] = "PROS_STAT_LCTN";
|
||||
tag [ PROS_STAT_SUBM ] = "PROS_STAT_SUBM";
|
||||
tag [ PROCESSES_STAT ] = "PROCESSES_STAT";
|
||||
tag [ PROCESSES_END ] = "PROCESSES_END";
|
||||
tag [ PROCESS_DO_STAT ] = "PROCESS_DO_STAT";
|
||||
tag [ PROCESSORS_STAT ] = "PROCESSORS_STAT";
|
||||
tag [ CHANNEL_STAT ] = "CHANNEL_STAT";
|
||||
tag [ MERGER_STAT ] = "MERGER_STAT";
|
||||
tag [ MOVE_PORT ] = "MOVE_PORT";
|
||||
tag [ SEND_STAT ] = "SEND_STAT";
|
||||
tag [ RECEIVE_STAT ] = "RECEIVE_STAT";
|
||||
tag [ ENDCHANNEL_STAT ] = "ENDCHANNEL_STAT";
|
||||
tag [ PROBE_STAT ] = "PROBE_STAT";
|
||||
tag [ INPORT_DECL ] = "INPORT_DECL";
|
||||
tag [ OUTPORT_DECL ] = "OUTPORT_DECL";
|
||||
tag [ HPF_TEMPLATE_STAT ] = "HPF_TEMPLATE_STAT";
|
||||
tag [ HPF_ALIGN_STAT ] = "HPF_ALIGN_STAT";
|
||||
tag [ HPF_PROCESSORS_STAT ] = "HPF_PROCESSORS_STAT";
|
||||
tag [ DVM_REDISTRIBUTE_DIR ] = "DVM_REDISTRIBUTE_DIR";
|
||||
tag [ DVM_TASK_REGION_DIR ] = "DVM_TASK_REGION_DIR";
|
||||
tag [ DVM_END_TASK_REGION_DIR ] = "DVM_END_TASK_REGION_DIR";
|
||||
tag [ DVM_ON_DIR ] = "DVM_ON_DIR";
|
||||
tag [ DVM_END_ON_DIR ] = "DVM_END_ON_DIR";
|
||||
tag [ DVM_TASK_DIR ] = "DVM_TASK_DIR";
|
||||
tag [ DVM_MAP_DIR ] = "DVM_MAP_DIR";
|
||||
tag [ DVM_PARALLEL_TASK_DIR ] = "DVM_PARALLEL_TASK_DIR";
|
||||
tag [ DVM_INHERIT_DIR ] = "DVM_INHERIT_DIR";
|
||||
tag [ DVM_INDIRECT_GROUP_DIR ] = "DVM_INDIRECT_GROUP_DIR";
|
||||
tag [ DVM_INDIRECT_ACCESS_DIR ] = "DVM_INDIRECT_ACCESS_DIR";
|
||||
tag [ DVM_REMOTE_GROUP_DIR ] = "DVM_REMOTE_GROUP_DIR";
|
||||
tag [ DVM_RESET_DIR ] = "DVM_RESET_DIR";
|
||||
tag [ DVM_PREFETCH_DIR ] = "DVM_PREFETCH_DIR";
|
||||
tag [ DVM_OWN_DIR ] = "DVM_OWN_DIR";
|
||||
tag [ DVM_HEAP_DIR ] = "DVM_HEAP_DIR";
|
||||
tag [ DVM_ASYNCID_DIR ] = "DVM_ASYNCID_DIR";
|
||||
tag [ DVM_ASYNCHRONOUS_DIR ] = "DVM_ASYNCHRONOUS_DIR";
|
||||
tag [ DVM_ENDASYNCHRONOUS_DIR ] = "DVM_ENDASYNCHRONOUS_DIR";
|
||||
tag [ DVM_ASYNCWAIT_DIR ] = "DVM_ASYNCWAIT_DIR";
|
||||
tag [ DVM_F90_DIR ] = "DVM_F90_DIR";
|
||||
tag [ DVM_BARRIER_DIR ] = "DVM_BARRIER_DIR";
|
||||
tag [ FORALL_STAT ] = "FORALL_STAT";
|
||||
tag [ DVM_CONSISTENT_GROUP_DIR ] = "DVM_CONSISTENT_GROUP_DIR";
|
||||
tag [ DVM_CONSISTENT_START_DIR ] = "DVM_CONSISTENT_START_DIR";
|
||||
tag [ DVM_CONSISTENT_WAIT_DIR ] = "DVM_CONSISTENT_WAIT_DIR";
|
||||
tag [ DVM_CONSISTENT_DIR ] = "DVM_CONSISTENT_DIR";
|
||||
tag [ DVM_CHECK_DIR ] = "DVM_CHECK_DIR";
|
||||
tag [ DVM_IO_MODE_DIR ] = "DVM_IO_MODE_DIR";
|
||||
tag [ DVM_LOCALIZE_DIR ] = "DVM_LOCALIZE_DIR";
|
||||
tag [ DVM_SHADOW_ADD_DIR ] = "DVM_SHADOW_ADD_DIR";
|
||||
tag [ DVM_CP_CREATE_DIR ] = "DVM_CP_CREATE_DIR";
|
||||
tag [ DVM_CP_LOAD_DIR ] = "DVM_CP_LOAD_DIR";
|
||||
tag [ DVM_CP_SAVE_DIR ] = "DVM_CP_SAVE_DIR";
|
||||
tag [ DVM_CP_WAIT_DIR ] = "DVM_CP_WAIT_DIR";
|
||||
tag [ DVM_EXIT_INTERVAL_DIR ] = "DVM_EXIT_INTERVAL_DIR";
|
||||
tag [ DVM_TEMPLATE_CREATE_DIR ] = "DVM_TEMPLATE_CREATE_DIR";
|
||||
tag [ DVM_TEMPLATE_DELETE_DIR ] = "DVM_TEMPLATE_DELETE_DIR";
|
||||
|
||||
/***************** variant tags for low level nodes ********************/
|
||||
|
||||
tag [ INT_VAL ] = "INT_VAL";
|
||||
tag [ FLOAT_VAL ] = "FLOAT_VAL";
|
||||
tag [ DOUBLE_VAL ] = "DOUBLE_VAL";
|
||||
tag [ BOOL_VAL ] = "BOOL_VAL";
|
||||
tag [ CHAR_VAL ] = "CHAR_VAL";
|
||||
tag [ STRING_VAL ] = "STRING_VAL";
|
||||
tag [ CONST_REF ] = "CONST_REF";
|
||||
tag [ VAR_REF ] = "VAR_REF";
|
||||
tag [ ARRAY_REF ] = "ARRAY_REF";
|
||||
tag [ RECORD_REF ] = "RECORD_REF";
|
||||
tag [ ENUM_REF ] = "ENUM_REF";
|
||||
tag [ VAR_LIST ] = "VAR_LIST";
|
||||
tag [ EXPR_LIST ] = "EXPR_LIST";
|
||||
tag [ RANGE_LIST ] = "RANGE_LIST";
|
||||
tag [ CASE_CHOICE ] = "CASE_CHOICE";
|
||||
tag [ DEF_CHOICE ] = "DEF_CHOICE";
|
||||
tag [ VARIANT_CHOICE ] = "VARIANT_CHOICE";
|
||||
tag [ COMPLEX_VAL ] = "COMPLEX_VAL";
|
||||
tag [ LABEL_REF ] = "LABEL_REF";
|
||||
tag [ KEYWORD_VAL ] = "KEYWORD_VAL";
|
||||
tag [ DDOT ] = "DDOT";
|
||||
tag [ RANGE_OP ] = "RANGE_OP";
|
||||
tag [ UPPER_OP ] = "UPPER_OP";
|
||||
tag [ LOWER_OP ] = "LOWER_OP";
|
||||
tag [ EQ_OP ] = "EQ_OP";
|
||||
tag [ LT_OP ] = "LT_OP";
|
||||
tag [ GT_OP ] = "GT_OP";
|
||||
tag [ NOTEQL_OP ] = "NOTEQL_OP";
|
||||
tag [ LTEQL_OP ] = "LTEQL_OP";
|
||||
tag [ GTEQL_OP ] = "GTEQL_OP";
|
||||
tag [ ADD_OP ] = "ADD_OP";
|
||||
tag [ SUBT_OP ] = "SUBT_OP";
|
||||
tag [ OR_OP ] = "OR_OP";
|
||||
tag [ MULT_OP ] = "MULT_OP";
|
||||
tag [ DIV_OP ] = "DIV_OP";
|
||||
tag [ MOD_OP ] = "MOD_OP";
|
||||
tag [ AND_OP ] = "AND_OP";
|
||||
tag [ EXP_OP ] = "EXP_OP";
|
||||
tag [ ARRAY_MULT ] = "ARRAY_MULT";
|
||||
tag [ CONCAT_OP ] = "CONCAT_OP";
|
||||
tag [ XOR_OP ] = "XOR_OP";
|
||||
tag [ EQV_OP ] = "EQV_OP";
|
||||
tag [ NEQV_OP ] = "NEQV_OP";
|
||||
tag [ MINUS_OP ] = "MINUS_OP";
|
||||
tag [ NOT_OP ] = "NOT_OP";
|
||||
tag [ ASSGN_OP ] = "ASSGN_OP";
|
||||
tag [ DEREF_OP ] = "DEREF_OP";
|
||||
tag [ POINTST_OP ] = "POINTST_OP";
|
||||
tag [ FUNCTION_OP ] = "FUNCTION_OP";
|
||||
tag [ MINUSMINUS_OP ] = "MINUSMINUS_OP";
|
||||
tag [ PLUSPLUS_OP ] = "PLUSPLUS_OP";
|
||||
tag [ BITAND_OP ] = "BITAND_OP";
|
||||
tag [ BITOR_OP ] = "BITOR_OP";
|
||||
tag [ STAR_RANGE ] = "STAR_RANGE";
|
||||
tag [ PROC_CALL ] = "PROC_CALL";
|
||||
tag [ FUNC_CALL ] = "FUNC_CALL";
|
||||
tag [ CONSTRUCTOR_REF ] = "CONSTRUCTOR_REF";
|
||||
tag [ ACCESS_REF ] = "ACCESS_REF";
|
||||
tag [ CONS ] = "CONS";
|
||||
tag [ ACCESS ] = "ACCESS";
|
||||
tag [ IOACCESS ] = "IOACCESS";
|
||||
tag [ CONTROL_LIST ] = "CONTROL_LIST";
|
||||
tag [ SEQ ] = "SEQ";
|
||||
tag [ SPEC_PAIR ] = "SPEC_PAIR";
|
||||
tag [ COMM_LIST ] = "COMM_LIST";
|
||||
tag [ STMT_STR ] = "STMT_STR";
|
||||
tag [ EQUI_LIST ] = "EQUI_LIST";
|
||||
tag [ IMPL_TYPE ] = "IMPL_TYPE";
|
||||
tag [ STMTFN_DECL ] = "STMTFN_DECL";
|
||||
tag [ BIT_COMPLEMENT_OP ] = "BIT_COMPLEMENT_OP";
|
||||
tag [ EXPR_IF ] = "EXPR_IF";
|
||||
tag [ EXPR_IF_BODY ] = "EXPR_IF_BODY";
|
||||
tag [ FUNCTION_REF ] = "FUNCTION_REF";
|
||||
tag [ LSHIFT_OP ] = "LSHIFT_OP";
|
||||
tag [ RSHIFT_OP ] = "RSHIFT_OP";
|
||||
tag [ UNARY_ADD_OP ] = "UNARY_ADD_OP";
|
||||
tag [ SIZE_OP ] = "SIZE_OP";
|
||||
tag [ INTEGER_DIV_OP ] = "INTEGER_DIV_OP";
|
||||
tag [ SUB_OP ] = "SUB_OP";
|
||||
tag [ LE_OP ] = "LE_OP";
|
||||
tag [ GE_OP ] = "GE_OP";
|
||||
tag [ NE_OP ] = "NE_OP";
|
||||
tag [ CLASSINIT_OP ] = "CLASSINIT_OP";
|
||||
tag [ CAST_OP ] = "CAST_OP";
|
||||
tag [ ADDRESS_OP ] = "ADDRESS_OP";
|
||||
tag [ POINSTAT_OP ] = "POINSTAT_OP";
|
||||
tag [ COPY_NODE ] = "COPY_NODE";
|
||||
tag [ INIT_LIST ] = "INIT_LIST";
|
||||
tag [ VECTOR_CONST ] = "VECTOR_CONST";
|
||||
tag [ BIT_NUMBER ] = "BIT_NUMBER";
|
||||
tag [ ARITH_ASSGN_OP ] = "ARITH_ASSGN_OP";
|
||||
tag [ ARRAY_OP ] = "ARRAY_OP";
|
||||
tag [ NEW_OP ] = "NEW_OP";
|
||||
tag [ DELETE_OP ] = "DELETE_OP";
|
||||
tag [ NAMELIST_LIST ] = "NAMELIST_LIST";
|
||||
tag [ THIS_NODE ] = "THIS_NODE";
|
||||
tag [ SCOPE_OP ] = "SCOPE_OP";
|
||||
tag [ PLUS_ASSGN_OP ] = "PLUS_ASSGN_OP";
|
||||
tag [ MINUS_ASSGN_OP ] = "MINUS_ASSGN_OP";
|
||||
tag [ AND_ASSGN_OP ] = "AND_ASSGN_OP";
|
||||
tag [ IOR_ASSGN_OP ] = "IOR_ASSGN_OP";
|
||||
tag [ MULT_ASSGN_OP ] = "MULT_ASSGN_OP";
|
||||
tag [ DIV_ASSGN_OP ] = "DIV_ASSGN_OP";
|
||||
tag [ MOD_ASSGN_OP ] = "MOD_ASSGN_OP";
|
||||
tag [ XOR_ASSGN_OP ] = "XOR_ASSGN_OP";
|
||||
tag [ LSHIFT_ASSGN_OP ] = "LSHIFT_ASSGN_OP";
|
||||
tag [ RSHIFT_ASSGN_OP ] = "RSHIFT_ASSGN_OP";
|
||||
tag [ ORDERED_OP ] = "ORDERED_OP";
|
||||
tag [ EXTEND_OP ] = "EXTEND_OP";
|
||||
tag [ MAXPARALLEL_OP ] = "MAXPARALLEL_OP";
|
||||
tag [ SAMETYPE_OP ] = "SAMETYPE_OP";
|
||||
tag [ TYPE_REF ] = "TYPE_REF";
|
||||
tag [ STRUCTURE_CONSTRUCTOR ] = "STRUCTURE_CONSTRUCTOR";
|
||||
tag [ ARRAY_CONSTRUCTOR ] = "ARRAY_CONSTRUCTOR";
|
||||
tag [ SECTION_REF ] = "SECTION_REF";
|
||||
tag [ VECTOR_SUBSCRIPT ] = "VECTOR_SUBSCRIPT";
|
||||
tag [ SECTION_OPERANDS ] = "SECTION_OPERANDS";
|
||||
tag [ KEYWORD_ARG ] = "KEYWORD_ARG";
|
||||
tag [ OVERLOADED_CALL ] = "OVERLOADED_CALL";
|
||||
tag [ INTERFACE_REF ] = "INTERFACE_REF";
|
||||
tag [ RENAME_NODE ] = "RENAME_NODE";
|
||||
tag [ TYPE_NODE ] = "TYPE_NODE";
|
||||
tag [ PAREN_OP ] = "PAREN_OP";
|
||||
tag [ PARAMETER_OP ] = "PARAMETER_OP";
|
||||
tag [ PUBLIC_OP ] = "PUBLIC_OP";
|
||||
tag [ PRIVATE_OP ] = "PRIVATE_OP";
|
||||
tag [ ALLOCATABLE_OP ] = "ALLOCATABLE_OP";
|
||||
tag [ DIMENSION_OP ] = "DIMENSION_OP";
|
||||
tag [ EXTERNAL_OP ] = "EXTERNAL_OP";
|
||||
tag [ IN_OP ] = "IN_OP";
|
||||
tag [ OUT_OP ] = "OUT_OP";
|
||||
tag [ INOUT_OP ] = "INOUT_OP";
|
||||
tag [ INTRINSIC_OP ] = "INTRINSIC_OP";
|
||||
tag [ POINTER_OP ] = "POINTER_OP";
|
||||
tag [ OPTIONAL_OP ] = "OPTIONAL_OP";
|
||||
tag [ SAVE_OP ] = "SAVE_OP";
|
||||
tag [ TARGET_OP ] = "TARGET_OP";
|
||||
tag [ ONLY_NODE ] = "ONLY_NODE";
|
||||
tag [ LEN_OP ] = "LEN_OP";
|
||||
tag [ TYPE_OP ] = "TYPE_OP";
|
||||
tag [ DOTSTAR_OP ] = "DOTSTAR_OP";
|
||||
tag [ ARROWSTAR_OP ] = "ARROWSTAR_OP";
|
||||
tag [ FORDECL_OP ] = "FORDECL_OP";
|
||||
tag [ THROW_OP ] = "THROW_OP";
|
||||
tag [ PROCESSORS_REF ] = "PROCESSORS_REF";
|
||||
tag [ PORT_TYPE_OP ] = "PORT_TYPE_OP";
|
||||
tag [ INPORT_TYPE_OP ] = "INPORT_TYPE_OP";
|
||||
tag [ OUTPORT_TYPE_OP ] = "OUTPORT_TYPE_OP";
|
||||
tag [ INPORT_NAME ] = "INPORT_NAME";
|
||||
tag [ OUTPORT_NAME ] = "OUTPORT_NAME";
|
||||
tag [ FROMPORT_NAME ] = "FROMPORT_NAME";
|
||||
tag [ TOPORT_NAME ] = "TOPORT_NAME";
|
||||
tag [ IOSTAT_STORE ] = "IOSTAT_STORE";
|
||||
tag [ EMPTY_STORE ] = "EMPTY_STORE";
|
||||
tag [ ERR_LABEL ] = "ERR_LABEL";
|
||||
tag [ END_LABEL ] = "END_LABEL";
|
||||
tag [ PROS_CALL ] = "PROS_CALL";
|
||||
tag [ STATIC_OP ] = "STATIC_OP";
|
||||
tag [ LABEL_ARG ] = "LABEL_ARG";
|
||||
tag [ DATA_IMPL_DO ] = "DATA_IMPL_DO";
|
||||
tag [ DATA_ELT ] = "DATA_ELT";
|
||||
tag [ DATA_SUBS ] = "DATA_SUBS";
|
||||
tag [ DATA_RANGE ] = "DATA_RANGE";
|
||||
tag [ ICON_EXPR ] = "ICON_EXPR";
|
||||
tag [ BLOCK_OP ] = "BLOCK_OP";
|
||||
tag [ NEW_SPEC_OP ] = "NEW_SPEC_OP";
|
||||
tag [ REDUCTION_OP ] = "REDUCTION_OP";
|
||||
tag [ SHADOW_RENEW_OP ] = "SHADOW_RENEW_OP";
|
||||
tag [ SHADOW_START_OP ] = "SHADOW_START_OP";
|
||||
tag [ SHADOW_WAIT_OP ] = "SHADOW_WAIT_OP";
|
||||
tag [ DIAG_OP ] = "DIAG_OP";
|
||||
tag [ REMOTE_ACCESS_OP ] = "REMOTE_ACCESS_OP";
|
||||
tag [ TEMPLATE_OP ] = "TEMPLATE_OP";
|
||||
tag [ PROCESSORS_OP ] = "PROCESSORS_OP";
|
||||
tag [ DYNAMIC_OP ] = "DYNAMIC_OP";
|
||||
tag [ ALIGN_OP ] = "ALIGN_OP";
|
||||
tag [ DISTRIBUTE_OP ] = "DISTRIBUTE_OP";
|
||||
tag [ SHADOW_OP ] = "SHADOW_OP";
|
||||
tag [ INDIRECT_ACCESS_OP ] = "INDIRECT_ACCESS_OP";
|
||||
tag [ ACROSS_OP ] = "ACROSS_OP";
|
||||
tag [ NEW_VALUE_OP ] = "NEW_VALUE_OP";
|
||||
tag [ SHADOW_COMP_OP ] = "SHADOW_COMP_OP";
|
||||
tag [ STAGE_OP ] = "STAGE_OP";
|
||||
tag [ FORALL_OP ] = "FORALL_OP";
|
||||
tag [ CONSISTENT_OP ] = "CONSISTENT_OP";
|
||||
tag [ INTERFACE_OPERATOR ] = "INTERFACE_OPERATOR";
|
||||
tag [ INTERFACE_ASSIGNMENT ] = "INTERFACE_ASSIGNMENT";
|
||||
tag [ VAR_DECL_90 ] = "VAR_DECL_90";
|
||||
tag [ ASSIGNMENT_OP ] = "ASSIGNMENT_OP";
|
||||
tag [ OPERATOR_OP ] = "OPERATOR_OP";
|
||||
tag [ KIND_OP ] = "KIND_OP";
|
||||
tag [ LENGTH_OP ] = "LENGTH_OP";
|
||||
tag [ RECURSIVE_OP ] = "RECURSIVE_OP";
|
||||
tag [ ELEMENTAL_OP ] = "ELEMENTAL_OP";
|
||||
tag [ PURE_OP ] = "PURE_OP";
|
||||
tag [ DEFINED_OP ] = "DEFINED_OP";
|
||||
tag [ PARALLEL_OP ] = "PARALLEL_OP";
|
||||
tag [ INDIRECT_OP ] = "INDIRECT_OP";
|
||||
tag [ DERIVED_OP ] = "DERIVED_OP";
|
||||
tag [ DUMMY_REF ] = "DUMMY_REF";
|
||||
tag [ COMMON_OP ] = "COMMON_OP";
|
||||
tag [ SHADOW_NAMES_OP ] = "SHADOW_NAMES_OP";
|
||||
|
||||
/***************** variant tags for symbol table entries ********************/
|
||||
|
||||
tag [ CONST_NAME ] = "CONST_NAME";
|
||||
tag [ ENUM_NAME ] = "ENUM_NAME";
|
||||
tag [ FIELD_NAME ] = "FIELD_NAME";
|
||||
tag [ VARIABLE_NAME ] = "VARIABLE_NAME";
|
||||
tag [ TYPE_NAME ] = "TYPE_NAME";
|
||||
tag [ PROGRAM_NAME ] = "PROGRAM_NAME";
|
||||
tag [ PROCEDURE_NAME ] = "PROCEDURE_NAME";
|
||||
tag [ VAR_FIELD ] = "VAR_FIELD";
|
||||
tag [ LABEL_VAR ] = "LABEL_VAR";
|
||||
tag [ FUNCTION_NAME ] = "FUNCTION_NAME";
|
||||
tag [ MEMBER_FUNC ] = "MEMBER_FUNC";
|
||||
tag [ CLASS_NAME ] = "CLASS_NAME";
|
||||
tag [ UNION_NAME ] = "UNION_NAME";
|
||||
tag [ STRUCT_NAME ] = "STRUCT_NAME";
|
||||
tag [ LABEL_NAME ] = "LABEL_NAME";
|
||||
tag [ COLLECTION_NAME ] = "COLLECTION_NAME";
|
||||
tag [ ROUTINE_NAME ] = "ROUTINE_NAME";
|
||||
tag [ CONSTRUCT_NAME ] = "CONSTRUCT_NAME";
|
||||
tag [ INTERFACE_NAME ] = "INTERFACE_NAME";
|
||||
tag [ MODULE_NAME ] = "MODULE_NAME";
|
||||
tag [ TEMPLATE_CL_NAME ] = "TEMPLATE_CL_NAME";
|
||||
tag [ TEMPLATE_FN_NAME ] = "TEMPLATE_FN_NAME";
|
||||
tag [ TECLASS_NAME ] = "TECLASS_NAME";
|
||||
tag [ SHADOW_GROUP_NAME ] = "SHADOW_GROUP_NAME";
|
||||
tag [ REDUCTION_GROUP_NAME ] = "REDUCTION_GROUP_NAME";
|
||||
tag [ REF_GROUP_NAME ] = "REF_GROUP_NAME";
|
||||
tag [ ASYNC_ID ] = "ASYNC_ID";
|
||||
tag [ CONSISTENT_GROUP_NAME ] = "CONSISTENT_GROUP_NAME";
|
||||
tag [ NAMELIST_NAME ] = "NAMELIST_NAME";
|
||||
tag [ COMMON_NAME ] = "COMMON_NAME";
|
||||
|
||||
tag [ DEFAULT ] = "DEFAULT";
|
||||
tag [ T_INT ] = "T_INT";
|
||||
tag [ T_FLOAT ] = "T_FLOAT";
|
||||
tag [ T_DOUBLE ] = "T_DOUBLE";
|
||||
tag [ T_CHAR ] = "T_CHAR";
|
||||
tag [ T_BOOL ] = "T_BOOL";
|
||||
tag [ T_STRING ] = "T_STRING";
|
||||
tag [ T_ENUM ] = "T_ENUM";
|
||||
tag [ T_SUBRANGE ] = "T_SUBRANGE";
|
||||
tag [ T_LIST ] = "T_LIST";
|
||||
tag [ T_ARRAY ] = "T_ARRAY";
|
||||
tag [ T_RECORD ] = "T_RECORD";
|
||||
tag [ T_ENUM_FIELD ] = "T_ENUM_FIELD";
|
||||
tag [ T_UNKNOWN ] = "T_UNKNOWN";
|
||||
tag [ T_COMPLEX ] = "T_COMPLEX";
|
||||
tag [ T_VOID ] = "T_VOID";
|
||||
tag [ T_DESCRIPT ] = "T_DESCRIPT";
|
||||
tag [ T_FUNCTION ] = "T_FUNCTION";
|
||||
tag [ T_POINTER ] = "T_POINTER";
|
||||
tag [ T_UNION ] = "T_UNION";
|
||||
tag [ T_STRUCT ] = "T_STRUCT";
|
||||
tag [ T_CLASS ] = "T_CLASS";
|
||||
tag [ T_DERIVED_CLASS ] = "T_DERIVED_CLASS";
|
||||
tag [ T_DERIVED_TYPE ] = "T_DERIVED_TYPE";
|
||||
tag [ T_COLLECTION ] = "T_COLLECTION";
|
||||
tag [ T_DERIVED_COLLECTION ] = "T_DERIVED_COLLECTION";
|
||||
tag [ T_REFERENCE ] = "T_REFERENCE";
|
||||
tag [ T_DERIVED_TEMPLATE ] = "T_DERIVED_TEMPLATE";
|
||||
tag [ T_MEMBER_POINTER ] = "T_MEMBER_POINTER";
|
||||
tag [ T_TECLASS ] = "T_TECLASS";
|
||||
tag [ T_GATE ] = "T_GATE";
|
||||
tag [ T_EVENT ] = "T_EVENT";
|
||||
tag [ T_SEQUENCE ] = "T_SEQUENCE";
|
||||
tag [ T_DCOMPLEX ] = "T_DCOMPLEX";
|
||||
tag [ T_LONG ] = "T_LONG";
|
||||
tag [ BY_USE ] = "BY_USE";
|
||||
tag [ LOCAL ] = "LOCAL";
|
||||
tag [ INPUT ] = "INPUT";
|
||||
tag [ OUTPUT ] = "OUTPUT";
|
||||
tag [ IO ] = "IO";
|
||||
tag [ PROCESS_NAME ] = "PROCESS_NAME";
|
||||
|
||||
tag [ OMP_PRIVATE ] = "OMP_PRIVATE";
|
||||
tag [ OMP_SHARED ] = "OMP_SHARED";
|
||||
tag [ OMP_FIRSTPRIVATE ] = "OMP_FIRSTPRIVATE";
|
||||
tag [ OMP_LASTPRIVATE ] = "OMP_LASTPRIVATE";
|
||||
tag [ OMP_THREADPRIVATE ] = "OMP_THREADPRIVATE";
|
||||
tag [ OMP_COPYIN ] = "OMP_COPYIN";
|
||||
tag [ OMP_COPYPRIVATE ] = "OMP_COPYPRIVATE";
|
||||
tag [ OMP_DEFAULT ] = "OMP_DEFAULT";
|
||||
tag [ OMP_ORDERED ] = "OMP_ORDERED";
|
||||
tag [ OMP_SCHEDULE ] = "OMP_SCHEDULE";
|
||||
tag [ OMP_REDUCTION ] = "OMP_REDUCTION";
|
||||
tag [ OMP_IF ] = "OMP_IF";
|
||||
tag [ OMP_NUM_THREADS ] = "OMP_NUM_THREADS";
|
||||
tag [ OMP_NOWAIT ] = "OMP_NOWAIT";
|
||||
tag [ OMP_PARALLEL_DIR ] = "OMP_PARALLEL_DIR";
|
||||
tag [ OMP_END_PARALLEL_DIR ] = "OMP_END_PARALLEL_DIR";
|
||||
tag [ OMP_DO_DIR ] = "OMP_DO_DIR";
|
||||
tag [ OMP_END_DO_DIR ] = "OMP_END_DO_DIR";
|
||||
tag [ OMP_SECTIONS_DIR ] = "OMP_SECTIONS_DIR";
|
||||
tag [ OMP_END_SECTIONS_DIR ] = "OMP_END_SECTIONS_DIR";
|
||||
tag [ OMP_SECTION_DIR ] = "OMP_SECTION_DIR";
|
||||
tag [ OMP_SINGLE_DIR ] = "OMP_SINGLE_DIR";
|
||||
tag [ OMP_END_SINGLE_DIR ] = "OMP_END_SINGLE_DIR";
|
||||
tag [ OMP_WORKSHARE_DIR ] = "OMP_WORKSHARE_DIR";
|
||||
tag [ OMP_END_WORKSHARE_DIR ] = "OMP_END_WORKSHARE_DIR";
|
||||
tag [ OMP_PARALLEL_DO_DIR ] = "OMP_PARALLEL_DO_DIR";
|
||||
tag [ OMP_END_PARALLEL_DO_DIR ] = "OMP_END_PARALLEL_DO_DIR";
|
||||
tag [ OMP_PARALLEL_SECTIONS_DIR ] = "OMP_PARALLEL_SECTIONS_DIR";
|
||||
tag [ OMP_END_PARALLEL_SECTIONS_DIR ] = "OMP_END_PARALLEL_SECTIONS_DIR";
|
||||
tag [ OMP_PARALLEL_WORKSHARE_DIR ] = "OMP_PARALLEL_WORKSHARE_DIR";
|
||||
tag [ OMP_END_PARALLEL_WORKSHARE_DIR ] = "OMP_END_PARALLEL_WORKSHARE_DIR";
|
||||
tag [ OMP_MASTER_DIR ] = "OMP_MASTER_DIR";
|
||||
tag [ OMP_END_MASTER_DIR ] = "OMP_END_MASTER_DIR";
|
||||
tag [ OMP_CRITICAL_DIR ] = "OMP_CRITICAL_DIR";
|
||||
tag [ OMP_END_CRITICAL_DIR ] = "OMP_END_CRITICAL_DIR";
|
||||
tag [ OMP_BARRIER_DIR ] = "OMP_BARRIER_DIR";
|
||||
tag [ OMP_ATOMIC_DIR ] = "OMP_ATOMIC_DIR";
|
||||
tag [ OMP_FLUSH_DIR ] = "OMP_FLUSH_DIR";
|
||||
tag [ OMP_ORDERED_DIR ] = "OMP_ORDERED_DIR";
|
||||
tag [ OMP_END_ORDERED_DIR ] = "OMP_END_ORDERED_DIR";
|
||||
tag [ RECORD_DECL ] = "RECORD_DECL";
|
||||
tag [ FUNC_STAT ] = "FUNC_STAT";
|
||||
tag [ OMP_ONETHREAD_DIR ] = "OMP_ONETHREAD_DIR";
|
||||
tag [ OMP_THREADPRIVATE_DIR ] = "OMP_THREADPRIVATE_DIR";
|
||||
tag [ OMP_DEFAULT_SECTION_DIR ] = "OMP_DEFAULT_SECTION_DIR";
|
||||
tag [ OMP_COLLAPSE ] = "OMP_COLLAPSE";
|
||||
|
||||
tag [ ACC_REGION_DIR ] = "ACC_REGION_DIR";
|
||||
tag [ ACC_END_REGION_DIR ] = "ACC_END_REGION_DIR";
|
||||
tag [ ACC_CALL_STMT ] = "ACC_CALL_STMT";
|
||||
tag [ ACC_KERNEL_HEDR ] = "ACC_KERNEL_HEDR";
|
||||
tag [ ACC_GET_ACTUAL_DIR ] = "ACC_GET_ACTUAL_DIR";
|
||||
tag [ ACC_ACTUAL_DIR ] = "ACC_ACTUAL_DIR";
|
||||
tag [ ACC_CHECKSECTION_DIR ] = "ACC_CHECKSECTION_DIR";
|
||||
tag [ ACC_END_CHECKSECTION_DIR ] = "ACC_END_CHECKSECTION_DIR";
|
||||
tag [ ACC_ROUTINE_DIR ] = "ACC_ROUTINE_DIR";
|
||||
|
||||
tag [ ACC_TIE_OP ] = "ACC_TIE_OP";
|
||||
tag [ ACC_INLOCAL_OP ] = "ACC_INLOCAL_OP";
|
||||
tag [ ACC_INOUT_OP ] = "ACC_INOUT_OP";
|
||||
tag [ ACC_IN_OP ] = "ACC_IN_OP";
|
||||
tag [ ACC_OUT_OP ] = "ACC_OUT_OP";
|
||||
tag [ ACC_LOCAL_OP ] = "ACC_LOCAL_OP";
|
||||
tag [ ACC_PRIVATE_OP ] = "ACC_PRIVATE_OP";
|
||||
tag [ ACC_DEVICE_OP ] = "ACC_DEVICE_OP";
|
||||
tag [ ACC_CUDA_OP ] = "ACC_CUDA_OP";
|
||||
tag [ ACC_HOST_OP ] = "ACC_HOST_OP";
|
||||
|
||||
tag [ ACC_GLOBAL_OP ] = "ACC_GLOBAL_OP";
|
||||
tag [ ACC_ATTRIBUTES_OP ] = "ACC_ATTRIBUTES_OP";
|
||||
tag [ ACC_VALUE_OP ] = "ACC_VALUE_OP";
|
||||
tag [ ACC_SHARED_OP ] = "ACC_SHARED_OP";
|
||||
tag [ ACC_CONSTANT_OP ] = "ACC_CONSTANT_OP";
|
||||
tag [ ACC_USES_OP ] = "ACC_USES_OP";
|
||||
tag [ ACC_CALL_OP ] = "ACC_CALL_OP";
|
||||
tag [ ACC_CUDA_BLOCK_OP ] = "ACC_CUDA_BLOCK_OP";
|
||||
|
||||
tag [ ACC_TARGETS_OP ] = "ACC_TARGETS_OP";
|
||||
tag [ ACC_ASYNC_OP ] = "ACC_ASYNC_OP";
|
||||
|
||||
tag [ SPF_ANALYSIS_DIR ] = "SPF_ANALYSIS_DIR";
|
||||
tag [ SPF_PARALLEL_DIR ] = "SPF_PARALLEL_DIR";
|
||||
tag [ SPF_TRANSFORM_DIR ] = "SPF_TRANSFORM_DIR";
|
||||
tag [ SPF_NOINLINE_OP ] = "SPF_NOINLINE_OP";
|
||||
tag [ SPF_PARALLEL_REG_DIR ] = "SPF_PARALLEL_REG_DIR";
|
||||
tag [ SPF_END_PARALLEL_REG_DIR ] = "SPF_END_PARALLEL_REG_DIR";
|
||||
tag [ SPF_REGION_NAME ] = "SPF_REGION_NAME";
|
||||
tag [ SPF_EXPAND_OP ] = "SPF_EXPAND_OP";
|
||||
tag [ SPF_FISSION_OP ] = "SPF_FISSION_OP";
|
||||
tag [ SPF_SHRINK_OP ] = "SPF_SHRINK_OP";
|
||||
tag [ SPF_CHECKPOINT_DIR ] = "SPF_CHECKPOINT_DIR";
|
||||
tag [ SPF_TYPE_OP ] = "SPF_TYPE_OP";
|
||||
tag [ SPF_VARLIST_OP ] = "SPF_VARLIST_OP";
|
||||
tag [ SPF_EXCEPT_OP ] = "SPF_EXCEPT_OP";
|
||||
tag [ SPF_FILES_COUNT_OP ] = "SPF_FILES_COUNT_OP";
|
||||
tag [ SPF_INTERVAL_OP ] = "SPF_INTERVAL_OP";
|
||||
tag [ SPF_TIME_OP ] = "SPF_TIME_OP";
|
||||
tag [ SPF_ITER_OP ] = "SPF_ITER_OP";
|
||||
tag [ SPF_FLEXIBLE_OP ] = "SPF_FLEXIBLE_OP";
|
||||
tag [ SPF_PARAMETER_OP ] = "SPF_PARAMETER_OP";
|
||||
tag [ SPF_CODE_COVERAGE_OP ] = "SPF_CODE_COVERAGE_OP";
|
||||
tag [ SPF_UNROLL_OP ] = "SPF_UNROLL_OP";
|
||||
352
dvm/fdvm/trunk/parser/tokdefs.h
Normal file
352
dvm/fdvm/trunk/parser/tokdefs.h
Normal file
@@ -0,0 +1,352 @@
|
||||
#define PERCENT 1
|
||||
#define AMPERSAND 2
|
||||
#define ASTER 3
|
||||
#define CLUSTER 4
|
||||
#define COLON 5
|
||||
#define COMMA 6
|
||||
#define DASTER 7
|
||||
#define DEFINED_OPERATOR 8
|
||||
#define DOT 9
|
||||
#define DQUOTE 10
|
||||
#define GLOBAL_A 11
|
||||
#define LEFTAB 12
|
||||
#define LEFTPAR 13
|
||||
#define MINUS 14
|
||||
#define PLUS 15
|
||||
#define POINT_TO 16
|
||||
#define QUOTE 17
|
||||
#define RIGHTAB 18
|
||||
#define RIGHTPAR 19
|
||||
#define AND 20
|
||||
#define DSLASH 21
|
||||
#define EQV 22
|
||||
#define EQ 23
|
||||
#define EQUAL 24
|
||||
#define FFALSE 25
|
||||
#define GE 26
|
||||
#define GT 27
|
||||
#define LE 28
|
||||
#define LT 29
|
||||
#define NE 30
|
||||
#define NEQV 31
|
||||
#define NOT 32
|
||||
#define OR 33
|
||||
#define TTRUE 34
|
||||
#define SLASH 35
|
||||
#define XOR 36
|
||||
#define REFERENCE 37
|
||||
#define AT 38
|
||||
#define ACROSS 39
|
||||
#define ALIGN_WITH 40
|
||||
#define ALIGN 41
|
||||
#define ALLOCATABLE 42
|
||||
#define ALLOCATE 43
|
||||
#define ARITHIF 44
|
||||
#define ASSIGNMENT 45
|
||||
#define ASSIGN 46
|
||||
#define ASSIGNGOTO 47
|
||||
#define ASYNCHRONOUS 48
|
||||
#define ASYNCID 49
|
||||
#define ASYNCWAIT 50
|
||||
#define BACKSPACE 51
|
||||
#define BAD_CCONST 52
|
||||
#define BAD_SYMBOL 53
|
||||
#define BARRIER 54
|
||||
#define BLOCKDATA 55
|
||||
#define BLOCK 56
|
||||
#define BOZ_CONSTANT 57
|
||||
#define BYTE 58
|
||||
#define CALL 59
|
||||
#define CASE 60
|
||||
#define CHARACTER 61
|
||||
#define CHAR_CONSTANT 62
|
||||
#define CHECK 63
|
||||
#define CLOSE 64
|
||||
#define COMMON 65
|
||||
#define COMPLEX 66
|
||||
#define COMPGOTO 67
|
||||
#define CONSISTENT_GROUP 68
|
||||
#define CONSISTENT_SPEC 69
|
||||
#define CONSISTENT_START 70
|
||||
#define CONSISTENT_WAIT 71
|
||||
#define CONSISTENT 72
|
||||
#define CONSTRUCT_ID 73
|
||||
#define CONTAINS 74
|
||||
#define CONTINUE 75
|
||||
#define CORNER 76
|
||||
#define CYCLE 77
|
||||
#define DATA 78
|
||||
#define DEALLOCATE 79
|
||||
#define HPF_TEMPLATE 80
|
||||
#define DEBUG 81
|
||||
#define DEFAULT_CASE 82
|
||||
#define DEFINE 83
|
||||
#define DERIVED 84
|
||||
#define DIMENSION 85
|
||||
#define DISTRIBUTE 86
|
||||
#define DOWHILE 87
|
||||
#define DOUBLEPRECISION 88
|
||||
#define DOUBLECOMPLEX 89
|
||||
#define DP_CONSTANT 90
|
||||
#define DVM_POINTER 91
|
||||
#define DYNAMIC 92
|
||||
#define ELEMENTAL 93
|
||||
#define ELSE 94
|
||||
#define ELSEIF 95
|
||||
#define ELSEWHERE 96
|
||||
#define ENDASYNCHRONOUS 97
|
||||
#define ENDDEBUG 98
|
||||
#define ENDINTERVAL 99
|
||||
#define ENDUNIT 100
|
||||
#define ENDDO 101
|
||||
#define ENDFILE 102
|
||||
#define ENDFORALL 103
|
||||
#define ENDIF 104
|
||||
#define ENDINTERFACE 105
|
||||
#define ENDMODULE 106
|
||||
#define ENDON 107
|
||||
#define ENDSELECT 108
|
||||
#define ENDTASK_REGION 109
|
||||
#define ENDTYPE 110
|
||||
#define ENDWHERE 111
|
||||
#define ENTRY 112
|
||||
#define EXIT 113
|
||||
#define EOLN 114
|
||||
#define EQUIVALENCE 115
|
||||
#define ERROR 116
|
||||
#define EXTERNAL 117
|
||||
#define F90 118
|
||||
#define FIND 119
|
||||
#define FORALL 120
|
||||
#define FORMAT 121
|
||||
#define FUNCTION 122
|
||||
#define GATE 123
|
||||
#define GEN_BLOCK 124
|
||||
#define HEAP 125
|
||||
#define HIGH 126
|
||||
#define IDENTIFIER 127
|
||||
#define IMPLICIT 128
|
||||
#define IMPLICITNONE 129
|
||||
#define INCLUDE_TO 130
|
||||
#define INCLUDE 131
|
||||
#define INDEPENDENT 132
|
||||
#define INDIRECT_ACCESS 133
|
||||
#define INDIRECT_GROUP 134
|
||||
#define INDIRECT 135
|
||||
#define INHERIT 136
|
||||
#define INQUIRE 137
|
||||
#define INTERFACEASSIGNMENT 138
|
||||
#define INTERFACEOPERATOR 139
|
||||
#define INTERFACE 140
|
||||
#define INTRINSIC 141
|
||||
#define INTEGER 142
|
||||
#define INTENT 143
|
||||
#define INTERVAL 144
|
||||
#define INOUT 145
|
||||
#define IN 146
|
||||
#define INT_CONSTANT 147
|
||||
#define LABEL 148
|
||||
#define LABEL_DECLARE 149
|
||||
#define LET 150
|
||||
#define LOCALIZE 151
|
||||
#define LOGICAL 152
|
||||
#define LOGICALIF 153
|
||||
#define LOOP 154
|
||||
#define LOW 155
|
||||
#define MAXLOC 156
|
||||
#define MAX 157
|
||||
#define MAP 158
|
||||
#define MINLOC 159
|
||||
#define MIN 160
|
||||
#define MODULE_PROCEDURE 161
|
||||
#define MODULE 162
|
||||
#define MULT_BLOCK 163
|
||||
#define NAMEEQ 164
|
||||
#define NAMELIST 165
|
||||
#define NEW_VALUE 166
|
||||
#define NEW 167
|
||||
#define NULLIFY 168
|
||||
#define OCTAL_CONSTANT 169
|
||||
#define ONLY 170
|
||||
#define ON 171
|
||||
#define ON_DIR 172
|
||||
#define ONTO 173
|
||||
#define OPEN 174
|
||||
#define OPERATOR 175
|
||||
#define OPTIONAL 176
|
||||
#define OTHERWISE 177
|
||||
#define OUT 178
|
||||
#define OWN 179
|
||||
#define PARALLEL 180
|
||||
#define PARAMETER 181
|
||||
#define PAUSE 182
|
||||
#define PLAINDO 183
|
||||
#define PLAINGOTO 184
|
||||
#define POINTER 185
|
||||
#define POINTERLET 186
|
||||
#define PREFETCH 187
|
||||
#define PRINT 188
|
||||
#define PRIVATE 189
|
||||
#define PRODUCT 190
|
||||
#define PROGRAM 191
|
||||
#define PUBLIC 192
|
||||
#define PURE 193
|
||||
#define RANGE 194
|
||||
#define READ 195
|
||||
#define REALIGN_WITH 196
|
||||
#define REALIGN 197
|
||||
#define REAL 198
|
||||
#define REAL_CONSTANT 199
|
||||
#define RECURSIVE 200
|
||||
#define REDISTRIBUTE_NEW 201
|
||||
#define REDISTRIBUTE 202
|
||||
#define REDUCTION_GROUP 203
|
||||
#define REDUCTION_START 204
|
||||
#define REDUCTION_WAIT 205
|
||||
#define REDUCTION 206
|
||||
#define REMOTE_ACCESS_SPEC 207
|
||||
#define REMOTE_ACCESS 208
|
||||
#define REMOTE_GROUP 209
|
||||
#define RESET 210
|
||||
#define RESULT 211
|
||||
#define RETURN 212
|
||||
#define REWIND 213
|
||||
#define SAVE 214
|
||||
#define SECTION 215
|
||||
#define SELECT 216
|
||||
#define SEQUENCE 217
|
||||
#define SHADOW_ADD 218
|
||||
#define SHADOW_COMPUTE 219
|
||||
#define SHADOW_GROUP 220
|
||||
#define SHADOW_RENEW 221
|
||||
#define SHADOW_START_SPEC 222
|
||||
#define SHADOW_START 223
|
||||
#define SHADOW_WAIT_SPEC 224
|
||||
#define SHADOW_WAIT 225
|
||||
#define SHADOW 226
|
||||
#define STAGE 227
|
||||
#define STATIC 228
|
||||
#define STAT 229
|
||||
#define STOP 230
|
||||
#define SUBROUTINE 231
|
||||
#define SUM 232
|
||||
#define SYNC 233
|
||||
#define TARGET 234
|
||||
#define TASK 235
|
||||
#define TASK_REGION 236
|
||||
#define THEN 237
|
||||
#define TO 238
|
||||
#define TRACEON 239
|
||||
#define TRACEOFF 240
|
||||
#define TRUNC 241
|
||||
#define TYPE 242
|
||||
#define TYPE_DECL 243
|
||||
#define UNDER 244
|
||||
#define UNKNOWN 245
|
||||
#define USE 246
|
||||
#define VIRTUAL 247
|
||||
#define VARIABLE 248
|
||||
#define WAIT 249
|
||||
#define WHERE 250
|
||||
#define WHERE_ASSIGN 251
|
||||
#define WHILE 252
|
||||
#define WITH 253
|
||||
#define WRITE 254
|
||||
#define COMMENT 255
|
||||
#define WGT_BLOCK 256
|
||||
#define HPF_PROCESSORS 257
|
||||
#define IOSTAT 258
|
||||
#define ERR 259
|
||||
#define END 260
|
||||
#define OMPDVM_ATOMIC 261
|
||||
#define OMPDVM_BARRIER 262
|
||||
#define OMPDVM_COPYIN 263
|
||||
#define OMPDVM_COPYPRIVATE 264
|
||||
#define OMPDVM_CRITICAL 265
|
||||
#define OMPDVM_ONETHREAD 266
|
||||
#define OMPDVM_DO 267
|
||||
#define OMPDVM_DYNAMIC 268
|
||||
#define OMPDVM_ENDCRITICAL 269
|
||||
#define OMPDVM_ENDDO 270
|
||||
#define OMPDVM_ENDMASTER 271
|
||||
#define OMPDVM_ENDORDERED 272
|
||||
#define OMPDVM_ENDPARALLEL 273
|
||||
#define OMPDVM_ENDPARALLELDO 274
|
||||
#define OMPDVM_ENDPARALLELSECTIONS 275
|
||||
#define OMPDVM_ENDPARALLELWORKSHARE 276
|
||||
#define OMPDVM_ENDSECTIONS 277
|
||||
#define OMPDVM_ENDSINGLE 278
|
||||
#define OMPDVM_ENDWORKSHARE 279
|
||||
#define OMPDVM_FIRSTPRIVATE 280
|
||||
#define OMPDVM_FLUSH 281
|
||||
#define OMPDVM_GUIDED 282
|
||||
#define OMPDVM_LASTPRIVATE 283
|
||||
#define OMPDVM_MASTER 284
|
||||
#define OMPDVM_NOWAIT 285
|
||||
#define OMPDVM_NONE 286
|
||||
#define OMPDVM_NUM_THREADS 287
|
||||
#define OMPDVM_ORDERED 288
|
||||
#define OMPDVM_PARALLEL 289
|
||||
#define OMPDVM_PARALLELDO 290
|
||||
#define OMPDVM_PARALLELSECTIONS 291
|
||||
#define OMPDVM_PARALLELWORKSHARE 292
|
||||
#define OMPDVM_RUNTIME 293
|
||||
#define OMPDVM_SECTION 294
|
||||
#define OMPDVM_SECTIONS 295
|
||||
#define OMPDVM_SCHEDULE 296
|
||||
#define OMPDVM_SHARED 297
|
||||
#define OMPDVM_SINGLE 298
|
||||
#define OMPDVM_THREADPRIVATE 299
|
||||
#define OMPDVM_WORKSHARE 300
|
||||
#define OMPDVM_NODES 301
|
||||
#define OMPDVM_IF 302
|
||||
#define IAND 303
|
||||
#define IEOR 304
|
||||
#define IOR 305
|
||||
#define ACC_REGION 306
|
||||
#define ACC_END_REGION 307
|
||||
#define ACC_CHECKSECTION 308
|
||||
#define ACC_END_CHECKSECTION 309
|
||||
#define ACC_GET_ACTUAL 310
|
||||
#define ACC_ACTUAL 311
|
||||
#define ACC_TARGETS 312
|
||||
#define ACC_ASYNC 313
|
||||
#define ACC_HOST 314
|
||||
#define ACC_CUDA 315
|
||||
#define ACC_LOCAL 316
|
||||
#define ACC_INLOCAL 317
|
||||
#define ACC_CUDA_BLOCK 318
|
||||
#define ACC_ROUTINE 319
|
||||
#define ACC_TIE 320
|
||||
#define BY 321
|
||||
#define IO_MODE 322
|
||||
#define CP_CREATE 323
|
||||
#define CP_LOAD 324
|
||||
#define CP_SAVE 325
|
||||
#define CP_WAIT 326
|
||||
#define FILES 327
|
||||
#define VARLIST 328
|
||||
#define STATUS 329
|
||||
#define EXITINTERVAL 330
|
||||
#define TEMPLATE_CREATE 331
|
||||
#define TEMPLATE_DELETE 332
|
||||
#define SPF_ANALYSIS 333
|
||||
#define SPF_PARALLEL 334
|
||||
#define SPF_TRANSFORM 335
|
||||
#define SPF_NOINLINE 336
|
||||
#define SPF_PARALLEL_REG 337
|
||||
#define SPF_END_PARALLEL_REG 338
|
||||
#define SPF_EXPAND 339
|
||||
#define SPF_FISSION 340
|
||||
#define SPF_SHRINK 341
|
||||
#define SPF_CHECKPOINT 342
|
||||
#define SPF_EXCEPT 343
|
||||
#define SPF_FILES_COUNT 344
|
||||
#define SPF_INTERVAL 345
|
||||
#define SPF_TIME 346
|
||||
#define SPF_ITER 347
|
||||
#define SPF_FLEXIBLE 348
|
||||
#define SPF_APPLY_REGION 349
|
||||
#define SPF_APPLY_FRAGMENT 350
|
||||
#define SPF_CODE_COVERAGE 351
|
||||
#define SPF_UNROLL 352
|
||||
352
dvm/fdvm/trunk/parser/tokens
Normal file
352
dvm/fdvm/trunk/parser/tokens
Normal file
@@ -0,0 +1,352 @@
|
||||
PERCENT
|
||||
AMPERSAND
|
||||
ASTER
|
||||
CLUSTER
|
||||
COLON
|
||||
COMMA
|
||||
DASTER
|
||||
DEFINED_OPERATOR
|
||||
DOT
|
||||
DQUOTE
|
||||
GLOBAL_A
|
||||
LEFTAB
|
||||
LEFTPAR
|
||||
MINUS
|
||||
PLUS
|
||||
POINT_TO
|
||||
QUOTE
|
||||
RIGHTAB
|
||||
RIGHTPAR
|
||||
AND
|
||||
DSLASH
|
||||
EQV
|
||||
EQ
|
||||
EQUAL
|
||||
FFALSE
|
||||
GE
|
||||
GT
|
||||
LE
|
||||
LT
|
||||
NE
|
||||
NEQV
|
||||
NOT
|
||||
OR
|
||||
TTRUE
|
||||
SLASH
|
||||
XOR
|
||||
REFERENCE
|
||||
AT
|
||||
ACROSS
|
||||
ALIGN_WITH
|
||||
ALIGN
|
||||
ALLOCATABLE
|
||||
ALLOCATE
|
||||
ARITHIF
|
||||
ASSIGNMENT
|
||||
ASSIGN
|
||||
ASSIGNGOTO
|
||||
ASYNCHRONOUS
|
||||
ASYNCID
|
||||
ASYNCWAIT
|
||||
BACKSPACE
|
||||
BAD_CCONST
|
||||
BAD_SYMBOL
|
||||
BARRIER
|
||||
BLOCKDATA
|
||||
BLOCK
|
||||
BOZ_CONSTANT
|
||||
BYTE
|
||||
CALL
|
||||
CASE
|
||||
CHARACTER
|
||||
CHAR_CONSTANT
|
||||
CHECK
|
||||
CLOSE
|
||||
COMMON
|
||||
COMPLEX
|
||||
COMPGOTO
|
||||
CONSISTENT_GROUP
|
||||
CONSISTENT_SPEC
|
||||
CONSISTENT_START
|
||||
CONSISTENT_WAIT
|
||||
CONSISTENT
|
||||
CONSTRUCT_ID
|
||||
CONTAINS
|
||||
CONTINUE
|
||||
CORNER
|
||||
CYCLE
|
||||
DATA
|
||||
DEALLOCATE
|
||||
HPF_TEMPLATE
|
||||
DEBUG
|
||||
DEFAULT_CASE
|
||||
DEFINE
|
||||
DERIVED
|
||||
DIMENSION
|
||||
DISTRIBUTE
|
||||
DOWHILE
|
||||
DOUBLEPRECISION
|
||||
DOUBLECOMPLEX
|
||||
DP_CONSTANT
|
||||
DVM_POINTER
|
||||
DYNAMIC
|
||||
ELEMENTAL
|
||||
ELSE
|
||||
ELSEIF
|
||||
ELSEWHERE
|
||||
ENDASYNCHRONOUS
|
||||
ENDDEBUG
|
||||
ENDINTERVAL
|
||||
ENDUNIT
|
||||
ENDDO
|
||||
ENDFILE
|
||||
ENDFORALL
|
||||
ENDIF
|
||||
ENDINTERFACE
|
||||
ENDMODULE
|
||||
ENDON
|
||||
ENDSELECT
|
||||
ENDTASK_REGION
|
||||
ENDTYPE
|
||||
ENDWHERE
|
||||
ENTRY
|
||||
EXIT
|
||||
EOLN
|
||||
EQUIVALENCE
|
||||
ERROR
|
||||
EXTERNAL
|
||||
F90
|
||||
FIND
|
||||
FORALL
|
||||
FORMAT
|
||||
FUNCTION
|
||||
GATE
|
||||
GEN_BLOCK
|
||||
HEAP
|
||||
HIGH
|
||||
IDENTIFIER
|
||||
IMPLICIT
|
||||
IMPLICITNONE
|
||||
INCLUDE_TO
|
||||
INCLUDE
|
||||
INDEPENDENT
|
||||
INDIRECT_ACCESS
|
||||
INDIRECT_GROUP
|
||||
INDIRECT
|
||||
INHERIT
|
||||
INQUIRE
|
||||
INTERFACEASSIGNMENT
|
||||
INTERFACEOPERATOR
|
||||
INTERFACE
|
||||
INTRINSIC
|
||||
INTEGER
|
||||
INTENT
|
||||
INTERVAL
|
||||
INOUT
|
||||
IN
|
||||
INT_CONSTANT
|
||||
LABEL
|
||||
LABEL_DECLARE
|
||||
LET
|
||||
LOCALIZE
|
||||
LOGICAL
|
||||
LOGICALIF
|
||||
LOOP
|
||||
LOW
|
||||
MAXLOC
|
||||
MAX
|
||||
MAP
|
||||
MINLOC
|
||||
MIN
|
||||
MODULE_PROCEDURE
|
||||
MODULE
|
||||
MULT_BLOCK
|
||||
NAMEEQ
|
||||
NAMELIST
|
||||
NEW_VALUE
|
||||
NEW
|
||||
NULLIFY
|
||||
OCTAL_CONSTANT
|
||||
ONLY
|
||||
ON
|
||||
ON_DIR
|
||||
ONTO
|
||||
OPEN
|
||||
OPERATOR
|
||||
OPTIONAL
|
||||
OTHERWISE
|
||||
OUT
|
||||
OWN
|
||||
PARALLEL
|
||||
PARAMETER
|
||||
PAUSE
|
||||
PLAINDO
|
||||
PLAINGOTO
|
||||
POINTER
|
||||
POINTERLET
|
||||
PREFETCH
|
||||
PRINT
|
||||
PRIVATE
|
||||
PRODUCT
|
||||
PROGRAM
|
||||
PUBLIC
|
||||
PURE
|
||||
RANGE
|
||||
READ
|
||||
REALIGN_WITH
|
||||
REALIGN
|
||||
REAL
|
||||
REAL_CONSTANT
|
||||
RECURSIVE
|
||||
REDISTRIBUTE_NEW
|
||||
REDISTRIBUTE
|
||||
REDUCTION_GROUP
|
||||
REDUCTION_START
|
||||
REDUCTION_WAIT
|
||||
REDUCTION
|
||||
REMOTE_ACCESS_SPEC
|
||||
REMOTE_ACCESS
|
||||
REMOTE_GROUP
|
||||
RESET
|
||||
RESULT
|
||||
RETURN
|
||||
REWIND
|
||||
SAVE
|
||||
SECTION
|
||||
SELECT
|
||||
SEQUENCE
|
||||
SHADOW_ADD
|
||||
SHADOW_COMPUTE
|
||||
SHADOW_GROUP
|
||||
SHADOW_RENEW
|
||||
SHADOW_START_SPEC
|
||||
SHADOW_START
|
||||
SHADOW_WAIT_SPEC
|
||||
SHADOW_WAIT
|
||||
SHADOW
|
||||
STAGE
|
||||
STATIC
|
||||
STAT
|
||||
STOP
|
||||
SUBROUTINE
|
||||
SUM
|
||||
SYNC
|
||||
TARGET
|
||||
TASK
|
||||
TASK_REGION
|
||||
THEN
|
||||
TO
|
||||
TRACEON
|
||||
TRACEOFF
|
||||
TRUNC
|
||||
TYPE
|
||||
TYPE_DECL
|
||||
UNDER
|
||||
UNKNOWN
|
||||
USE
|
||||
VIRTUAL
|
||||
VARIABLE
|
||||
WAIT
|
||||
WHERE
|
||||
WHERE_ASSIGN
|
||||
WHILE
|
||||
WITH
|
||||
WRITE
|
||||
COMMENT
|
||||
WGT_BLOCK
|
||||
HPF_PROCESSORS
|
||||
IOSTAT
|
||||
ERR
|
||||
END
|
||||
OMPDVM_ATOMIC
|
||||
OMPDVM_BARRIER
|
||||
OMPDVM_COPYIN
|
||||
OMPDVM_COPYPRIVATE
|
||||
OMPDVM_CRITICAL
|
||||
OMPDVM_ONETHREAD
|
||||
OMPDVM_DO
|
||||
OMPDVM_DYNAMIC
|
||||
OMPDVM_ENDCRITICAL
|
||||
OMPDVM_ENDDO
|
||||
OMPDVM_ENDMASTER
|
||||
OMPDVM_ENDORDERED
|
||||
OMPDVM_ENDPARALLEL
|
||||
OMPDVM_ENDPARALLELDO
|
||||
OMPDVM_ENDPARALLELSECTIONS
|
||||
OMPDVM_ENDPARALLELWORKSHARE
|
||||
OMPDVM_ENDSECTIONS
|
||||
OMPDVM_ENDSINGLE
|
||||
OMPDVM_ENDWORKSHARE
|
||||
OMPDVM_FIRSTPRIVATE
|
||||
OMPDVM_FLUSH
|
||||
OMPDVM_GUIDED
|
||||
OMPDVM_LASTPRIVATE
|
||||
OMPDVM_MASTER
|
||||
OMPDVM_NOWAIT
|
||||
OMPDVM_NONE
|
||||
OMPDVM_NUM_THREADS
|
||||
OMPDVM_ORDERED
|
||||
OMPDVM_PARALLEL
|
||||
OMPDVM_PARALLELDO
|
||||
OMPDVM_PARALLELSECTIONS
|
||||
OMPDVM_PARALLELWORKSHARE
|
||||
OMPDVM_RUNTIME
|
||||
OMPDVM_SECTION
|
||||
OMPDVM_SECTIONS
|
||||
OMPDVM_SCHEDULE
|
||||
OMPDVM_SHARED
|
||||
OMPDVM_SINGLE
|
||||
OMPDVM_THREADPRIVATE
|
||||
OMPDVM_WORKSHARE
|
||||
OMPDVM_NODES
|
||||
OMPDVM_IF
|
||||
IAND
|
||||
IEOR
|
||||
IOR
|
||||
ACC_REGION
|
||||
ACC_END_REGION
|
||||
ACC_CHECKSECTION
|
||||
ACC_END_CHECKSECTION
|
||||
ACC_GET_ACTUAL
|
||||
ACC_ACTUAL
|
||||
ACC_TARGETS
|
||||
ACC_ASYNC
|
||||
ACC_HOST
|
||||
ACC_CUDA
|
||||
ACC_LOCAL
|
||||
ACC_INLOCAL
|
||||
ACC_CUDA_BLOCK
|
||||
ACC_ROUTINE
|
||||
ACC_TIE
|
||||
BY
|
||||
IO_MODE
|
||||
CP_CREATE
|
||||
CP_LOAD
|
||||
CP_SAVE
|
||||
CP_WAIT
|
||||
FILES
|
||||
VARLIST
|
||||
STATUS
|
||||
EXITINTERVAL
|
||||
TEMPLATE_CREATE
|
||||
TEMPLATE_DELETE
|
||||
SPF_ANALYSIS
|
||||
SPF_PARALLEL
|
||||
SPF_TRANSFORM
|
||||
SPF_NOINLINE
|
||||
SPF_PARALLEL_REG
|
||||
SPF_END_PARALLEL_REG
|
||||
SPF_EXPAND
|
||||
SPF_FISSION
|
||||
SPF_SHRINK
|
||||
SPF_CHECKPOINT
|
||||
SPF_EXCEPT
|
||||
SPF_FILES_COUNT
|
||||
SPF_INTERVAL
|
||||
SPF_TIME
|
||||
SPF_ITER
|
||||
SPF_FLEXIBLE
|
||||
SPF_APPLY_REGION
|
||||
SPF_APPLY_FRAGMENT
|
||||
SPF_CODE_COVERAGE
|
||||
SPF_UNROLL
|
||||
778
dvm/fdvm/trunk/parser/types.c
Normal file
778
dvm/fdvm/trunk/parser/types.c
Normal file
@@ -0,0 +1,778 @@
|
||||
/*********************************************************************/
|
||||
/* pC++/Sage++ Copyright (C) 1993 */
|
||||
/* Indiana University University of Oregon University of Rennes */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* types.c
|
||||
*
|
||||
* Routines to handle the type and variable decalrations
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
#include "ll.h"
|
||||
#include "symb.h"
|
||||
#include "db.h"
|
||||
#include "f90.h"
|
||||
#include "fm.h"
|
||||
#ifdef SYS5
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
PTR_LLND make_llnd();
|
||||
PTR_TYPE make_type();
|
||||
PTR_BFND get_bfnd();
|
||||
extern void err();
|
||||
extern PTR_FILE fi;
|
||||
void errstr();
|
||||
int match_args();
|
||||
int match_an_arg();
|
||||
int remainder_optional();
|
||||
|
||||
extern PTR_TYPE global_int, global_double, global_float, global_bool;
|
||||
extern PTR_TYPE global_char, global_string, global_complex, global_dcomplex, global_default;
|
||||
|
||||
/*
|
||||
* set_type takes an id_list and a base type goes through list
|
||||
* settting up the type used for variables and params
|
||||
*/
|
||||
void
|
||||
set_type(id_list, base, tag)
|
||||
PTR_SYMB id_list;
|
||||
PTR_TYPE base;
|
||||
int tag;
|
||||
{
|
||||
PTR_SYMB temp;
|
||||
PTR_SYMB last;
|
||||
|
||||
temp = id_list;
|
||||
while (temp) {
|
||||
temp->variant = VARIABLE_NAME;
|
||||
temp->type = base;
|
||||
temp->entry.var_decl.local = tag;
|
||||
/* if parameter the local field should already be set */
|
||||
last = temp;
|
||||
temp = last->id_list;
|
||||
last->id_list = SMNULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* install_const takes an id_list and an expr sets up the constant declarations
|
||||
*/
|
||||
void
|
||||
install_const(id_list, expr)
|
||||
PTR_SYMB id_list;
|
||||
PTR_LLND expr;
|
||||
{
|
||||
register PTR_SYMB temp, last;
|
||||
|
||||
temp = id_list;
|
||||
while (temp) {
|
||||
temp->variant = CONST_NAME;
|
||||
temp->type = expr->type;
|
||||
temp->entry.const_value = expr;
|
||||
last = temp;
|
||||
temp = last->id_list;
|
||||
last->id_list = SMNULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* install_array
|
||||
*/
|
||||
PTR_TYPE
|
||||
install_array(range, base, ndim)
|
||||
PTR_LLND range;
|
||||
PTR_TYPE base;
|
||||
int ndim;
|
||||
{
|
||||
PTR_TYPE ret;
|
||||
|
||||
ret = make_type(fi,T_ARRAY);
|
||||
ret->entry.ar_decl.num_dimensions = ndim;
|
||||
ret->entry.ar_decl.base_type = base;
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* install_param_list gets an proc id and a parameter list
|
||||
* and sets them up as parameters
|
||||
*/
|
||||
void
|
||||
install_param_list(id, id_list, result_clause, func)
|
||||
PTR_SYMB id, id_list;
|
||||
int func;
|
||||
PTR_LLND result_clause;
|
||||
{
|
||||
int num_input = 0;
|
||||
register PTR_SYMB temp, last, result_sym_ptr;
|
||||
|
||||
temp = id_list;
|
||||
while (temp) {
|
||||
temp->variant = VARIABLE_NAME;
|
||||
temp->entry.var_decl.next_in = temp->id_list;
|
||||
temp->entry.var_decl.local = IO;
|
||||
++num_input;
|
||||
last = temp;
|
||||
temp = last->id_list;
|
||||
last->id_list = SMNULL;
|
||||
}
|
||||
id->entry.proc_decl.in_list = id_list;
|
||||
id->entry.proc_decl.num_io = 0;
|
||||
id->entry.proc_decl.num_input = num_input;
|
||||
id->entry.proc_decl.num_output = (func == FUNCTION_NAME);
|
||||
if (result_clause)
|
||||
{
|
||||
result_sym_ptr = result_clause->entry.Template.symbol;
|
||||
/* id->entry.Template.declared_name = result_sym_ptr;*/ /*16.03.03*/
|
||||
result_sym_ptr->type = id->type;
|
||||
}
|
||||
}
|
||||
|
||||
PTR_LLND
|
||||
construct_entry_list(entry_id, symb_list, entry_kind)
|
||||
PTR_SYMB entry_id, symb_list;
|
||||
int entry_kind;
|
||||
{
|
||||
int num_input = 0;
|
||||
PTR_SYMB last_symb;
|
||||
PTR_LLND entry_param_list, l, set_ll_list();
|
||||
|
||||
entry_param_list = LLNULL;
|
||||
if (symb_list)
|
||||
{
|
||||
l = make_llnd(fi, VAR_REF, LLNULL, LLNULL, symb_list);
|
||||
entry_param_list = set_ll_list(l, LLNULL, EXPR_LIST);
|
||||
last_symb = symb_list;
|
||||
symb_list = last_symb->id_list;
|
||||
last_symb->id_list = SMNULL;
|
||||
num_input++;
|
||||
last_symb->entry.var_decl.local = IO; /*5.02.03*/
|
||||
}
|
||||
|
||||
while (symb_list)
|
||||
{
|
||||
l = make_llnd(fi, VAR_REF, LLNULL, LLNULL, symb_list);
|
||||
entry_param_list = set_ll_list(entry_param_list, l, EXPR_LIST);
|
||||
last_symb = symb_list;
|
||||
symb_list = last_symb->id_list;
|
||||
last_symb->id_list = SMNULL;
|
||||
num_input++;
|
||||
last_symb->entry.var_decl.local = IO; /*5.02.03*/
|
||||
}
|
||||
|
||||
/* entry_id->entry.proc_decl.in_list = symb_list; */
|
||||
entry_id->entry.proc_decl.num_io = 0;
|
||||
entry_id->entry.proc_decl.num_input = num_input;
|
||||
entry_id->entry.proc_decl.num_output = (entry_kind == FUNCTION_NAME);
|
||||
return entry_param_list;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* set_expr_type sets the type of an expression and
|
||||
* performs other semantic checks
|
||||
*/
|
||||
void
|
||||
set_expr_type(expr)
|
||||
PTR_LLND expr;
|
||||
{
|
||||
int r_type, l_type, ilen;
|
||||
PTR_TYPE temp, l_operand, r_operand, copy_type_node();
|
||||
PTR_LLND len;
|
||||
len = NULL;
|
||||
ilen = 0;
|
||||
switch (expr->variant) {
|
||||
|
||||
case (ARRAY_MULT): /* to be changed */
|
||||
case (PROC_CALL):
|
||||
case (DEF_CHOICE):
|
||||
case (VAR_LIST):
|
||||
case (EXPR_LIST):
|
||||
case (RANGE_LIST):
|
||||
case (RANGE_OP):
|
||||
case (STAR_RANGE):
|
||||
expr->type = global_default;
|
||||
break;
|
||||
|
||||
case (INT_VAL):
|
||||
expr->type = global_int;
|
||||
break;
|
||||
case (FLOAT_VAL):
|
||||
expr->type = global_float;
|
||||
break;
|
||||
case (DOUBLE_VAL):
|
||||
expr->type = global_double;
|
||||
break;
|
||||
case (BOOL_VAL):
|
||||
expr->type = global_bool;
|
||||
break;
|
||||
case (CHAR_VAL):
|
||||
expr->type = global_char;
|
||||
break;
|
||||
case (STMT_STR):
|
||||
case (STRING_VAL):
|
||||
expr->type = global_string;
|
||||
break;
|
||||
case (COMPLEX_VAL):
|
||||
expr->type = global_complex;
|
||||
break;
|
||||
case (CONST_REF): /* check that the symbol referred to is a
|
||||
* constant and then return type */
|
||||
if (expr->entry.const_ref.symbol->variant != CONST_NAME) {
|
||||
/*err("Not a constant identifier");*/ /*podd*/
|
||||
expr->type = global_default;
|
||||
} else
|
||||
expr->type = expr->entry.const_ref.symbol->type;
|
||||
break;
|
||||
case (ENUM_REF):
|
||||
case (VAR_REF):
|
||||
expr->type = expr->entry.var_ref.symbol->type;
|
||||
if (expr->type == global_default)
|
||||
err("Identifier not declared",321);
|
||||
break;
|
||||
|
||||
case (ARRAY_REF): /* check to see if symbol is array ??? */
|
||||
expr->type = expr->entry.array_ref.array_elt ?
|
||||
expr->entry.array_ref.array_elt->type :
|
||||
expr->entry.array_ref.symbol->type;
|
||||
break;
|
||||
|
||||
case (RECORD_REF):
|
||||
expr->type = expr->entry.record_ref.rec_field ?
|
||||
expr->entry.record_ref.rec_field->type :
|
||||
expr->entry.record_ref.symbol->type;
|
||||
break;
|
||||
case (MOD_OP):
|
||||
case (LOWER_OP):
|
||||
case (UPPER_OP):
|
||||
expr->type = global_int;
|
||||
break;
|
||||
case (AND_OP):
|
||||
case (OR_OP):
|
||||
case (EQ_OP):
|
||||
case (LT_OP):
|
||||
case (GT_OP):
|
||||
case (NOTEQL_OP):
|
||||
case (LTEQL_OP):
|
||||
case (EQV_OP):
|
||||
case (NEQV_OP):
|
||||
case (GTEQL_OP):
|
||||
if ((expr->entry.binary_op.l_operand == LLNULL) ||
|
||||
(expr->entry.binary_op.l_operand->type == TYNULL) ||
|
||||
(expr->entry.binary_op.r_operand == LLNULL) ||
|
||||
(expr->entry.binary_op.r_operand->type == TYNULL))
|
||||
/* err("Inconsistent operands to boolean operation", 26); */
|
||||
expr->type = global_default;
|
||||
else if (expr->entry.binary_op.l_operand->type->variant == T_ARRAY)
|
||||
{
|
||||
expr->type = copy_type_node(expr->entry.binary_op.l_operand->type);
|
||||
expr->type->entry.ar_decl.base_type = global_bool;
|
||||
}
|
||||
else if (expr->entry.binary_op.r_operand->type->variant == T_ARRAY)
|
||||
{
|
||||
expr->type = copy_type_node(expr->entry.binary_op.r_operand->type);
|
||||
expr->type->entry.ar_decl.base_type = global_bool;
|
||||
}
|
||||
else expr->type = global_bool;
|
||||
break;
|
||||
case (DIV_OP):
|
||||
case (ADD_OP):
|
||||
case (SUBT_OP):
|
||||
case (MULT_OP):
|
||||
case (EXP_OP):
|
||||
if ((expr->entry.binary_op.l_operand == LLNULL) ||
|
||||
(expr->entry.binary_op.r_operand == LLNULL))
|
||||
{
|
||||
/* err("Inconsistent operands to arithmetic operation", 27);*/
|
||||
expr->type = global_default;
|
||||
break;
|
||||
}
|
||||
l_operand = expr->entry.binary_op.l_operand->type;
|
||||
r_operand = expr->entry.binary_op.r_operand->type;
|
||||
if (! l_operand || ! r_operand)
|
||||
expr->type = global_default;
|
||||
else {
|
||||
if (l_operand->variant == T_ARRAY)
|
||||
l_type = l_operand->entry.ar_decl.base_type->variant;
|
||||
else
|
||||
l_type = l_operand->variant;
|
||||
if (r_operand->variant == T_ARRAY)
|
||||
r_type = r_operand->entry.ar_decl.base_type->variant;
|
||||
else
|
||||
r_type = r_operand->variant;
|
||||
if(l_operand->entry.Template.ranges)
|
||||
{ len=(l_operand->entry.Template.ranges)->entry.Template.ll_ptr1;
|
||||
if(len && len->variant==INT_VAL)
|
||||
ilen=len->entry.ival;
|
||||
if(l_type==T_FLOAT && ilen==8)
|
||||
l_type=T_DOUBLE;
|
||||
if(l_type==T_COMPLEX && ilen==16)
|
||||
l_type=T_DCOMPLEX;
|
||||
}
|
||||
if(r_operand->entry.Template.ranges)
|
||||
{ len=(r_operand->entry.Template.ranges)->entry.Template.ll_ptr1;
|
||||
if(len && len->variant==INT_VAL)
|
||||
ilen=len->entry.ival;
|
||||
if(r_type==T_FLOAT && ilen==8)
|
||||
r_type=T_DOUBLE;
|
||||
if(r_type==T_COMPLEX && ilen==16)
|
||||
r_type=T_DCOMPLEX;
|
||||
}
|
||||
|
||||
if (l_type == T_DCOMPLEX || r_type == T_DCOMPLEX)
|
||||
temp = global_dcomplex;
|
||||
else if (l_type == T_COMPLEX || r_type == T_COMPLEX)
|
||||
temp = global_complex;
|
||||
else if (l_type == T_DOUBLE || r_type == T_DOUBLE)
|
||||
temp = global_double;
|
||||
else if (l_type == T_FLOAT || r_type == T_FLOAT)
|
||||
temp = global_float;
|
||||
else if (l_type == T_INT && r_type == T_INT)
|
||||
temp = global_int;
|
||||
|
||||
else temp = global_default;
|
||||
|
||||
if (l_operand->variant == T_ARRAY)
|
||||
{
|
||||
expr->type = copy_type_node(expr->entry.binary_op.l_operand->type);
|
||||
expr->type->entry.ar_decl.base_type = temp;
|
||||
}
|
||||
else if (r_operand->variant == T_ARRAY)
|
||||
{
|
||||
expr->type = copy_type_node(expr->entry.binary_op.r_operand->type);
|
||||
expr->type->entry.ar_decl.base_type = temp;
|
||||
}
|
||||
else expr->type = temp;
|
||||
}
|
||||
break;
|
||||
case (NOT_OP):
|
||||
case (UNARY_ADD_OP):
|
||||
case (MINUS_OP):
|
||||
expr->type = expr->entry.unary_op.operand->type;
|
||||
break;
|
||||
/* case (EXP_OP):
|
||||
expr->type = expr->entry.binary_op.l_operand->type;
|
||||
break;
|
||||
*/
|
||||
case (CONCAT_OP):
|
||||
expr->type = expr->entry.binary_op.l_operand->type;
|
||||
break;
|
||||
case (DDOT):
|
||||
expr->type = expr->entry.binary_op.r_operand->type;
|
||||
break;
|
||||
default:
|
||||
err("Expression variant not known",322);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* chase_qual_index gets a partially set up variable and an index list
|
||||
* and has to chase down array elements or record fields to hang the list
|
||||
*/
|
||||
void
|
||||
chase_qual_index(ref, index_list)
|
||||
PTR_LLND ref, index_list;
|
||||
{
|
||||
if (ref->variant == ARRAY_REF)
|
||||
chase_qual_index(ref->entry.array_ref.array_elt, index_list);
|
||||
else if (ref->variant == RECORD_REF)
|
||||
chase_qual_index(ref->entry.record_ref.rec_field, index_list);
|
||||
else if (ref->variant == VAR_REF) {
|
||||
|
||||
/*
|
||||
* check that this is an array ref symbol and that dimensions are ok
|
||||
* etc.
|
||||
*/
|
||||
ref->variant = ARRAY_REF;
|
||||
ref->entry.array_ref.index = index_list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* chase_qual_field gets ref and a field_id and has to be set up
|
||||
*/
|
||||
void
|
||||
chase_qual_field(ref, field_id)
|
||||
PTR_LLND ref;
|
||||
PTR_SYMB field_id;
|
||||
{
|
||||
if (ref->variant == ARRAY_REF) {
|
||||
if (! ref->entry.array_ref.array_elt)
|
||||
ref->entry.array_ref.array_elt =
|
||||
make_llnd(fi,VAR_REF, LLNULL, LLNULL, field_id);
|
||||
else
|
||||
chase_qual_field(ref->entry.array_ref.array_elt, field_id);
|
||||
} else if (ref->variant == RECORD_REF) {
|
||||
if (! ref->entry.record_ref.rec_field)
|
||||
ref->entry.record_ref.rec_field =
|
||||
make_llnd(fi,VAR_REF, LLNULL, LLNULL, field_id);
|
||||
else
|
||||
chase_qual_field(ref->entry.record_ref.rec_field, field_id);
|
||||
} else if (ref->variant == VAR_REF) {
|
||||
ref->variant = RECORD_REF;
|
||||
ref->entry.record_ref.rec_field =
|
||||
make_llnd(fi,VAR_REF, LLNULL, LLNULL, field_id);
|
||||
} else
|
||||
err("Error in chase filed ids", 323);
|
||||
}
|
||||
|
||||
PTR_TYPE
|
||||
copy_type_node(typenode)
|
||||
PTR_TYPE typenode;
|
||||
{
|
||||
PTR_TYPE new_node;
|
||||
|
||||
new_node = make_type(fi, typenode->variant);
|
||||
|
||||
new_node->entry.Template.base_type = typenode->entry.Template.base_type;
|
||||
new_node->entry.Template.ranges = typenode->entry.Template.ranges;
|
||||
new_node->entry.Template.dummy1 = typenode->entry.Template.dummy1;
|
||||
new_node->entry.Template.kind_len = typenode->entry.Template.kind_len;
|
||||
new_node->entry.Template.dummy3 = typenode->entry.Template.dummy3;
|
||||
new_node->entry.Template.dummy4 = typenode->entry.Template.dummy4;
|
||||
new_node->entry.Template.dummy5 = typenode->entry.Template.dummy5;
|
||||
|
||||
return (new_node);
|
||||
}
|
||||
|
||||
PTR_SYMB
|
||||
resolve_overloading(interface_symbol, argptr)
|
||||
PTR_SYMB interface_symbol;
|
||||
PTR_LLND argptr;
|
||||
{
|
||||
PTR_SYMB current;
|
||||
void reset_args();
|
||||
|
||||
if (interface_symbol->variant != INTERFACE_NAME)
|
||||
return (interface_symbol);
|
||||
|
||||
current = interface_symbol->entry.Template.symb_list; /*entry.Template.declared_name;*//*19.03.03*/
|
||||
while (current)
|
||||
{
|
||||
reset_args(current);
|
||||
if (match_args(current, argptr))
|
||||
return (current);
|
||||
current = current->entry.Template.declared_name;
|
||||
}
|
||||
return (SMNULL);
|
||||
}
|
||||
|
||||
int
|
||||
match_args(contender_proc, argptr)
|
||||
PTR_SYMB contender_proc;
|
||||
PTR_LLND argptr;
|
||||
{
|
||||
PTR_SYMB formal_argptr, formal_arg, find_keyword_arg();
|
||||
PTR_LLND argref, actual_arg;
|
||||
int match_status;
|
||||
|
||||
formal_argptr = contender_proc->entry.Template.in_list;
|
||||
while (argptr && formal_argptr)
|
||||
{
|
||||
argref = argptr->entry.list.item;
|
||||
if (argref->variant == KEYWORD_ARG)
|
||||
{
|
||||
formal_arg = find_keyword_arg(contender_proc,
|
||||
argref->entry.Template.ll_ptr1->entry.string_val);
|
||||
actual_arg = argref->entry.Template.ll_ptr2;
|
||||
}
|
||||
else
|
||||
{
|
||||
formal_arg = formal_argptr;
|
||||
actual_arg = argref;
|
||||
}
|
||||
match_status = match_an_arg(actual_arg, formal_arg);
|
||||
if (!match_status)
|
||||
return (0);
|
||||
formal_argptr = formal_argptr->entry.var_decl.next_in;
|
||||
argptr = argptr->entry.list.next;
|
||||
}
|
||||
if (remainder_optional(contender_proc))
|
||||
return (1);
|
||||
else return (0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
match_an_arg(actual_arg, formal_arg)
|
||||
PTR_LLND actual_arg;
|
||||
PTR_SYMB formal_arg;
|
||||
{
|
||||
PTR_TYPE actual_arg_type, formal_arg_type;
|
||||
|
||||
actual_arg_type = actual_arg->type;
|
||||
formal_arg_type = formal_arg->type;
|
||||
|
||||
if (actual_arg_type->variant != formal_arg_type->variant)
|
||||
return (0);
|
||||
|
||||
if ((actual_arg_type->variant == T_DERIVED_TYPE) &&
|
||||
(actual_arg_type->name != formal_arg_type->name))
|
||||
return (0);
|
||||
|
||||
if (actual_arg_type->variant == T_ARRAY)
|
||||
{
|
||||
if (actual_arg_type->entry.ar_decl.base_type->variant !=
|
||||
formal_arg_type->entry.ar_decl.base_type->variant)
|
||||
return (0);
|
||||
|
||||
if ((actual_arg_type->entry.ar_decl.base_type->variant == T_DERIVED_TYPE)
|
||||
&& (actual_arg_type->entry.ar_decl.base_type->name !=
|
||||
formal_arg_type->entry.ar_decl.base_type->name))
|
||||
return (0);
|
||||
|
||||
if (actual_arg_type->entry.ar_decl.num_dimensions !=
|
||||
formal_arg_type->entry.ar_decl.num_dimensions)
|
||||
return (0);
|
||||
}
|
||||
|
||||
formal_arg->decl = 1;
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
reset_args(proc)
|
||||
PTR_SYMB proc;
|
||||
{
|
||||
PTR_SYMB temp;
|
||||
|
||||
temp = proc->entry.Template.in_list;
|
||||
while (temp != SMNULL)
|
||||
{
|
||||
temp->decl = 0;
|
||||
temp = temp->entry.var_decl.next_in;
|
||||
}
|
||||
}
|
||||
|
||||
PTR_SYMB
|
||||
find_keyword_arg(proc, keyword)
|
||||
PTR_SYMB proc;
|
||||
char *keyword;
|
||||
{
|
||||
PTR_SYMB temp;
|
||||
|
||||
temp = proc->entry.Template.in_list;
|
||||
while (temp != SMNULL)
|
||||
{
|
||||
if (!strcmp(temp->ident, keyword))
|
||||
return (temp);
|
||||
temp = temp->entry.var_decl.next_in;
|
||||
}
|
||||
|
||||
return (SMNULL);
|
||||
}
|
||||
|
||||
int
|
||||
remainder_optional(proc)
|
||||
PTR_SYMB proc;
|
||||
{
|
||||
PTR_SYMB temp;
|
||||
|
||||
temp = proc->entry.Template.in_list;
|
||||
while (temp != SMNULL)
|
||||
{
|
||||
if ((temp->decl == 0) && !(temp->attr & OPTIONAL_BIT))
|
||||
return (0);
|
||||
temp = temp->entry.var_decl.next_in;
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
PTR_LLND
|
||||
intrinsic_op_node(opname, op, rand1, rand2)
|
||||
char *opname;
|
||||
int op;
|
||||
PTR_LLND rand1, rand2;
|
||||
{
|
||||
PTR_HASH hash_node;
|
||||
PTR_SYMB s, sym;
|
||||
PTR_LLND temp1, temp2, l, result;
|
||||
extern PTR_HASH just_look_up_sym();
|
||||
|
||||
hash_node = just_look_up_sym(opname);
|
||||
if (hash_node == HSNULL || !strcmp(hash_node->id_attr->ident,"*") && hash_node->id_attr->entry.var_decl.local == IO)
|
||||
{
|
||||
result = make_llnd(fi, op, rand1, rand2, SMNULL);
|
||||
set_expr_type(result);
|
||||
return (result);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = hash_node->id_attr;
|
||||
if (s->variant != INTERFACE_NAME)
|
||||
{
|
||||
errstr("Can't resolve call %s", opname,324);
|
||||
return (LLNULL);
|
||||
}
|
||||
|
||||
temp1 = make_llnd(fi, EXPR_LIST, rand1, LLNULL, SMNULL);
|
||||
temp2 = make_llnd(fi, EXPR_LIST, rand2, LLNULL, SMNULL);
|
||||
temp1->entry.Template.ll_ptr2 = temp2;
|
||||
sym = resolve_overloading(s, temp1);
|
||||
if (sym != SMNULL)
|
||||
{
|
||||
l = make_llnd(fi, FUNC_CALL, temp1, LLNULL, sym);
|
||||
l->type = sym->type;
|
||||
result = make_llnd(fi, OVERLOADED_CALL, l, LLNULL, s);
|
||||
result->type = sym->type;
|
||||
return (result);
|
||||
}
|
||||
else {
|
||||
result = make_llnd(fi, op, rand1, rand2, SMNULL);
|
||||
set_expr_type(result);
|
||||
return (result);
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
PTR_LLND
|
||||
defined_op_node(hash_node, rand1, rand2)
|
||||
PTR_HASH hash_node;
|
||||
PTR_LLND rand1, rand2;
|
||||
|
||||
{
|
||||
PTR_SYMB s, sym;
|
||||
PTR_LLND temp1,temp2, l, result;
|
||||
PTR_TYPE type;
|
||||
extern PTR_HASH just_look_up_sym();
|
||||
|
||||
if (hash_node == HSNULL)
|
||||
{
|
||||
err("Unknown operator",316);
|
||||
return (LLNULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = hash_node->id_attr;
|
||||
if(s == SMNULL ){
|
||||
errstr("Unknown operator %s",hash_node->ident,316);
|
||||
return (LLNULL);
|
||||
}
|
||||
if ( s->variant != INTERFACE_NAME)
|
||||
|
||||
{
|
||||
errstr("Can't resolve call %s", s->ident,324);
|
||||
return (LLNULL);
|
||||
}
|
||||
|
||||
temp1 = make_llnd(fi, EXPR_LIST, rand1, LLNULL, SMNULL);
|
||||
if(rand2 != LLNULL){
|
||||
temp2 = make_llnd(fi, EXPR_LIST, rand2, LLNULL, SMNULL);
|
||||
temp1->entry.Template.ll_ptr2 = temp2;
|
||||
}
|
||||
sym = resolve_overloading(s, temp1);
|
||||
l = make_llnd(fi, DEFINED_OP, rand1, rand2, s);
|
||||
if (sym != SMNULL)
|
||||
type = sym->type;
|
||||
else
|
||||
type = global_default;
|
||||
l->type = type;
|
||||
result = make_llnd(fi, OVERLOADED_CALL, l, LLNULL, sym);
|
||||
result->type = type;
|
||||
return (result);
|
||||
/*
|
||||
if (sym != SMNULL)
|
||||
{
|
||||
l = make_llnd(fi, FUNC_CALL, temp1, LLNULL, sym);
|
||||
|
||||
l->type = sym->type;
|
||||
result = make_llnd(fi, OVERLOADED_CALL, l, LLNULL, sym);
|
||||
result->type = sym->type;
|
||||
return (result);
|
||||
}
|
||||
else {
|
||||
errstr("Can't resolve call %s", hash_node->ident,324);
|
||||
|
||||
return (result);
|
||||
}
|
||||
*/ /*2.07.03*/
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
PTR_BFND
|
||||
subroutine_call(subroutine_name, argptr)
|
||||
PTR_SYMB subroutine_name;
|
||||
PTR_LLND argptr;
|
||||
{
|
||||
PTR_BFND stmt;
|
||||
PTR_LLND ll_ptr;
|
||||
PTR_SYMB current;
|
||||
void reset_args();
|
||||
|
||||
/* if (subroutine_name->variant != INTERFACE_NAME) */ /*19.08.03*/
|
||||
{
|
||||
stmt = get_bfnd(fi,PROC_STAT, subroutine_name, argptr, LLNULL, LLNULL);
|
||||
return (stmt);
|
||||
}
|
||||
|
||||
current = subroutine_name->entry.Template.symb_list; /*entry.Template.declared_name;*//*19.03.03*/
|
||||
while (current)
|
||||
{
|
||||
reset_args(current);
|
||||
if (match_args(current, argptr))
|
||||
{
|
||||
ll_ptr = make_llnd(fi, PROC_CALL, argptr, LLNULL, current);
|
||||
stmt = get_bfnd(fi,OVERLOADED_PROC_STAT, subroutine_name, argptr, ll_ptr,LLNULL);
|
||||
return (stmt);
|
||||
}
|
||||
current = current->entry.Template.declared_name;
|
||||
}
|
||||
return (BFNULL);
|
||||
}
|
||||
|
||||
|
||||
PTR_BFND /* process_call added for FORTRAN M */
|
||||
process_call(process_name, argptr, p_mapping, type)
|
||||
PTR_SYMB process_name;
|
||||
PTR_LLND argptr;
|
||||
PTR_LLND p_mapping;
|
||||
int type;
|
||||
{
|
||||
PTR_BFND stmt = NULL;
|
||||
/*PTR_LLND ll_ptr;*/
|
||||
/*PTR_SYMB current;*/
|
||||
void reset_args();
|
||||
|
||||
if (process_name->variant != INTERFACE_NAME)
|
||||
{
|
||||
switch (type) {
|
||||
case PLAIN:
|
||||
stmt = get_bfnd(fi, PROS_STAT, process_name, argptr,
|
||||
p_mapping, LLNULL);
|
||||
break;
|
||||
case LCTN:
|
||||
stmt = get_bfnd(fi, PROS_STAT_LCTN, process_name, argptr,
|
||||
p_mapping, LLNULL);
|
||||
break;
|
||||
case SUBM:
|
||||
stmt = get_bfnd(fi, PROS_STAT_SUBM, process_name, argptr,
|
||||
p_mapping, LLNULL);
|
||||
break;
|
||||
default:
|
||||
errstr("Invalid type of process call %d", type,325);
|
||||
}
|
||||
return (stmt);
|
||||
}
|
||||
|
||||
return (BFNULL);
|
||||
}
|
||||
|
||||
4971
dvm/fdvm/trunk/parser/unparse_hpf.c
Normal file
4971
dvm/fdvm/trunk/parser/unparse_hpf.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user