version 1.15, 2001/12/05 18:58:21
|
version 1.19, 2002/03/20 18:15:00
|
Line 488 EndLine ([\r][\n]|[\n])
|
Line 488 EndLine ([\r][\n]|[\n])
|
} |
} |
^{Spaces}"/MAP" { LLDBUG_PRL1("[MAP]"); Pcount = 0; sccount = 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; sccount = 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])* { |
int top_item, input_idx; |
int i; |
LLDBUG_PRL2("[ENDWHILE While_idx=<%d>]\n",While_idx); |
LLDBUG_PRL2("[ENDWHILE While_idx=<%d>]\n",IFcount); |
|
IFcount--; |
top_item = While_idx - 1; |
end_mode_stream(DEFAULT_DEST,0); |
if( top_item < 0 ) { /* strange things must have happened here! */ |
for(i=0;i<IFcount;i++) {send("\t",NULL);} |
|
send_stream(0,"</while>"); |
} else { |
send_stream(1,"}"); |
input_idx = WhileStack[top_item].input_idx; |
if (IFcount == 0) { |
file_pos = WhileStack[top_item].pos_idx; |
if (watch_mode[current_dest][1]) { |
Current_line[input_idx] = WhileStack[top_item].line_idx; |
end_streams(DEFAULT_DEST,1); |
Lexi_pos[input_idx] = 0; |
} else { |
fseek(Input_stream[input_idx],file_pos,SEEK_SET); |
end_streams(DEFAULT_DEST,0); |
fgets(Lexi_buf[input_idx],LEX_BUFLEN-1,Input_stream[input_idx]); |
} |
While_idx--; |
change_destination(DEFAULT_DEST); |
} |
} |
|
delete_cache(); |
BEGIN S_TEXT; |
BEGIN S_TEXT; |
} |
} |
"/WHILE" | |
"/WHILE" | |
^{Spaces}"/WHILE" { long int file_pos; |
^{Spaces}"/WHILE" { |
int leng; |
int i; |
LLDBUG_PRL2("[WHILE While_idx=<%d>]\n",While_idx); |
LLDBUG_PRL2("[WHILE While_idx=<%d>]\n",IFcount); |
leng = strlen(Lexi_buf[Input_idx]); /* length of current line */ |
IFcount++; /* advance the stack pointer */ |
/* <-- because we use fgets() to read input, |
BEGIN S_TRUE_FALSE_STMT; |
thus ftell() will give the starting position of next line */ |
if ( IFcount == 1) { |
WhileStack[While_idx].input_idx = Input_idx; |
start_streams(DEFAULT_DEST, 2); |
file_pos = ftell(Input_stream[Input_idx]); |
change_destination(DEFAULT_DEST); |
file_pos -= leng; /* calibrate the current line length */ |
watch_mode[current_dest][1]=1; |
WhileStack[While_idx].pos_idx = file_pos; /* begin of current line */ |
} |
WhileStack[While_idx].line_idx = Current_line[Input_idx]; |
end_mode_stream(DEFAULT_DEST, 0); |
While_idx++; /* advance the stack pointer */ |
start_mode_stream(DEFAULT_DEST,1,MODE_SCRIPT,NULL); |
|
for(i=1;i<IFcount;i++) {send("\t",NULL);} |
BEGIN S_TRUE_FALSE_STMT; RETURN(CAPA_WHILE); |
send_stream(0,"<while condition=\"",NULL); |
|
send_stream(1,"while (",NULL); |
|
new_cache(); |
|
start_cache(); |
} |
} |
^{Spaces}"/IF" { int i; |
^{Spaces}"/IF" { int i; |
IFcount++; |
IFcount++; |
Line 576 EndLine ([\r][\n]|[\n])
|
Line 579 EndLine ([\r][\n]|[\n])
|
} |
} |
"/OR" { LLDBUG_PRL1("[OR]"); BEGIN S_ANSCONTINUE; RETURN(ANS_OR); } |
"/OR" { LLDBUG_PRL1("[OR]"); BEGIN S_ANSCONTINUE; RETURN(ANS_OR); } |
{EndLine} { LLDBUG_PR1("[EoL within S_TEXT]\n"); /* end of the whole text line */ |
{EndLine} { LLDBUG_PR1("[EoL within S_TEXT]\n"); /* end of the whole text line */ |
send("\n"); } |
send("<br />\n"); } |
[\\]{Space}*{EndLine} { LLDBUG_PR2("[\\EoL continue](%s)",yytext); /* continuation on next line */ } |
[\\]{Space}*{EndLine} { LLDBUG_PR2("[\\EoL continue](%s)",yytext); /* continuation on next line */ } |
^{Spaces}"//"[^\n]*$ { LLDBUG_PRL2("[COMMENT<%s>]\n",yytext); |
^{Spaces}"//"[^\n]*$ { LLDBUG_PRL2("[COMMENT<%s>]\n",yytext); |
start_mode(MODE_SCRIPT,NULL); |
start_mode(MODE_SCRIPT,NULL); |
Line 812 EndLine ([\r][\n]|[\n])
|
Line 815 EndLine ([\r][\n]|[\n])
|
} else { |
} else { |
add_delayed("\" />\n\t"); |
add_delayed("\" />\n\t"); |
} |
} |
add_delayed("<responseparam name=\"sig\" type=\"int,range,0-12\" description=\"Significant Figures\" default=\""); |
add_delayed("<responseparam name=\"sig\" type=\"int_range,0-12\" description=\"Significant Figures\" default=\""); |
dosend=2; |
dosend=2; |
} |
} |
|
|
Line 820 EndLine ([\r][\n]|[\n])
|
Line 823 EndLine ([\r][\n]|[\n])
|
[Ee][Vv][Aa][Ll] | |
[Ee][Vv][Aa][Ll] | |
[Ee][Vv][Aa][Ll][Uu][Aa][Tt][Ee] { LLDBUG_PR1("[EVAL]");send("\" eval="); dosend=1;} |
[Ee][Vv][Aa][Ll][Uu][Aa][Tt][Ee] { LLDBUG_PR1("[EVAL]");send("\" eval="); dosend=1;} |
[Uu][Nn][Ii][Tt] | |
[Uu][Nn][Ii][Tt] | |
[Uu][Nn][Ii][Tt][Ss] { LLDBUG_PR1("[UNIT]"); send("\" units=\""); dosend=1;} |
[Uu][Nn][Ii][Tt][Ss] { LLDBUG_PR1("[UNIT]"); send("\" unit=\""); dosend=1;} |
|
|
[Ee][Xx][Tt][Ee][Rr][Nn][Aa][Ll] { LLDBUG_PR1("[EXTERNAL]"); dosend=0; } |
[Ee][Xx][Tt][Ee][Rr][Nn][Aa][Ll] { LLDBUG_PR1("[EXTERNAL]"); dosend=0; } |
[Aa][Nn][Ss][Bb][Oo][Xx] { LLDBUG_PR1("[SHOW_ANS_BOX]"); dosend=0; } |
[Aa][Nn][Ss][Bb][Oo][Xx] { LLDBUG_PR1("[SHOW_ANS_BOX]"); dosend=0; } |
Line 873 EndLine ([\r][\n]|[\n])
|
Line 876 EndLine ([\r][\n]|[\n])
|
if (dosend==2) add_delayed("&%s",yytext); |
if (dosend==2) add_delayed("&%s",yytext); |
Pcount++; |
Pcount++; |
} |
} |
{Alpha}{AlphaNum}*{Space}*[\[] { char aline[MAX_FUNC_NAME]; |
{Alpha}{AlphaNum}*{Space}*[\[] { |
int i; |
LLDBUG_PR2("[ARRAY<%s>]",yytext); |
for(i=0;i < (yyleng-1); i++) { |
|
if( yytext[i] == ' ' || yytext[i] == '\t' || |
|
yytext[i] == 0 || yytext[i] == '[' ) break; |
|
aline[i] = yytext[i]; |
|
} |
|
aline[i] = 0; |
|
LLDBUG_PR2("[ARRAY<%s>]",aline); |
|
|
|
yylval = (Symbol *) capa_malloc(1, sizeof(Symbol)); /* *** */ |
yyless(yyleng-1); /*<-- push back char '[' */ |
yylval->s_name = strsave(aline); /* free it in parser() */ |
if (dosend==1) send("$%s",yytext); |
yylval->s_type = ARRAY_ID; |
if (dosend==2) add_delayed("$%s",yytext); |
|
|
yyless(yyleng-1); /* <-- push back char '[' */ |
|
RETURN(ARRAY_ID); |
|
} |
} |
{Number}*"\."{Number}*[Ee]"+"{Number}+ | |
{Number}*"\."{Number}*[Ee]"+"{Number}+ | |
{Number}*"\."{Number}*[Ee]{Number}+ | |
{Number}*"\."{Number}*[Ee]{Number}+ | |
Line 906 EndLine ([\r][\n]|[\n])
|
Line 899 EndLine ([\r][\n]|[\n])
|
if (dosend==1) send("%s",yytext); |
if (dosend==1) send("%s",yytext); |
if (dosend==2) add_delayed("%s",yytext); |
if (dosend==2) add_delayed("%s",yytext); |
} |
} |
[\[] { LLDBUG_PR1("[dis let ans map '[']"); return(yytext[0]); } |
[\[] { LLDBUG_PR1("[dis let ans map '[']"); |
[\]] { LLDBUG_PR1("[dis let ans map ']']"); return(yytext[0]); } |
if(dosend==1) send("%s",yytext); |
|
if(dosend==2) add_delayed("%s",yytext); |
|
} |
|
[\]] { LLDBUG_PR1("[dis let ans map ']']"); |
|
if(dosend==1) send("%s",yytext); |
|
if(dosend==2) add_delayed("%s",yytext); |
|
} |
{Space}+ { /* LLDBUG_PR1("[SP ignored]"); Ignore Spaces */ } |
{Space}+ { /* LLDBUG_PR1("[SP ignored]"); Ignore Spaces */ } |
} |
} |
|
|