Revision 56

Date:
2010/11/16 19:31:28
Author:
gdshaw@RISCID.ORG
Revision Log:
Allowed tags to contain digits.
Files:

Legend:

 
Added
 
Removed
 
Modified
  • trunk/parser/grammar.cc

     
    27 27 std::string::size_type i=0;
    28 28 while ((i!=line.size())&&(line[i]==' ')) ++i;
    29 29 size_t j=i;
    30 while ((i!=line.size())&&(isalpha(line[i]))) ++i;
    30 while ((i!=line.size())&&(isalnum(line[i]))) ++i;
    31 31 if (i==j) throw std::runtime_error("tag expected");
    32 32 std::string result=line.substr(j,i-j);
    33 33 while ((i!=line.size())&&(line[i]==' ')) ++i;
     
    37 37 else throw std::runtime_error("<- expected");
    38 38 while ((i!=line.size())&&(line[i]==' ')) ++i;
    39 39 j=i;
    40 while ((i!=line.size())&&(isalpha(line[i]))) ++i;
    40 while ((i!=line.size())&&(isalnum(line[i]))) ++i;
    41 41 if (i==j) throw std::runtime_error("tag expected");
    42 42 std::string lhs=line.substr(j,i-j);
    43 43 while ((i!=line.size())&&(line[i]==' ')) ++i;
     
    48 48 else
    49 49 {
    50 50 j=i;
    51 while ((i!=line.size())&&(isalpha(line[i]))) ++i;
    51 while ((i!=line.size())&&(isalnum(line[i]))) ++i;
    52 52 if (i==j) throw std::runtime_error("tag expected");
    53 53 std::string rhs=line.substr(j,i-j);
    54 54 while ((i!=line.size())&&(line[i]==' ')) ++i;