[Bro-Dev] BiF parsing index types
Gregor Maier
gregor at icir.org
Mon May 16 14:25:00 PDT 2011
>> I thought about that too. However the problem with treating the types as
>> opaque is that the parser still has to parse over them as they contain
>> keyword, tokens, braces, etc.
>
> Wouldn't it only need to follow brackets and parentheses? That's
> pretty straight-forward, and everything read while doing so would just
> be concatenated into a single string.
I don't think that you can specify a yacc grammar that will work. E.g.,
consider this grammar:
type_def: TOK_TYPE opt_ws TOK_ID opt_ws ':' opt_ws TOK_RECORD opt_ws ';'
the trailing ';' would have to be replaced with something like
.... TOK_RECORD opt_ws { THE_OPAQUE_STRING }
but I don't see how you can specify THE_OPAQUE_STRING in a short way
without reproducing a lot of Bro's grammar.
But maybe I'm missing something. I'm not a yacc expert.
cu
Gregor
--
Gregor Maier
<gregor at icir.org> <gregor at icsi.berkeley.edu>
Int. Computer Science Institute (ICSI)
1947 Center St., Ste. 600
Berkeley, CA 94704, USA
http://www.icir.org/gregor/
More information about the bro-dev
mailing list