GCC Code Coverage Report


Directory: ../
File: src/ast/ParallelizableASTVisitor.h
Date: 2024-12-24 01:17:15
Exec Total Coverage
Lines: 1 1 100.0%
Functions: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 // Copyright (c) 2021-2024 ChilliBits. All rights reserved.
2
3 #pragma once
4
5 #include <any>
6
7 namespace spice::compiler {
8
9 // Forward declarations
10 class ASTNode;
11 class EntryNode;
12 class MainFctDefNode;
13 class FctNameNode;
14 class FctDefNode;
15 class ProcDefNode;
16 class StructDefNode;
17 class InterfaceDefNode;
18 class EnumDefNode;
19 class GenericTypeDefNode;
20 class AliasDefNode;
21 class GlobalVarDefNode;
22 class ExtDeclNode;
23 class UnsafeBlockNode;
24 class ForLoopNode;
25 class ForeachLoopNode;
26 class WhileLoopNode;
27 class DoWhileLoopNode;
28 class IfStmtNode;
29 class ElseStmtNode;
30 class SwitchStmtNode;
31 class CaseBranchNode;
32 class DefaultBranchNode;
33 class AssertStmtNode;
34 class AnonymousBlockStmtNode;
35 class StmtLstNode;
36 class TypeLstNode;
37 class TypeAltsLstNode;
38 class ParamLstNode;
39 class ArgLstNode;
40 class EnumItemLstNode;
41 class EnumItemNode;
42 class FieldNode;
43 class SignatureNode;
44 class DeclStmtNode;
45 class ExprStmtNode;
46 class SpecifierLstNode;
47 class SpecifierNode;
48 class ModAttrNode;
49 class TopLevelDefinitionAttrNode;
50 class LambdaAttrNode;
51 class AttrLstNode;
52 class AttrNode;
53 class CaseConstantNode;
54 class ImportDefNode;
55 class ReturnStmtNode;
56 class BreakStmtNode;
57 class ContinueStmtNode;
58 class FallthroughStmtNode;
59 class BuiltinCallNode;
60 class PrintfCallNode;
61 class SizeofCallNode;
62 class AlignofCallNode;
63 class LenCallNode;
64 class PanicCallNode;
65 class SysCallNode;
66 class AssignExprNode;
67 class TernaryExprNode;
68 class LogicalOrExprNode;
69 class LogicalAndExprNode;
70 class BitwiseOrExprNode;
71 class BitwiseXorExprNode;
72 class BitwiseAndExprNode;
73 class EqualityExprNode;
74 class RelationalExprNode;
75 class ShiftExprNode;
76 class AdditiveExprNode;
77 class MultiplicativeExprNode;
78 class CastExprNode;
79 class PrefixUnaryExprNode;
80 class PostfixUnaryExprNode;
81 class AtomicExprNode;
82 class ValueNode;
83 class ConstantNode;
84 class FctCallNode;
85 class ArrayInitializationNode;
86 class StructInstantiationNode;
87 class LambdaFuncNode;
88 class LambdaProcNode;
89 class LambdaExprNode;
90 class DataTypeNode;
91 class BaseDataTypeNode;
92 class CustomDataTypeNode;
93 class FunctionDataTypeNode;
94
95 class ParallelizableASTVisitor {
96 public:
97 // Destructor
98 1356 virtual ~ParallelizableASTVisitor() = default;
99
100 // General visitor method
101 std::any visit(const ASTNode *node);
102 std::any visitChildren(const ASTNode *node);
103
104 // Visitor methods
105 virtual std::any visitEntry(const EntryNode *node);
106 virtual std::any visitMainFctDef(const MainFctDefNode *node);
107 virtual std::any visitFctDef(const FctDefNode *node);
108 virtual std::any visitProcDef(const ProcDefNode *node);
109 virtual std::any visitFctName(const FctNameNode *node);
110 virtual std::any visitStructDef(const StructDefNode *node);
111 virtual std::any visitInterfaceDef(const InterfaceDefNode *node);
112 virtual std::any visitEnumDef(const EnumDefNode *node);
113 virtual std::any visitGenericTypeDef(const GenericTypeDefNode *node);
114 virtual std::any visitAliasDef(const AliasDefNode *node);
115 virtual std::any visitGlobalVarDef(const GlobalVarDefNode *node);
116 virtual std::any visitExtDecl(const ExtDeclNode *node);
117 virtual std::any visitImportDef(const ImportDefNode *node);
118 virtual std::any visitUnsafeBlockDef(const UnsafeBlockNode *node);
119 virtual std::any visitForLoop(const ForLoopNode *node);
120 virtual std::any visitForeachLoop(const ForeachLoopNode *node);
121 virtual std::any visitWhileLoop(const WhileLoopNode *node);
122 virtual std::any visitDoWhileLoop(const DoWhileLoopNode *node);
123 virtual std::any visitIfStmt(const IfStmtNode *node);
124 virtual std::any visitElseStmt(const ElseStmtNode *node);
125 virtual std::any visitSwitchStmt(const SwitchStmtNode *node);
126 virtual std::any visitCaseBranch(const CaseBranchNode *node);
127 virtual std::any visitDefaultBranch(const DefaultBranchNode *node);
128 virtual std::any visitAnonymousBlockStmt(const AnonymousBlockStmtNode *node);
129 virtual std::any visitStmtLst(const StmtLstNode *node);
130 virtual std::any visitTypeLst(const TypeLstNode *node);
131 virtual std::any visitTypeAltsLst(const TypeAltsLstNode *node);
132 virtual std::any visitParamLst(const ParamLstNode *node);
133 virtual std::any visitArgLst(const ArgLstNode *node);
134 virtual std::any visitEnumItemLst(const EnumItemLstNode *node);
135 virtual std::any visitEnumItem(const EnumItemNode *node);
136 virtual std::any visitField(const FieldNode *node);
137 virtual std::any visitSignature(const SignatureNode *node);
138 virtual std::any visitDeclStmt(const DeclStmtNode *node);
139 virtual std::any visitExprStmt(const ExprStmtNode *node);
140 virtual std::any visitSpecifierLst(const SpecifierLstNode *node);
141 virtual std::any visitSpecifier(const SpecifierNode *node);
142 virtual std::any visitModAttr(const ModAttrNode *node);
143 virtual std::any visitTopLevelDefinitionAttr(const TopLevelDefinitionAttrNode *node);
144 virtual std::any visitLambdaAttr(const LambdaAttrNode *node);
145 virtual std::any visitAttrLst(const AttrLstNode *node);
146 virtual std::any visitAttr(const AttrNode *node);
147 virtual std::any visitCaseConstant(const CaseConstantNode *node);
148 virtual std::any visitReturnStmt(const ReturnStmtNode *node);
149 virtual std::any visitBreakStmt(const BreakStmtNode *node);
150 virtual std::any visitContinueStmt(const ContinueStmtNode *node);
151 virtual std::any visitFallthroughStmt(const FallthroughStmtNode *node);
152 virtual std::any visitAssertStmt(const AssertStmtNode *node);
153 virtual std::any visitBuiltinCall(const BuiltinCallNode *node);
154 virtual std::any visitPrintfCall(const PrintfCallNode *node);
155 virtual std::any visitSizeofCall(const SizeofCallNode *node);
156 virtual std::any visitAlignofCall(const AlignofCallNode *node);
157 virtual std::any visitLenCall(const LenCallNode *node);
158 virtual std::any visitPanicCall(const PanicCallNode *node);
159 virtual std::any visitSysCall(const SysCallNode *node);
160 virtual std::any visitAssignExpr(const AssignExprNode *node);
161 virtual std::any visitTernaryExpr(const TernaryExprNode *node);
162 virtual std::any visitLogicalOrExpr(const LogicalOrExprNode *node);
163 virtual std::any visitLogicalAndExpr(const LogicalAndExprNode *node);
164 virtual std::any visitBitwiseOrExpr(const BitwiseOrExprNode *node);
165 virtual std::any visitBitwiseXorExpr(const BitwiseXorExprNode *node);
166 virtual std::any visitBitwiseAndExpr(const BitwiseAndExprNode *node);
167 virtual std::any visitEqualityExpr(const EqualityExprNode *node);
168 virtual std::any visitRelationalExpr(const RelationalExprNode *node);
169 virtual std::any visitShiftExpr(const ShiftExprNode *node);
170 virtual std::any visitAdditiveExpr(const AdditiveExprNode *node);
171 virtual std::any visitMultiplicativeExpr(const MultiplicativeExprNode *node);
172 virtual std::any visitCastExpr(const CastExprNode *node);
173 virtual std::any visitPrefixUnaryExpr(const PrefixUnaryExprNode *node);
174 virtual std::any visitPostfixUnaryExpr(const PostfixUnaryExprNode *node);
175 virtual std::any visitAtomicExpr(const AtomicExprNode *node);
176 virtual std::any visitValue(const ValueNode *node);
177 virtual std::any visitConstant(const ConstantNode *node);
178 virtual std::any visitFctCall(const FctCallNode *node);
179 virtual std::any visitArrayInitialization(const ArrayInitializationNode *node);
180 virtual std::any visitStructInstantiation(const StructInstantiationNode *node);
181 virtual std::any visitLambdaFunc(const LambdaFuncNode *node);
182 virtual std::any visitLambdaProc(const LambdaProcNode *node);
183 virtual std::any visitLambdaExpr(const LambdaExprNode *node);
184 virtual std::any visitDataType(const DataTypeNode *node);
185 virtual std::any visitBaseDataType(const BaseDataTypeNode *node);
186 virtual std::any visitCustomDataType(const CustomDataTypeNode *node);
187 virtual std::any visitFunctionDataType(const FunctionDataTypeNode *node);
188 };
189
190 } // namespace spice::compiler
191