CodeQL library for Go
codeql/go-all 0.7.12 (changelog, source)
Search

Class StringOps::ConcatenationElement

An element of a string concatenation, which either itself performs a string concatenation or occurs as an operand in a string concatenation.

For example, the expression x + y + z contains the following concatenation elements:

  • The leaf elements x, y, and z
  • The intermediate element x + y, which is both a concatenation and an operand
  • The root element x + y + z

Import path

import semmle.go.StringOps

Direct supertypes

Known direct subtypes

Predicates

asNode

Gets the data-flow node corresponding to this concatenation element, if any.

getALeaf

Gets a leaf in the concatenation tree that this element is the root of.

getAnOperand

Gets an operand of this string concatenation.

getConcatenationRoot

Gets the root of the concatenation tree to which this element belongs.

getFirstLeaf

Gets the first leaf in this concatenation tree.

getFirstOperand

Gets the first operand of this string concatenation.

getLastLeaf

Gets the last leaf in this concatenation tree.

getLastOperand

Gets the last operand of this string concatenation.

getNumOperand

Gets the number of operands of this string concatenation.

getOperand

Gets the nth operand of this string concatenation.

getStringValue

Gets the string value of this concatenation element if it is a constant.

hasLocationInfo

Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

toString

Gets a textual representation of this concatenation element.