Skip to main content
Codegen uses a set of core behaviors that can be inherited by code elements. These behaviors provide consistent APIs across different types of symbols.

Core Behaviors

These “behaviors” are implemented as inherited classes.

Working with Names

The HasName behavior provides APIs for working with named elements:

Working with Values

The HasValue behavior provides APIs for elements that have values:

Working with Code Blocks

The HasBlock behavior provides APIs for elements containing code:

Working with Attributes

The get_attribute method provides APIs for attribute access:

Behavior Combinations

Many code elements inherit multiple behaviors. For example, a function typically has: