Changeset 37275 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Oct 3, 2008, 6:39:43 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/NodeInfo.h
r37132 r37275 26 26 namespace JSC { 27 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 const FeatureInfo ArgumentsFeature = 1 << 3; 35 const FeatureInfo WithFeature = 1 << 4; 36 const FeatureInfo CatchFeature = 1 << 5; 37 const FeatureInfo ThisFeature = 1 << 6; 38 const FeatureInfo AllFeatures = EvalFeature | ClosureFeature | AssignFeature | ArgumentsFeature | WithFeature | CatchFeature | ThisFeature; 39 40 template <typename T> struct NodeFeatureInfo { 28 template <typename T> struct NodeInfo { 41 29 T m_node; 42 FeatureInfo m_featureInfo;30 CodeFeatures m_features; 43 31 int m_numConstants; 44 32 }; 45 33 46 typedef Node FeatureInfo<FuncDeclNode*> FuncDeclNodeInfo;47 typedef Node FeatureInfo<FuncExprNode*> FuncExprNodeInfo;48 typedef Node FeatureInfo<ExpressionNode*> ExpressionNodeInfo;49 typedef Node FeatureInfo<ArgumentsNode*> ArgumentsNodeInfo;50 typedef Node FeatureInfo<ConstDeclNode*> ConstDeclNodeInfo;51 typedef Node FeatureInfo<PropertyNode*> PropertyNodeInfo;52 typedef Node FeatureInfo<PropertyList> PropertyListInfo;53 typedef Node FeatureInfo<ElementList> ElementListInfo;54 typedef Node FeatureInfo<ArgumentList> ArgumentListInfo;34 typedef NodeInfo<FuncDeclNode*> FuncDeclNodeInfo; 35 typedef NodeInfo<FuncExprNode*> FuncExprNodeInfo; 36 typedef NodeInfo<ExpressionNode*> ExpressionNodeInfo; 37 typedef NodeInfo<ArgumentsNode*> ArgumentsNodeInfo; 38 typedef NodeInfo<ConstDeclNode*> ConstDeclNodeInfo; 39 typedef NodeInfo<PropertyNode*> PropertyNodeInfo; 40 typedef NodeInfo<PropertyList> PropertyListInfo; 41 typedef NodeInfo<ElementList> ElementListInfo; 42 typedef NodeInfo<ArgumentList> ArgumentListInfo; 55 43 56 44 template <typename T> struct NodeDeclarationInfo { … … 58 46 ParserRefCountedData<DeclarationStacks::VarStack>* m_varDeclarations; 59 47 ParserRefCountedData<DeclarationStacks::FunctionStack>* m_funcDeclarations; 60 FeatureInfo m_featureInfo;48 CodeFeatures m_features; 61 49 int m_numConstants; 62 50 }; -
trunk/JavaScriptCore/kjs/Parser.cpp
r37184 r37275 68 68 69 69 void Parser::didFinishParsing(SourceElements* sourceElements, ParserRefCountedData<DeclarationStacks::VarStack>* varStack, 70 ParserRefCountedData<DeclarationStacks::FunctionStack>* funcStack, bool usesEval, bool needsClosure, bool usesArguments, int lastLine, int numConstants)70 ParserRefCountedData<DeclarationStacks::FunctionStack>* funcStack, CodeFeatures features, int lastLine, int numConstants) 71 71 { 72 72 m_sourceElements = sourceElements; 73 73 m_varDeclarations = varStack; 74 74 m_funcDeclarations = funcStack; 75 m_usesEval = usesEval; 76 m_needsClosure = needsClosure; 77 m_usesArguments = usesArguments; 75 m_features = features; 78 76 m_lastLine = lastLine; 79 77 m_numConstants = numConstants; -
trunk/JavaScriptCore/kjs/Parser.h
r37184 r37275 53 53 54 54 void didFinishParsing(SourceElements*, ParserRefCountedData<DeclarationStacks::VarStack>*, 55 ParserRefCountedData<DeclarationStacks::FunctionStack>*, bool usesEval, bool needsClosure, bool usesArguments, int lastLine, int numConstants);55 ParserRefCountedData<DeclarationStacks::FunctionStack>*, CodeFeatures features, int lastLine, int numConstants); 56 56 57 57 private: … … 64 64 RefPtr<ParserRefCountedData<DeclarationStacks::VarStack> > m_varDeclarations; 65 65 RefPtr<ParserRefCountedData<DeclarationStacks::FunctionStack> > m_funcDeclarations; 66 bool m_usesEval; 67 bool m_needsClosure; 68 bool m_usesArguments; 66 CodeFeatures m_features; 69 67 int m_lastLine; 70 68 int m_numConstants; … … 82 80 m_funcDeclarations ? &m_funcDeclarations->data : 0, 83 81 *m_source, 84 m_usesEval, 85 m_needsClosure, 86 m_usesArguments, 82 m_features, 87 83 m_numConstants); 88 84 result->setLoc(m_source->firstLine(), m_lastLine); -
trunk/JavaScriptCore/kjs/grammar.y
r37227 r37275 101 101 template <typename T> NodeDeclarationInfo<T> createNodeDeclarationInfo(T node, ParserRefCountedData<DeclarationStacks::VarStack>* varDecls, 102 102 ParserRefCountedData<DeclarationStacks::FunctionStack>* funcDecls, 103 FeatureInfoinfo,103 CodeFeatures info, 104 104 int numConstants) 105 105 { … … 109 109 } 110 110 111 template <typename T> Node FeatureInfo<T> createNodeFeatureInfo(T node, FeatureInfoinfo, int numConstants)111 template <typename T> NodeInfo<T> createNodeInfo(T node, CodeFeatures info, int numConstants) 112 112 { 113 113 ASSERT((info & ~AllFeatures) == 0); 114 Node FeatureInfo<T> result = {node, info, numConstants};114 NodeInfo<T> result = {node, info, numConstants}; 115 115 return result; 116 116 } … … 284 284 285 285 Literal: 286 NULLTOKEN { $$ = createNode FeatureInfo<ExpressionNode*>(new NullNode(GLOBAL_DATA), 0, 1); }287 | TRUETOKEN { $$ = createNode FeatureInfo<ExpressionNode*>(new BooleanNode(GLOBAL_DATA, true), 0, 1); }288 | FALSETOKEN { $$ = createNode FeatureInfo<ExpressionNode*>(new BooleanNode(GLOBAL_DATA, false), 0, 1); }289 | NUMBER { $$ = createNode FeatureInfo<ExpressionNode*>(makeNumberNode(GLOBAL_DATA, $1), 0, 1); }290 | STRING { $$ = createNode FeatureInfo<ExpressionNode*>(new StringNode(GLOBAL_DATA, *$1), 0, 1); }286 NULLTOKEN { $$ = createNodeInfo<ExpressionNode*>(new NullNode(GLOBAL_DATA), 0, 1); } 287 | TRUETOKEN { $$ = createNodeInfo<ExpressionNode*>(new BooleanNode(GLOBAL_DATA, true), 0, 1); } 288 | FALSETOKEN { $$ = createNodeInfo<ExpressionNode*>(new BooleanNode(GLOBAL_DATA, false), 0, 1); } 289 | NUMBER { $$ = createNodeInfo<ExpressionNode*>(makeNumberNode(GLOBAL_DATA, $1), 0, 1); } 290 | STRING { $$ = createNodeInfo<ExpressionNode*>(new StringNode(GLOBAL_DATA, *$1), 0, 1); } 291 291 | '/' /* regexp */ { 292 292 Lexer& l = *LEXER; … … 296 296 int size = l.pattern().size() + 2; // + 2 for the two /'s 297 297 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.first_column + size, @1.first_column + size); 298 $$ = createNode FeatureInfo<ExpressionNode*>(node, 0, 0);298 $$ = createNodeInfo<ExpressionNode*>(node, 0, 0); 299 299 } 300 300 | DIVEQUAL /* regexp with /= */ { … … 305 305 int size = l.pattern().size() + 2; // + 2 for the two /'s 306 306 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.first_column + size, @1.first_column + size); 307 $$ = createNode FeatureInfo<ExpressionNode*>(node, 0, 0);307 $$ = createNodeInfo<ExpressionNode*>(node, 0, 0); 308 308 } 309 309 ; 310 310 311 311 Property: 312 IDENT ':' AssignmentExpr { $$ = createNode FeatureInfo<PropertyNode*>(new PropertyNode(GLOBAL_DATA, *$1, $3.m_node, PropertyNode::Constant), $3.m_featureInfo, $3.m_numConstants); }313 | STRING ':' AssignmentExpr { $$ = createNode FeatureInfo<PropertyNode*>(new PropertyNode(GLOBAL_DATA, *$1, $3.m_node, PropertyNode::Constant), $3.m_featureInfo, $3.m_numConstants); }314 | NUMBER ':' AssignmentExpr { $$ = createNode FeatureInfo<PropertyNode*>(new PropertyNode(GLOBAL_DATA, Identifier(GLOBAL_DATA, UString::from($1)), $3.m_node, PropertyNode::Constant), $3.m_featureInfo, $3.m_numConstants); }315 | IDENT IDENT '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNode FeatureInfo<PropertyNode*>(makeGetterOrSetterPropertyNode(globalPtr, *$1, *$2, 0, $6, LEXER->sourceCode($5, $7, @5.first_line)), ClosureFeature, 0); DBG($6, @5, @7); if (!$$.m_node) YYABORT; }312 IDENT ':' AssignmentExpr { $$ = createNodeInfo<PropertyNode*>(new PropertyNode(GLOBAL_DATA, *$1, $3.m_node, PropertyNode::Constant), $3.m_features, $3.m_numConstants); } 313 | STRING ':' AssignmentExpr { $$ = createNodeInfo<PropertyNode*>(new PropertyNode(GLOBAL_DATA, *$1, $3.m_node, PropertyNode::Constant), $3.m_features, $3.m_numConstants); } 314 | NUMBER ':' AssignmentExpr { $$ = createNodeInfo<PropertyNode*>(new PropertyNode(GLOBAL_DATA, Identifier(GLOBAL_DATA, UString::from($1)), $3.m_node, PropertyNode::Constant), $3.m_features, $3.m_numConstants); } 315 | IDENT IDENT '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeInfo<PropertyNode*>(makeGetterOrSetterPropertyNode(globalPtr, *$1, *$2, 0, $6, LEXER->sourceCode($5, $7, @5.first_line)), ClosureFeature, 0); DBG($6, @5, @7); if (!$$.m_node) YYABORT; } 316 316 | IDENT IDENT '(' FormalParameterList ')' OPENBRACE FunctionBody CLOSEBRACE 317 { $$ = createNodeFeatureInfo<PropertyNode*>(makeGetterOrSetterPropertyNode(globalPtr, *$1, *$2, $4.m_node.head, $7, LEXER->sourceCode($6, $8, @6.first_line)), $4.m_featureInfo | ClosureFeature, 0); $7->setUsesArguments($7->usesArguments() || (($4.m_featureInfo & ArgumentsFeature) != 0)); DBG($7, @6, @8); if (!$$.m_node) YYABORT; } 317 { 318 $$ = createNodeInfo<PropertyNode*>(makeGetterOrSetterPropertyNode(globalPtr, *$1, *$2, $4.m_node.head, $7, LEXER->sourceCode($6, $8, @6.first_line)), $4.m_features | ClosureFeature, 0); 319 if ($4.m_features & ArgumentsFeature) 320 $7->setUsesArguments(); 321 DBG($7, @6, @8); 322 if (!$$.m_node) 323 YYABORT; 324 } 318 325 ; 319 326 … … 321 328 Property { $$.m_node.head = new PropertyListNode(GLOBAL_DATA, $1.m_node); 322 329 $$.m_node.tail = $$.m_node.head; 323 $$.m_feature Info = $1.m_featureInfo;330 $$.m_features = $1.m_features; 324 331 $$.m_numConstants = $1.m_numConstants; } 325 332 | PropertyList ',' Property { $$.m_node.head = $1.m_node.head; 326 333 $$.m_node.tail = new PropertyListNode(GLOBAL_DATA, $3.m_node, $1.m_node.tail); 327 $$.m_feature Info = $1.m_featureInfo | $3.m_featureInfo;334 $$.m_features = $1.m_features | $3.m_features; 328 335 $$.m_numConstants = $1.m_numConstants + $3.m_numConstants; } 329 336 ; … … 331 338 PrimaryExpr: 332 339 PrimaryExprNoBrace 333 | OPENBRACE CLOSEBRACE { $$ = createNode FeatureInfo<ExpressionNode*>(new ObjectLiteralNode(GLOBAL_DATA), 0, 0); }334 | OPENBRACE PropertyList CLOSEBRACE { $$ = createNode FeatureInfo<ExpressionNode*>(new ObjectLiteralNode(GLOBAL_DATA, $2.m_node.head), $2.m_featureInfo, $2.m_numConstants); }340 | OPENBRACE CLOSEBRACE { $$ = createNodeInfo<ExpressionNode*>(new ObjectLiteralNode(GLOBAL_DATA), 0, 0); } 341 | OPENBRACE PropertyList CLOSEBRACE { $$ = createNodeInfo<ExpressionNode*>(new ObjectLiteralNode(GLOBAL_DATA, $2.m_node.head), $2.m_features, $2.m_numConstants); } 335 342 /* allow extra comma, see http://bugs.webkit.org/show_bug.cgi?id=5939 */ 336 | OPENBRACE PropertyList ',' CLOSEBRACE { $$ = createNode FeatureInfo<ExpressionNode*>(new ObjectLiteralNode(GLOBAL_DATA, $2.m_node.head), $2.m_featureInfo, $2.m_numConstants); }343 | OPENBRACE PropertyList ',' CLOSEBRACE { $$ = createNodeInfo<ExpressionNode*>(new ObjectLiteralNode(GLOBAL_DATA, $2.m_node.head), $2.m_features, $2.m_numConstants); } 337 344 ; 338 345 339 346 PrimaryExprNoBrace: 340 THISTOKEN { $$ = createNode FeatureInfo<ExpressionNode*>(new ThisNode(GLOBAL_DATA), ThisFeature, 0); }347 THISTOKEN { $$ = createNodeInfo<ExpressionNode*>(new ThisNode(GLOBAL_DATA), ThisFeature, 0); } 341 348 | Literal 342 349 | ArrayLiteral 343 | IDENT { $$ = createNode FeatureInfo<ExpressionNode*>(new ResolveNode(GLOBAL_DATA, *$1, @1.first_column), (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0, 0); }350 | IDENT { $$ = createNodeInfo<ExpressionNode*>(new ResolveNode(GLOBAL_DATA, *$1, @1.first_column), (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0, 0); } 344 351 | '(' Expr ')' { $$ = $2; } 345 352 ; 346 353 347 354 ArrayLiteral: 348 '[' ElisionOpt ']' { $$ = createNode FeatureInfo<ExpressionNode*>(new ArrayNode(GLOBAL_DATA, $2), 0, $2 ? 1 : 0); }349 | '[' ElementList ']' { $$ = createNode FeatureInfo<ExpressionNode*>(new ArrayNode(GLOBAL_DATA, $2.m_node.head), $2.m_featureInfo, $2.m_numConstants); }350 | '[' ElementList ',' ElisionOpt ']' { $$ = createNode FeatureInfo<ExpressionNode*>(new ArrayNode(GLOBAL_DATA, $4, $2.m_node.head), $2.m_featureInfo, $4 ? $2.m_numConstants + 1 : $2.m_numConstants); }355 '[' ElisionOpt ']' { $$ = createNodeInfo<ExpressionNode*>(new ArrayNode(GLOBAL_DATA, $2), 0, $2 ? 1 : 0); } 356 | '[' ElementList ']' { $$ = createNodeInfo<ExpressionNode*>(new ArrayNode(GLOBAL_DATA, $2.m_node.head), $2.m_features, $2.m_numConstants); } 357 | '[' ElementList ',' ElisionOpt ']' { $$ = createNodeInfo<ExpressionNode*>(new ArrayNode(GLOBAL_DATA, $4, $2.m_node.head), $2.m_features, $4 ? $2.m_numConstants + 1 : $2.m_numConstants); } 351 358 ; 352 359 … … 354 361 ElisionOpt AssignmentExpr { $$.m_node.head = new ElementNode(GLOBAL_DATA, $1, $2.m_node); 355 362 $$.m_node.tail = $$.m_node.head; 356 $$.m_feature Info = $2.m_featureInfo;363 $$.m_features = $2.m_features; 357 364 $$.m_numConstants = $2.m_numConstants; } 358 365 | ElementList ',' ElisionOpt AssignmentExpr 359 366 { $$.m_node.head = $1.m_node.head; 360 367 $$.m_node.tail = new ElementNode(GLOBAL_DATA, $1.m_node.tail, $3, $4.m_node); 361 $$.m_feature Info = $1.m_featureInfo | $4.m_featureInfo;368 $$.m_features = $1.m_features | $4.m_features; 362 369 $$.m_numConstants = $1.m_numConstants + $4.m_numConstants; } 363 370 ; … … 375 382 MemberExpr: 376 383 PrimaryExpr 377 | FunctionExpr { $$ = createNode FeatureInfo<ExpressionNode*>($1.m_node, $1.m_featureInfo, $1.m_numConstants); }378 | MemberExpr '[' Expr ']' { BracketAccessorNode* node = new BracketAccessorNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_feature Info& AssignFeature);384 | FunctionExpr { $$ = createNodeInfo<ExpressionNode*>($1.m_node, $1.m_features, $1.m_numConstants); } 385 | MemberExpr '[' Expr ']' { BracketAccessorNode* node = new BracketAccessorNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature); 379 386 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.last_column, @4.last_column); 380 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants);387 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); 381 388 } 382 389 | MemberExpr '.' IDENT { DotAccessorNode* node = new DotAccessorNode(GLOBAL_DATA, $1.m_node, *$3); 383 390 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.last_column, @3.last_column); 384 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo, $1.m_numConstants);391 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features, $1.m_numConstants); 385 392 } 386 393 | NEW MemberExpr Arguments { NewExprNode* node = new NewExprNode(GLOBAL_DATA, $2.m_node, $3.m_node); 387 394 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.last_column, @3.last_column); 388 $$ = createNode FeatureInfo<ExpressionNode*>(node, $2.m_featureInfo | $3.m_featureInfo, $2.m_numConstants + $3.m_numConstants);395 $$ = createNodeInfo<ExpressionNode*>(node, $2.m_features | $3.m_features, $2.m_numConstants + $3.m_numConstants); 389 396 } 390 397 ; … … 392 399 MemberExprNoBF: 393 400 PrimaryExprNoBrace 394 | MemberExprNoBF '[' Expr ']' { BracketAccessorNode* node = new BracketAccessorNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_feature Info& AssignFeature);401 | MemberExprNoBF '[' Expr ']' { BracketAccessorNode* node = new BracketAccessorNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature); 395 402 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.last_column, @4.last_column); 396 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants);403 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); 397 404 } 398 405 | MemberExprNoBF '.' IDENT { DotAccessorNode* node = new DotAccessorNode(GLOBAL_DATA, $1.m_node, *$3); 399 406 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.last_column, @3.last_column); 400 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo, $1.m_numConstants);407 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features, $1.m_numConstants); 401 408 } 402 409 | NEW MemberExpr Arguments { NewExprNode* node = new NewExprNode(GLOBAL_DATA, $2.m_node, $3.m_node); 403 410 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.last_column, @3.last_column); 404 $$ = createNode FeatureInfo<ExpressionNode*>(node, $2.m_featureInfo | $3.m_featureInfo, $2.m_numConstants + $3.m_numConstants);411 $$ = createNodeInfo<ExpressionNode*>(node, $2.m_features | $3.m_features, $2.m_numConstants + $3.m_numConstants); 405 412 } 406 413 ; … … 410 417 | NEW NewExpr { NewExprNode* node = new NewExprNode(GLOBAL_DATA, $2.m_node); 411 418 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.last_column, @2.last_column); 412 $$ = createNode FeatureInfo<ExpressionNode*>(node, $2.m_featureInfo, $2.m_numConstants);419 $$ = createNodeInfo<ExpressionNode*>(node, $2.m_features, $2.m_numConstants); 413 420 } 414 421 ; … … 418 425 | NEW NewExpr { NewExprNode* node = new NewExprNode(GLOBAL_DATA, $2.m_node); 419 426 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.last_column, @2.last_column); 420 $$ = createNode FeatureInfo<ExpressionNode*>(node, $2.m_featureInfo, $2.m_numConstants);427 $$ = createNodeInfo<ExpressionNode*>(node, $2.m_features, $2.m_numConstants); 421 428 } 422 429 ; … … 425 432 MemberExpr Arguments { $$ = makeFunctionCallNode(globalPtr, $1, $2, @1.first_column, @1.last_column, @2.last_column); } 426 433 | CallExpr Arguments { $$ = makeFunctionCallNode(globalPtr, $1, $2, @1.first_column, @1.last_column, @2.last_column); } 427 | CallExpr '[' Expr ']' { BracketAccessorNode* node = new BracketAccessorNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_feature Info& AssignFeature);434 | CallExpr '[' Expr ']' { BracketAccessorNode* node = new BracketAccessorNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature); 428 435 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.last_column, @4.last_column); 429 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants);436 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); 430 437 } 431 438 | CallExpr '.' IDENT { DotAccessorNode* node = new DotAccessorNode(GLOBAL_DATA, $1.m_node, *$3); 432 439 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.last_column, @3.last_column); 433 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo, $1.m_numConstants); }440 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features, $1.m_numConstants); } 434 441 ; 435 442 … … 437 444 MemberExprNoBF Arguments { $$ = makeFunctionCallNode(globalPtr, $1, $2, @1.first_column, @1.last_column, @2.last_column); } 438 445 | CallExprNoBF Arguments { $$ = makeFunctionCallNode(globalPtr, $1, $2, @1.first_column, @1.last_column, @2.last_column); } 439 | CallExprNoBF '[' Expr ']' { BracketAccessorNode* node = new BracketAccessorNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_feature Info& AssignFeature);446 | CallExprNoBF '[' Expr ']' { BracketAccessorNode* node = new BracketAccessorNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature); 440 447 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.last_column, @4.last_column); 441 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants);448 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); 442 449 } 443 450 | CallExprNoBF '.' IDENT { DotAccessorNode* node = new DotAccessorNode(GLOBAL_DATA, $1.m_node, *$3); 444 451 SET_EXCEPTION_LOCATION(node, @1.first_column, @1.last_column, @3.last_column); 445 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo, $1.m_numConstants);452 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features, $1.m_numConstants); 446 453 } 447 454 ; 448 455 449 456 Arguments: 450 '(' ')' { $$ = createNode FeatureInfo<ArgumentsNode*>(new ArgumentsNode(GLOBAL_DATA), 0, 0); }451 | '(' ArgumentList ')' { $$ = createNode FeatureInfo<ArgumentsNode*>(new ArgumentsNode(GLOBAL_DATA, $2.m_node.head), $2.m_featureInfo, $2.m_numConstants); }457 '(' ')' { $$ = createNodeInfo<ArgumentsNode*>(new ArgumentsNode(GLOBAL_DATA), 0, 0); } 458 | '(' ArgumentList ')' { $$ = createNodeInfo<ArgumentsNode*>(new ArgumentsNode(GLOBAL_DATA, $2.m_node.head), $2.m_features, $2.m_numConstants); } 452 459 ; 453 460 … … 455 462 AssignmentExpr { $$.m_node.head = new ArgumentListNode(GLOBAL_DATA, $1.m_node); 456 463 $$.m_node.tail = $$.m_node.head; 457 $$.m_feature Info = $1.m_featureInfo;464 $$.m_features = $1.m_features; 458 465 $$.m_numConstants = $1.m_numConstants; } 459 466 | ArgumentList ',' AssignmentExpr { $$.m_node.head = $1.m_node.head; 460 467 $$.m_node.tail = new ArgumentListNode(GLOBAL_DATA, $1.m_node.tail, $3.m_node); 461 $$.m_feature Info = $1.m_featureInfo | $3.m_featureInfo;468 $$.m_features = $1.m_features | $3.m_features; 462 469 $$.m_numConstants = $1.m_numConstants + $3.m_numConstants; } 463 470 ; … … 475 482 PostfixExpr: 476 483 LeftHandSideExpr 477 | LeftHandSideExpr PLUSPLUS { $$ = createNode FeatureInfo<ExpressionNode*>(makePostfixNode(GLOBAL_DATA, $1.m_node, OpPlusPlus, @1.first_column, @1.last_column, @2.last_column), $1.m_featureInfo| AssignFeature, $1.m_numConstants); }478 | LeftHandSideExpr MINUSMINUS { $$ = createNode FeatureInfo<ExpressionNode*>(makePostfixNode(GLOBAL_DATA, $1.m_node, OpMinusMinus, @1.first_column, @1.last_column, @2.last_column), $1.m_featureInfo| AssignFeature, $1.m_numConstants); }484 | LeftHandSideExpr PLUSPLUS { $$ = createNodeInfo<ExpressionNode*>(makePostfixNode(GLOBAL_DATA, $1.m_node, OpPlusPlus, @1.first_column, @1.last_column, @2.last_column), $1.m_features | AssignFeature, $1.m_numConstants); } 485 | LeftHandSideExpr MINUSMINUS { $$ = createNodeInfo<ExpressionNode*>(makePostfixNode(GLOBAL_DATA, $1.m_node, OpMinusMinus, @1.first_column, @1.last_column, @2.last_column), $1.m_features | AssignFeature, $1.m_numConstants); } 479 486 ; 480 487 481 488 PostfixExprNoBF: 482 489 LeftHandSideExprNoBF 483 | LeftHandSideExprNoBF PLUSPLUS { $$ = createNode FeatureInfo<ExpressionNode*>(makePostfixNode(GLOBAL_DATA, $1.m_node, OpPlusPlus, @1.first_column, @1.last_column, @2.last_column), $1.m_featureInfo| AssignFeature, $1.m_numConstants); }484 | LeftHandSideExprNoBF MINUSMINUS { $$ = createNode FeatureInfo<ExpressionNode*>(makePostfixNode(GLOBAL_DATA, $1.m_node, OpMinusMinus, @1.first_column, @1.last_column, @2.last_column), $1.m_featureInfo| AssignFeature, $1.m_numConstants); }490 | LeftHandSideExprNoBF PLUSPLUS { $$ = createNodeInfo<ExpressionNode*>(makePostfixNode(GLOBAL_DATA, $1.m_node, OpPlusPlus, @1.first_column, @1.last_column, @2.last_column), $1.m_features | AssignFeature, $1.m_numConstants); } 491 | LeftHandSideExprNoBF MINUSMINUS { $$ = createNodeInfo<ExpressionNode*>(makePostfixNode(GLOBAL_DATA, $1.m_node, OpMinusMinus, @1.first_column, @1.last_column, @2.last_column), $1.m_features | AssignFeature, $1.m_numConstants); } 485 492 ; 486 493 487 494 UnaryExprCommon: 488 DELETETOKEN UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makeDeleteNode(GLOBAL_DATA, $2.m_node, @1.first_column, @2.last_column, @2.last_column), $2.m_featureInfo, $2.m_numConstants); }489 | VOIDTOKEN UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new VoidNode(GLOBAL_DATA, $2.m_node), $2.m_featureInfo, $2.m_numConstants + 1); }490 | TYPEOF UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makeTypeOfNode(GLOBAL_DATA, $2.m_node), $2.m_featureInfo, $2.m_numConstants); }491 | PLUSPLUS UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makePrefixNode(GLOBAL_DATA, $2.m_node, OpPlusPlus, @1.first_column, @2.first_column + 1, @2.last_column), $2.m_featureInfo| AssignFeature, $2.m_numConstants); }492 | AUTOPLUSPLUS UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makePrefixNode(GLOBAL_DATA, $2.m_node, OpPlusPlus, @1.first_column, @2.first_column + 1, @2.last_column), $2.m_featureInfo| AssignFeature, $2.m_numConstants); }493 | MINUSMINUS UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makePrefixNode(GLOBAL_DATA, $2.m_node, OpMinusMinus, @1.first_column, @2.first_column + 1, @2.last_column), $2.m_featureInfo| AssignFeature, $2.m_numConstants); }494 | AUTOMINUSMINUS UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makePrefixNode(GLOBAL_DATA, $2.m_node, OpMinusMinus, @1.first_column, @2.first_column + 1, @2.last_column), $2.m_featureInfo| AssignFeature, $2.m_numConstants); }495 | '+' UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new UnaryPlusNode(GLOBAL_DATA, $2.m_node), $2.m_featureInfo, $2.m_numConstants); }496 | '-' UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makeNegateNode(GLOBAL_DATA, $2.m_node), $2.m_featureInfo, $2.m_numConstants); }497 | '~' UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makeBitwiseNotNode(GLOBAL_DATA, $2.m_node), $2.m_featureInfo, $2.m_numConstants); }498 | '!' UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LogicalNotNode(GLOBAL_DATA, $2.m_node), $2.m_featureInfo, $2.m_numConstants); }495 DELETETOKEN UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makeDeleteNode(GLOBAL_DATA, $2.m_node, @1.first_column, @2.last_column, @2.last_column), $2.m_features, $2.m_numConstants); } 496 | VOIDTOKEN UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(new VoidNode(GLOBAL_DATA, $2.m_node), $2.m_features, $2.m_numConstants + 1); } 497 | TYPEOF UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makeTypeOfNode(GLOBAL_DATA, $2.m_node), $2.m_features, $2.m_numConstants); } 498 | PLUSPLUS UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makePrefixNode(GLOBAL_DATA, $2.m_node, OpPlusPlus, @1.first_column, @2.first_column + 1, @2.last_column), $2.m_features | AssignFeature, $2.m_numConstants); } 499 | AUTOPLUSPLUS UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makePrefixNode(GLOBAL_DATA, $2.m_node, OpPlusPlus, @1.first_column, @2.first_column + 1, @2.last_column), $2.m_features | AssignFeature, $2.m_numConstants); } 500 | MINUSMINUS UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makePrefixNode(GLOBAL_DATA, $2.m_node, OpMinusMinus, @1.first_column, @2.first_column + 1, @2.last_column), $2.m_features | AssignFeature, $2.m_numConstants); } 501 | AUTOMINUSMINUS UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makePrefixNode(GLOBAL_DATA, $2.m_node, OpMinusMinus, @1.first_column, @2.first_column + 1, @2.last_column), $2.m_features | AssignFeature, $2.m_numConstants); } 502 | '+' UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(new UnaryPlusNode(GLOBAL_DATA, $2.m_node), $2.m_features, $2.m_numConstants); } 503 | '-' UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makeNegateNode(GLOBAL_DATA, $2.m_node), $2.m_features, $2.m_numConstants); } 504 | '~' UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makeBitwiseNotNode(GLOBAL_DATA, $2.m_node), $2.m_features, $2.m_numConstants); } 505 | '!' UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(new LogicalNotNode(GLOBAL_DATA, $2.m_node), $2.m_features, $2.m_numConstants); } 499 506 500 507 UnaryExpr: … … 510 517 MultiplicativeExpr: 511 518 UnaryExpr 512 | MultiplicativeExpr '*' UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makeMultNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }513 | MultiplicativeExpr '/' UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makeDivNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }514 | MultiplicativeExpr '%' UnaryExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new ModNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }519 | MultiplicativeExpr '*' UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makeMultNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 520 | MultiplicativeExpr '/' UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(makeDivNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 521 | MultiplicativeExpr '%' UnaryExpr { $$ = createNodeInfo<ExpressionNode*>(new ModNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 515 522 ; 516 523 … … 518 525 UnaryExprNoBF 519 526 | MultiplicativeExprNoBF '*' UnaryExpr 520 { $$ = createNode FeatureInfo<ExpressionNode*>(new MultNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }527 { $$ = createNodeInfo<ExpressionNode*>(new MultNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 521 528 | MultiplicativeExprNoBF '/' UnaryExpr 522 { $$ = createNode FeatureInfo<ExpressionNode*>(new DivNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }529 { $$ = createNodeInfo<ExpressionNode*>(new DivNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 523 530 | MultiplicativeExprNoBF '%' UnaryExpr 524 { $$ = createNode FeatureInfo<ExpressionNode*>(new ModNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }531 { $$ = createNodeInfo<ExpressionNode*>(new ModNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 525 532 ; 526 533 527 534 AdditiveExpr: 528 535 MultiplicativeExpr 529 | AdditiveExpr '+' MultiplicativeExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makeAddNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }530 | AdditiveExpr '-' MultiplicativeExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new SubNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }536 | AdditiveExpr '+' MultiplicativeExpr { $$ = createNodeInfo<ExpressionNode*>(makeAddNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 537 | AdditiveExpr '-' MultiplicativeExpr { $$ = createNodeInfo<ExpressionNode*>(new SubNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 531 538 ; 532 539 … … 534 541 MultiplicativeExprNoBF 535 542 | AdditiveExprNoBF '+' MultiplicativeExpr 536 { $$ = createNode FeatureInfo<ExpressionNode*>(new AddNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }543 { $$ = createNodeInfo<ExpressionNode*>(new AddNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 537 544 | AdditiveExprNoBF '-' MultiplicativeExpr 538 { $$ = createNode FeatureInfo<ExpressionNode*>(new SubNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }545 { $$ = createNodeInfo<ExpressionNode*>(new SubNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 539 546 ; 540 547 541 548 ShiftExpr: 542 549 AdditiveExpr 543 | ShiftExpr LSHIFT AdditiveExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makeLeftShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }544 | ShiftExpr RSHIFT AdditiveExpr { $$ = createNode FeatureInfo<ExpressionNode*>(makeRightShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }545 | ShiftExpr URSHIFT AdditiveExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new UnsignedRightShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }550 | ShiftExpr LSHIFT AdditiveExpr { $$ = createNodeInfo<ExpressionNode*>(makeLeftShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 551 | ShiftExpr RSHIFT AdditiveExpr { $$ = createNodeInfo<ExpressionNode*>(makeRightShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 552 | ShiftExpr URSHIFT AdditiveExpr { $$ = createNodeInfo<ExpressionNode*>(new UnsignedRightShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 546 553 ; 547 554 548 555 ShiftExprNoBF: 549 556 AdditiveExprNoBF 550 | ShiftExprNoBF LSHIFT AdditiveExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LeftShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }551 | ShiftExprNoBF RSHIFT AdditiveExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new RightShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }552 | ShiftExprNoBF URSHIFT AdditiveExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new UnsignedRightShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }557 | ShiftExprNoBF LSHIFT AdditiveExpr { $$ = createNodeInfo<ExpressionNode*>(new LeftShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 558 | ShiftExprNoBF RSHIFT AdditiveExpr { $$ = createNodeInfo<ExpressionNode*>(new RightShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 559 | ShiftExprNoBF URSHIFT AdditiveExpr { $$ = createNodeInfo<ExpressionNode*>(new UnsignedRightShiftNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 553 560 ; 554 561 555 562 RelationalExpr: 556 563 ShiftExpr 557 | RelationalExpr '<' ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LessNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }558 | RelationalExpr '>' ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new GreaterNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }559 | RelationalExpr LE ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LessEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }560 | RelationalExpr GE ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new GreaterEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }561 | RelationalExpr INSTANCEOF ShiftExpr { InstanceOfNode* node = new InstanceOfNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_feature Info& AssignFeature);564 | RelationalExpr '<' ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new LessNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 565 | RelationalExpr '>' ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new GreaterNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 566 | RelationalExpr LE ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new LessEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 567 | RelationalExpr GE ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new GreaterEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 568 | RelationalExpr INSTANCEOF ShiftExpr { InstanceOfNode* node = new InstanceOfNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature); 562 569 SET_EXCEPTION_LOCATION(node, @1.first_column, @3.first_column, @3.last_column); 563 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }564 | RelationalExpr INTOKEN ShiftExpr { InNode* node = new InNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_feature Info& AssignFeature);570 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 571 | RelationalExpr INTOKEN ShiftExpr { InNode* node = new InNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature); 565 572 SET_EXCEPTION_LOCATION(node, @1.first_column, @3.first_column, @3.last_column); 566 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }573 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 567 574 ; 568 575 569 576 RelationalExprNoIn: 570 577 ShiftExpr 571 | RelationalExprNoIn '<' ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LessNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }572 | RelationalExprNoIn '>' ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new GreaterNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }573 | RelationalExprNoIn LE ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LessEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }574 | RelationalExprNoIn GE ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new GreaterEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }578 | RelationalExprNoIn '<' ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new LessNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 579 | RelationalExprNoIn '>' ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new GreaterNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 580 | RelationalExprNoIn LE ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new LessEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 581 | RelationalExprNoIn GE ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new GreaterEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 575 582 | RelationalExprNoIn INSTANCEOF ShiftExpr 576 { InstanceOfNode* node = new InstanceOfNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_feature Info& AssignFeature);583 { InstanceOfNode* node = new InstanceOfNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature); 577 584 SET_EXCEPTION_LOCATION(node, @1.first_column, @3.first_column, @3.last_column); 578 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }585 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 579 586 ; 580 587 581 588 RelationalExprNoBF: 582 589 ShiftExprNoBF 583 | RelationalExprNoBF '<' ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LessNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }584 | RelationalExprNoBF '>' ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new GreaterNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }585 | RelationalExprNoBF LE ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LessEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }586 | RelationalExprNoBF GE ShiftExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new GreaterEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }590 | RelationalExprNoBF '<' ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new LessNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 591 | RelationalExprNoBF '>' ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new GreaterNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 592 | RelationalExprNoBF LE ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new LessEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 593 | RelationalExprNoBF GE ShiftExpr { $$ = createNodeInfo<ExpressionNode*>(new GreaterEqNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 587 594 | RelationalExprNoBF INSTANCEOF ShiftExpr 588 { InstanceOfNode* node = new InstanceOfNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_feature Info& AssignFeature);595 { InstanceOfNode* node = new InstanceOfNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature); 589 596 SET_EXCEPTION_LOCATION(node, @1.first_column, @3.first_column, @3.last_column); 590 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }597 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 591 598 | RelationalExprNoBF INTOKEN ShiftExpr 592 { InNode* node = new InNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_feature Info& AssignFeature);599 { InNode* node = new InNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature); 593 600 SET_EXCEPTION_LOCATION(node, @1.first_column, @3.first_column, @3.last_column); 594 $$ = createNode FeatureInfo<ExpressionNode*>(node, $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }601 $$ = createNodeInfo<ExpressionNode*>(node, $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 595 602 ; 596 603 597 604 EqualityExpr: 598 605 RelationalExpr 599 | EqualityExpr EQEQ RelationalExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new EqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }600 | EqualityExpr NE RelationalExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new NotEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }601 | EqualityExpr STREQ RelationalExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new StrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }602 | EqualityExpr STRNEQ RelationalExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new NotStrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }606 | EqualityExpr EQEQ RelationalExpr { $$ = createNodeInfo<ExpressionNode*>(new EqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 607 | EqualityExpr NE RelationalExpr { $$ = createNodeInfo<ExpressionNode*>(new NotEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 608 | EqualityExpr STREQ RelationalExpr { $$ = createNodeInfo<ExpressionNode*>(new StrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 609 | EqualityExpr STRNEQ RelationalExpr { $$ = createNodeInfo<ExpressionNode*>(new NotStrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 603 610 ; 604 611 … … 606 613 RelationalExprNoIn 607 614 | EqualityExprNoIn EQEQ RelationalExprNoIn 608 { $$ = createNode FeatureInfo<ExpressionNode*>(new EqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }615 { $$ = createNodeInfo<ExpressionNode*>(new EqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 609 616 | EqualityExprNoIn NE RelationalExprNoIn 610 { $$ = createNode FeatureInfo<ExpressionNode*>(new NotEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }617 { $$ = createNodeInfo<ExpressionNode*>(new NotEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 611 618 | EqualityExprNoIn STREQ RelationalExprNoIn 612 { $$ = createNode FeatureInfo<ExpressionNode*>(new StrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }619 { $$ = createNodeInfo<ExpressionNode*>(new StrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 613 620 | EqualityExprNoIn STRNEQ RelationalExprNoIn 614 { $$ = createNode FeatureInfo<ExpressionNode*>(new NotStrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }621 { $$ = createNodeInfo<ExpressionNode*>(new NotStrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 615 622 ; 616 623 … … 618 625 RelationalExprNoBF 619 626 | EqualityExprNoBF EQEQ RelationalExpr 620 { $$ = createNode FeatureInfo<ExpressionNode*>(new EqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }621 | EqualityExprNoBF NE RelationalExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new NotEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }627 { $$ = createNodeInfo<ExpressionNode*>(new EqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 628 | EqualityExprNoBF NE RelationalExpr { $$ = createNodeInfo<ExpressionNode*>(new NotEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 622 629 | EqualityExprNoBF STREQ RelationalExpr 623 { $$ = createNode FeatureInfo<ExpressionNode*>(new StrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }630 { $$ = createNodeInfo<ExpressionNode*>(new StrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 624 631 | EqualityExprNoBF STRNEQ RelationalExpr 625 { $$ = createNode FeatureInfo<ExpressionNode*>(new NotStrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }632 { $$ = createNodeInfo<ExpressionNode*>(new NotStrictEqualNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 626 633 ; 627 634 628 635 BitwiseANDExpr: 629 636 EqualityExpr 630 | BitwiseANDExpr '&' EqualityExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new BitAndNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }637 | BitwiseANDExpr '&' EqualityExpr { $$ = createNodeInfo<ExpressionNode*>(new BitAndNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 631 638 ; 632 639 … … 634 641 EqualityExprNoIn 635 642 | BitwiseANDExprNoIn '&' EqualityExprNoIn 636 { $$ = createNode FeatureInfo<ExpressionNode*>(new BitAndNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }643 { $$ = createNodeInfo<ExpressionNode*>(new BitAndNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 637 644 ; 638 645 639 646 BitwiseANDExprNoBF: 640 647 EqualityExprNoBF 641 | BitwiseANDExprNoBF '&' EqualityExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new BitAndNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }648 | BitwiseANDExprNoBF '&' EqualityExpr { $$ = createNodeInfo<ExpressionNode*>(new BitAndNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 642 649 ; 643 650 644 651 BitwiseXORExpr: 645 652 BitwiseANDExpr 646 | BitwiseXORExpr '^' BitwiseANDExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new BitXOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }653 | BitwiseXORExpr '^' BitwiseANDExpr { $$ = createNodeInfo<ExpressionNode*>(new BitXOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 647 654 ; 648 655 … … 650 657 BitwiseANDExprNoIn 651 658 | BitwiseXORExprNoIn '^' BitwiseANDExprNoIn 652 { $$ = createNode FeatureInfo<ExpressionNode*>(new BitXOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }659 { $$ = createNodeInfo<ExpressionNode*>(new BitXOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 653 660 ; 654 661 … … 656 663 BitwiseANDExprNoBF 657 664 | BitwiseXORExprNoBF '^' BitwiseANDExpr 658 { $$ = createNode FeatureInfo<ExpressionNode*>(new BitXOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }665 { $$ = createNodeInfo<ExpressionNode*>(new BitXOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 659 666 ; 660 667 661 668 BitwiseORExpr: 662 669 BitwiseXORExpr 663 | BitwiseORExpr '|' BitwiseXORExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new BitOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }670 | BitwiseORExpr '|' BitwiseXORExpr { $$ = createNodeInfo<ExpressionNode*>(new BitOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 664 671 ; 665 672 … … 667 674 BitwiseXORExprNoIn 668 675 | BitwiseORExprNoIn '|' BitwiseXORExprNoIn 669 { $$ = createNode FeatureInfo<ExpressionNode*>(new BitOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }676 { $$ = createNodeInfo<ExpressionNode*>(new BitOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 670 677 ; 671 678 … … 673 680 BitwiseXORExprNoBF 674 681 | BitwiseORExprNoBF '|' BitwiseXORExpr 675 { $$ = createNode FeatureInfo<ExpressionNode*>(new BitOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_featureInfo & AssignFeature), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }682 { $$ = createNodeInfo<ExpressionNode*>(new BitOrNode(GLOBAL_DATA, $1.m_node, $3.m_node, $3.m_features & AssignFeature), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 676 683 ; 677 684 678 685 LogicalANDExpr: 679 686 BitwiseORExpr 680 | LogicalANDExpr AND BitwiseORExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalAnd), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }687 | LogicalANDExpr AND BitwiseORExpr { $$ = createNodeInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalAnd), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 681 688 ; 682 689 … … 684 691 BitwiseORExprNoIn 685 692 | LogicalANDExprNoIn AND BitwiseORExprNoIn 686 { $$ = createNode FeatureInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalAnd), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }693 { $$ = createNodeInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalAnd), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 687 694 ; 688 695 … … 690 697 BitwiseORExprNoBF 691 698 | LogicalANDExprNoBF AND BitwiseORExpr 692 { $$ = createNode FeatureInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalAnd), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }699 { $$ = createNodeInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalAnd), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 693 700 ; 694 701 695 702 LogicalORExpr: 696 703 LogicalANDExpr 697 | LogicalORExpr OR LogicalANDExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalOr), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }704 | LogicalORExpr OR LogicalANDExpr { $$ = createNodeInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalOr), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 698 705 ; 699 706 … … 701 708 LogicalANDExprNoIn 702 709 | LogicalORExprNoIn OR LogicalANDExprNoIn 703 { $$ = createNode FeatureInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalOr), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }710 { $$ = createNodeInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalOr), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 704 711 ; 705 712 706 713 LogicalORExprNoBF: 707 714 LogicalANDExprNoBF 708 | LogicalORExprNoBF OR LogicalANDExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalOr), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }715 | LogicalORExprNoBF OR LogicalANDExpr { $$ = createNodeInfo<ExpressionNode*>(new LogicalOpNode(GLOBAL_DATA, $1.m_node, $3.m_node, OpLogicalOr), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 709 716 ; 710 717 … … 712 719 LogicalORExpr 713 720 | LogicalORExpr '?' AssignmentExpr ':' AssignmentExpr 714 { $$ = createNode FeatureInfo<ExpressionNode*>(new ConditionalNode(GLOBAL_DATA, $1.m_node, $3.m_node, $5.m_node), $1.m_featureInfo | $3.m_featureInfo | $5.m_featureInfo, $1.m_numConstants + $3.m_numConstants + $5.m_numConstants); }721 { $$ = createNodeInfo<ExpressionNode*>(new ConditionalNode(GLOBAL_DATA, $1.m_node, $3.m_node, $5.m_node), $1.m_features | $3.m_features | $5.m_features, $1.m_numConstants + $3.m_numConstants + $5.m_numConstants); } 715 722 ; 716 723 … … 718 725 LogicalORExprNoIn 719 726 | LogicalORExprNoIn '?' AssignmentExprNoIn ':' AssignmentExprNoIn 720 { $$ = createNode FeatureInfo<ExpressionNode*>(new ConditionalNode(GLOBAL_DATA, $1.m_node, $3.m_node, $5.m_node), $1.m_featureInfo | $3.m_featureInfo | $5.m_featureInfo, $1.m_numConstants + $3.m_numConstants + $5.m_numConstants); }727 { $$ = createNodeInfo<ExpressionNode*>(new ConditionalNode(GLOBAL_DATA, $1.m_node, $3.m_node, $5.m_node), $1.m_features | $3.m_features | $5.m_features, $1.m_numConstants + $3.m_numConstants + $5.m_numConstants); } 721 728 ; 722 729 … … 724 731 LogicalORExprNoBF 725 732 | LogicalORExprNoBF '?' AssignmentExpr ':' AssignmentExpr 726 { $$ = createNode FeatureInfo<ExpressionNode*>(new ConditionalNode(GLOBAL_DATA, $1.m_node, $3.m_node, $5.m_node), $1.m_featureInfo | $3.m_featureInfo | $5.m_featureInfo, $1.m_numConstants + $3.m_numConstants + $5.m_numConstants); }733 { $$ = createNodeInfo<ExpressionNode*>(new ConditionalNode(GLOBAL_DATA, $1.m_node, $3.m_node, $5.m_node), $1.m_features | $3.m_features | $5.m_features, $1.m_numConstants + $3.m_numConstants + $5.m_numConstants); } 727 734 ; 728 735 … … 730 737 ConditionalExpr 731 738 | LeftHandSideExpr AssignmentOperator AssignmentExpr 732 { $$ = createNode FeatureInfo<ExpressionNode*>(makeAssignNode(GLOBAL_DATA, $1.m_node, $2, $3.m_node, $1.m_featureInfo & AssignFeature, $3.m_featureInfo& AssignFeature,733 @1.first_column, @2.first_column + 1, @3.last_column), $1.m_feature Info | $3.m_featureInfo| AssignFeature, $1.m_numConstants + $3.m_numConstants);739 { $$ = createNodeInfo<ExpressionNode*>(makeAssignNode(GLOBAL_DATA, $1.m_node, $2, $3.m_node, $1.m_features & AssignFeature, $3.m_features & AssignFeature, 740 @1.first_column, @2.first_column + 1, @3.last_column), $1.m_features | $3.m_features | AssignFeature, $1.m_numConstants + $3.m_numConstants); 734 741 } 735 742 ; … … 738 745 ConditionalExprNoIn 739 746 | LeftHandSideExpr AssignmentOperator AssignmentExprNoIn 740 { $$ = createNode FeatureInfo<ExpressionNode*>(makeAssignNode(GLOBAL_DATA, $1.m_node, $2, $3.m_node, $1.m_featureInfo & AssignFeature, $3.m_featureInfo& AssignFeature,741 @1.first_column, @2.first_column + 1, @3.last_column), $1.m_feature Info | $3.m_featureInfo| AssignFeature, $1.m_numConstants + $3.m_numConstants);747 { $$ = createNodeInfo<ExpressionNode*>(makeAssignNode(GLOBAL_DATA, $1.m_node, $2, $3.m_node, $1.m_features & AssignFeature, $3.m_features & AssignFeature, 748 @1.first_column, @2.first_column + 1, @3.last_column), $1.m_features | $3.m_features | AssignFeature, $1.m_numConstants + $3.m_numConstants); 742 749 } 743 750 ; … … 746 753 ConditionalExprNoBF 747 754 | LeftHandSideExprNoBF AssignmentOperator AssignmentExpr 748 { $$ = createNode FeatureInfo<ExpressionNode*>(makeAssignNode(GLOBAL_DATA, $1.m_node, $2, $3.m_node, $1.m_featureInfo & AssignFeature, $3.m_featureInfo& AssignFeature,749 @1.first_column, @2.first_column + 1, @3.last_column), $1.m_feature Info | $3.m_featureInfo| AssignFeature, $1.m_numConstants + $3.m_numConstants);755 { $$ = createNodeInfo<ExpressionNode*>(makeAssignNode(GLOBAL_DATA, $1.m_node, $2, $3.m_node, $1.m_features & AssignFeature, $3.m_features & AssignFeature, 756 @1.first_column, @2.first_column + 1, @3.last_column), $1.m_features | $3.m_features | AssignFeature, $1.m_numConstants + $3.m_numConstants); 750 757 } 751 758 ; … … 768 775 Expr: 769 776 AssignmentExpr 770 | Expr ',' AssignmentExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new CommaNode(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }777 | Expr ',' AssignmentExpr { $$ = createNodeInfo<ExpressionNode*>(new CommaNode(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 771 778 ; 772 779 773 780 ExprNoIn: 774 781 AssignmentExprNoIn 775 | ExprNoIn ',' AssignmentExprNoIn { $$ = createNode FeatureInfo<ExpressionNode*>(new CommaNode(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }782 | ExprNoIn ',' AssignmentExprNoIn { $$ = createNodeInfo<ExpressionNode*>(new CommaNode(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 776 783 ; 777 784 778 785 ExprNoBF: 779 786 AssignmentExprNoBF 780 | ExprNoBF ',' AssignmentExpr { $$ = createNode FeatureInfo<ExpressionNode*>(new CommaNode(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_featureInfo | $3.m_featureInfo, $1.m_numConstants + $3.m_numConstants); }787 | ExprNoBF ',' AssignmentExpr { $$ = createNodeInfo<ExpressionNode*>(new CommaNode(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } 781 788 ; 782 789 … … 803 810 OPENBRACE CLOSEBRACE { $$ = createNodeDeclarationInfo<StatementNode*>(new BlockNode(GLOBAL_DATA, 0), 0, 0, 0, 0); 804 811 DBG($$.m_node, @1, @2); } 805 | OPENBRACE SourceElements CLOSEBRACE { $$ = createNodeDeclarationInfo<StatementNode*>(new BlockNode(GLOBAL_DATA, $2.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_feature Info, $2.m_numConstants);812 | OPENBRACE SourceElements CLOSEBRACE { $$ = createNodeDeclarationInfo<StatementNode*>(new BlockNode(GLOBAL_DATA, $2.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_features, $2.m_numConstants); 806 813 DBG($$.m_node, @1, @3); } 807 814 ; 808 815 809 816 VariableStatement: 810 VAR VariableDeclarationList ';' { $$ = createNodeDeclarationInfo<StatementNode*>(makeVarStatementNode(GLOBAL_DATA, $2.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_feature Info, $2.m_numConstants);817 VAR VariableDeclarationList ';' { $$ = createNodeDeclarationInfo<StatementNode*>(makeVarStatementNode(GLOBAL_DATA, $2.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_features, $2.m_numConstants); 811 818 DBG($$.m_node, @1, @3); } 812 | VAR VariableDeclarationList error { $$ = createNodeDeclarationInfo<StatementNode*>(makeVarStatementNode(GLOBAL_DATA, $2.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_feature Info, $2.m_numConstants);819 | VAR VariableDeclarationList error { $$ = createNodeDeclarationInfo<StatementNode*>(makeVarStatementNode(GLOBAL_DATA, $2.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_features, $2.m_numConstants); 813 820 DBG($$.m_node, @1, @2); 814 821 AUTO_SEMICOLON; } … … 820 827 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$1, 0); 821 828 $$.m_funcDeclarations = 0; 822 $$.m_feature Info= (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0;829 $$.m_features = (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0; 823 830 $$.m_numConstants = 0; 824 831 } 825 | IDENT Initializer { AssignResolveNode* node = new AssignResolveNode(GLOBAL_DATA, *$1, $2.m_node, $2.m_feature Info& AssignFeature);832 | IDENT Initializer { AssignResolveNode* node = new AssignResolveNode(GLOBAL_DATA, *$1, $2.m_node, $2.m_features & AssignFeature); 826 833 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.first_column + 1, @2.last_column); 827 834 $$.m_node = node; … … 829 836 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$1, DeclarationStacks::HasInitializer); 830 837 $$.m_funcDeclarations = 0; 831 $$.m_feature Info = ((*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $2.m_featureInfo;838 $$.m_features = ((*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $2.m_features; 832 839 $$.m_numConstants = $2.m_numConstants; 833 840 } … … 837 844 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$3, 0); 838 845 $$.m_funcDeclarations = 0; 839 $$.m_feature Info = $1.m_featureInfo| ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0);846 $$.m_features = $1.m_features | ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0); 840 847 $$.m_numConstants = $1.m_numConstants; 841 848 } 842 849 | VariableDeclarationList ',' IDENT Initializer 843 { AssignResolveNode* node = new AssignResolveNode(GLOBAL_DATA, *$3, $4.m_node, $4.m_feature Info& AssignFeature);850 { AssignResolveNode* node = new AssignResolveNode(GLOBAL_DATA, *$3, $4.m_node, $4.m_features & AssignFeature); 844 851 SET_EXCEPTION_LOCATION(node, @3.first_column, @4.first_column + 1, @4.last_column); 845 852 $$.m_node = combineVarInitializers(GLOBAL_DATA, $1.m_node, node); … … 847 854 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$3, DeclarationStacks::HasInitializer); 848 855 $$.m_funcDeclarations = 0; 849 $$.m_feature Info = $1.m_featureInfo | ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $4.m_featureInfo;856 $$.m_features = $1.m_features | ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $4.m_features; 850 857 $$.m_numConstants = $1.m_numConstants + $4.m_numConstants; 851 858 } … … 857 864 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$1, 0); 858 865 $$.m_funcDeclarations = 0; 859 $$.m_feature Info= (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0;866 $$.m_features = (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0; 860 867 $$.m_numConstants = 0; 861 868 } 862 | IDENT InitializerNoIn { AssignResolveNode* node = new AssignResolveNode(GLOBAL_DATA, *$1, $2.m_node, $2.m_feature Info& AssignFeature);869 | IDENT InitializerNoIn { AssignResolveNode* node = new AssignResolveNode(GLOBAL_DATA, *$1, $2.m_node, $2.m_features & AssignFeature); 863 870 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.first_column + 1, @2.last_column); 864 871 $$.m_node = node; … … 866 873 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$1, DeclarationStacks::HasInitializer); 867 874 $$.m_funcDeclarations = 0; 868 $$.m_feature Info = ((*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $2.m_featureInfo;875 $$.m_features = ((*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $2.m_features; 869 876 $$.m_numConstants = $2.m_numConstants; 870 877 } … … 874 881 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$3, 0); 875 882 $$.m_funcDeclarations = 0; 876 $$.m_feature Info = $1.m_featureInfo| ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0);883 $$.m_features = $1.m_features | ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0); 877 884 $$.m_numConstants = $1.m_numConstants; 878 885 } 879 886 | VariableDeclarationListNoIn ',' IDENT InitializerNoIn 880 { AssignResolveNode* node = new AssignResolveNode(GLOBAL_DATA, *$3, $4.m_node, $4.m_feature Info& AssignFeature);887 { AssignResolveNode* node = new AssignResolveNode(GLOBAL_DATA, *$3, $4.m_node, $4.m_features & AssignFeature); 881 888 SET_EXCEPTION_LOCATION(node, @3.first_column, @4.first_column + 1, @4.last_column); 882 889 $$.m_node = combineVarInitializers(GLOBAL_DATA, $1.m_node, node); … … 884 891 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$3, DeclarationStacks::HasInitializer); 885 892 $$.m_funcDeclarations = 0; 886 $$.m_feature Info = $1.m_featureInfo | ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $4.m_featureInfo;893 $$.m_features = $1.m_features | ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $4.m_features; 887 894 $$.m_numConstants = $1.m_numConstants + $4.m_numConstants; 888 895 } … … 890 897 891 898 ConstStatement: 892 CONSTTOKEN ConstDeclarationList ';' { $$ = createNodeDeclarationInfo<StatementNode*>(new ConstStatementNode(GLOBAL_DATA, $2.m_node.head), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_feature Info, $2.m_numConstants);899 CONSTTOKEN ConstDeclarationList ';' { $$ = createNodeDeclarationInfo<StatementNode*>(new ConstStatementNode(GLOBAL_DATA, $2.m_node.head), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_features, $2.m_numConstants); 893 900 DBG($$.m_node, @1, @3); } 894 901 | CONSTTOKEN ConstDeclarationList error 895 { $$ = createNodeDeclarationInfo<StatementNode*>(new ConstStatementNode(GLOBAL_DATA, $2.m_node.head), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_feature Info, $2.m_numConstants);902 { $$ = createNodeDeclarationInfo<StatementNode*>(new ConstStatementNode(GLOBAL_DATA, $2.m_node.head), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_features, $2.m_numConstants); 896 903 DBG($$.m_node, @1, @2); AUTO_SEMICOLON; } 897 904 ; … … 903 910 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, $1.m_node); 904 911 $$.m_funcDeclarations = 0; 905 $$.m_feature Info = $1.m_featureInfo;912 $$.m_features = $1.m_features; 906 913 $$.m_numConstants = $1.m_numConstants; 907 914 } … … 913 920 appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, $3.m_node); 914 921 $$.m_funcDeclarations = 0; 915 $$.m_feature Info = $1.m_featureInfo | $3.m_featureInfo;922 $$.m_features = $1.m_features | $3.m_features; 916 923 $$.m_numConstants = $1.m_numConstants + $3.m_numConstants; } 917 924 ; 918 925 919 926 ConstDeclaration: 920 IDENT { $$ = createNode FeatureInfo<ConstDeclNode*>(new ConstDeclNode(GLOBAL_DATA, *$1, 0), (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0, 0); }921 | IDENT Initializer { $$ = createNode FeatureInfo<ConstDeclNode*>(new ConstDeclNode(GLOBAL_DATA, *$1, $2.m_node), ((*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $2.m_featureInfo, $2.m_numConstants); }927 IDENT { $$ = createNodeInfo<ConstDeclNode*>(new ConstDeclNode(GLOBAL_DATA, *$1, 0), (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0, 0); } 928 | IDENT Initializer { $$ = createNodeInfo<ConstDeclNode*>(new ConstDeclNode(GLOBAL_DATA, *$1, $2.m_node), ((*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $2.m_features, $2.m_numConstants); } 922 929 ; 923 930 … … 935 942 936 943 ExprStatement: 937 ExprNoBF ';' { $$ = createNodeDeclarationInfo<StatementNode*>(new ExprStatementNode(GLOBAL_DATA, $1.m_node), 0, 0, $1.m_feature Info, $1.m_numConstants);944 ExprNoBF ';' { $$ = createNodeDeclarationInfo<StatementNode*>(new ExprStatementNode(GLOBAL_DATA, $1.m_node), 0, 0, $1.m_features, $1.m_numConstants); 938 945 DBG($$.m_node, @1, @2); } 939 | ExprNoBF error { $$ = createNodeDeclarationInfo<StatementNode*>(new ExprStatementNode(GLOBAL_DATA, $1.m_node), 0, 0, $1.m_feature Info, $1.m_numConstants);946 | ExprNoBF error { $$ = createNodeDeclarationInfo<StatementNode*>(new ExprStatementNode(GLOBAL_DATA, $1.m_node), 0, 0, $1.m_features, $1.m_numConstants); 940 947 DBG($$.m_node, @1, @1); AUTO_SEMICOLON; } 941 948 ; … … 943 950 IfStatement: 944 951 IF '(' Expr ')' Statement %prec IF_WITHOUT_ELSE 945 { $$ = createNodeDeclarationInfo<StatementNode*>(new IfNode(GLOBAL_DATA, $3.m_node, $5.m_node), $5.m_varDeclarations, $5.m_funcDeclarations, $3.m_feature Info | $5.m_featureInfo, $3.m_numConstants + $5.m_numConstants);952 { $$ = createNodeDeclarationInfo<StatementNode*>(new IfNode(GLOBAL_DATA, $3.m_node, $5.m_node), $5.m_varDeclarations, $5.m_funcDeclarations, $3.m_features | $5.m_features, $3.m_numConstants + $5.m_numConstants); 946 953 DBG($$.m_node, @1, @4); } 947 954 | IF '(' Expr ')' Statement ELSE Statement 948 955 { $$ = createNodeDeclarationInfo<StatementNode*>(new IfElseNode(GLOBAL_DATA, $3.m_node, $5.m_node, $7.m_node), 949 956 mergeDeclarationLists($5.m_varDeclarations, $7.m_varDeclarations), mergeDeclarationLists($5.m_funcDeclarations, $7.m_funcDeclarations), 950 $3.m_feature Info | $5.m_featureInfo | $7.m_featureInfo,957 $3.m_features | $5.m_features | $7.m_features, 951 958 $3.m_numConstants + $5.m_numConstants + $7.m_numConstants); 952 959 DBG($$.m_node, @1, @4); } … … 954 961 955 962 IterationStatement: 956 DO Statement WHILE '(' Expr ')' ';' { $$ = createNodeDeclarationInfo<StatementNode*>(new DoWhileNode(GLOBAL_DATA, $2.m_node, $5.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_feature Info | $5.m_featureInfo, $2.m_numConstants + $5.m_numConstants);963 DO Statement WHILE '(' Expr ')' ';' { $$ = createNodeDeclarationInfo<StatementNode*>(new DoWhileNode(GLOBAL_DATA, $2.m_node, $5.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_features | $5.m_features, $2.m_numConstants + $5.m_numConstants); 957 964 DBG($$.m_node, @1, @3); } 958 | DO Statement WHILE '(' Expr ')' error { $$ = createNodeDeclarationInfo<StatementNode*>(new DoWhileNode(GLOBAL_DATA, $2.m_node, $5.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_feature Info | $5.m_featureInfo, $2.m_numConstants + $5.m_numConstants);965 | DO Statement WHILE '(' Expr ')' error { $$ = createNodeDeclarationInfo<StatementNode*>(new DoWhileNode(GLOBAL_DATA, $2.m_node, $5.m_node), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_features | $5.m_features, $2.m_numConstants + $5.m_numConstants); 959 966 DBG($$.m_node, @1, @3); } // Always performs automatic semicolon insertion. 960 | WHILE '(' Expr ')' Statement { $$ = createNodeDeclarationInfo<StatementNode*>(new WhileNode(GLOBAL_DATA, $3.m_node, $5.m_node), $5.m_varDeclarations, $5.m_funcDeclarations, $3.m_feature Info | $5.m_featureInfo, $3.m_numConstants + $5.m_numConstants);967 | WHILE '(' Expr ')' Statement { $$ = createNodeDeclarationInfo<StatementNode*>(new WhileNode(GLOBAL_DATA, $3.m_node, $5.m_node), $5.m_varDeclarations, $5.m_funcDeclarations, $3.m_features | $5.m_features, $3.m_numConstants + $5.m_numConstants); 961 968 DBG($$.m_node, @1, @4); } 962 969 | FOR '(' ExprNoInOpt ';' ExprOpt ';' ExprOpt ')' Statement 963 970 { $$ = createNodeDeclarationInfo<StatementNode*>(new ForNode(GLOBAL_DATA, $3.m_node, $5.m_node, $7.m_node, $9.m_node, false), $9.m_varDeclarations, $9.m_funcDeclarations, 964 $3.m_feature Info | $5.m_featureInfo | $7.m_featureInfo | $9.m_featureInfo,971 $3.m_features | $5.m_features | $7.m_features | $9.m_features, 965 972 $3.m_numConstants + $5.m_numConstants + $7.m_numConstants + $9.m_numConstants); 966 973 DBG($$.m_node, @1, @8); … … 970 977 mergeDeclarationLists($4.m_varDeclarations, $10.m_varDeclarations), 971 978 mergeDeclarationLists($4.m_funcDeclarations, $10.m_funcDeclarations), 972 $4.m_feature Info | $6.m_featureInfo | $8.m_featureInfo | $10.m_featureInfo,979 $4.m_features | $6.m_features | $8.m_features | $10.m_features, 973 980 $4.m_numConstants + $6.m_numConstants + $8.m_numConstants + $10.m_numConstants); 974 981 DBG($$.m_node, @1, @9); } … … 978 985 SET_EXCEPTION_LOCATION(node, @3.first_column, @3.last_column, @5.last_column); 979 986 $$ = createNodeDeclarationInfo<StatementNode*>(node, $7.m_varDeclarations, $7.m_funcDeclarations, 980 $3.m_feature Info | $5.m_featureInfo | $7.m_featureInfo,987 $3.m_features | $5.m_features | $7.m_features, 981 988 $3.m_numConstants + $5.m_numConstants + $7.m_numConstants); 982 989 DBG($$.m_node, @1, @6); … … 986 993 SET_EXCEPTION_LOCATION(forIn, @4.first_column, @5.first_column + 1, @6.last_column); 987 994 appendToVarDeclarationList(GLOBAL_DATA, $8.m_varDeclarations, *$4, DeclarationStacks::HasInitializer); 988 $$ = createNodeDeclarationInfo<StatementNode*>(forIn, $8.m_varDeclarations, $8.m_funcDeclarations, ((*$4 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $6.m_feature Info | $8.m_featureInfo, $6.m_numConstants + $8.m_numConstants);995 $$ = createNodeDeclarationInfo<StatementNode*>(forIn, $8.m_varDeclarations, $8.m_funcDeclarations, ((*$4 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $6.m_features | $8.m_features, $6.m_numConstants + $8.m_numConstants); 989 996 DBG($$.m_node, @1, @7); } 990 997 | FOR '(' VAR IDENT InitializerNoIn INTOKEN Expr ')' Statement … … 993 1000 appendToVarDeclarationList(GLOBAL_DATA, $9.m_varDeclarations, *$4, DeclarationStacks::HasInitializer); 994 1001 $$ = createNodeDeclarationInfo<StatementNode*>(forIn, $9.m_varDeclarations, $9.m_funcDeclarations, 995 ((*$4 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $5.m_feature Info | $7.m_featureInfo | $9.m_featureInfo,1002 ((*$4 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $5.m_features | $7.m_features | $9.m_features, 996 1003 $5.m_numConstants + $7.m_numConstants + $9.m_numConstants); 997 1004 DBG($$.m_node, @1, @8); } … … 999 1006 1000 1007 ExprOpt: 1001 /* nothing */ { $$ = createNode FeatureInfo<ExpressionNode*>(0, 0, 0); }1008 /* nothing */ { $$ = createNodeInfo<ExpressionNode*>(0, 0, 0); } 1002 1009 | Expr 1003 1010 ; 1004 1011 1005 1012 ExprNoInOpt: 1006 /* nothing */ { $$ = createNode FeatureInfo<ExpressionNode*>(0, 0, 0); }1013 /* nothing */ { $$ = createNodeInfo<ExpressionNode*>(0, 0, 0); } 1007 1014 | ExprNoIn 1008 1015 ; … … 1051 1058 | RETURN Expr ';' { ReturnNode* node = new ReturnNode(GLOBAL_DATA, $2.m_node); 1052 1059 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.last_column, @2.last_column); 1053 $$ = createNodeDeclarationInfo<StatementNode*>(node, 0, 0, $2.m_feature Info, $2.m_numConstants); DBG($$.m_node, @1, @3); }1060 $$ = createNodeDeclarationInfo<StatementNode*>(node, 0, 0, $2.m_features, $2.m_numConstants); DBG($$.m_node, @1, @3); } 1054 1061 | RETURN Expr error { ReturnNode* node = new ReturnNode(GLOBAL_DATA, $2.m_node); 1055 1062 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.last_column, @2.last_column); 1056 $$ = createNodeDeclarationInfo<StatementNode*>(node, 0, 0, $2.m_feature Info, $2.m_numConstants); DBG($$.m_node, @1, @2); AUTO_SEMICOLON; }1063 $$ = createNodeDeclarationInfo<StatementNode*>(node, 0, 0, $2.m_features, $2.m_numConstants); DBG($$.m_node, @1, @2); AUTO_SEMICOLON; } 1057 1064 ; 1058 1065 1059 1066 WithStatement: 1060 1067 WITH '(' Expr ')' Statement { $$ = createNodeDeclarationInfo<StatementNode*>(new WithNode(GLOBAL_DATA, $3.m_node, $5.m_node, @3.last_column, @3.last_column - @3.first_column), 1061 $5.m_varDeclarations, $5.m_funcDeclarations, $3.m_feature Info | $5.m_featureInfo| WithFeature, $3.m_numConstants + $5.m_numConstants);1068 $5.m_varDeclarations, $5.m_funcDeclarations, $3.m_features | $5.m_features | WithFeature, $3.m_numConstants + $5.m_numConstants); 1062 1069 DBG($$.m_node, @1, @4); } 1063 1070 ; … … 1065 1072 SwitchStatement: 1066 1073 SWITCH '(' Expr ')' CaseBlock { $$ = createNodeDeclarationInfo<StatementNode*>(new SwitchNode(GLOBAL_DATA, $3.m_node, $5.m_node), $5.m_varDeclarations, $5.m_funcDeclarations, 1067 $3.m_feature Info | $5.m_featureInfo, $3.m_numConstants + $5.m_numConstants);1074 $3.m_features | $5.m_features, $3.m_numConstants + $5.m_numConstants); 1068 1075 DBG($$.m_node, @1, @4); } 1069 1076 ; 1070 1077 1071 1078 CaseBlock: 1072 OPENBRACE CaseClausesOpt CLOSEBRACE { $$ = createNodeDeclarationInfo<CaseBlockNode*>(new CaseBlockNode(GLOBAL_DATA, $2.m_node.head, 0, 0), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_feature Info, $2.m_numConstants); }1079 OPENBRACE CaseClausesOpt CLOSEBRACE { $$ = createNodeDeclarationInfo<CaseBlockNode*>(new CaseBlockNode(GLOBAL_DATA, $2.m_node.head, 0, 0), $2.m_varDeclarations, $2.m_funcDeclarations, $2.m_features, $2.m_numConstants); } 1073 1080 | OPENBRACE CaseClausesOpt DefaultClause CaseClausesOpt CLOSEBRACE 1074 1081 { $$ = createNodeDeclarationInfo<CaseBlockNode*>(new CaseBlockNode(GLOBAL_DATA, $2.m_node.head, $3.m_node, $4.m_node.head), 1075 1082 mergeDeclarationLists(mergeDeclarationLists($2.m_varDeclarations, $3.m_varDeclarations), $4.m_varDeclarations), 1076 1083 mergeDeclarationLists(mergeDeclarationLists($2.m_funcDeclarations, $3.m_funcDeclarations), $4.m_funcDeclarations), 1077 $2.m_feature Info | $3.m_featureInfo | $4.m_featureInfo,1084 $2.m_features | $3.m_features | $4.m_features, 1078 1085 $2.m_numConstants + $3.m_numConstants + $4.m_numConstants); } 1079 1086 ; 1080 1087 1081 1088 CaseClausesOpt: 1082 /* nothing */ { $$.m_node.head = 0; $$.m_node.tail = 0; $$.m_varDeclarations = 0; $$.m_funcDeclarations = 0; $$.m_feature Info= 0; $$.m_numConstants = 0; }1089 /* nothing */ { $$.m_node.head = 0; $$.m_node.tail = 0; $$.m_varDeclarations = 0; $$.m_funcDeclarations = 0; $$.m_features = 0; $$.m_numConstants = 0; } 1083 1090 | CaseClauses 1084 1091 ; … … 1089 1096 $$.m_varDeclarations = $1.m_varDeclarations; 1090 1097 $$.m_funcDeclarations = $1.m_funcDeclarations; 1091 $$.m_feature Info = $1.m_featureInfo;1098 $$.m_features = $1.m_features; 1092 1099 $$.m_numConstants = $1.m_numConstants; } 1093 1100 | CaseClauses CaseClause { $$.m_node.head = $1.m_node.head; … … 1095 1102 $$.m_varDeclarations = mergeDeclarationLists($1.m_varDeclarations, $2.m_varDeclarations); 1096 1103 $$.m_funcDeclarations = mergeDeclarationLists($1.m_funcDeclarations, $2.m_funcDeclarations); 1097 $$.m_feature Info = $1.m_featureInfo | $2.m_featureInfo;1104 $$.m_features = $1.m_features | $2.m_features; 1098 1105 $$.m_numConstants = $1.m_numConstants + $2.m_numConstants; 1099 1106 } … … 1101 1108 1102 1109 CaseClause: 1103 CASE Expr ':' { $$ = createNodeDeclarationInfo<CaseClauseNode*>(new CaseClauseNode(GLOBAL_DATA, $2.m_node), 0, 0, $2.m_feature Info, $2.m_numConstants); }1104 | CASE Expr ':' SourceElements { $$ = createNodeDeclarationInfo<CaseClauseNode*>(new CaseClauseNode(GLOBAL_DATA, $2.m_node, $4.m_node), $4.m_varDeclarations, $4.m_funcDeclarations, $2.m_feature Info | $4.m_featureInfo, $2.m_numConstants + $4.m_numConstants); }1110 CASE Expr ':' { $$ = createNodeDeclarationInfo<CaseClauseNode*>(new CaseClauseNode(GLOBAL_DATA, $2.m_node), 0, 0, $2.m_features, $2.m_numConstants); } 1111 | CASE Expr ':' SourceElements { $$ = createNodeDeclarationInfo<CaseClauseNode*>(new CaseClauseNode(GLOBAL_DATA, $2.m_node, $4.m_node), $4.m_varDeclarations, $4.m_funcDeclarations, $2.m_features | $4.m_features, $2.m_numConstants + $4.m_numConstants); } 1105 1112 ; 1106 1113 1107 1114 DefaultClause: 1108 1115 DEFAULT ':' { $$ = createNodeDeclarationInfo<CaseClauseNode*>(new CaseClauseNode(GLOBAL_DATA, 0), 0, 0, 0, 0); } 1109 | DEFAULT ':' SourceElements { $$ = createNodeDeclarationInfo<CaseClauseNode*>(new CaseClauseNode(GLOBAL_DATA, 0, $3.m_node), $3.m_varDeclarations, $3.m_funcDeclarations, $3.m_feature Info, $3.m_numConstants); }1116 | DEFAULT ':' SourceElements { $$ = createNodeDeclarationInfo<CaseClauseNode*>(new CaseClauseNode(GLOBAL_DATA, 0, $3.m_node), $3.m_varDeclarations, $3.m_funcDeclarations, $3.m_features, $3.m_numConstants); } 1110 1117 ; 1111 1118 … … 1114 1121 LabelNode* node = new LabelNode(GLOBAL_DATA, *$1, $3.m_node); 1115 1122 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.last_column, @2.last_column); 1116 $$ = createNodeDeclarationInfo<StatementNode*>(node, $3.m_varDeclarations, $3.m_funcDeclarations, $3.m_feature Info, $3.m_numConstants); }1123 $$ = createNodeDeclarationInfo<StatementNode*>(node, $3.m_varDeclarations, $3.m_funcDeclarations, $3.m_features, $3.m_numConstants); } 1117 1124 ; 1118 1125 … … 1120 1127 THROW Expr ';' { ThrowNode* node = new ThrowNode(GLOBAL_DATA, $2.m_node); 1121 1128 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.last_column, @2.last_column); 1122 $$ = createNodeDeclarationInfo<StatementNode*>(node, 0, 0, $2.m_feature Info, $2.m_numConstants); DBG($$.m_node, @1, @2);1129 $$ = createNodeDeclarationInfo<StatementNode*>(node, 0, 0, $2.m_features, $2.m_numConstants); DBG($$.m_node, @1, @2); 1123 1130 } 1124 1131 | THROW Expr error { ThrowNode* node = new ThrowNode(GLOBAL_DATA, $2.m_node); 1125 1132 SET_EXCEPTION_LOCATION(node, @1.first_column, @2.last_column, @2.last_column); 1126 $$ = createNodeDeclarationInfo<StatementNode*>(node, 0, 0, $2.m_feature Info, $2.m_numConstants); DBG($$.m_node, @1, @2); AUTO_SEMICOLON;1133 $$ = createNodeDeclarationInfo<StatementNode*>(node, 0, 0, $2.m_features, $2.m_numConstants); DBG($$.m_node, @1, @2); AUTO_SEMICOLON; 1127 1134 } 1128 1135 ; … … 1132 1139 mergeDeclarationLists($2.m_varDeclarations, $4.m_varDeclarations), 1133 1140 mergeDeclarationLists($2.m_funcDeclarations, $4.m_funcDeclarations), 1134 $2.m_feature Info | $4.m_featureInfo,1141 $2.m_features | $4.m_features, 1135 1142 $2.m_numConstants + $4.m_numConstants); 1136 1143 DBG($$.m_node, @1, @2); } … … 1138 1145 mergeDeclarationLists($2.m_varDeclarations, $7.m_varDeclarations), 1139 1146 mergeDeclarationLists($2.m_funcDeclarations, $7.m_funcDeclarations), 1140 $2.m_feature Info | $7.m_featureInfo| CatchFeature,1147 $2.m_features | $7.m_features | CatchFeature, 1141 1148 $2.m_numConstants + $7.m_numConstants); 1142 1149 DBG($$.m_node, @1, @2); } … … 1145 1152 mergeDeclarationLists(mergeDeclarationLists($2.m_varDeclarations, $7.m_varDeclarations), $9.m_varDeclarations), 1146 1153 mergeDeclarationLists(mergeDeclarationLists($2.m_funcDeclarations, $7.m_funcDeclarations), $9.m_funcDeclarations), 1147 $2.m_feature Info | $7.m_featureInfo | $9.m_featureInfo| CatchFeature,1154 $2.m_features | $7.m_features | $9.m_features | CatchFeature, 1148 1155 $2.m_numConstants + $7.m_numConstants + $9.m_numConstants); 1149 1156 DBG($$.m_node, @1, @2); } … … 1158 1165 1159 1166 FunctionDeclaration: 1160 FUNCTION IDENT '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNode FeatureInfo(new FuncDeclNode(GLOBAL_DATA, *$2, $6, LEXER->sourceCode($5, $7, @5.first_line)), ((*$2 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | ClosureFeature, 0); DBG($6, @5, @7); }1167 FUNCTION IDENT '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeInfo(new FuncDeclNode(GLOBAL_DATA, *$2, $6, LEXER->sourceCode($5, $7, @5.first_line)), ((*$2 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | ClosureFeature, 0); DBG($6, @5, @7); } 1161 1168 | FUNCTION IDENT '(' FormalParameterList ')' OPENBRACE FunctionBody CLOSEBRACE 1162 { $$ = createNodeFeatureInfo(new FuncDeclNode(GLOBAL_DATA, *$2, $7, LEXER->sourceCode($6, $8, @6.first_line), $4.m_node.head), ((*$2 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $4.m_featureInfo | ClosureFeature, 0); $7->setUsesArguments($7->usesArguments() || (($4.m_featureInfo & ArgumentsFeature) != 0)); DBG($7, @6, @8); } 1169 { 1170 $$ = createNodeInfo(new FuncDeclNode(GLOBAL_DATA, *$2, $7, LEXER->sourceCode($6, $8, @6.first_line), $4.m_node.head), ((*$2 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0) | $4.m_features | ClosureFeature, 0); 1171 if ($4.m_features & ArgumentsFeature) 1172 $7->setUsesArguments(); 1173 DBG($7, @6, @8); 1174 } 1163 1175 ; 1164 1176 1165 1177 FunctionExpr: 1166 FUNCTION '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeFeatureInfo(new FuncExprNode(GLOBAL_DATA, GLOBAL_DATA->propertyNames->nullIdentifier, $5, LEXER->sourceCode($4, $6, @4.first_line)), ClosureFeature, 0); DBG($5, @4, @6); } 1167 | FUNCTION '(' FormalParameterList ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeFeatureInfo(new FuncExprNode(GLOBAL_DATA, GLOBAL_DATA->propertyNames->nullIdentifier, $6, LEXER->sourceCode($5, $7, @5.first_line), $3.m_node.head), $3.m_featureInfo | ClosureFeature, 0); $6->setUsesArguments($6->usesArguments() || (($3.m_featureInfo & ArgumentsFeature) != 0)); DBG($6, @5, @7); } 1168 | FUNCTION IDENT '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeFeatureInfo(new FuncExprNode(GLOBAL_DATA, *$2, $6, LEXER->sourceCode($5, $7, @5.first_line)), ClosureFeature, 0); DBG($6, @5, @7); } 1169 | FUNCTION IDENT '(' FormalParameterList ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeFeatureInfo(new FuncExprNode(GLOBAL_DATA, *$2, $7, LEXER->sourceCode($6, $8, @6.first_line), $4.m_node.head), $4.m_featureInfo | ClosureFeature, 0); $7->setUsesArguments($7->usesArguments() || (($4.m_featureInfo & ArgumentsFeature) != 0)); DBG($7, @6, @8); } 1178 FUNCTION '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeInfo(new FuncExprNode(GLOBAL_DATA, GLOBAL_DATA->propertyNames->nullIdentifier, $5, LEXER->sourceCode($4, $6, @4.first_line)), ClosureFeature, 0); DBG($5, @4, @6); } 1179 | FUNCTION '(' FormalParameterList ')' OPENBRACE FunctionBody CLOSEBRACE 1180 { 1181 $$ = createNodeInfo(new FuncExprNode(GLOBAL_DATA, GLOBAL_DATA->propertyNames->nullIdentifier, $6, LEXER->sourceCode($5, $7, @5.first_line), $3.m_node.head), $3.m_features | ClosureFeature, 0); 1182 if ($3.m_features & ArgumentsFeature) 1183 $6->setUsesArguments(); 1184 DBG($6, @5, @7); 1185 } 1186 | FUNCTION IDENT '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeInfo(new FuncExprNode(GLOBAL_DATA, *$2, $6, LEXER->sourceCode($5, $7, @5.first_line)), ClosureFeature, 0); DBG($6, @5, @7); } 1187 | FUNCTION IDENT '(' FormalParameterList ')' OPENBRACE FunctionBody CLOSEBRACE 1188 { 1189 $$ = createNodeInfo(new FuncExprNode(GLOBAL_DATA, *$2, $7, LEXER->sourceCode($6, $8, @6.first_line), $4.m_node.head), $4.m_features | ClosureFeature, 0); 1190 if ($4.m_features & ArgumentsFeature) 1191 $7->setUsesArguments(); 1192 DBG($7, @6, @8); 1193 } 1170 1194 ; 1171 1195 1172 1196 FormalParameterList: 1173 1197 IDENT { $$.m_node.head = new ParameterNode(GLOBAL_DATA, *$1); 1174 $$.m_feature Info= (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0;1198 $$.m_features = (*$1 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0; 1175 1199 $$.m_node.tail = $$.m_node.head; } 1176 1200 | FormalParameterList ',' IDENT { $$.m_node.head = $1.m_node.head; 1177 $$.m_feature Info = $1.m_featureInfo| ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0);1201 $$.m_features = $1.m_features | ((*$3 == GLOBAL_DATA->propertyNames->arguments) ? ArgumentsFeature : 0); 1178 1202 $$.m_node.tail = new ParameterNode(GLOBAL_DATA, $1.m_node.tail, *$3); } 1179 1203 ; 1180 1204 1181 1205 FunctionBody: 1182 /* not in spec */ { $$ = FunctionBodyNode::create(GLOBAL_DATA, 0, 0, 0, false, false, false, 0); }1206 /* not in spec */ { $$ = FunctionBodyNode::create(GLOBAL_DATA, 0, 0, 0, NoFeatures, 0); } 1183 1207 | SourceElements { $$ = FunctionBodyNode::create(GLOBAL_DATA, $1.m_node, $1.m_varDeclarations ? &$1.m_varDeclarations->data : 0, 1184 1208 $1.m_funcDeclarations ? &$1.m_funcDeclarations->data : 0, 1185 ($1.m_featureInfo & EvalFeature) != 0, ($1.m_featureInfo & ClosureFeature) != 0, 1186 ($1.m_featureInfo & ArgumentsFeature) != 0, $1.m_numConstants); 1209 $1.m_features, $1.m_numConstants); 1187 1210 // As in mergeDeclarationLists() we have to ref/deref to safely get rid of 1188 1211 // the declaration lists. … … 1199 1222 1200 1223 Program: 1201 /* not in spec */ { GLOBAL_DATA->parser->didFinishParsing(new SourceElements(GLOBAL_DATA), 0, 0, false, false, false, @0.last_line, 0); } 1202 | SourceElements { GLOBAL_DATA->parser->didFinishParsing($1.m_node, $1.m_varDeclarations, $1.m_funcDeclarations, 1203 ($1.m_featureInfo & EvalFeature) != 0, ($1.m_featureInfo & ClosureFeature) != 0, 1204 ($1.m_featureInfo & ArgumentsFeature) != 0, @1.last_line, $1.m_numConstants); } 1224 /* not in spec */ { GLOBAL_DATA->parser->didFinishParsing(new SourceElements(GLOBAL_DATA), 0, 0, NoFeatures, @0.last_line, 0); } 1225 | SourceElements { GLOBAL_DATA->parser->didFinishParsing($1.m_node, $1.m_varDeclarations, $1.m_funcDeclarations, $1.m_features, 1226 @1.last_line, $1.m_numConstants); } 1205 1227 ; 1206 1228 … … 1210 1232 $$.m_varDeclarations = $1.m_varDeclarations; 1211 1233 $$.m_funcDeclarations = $1.m_funcDeclarations; 1212 $$.m_feature Info = $1.m_featureInfo;1234 $$.m_features = $1.m_features; 1213 1235 $$.m_numConstants = $1.m_numConstants; 1214 1236 } … … 1216 1238 $$.m_varDeclarations = mergeDeclarationLists($1.m_varDeclarations, $2.m_varDeclarations); 1217 1239 $$.m_funcDeclarations = mergeDeclarationLists($1.m_funcDeclarations, $2.m_funcDeclarations); 1218 $$.m_feature Info = $1.m_featureInfo | $2.m_featureInfo;1240 $$.m_features = $1.m_features | $2.m_features; 1219 1241 $$.m_numConstants = $1.m_numConstants + $2.m_numConstants; 1220 1242 } … … 1222 1244 1223 1245 SourceElement: 1224 FunctionDeclaration { $$ = createNodeDeclarationInfo<StatementNode*>($1.m_node, 0, new ParserRefCountedData<DeclarationStacks::FunctionStack>(GLOBAL_DATA), $1.m_feature Info, 0); $$.m_funcDeclarations->data.append($1.m_node); }1246 FunctionDeclaration { $$ = createNodeDeclarationInfo<StatementNode*>($1.m_node, 0, new ParserRefCountedData<DeclarationStacks::FunctionStack>(GLOBAL_DATA), $1.m_features, 0); $$.m_funcDeclarations->data.append($1.m_node); } 1225 1247 | Statement { $$ = $1; } 1226 1248 ; … … 1309 1331 static ExpressionNodeInfo makeFunctionCallNode(void* globalPtr, ExpressionNodeInfo func, ArgumentsNodeInfo args, int start, int divot, int end) 1310 1332 { 1311 FeatureInfo features = func.m_featureInfo | args.m_featureInfo;1333 CodeFeatures features = func.m_features | args.m_features; 1312 1334 int numConstants = func.m_numConstants + args.m_numConstants; 1313 1335 if (!func.m_node->isLocation()) 1314 return createNode FeatureInfo<ExpressionNode*>(new FunctionCallValueNode(GLOBAL_DATA, func.m_node, args.m_node, divot, divot - start, end - divot), features, numConstants);1336 return createNodeInfo<ExpressionNode*>(new FunctionCallValueNode(GLOBAL_DATA, func.m_node, args.m_node, divot, divot - start, end - divot), features, numConstants); 1315 1337 if (func.m_node->isResolveNode()) { 1316 1338 ResolveNode* resolve = static_cast<ResolveNode*>(func.m_node); 1317 1339 const Identifier& identifier = resolve->identifier(); 1318 1340 if (identifier == GLOBAL_DATA->propertyNames->eval) 1319 return createNode FeatureInfo<ExpressionNode*>(new EvalFunctionCallNode(GLOBAL_DATA, args.m_node, divot, divot - start, end - divot), EvalFeature | features, numConstants);1320 return createNode FeatureInfo<ExpressionNode*>(new FunctionCallResolveNode(GLOBAL_DATA, identifier, args.m_node, divot, divot - start, end - divot), features, numConstants);1341 return createNodeInfo<ExpressionNode*>(new EvalFunctionCallNode(GLOBAL_DATA, args.m_node, divot, divot - start, end - divot), EvalFeature | features, numConstants); 1342 return createNodeInfo<ExpressionNode*>(new FunctionCallResolveNode(GLOBAL_DATA, identifier, args.m_node, divot, divot - start, end - divot), features, numConstants); 1321 1343 } 1322 1344 if (func.m_node->isBracketAccessorNode()) { … … 1324 1346 FunctionCallBracketNode* node = new FunctionCallBracketNode(GLOBAL_DATA, bracket->base(), bracket->subscript(), args.m_node, divot, divot - start, end - divot); 1325 1347 node->setSubexpressionInfo(bracket->divot(), bracket->endOffset()); 1326 return createNode FeatureInfo<ExpressionNode*>(node, features, numConstants);1348 return createNodeInfo<ExpressionNode*>(node, features, numConstants); 1327 1349 } 1328 1350 ASSERT(func.m_node->isDotAccessorNode()); … … 1330 1352 FunctionCallDotNode* node = new FunctionCallDotNode(GLOBAL_DATA, dot->base(), dot->identifier(), args.m_node, divot, divot - start, end - divot); 1331 1353 node->setSubexpressionInfo(dot->divot(), dot->endOffset()); 1332 return createNode FeatureInfo<ExpressionNode*>(node, features, numConstants);1354 return createNodeInfo<ExpressionNode*>(node, features, numConstants); 1333 1355 } 1334 1356 -
trunk/JavaScriptCore/kjs/nodes.cpp
r37184 r37275 1699 1699 // ------------------------------ ScopeNode ----------------------------- 1700 1700 1701 ScopeNode::ScopeNode(JSGlobalData* globalData, const SourceCode& source, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, bool usesEval, bool needsClosure, bool usesArguments, int numConstants)1701 ScopeNode::ScopeNode(JSGlobalData* globalData, const SourceCode& source, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, CodeFeatures features, int numConstants) 1702 1702 : BlockNode(globalData, children) 1703 1703 , m_source(source) 1704 , m_usesEval(usesEval) 1705 , m_needsClosure(needsClosure) 1706 , m_usesArguments(usesArguments) 1704 , m_features(features) 1707 1705 , m_numConstants(numConstants) 1708 1706 { … … 1717 1715 // ------------------------------ ProgramNode ----------------------------- 1718 1716 1719 ProgramNode::ProgramNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, bool usesEval, bool needsClosure, bool usesArguments, int numConstants)1720 : ScopeNode(globalData, source, children, varStack, funcStack, usesEval, needsClosure, usesArguments, numConstants)1721 { 1722 } 1723 1724 ProgramNode* ProgramNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, bool usesEval, bool needsClosure, bool usesArguments, int numConstants)1725 { 1726 return new ProgramNode(globalData, children, varStack, funcStack, source, usesEval, needsClosure, usesArguments, numConstants);1717 ProgramNode::ProgramNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, CodeFeatures features, int numConstants) 1718 : ScopeNode(globalData, source, children, varStack, funcStack, features, numConstants) 1719 { 1720 } 1721 1722 ProgramNode* ProgramNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, CodeFeatures features, int numConstants) 1723 { 1724 return new ProgramNode(globalData, children, varStack, funcStack, source, features, numConstants); 1727 1725 } 1728 1726 1729 1727 // ------------------------------ EvalNode ----------------------------- 1730 1728 1731 EvalNode::EvalNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, bool usesEval, bool needsClosure, bool usesArguments, int numConstants)1732 : ScopeNode(globalData, source, children, varStack, funcStack, usesEval, needsClosure, usesArguments, numConstants)1729 EvalNode::EvalNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, CodeFeatures features, int numConstants) 1730 : ScopeNode(globalData, source, children, varStack, funcStack, features, numConstants) 1733 1731 { 1734 1732 } … … 1759 1757 } 1760 1758 1761 EvalNode* EvalNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, bool usesEval, bool needsClosure, bool usesArguments, int numConstants)1762 { 1763 return new EvalNode(globalData, children, varStack, funcStack, source, usesEval, needsClosure, usesArguments, numConstants);1759 EvalNode* EvalNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, CodeFeatures features, int numConstants) 1760 { 1761 return new EvalNode(globalData, children, varStack, funcStack, source, features, numConstants); 1764 1762 } 1765 1763 1766 1764 // ------------------------------ FunctionBodyNode ----------------------------- 1767 1765 1768 FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, bool usesEval, bool needsClosure, bool usesArguments, int numConstants)1769 : ScopeNode(globalData, SourceCode(), children, varStack, funcStack, usesEval, needsClosure, usesArguments, numConstants)1766 FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, CodeFeatures features, int numConstants) 1767 : ScopeNode(globalData, SourceCode(), children, varStack, funcStack, features, numConstants) 1770 1768 , m_parameters(0) 1771 1769 , m_refCount(0) … … 1801 1799 } 1802 1800 1803 FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, bool usesEval, bool needsClosure, bool usesArguments, int numConstants)1804 { 1805 return new FunctionBodyNode(globalData, children, varStack, funcStack, usesEval, needsClosure, usesArguments, numConstants);1806 } 1807 1808 FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode&, bool usesEval, bool needsClosure, bool usesArguments, int numConstants)1809 { 1810 return new FunctionBodyNode(globalData, children, varStack, funcStack, usesEval, needsClosure, usesArguments, numConstants);1801 FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, CodeFeatures features, int numConstants) 1802 { 1803 return new FunctionBodyNode(globalData, children, varStack, funcStack, features, numConstants); 1804 } 1805 1806 FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode&, CodeFeatures features, int numConstants) 1807 { 1808 return new FunctionBodyNode(globalData, children, varStack, funcStack, features, numConstants); 1811 1809 } 1812 1810 -
trunk/JavaScriptCore/kjs/nodes.h
r37184 r37275 61 61 class SourceStream; 62 62 63 typedef unsigned int CodeFeatures; 64 65 const CodeFeatures NoFeatures = 0; 66 const CodeFeatures EvalFeature = 1 << 0; 67 const CodeFeatures ClosureFeature = 1 << 1; 68 const CodeFeatures AssignFeature = 1 << 2; 69 const CodeFeatures ArgumentsFeature = 1 << 3; 70 const CodeFeatures WithFeature = 1 << 4; 71 const CodeFeatures CatchFeature = 1 << 5; 72 const CodeFeatures ThisFeature = 1 << 6; 73 const CodeFeatures AllFeatures = EvalFeature | ClosureFeature | AssignFeature | ArgumentsFeature | WithFeature | CatchFeature | ThisFeature; 74 63 75 enum Operator { 64 76 OpEqual, … … 2168 2180 class ScopeNode : public BlockNode { 2169 2181 public: 2170 ScopeNode(JSGlobalData*, const SourceCode&, SourceElements*, VarStack*, FunctionStack*, bool usesEval, bool needsClosure, bool usesArguments, int numConstants) JSC_FAST_CALL;2182 ScopeNode(JSGlobalData*, const SourceCode&, SourceElements*, VarStack*, FunctionStack*, CodeFeatures, int numConstants) JSC_FAST_CALL; 2171 2183 2172 2184 virtual void streamTo(SourceStream&) const JSC_FAST_CALL; … … 2177 2189 intptr_t sourceID() const { return m_source.provider()->asID(); } 2178 2190 2179 bool usesEval() const { return m_ usesEval; }2180 bool needsClosure() const { return m_needsClosure; }2181 bool usesArguments() const { return m_ usesArguments; }2182 void setUsesArguments( bool usesArguments) { m_usesArguments = usesArguments; }2191 bool usesEval() const { return m_features & EvalFeature; } 2192 bool containsClosures() const { return m_features & ClosureFeature; } 2193 bool usesArguments() const { return m_features & ArgumentsFeature; } 2194 void setUsesArguments() { m_features |= ArgumentsFeature; } 2183 2195 2184 2196 VarStack& varStack() { return m_varStack; } … … 2198 2210 private: 2199 2211 SourceCode m_source; 2200 bool m_usesEval; 2201 bool m_needsClosure; 2202 bool m_usesArguments; 2212 CodeFeatures m_features; 2203 2213 int m_numConstants; 2204 2214 }; … … 2206 2216 class ProgramNode : public ScopeNode { 2207 2217 public: 2208 static ProgramNode* create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, bool usesEval, bool needsClosure, bool usesArguments, int numConstants) JSC_FAST_CALL;2218 static ProgramNode* create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants) JSC_FAST_CALL; 2209 2219 2210 2220 ProgramCodeBlock& byteCode(ScopeChainNode* scopeChain) JSC_FAST_CALL … … 2216 2226 2217 2227 private: 2218 ProgramNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, bool usesEval, bool needsClosure, bool usesArguments, int numConstants) JSC_FAST_CALL;2228 ProgramNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants) JSC_FAST_CALL; 2219 2229 2220 2230 void generateCode(ScopeChainNode*) JSC_FAST_CALL; … … 2229 2239 class EvalNode : public ScopeNode { 2230 2240 public: 2231 static EvalNode* create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, bool usesEval, bool needsClosure, bool usesArguments, int numConstants) JSC_FAST_CALL;2241 static EvalNode* create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants) JSC_FAST_CALL; 2232 2242 2233 2243 EvalCodeBlock& byteCode(ScopeChainNode* scopeChain) JSC_FAST_CALL … … 2239 2249 2240 2250 private: 2241 EvalNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, bool usesEval, bool needsClosure, bool usesArguments, int numConstants) JSC_FAST_CALL;2251 EvalNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants) JSC_FAST_CALL; 2242 2252 2243 2253 void generateCode(ScopeChainNode*) JSC_FAST_CALL; … … 2249 2259 class FunctionBodyNode : public ScopeNode { 2250 2260 public: 2251 static FunctionBodyNode* create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, bool usesEval, bool needsClosure, bool usesArguments, int numConstants) JSC_FAST_CALL;2252 static FunctionBodyNode* create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, bool usesEval, bool needsClosure, bool usesArguments, int numConstants) JSC_FAST_CALL;2261 static FunctionBodyNode* create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants) JSC_FAST_CALL; 2262 static FunctionBodyNode* create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, CodeFeatures, int numConstants) JSC_FAST_CALL; 2253 2263 ~FunctionBodyNode(); 2254 2264 … … 2297 2307 2298 2308 protected: 2299 FunctionBodyNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, bool usesEval, bool needsClosure, bool usesArguments, int numConstants) JSC_FAST_CALL;2309 FunctionBodyNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, CodeFeatures, int numConstants) JSC_FAST_CALL; 2300 2310 2301 2311 private:
Note:
See TracChangeset
for help on using the changeset viewer.