diff options
-rw-r--r-- | grammar/lexer.l | 5 | ||||
-rw-r--r-- | grammar/rainerscript.c | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/grammar/lexer.l b/grammar/lexer.l index b0f4bba9..c52e5a01 100644 --- a/grammar/lexer.l +++ b/grammar/lexer.l @@ -162,7 +162,7 @@ int fileno(FILE *stream); BEGIN INOBJ; return BEGINOBJ; } "module"[ \n\t]*"(" { yylval.objType = CNFOBJ_MODULE; BEGIN INOBJ; return BEGINOBJ; } -"action"[ \n\t]*"(" { dbgprintf("RRRR: lexer: %s\n", yytext); BEGIN INOBJ; return BEGIN_ACTION; } +"action"[ \n\t]*"(" { BEGIN INOBJ; return BEGIN_ACTION; } ^[ \t]*:\$?[a-z\-]+[ ]*,[ ]*!?[a-z]+[ ]*,[ ]*\".*\" { yylval.s = strdup(rmLeadingSpace(yytext)); return PROPFILT; } ^[ \t]*[\*a-z][,\*a-z]*[0-7]*\.[,!=;\.\*a-z0-7]+ { yylval.s = strdup(rmLeadingSpace(yytext)); return PRIFILT; } @@ -192,9 +192,6 @@ int fileno(FILE *stream); yyless(14); BEGIN INCL; } else { - /*yylval.s = strdup(yytext); - return CFSYSLINE;*/ - dbgprintf("RRRR: have CFSYSLINE/lexer: %s\n", yytext); cnfDoCfsysline(strdup(yytext)); } } diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 295e46b6..30600ea3 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -1468,7 +1468,6 @@ cnfstmtPrint(struct cnfstmt *root, int indent) break; case S_PRIFILT: doIndent(indent); dbgprintf("PRIFILT '%s'\n", stmt->printable); - //cnfexprPrint(stmt->d.cond.expr, indent+1); cnfstmtPrint(stmt->d.s_prifilt.t_then, indent+1); doIndent(indent); dbgprintf("END PRIFILT\n"); break; @@ -1543,6 +1542,7 @@ cnfstmtNew(unsigned s_type) struct cnfstmt* cnfstmt; if((cnfstmt = malloc(sizeof(struct cnfstmt))) != NULL) { cnfstmt->nodetype = s_type; + cnfstmt->printable = NULL; cnfstmt->next = NULL; } return cnfstmt; @@ -1558,7 +1558,6 @@ cnfstmtDestruct(struct cnfstmt *root) case S_STOP: break; case S_ACT: -dbgprintf("XXXX: destruct action %p\n", stmt->d.act); actionDestruct(stmt->d.act); break; case S_IF: @@ -1587,6 +1586,7 @@ dbgprintf("XXXX: destruct action %p\n", stmt->d.act); (unsigned) stmt->nodetype); break; } + free(stmt->printable); todel = stmt; stmt = stmt->next; free(todel); @@ -1610,7 +1610,7 @@ cnfstmtNewPROPFILT(char *propfilt, struct cnfstmt *t_then) { struct cnfstmt* cnfstmt; if((cnfstmt = cnfstmtNew(S_PROPFILT)) != NULL) { - cnfstmt->printable = (uchar*)strdup(propfilt); + cnfstmt->printable = (uchar*)propfilt; cnfstmt->d.s_propfilt.t_then = t_then; cnfstmt->d.s_propfilt.propName = NULL; cnfstmt->d.s_propfilt.regex_cache = NULL; @@ -1633,7 +1633,7 @@ cnfstmtNewAct(struct nvlst *lst) cnfstmt->nodetype = S_NOP; /* disable action! */ goto done; } - cnfstmt->printable = (uchar*)"action()"; + cnfstmt->printable = (uchar*)strdup("action()"); done: return cnfstmt; } |