Allow default function/hook/event parameters. Addresses #972.

And changed the endianness parameter of bytestring_to_count() BIF to
default to false (big endian), mostly just to prove that the BIF parser
doesn't choke on default parameters.
This commit is contained in:
Jon Siwek 2013-05-07 14:32:22 -05:00
parent 69c7363147
commit e2a1d4a233
14 changed files with 239 additions and 28 deletions

View file

@ -26,6 +26,7 @@ int check_c_mode(int t)
%}
WS [ \t]+
OWS [ \t]*
/* Note, bifcl only accepts a single "::" in IDs while the policy
layer acceptes multiple. (But the policy layer doesn't have
a hierachy. */
@ -101,7 +102,13 @@ HEX [0-9a-fA-F]+
return TOK_ID;
}
&{ID} {
/*
Hacky way to pass along arbitrary attribute expressions since the BIF parser
has little understanding of valid Bro expressions. With this pattern, the
attribute expression should stop when it reaches another attribute, another
function argument, or the end of the function declaration.
*/
&{ID}({OWS}={OWS}[^&%;,]+)? {
int t = check_c_mode(TOK_ATTR);
if ( t == TOK_ATTR )