source:
webkit/trunk/JavaScriptCore/kjs/NodeInfo.h@
36847
Last change on this file since 36847 was 36263, checked in by [email protected], 17 years ago | |
---|---|
2008-09-07 Cameron Zwarich <[email protected]>
|
|
|
|
File size: 2.5 KB |
Line | |
---|---|
1 | /* |
2 | * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
17 | * |
18 | */ |
19 | |
20 | #ifndef NodeInfo_h |
21 | #define NodeInfo_h |
22 | |
23 | #include "nodes.h" |
24 | #include "Parser.h" |
25 | |
26 | namespace JSC { |
27 | |
28 | typedef unsigned int FeatureInfo; |
29 | |
30 | const FeatureInfo NoFeatures = 0; |
31 | const FeatureInfo EvalFeature = 1 << 0; |
32 | const FeatureInfo ClosureFeature = 1 << 1; |
33 | const FeatureInfo AssignFeature = 1 << 2; |
34 | |
35 | template <typename T> struct NodeFeatureInfo { |
36 | T m_node; |
37 | FeatureInfo m_featureInfo; |
38 | int m_numConstants; |
39 | }; |
40 | |
41 | typedef NodeFeatureInfo<FuncExprNode*> FuncExprNodeInfo; |
42 | typedef NodeFeatureInfo<ExpressionNode*> ExpressionNodeInfo; |
43 | typedef NodeFeatureInfo<ArgumentsNode*> ArgumentsNodeInfo; |
44 | typedef NodeFeatureInfo<ConstDeclNode*> ConstDeclNodeInfo; |
45 | typedef NodeFeatureInfo<PropertyNode*> PropertyNodeInfo; |
46 | typedef NodeFeatureInfo<PropertyList> PropertyListInfo; |
47 | typedef NodeFeatureInfo<ElementList> ElementListInfo; |
48 | typedef NodeFeatureInfo<ArgumentList> ArgumentListInfo; |
49 | |
50 | template <typename T> struct NodeDeclarationInfo { |
51 | T m_node; |
52 | ParserRefCountedData<DeclarationStacks::VarStack>* m_varDeclarations; |
53 | ParserRefCountedData<DeclarationStacks::FunctionStack>* m_funcDeclarations; |
54 | FeatureInfo m_featureInfo; |
55 | int m_numConstants; |
56 | }; |
57 | |
58 | typedef NodeDeclarationInfo<StatementNode*> StatementNodeInfo; |
59 | typedef NodeDeclarationInfo<CaseBlockNode*> CaseBlockNodeInfo; |
60 | typedef NodeDeclarationInfo<CaseClauseNode*> CaseClauseNodeInfo; |
61 | typedef NodeDeclarationInfo<SourceElements*> SourceElementsInfo; |
62 | typedef NodeDeclarationInfo<ClauseList> ClauseListInfo; |
63 | typedef NodeDeclarationInfo<ExpressionNode*> VarDeclListInfo; |
64 | typedef NodeDeclarationInfo<ConstDeclList> ConstDeclListInfo; |
65 | |
66 | } // namespace JSC |
67 | |
68 | #endif // NodeInfo_h |
Note:
See TracBrowser
for help on using the repository browser.