Skip to content

SgNodeHelper::Pattern

Provides functions which match a certain AST pattern and return a pointer to a node of interest inside that pattern.

Types

Functions

Name

Description

matchAssertExpr

tests pattern for an assert

matchExprStmtAssignOpVarRefExpFunctionCallExp

tests pattern SgExprStatement(SgAssignOp(VarRefExp,FunctionCallExp)) and returns pointer to FunctionCallExp otherwise 0.

matchExprStmtAssignOpVarRefExpFunctionCallExp2

matchExprStmtFunctionCallExp

tests pattern SgExprStatement(FunctionCallExp) and returns pointer to FunctionCallExp, otherwise 0.

matchFunctionCall

tests several patterns and returns pointer to FunctionCallExp inside that matched pattern, otherwise 0.

matchFunctionCallExpInVariableDeclaration

tests pattern for function call in variable declaration and returns pointer to FunctionCallExp otherwise 0.

matchReturnStmtFunctionCallExp

tests pattern SgReturnStmt(FunctionCallExp) and returns pointer to FunctionCallExp, otherwise 0.

matchSingleVarFPrintf

tests pattern SgFunctionCall(...) where the name of the function is fprintf with 3 params

matchSingleVarOrValuePrintf

matchSingleVarPrintf

tests pattern SgFunctionCall(...) where the name of the function is printf with 2 params

matchSingleVarScanf

tests pattern SgFunctionCall(...) where the name of the function is scanf with 2 params

matchVariableDeclarationWithFunctionCall

checks variable declaration with function call, returns variable declaration. Otherwise 0. e.g. int x=f();

matchVariableDeclarationWithFunctionCall2

checks variable declaration with function call, returns both in a pair, or a with (0,0).

Created with MrDocs