OSSP CVS Repository

ossp - Check-in [2307]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2307
Date: 2002-Jul-17 20:47:09 (local)
2002-Jul-17 18:47:09 (UTC)
User:rse
Branch:
Comment: use definitions to remove redundancy
Tickets:
Inspections:
Files:
ossp-pkg/cfg/cfg_syn_scan.l      1.9 -> 1.10     10 inserted, 8 deleted

ossp-pkg/cfg/cfg_syn_scan.l 1.9 -> 1.10

--- cfg_syn_scan.l       2002/07/17 14:48:08     1.9
+++ cfg_syn_scan.l       2002/07/17 18:47:09     1.10
@@ -77,6 +77,12 @@
 %x SS_PT
 %x SS_CO_C
 
+/* the delimiting character for flexible quoting has to one a
+   special character c, i.e., one of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ or 
+   in C code: isprint(c) && !isspace(c) && !iscntrl(c) && !isalpha(i) && !isdigit(i) */
+FQDEL   [\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~]
+FQDELN [^\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~]
+
 %%
 
     /* local variables */
@@ -209,19 +215,15 @@
     return 0;
 }
 
-    /* flexible-quoted word (q(.)[^\1]\1)
-       the delimiting character has to one a special character c, i.e.,
-       one of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ or in C code:
-       isprint(c) && !isspace(c) && !iscntrl(c) && !isalpha(i) && !isdigit(i)
-       */
-"q"[\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~] {
+    /* flexible-quoted word (q(.)[^\1]\1) */
+"q"{FQDEL} {
     cpStr = caStr;
     nQuoteOpen = 1;
     cQuoteOpen = yytext[1];
     cQuoteClose = closing_brace(yytext[1]);
     BEGIN(SS_FQ);
 }
-<SS_FQ>\\[\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~] {
+<SS_FQ>\\{FQDEL} {
     if (yytext[1] == cQuoteOpen || yytext[1] == cQuoteClose) {
         *cpStr++ = yytext[1];
     }
@@ -233,7 +235,7 @@
 <SS_FQ>\\\n[ \t]* {
     /* no-op */
 }
-<SS_FQ>[^\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~] {
+<SS_FQ>{FQDELN} {
     char *cp = yytext;
     while (*cp != '\0')
         *cpStr++ = *cp++;

CVSTrac 2.0.1