Diff for /loncom/homework/CAPA-converter/capaLexerDef.flex between versions 1.4 and 1.8

version 1.4, 2000/07/06 21:06:22 version 1.8, 2001/07/09 04:01:53
Line 382  EndLine    ([\r][\n]|[\n]) Line 382  EndLine    ([\r][\n]|[\n])
   
 <S_COMMENT>{  <S_COMMENT>{
 {EndLine}{Spaces}"//"[^\n]*$ {LLDBUG_PRL2("[COMMENT<%s>]\n",yytext);   {EndLine}{Spaces}"//"[^\n]*$ {LLDBUG_PRL2("[COMMENT<%s>]\n",yytext); 
       send("# %s",&yytext[2]);        send("# %s\n",&yytext[2]);
                              }                               }
 [^\n]*{EndLine}      {  [^\n]*{EndLine}      {
                        send("\n"); BEGIN S_TEXT;                         send("\n"); BEGIN S_TEXT;
Line 699  EndLine    ([\r][\n]|[\n]) Line 699  EndLine    ([\r][\n]|[\n])
 }  }
   
 <S_IMPORT>{  <S_IMPORT>{
 {FileName}{Space}*             { end_mode();send("<import>%s</import>\n",yytext); BEGIN S_SKIP; }  {FileName}{Space}*             { end_mode();send("<import>/res/capa/%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 738  EndLine    ([\r][\n]|[\n])
                              }                               }
   
 [Pp][Cc][Rr]                 |  [Pp][Cc][Rr]                 |
 [Hh][Gg][Rr]                 { if (firstparam) firstparam=0; else add_delayed("\">\n\t");  [Hh][Gg][Rr]                 { if (firstparam) firstparam=0; else add_delayed("\"></responseparam>\n\t");
                                add_delayed("<param type=\"hgr\" value=\"on|off\" default=\"");                                  add_delayed("<responseparam type=\"hgr\" value=\"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("\">\n\t");                                 if (firstparam) firstparam=0; else add_delayed("\"></responseparam>\n\t");
        add_delayed("<param type=\"tol\" value=\"tolerance\" default=\"");          add_delayed("<responseparam type=\"tol\" value=\"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("\">\n\t");                                 if (firstparam) firstparam=0; else add_delayed("\"></responseparam>\n\t");
        add_delayed("<param type=\"sig\" value=\"int,range,0-12\" default=\"");          add_delayed("<responseparam type=\"sig\" value=\"int,range,0-12\" default=\""); 
                                dosend=2;                                 dosend=2;
                              }                               }
   
 [Ss][Tt][Rr]                 { LLDBUG_PR1("[STR]"); send("\" str="); dosend=1; }  [Ss][Tt][Rr]                 { LLDBUG_PR1("[STR]"); send("\" str=\""); dosend=1; }
 [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]             |
Line 837  EndLine    ([\r][\n]|[\n]) Line 837  EndLine    ([\r][\n]|[\n])
 <S_VARIABLE,S_TRUE_FALSE_STMT,S_MAP,S_LET>{  <S_VARIABLE,S_TRUE_FALSE_STMT,S_MAP,S_LET>{
 [\"]                      { LLDBUG_PR1("[TF,V,LET,MAP str\" ]");   [\"]                      { LLDBUG_PR1("[TF,V,LET,MAP str\" ]"); 
                             Current_char_p = String_buf;                               Current_char_p = String_buf; 
     send("\"");      send("'");
                             yy_push_state(S_STRING);                              yy_push_state(S_STRING);
                           }                            }
 }  }
Line 870  EndLine    ([\r][\n]|[\n]) Line 870  EndLine    ([\r][\n]|[\n])
                              end_delayed();                               end_delayed();
                              send("&format(");                               send("&format(");
                              flush_delayed();                               flush_delayed();
                              send(",\"%s\")",yytext+1);                               send(",'%s')",yytext+1);
                            }                             }
 <S_ANSWER>[:]{Number}+[EeFf]   {   <S_ANSWER>[:]{Number}+[EeFf]   { 
                              if (dosend) send("\" format=\"%s",yytext+1);                               if (dosend) send("\" format=\"%s",yytext+1);
Line 931  EndLine    ([\r][\n]|[\n]) Line 931  EndLine    ([\r][\n]|[\n])
 [\\][\"]            { /**Current_char_p++ = '"';*/ send("\\\"");  }  [\\][\"]            { /**Current_char_p++ = '"';*/ send("\\\"");  }
 [\\]{Space}*[\n]    { LLDBUG_PR2("[\\CR continue in S_STRING](%s)",yytext); /* continuation on next line */ }                         [\\]{Space}*[\n]    { LLDBUG_PR2("[\\CR continue in S_STRING](%s)",yytext); /* continuation on next line */ }                       
 [\"]                { /* end of a string constant --   */  [\"]                { /* end of a string constant --   */
                       send("\"");                        send("'");
       yy_pop_state();        yy_pop_state();
     }      }
 {EndLine}           { /* check for termination of string constant */  {EndLine}           { /* check for termination of string constant */
Line 996  EndLine    ([\r][\n]|[\n]) Line 996  EndLine    ([\r][\n]|[\n])
 }  }
   
 <S_MAP>{  <S_MAP>{
 [;,]                         { LLDBUG_PR2("[%c]",yytext[0]); return(yytext[0]);  }  [;,]                         { LLDBUG_PR2("[%c]",yytext[0]); send("%c",yytext[0]);  }
 [\)]                         { LLDBUG_PR1("[) in MAP]"); Pcount--;   [\)]                         { LLDBUG_PR1("[) in MAP]"); Pcount--; 
                                if(Pcount==0) {                                 if(Pcount==0) {
                                    BEGIN S_SKIP;                                      BEGIN S_SKIP; 
                                }                                 }
                                return(yytext[0]);                                  send("%c",yytext[0]); 
                              }                               }
 }  }
   

Removed from v.1.4  
changed lines
  Added in v.1.8


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>