Expand description
Abstract Syntax Tree definitions for GENT
Structs§
- Agent
Decl - An agent declaration:
agent Name { fields... } - Agent
Field - A field in an agent declaration:
name: value - Assignment
Stmt - Assignment statement:
x = expr - Block
- A block of statements
- Duration
- Duration value with unit
- Enum
Decl - Enum declaration:
enum Name { Variant1, Variant2(type) } - Enum
Field - A field in an enum variant
- Enum
Variant - A variant in an enum declaration
- FnDecl
- Function declaration (pure, no agent access):
fn name(params) -> return_type { body } - ForStmt
- For loop statement
- IfStmt
- If statement:
if cond { ... } else { ... } - Import
Stmt - Import statement:
import { Name1, Name2 } from "./path.gnt" - Lambda
- Lambda expression: (params) => body
- LetStmt
- Let statement:
let x = expr - Match
Arm - A single arm in a match expression
- Match
Expr - Match expression:
match value { Pattern => result } - Parallel
Decl - Parallel execution block declaration
- Param
- Parameter in a tool or function declaration
- Program
- A complete GENT program
- Return
Stmt - Return statement:
return expr? - Struct
Decl - Struct declaration:
struct Name { fields... } - Struct
Field - A field in a struct or inline object type
- Tool
Decl - Tool declaration:
tool name(params) -> return_type { body } - TopLevel
Call - A top-level function call:
funcName(args...) - TryStmt
- Try/catch statement
- While
Stmt - While loop statement
Enums§
- Binary
Op - Binary operators
- Block
Stmt - A statement within a block
- Duration
Unit - Duration unit for timeout specifications
- Expression
- An expression in GENT
- Field
Type - Field types for structured output schemas
- Lambda
Body - Lambda body - either a single expression or a block
- Match
Body - Body of a match arm
- Match
Pattern - Pattern in a match arm
- Output
Type - Output type specification (inline or named)
- Statement
- A statement in GENT
- String
Part - Part of an interpolated string
- Type
Name - Type names in GENT
- UnaryOp
- Unary operators