ArrayElement

data class ArrayElement(var array: Expression, var index: Expression, var typeName: String? = null, var line: Int) : Assignable, IsParent

Used to describe the access to an array element

Example:

int a[100];
a[5] = 0;

Constructors

Link copied to clipboard
constructor(array: Expression, index: Expression, typeName: String? = null, line: Int)

Properties

Link copied to clipboard

represents the array being accessed

Link copied to clipboard

represents the index in the array

Link copied to clipboard
open override var line: Int

is the line at which the statement/code component begins in the program text file

Link copied to clipboard
open override var parent: IsParent?

is the parent of the node in the Syntax Tree

Link copied to clipboard
open override val scope: SymbolTable?

is the scope to which the node belongs

Link copied to clipboard
open override var typeName: String?

used to specify the expression's type

Functions

Link copied to clipboard
open override fun replaceChild(initial: AstObject, replacement: AstObject)

Is replacing a certain child of the class with another object of the same type If the two parameters don't have the same type, no block will be replaced. If the type of initial doesn't match any of the current node children, no child will be replaced

Link copied to clipboard
open override fun setParentForChildren()

Sets the object as a parent for its children