Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2005 Maksim Orlovich <maksim@kde.org> | 2 * Copyright 2005 Maksim Orlovich <maksim@kde.org> |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 NumericOp::Opcode numop; | 55 NumericOp::Opcode numop; |
| 56 EqTestOp::Opcode eqop; | 56 EqTestOp::Opcode eqop; |
| 57 | 57 |
| 58 Token(int t) : type(t) { } | 58 Token(int t) : type(t) { } |
| 59 Token(int t, const String& v): type(t), str(v) { } | 59 Token(int t, const String& v): type(t), str(v) { } |
| 60 Token(int t, Step::Axis v): type(t), axis(v) { } | 60 Token(int t, Step::Axis v): type(t), axis(v) { } |
| 61 Token(int t, NumericOp::Opcode v): type(t), numop(v) { } | 61 Token(int t, NumericOp::Opcode v): type(t), numop(v) { } |
| 62 Token(int t, EqTestOp::Opcode v): type(t), eqop(v) { } | 62 Token(int t, EqTestOp::Opcode v): type(t), eqop(v) { } |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class Parser { | 65 class Parser { |
|
Mads Ager (chromium)
2014/02/19 10:24:30
I think parser is actually stack allocated? In tha
haraken
2014/02/19 10:40:52
STACK_ALLOCATED is not yet available, so I added a
| |
| 66 WTF_MAKE_NONCOPYABLE(Parser); | 66 WTF_MAKE_NONCOPYABLE(Parser); |
| 67 public: | 67 public: |
| 68 Parser(); | 68 Parser(); |
| 69 ~Parser(); | 69 ~Parser(); |
| 70 | 70 |
| 71 XPathNSResolver* resolver() const { return m_resolver.get(); } | 71 XPathNSResolver* resolver() const { return m_resolver.get(); } |
| 72 bool expandQName(const String& qName, AtomicString& localName, AtomicString& namespaceURI); | 72 bool expandQName(const String& qName, AtomicString& localName, AtomicString& namespaceURI); |
| 73 | 73 |
| 74 Expression* parseStatement(const String& statement, PassRefPtr<XPathNSResolv er>, ExceptionState&); | 74 Expression* parseStatement(const String& statement, PassRefPtrWillBeRawPtr<X PathNSResolver>, ExceptionState&); |
| 75 | 75 |
| 76 static Parser* current() { return currentParser; } | 76 static Parser* current() { return currentParser; } |
| 77 | 77 |
| 78 int lex(void* yylval); | 78 int lex(void* yylval); |
| 79 | 79 |
| 80 Expression* m_topExpr; | 80 Expression* m_topExpr; |
| 81 bool m_gotNamespaceError; | 81 bool m_gotNamespaceError; |
| 82 | 82 |
| 83 void registerParseNode(ParseNode*); | 83 void registerParseNode(ParseNode*); |
| 84 void unregisterParseNode(ParseNode*); | 84 void unregisterParseNode(ParseNode*); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 113 Token nextToken(); | 113 Token nextToken(); |
| 114 Token nextTokenInternal(); | 114 Token nextTokenInternal(); |
| 115 | 115 |
| 116 void reset(const String& data); | 116 void reset(const String& data); |
| 117 | 117 |
| 118 static Parser* currentParser; | 118 static Parser* currentParser; |
| 119 | 119 |
| 120 unsigned m_nextPos; | 120 unsigned m_nextPos; |
| 121 String m_data; | 121 String m_data; |
| 122 int m_lastTokenType; | 122 int m_lastTokenType; |
| 123 RefPtr<XPathNSResolver> m_resolver; | 123 RefPtrWillBePersistent<XPathNSResolver> m_resolver; |
| 124 | 124 |
| 125 HashSet<ParseNode*> m_parseNodes; | 125 HashSet<ParseNode*> m_parseNodes; |
| 126 HashSet<Vector<OwnPtr<Predicate> >*> m_predicateVectors; | 126 HashSet<Vector<OwnPtr<Predicate> >*> m_predicateVectors; |
| 127 HashSet<Vector<OwnPtr<Expression> >*> m_expressionVectors; | 127 HashSet<Vector<OwnPtr<Expression> >*> m_expressionVectors; |
| 128 HashSet<String*> m_strings; | 128 HashSet<String*> m_strings; |
| 129 HashSet<Step::NodeTest*> m_nodeTests; | 129 HashSet<Step::NodeTest*> m_nodeTests; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 } // XPath | 132 } // XPath |
| 133 | 133 |
| 134 } // WebCore | 134 } // WebCore |
| 135 | 135 |
| 136 #endif | 136 #endif |
| OLD | NEW |