]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Wed, 26 Jul 2000 22:32:25 +0000 (22:32 +0000)
committerAndreas Gustafsson <source@isc.org>
Wed, 26 Jul 2000 22:32:25 +0000 (22:32 +0000)
Removed some debugging cruft.
Fixed handling of octal/hexadecimal numbers on input.

lib/dns/config/confndc.c
lib/dns/config/confparser.y

index c07708ca8c056c09cb4dfddb9a2e3fb08144c101..b2dae788a3e043d8b34867bd894d33669a7d227f 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: confndc.c,v 1.18.2.2 2000/07/12 17:25:49 gson Exp $ */
+/* $Id: confndc.c,v 1.18.2.3 2000/07/26 22:32:25 gson Exp $ */
 
 /*
 **     options {
@@ -1381,7 +1381,7 @@ parser_setup(ndcpcontext *pctx, isc_mem_t *mem, const char *filename) {
        pctx->thecontext = NULL;
        pctx->errors = 0;
        pctx->warnings = 0;
-       pctx->debug_lexer = ISC_TF(getenv("DEBUG_LEXER") != NULL);
+       pctx->debug_lexer = ISC_FALSE;
 
        pctx->prevtok = pctx->currtok = 0;
 
@@ -1610,9 +1610,6 @@ getnexttoken(ndcpcontext *pctx) {
         case ISC_R_SUCCESS:
                switch (token.type) {
                case isc_tokentype_unknown:
-                       if (pctx->debug_lexer)
-                               fprintf(stderr, "unknown token\n");
-
                        result = ISC_R_FAILURE;
                        break;
 
@@ -1629,12 +1626,6 @@ getnexttoken(ndcpcontext *pctx) {
                                tokstr[CONF_MAX_IDENT - 1] = '\0';
                        }
 
-                       if (pctx->debug_lexer)
-                               fprintf(stderr, "lexer token: %s : %s\n",
-                                       (token.type == isc_tokentype_special ?
-                                        "special" : "string"),
-                                       tokstr);
-
                        result = isc_symtab_lookup(pctx->thekeywords, tokstr,
                                                   KEYWORD_SYM_TYPE,
                                                   &keywordtok);
@@ -1659,11 +1650,6 @@ getnexttoken(ndcpcontext *pctx) {
                        pctx->currtok = L_INTEGER;
                        sprintf(pctx->tokstr, "%lu",
                                (unsigned long)pctx->intval);
-
-                       if(pctx->debug_lexer)
-                               fprintf(stderr, "lexer token: number : %lu\n",
-                                       (unsigned long)pctx->intval);
-
                        break;
 
                case isc_tokentype_qstring:
@@ -1672,12 +1658,6 @@ getnexttoken(ndcpcontext *pctx) {
                                CONF_MAX_IDENT);
                        pctx->tokstr[CONF_MAX_IDENT - 1] = '\0';
                        pctx->currtok = L_QSTRING;
-
-                       if (pctx->debug_lexer)
-                               fprintf(stderr,
-                                       "lexer token: qstring : \"%s\"\n",
-                                       pctx->tokstr);
-
                        break;
 
                case isc_tokentype_eof:
@@ -1690,39 +1670,23 @@ getnexttoken(ndcpcontext *pctx) {
                                 * The only way to tell that we closed the
                                 * main file and not an included file.
                                 */
-                               if (pctx->debug_lexer)
-                                       fprintf(stderr, "lexer token: EOF\n");
-
                                pctx->currtok = L_END_INPUT;
 
                        } else {
-                               if (pctx->debug_lexer)
-                                       fprintf(stderr,
-                                               "lexer token: EOF (main)\n");
-
                                pctx->currtok = L_END_INCLUDE;
                        }
                        result = ISC_R_SUCCESS;
                        break;
 
                case isc_tokentype_initialws:
-                       if (pctx->debug_lexer)
-                               fprintf(stderr, "lexer token: initial ws\n");
-
                        result = ISC_R_FAILURE;
                        break;
 
                case isc_tokentype_eol:
-                       if (pctx->debug_lexer)
-                               fprintf(stderr, "lexer token: eol\n");
-
                        result = ISC_R_FAILURE;
                        break;
 
                case isc_tokentype_nomore:
