Logo Search packages:      
Sourcecode: yui-compressor version File versions  Download package

Node org::mozilla::javascript::Parser::propertyName ( Node  pn,
String  name,
int  memberTypeFlags 
) throws IOException, ParserException [inline, private]

Check if :: follows name in which case it becomes qualified name

Definition at line 2106 of file Parser.java.

References org::mozilla::javascript::Decompiler::addName(), org::mozilla::javascript::Decompiler::addToken(), and org::mozilla::javascript::TokenStream::getString().

    {
        String namespace = null;
        if (matchToken(Token.COLONCOLON)) {
            decompiler.addToken(Token.COLONCOLON);
            namespace = name;

            int tt = nextToken();
            switch (tt) {
              // handles name::name
              case Token.NAME:
                name = ts.getString();
                decompiler.addName(name);
                break;

              // handles name::*
              case Token.MUL:
                decompiler.addName("*");
                name = "*";
                break;

              // handles name::[expr]
              case Token.LB:
                decompiler.addToken(Token.LB);
                pn = nf.createElementGet(pn, namespace, expr(false),
                                         memberTypeFlags);
                mustMatchToken(Token.RB, "msg.no.bracket.index");
                decompiler.addToken(Token.RB);
                return pn;

              default:
                reportError("msg.no.name.after.coloncolon");
                name = "?";
            }
        }

        pn = nf.createPropertyGet(pn, namespace, name, memberTypeFlags);
        return pn;
    }


Generated by  Doxygen 1.6.0   Back to index