binpac: Reformat C++ code in Spicy style

This commit is contained in:
Tim Wojtulewicz 2023-10-30 13:15:14 -07:00
parent 716bf016a1
commit 3297de477b
89 changed files with 7887 additions and 9733 deletions

View file

@ -4,65 +4,62 @@
#include "pac_analyzer.h"
#include "pac_decl.h"
class Function : public Object
{
class Function : public Object {
public:
Function(ID* id, Type* type, ParamList* params);
~Function();
Function(ID* id, Type* type, ParamList* params);
~Function();
ID* id() const { return id_; }
ID* id() const { return id_; }
AnalyzerDecl* analyzer_decl() const { return analyzer_decl_; }
void set_analyzer_decl(AnalyzerDecl* decl) { analyzer_decl_ = decl; }
AnalyzerDecl* analyzer_decl() const { return analyzer_decl_; }
void set_analyzer_decl(AnalyzerDecl* decl) { analyzer_decl_ = decl; }
Expr* expr() const { return expr_; }
void set_expr(Expr* expr) { expr_ = expr; }
Expr* expr() const { return expr_; }
void set_expr(Expr* expr) { expr_ = expr; }
EmbeddedCode* code() const { return code_; }
void set_code(EmbeddedCode* code) { code_ = code; }
EmbeddedCode* code() const { return code_; }
void set_code(EmbeddedCode* code) { code_ = code; }
void Prepare(Env* env);
void GenForwardDeclaration(Output* out_h);
void GenCode(Output* out_h, Output* out_cc);
void Prepare(Env* env);
void GenForwardDeclaration(Output* out_h);
void GenCode(Output* out_h, Output* out_cc);
private:
Env* env_;
Env* env_;
ID* id_;
Type* type_;
ParamList* params_;
ID* id_;
Type* type_;
ParamList* params_;
AnalyzerDecl* analyzer_decl_;
AnalyzerDecl* analyzer_decl_;
Expr* expr_;
EmbeddedCode* code_;
};
Expr* expr_;
EmbeddedCode* code_;
};
class FuncDecl : public Decl
{
class FuncDecl : public Decl {
public:
FuncDecl(Function* function);
~FuncDecl() override;
FuncDecl(Function* function);
~FuncDecl() override;
Function* function() const { return function_; }
Function* function() const { return function_; }
void Prepare() override;
void GenForwardDeclaration(Output* out_h) override;
void GenCode(Output* out_h, Output* out_cc) override;
void Prepare() override;
void GenForwardDeclaration(Output* out_h) override;
void GenCode(Output* out_h, Output* out_cc) override;
private:
Function* function_;
};
Function* function_;
};
class AnalyzerFunction : public AnalyzerElement
{
class AnalyzerFunction : public AnalyzerElement {
public:
AnalyzerFunction(Function* function);
AnalyzerFunction(Function* function);
Function* function() const { return function_; }
Function* function() const { return function_; }
private:
Function* function_;
};
Function* function_;
};
#endif // pac_func_h