* 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 {
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;
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;
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);
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:
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:
* 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;
}
* 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>
static isc_result_t tmpres;
-static int debug_lexer;
static in_port_t default_port;
int yyparse(void);
INSIST(keywords == NULL);
INSIST(callbacks == NULL);
-#if 1
- if (getenv("DEBUG_LEXER") != NULL) { /* XXX debug */
- debug_lexer++;
- }
-#endif
-
specials['{'] = 1;
specials['}'] = 1;
specials[';'] = 1;
isc_result_t res;
int options = (ISC_LEXOPT_EOF |
ISC_LEXOPT_NUMBER |
+ ISC_LEXOPT_CNUMBER |
ISC_LEXOPT_QSTRING |
ISC_LEXOPT_NOMORE);
switch (token->type) {
case isc_tokentype_unknown:
- if (debug_lexer) {
- fprintf(stderr, "unknown lexer token\n");
- }
-
res = -1;
break;
} 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:
} else {
res = L_QSTRING;
}
-
- if (debug_lexer) {
- fprintf(stderr, "lexer token: qstring : \"%s\"\n",
- yylval.text);
- }
-
break;
case isc_tokentype_eof:
/* 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;
}