Property

data class Property(var title: String, var typeName: String? = null, var defaultValue: Expression? = null, var line: Int) : Expression, IsParent

Used to define a function parameter or a class property

Example:

struct myStructure {
int myNum; //this is a property
char myLetter; //this is another property
};

Constructors

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

Properties

Link copied to clipboard
Link copied to clipboard
open override var line: Int

represents the line on which the property is located

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
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