package core:odin/ast
Index
Types (97)
- Any_Expr
- Any_Node
- Any_Stmt
- Array_Type
- Assign_Stmt
- Attribute
- Auto_Cast
- Bad_Decl
- Bad_Expr
- Bad_Stmt
- Basic_Directive
- Basic_Lit
- Binary_Expr
- Bit_Set_Type
- Block_Stmt
- Branch_Stmt
- Call_Expr
- Case_Clause
- Comment_Group
- Comp_Lit
- Decl
- Defer_Stmt
- Deref_Expr
- Distinct_Type
- Dynamic_Array_Type
- Ellipsis
- Empty_Stmt
- Enum_Type
- Expr
- Expr_Stmt
- Field
- Field_Flag
- Field_Flags
- Field_List
- Field_Value
- File
- For_Stmt
- Foreign_Block_Decl
- Foreign_Import_Decl
- Helper_Type
- Ident
- If_Stmt
- Implicit
- Implicit_Selector_Expr
- Import_Decl
- Index_Expr
- Inline_Asm_Dialect
- Inline_Asm_Expr
- Inline_Range_Stmt
- Map_Type
- Matrix_Index_Expr
- Matrix_Type
- Multi_Pointer_Type
- Node
- Node_State_Flag
- Node_State_Flags
- Or_Else_Expr
- Or_Return_Expr
- Package
- Package_Decl
- Package_Kind
- Paren_Expr
- Pointer_Type
- Poly_Type
- Proc_Calling_Convention
- Proc_Calling_Convention_Extra
- Proc_Group
- Proc_Inlining
- Proc_Lit
- Proc_Tag
- Proc_Tags
- Proc_Type
- Range_Stmt
- Relative_Type
- Return_Stmt
- Selector_Call_Expr
- Selector_Expr
- Slice_Expr
- Stmt
- Struct_Type
- Switch_Stmt
- Tag_Expr
- Tag_Stmt
- Ternary_If_Expr
- Ternary_When_Expr
- Type_Assertion
- Type_Cast
- Type_Switch_Stmt
- Typeid_Type
- Unary_Expr
- Undef
- Union_Type
- Union_Type_Kind
- Using_Stmt
- Value_Decl
- Visitor
- When_Stmt
Variables (2)
Procedures (10)
Procedure Groups (1)
Types
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, ^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, ^Struct_Type, ^Union_Type, ^Enum_Type, ^Bit_Set_Type, ^Map_Type, ^Relative_Type, ^Matrix_Type, }
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, ^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, ^Struct_Type, ^Union_Type, ^Enum_Type, ^Bit_Set_Type, ^Map_Type, ^Relative_Type, ^Matrix_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, }
Any_Stmt ¶
Any_Stmt :: union { ^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 ¶
Attribute :: struct { node: Node, tok: odin_tokenizer.Token_Kind, open: odin_tokenizer.Pos, elems: []^Expr, close: odin_tokenizer.Pos, }
Bad_Decl ¶
Bad_Decl :: struct { node: Decl, }
Bad_Expr ¶
Bad_Expr :: struct { node: Expr, }
Bad_Stmt ¶
Bad_Stmt :: struct { node: Stmt, }
Distinct_Type ¶
Distinct_Type :: struct { node: Expr, tok: odin_tokenizer.Token_Kind, type: ^Expr, }
Ellipsis ¶
Ellipsis :: struct { node: Expr, tok: odin_tokenizer.Token_Kind, expr: ^Expr, }
Field ¶
Field :: struct { node: Node, docs: ^Comment_Group, names: []^Expr, // Could be polymorphic type: ^Expr, default_value: ^Expr, tag: odin_tokenizer.Token, flags: Field_Flags, comment: ^Comment_Group, }
Field_Flag ¶
Field_Flag :: enum int { Invalid, Unknown, Ellipsis, Using, No_Alias, C_Vararg, Auto_Cast, Any_Int, Subtype, By_Ptr, Results, Tags, Default_Parameters, Typeid_Token, }
Field_Flags ¶
Field_Flags :: distinct bit_set[Field_Flag]
File ¶
File :: struct { node: Node, id: int, pkg: ^Package, fullpath: string, src: string, docs: ^Comment_Group, pkg_decl: ^Package_Decl, pkg_token: odin_tokenizer.Token, pkg_name: string, decls: [dynamic]^Stmt, imports: [dynamic]^Import_Decl, directive_count: int, comments: [dynamic]^Comment_Group, syntax_warning_count: int, syntax_error_count: int, }
Foreign_Import_Decl ¶
Foreign_Import_Decl :: struct { node: Decl, docs: ^Comment_Group, attributes: [dynamic]^Attribute, // dynamic as parsing will add to them lazily foreign_tok: odin_tokenizer.Token, import_tok: odin_tokenizer.Token, name: ^Ident, collection_name: string, fullpaths: []string, comment: ^Comment_Group, }
Helper_Type ¶
Helper_Type :: struct { node: Expr, tok: odin_tokenizer.Token_Kind, type: ^Expr, }
Import_Decl ¶
Import_Decl :: struct { node: Decl, docs: ^Comment_Group, is_using: bool, import_tok: odin_tokenizer.Token, name: odin_tokenizer.Token, relpath: odin_tokenizer.Token, fullpath: string, comment: ^Comment_Group, }
Inline_Asm_Dialect ¶
Inline_Asm_Dialect :: enum u8 { Default = 0, ATT = 1, Intel = 2, }
Node ¶
Node :: struct { pos: odin_tokenizer.Pos, end: odin_tokenizer.Pos, state_flags: Node_State_Flags, derived: Any_Node, }
Node_State_Flag ¶
Node_State_Flag :: enum int { Bounds_Check, No_Bounds_Check, }
Node_State_Flags ¶
Node_State_Flags :: distinct bit_set[Node_State_Flag]
Package ¶
Package :: struct { node: Node, kind: Package_Kind, id: int, name: string, fullpath: string, files: map[string]^File, user_data: rawptr, }
Package_Decl ¶
Package_Decl :: struct { node: Decl, docs: ^Comment_Group, token: odin_tokenizer.Token, name: string, comment: ^Comment_Group, }
Package_Kind ¶
Package_Kind :: enum int { Normal, Runtime, Init, }
Proc_Calling_Convention ¶
Proc_Calling_Convention :: union { string, Proc_Calling_Convention_Extra, }
Proc_Calling_Convention_Extra ¶
Proc_Calling_Convention_Extra :: enum i32 { Foreign_Block_Default, }
Proc_Inlining ¶
Proc_Inlining :: enum u32 { None = 0, Inline = 1, No_Inline = 2, }
Proc_Tag ¶
Proc_Tag :: enum int { Bounds_Check, No_Bounds_Check, Optional_Ok, Optional_Allocator_Error, }
Proc_Tags ¶
Proc_Tags :: distinct bit_set[Proc_Tag; u32]
Proc_Type ¶
Proc_Type :: struct { node: Expr, tok: odin_tokenizer.Token, calling_convention: Proc_Calling_Convention, params: ^Field_List, arrow: odin_tokenizer.Pos, results: ^Field_List, tags: Proc_Tags, generic: bool, diverging: bool, }
Struct_Type ¶
Struct_Type :: struct { node: Expr, tok_pos: odin_tokenizer.Pos, poly_params: ^Field_List, align: ^Expr, where_token: odin_tokenizer.Token, where_clauses: []^Expr, is_packed: bool, is_raw_union: bool, fields: ^Field_List, name_count: int, }
Typeid_Type ¶
Typeid_Type :: struct { node: Expr, tok: odin_tokenizer.Token_Kind, specialization: ^Expr, }
Types
Undef ¶
Undef :: struct { node: Expr, tok: odin_tokenizer.Token_Kind, }
Union_Type ¶
Union_Type :: struct { node: Expr, tok_pos: odin_tokenizer.Pos, poly_params: ^Field_List, align: ^Expr, kind: Union_Type_Kind, where_token: odin_tokenizer.Token, where_clauses: []^Expr, variants: []^Expr, }
Union_Type_Kind ¶
Union_Type_Kind :: enum u8 { Normal, maybe, no_nil, shared_nil, }
Value_Decl ¶
Value_Decl :: struct { node: Decl, docs: ^Comment_Group, attributes: [dynamic]^Attribute, // dynamic as parsing will add to them lazily names: []^Expr, type: ^Expr, values: []^Expr, comment: ^Comment_Group, is_using: bool, is_mutable: bool, }
Visitor ¶
Visitor :: struct { visit: proc "odin" (visitor: ^Visitor, node: ^Node) -> ^Visitor, data: rawptr, }
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
Field_Flags_Record_Poly_Params ¶
Field_Flags_Record_Poly_Params :: Field_Flags{.Typeid_Token, .Default_Parameters}
Field_Flags_Signature ¶
Field_Flags_Signature :: Field_Flags{.Ellipsis, .Using, .No_Alias, .C_Vararg, .Auto_Cast, .Any_Int, .By_Ptr, .Default_Parameters}
Field_Flags_Signature_Params ¶
Field_Flags_Signature_Params :: Field_Flags_Signature | {Field_Flag.Typeid_Token}
Field_Flags_Signature_Results ¶
Field_Flags_Signature_Results :: Field_Flags_Signature
Field_Flags_Struct ¶
Field_Flags_Struct :: Field_Flags{.Using, .Tags, .Subtype}
Variables
field_flag_strings ¶
field_flag_strings: [Field_Flag]string = …
field_hash_flag_strings ¶
field_hash_flag_strings: []struct { key: string, flag: Field_Flag, } = …
Procedures
clone_array ¶
clone_array :: proc "odin" (array: $A/[]^$T) -> $A/[]^$T {…}
clone_dynamic_array ¶
clone_dynamic_array :: proc "odin" (array: $A/[dynamic]^$T) -> $A/[dynamic]^$T {…}
inspect ¶
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 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
clone ¶
clone :: proc{ clone_node, clone_expr, clone_stmt, clone_decl, clone_array, clone_dynamic_array, }
Source Files
Generation Information
Generated with odin version dev-2023-03 (vendor "odin") Windows_amd64 @ 2023-03-29 21:09:05.292399700 +0000 UTC