core/odin/ast

odin_ast

Types

103

Any_Expr

Any_Expr :: union { ^Bad_Expr, ^Ident, ^Implicit, ^Undef, ^Basic_Lit, ^Basic_Directive, ^Ellipsis, ^Proc_Lit, ^Comp_Lit, ^Tag_Expr, ^Unary_Expr, ^Binary_Expr, ^Paren_Expr, ^Selector_Expr, ^Implicit_Selector_Expr, ^Selector_Call_Expr, ^Index_Expr, ^Deref_Expr, ^Slice_Expr, ^Matrix_Index_Expr, ^Call_Expr, ^Field_Value, ^Ternary_If_Expr, ^Ternary_When_Expr, ^Or_Else_Expr, ^Or_Return_Expr, ^Or_Branch_Expr, ^Type_Assertion, ^Type_Cast, ^Auto_Cast, ^Inline_Asm_Expr, ^Proc_Group, ^Typeid_Type, ^Helper_Type, ^Distinct_Type, ^Poly_Type, ^Proc_Type, ^Pointer_Type, ^Multi_Pointer_Type, ^Array_Type, ^Dynamic_Array_Type, ^Fixed_Capacity_Dynamic_Array_Type, ^Struct_Type, ^Union_Type, ^Enum_Type, ^Bit_Set_Type, ^Map_Type, ^Relative_Type, ^Matrix_Type, ^Bit_Field_Type, }Source

Any_Node

Any_Node :: union { ^Package, ^File, ^Comment_Group, ^Bad_Expr, ^Ident, ^Implicit, ^Undef, ^Basic_Lit, ^Basic_Directive, ^Ellipsis, ^Proc_Lit, ^Comp_Lit, ^Tag_Expr, ^Unary_Expr, ^Binary_Expr, ^Paren_Expr, ^Selector_Expr, ^Implicit_Selector_Expr, ^Selector_Call_Expr, ^Index_Expr, ^Deref_Expr, ^Slice_Expr, ^Matrix_Index_Expr, ^Call_Expr, ^Field_Value, ^Ternary_If_Expr, ^Ternary_When_Expr, ^Or_Else_Expr, ^Or_Return_Expr, ^Or_Branch_Expr, ^Type_Assertion, ^Type_Cast, ^Auto_Cast, ^Inline_Asm_Expr, ^Proc_Group, ^Typeid_Type, ^Helper_Type, ^Distinct_Type, ^Poly_Type, ^Proc_Type, ^Pointer_Type, ^Multi_Pointer_Type, ^Array_Type, ^Dynamic_Array_Type, ^Fixed_Capacity_Dynamic_Array_Type, ^Struct_Type, ^Union_Type, ^Enum_Type, ^Bit_Set_Type, ^Map_Type, ^Relative_Type, ^Matrix_Type, ^Bit_Field_Type, ^Bad_Stmt, ^Empty_Stmt, ^Expr_Stmt, ^Tag_Stmt, ^Assign_Stmt, ^Block_Stmt, ^If_Stmt, ^When_Stmt, ^Return_Stmt, ^Defer_Stmt, ^For_Stmt, ^Range_Stmt, ^Inline_Range_Stmt, ^Case_Clause, ^Switch_Stmt, ^Type_Switch_Stmt, ^Branch_Stmt, ^Using_Stmt, ^Bad_Decl, ^Value_Decl, ^Package_Decl, ^Import_Decl, ^Foreign_Block_Decl, ^Foreign_Import_Decl, ^Attribute, ^Field, ^Field_List, ^Bit_Field_Field, }Source

Field_Flag

Field_Flag :: enum int { Invalid = 0, Unknown = 1, Ellipsis = 2, Using = 3, No_Alias = 4, C_Vararg = 5, Const = 6, Any_Int = 7, Subtype = 8, By_Ptr = 9, No_Broadcast = 10, No_Capture = 11, Results = 12, Tags = 13, Default_Parameters = 14, Typeid_Token = 15, }Source

Visitor

Visitor :: struct { visit: proc(visitor: ^Visitor, node: ^Node) -> (^Visitor), visitor: ^Visitor, Visitor: ^Node, node: ^Node, data: rawptr, }Source

A Visitor's visit procedure is invoked for each node encountered by walk If the result visitor is not nil, walk visits each of the children of node with the new visitor, followed by a call of v.visit(v, nil)

Constants

5

Variables

2

Procedures

12

inspect

inspect :: proc(node: ^Node, f: proc(^Node) -> (bool))Source

inspect traverses an AST in depth-first order It starts by calling f(node), and node must be non-nil If f returns true, inspect invokes f recursively for each of the non-nil children of node, followed by a call of f(nil)

walk

walk :: proc(v: ^Visitor, node: ^Node)Source

walk traverses an AST in depth-first order: It starts by calling v.visit(v, node), and node must not be nil If the visitor returned by v.visit(v, node) is not nil, walk is invoked recursively with the new visitor for each of the non-nil children of node, followed by a call of the new visit procedure

Procedure Groups

2

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.