Support namespaces / modules in bif. Checkpoint.

(now actually commiting all the files)

This change is actually two-fold:
a) bif's now accept module XYZ; statements and module::ID for
   function, const, event, enum, etc. declartation
b) Added C++-namespaces to variables, functions, etc. that are declared
   in bif but accessed from C++
   This required some (lightweight) re-factoring of the C++ codes.
   Note, event's don't have their own C++ namespace yet, since this
   would require a rather huge re-factoring.

Compiles and passes test suite.
New namespace feature not tested yet.
Documentation to follow.
This commit is contained in:
Gregor Maier 2011-02-11 09:37:23 -08:00
parent 86fdd1dcf3
commit f79ea244fa
31 changed files with 332 additions and 228 deletions

View file

@ -28,7 +28,11 @@ int check_c_mode(int t)
%}
WS [ \t]+
ID [A-Za-z_][A-Za-z_0-9]*
/* Note, bifcl only accepts a single :: in IDs while the policy
layer acceptes multiple. (But the policy layer doesn't have
a hierachy */
IDCOMPONENT [A-Za-z_][A-Za-z_0-9]*
ID {IDCOMPONENT}(::{IDCOMPONENT})?
ESCSEQ (\\([^\n]|[0-7]+|x[[:xdigit:]]+))
D [[:digit:]]+
HEX [0-9a-fA-F]+
@ -69,6 +73,7 @@ HEX [0-9a-fA-F]+
"enum" return check_c_mode(TOK_ENUM);
"type" return check_c_mode(TOK_TYPE);
"record" return check_c_mode(TOK_RECORD);
"module" return check_c_mode(TOK_MODULE);
"@ARG@" return TOK_ARG;
"@ARGS@" return TOK_ARGS;