#ifndef WILLOWC_INCLUDE_AST_HPP #define WILLOWC_INCLUDE_AST_HPP #include #include #include #include #include #include namespace willowc { using Opcode = willow::Instruction::Opcode; using TokenIndex = std::size_t; // this is like willow::ValueKind, but treats groups all ssa values into 'Value' // (because they can't be differentiated by syntax alone) enum class ExprKind { Constant, BasicBlock, Function, Value }; struct ExprAST { ExprKind kind; std::string name; // token?? }; struct InstAST { Opcode op; std::string name; std::vector> args; }; struct BlockAST { std::string label; std::vector> body; }; struct ParameterAST { std::string name; willow::Type type; }; struct FunctionDeclAST { std::string name; std::vector> parameters; std::string returntype; std::vector> body; // TODO: movable symbol table }; struct ModuleAST { std::vector> Functions; // TODO: imports, symbol table }; }; // namespace willowc #endif // WILLOWC_INCLUDE_AST_HPP