source: webkit/trunk/JavaScriptCore/kjs/NodeInfo.h@ 33979

Last change on this file since 33979 was 33979, checked in by [email protected], 17 years ago

Merge squirrelfish branch into trunk.

  • Property svn:eol-style set to native
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
26namespace KJS {
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 };
39
40 typedef NodeFeatureInfo<FuncExprNode*> FuncExprNodeInfo;
41 typedef NodeFeatureInfo<ExpressionNode*> ExpressionNodeInfo;
42 typedef NodeFeatureInfo<ArgumentsNode*> ArgumentsNodeInfo;
43 typedef NodeFeatureInfo<ConstDeclNode*> ConstDeclNodeInfo;
44 typedef NodeFeatureInfo<PropertyNode*> PropertyNodeInfo;
45 typedef NodeFeatureInfo<PropertyList> PropertyListInfo;
46 typedef NodeFeatureInfo<ElementList> ElementListInfo;
47 typedef NodeFeatureInfo<ArgumentList> ArgumentListInfo;
48
49 template <typename T> struct NodeDeclarationInfo {
50 T m_node;
51 ParserRefCountedData<DeclarationStacks::VarStack>* m_varDeclarations;
52 ParserRefCountedData<DeclarationStacks::FunctionStack>* m_funcDeclarations;
53 FeatureInfo m_featureInfo;
54 };
55
56 typedef NodeDeclarationInfo<StatementNode*> StatementNodeInfo;
57 typedef NodeDeclarationInfo<CaseBlockNode*> CaseBlockNodeInfo;
58 typedef NodeDeclarationInfo<CaseClauseNode*> CaseClauseNodeInfo;
59 typedef NodeDeclarationInfo<SourceElements*> SourceElementsInfo;
60 typedef NodeDeclarationInfo<ClauseList> ClauseListInfo;
61 typedef NodeDeclarationInfo<ExpressionNode*> VarDeclListInfo;
62 typedef NodeDeclarationInfo<ConstDeclList> ConstDeclListInfo;
63
64} // namespace KJS
65
66#endif // NodeInfo_h
Note: See TracBrowser for help on using the repository browser.