Back to index

wims  3.65+svn20090927
type.c
Go to the documentation of this file.
00001 /*    Copyright (C) 2002-2003 XIAO, Gang of Universite de Nice - Sophia Antipolis
00002  *
00003  *  This program is free software; you can redistribute it and/or modify
00004  *  it under the terms of the GNU General Public License as published by
00005  *  the Free Software Foundation; either version 2 of the License, or
00006  *  (at your option) any later version.
00007  *
00008  *  This program is distributed in the hope that it will be useful,
00009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *  GNU General Public License for more details.
00012  *
00013  *  You should have received a copy of the GNU General Public License
00014  *  along with this program; if not, write to the Free Software
00015  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00016  */
00017 
00018 
00019 
00020        /* the type of an expression, with cutpoints */
00021 void req_type(void)
00022 {
00023     int i,l;
00024     char *p;
00025     int commas[MAX_COMMAS];
00026     int commacnt;
00027     if(objlinecnt<2) return;
00028     while((p=wordchr(objline[0],"nocomma"))!=NULL) {
00029        nocomma=1; strcpy(p,p+strlen("nocomma"));
00030     }
00031     for(i=1;i<objlinecnt;i++) {
00032        thisobjline=i; p=find_word_start(objline[i]);
00033        linelogdir=0;
00034        if(*p=='>') {
00035            if(logdir<0) continue;
00036            p=find_word_start(p+1); linelogdir=1;
00037        }
00038        else if(*p=='<') {
00039            if(logdir>0) continue;
00040            p=find_word_start(p+1); linelogdir=-1;
00041        }
00042        thislinelen=strlen(p); if(thislinelen<=0) continue;
00043        l=_type(p,commas,&commacnt); printf("%s\n",typenames[l]);
00044     }
00045 
00046 }
00047