private void parseNamespaceOrTypes() throws FeatureNotSupportedException {
        while (!curtok.equals(EOF)) {
            // todo: account for assembly attributes
            parsePossibleAttributes(true);
            if (curAttributes.size() > 0) {
                for (AttributeNode an : curAttributes) {
                    cu.attributes.add(an);
                }
                curAttributes.clear();
            }
            // can be usingDirectives, globalAttribs, or NamespaceMembersDecls
            // NamespaceMembersDecls include namespaces, class, struct, interface, enum, delegate
            switch (curtok.id) {
                case TokenID.Using:
                    // using directive
                    parseUsingDirectives();
                    break;
                case TokenID.New:
                case TokenID.Public:
                case TokenID.Protected:
                case TokenID.Partial:
                case TokenID.Static:
                case TokenID.Internal:
                case TokenID.Private:
                case TokenID.Abstract:
                case TokenID.Sealed:
                    //parseTypeModifier();
                    curmods |= modMap.get(curtok.id);
                    advance();
                    break;
                case TokenID.Namespace:
                    parseNamespace();
                    break;
                case TokenID.Class:
                    parseClass();
                    break;
                case TokenID.Struct:
                    parseStruct();
                    break;
                case TokenID.Interface:
                    parseInterface();
                    break;
                case TokenID.Enum:
                    parseEnum();
                    break;
                case TokenID.Delegate:
                    parseDelegate();
                    break;
                case TokenID.Semi:
                    advance();
                    break;
                default:
                    return;
            }
        }
    }
private void parseNamespaceOrTypes() throws FeatureNotSupportedException {
        while (!curtok.equals(EOF)) {
           
            parsePossibleAttributes(true);
            if (curAttributes.size() > 0) {
                for (AttributeNode an : curAttributes) {
                    cu.attributes.add(an);
                }
                curAttributes.clear();
            }
           
           
            switch (curtok.id) {
                case TokenID.Using:
                   
                    parseUsingDirectives();
                    break;
                case TokenID.New:
                case TokenID.Public:
                case TokenID.Protected:
                case TokenID.Partial:
                case TokenID.Static:
                case TokenID.Internal:
                case TokenID.Private:
                case TokenID.Abstract:
                case TokenID.Sealed:
                   
                    curmods |= modMap.get(curtok.id);
                    advance();
                    break;
                case TokenID.Namespace:
                    parseNamespace();
                    break;
                case TokenID.Class:
                    parseClass();
                    break;
                case TokenID.Struct:
                    parseStruct();
                    break;
                case TokenID.Interface:
                    parseInterface();
                    break;
                case TokenID.Enum:
                    parseEnum();
                    break;
                case TokenID.Delegate:
                    parseDelegate();
                    break;
                case TokenID.Semi:
                    advance();
                    break;
                default:
                    return;
            }
        }
    }
private void parsenamespaceortypes() throws featurenotsupportedexception { while (!curtok.equals(eof)) { parsepossibleattributes(true); if (curattributes.size() > 0) { for (attributenode an : curattributes) { cu.attributes.add(an); } curattributes.clear(); } switch (curtok.id) { case tokenid.using: parseusingdirectives(); break; case tokenid.new: case tokenid.public: case tokenid.protected: case tokenid.partial: case tokenid.static: case tokenid.internal: case tokenid.private: case tokenid.abstract: case tokenid.sealed: curmods |= modmap.get(curtok.id); advance(); break; case tokenid.namespace: parsenamespace(); break; case tokenid.class: parseclass(); break; case tokenid.struct: parsestruct(); break; case tokenid.interface: parseinterface(); break; case tokenid.enum: parseenum(); break; case tokenid.delegate: parsedelegate(); break; case tokenid.semi: advance(); break; default: return; } } }