[Bro-Dev] BiF parsing index types

Robin Sommer robin at icir.org
Tue May 17 20:50:14 PDT 2011


On Mon, May 16, 2011 at 23:25 +0200, you wrote:

>    .... TOK_RECORD opt_ws {  THE_OPAQUE_STRING }

How about something like this:

    .... TOK_RECORD opt_ws {  opaque_string }

    opaque_string : TOK_NO_BRACKET_STRING opaque_string
                  | '[' opaque_string ']'
                  | '{' opaque_string '}'
                  | '(' opaque_string ')'
                  |

TOK_NO_BRACKET_STRING is something like '[^{}[]()]+'.

And for each rule, we append the $1,...,$n to a global
current_opaque_string.

This is probably too simplistic, I'm sure I'm missing something (and
it doesn't preserve white-space; we'd need switch the lexer into a
separate mode). But some hack like that.

Robin

-- 
Robin Sommer * Phone +1 (510) 722-6541 * robin at icir.org
ICSI/LBNL    * Fax   +1 (510) 666-2956 *   www.icir.org


More information about the bro-dev mailing list