From 8b86d07bfca3f9182fea2242de4c3227544401d8 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Tue, 20 Aug 2024 16:00:10 +0800 Subject: [PATCH] llcppg/ast:func decl --- chore/llcppg/ast/ast.go | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/chore/llcppg/ast/ast.go b/chore/llcppg/ast/ast.go index 9b18f3fc..3c9090fb 100644 --- a/chore/llcppg/ast/ast.go +++ b/chore/llcppg/ast/ast.go @@ -43,6 +43,16 @@ type PPD interface { // preprocessing directive ppdNode() } +// ============================================================================= +type AccessSpecifier uint + +const ( + Invalid AccessSpecifier = iota + Public + Protected + Private +) + // ============================================================================= // Expressions (Types are also expressions) @@ -274,8 +284,18 @@ func (*EnumTypeDecl) declNode() {} // Ret Name(Params); type FuncDecl struct { DeclBase - Name *Ident - Type *FuncType + Name *Ident + Type *FuncType + IsInline bool + IsStatic bool + + // Class method specific fields + IsConst bool // const member function + IsExplicit bool // explicit constructor + IsConstructor bool + IsDestructor bool + IsVirtual bool + IsOverride bool } func (*FuncDecl) declNode() {}