@@ -453,6 +453,38 @@ module ExprNodes {
453453
454454 StmtBlockCfgNode getStmtBlock ( ) { e .hasCfgChild ( e .getStmtBlock ( ) , this , result ) }
455455 }
456+
457+ class HashTableChildMapping extends ExprChildMapping , HashTableExpr {
458+ override predicate relevantChild ( Ast n ) { this .hasEntry ( _, _, n ) or this .hasEntry ( _, n , _) }
459+ }
460+
461+ class HashTableCfgNode extends ExprCfgNode {
462+ override string getAPrimaryQlClass ( ) { result = "HashMapCfgNode" }
463+
464+ override HashTableChildMapping e ;
465+
466+ override HashTableExpr getExpr ( ) { result = super .getExpr ( ) }
467+
468+ StmtCfgNode getElement ( ExprCfgNode key ) {
469+ exists ( Expr eKey |
470+ eKey = key .getAstNode ( ) and
471+ e .hasCfgChild ( eKey , this , key ) and
472+ e .hasCfgChild ( e .getElement ( eKey ) , this , result )
473+ )
474+ }
475+
476+ predicate hasKey ( ExprCfgNode key ) { exists ( this .getElement ( key ) ) }
477+
478+ StmtCfgNode getAnElement ( ) { result = this .getElement ( _) }
479+
480+ predicate hasEntry ( int index , ExprCfgNode key , StmtCfgNode value ) {
481+ exists ( Expr eKey , Stmt sValue |
482+ e .hasCfgChild ( eKey , this , key ) and
483+ e .hasCfgChild ( sValue , this , value ) and
484+ e .hasEntry ( index , eKey , sValue )
485+ )
486+ }
487+ }
456488}
457489
458490module StmtNodes {
0 commit comments