--- loncom/homework/CAPA-converter/capaGrammarDef.y 2000/10/02 22:13:11 1.2 +++ loncom/homework/CAPA-converter/capaGrammarDef.y 2001/12/04 15:17:57 1.4 @@ -1,3 +1,30 @@ +/* The LearningOnline Network with CAPA + * CAPA parser (beaten into submission for conversion) + * $Id: capaGrammarDef.y,v 1.4 2001/12/04 15:17:57 albertel Exp $ + * + * Copyright Michigan State University Board of Trustees + * + * This file is part of the LearningOnline Network with CAPA (LON-CAPA). + * + * LON-CAPA 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 of the License, or + * (at your option) any later version. + * + * LON-CAPA 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 LON-CAPA; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * /home/httpd/html/adm/gpl.txt + * + * http://www.lon-capa.org/ + */ + /* ========================================================================== */ /* capaGrammarDef.y created by Isaac Tsai */ /* 1998, 1999 copyrighted by Isaac Tsai */ @@ -59,7 +86,7 @@ extern int Input_idx; int Current_line[MAX_OPENED_FILE]; extern int Func_idx; extern Symbol FuncStack[MAX_FUNC_NEST]; -extern int IFstatus[MAX_FUNC_NEST]; +/*extern int IFstatus[MAX_FUNC_NEST];*/ extern int IFcount; /*extern int gUnitError;*/ @@ -295,24 +322,24 @@ if_expr : CAPA_IF '(' calc_expr ' YYDBUG_PR2("(IF expr )\n",IFcount); switch($3->s_type) { case IDENTIFIER: - IFstatus[IFcount] = IF_FALSE; + /*IFstatus[IFcount] = IF_FALSE;*/ begin_next_line(); break; case I_CONSTANT: case I_VAR: if(!$3->s_int) { - IFstatus[IFcount] = IF_FALSE; - begin_if_skip(); + /*IFstatus[IFcount] = IF_FALSE; + begin_if_skip();*/ } else { - IFstatus[IFcount] = IF_TRUE; + /*IFstatus[IFcount] = IF_TRUE;*/ begin_next_line(); } break; case R_CONSTANT: case R_VAR: if($3->s_real == 0.0) { - IFstatus[IFcount] = IF_FALSE; - begin_if_skip(); + /*IFstatus[IFcount] = IF_FALSE; + begin_if_skip();*/ }else{ - IFstatus[IFcount] = IF_TRUE; + /*IFstatus[IFcount] = IF_TRUE;*/ begin_next_line(); } break; @@ -322,10 +349,10 @@ if_expr : CAPA_IF '(' calc_expr ' capa_mfree($3->s_str); } if(leng == 0) { - IFstatus[IFcount] = IF_FALSE; - begin_if_skip(); + /*IFstatus[IFcount] = IF_FALSE; + begin_if_skip();*/ }else{ - IFstatus[IFcount] = IF_TRUE; + /*IFstatus[IFcount] = IF_TRUE;*/ begin_next_line(); } break; @@ -335,10 +362,10 @@ if_expr : CAPA_IF '(' calc_expr ' capa_mfree($3->s_str); } if(leng == 0) { - IFstatus[IFcount] = IF_FALSE; - begin_if_skip(); + /*IFstatus[IFcount] = IF_FALSE;*/ + /*begin_if_skip();*/ }else{ - IFstatus[IFcount] = IF_TRUE; + /*IFstatus[IFcount] = IF_TRUE;*/ begin_next_line(); } break; @@ -708,7 +735,7 @@ term : term '*' basic_constr { YYDBUG_PR1(" term <= basic_constr "); YYDBUG_SYM($1); } ; -basic_constr : FUNCTION_ID '(' ')' { int tmp; +basic_constr : FUNCTION_ID '(' ')' { /*int tmp;*/ Func_idx--; if(Func_idx >= 0 ) { @@ -719,7 +746,7 @@ basic_constr : FUNCTION_ID '(' ')' { } | FUNCTION_ID '(' arg_list ')' - { int tmp; + { /*int tmp; */ Func_idx--; YYDBUG_PR4(" basic_constr <= FUNCTION<%s> YYSTATE(%d) ", @@ -867,7 +894,7 @@ void free_calc_expr(Symbol *expr) Symbol* get_array_symbol ( name,index,free_symbols ) Symbol *name,*index;int free_symbols; { - Symbol *s_p, *a_p; + Symbol *s_p/*, *a_p*/; char *key, *tmp; int leng, idx_len; leng = strlen(name->s_name)+8; /* [ ] */ @@ -912,7 +939,7 @@ Symbol * build_array_list(ar_name,num_el Symbol *ar_name;int num_elem; { int i; - Symbol *arg_list,*a_p; + Symbol *arg_list/*,*a_p*/; char idx_str[MAX_BUFFER_SIZE]; /*a_p = find_arrayid(ar_name->s_name);*/