scanner rules


  
  {begintag}  { 
          char tag[BUFSIZ];
          char atts[2*BUFSIZ];
          char* p = yytext+1;
          yytext[yyleng-1]='\0';
          while (p && !delim(*p)) p++;
          if (*p != '\0') {
  		*p = '\0';
                  strcpy(tag,yytext+1);
                  strcpy(atts,p+1);
          } else {
                  strcpy(tag,yytext+1);
                  strcpy(atts,"");
          }
                  
          cout << "TAG: " << tag << endl;
          cout << "ATTS: " << atts << endl;
          //VW->open_element(tag, atts );
          //cout << "SC:begin simple " << yytext;
          }
  "</"{ident}">"    {
          char* tag = yytext+2; yytext[yyleng-1]='\0';
          cout << "/TAG: " << tag << endl;
          //VW->close_element(tag);
          }
  {begincmt}  { 
          in_cmt++; //cout << "begin cmt " <, endl;
          }
  {endcmt}  { 
          in_cmt--; cout << "begin cmt " << endl; 
          }
  any     { 
          //cout << "Any " << yytext << endl;
          }
  {value}|\n|. {
          cout << "DATA: " << yytext << endl;
          //VW->new_data(yytext);
          }
  

slide: scanner rules