-                       if (pctx->debug_lexer)
-                               fprintf(stderr, "lexer token: nomore\n");
-
                        result = ISC_R_FAILURE;
                        break;
                }
index cac47eb22f81cb6fdd4cdad3f0225cf20653514b..25eaa572e39cd7390700d2331ba64550112dd474 100644 (file)
@@ -16,7 +16,7 @@
  * SOFTWARE.
  */
 
-/* $Id: confparser.y,v 1.99.2.2 2000/07/11 21:31:48 gson Exp $ */
+/* $Id: confparser.y,v 1.99.2.3 2000/07/26 22:32:23 gson Exp $ */
 
 #include <config.h>
 
@@ -122,7 +122,6 @@ static isc_lexspecials_t    specials;
 
 
 static isc_result_t    tmpres;
-static int             debug_lexer;
 static in_port_t       default_port;
 
 int                    yyparse(void);
@@ -5351,12 +5350,6 @@ dns_c_parse_namedconf(const char *filename, isc_mem_t *mem,
        INSIST(keywords == NULL);
        INSIST(callbacks == NULL);
 
-#if 1
-       if (getenv("DEBUG_LEXER") != NULL) { /* XXX debug */
-               debug_lexer++;
-       }
-#endif
-
        specials['{'] = 1;
        specials['}'] = 1;
        specials[';'] = 1;
@@ -5515,6 +5508,7 @@ yylex(void)
        isc_result_t res;
        int options = (ISC_LEXOPT_EOF |
                       ISC_LEXOPT_NUMBER |
+                      ISC_LEXOPT_CNUMBER |
                       ISC_LEXOPT_QSTRING |
                       ISC_LEXOPT_NOMORE);
 
@@ -5764,10 +5758,6 @@ token_value(isc_token_t *token, isc_symtab_t *symtable)
 
        switch (token->type) {
        case isc_tokentype_unknown:
-               if (debug_lexer) {
-                       fprintf(stderr, "unknown lexer token\n");
-               }
-
                res = -1;
                break;
 
@@ -5789,24 +5779,11 @@ token_value(isc_token_t *token, isc_symtab_t *symtable)
                } else {
                        res = keywordtok.as_integer;
                }
-
-               if (debug_lexer) {
-                       fprintf(stderr, "lexer token: %s : %s (%d)\n",
-                               (token->type == isc_tokentype_special ?
-                                "special" : "string"), tokstring, res);
-               }
-
                break;
 
        case isc_tokentype_number:
                yylval.ul_int = (isc_uint32_t)token->value.as_ulong;
                res = L_INTEGER;
-
-               if(debug_lexer) {
-                       fprintf(stderr, "lexer token: number : %lu\n",
-                               (unsigned long)yylval.ul_int);
-               }
-
                break;
 
        case isc_tokentype_qstring:
@@ -5817,12 +5794,6 @@ token_value(isc_token_t *token, isc_symtab_t *symtable)
                } else {
                        res = L_QSTRING;
                }
-
-               if (debug_lexer) {
-                       fprintf(stderr, "lexer token: qstring : \"%s\"\n",
-                               yylval.text);
-               }
-
                break;
 
        case isc_tokentype_eof:
@@ -5833,36 +5804,21 @@ token_value(isc_token_t *token, isc_symtab_t *symtable)
                        /* the only way to tell that we
                         *  closed the main file and not an included file
                         */
-                       if (debug_lexer) {
-                               fprintf(stderr, "lexer token: EOF\n");
-                       }
                        res = 0;
                } else {
-                       if (debug_lexer) {
-                               fprintf(stderr, "lexer token: EOF (main)\n");
-                       }
                        res = L_END_INCLUDE;
                }
                break;
 
        case isc_tokentype_initialws:
-               if (debug_lexer) {
-                       fprintf(stderr, "lexer token: initial ws\n");
-               }
                res = -1;
                break;
 
        case isc_tokentype_eol:
-               if (debug_lexer) {
-                       fprintf(stderr, "lexer token: eol\n");
-               }
                res = -1;
                break;
 
        case isc_tokentype_nomore:
-               if (debug_lexer) {
-                       fprintf(stderr, "lexer token: nomore\n");
-               }
                res = -1;
                break;
        }