I'm writing a simple HTML parser using yacc(bison) and flex. how can I make this rule:
column -> <td>text</td>column | NULL
I've tried many forms like this:
COLUMN : L_TAG T_OPEN R_TAG ID L_TAG T_CLOSE R_TAG COLUMN
|
;
//The tokens are specified in lex.
unfortunately it doesn't work. it gives me the shift/reduce error. whether I put the COLUMN at the beginning of the rule or at the end. whether I use the NULL like this:
{$$ = NULL}
or leave it empty. I need the NULL thing to make the rule recursive and be able to have the same tag more than once next to each other. something like this:
<tr>name</tr><tr>age</tr>
how can I make this work?