GCC Code Coverage Report


Directory: ../
File: src/visualizer/CSTVisualizer.h
Date: 2025-02-05 01:09:36
Exec Total Coverage
Lines: 84 90 93.3%
Functions: 83 89 93.3%
Branches: 167 358 46.6%

Line Branch Exec Source
1 // Copyright (c) 2021-2025 ChilliBits. All rights reserved.
2
3 #pragma once
4
5 #include <SpiceLexer.h>
6 #include <SpiceVisitor.h>
7
8 #include <CompilerPass.h>
9
10 namespace spice::compiler {
11
12 /**
13 * Visitor for debug purposes (is only executed in the compiler debug mode and when explicitly enabling it via cli flag)
14 *
15 * Jobs:
16 * - Visualize CST
17 */
18 class CSTVisualizer final : CompilerPass, public SpiceVisitor {
19 public:
20 // Constructors
21 630 CSTVisualizer(GlobalResourceManager &resourceManager, SourceFile *sourceFile, const SpiceLexer *lexer,
22 const SpiceParser *parser)
23
3/6
✓ Branch 0 (4→5) taken 630 times.
✗ Branch 1 (4→9) not taken.
✓ Branch 2 (5→6) taken 630 times.
✗ Branch 3 (5→9) not taken.
✓ Branch 4 (6→7) taken 630 times.
✗ Branch 5 (6→9) not taken.
630 : CompilerPass(resourceManager, sourceFile), vocabulary(lexer->getVocabulary()), ruleNames(parser->getRuleNames()) {}
24
25 // Visitor methods
26
2/4
✓ Branch 0 (2→3) taken 630 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 630 times.
✗ Branch 3 (3→8) not taken.
630 std::any visitEntry(SpiceParser::EntryContext *ctx) override { return buildRule(ctx); }
27
2/4
✓ Branch 0 (2→3) taken 8 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 8 times.
✗ Branch 3 (3→8) not taken.
8 std::any visitMainFunctionDef(SpiceParser::MainFunctionDefContext *ctx) override { return buildRule(ctx); }
28
2/4
✓ Branch 0 (2→3) taken 5884 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 5884 times.
✗ Branch 3 (3→8) not taken.
5884 std::any visitFunctionDef(SpiceParser::FunctionDefContext *ctx) override { return buildRule(ctx); }
29
2/4
✓ Branch 0 (2→3) taken 2864 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 2864 times.
✗ Branch 3 (3→8) not taken.
2864 std::any visitProcedureDef(SpiceParser::ProcedureDefContext *ctx) override { return buildRule(ctx); }
30
2/4
✓ Branch 0 (2→3) taken 8748 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 8748 times.
✗ Branch 3 (3→8) not taken.
8748 std::any visitFctName(SpiceParser::FctNameContext *ctx) override { return buildRule(ctx); }
31
2/4
✓ Branch 0 (2→3) taken 725 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 725 times.
✗ Branch 3 (3→8) not taken.
725 std::any visitGenericTypeDef(SpiceParser::GenericTypeDefContext *ctx) override { return buildRule(ctx); }
32
2/4
✓ Branch 0 (2→3) taken 41 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 41 times.
✗ Branch 3 (3→8) not taken.
41 std::any visitAliasDef(SpiceParser::AliasDefContext *ctx) override { return buildRule(ctx); }
33
2/4
✓ Branch 0 (2→3) taken 468 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 468 times.
✗ Branch 3 (3→8) not taken.
468 std::any visitStructDef(SpiceParser::StructDefContext *ctx) override { return buildRule(ctx); }
34
2/4
✓ Branch 0 (2→3) taken 67 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 67 times.
✗ Branch 3 (3→8) not taken.
67 std::any visitInterfaceDef(SpiceParser::InterfaceDefContext *ctx) override { return buildRule(ctx); }
35
2/4
✓ Branch 0 (2→3) taken 57 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 57 times.
✗ Branch 3 (3→8) not taken.
57 std::any visitEnumDef(SpiceParser::EnumDefContext *ctx) override { return buildRule(ctx); }
36
2/4
✓ Branch 0 (2→3) taken 741 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 741 times.
✗ Branch 3 (3→8) not taken.
741 std::any visitGlobalVarDef(SpiceParser::GlobalVarDefContext *ctx) override { return buildRule(ctx); }
37
2/4
✓ Branch 0 (2→3) taken 842 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 842 times.
✗ Branch 3 (3→8) not taken.
842 std::any visitExtDecl(SpiceParser::ExtDeclContext *ctx) override { return buildRule(ctx); }
38
2/4
✓ Branch 0 (2→3) taken 352 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 352 times.
✗ Branch 3 (3→8) not taken.
352 std::any visitImportDef(SpiceParser::ImportDefContext *ctx) override { return buildRule(ctx); }
39
2/4
✓ Branch 0 (2→3) taken 2072 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 2072 times.
✗ Branch 3 (3→8) not taken.
2072 std::any visitUnsafeBlock(SpiceParser::UnsafeBlockContext *ctx) override { return buildRule(ctx); }
40
2/4
✓ Branch 0 (2→3) taken 986 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 986 times.
✗ Branch 3 (3→8) not taken.
986 std::any visitForLoop(SpiceParser::ForLoopContext *ctx) override { return buildRule(ctx); }
41
2/4
✓ Branch 0 (2→3) taken 986 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 986 times.
✗ Branch 3 (3→8) not taken.
986 std::any visitForHead(SpiceParser::ForHeadContext *ctx) override { return buildRule(ctx); }
42
2/4
✓ Branch 0 (2→3) taken 49 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 49 times.
✗ Branch 3 (3→8) not taken.
49 std::any visitForeachLoop(SpiceParser::ForeachLoopContext *ctx) override { return buildRule(ctx); }
43
2/4
✓ Branch 0 (2→3) taken 49 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 49 times.
✗ Branch 3 (3→8) not taken.
49 std::any visitForeachHead(SpiceParser::ForeachHeadContext *ctx) override { return buildRule(ctx); }
44
2/4
✓ Branch 0 (2→3) taken 560 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 560 times.
✗ Branch 3 (3→8) not taken.
560 std::any visitWhileLoop(SpiceParser::WhileLoopContext *ctx) override { return buildRule(ctx); }
45
2/4
✓ Branch 0 (2→3) taken 3 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 3 times.
✗ Branch 3 (3→8) not taken.
3 std::any visitDoWhileLoop(SpiceParser::DoWhileLoopContext *ctx) override { return buildRule(ctx); }
46
2/4
✓ Branch 0 (2→3) taken 3335 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 3335 times.
✗ Branch 3 (3→8) not taken.
3335 std::any visitIfStmt(SpiceParser::IfStmtContext *ctx) override { return buildRule(ctx); }
47
2/4
✓ Branch 0 (2→3) taken 160 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 160 times.
✗ Branch 3 (3→8) not taken.
160 std::any visitElseStmt(SpiceParser::ElseStmtContext *ctx) override { return buildRule(ctx); }
48
2/4
✓ Branch 0 (2→3) taken 5 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 5 times.
✗ Branch 3 (3→8) not taken.
5 std::any visitSwitchStmt(SpiceParser::SwitchStmtContext *ctx) override { return buildRule(ctx); }
49
2/4
✓ Branch 0 (2→3) taken 31 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 31 times.
✗ Branch 3 (3→8) not taken.
31 std::any visitCaseBranch(SpiceParser::CaseBranchContext *ctx) override { return buildRule(ctx); }
50
2/4
✓ Branch 0 (2→3) taken 3 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 3 times.
✗ Branch 3 (3→8) not taken.
3 std::any visitDefaultBranch(SpiceParser::DefaultBranchContext *ctx) override { return buildRule(ctx); }
51
2/4
✓ Branch 0 (2→3) taken 78 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 78 times.
✗ Branch 3 (3→8) not taken.
78 std::any visitAssertStmt(SpiceParser::AssertStmtContext *ctx) override { return buildRule(ctx); }
52 std::any visitAnonymousBlockStmt(SpiceParser::AnonymousBlockStmtContext *ctx) override { return buildRule(ctx); }
53
2/4
✓ Branch 0 (2→3) taken 15911 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 15911 times.
✗ Branch 3 (3→8) not taken.
15911 std::any visitStmtLst(SpiceParser::StmtLstContext *ctx) override { return buildRule(ctx); }
54
2/4
✓ Branch 0 (2→3) taken 1061 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 1061 times.
✗ Branch 3 (3→8) not taken.
1061 std::any visitField(SpiceParser::FieldContext *ctx) override { return buildRule(ctx); }
55
2/4
✓ Branch 0 (2→3) taken 172 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 172 times.
✗ Branch 3 (3→8) not taken.
172 std::any visitSignature(SpiceParser::SignatureContext *ctx) override { return buildRule(ctx); }
56
2/4
✓ Branch 0 (2→3) taken 4758 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 4758 times.
✗ Branch 3 (3→8) not taken.
4758 std::any visitTypeLst(SpiceParser::TypeLstContext *ctx) override { return buildRule(ctx); }
57
2/4
✓ Branch 0 (2→3) taken 725 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 725 times.
✗ Branch 3 (3→8) not taken.
725 std::any visitTypeAltsLst(SpiceParser::TypeAltsLstContext *ctx) override { return buildRule(ctx); }
58
2/4
✓ Branch 0 (2→3) taken 6567 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 6567 times.
✗ Branch 3 (3→8) not taken.
6567 std::any visitParamLst(SpiceParser::ParamLstContext *ctx) override { return buildRule(ctx); }
59
2/4
✓ Branch 0 (2→3) taken 9263 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 9263 times.
✗ Branch 3 (3→8) not taken.
9263 std::any visitArgLst(SpiceParser::ArgLstContext *ctx) override { return buildRule(ctx); }
60
2/4
✓ Branch 0 (2→3) taken 57 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 57 times.
✗ Branch 3 (3→8) not taken.
57 std::any visitEnumItemLst(SpiceParser::EnumItemLstContext *ctx) override { return buildRule(ctx); }
61
2/4
✓ Branch 0 (2→3) taken 708 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 708 times.
✗ Branch 3 (3→8) not taken.
708 std::any visitEnumItem(SpiceParser::EnumItemContext *ctx) override { return buildRule(ctx); }
62
2/4
✓ Branch 0 (2→3) taken 21138 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 21138 times.
✗ Branch 3 (3→8) not taken.
21138 std::any visitStmt(SpiceParser::StmtContext *ctx) override { return buildRule(ctx); }
63
2/4
✓ Branch 0 (2→3) taken 14968 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 14968 times.
✗ Branch 3 (3→8) not taken.
14968 std::any visitDeclStmt(SpiceParser::DeclStmtContext *ctx) override { return buildRule(ctx); }
64
2/4
✓ Branch 0 (2→3) taken 9653 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 9653 times.
✗ Branch 3 (3→8) not taken.
9653 std::any visitExprStmt(SpiceParser::ExprStmtContext *ctx) override { return buildRule(ctx); }
65
2/4
✓ Branch 0 (2→3) taken 23474 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 23474 times.
✗ Branch 3 (3→8) not taken.
23474 std::any visitQualifierLst(SpiceParser::QualifierLstContext *ctx) override { return buildRule(ctx); }
66
2/4
✓ Branch 0 (2→3) taken 28147 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 28147 times.
✗ Branch 3 (3→8) not taken.
28147 std::any visitQualifier(SpiceParser::QualifierContext *ctx) override { return buildRule(ctx); }
67
2/4
✓ Branch 0 (2→3) taken 292 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 292 times.
✗ Branch 3 (3→8) not taken.
292 std::any visitModAttr(SpiceParser::ModAttrContext *ctx) override { return buildRule(ctx); }
68
2/4
✓ Branch 0 (2→3) taken 422 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 422 times.
✗ Branch 3 (3→8) not taken.
422 std::any visitTopLevelDefAttr(SpiceParser::TopLevelDefAttrContext *ctx) override { return buildRule(ctx); }
69
2/4
✓ Branch 0 (2→3) taken 1 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 1 times.
✗ Branch 3 (3→8) not taken.
1 std::any visitLambdaAttr(SpiceParser::LambdaAttrContext *ctx) override { return buildRule(ctx); }
70
2/4
✓ Branch 0 (2→3) taken 715 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 715 times.
✗ Branch 3 (3→8) not taken.
715 std::any visitAttrLst(SpiceParser::AttrLstContext *ctx) override { return buildRule(ctx); }
71
2/4
✓ Branch 0 (2→3) taken 1150 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 1150 times.
✗ Branch 3 (3→8) not taken.
1150 std::any visitAttr(SpiceParser::AttrContext *ctx) override { return buildRule(ctx); }
72
2/4
✓ Branch 0 (2→3) taken 48 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 48 times.
✗ Branch 3 (3→8) not taken.
48 std::any visitCaseConstant(SpiceParser::CaseConstantContext *ctx) override { return buildRule(ctx); }
73
2/4
✓ Branch 0 (2→3) taken 7417 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 7417 times.
✗ Branch 3 (3→8) not taken.
7417 std::any visitReturnStmt(SpiceParser::ReturnStmtContext *ctx) override { return buildRule(ctx); }
74
2/4
✓ Branch 0 (2→3) taken 96 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 96 times.
✗ Branch 3 (3→8) not taken.
96 std::any visitBreakStmt(SpiceParser::BreakStmtContext *ctx) override { return buildRule(ctx); }
75
2/4
✓ Branch 0 (2→3) taken 172 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 172 times.
✗ Branch 3 (3→8) not taken.
172 std::any visitContinueStmt(SpiceParser::ContinueStmtContext *ctx) override { return buildRule(ctx); }
76 std::any visitFallthroughStmt(SpiceParser::FallthroughStmtContext *ctx) override { return buildRule(ctx); }
77
2/4
✓ Branch 0 (2→3) taken 1045 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 1045 times.
✗ Branch 3 (3→8) not taken.
1045 std::any visitBuiltinCall(SpiceParser::BuiltinCallContext *ctx) override { return buildRule(ctx); }
78
2/4
✓ Branch 0 (2→3) taken 158 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 158 times.
✗ Branch 3 (3→8) not taken.
158 std::any visitPrintfCall(SpiceParser::PrintfCallContext *ctx) override { return buildRule(ctx); }
79
2/4
✓ Branch 0 (2→3) taken 184 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 184 times.
✗ Branch 3 (3→8) not taken.
184 std::any visitSizeOfCall(SpiceParser::SizeOfCallContext *ctx) override { return buildRule(ctx); }
80 std::any visitAlignOfCall(SpiceParser::AlignOfCallContext *ctx) override { return buildRule(ctx); }
81
2/4
✓ Branch 0 (2→3) taken 18 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 18 times.
✗ Branch 3 (3→8) not taken.
18 std::any visitLenCall(SpiceParser::LenCallContext *ctx) override { return buildRule(ctx); }
82
2/4
✓ Branch 0 (2→3) taken 685 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 685 times.
✗ Branch 3 (3→8) not taken.
685 std::any visitPanicCall(SpiceParser::PanicCallContext *ctx) override { return buildRule(ctx); }
83 std::any visitSysCall(SpiceParser::SysCallContext *ctx) override { return buildRule(ctx); }
84
2/4
✓ Branch 0 (2→3) taken 52226 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 52226 times.
✗ Branch 3 (3→8) not taken.
52226 std::any visitAssignExpr(SpiceParser::AssignExprContext *ctx) override { return buildRule(ctx); }
85
2/4
✓ Branch 0 (2→3) taken 46758 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 46758 times.
✗ Branch 3 (3→8) not taken.
46758 std::any visitTernaryExpr(SpiceParser::TernaryExprContext *ctx) override { return buildRule(ctx); }
86
2/4
✓ Branch 0 (2→3) taken 47268 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 47268 times.
✗ Branch 3 (3→8) not taken.
47268 std::any visitLogicalOrExpr(SpiceParser::LogicalOrExprContext *ctx) override { return buildRule(ctx); }
87
2/4
✓ Branch 0 (2→3) taken 48367 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 48367 times.
✗ Branch 3 (3→8) not taken.
48367 std::any visitLogicalAndExpr(SpiceParser::LogicalAndExprContext *ctx) override { return buildRule(ctx); }
88
2/4
✓ Branch 0 (2→3) taken 48576 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 48576 times.
✗ Branch 3 (3→8) not taken.
48576 std::any visitBitwiseOrExpr(SpiceParser::BitwiseOrExprContext *ctx) override { return buildRule(ctx); }
89
2/4
✓ Branch 0 (2→3) taken 48635 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 48635 times.
✗ Branch 3 (3→8) not taken.
48635 std::any visitBitwiseXorExpr(SpiceParser::BitwiseXorExprContext *ctx) override { return buildRule(ctx); }
90
2/4
✓ Branch 0 (2→3) taken 48635 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 48635 times.
✗ Branch 3 (3→8) not taken.
48635 std::any visitBitwiseAndExpr(SpiceParser::BitwiseAndExprContext *ctx) override { return buildRule(ctx); }
91
2/4
✓ Branch 0 (2→3) taken 48655 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 48655 times.
✗ Branch 3 (3→8) not taken.
48655 std::any visitEqualityExpr(SpiceParser::EqualityExprContext *ctx) override { return buildRule(ctx); }
92
2/4
✓ Branch 0 (2→3) taken 52583 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 52583 times.
✗ Branch 3 (3→8) not taken.
52583 std::any visitRelationalExpr(SpiceParser::RelationalExprContext *ctx) override { return buildRule(ctx); }
93
2/4
✓ Branch 0 (2→3) taken 55424 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 55424 times.
✗ Branch 3 (3→8) not taken.
55424 std::any visitShiftExpr(SpiceParser::ShiftExprContext *ctx) override { return buildRule(ctx); }
94
2/4
✓ Branch 0 (2→3) taken 55461 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 55461 times.
✗ Branch 3 (3→8) not taken.
55461 std::any visitAdditiveExpr(SpiceParser::AdditiveExprContext *ctx) override { return buildRule(ctx); }
95
2/4
✓ Branch 0 (2→3) taken 58590 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 58590 times.
✗ Branch 3 (3→8) not taken.
58590 std::any visitMultiplicativeExpr(SpiceParser::MultiplicativeExprContext *ctx) override { return buildRule(ctx); }
96
2/4
✓ Branch 0 (2→3) taken 59680 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 59680 times.
✗ Branch 3 (3→8) not taken.
59680 std::any visitCastExpr(SpiceParser::CastExprContext *ctx) override { return buildRule(ctx); }
97
2/4
✓ Branch 0 (2→3) taken 66143 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 66143 times.
✗ Branch 3 (3→8) not taken.
66143 std::any visitPrefixUnaryExpr(SpiceParser::PrefixUnaryExprContext *ctx) override { return buildRule(ctx); }
98
2/4
✓ Branch 0 (2→3) taken 84230 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 84230 times.
✗ Branch 3 (3→8) not taken.
84230 std::any visitPostfixUnaryExpr(SpiceParser::PostfixUnaryExprContext *ctx) override { return buildRule(ctx); }
99
2/4
✓ Branch 0 (2→3) taken 65273 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 65273 times.
✗ Branch 3 (3→8) not taken.
65273 std::any visitAtomicExpr(SpiceParser::AtomicExprContext *ctx) override { return buildRule(ctx); }
100
2/4
✓ Branch 0 (2→3) taken 12588 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 12588 times.
✗ Branch 3 (3→8) not taken.
12588 std::any visitValue(SpiceParser::ValueContext *ctx) override { return buildRule(ctx); }
101
2/4
✓ Branch 0 (2→3) taken 11527 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 11527 times.
✗ Branch 3 (3→8) not taken.
11527 std::any visitFctCall(SpiceParser::FctCallContext *ctx) override { return buildRule(ctx); }
102
2/4
✓ Branch 0 (2→3) taken 5 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 5 times.
✗ Branch 3 (3→8) not taken.
5 std::any visitArrayInitialization(SpiceParser::ArrayInitializationContext *ctx) override { return buildRule(ctx); }
103
2/4
✓ Branch 0 (2→3) taken 155 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 155 times.
✗ Branch 3 (3→8) not taken.
155 std::any visitStructInstantiation(SpiceParser::StructInstantiationContext *ctx) override { return buildRule(ctx); }
104 std::any visitLambdaFunc(SpiceParser::LambdaFuncContext *ctx) override { return buildRule(ctx); }
105
2/4
✓ Branch 0 (2→3) taken 2 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 2 times.
✗ Branch 3 (3→8) not taken.
2 std::any visitLambdaProc(SpiceParser::LambdaProcContext *ctx) override { return buildRule(ctx); }
106 std::any visitLambdaExpr(SpiceParser::LambdaExprContext *ctx) override { return buildRule(ctx); }
107
2/4
✓ Branch 0 (2→3) taken 12053 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 12053 times.
✗ Branch 3 (3→8) not taken.
12053 std::any visitConstant(SpiceParser::ConstantContext *ctx) override { return buildRule(ctx); }
108
2/4
✓ Branch 0 (2→3) taken 34665 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 34665 times.
✗ Branch 3 (3→8) not taken.
34665 std::any visitDataType(SpiceParser::DataTypeContext *ctx) override { return buildRule(ctx); }
109
2/4
✓ Branch 0 (2→3) taken 34665 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 34665 times.
✗ Branch 3 (3→8) not taken.
34665 std::any visitBaseDataType(SpiceParser::BaseDataTypeContext *ctx) override { return buildRule(ctx); }
110
2/4
✓ Branch 0 (2→3) taken 12521 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 12521 times.
✗ Branch 3 (3→8) not taken.
12521 std::any visitCustomDataType(SpiceParser::CustomDataTypeContext *ctx) override { return buildRule(ctx); }
111
2/4
✓ Branch 0 (2→3) taken 56 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 56 times.
✗ Branch 3 (3→8) not taken.
56 std::any visitFunctionDataType(SpiceParser::FunctionDataTypeContext *ctx) override { return buildRule(ctx); }
112
2/4
✓ Branch 0 (2→3) taken 5593 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 5593 times.
✗ Branch 3 (3→8) not taken.
5593 std::any visitAssignOp(SpiceParser::AssignOpContext *ctx) override { return buildRule(ctx); }
113
2/4
✓ Branch 0 (2→3) taken 1488 times.
✗ Branch 1 (2→10) not taken.
✓ Branch 2 (3→4) taken 1488 times.
✗ Branch 3 (3→8) not taken.
1488 std::any visitOverloadableOp(SpiceParser::OverloadableOpContext *ctx) override { return buildRule(ctx); }
114
115 private:
116 // Members
117 const antlr4::dfa::Vocabulary &vocabulary;
118 const std::vector<std::string> ruleNames;
119 int currentTabs = 1;
120 std::string parentNodeId;
121
122 // Private methods
123 std::string buildRule(antlr4::ParserRuleContext *ctx);
124 [[nodiscard]] std::string getSpaces() const;
125 [[nodiscard]] static std::string tokenToCodeLoc(const antlr4::Token &token);
126 };
127
128 } // namespace spice::compiler
129