Annotation of researchv10no/cmd/diction/rewrite.l, revision 1.1

1.1     ! root        1: %{
        !             2: #include <ctype.h>
        !             3: int i;
        !             4: %}
        !             5: L      [a-z0-9]
        !             6: %%
        !             7: ^be[\t].+[\n]  {
        !             8:        for(i=0;i<yyleng;i++)
        !             9:                if(yytext[i] == '\t')break;
        !            10:        while(++i<yyleng-1){
        !            11:                if(islower(yytext[i]))
        !            12:                        putchar(toupper(yytext[i]));
        !            13:                else putchar(yytext[i]);
        !            14:        }
        !            15:        putchar(' ');
        !            16:        }
        !            17: ^prep[\t].+[\n]        {
        !            18:        for(i=0;i<yyleng;i++)
        !            19:                if(yytext[i] == '\t')break;
        !            20:        while(++i<yyleng-1){
        !            21:                if(islower(yytext[i]))
        !            22:                        putchar(toupper(yytext[i]));
        !            23:                else putchar(yytext[i]);
        !            24:        }
        !            25:        putchar(' ');
        !            26:        }
        !            27: ^"verb"[\t]"be"[\n]    {
        !            28:        printf("BE");
        !            29:        putchar(' ');
        !            30:        }
        !            31: ^{L}+[\t].+[\n]        {
        !            32:        for(i=0;i<yyleng;i++)
        !            33:                if(yytext[i] == '\t')break;
        !            34:        while(++i<yyleng-1){
        !            35:                if(isupper(yytext[i]))
        !            36:                        putchar(tolower(yytext[i]));
        !            37:                else
        !            38:                        putchar(yytext[i]);
        !            39:        }
        !            40:        putchar(' ');
        !            41:        }
        !            42: ^[.,;:][\t][.,;:!][\n] {
        !            43:        putchar(yytext[2]);
        !            44:        putchar('\n');
        !            45:        }
        !            46: ^"..."[\t]"..."[\n]    {
        !            47:        printf(" ...");
        !            48:        }
        !            49: ^[\[\]()\{\}\"-][\t][\[\]()\{\}\"-][\n]        {
        !            50:        putchar(yytext[0]);
        !            51:        }
        !            52: ^"``"[\t]"``"[\n]      {
        !            53:        printf("``");
        !            54:        }
        !            55: ^"--"[\t]"--"[\n]      {
        !            56:        printf(" -- ");
        !            57:        }
        !            58: ^"."[\t]".\""  {
        !            59:        printf(" .\"");
        !            60:        }
        !            61: ^"'    '"[\n]  {
        !            62:        putchar(yytext[0]);
        !            63:        }
        !            64: ^"''"[\t]"''"[\n]      {
        !            65:        printf(" ''");
        !            66:        }
        !            67: ^"`    `"[\n]  {
        !            68:        putchar(yytext[0]);
        !            69:        }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.