version 1.8, 2001/07/09 04:01:53
|
version 1.9, 2001/11/15 21:42:42
|
Line 124 int IFcurrent[MAX_FUNC_NEST];
|
Line 124 int IFcurrent[MAX_FUNC_NEST];
|
int IFcount; |
int IFcount; |
WhileLoop_t WhileStack[MAX_FUNC_NEST]; /* <-- perhaps we can use linked list */ |
WhileLoop_t WhileStack[MAX_FUNC_NEST]; /* <-- perhaps we can use linked list */ |
int While_idx, Wcount; |
int While_idx, Wcount; |
|
int sccount; /* Semi-colon count for MAP and RMAP */ |
|
|
#ifdef USE_DYNAMIC_SYMBOLS |
#ifdef USE_DYNAMIC_SYMBOLS |
Symbol *SymbList_p; |
Symbol *SymbList_p; |
Line 401 EndLine ([\r][\n]|[\n])
|
Line 402 EndLine ([\r][\n]|[\n])
|
send("<PRE>\n"); |
send("<PRE>\n"); |
} |
} |
^{Spaces}"/HIN"{Alpha}*{Spaces} { LLDBUG_PRL1("[HIN]"); |
^{Spaces}"/HIN"{Alpha}*{Spaces} { LLDBUG_PRL1("[HIN]"); |
start_mode(MODE_BLOCK, |
start_mode(MODE_HINT, ""); |
"condition=\"&hinton\""); |
|
BEGIN S_HINT; |
BEGIN S_HINT; |
} |
} |
^{Spaces}"/EXP"{Alpha}*{Spaces} { start_mode(MODE_BLOCK,"condition=&explanation"); |
^{Spaces}"/EXP"{Alpha}*{Spaces} { start_mode(MODE_BLOCK,"condition=&explanation"); |
Line 436 EndLine ([\r][\n]|[\n])
|
Line 436 EndLine ([\r][\n]|[\n])
|
BEGIN S_ANSWER; |
BEGIN S_ANSWER; |
end_mode(); |
end_mode(); |
start_mode(MODE_ANSWER,NULL); |
start_mode(MODE_ANSWER,NULL); |
send("<caparesponse answer=\""); |
send("<numericalresponse answer=\""); |
dosend=1; |
dosend=1; |
firstparam=1; |
firstparam=1; |
} |
} |
Line 448 EndLine ([\r][\n]|[\n])
|
Line 448 EndLine ([\r][\n]|[\n])
|
dosend=1; |
dosend=1; |
firstparam=1; |
firstparam=1; |
} |
} |
^{Spaces}"/MAP" { LLDBUG_PRL1("[MAP]"); Pcount = 0; BEGIN S_MAP; start_mode(MODE_SCRIPT,NULL);send("&map("); } |
^{Spaces}"/MAP" { LLDBUG_PRL1("[MAP]"); Pcount = 0; sccount = 0; BEGIN S_MAP; start_mode(MODE_SCRIPT,NULL);send("&map("); } |
^{Spaces}"/RMAP" { LLDBUG_PRL1("[RMAP]"); Pcount = 0; BEGIN S_MAP; start_mode(MODE_SCRIPT,NULL);send("&rmap("); } |
^{Spaces}"/RMAP" { LLDBUG_PRL1("[RMAP]"); Pcount = 0; sccount = 0; BEGIN S_MAP; start_mode(MODE_SCRIPT,NULL);send("&rmap("); } |
^{Spaces}"/ENDWHILE"([^\n])* { long int file_pos; |
^{Spaces}"/ENDWHILE"([^\n])* { long int file_pos; |
int top_item, input_idx; |
int top_item, input_idx; |
LLDBUG_PRL2("[ENDWHILE While_idx=<%d>]\n",While_idx); |
LLDBUG_PRL2("[ENDWHILE While_idx=<%d>]\n",While_idx); |
Line 656 EndLine ([\r][\n]|[\n])
|
Line 656 EndLine ([\r][\n]|[\n])
|
} |
} |
|
|
<S_HINTEXLAINX>{ |
<S_HINTEXLAINX>{ |
{Alpha}{AlphaNum}* { char *aptr; |
{Alpha}{AlphaNum}* {send("${%s}",yytext);} |
char tmp_str[QUARTER_K],warn_msg[ONE_K]; |
|
int ii, len; |
|
Symbol *tmp_p; |
|
|
|
/*tmp_p = find_identifier(yytext);*/ |
|
switch(tmp_p->s_type) { |
|
case IDENTIFIER: |
|
sprintf(warn_msg,"var %s not defined.\n", yytext); |
|
capa_msg(MESSAGE_ERROR,warn_msg); |
|
break; |
|
case I_VAR: |
|
case I_CONSTANT: |
|
sprintf(tmp_str,"%ld",tmp_p->s_int); |
|
len = strlen(tmp_str); |
|
for(ii=0;ii< len;ii++) { |
|
*Current_char_p++ = tmp_str[ii]; |
|
} |
|
break; |
|
case R_VAR: |
|
case R_CONSTANT: |
|
sprintf(tmp_str,"%g",tmp_p->s_real); |
|
len = strlen(tmp_str); |
|
for(ii=0;ii< len;ii++) { |
|
*Current_char_p++ = tmp_str[ii]; |
|
} |
|
break; |
|
case S_VAR: |
|
case S_CONSTANT: |
|
len = strlen(tmp_p->s_str); |
|
aptr = tmp_p->s_str; |
|
for(ii=0;ii< len;ii++) { |
|
*Current_char_p++ = *aptr++; |
|
} |
|
break; |
|
} |
|
printf("FIXME!Hint: %s\n",yytext); |
|
} |
|
{Space}+ { } |
{Space}+ { } |
[)] { yy_pop_state(); } |
[)] { yy_pop_state(); } |
} |
} |
|
|
<S_IMPORT>{ |
<S_IMPORT>{ |
{FileName}{Space}* { end_mode();send("<import>/res/capa/%s</import>\n",yytext); BEGIN S_SKIP; } |
{FileName}{Space}* { end_mode();send("<import>/res/ohiou/%s</import>\n",yytext); BEGIN S_SKIP; } |
{Identifier}{Space}* { end_mode();send("<import>$%s</import>\n",yytext); BEGIN S_SKIP; } |
{Identifier}{Space}* { end_mode();send("<import>$%s</import>\n",yytext); BEGIN S_SKIP; } |
} |
} |
|
|
Line 738 EndLine ([\r][\n]|[\n])
|
Line 701 EndLine ([\r][\n]|[\n])
|
} |
} |
|
|
[Pp][Cc][Rr] | |
[Pp][Cc][Rr] | |
[Hh][Gg][Rr] { if (firstparam) firstparam=0; else add_delayed("\"></responseparam>\n\t"); |
[Hh][Gg][Rr] { if (firstparam) firstparam=0; else add_delayed("\" />\n\t"); |
add_delayed("<responseparam type=\"hgr\" value=\"on|off\" default=\""); |
add_delayed("<responseparam name=\"hgr\" type=\"on|off\" default=\""); |
dosend=2; |
dosend=2; |
} |
} |
[Tt][Oo][Ll] { LLDBUG_PR2("[tol(%s)]",yytext); |
[Tt][Oo][Ll] { LLDBUG_PR2("[tol(%s)]",yytext); |
if (firstparam) firstparam=0; else add_delayed("\"></responseparam>\n\t"); |
if (firstparam) firstparam=0; else add_delayed("\" />\n\t"); |
add_delayed("<responseparam type=\"tol\" value=\"tolerance\" default=\""); |
add_delayed("<responseparam name=\"tol\" type=\"tolerance\" description=\"Numerical Tolerance\" default=\""); |
dosend=2; |
dosend=2; |
} |
} |
[Ss][Ii][Gg] { |
[Ss][Ii][Gg] { |
LLDBUG_PR2("[SIG(%s)]",yytext); |
LLDBUG_PR2("[SIG(%s)]",yytext); |
if (firstparam) firstparam=0; else add_delayed("\"></responseparam>\n\t"); |
if (firstparam) firstparam=0; else add_delayed("\" />\n\t"); |
add_delayed("<responseparam type=\"sig\" value=\"int,range,0-12\" default=\""); |
add_delayed("<responseparam name=\"sig\" type=\"int,range,0-12\" description=\"Significant Figures\" default=\""); |
dosend=2; |
dosend=2; |
} |
} |
|
|
Line 780 EndLine ([\r][\n]|[\n])
|
Line 743 EndLine ([\r][\n]|[\n])
|
send("\">\n\t"); |
send("\">\n\t"); |
dosend=1; |
dosend=1; |
flush_delayed(); |
flush_delayed(); |
if (!firstparam) send("\">"); |
if (!firstparam) send("\" />"); |
send("\n\t<textline></textline>\n</caparesponse>\n"); |
send("\n\t<textline />\n</numericalresponse>\n"); |
} |
} |
} |
} |
|
|
Line 876 EndLine ([\r][\n]|[\n])
|
Line 839 EndLine ([\r][\n]|[\n])
|
if (dosend) send("\" format=\"%s",yytext+1); |
if (dosend) send("\" format=\"%s",yytext+1); |
} |
} |
|
|
|
<S_MAP>{ |
|
[;] { |
|
if (sccount==0) { |
|
send(",[\\"); |
|
sccount++; |
|
} else if (sccount==1) { |
|
send("],["); |
|
sccount++; |
|
} |
|
} |
|
[,] { |
|
if (sccount==1) { |
|
send(",\\"); |
|
} else { |
|
send(","); |
|
} |
|
} |
|
[\)] { |
|
LLDBUG_PR1("[) in MAP]"); Pcount--; |
|
if(Pcount==0) { |
|
BEGIN S_SKIP; |
|
} |
|
/* you might need a ; in the string below */ |
|
send("]%c;\n",yytext[0]); |
|
sccount=0; |
|
} |
|
} |
|
|
<S_VARIABLE,S_TRUE_FALSE_STMT,S_LET,S_MAP>{ |
<S_VARIABLE,S_TRUE_FALSE_STMT,S_LET,S_MAP>{ |
"==" { LLDBUG_PR1("[==]"); send(yytext); } |
"==" { LLDBUG_PR1("[==]"); send(yytext); } |
"!=" { LLDBUG_PR1("[!=]"); send(yytext); } |
"!=" { LLDBUG_PR1("[!=]"); send(yytext); } |
Line 995 EndLine ([\r][\n]|[\n])
|
Line 986 EndLine ([\r][\n]|[\n])
|
} |
} |
} |
} |
|
|
<S_MAP>{ |
|
[;,] { LLDBUG_PR2("[%c]",yytext[0]); send("%c",yytext[0]); } |
|
[\)] { LLDBUG_PR1("[) in MAP]"); Pcount--; |
|
if(Pcount==0) { |
|
BEGIN S_SKIP; |
|
} |
|
send("%c",yytext[0]); |
|
} |
|
} |
|
|
|
<S_ANSCONTINUE>{ |
<S_ANSCONTINUE>{ |
{Space}+ { /* ignore white spaces */ } |
{Space}+ { /* ignore white spaces */ } |
[\\]{Space}*{EndLine} { /* continuation */ } |
[\\]{Space}*{EndLine} { /* continuation */ } |