Yume
Classes | Namespaces | Typedefs | Enumerations | Functions
ast.hpp File Reference
#include "token.hpp"
#include "ty/compatibility.hpp"
#include "ty/type_base.hpp"
#include "util.hpp"
#include <concepts>
#include <cstdint>
#include <llvm/ADT/SmallPtrSet.h>
#include <llvm/Support/ErrorHandling.h>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <unordered_set>
#include <utility>
#include <variant>
#include <vector>
Include dependency graph for ast.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  yume::ast::OptionalAnyBase< T >
 Represents "any" kind of ast node of type T, or the absence of one. See OptionalExpr and OptionalType. More...
 
class  yume::ast::AnyBase< T >
 Represents "any" kind of ast node of type T. See AnyExpr, AnyStmt and AnyType. More...
 
struct  yume::ast::Attachment
 Represents the relationship between multiple AST nodes. More...
 
class  yume::ast::AST
 All nodes in the AST tree of the program inherit from this class. More...
 
class  yume::ast::Stmt
 Statements make up most things in source code. More...
 
class  yume::ast::Type
 A type annotation. This (ast::Type) is distinct from the actual type of a value (ty::Type). More...
 
struct  yume::ast::SimpleType
 Just the name of a type, always capitalized. More...
 
struct  yume::ast::QualType
 A type with a Qualifier like mut or [] following. More...
 
struct  yume::ast::SelfType
 The self type. More...
 
struct  yume::ast::ProxyType
 A type which refers to a different type, specifically that of a struct field. More...
 
struct  yume::ast::FunctionType
 A function type i.e. ->(Foo,Bar)Baz. More...
 
struct  yume::ast::TypeName
 A pair of a Type and an identifier, i.e. a parameter name. More...
 
struct  yume::ast::GenericParam
 A generic, compile-time argument to a struct or function definition, comparable to C++ template parameters. Like C++ templates, these can be non-type parameters. If it's a generic type parameter, such as the following: More...
 
class  yume::ast::Expr
 Expressions have an associated value and type. More...
 
struct  yume::ast::AnyTypeOrExpr
 
struct  yume::ast::TemplatedType
 A type with explicit type parameters i.e. Foo<Bar,Baz>. More...
 
struct  yume::ast::NumberExpr
 Number literals. More...
 
struct  yume::ast::CharExpr
 Char literals. More...
 
struct  yume::ast::BoolExpr
 Bool literals (true or false). More...
 
struct  yume::ast::StringExpr
 String literals. More...
 
struct  yume::ast::VarExpr
 A variable, i.e. just an identifier. More...
 
struct  yume::ast::ConstExpr
 A constant. Currently global. More...
 
struct  yume::ast::CallExpr
 A function call or operator. More...
 
struct  yume::ast::BinaryLogicExpr
 A logical operator such as || or &&. Since these aren't overloadable, they have their own AST node. More...
 
struct  yume::ast::CtorExpr
 A construction of a struct or cast of a primitive. More...
 
struct  yume::ast::DtorExpr
 A destruction of an object upon leaving its scope. More...
 
struct  yume::ast::SliceExpr
 A slice literal, i.e. an array. More...
 
struct  yume::ast::AssignExpr
 An assignment (=). More...
 
struct  yume::ast::FieldAccessExpr
 Direct access of a field of a struct (::). More...
 
struct  yume::ast::ImplicitCastExpr
 Represents an implicit cast to a different type, performed during semantic analysis. More...
 
struct  yume::ast::TypeExpr
 Represents a reference to a type. More...
 
struct  yume::ast::Compound
 A statement consisting of multiple other statements, i.e. the body of a function. More...
 
struct  yume::ast::LambdaExpr
 A local definition of an anonymous function. More...
 
class  yume::ast::Decl
 Base class for a named declaration. More...
 
struct  yume::ast::FnDecl
 A declaration of a function (def). More...
 
struct  yume::ast::FnDecl::Body
 
struct  yume::ast::CtorDecl
 A declaration of a custom constructor (def :new). More...
 
struct  yume::ast::StructDecl
 A declaration of a struct (struct) or an interface (interface). More...
 
struct  yume::ast::VarDecl
 A declaration of a local variable (let). More...
 
struct  yume::ast::ConstDecl
 A declaration of a constant (const). More...
 
struct  yume::ast::WhileStmt
 A while loop (while). More...
 
struct  yume::ast::IfClause
 Clauses of an if statement IfStmt. More...
 
struct  yume::ast::IfStmt
 An if statement (if), with one or more IfClauses, and optionally an else clause. More...
 
struct  yume::ast::ReturnStmt
 Return from a function body. More...
 
struct  yume::ast::Program
 The top level structure of a file of source code. More...
 

Namespaces

namespace  llvm
 
namespace  yume
 
namespace  yume::diagnostic
 
namespace  yume::ast
 

Typedefs

using yume::ast::AnyStmt = AnyBase< Stmt >
 
using yume::ast::OptionalStmt = OptionalAnyBase< Stmt >
 
using yume::ast::AnyType = AnyBase< Type >
 
using yume::ast::OptionalType = OptionalAnyBase< Type >
 
using yume::ast::AnyExpr = AnyBase< Expr >
 
using yume::ast::OptionalExpr = OptionalAnyBase< Expr >
 

Enumerations

enum  yume::ast::Kind {
  yume::ast::K_Unknown , yume::ast::K_IfClause , yume::ast::K_TypeName , yume::ast::K_GenericParam ,
  yume::ast::K_Stmt , yume::ast::K_Compound , yume::ast::K_While , yume::ast::K_If ,
  yume::ast::K_Return , yume::ast::K_Program , yume::ast::K_Decl , yume::ast::K_FnDecl ,
  yume::ast::K_CtorDecl , yume::ast::K_StructDecl , yume::ast::K_VarDecl , yume::ast::K_ConstDecl ,
  yume::ast::K_END_Decl , yume::ast::K_Expr , yume::ast::K_Number , yume::ast::K_Char ,
  yume::ast::K_Bool , yume::ast::K_String , yume::ast::K_Var , yume::ast::K_Const ,
  yume::ast::K_Call , yume::ast::K_BinaryLogic , yume::ast::K_Ctor , yume::ast::K_Dtor ,
  yume::ast::K_Slice , yume::ast::K_Lambda , yume::ast::K_Assign , yume::ast::K_FieldAccess ,
  yume::ast::K_ImplicitCast , yume::ast::K_TypeExpr , yume::ast::K_END_Expr , yume::ast::K_END_Stmt ,
  yume::ast::K_Type , yume::ast::K_SimpleType , yume::ast::K_QualType , yume::ast::K_TemplatedType ,
  yume::ast::K_FunctionType , yume::ast::K_SelfType , yume::ast::K_ProxyType , yume::ast::K_END_Type
}
 

Functions

auto constexpr yume::ast::kind_name (Kind type) -> const char *