bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [trunk]: I-option2.patch


From: Akim Demaille
Subject: Re: [trunk]: I-option2.patch
Date: 26 Nov 2001 10:54:53 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

| +/*---------------------------------.
| +| Parse a double quoted parameter. |
| +`---------------------------------*/
|  
| +static const char *
| +parse_dquoted_param (const char *from)
| +{
| +  char buff[32];

This is not acceptable IMHO.

| +  int c;
| +  int i;
| +
| +  c = skip_white_space ();
| +
| +  if (c != '"')
| +    {
| +      ungetc (c, finput);
| +      complain (_("invalid %s declaration"), from);
| +      return NULL;
| +    }
| +
| +  c = getc (finput);
| +  for (i = 0; (c >= '!') && (c <= '~'); i++)

Sorry, but I don't understand `(c >= '!') && (c <= '~')'.

| +    {
| +      if (c == '"')
| +     break;
| +
| +      if (c == '\\')
| +     {
| +       c = getc (finput);
| +       if ((c < '!') && (c > '~'))

I don't understand, and I shouldn't have to make efforts to understand.

| +         break;
| +     }
| +
| +      buff[i] = c;
| +      c = getc (finput);
| +    }
| +  buff[i] = '\0';
| +
| +  if (c != '"')
| +    {
| +      ungetc (c, finput);
| +      complain (_("invalid %s declaration"), from);
| +      return NULL;
| +    }
| +
| +  return xstrdup (buff);
| +}

I don't understand why there's no use of literalchar in your code.
Something is probably wrong.

Also, are you sure the _reader_ should go for a string instead of
waiting for a string from the scanner.  I tend to think the approach
is wrong.  The scanner knows how to swallow strings, you should rely
on that.

But I might be wrong, of course.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]