![]() |
Spicy
|
#include <elements.h>
Public Member Functions | |
Block (std::vector< std::string > stmts) | |
void | addStatement (std::string stmt) |
void | addStatementAtFront (std::string stmt) |
void | addBlock (Block child) |
void | addComment (const std::string &stmt, bool sep_before=true, bool sep_after=false) |
void | addLocal (const declaration::Local &v) |
void | addTmp (const declaration::Local &v) |
void | addReturn (const Expression &expr=Expression()) |
void | addIf (const Expression &cond, Block true_) |
void | addIf (const Expression &init, const Expression &cond, cxx::Block true_) |
void | addIf (const Expression &cond, Block true_, Block false_) |
void | addIf (const Expression &init, const Expression &cond, Block true_, Block false_) |
void | addElseIf (const Expression &cond, Block true_) |
void | addElse (Block true_) |
void | addFor (const Expression &init, const Expression &cond, const Expression &next, const cxx::Block &body) |
void | addForRange (bool const_, const ID &id, const Expression &seq, const cxx::Block &body) |
void | addWhile (const Expression &cond, const Block &body) |
void | addLambda (const std::string &name, const std::string &signature, Block body) |
void | addSwitch (const Expression &cond, const std::vector< std::pair< Expression, Block >> &cases_, std::optional< Block > default_={}) |
void | appendFromBlock (Block b) |
void | addTry (Block body, std::vector< std::pair< declaration::Argument, Block >> catches) |
bool | ensureBracesForBlock () const |
void | setEnsureBracesforBlock () |
size_t | size (bool ignore_comments=false) const |
Block & | operator+= (const Block &other) |
operator bool () const | |
bool | operator== (const Block &other) const |
Friends | |
::hilti::detail::cxx::Formatter & | operator<< (Formatter &f, const Block &x) |
A C++ statement block.