-MODIFIER_LIST : MODIFIER_LIST MODIFIER {PASS12 $$=$1|$2;}
-
-MODIFIER : KW_PUBLIC {PASS12 $$=FLAG_PUBLIC;}
- | KW_PRIVATE {PASS12 $$=FLAG_PRIVATE;}
- | KW_PROTECTED {PASS12 $$=FLAG_PROTECTED;}
- | KW_STATIC {PASS12 $$=FLAG_STATIC;}
- | KW_DYNAMIC {PASS12 $$=FLAG_DYNAMIC;}
- | KW_FINAL {PASS12 $$=FLAG_FINAL;}
- | KW_OVERRIDE {PASS12 $$=FLAG_OVERRIDE;}
- | KW_NATIVE {PASS12 $$=FLAG_NATIVE;}
- | KW_INTERNAL {PASS12 $$=FLAG_PACKAGEINTERNAL;}
- | T_NAMESPACE {PASS12 $$=FLAG_NAMESPACE;}
+MODIFIER_LIST : MODIFIER_LIST MODIFIER {
+ PASS12
+ $$.flags=$1.flags|$2.flags;
+ if($1.ns && $2.ns) syntaxerror("only one namespace allowed in one declaration");
+ $$.ns=$1.ns?$1.ns:$2.ns;
+
+}
+
+MODIFIER : KW_PUBLIC {PASS12 $$.flags=FLAG_PUBLIC;$$.ns=0;}
+ | KW_PRIVATE {PASS12 $$.flags=FLAG_PRIVATE;$$.ns=0;}
+ | KW_PROTECTED {PASS12 $$.flags=FLAG_PROTECTED;$$.ns=0;}
+ | KW_STATIC {PASS12 $$.flags=FLAG_STATIC;$$.ns=0;}
+ | KW_DYNAMIC {PASS12 $$.flags=FLAG_DYNAMIC;$$.ns=0;}
+ | KW_FINAL {PASS12 $$.flags=FLAG_FINAL;$$.ns=0;}
+ | KW_OVERRIDE {PASS12 $$.flags=FLAG_OVERRIDE;$$.ns=0;}
+ | KW_NATIVE {PASS12 $$.flags=FLAG_NATIVE;$$.ns=0;}
+ | KW_INTERNAL {PASS12 $$.flags=FLAG_PACKAGEINTERNAL;$$.ns=0;}
+ | T_NAMESPACE {PASS12 $$.flags=FLAG_NAMESPACE;
+ $$.ns=$1;
+ }