VarDef

/**
* A ControlFlowNode that defines some RefExpr nodes, this node is a site.
* Including:
* 1. variable defination: let x = 1;
* 2. assignment expression: x = 1, x+= 1;
* 3. for like statement: for (x in ...);
* 4. parameter: function foo(p);
* 5. function with name: function foo();
*/

Inherit from ControlFlowNode

Primary key: id: int

schema VarDef extends ControlFlowNode {
  @primary id: int
}

VarDef::getRelativePath

/**
* Get the relative path of this control flow node.
*/
  • Parameter self: VarDef
  • Return string
pub fn getRelativePath(self: VarDef) -> string;

VarDef::getKindName

/**
* Get the kind name of node.
* If node is ast node, just return ast node kind name; otherwise
* return node name as CfgEntryNode or CfgExitNode.
*/
  • Parameter self: VarDef
  • Return string
pub fn getKindName(self: VarDef) -> string;

VarDef::getFile

/**
* Get the file of this control flow node.
*/
pub fn getFile(self: VarDef) -> File;

VarDef::getEnclosingFunction

/**
* Get the enclosing function of node.
* CfgEntryNode or CfgExitNode return belongs to function.
*/
pub fn getEnclosingFunction(self: VarDef) -> FunctionLikeDeclaration;

VarDef::isSyntheticNode

  • Parameter self: VarDef
  • Return bool
pub fn isSyntheticNode(self: VarDef) -> bool;

VarDef::getASuccessorWithCompletion

/**
* Get an immediate successor of this node with the given
* type of Completion.
*/
pub fn getASuccessorWithCompletion(self: VarDef, c: Completion) -> *ControlFlowNode;

VarDef::isEntryNode

  • Parameter self: VarDef
  • Return bool
pub fn isEntryNode(self: VarDef) -> bool;

VarDef::isAstNode

  • Parameter self: VarDef
  • Return bool
pub fn isAstNode(self: VarDef) -> bool;

VarDef::getLocation

/**
* Get the location of this control flow node.
*/
pub fn getLocation(self: VarDef) -> Location;

VarDef::__all__

Data constraint method.

pub fn __all__(db: JavascriptDB) -> *VarDef;

VarDef::getPredecessorCount

/**
* Get the count of immediate predecessor nodes/
*/
  • Parameter self: VarDef
  • Return int
pub fn getPredecessorCount(self: VarDef) -> int;

VarDef::getSource

/**
* Get the data source of this variable definition.
*/
pub fn getSource(self: VarDef) -> Expression;

VarDef::getText

/**
* Get the text of this control flow node.
*/
  • Parameter self: VarDef
  • Return string
pub fn getText(self: VarDef) -> string;

VarDef::getATarget

/**
* Gets the target of VarDef, maybe the type of target is LValue?
*/
pub fn getATarget(self: VarDef) -> *LValue;

VarDef::getSuccessorCount

/**
* Get the count of immediate successor nodes.
*/
  • Parameter self: VarDef
  • Return int
pub fn getSuccessorCount(self: VarDef) -> int;

VarDef::getAUse

/**
* Gets the RValue that are defined by this node.
*/
pub fn getAUse(self: VarDef) -> *VarUse;

VarDef::getBasicBlock

/**
* Get the basic block that contains this node.
*/
pub fn getBasicBlock(self: VarDef) -> BasicBlock;

VarDef::getAPredecessor

/**
* Get an immediate predecessor of this node.
*/
pub fn getAPredecessor(self: VarDef) -> *ControlFlowNode;

VarDef::isExitNode

  • Parameter self: VarDef
  • Return bool
pub fn isExitNode(self: VarDef) -> bool;

VarDef::getASuccessorRecursive

/**
* Gets the successor of this node, and query successors recursively
*/
pub fn getASuccessorRecursive(self: VarDef) -> *ControlFlowNode;

VarDef::getASuccessor

/**
* Get an immediate successor of this node.
*/
pub fn getASuccessor(self: VarDef) -> *ControlFlowNode;