GCC Code Coverage Report


Directory: ../
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 94.0% 79 / 0 / 84
Functions: 94.0% 78 / 0 / 83
Branches: 47.0% 157 / 0 / 334

src/visualizer/CSTVisualizer.h
Line Branch Exec Source
1 // Copyright (c) 2021-2026 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 804 CSTVisualizer(GlobalResourceManager &resourceManager, SourceFile *sourceFile, const SpiceLexer *lexer,
22 const SpiceParser *parser)
23
3/6
✓ Branch 4 → 5 taken 804 times.
✗ Branch 4 → 9 not taken.
✓ Branch 5 → 6 taken 804 times.
✗ Branch 5 → 9 not taken.
✓ Branch 6 → 7 taken 804 times.
✗ Branch 6 → 9 not taken.
804 : CompilerPass(resourceManager, sourceFile), vocabulary(lexer->getVocabulary()), ruleNames(parser->getRuleNames()) {}
24
25 // Visitor methods
26
2/4
✓ Branch 2 → 3 taken 804 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 804 times.
✗ Branch 3 → 8 not taken.
804 std::any visitEntry(SpiceParser::EntryContext *ctx) override { return buildRule(ctx); }
27
2/4
✓ Branch 2 → 3 taken 8 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 8 times.
✗ Branch 3 → 8 not taken.
8 std::any visitMainFunctionDef(SpiceParser::MainFunctionDefContext *ctx) override { return buildRule(ctx); }
28
2/4
✓ Branch 2 → 3 taken 8262 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 8262 times.
✗ Branch 3 → 8 not taken.
8262 std::any visitFunctionDef(SpiceParser::FunctionDefContext *ctx) override { return buildRule(ctx); }
29
2/4
✓ Branch 2 → 3 taken 4119 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 4119 times.
✗ Branch 3 → 8 not taken.
4119 std::any visitProcedureDef(SpiceParser::ProcedureDefContext *ctx) override { return buildRule(ctx); }
30
2/4
✓ Branch 2 → 3 taken 12381 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 12381 times.
✗ Branch 3 → 8 not taken.
12381 std::any visitFctName(SpiceParser::FctNameContext *ctx) override { return buildRule(ctx); }
31
2/4
✓ Branch 2 → 3 taken 957 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 957 times.
✗ Branch 3 → 8 not taken.
957 std::any visitGenericTypeDef(SpiceParser::GenericTypeDefContext *ctx) override { return buildRule(ctx); }
32
2/4
✓ Branch 2 → 3 taken 100 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 100 times.
✗ Branch 3 → 8 not taken.
100 std::any visitAliasDef(SpiceParser::AliasDefContext *ctx) override { return buildRule(ctx); }
33
2/4
✓ Branch 2 → 3 taken 618 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 618 times.
✗ Branch 3 → 8 not taken.
618 std::any visitStructDef(SpiceParser::StructDefContext *ctx) override { return buildRule(ctx); }
34
2/4
✓ Branch 2 → 3 taken 90 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 90 times.
✗ Branch 3 → 8 not taken.
90 std::any visitInterfaceDef(SpiceParser::InterfaceDefContext *ctx) override { return buildRule(ctx); }
35
2/4
✓ Branch 2 → 3 taken 69 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 69 times.
✗ Branch 3 → 8 not taken.
69 std::any visitEnumDef(SpiceParser::EnumDefContext *ctx) override { return buildRule(ctx); }
36
2/4
✓ Branch 2 → 3 taken 1236 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1236 times.
✗ Branch 3 → 8 not taken.
1236 std::any visitGlobalVarDef(SpiceParser::GlobalVarDefContext *ctx) override { return buildRule(ctx); }
37
2/4
✓ Branch 2 → 3 taken 1091 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1091 times.
✗ Branch 3 → 8 not taken.
1091 std::any visitExtDecl(SpiceParser::ExtDeclContext *ctx) override { return buildRule(ctx); }
38
2/4
✓ Branch 2 → 3 taken 493 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 493 times.
✗ Branch 3 → 8 not taken.
493 std::any visitImportDef(SpiceParser::ImportDefContext *ctx) override { return buildRule(ctx); }
39
2/4
✓ Branch 2 → 3 taken 2722 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 2722 times.
✗ Branch 3 → 8 not taken.
2722 std::any visitUnsafeBlock(SpiceParser::UnsafeBlockContext *ctx) override { return buildRule(ctx); }
40
2/4
✓ Branch 2 → 3 taken 1421 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1421 times.
✗ Branch 3 → 8 not taken.
1421 std::any visitForLoop(SpiceParser::ForLoopContext *ctx) override { return buildRule(ctx); }
41
2/4
✓ Branch 2 → 3 taken 1421 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1421 times.
✗ Branch 3 → 8 not taken.
1421 std::any visitForHead(SpiceParser::ForHeadContext *ctx) override { return buildRule(ctx); }
42
2/4
✓ Branch 2 → 3 taken 76 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 76 times.
✗ Branch 3 → 8 not taken.
76 std::any visitForeachLoop(SpiceParser::ForeachLoopContext *ctx) override { return buildRule(ctx); }
43
2/4
✓ Branch 2 → 3 taken 76 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 76 times.
✗ Branch 3 → 8 not taken.
76 std::any visitForeachHead(SpiceParser::ForeachHeadContext *ctx) override { return buildRule(ctx); }
44
2/4
✓ Branch 2 → 3 taken 823 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 823 times.
✗ Branch 3 → 8 not taken.
823 std::any visitWhileLoop(SpiceParser::WhileLoopContext *ctx) override { return buildRule(ctx); }
45
2/4
✓ Branch 2 → 3 taken 2 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 2 times.
✗ Branch 3 → 8 not taken.
2 std::any visitDoWhileLoop(SpiceParser::DoWhileLoopContext *ctx) override { return buildRule(ctx); }
46
2/4
✓ Branch 2 → 3 taken 4380 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 4380 times.
✗ Branch 3 → 8 not taken.
4380 std::any visitIfStmt(SpiceParser::IfStmtContext *ctx) override { return buildRule(ctx); }
47
2/4
✓ Branch 2 → 3 taken 238 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 238 times.
✗ Branch 3 → 8 not taken.
238 std::any visitElseStmt(SpiceParser::ElseStmtContext *ctx) override { return buildRule(ctx); }
48
2/4
✓ Branch 2 → 3 taken 5 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 5 times.
✗ Branch 3 → 8 not taken.
5 std::any visitSwitchStmt(SpiceParser::SwitchStmtContext *ctx) override { return buildRule(ctx); }
49
2/4
✓ Branch 2 → 3 taken 31 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 31 times.
✗ Branch 3 → 8 not taken.
31 std::any visitCaseBranch(SpiceParser::CaseBranchContext *ctx) override { return buildRule(ctx); }
50
2/4
✓ Branch 2 → 3 taken 3 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 3 times.
✗ Branch 3 → 8 not taken.
3 std::any visitDefaultBranch(SpiceParser::DefaultBranchContext *ctx) override { return buildRule(ctx); }
51
2/4
✓ Branch 2 → 3 taken 117 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 117 times.
✗ Branch 3 → 8 not taken.
117 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 2 → 3 taken 22019 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 22019 times.
✗ Branch 3 → 8 not taken.
22019 std::any visitStmtLst(SpiceParser::StmtLstContext *ctx) override { return buildRule(ctx); }
54
2/4
✓ Branch 2 → 3 taken 1363 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1363 times.
✗ Branch 3 → 8 not taken.
1363 std::any visitField(SpiceParser::FieldContext *ctx) override { return buildRule(ctx); }
55
2/4
✓ Branch 2 → 3 taken 225 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 225 times.
✗ Branch 3 → 8 not taken.
225 std::any visitSignature(SpiceParser::SignatureContext *ctx) override { return buildRule(ctx); }
56
2/4
✓ Branch 2 → 3 taken 7328 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 7328 times.
✗ Branch 3 → 8 not taken.
7328 std::any visitTypeLst(SpiceParser::TypeLstContext *ctx) override { return buildRule(ctx); }
57
2/4
✓ Branch 2 → 3 taken 1051 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1051 times.
✗ Branch 3 → 8 not taken.
1051 std::any visitTypeLstWithEllipsis(SpiceParser::TypeLstWithEllipsisContext *ctx) override { return buildRule(ctx); }
58
2/4
✓ Branch 2 → 3 taken 957 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 957 times.
✗ Branch 3 → 8 not taken.
957 std::any visitTypeAltsLst(SpiceParser::TypeAltsLstContext *ctx) override { return buildRule(ctx); }
59
2/4
✓ Branch 2 → 3 taken 9519 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 9519 times.
✗ Branch 3 → 8 not taken.
9519 std::any visitParamLst(SpiceParser::ParamLstContext *ctx) override { return buildRule(ctx); }
60
2/4
✓ Branch 2 → 3 taken 13693 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 13693 times.
✗ Branch 3 → 8 not taken.
13693 std::any visitArgLst(SpiceParser::ArgLstContext *ctx) override { return buildRule(ctx); }
61
2/4
✓ Branch 2 → 3 taken 69 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 69 times.
✗ Branch 3 → 8 not taken.
69 std::any visitEnumItemLst(SpiceParser::EnumItemLstContext *ctx) override { return buildRule(ctx); }
62
2/4
✓ Branch 2 → 3 taken 1160 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1160 times.
✗ Branch 3 → 8 not taken.
1160 std::any visitEnumItem(SpiceParser::EnumItemContext *ctx) override { return buildRule(ctx); }
63
2/4
✓ Branch 2 → 3 taken 28998 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 28998 times.
✗ Branch 3 → 8 not taken.
28998 std::any visitStmt(SpiceParser::StmtContext *ctx) override { return buildRule(ctx); }
64
2/4
✓ Branch 2 → 3 taken 20784 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 20784 times.
✗ Branch 3 → 8 not taken.
20784 std::any visitDeclStmt(SpiceParser::DeclStmtContext *ctx) override { return buildRule(ctx); }
65
2/4
✓ Branch 2 → 3 taken 13729 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 13729 times.
✗ Branch 3 → 8 not taken.
13729 std::any visitExprStmt(SpiceParser::ExprStmtContext *ctx) override { return buildRule(ctx); }
66
2/4
✓ Branch 2 → 3 taken 32591 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 32591 times.
✗ Branch 3 → 8 not taken.
32591 std::any visitQualifierLst(SpiceParser::QualifierLstContext *ctx) override { return buildRule(ctx); }
67
2/4
✓ Branch 2 → 3 taken 39298 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 39298 times.
✗ Branch 3 → 8 not taken.
39298 std::any visitQualifier(SpiceParser::QualifierContext *ctx) override { return buildRule(ctx); }
68
2/4
✓ Branch 2 → 3 taken 377 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 377 times.
✗ Branch 3 → 8 not taken.
377 std::any visitModAttr(SpiceParser::ModAttrContext *ctx) override { return buildRule(ctx); }
69
2/4
✓ Branch 2 → 3 taken 472 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 472 times.
✗ Branch 3 → 8 not taken.
472 std::any visitTopLevelDefAttr(SpiceParser::TopLevelDefAttrContext *ctx) override { return buildRule(ctx); }
70 std::any visitLambdaAttr(SpiceParser::LambdaAttrContext *ctx) override { return buildRule(ctx); }
71
2/4
✓ Branch 2 → 3 taken 849 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 849 times.
✗ Branch 3 → 8 not taken.
849 std::any visitAttrLst(SpiceParser::AttrLstContext *ctx) override { return buildRule(ctx); }
72
2/4
✓ Branch 2 → 3 taken 1138 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1138 times.
✗ Branch 3 → 8 not taken.
1138 std::any visitAttr(SpiceParser::AttrContext *ctx) override { return buildRule(ctx); }
73
2/4
✓ Branch 2 → 3 taken 48 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 48 times.
✗ Branch 3 → 8 not taken.
48 std::any visitCaseConstant(SpiceParser::CaseConstantContext *ctx) override { return buildRule(ctx); }
74
2/4
✓ Branch 2 → 3 taken 9980 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 9980 times.
✗ Branch 3 → 8 not taken.
9980 std::any visitReturnStmt(SpiceParser::ReturnStmtContext *ctx) override { return buildRule(ctx); }
75
2/4
✓ Branch 2 → 3 taken 121 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 121 times.
✗ Branch 3 → 8 not taken.
121 std::any visitBreakStmt(SpiceParser::BreakStmtContext *ctx) override { return buildRule(ctx); }
76
2/4
✓ Branch 2 → 3 taken 206 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 206 times.
✗ Branch 3 → 8 not taken.
206 std::any visitContinueStmt(SpiceParser::ContinueStmtContext *ctx) override { return buildRule(ctx); }
77 std::any visitFallthroughStmt(SpiceParser::FallthroughStmtContext *ctx) override { return buildRule(ctx); }
78
2/4
✓ Branch 2 → 3 taken 74887 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 74887 times.
✗ Branch 3 → 8 not taken.
74887 std::any visitAssignExpr(SpiceParser::AssignExprContext *ctx) override { return buildRule(ctx); }
79
2/4
✓ Branch 2 → 3 taken 67123 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 67123 times.
✗ Branch 3 → 8 not taken.
67123 std::any visitTernaryExpr(SpiceParser::TernaryExprContext *ctx) override { return buildRule(ctx); }
80
2/4
✓ Branch 2 → 3 taken 68023 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 68023 times.
✗ Branch 3 → 8 not taken.
68023 std::any visitLogicalOrExpr(SpiceParser::LogicalOrExprContext *ctx) override { return buildRule(ctx); }
81
2/4
✓ Branch 2 → 3 taken 69380 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 69380 times.
✗ Branch 3 → 8 not taken.
69380 std::any visitLogicalAndExpr(SpiceParser::LogicalAndExprContext *ctx) override { return buildRule(ctx); }
82
2/4
✓ Branch 2 → 3 taken 69661 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 69661 times.
✗ Branch 3 → 8 not taken.
69661 std::any visitBitwiseOrExpr(SpiceParser::BitwiseOrExprContext *ctx) override { return buildRule(ctx); }
83
2/4
✓ Branch 2 → 3 taken 69742 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 69742 times.
✗ Branch 3 → 8 not taken.
69742 std::any visitBitwiseXorExpr(SpiceParser::BitwiseXorExprContext *ctx) override { return buildRule(ctx); }
84
2/4
✓ Branch 2 → 3 taken 69749 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 69749 times.
✗ Branch 3 → 8 not taken.
69749 std::any visitBitwiseAndExpr(SpiceParser::BitwiseAndExprContext *ctx) override { return buildRule(ctx); }
85
2/4
✓ Branch 2 → 3 taken 69776 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 69776 times.
✗ Branch 3 → 8 not taken.
69776 std::any visitEqualityExpr(SpiceParser::EqualityExprContext *ctx) override { return buildRule(ctx); }
86
2/4
✓ Branch 2 → 3 taken 74778 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 74778 times.
✗ Branch 3 → 8 not taken.
74778 std::any visitRelationalExpr(SpiceParser::RelationalExprContext *ctx) override { return buildRule(ctx); }
87
2/4
✓ Branch 2 → 3 taken 78875 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 78875 times.
✗ Branch 3 → 8 not taken.
78875 std::any visitShiftExpr(SpiceParser::ShiftExprContext *ctx) override { return buildRule(ctx); }
88
2/4
✓ Branch 2 → 3 taken 78982 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 78982 times.
✗ Branch 3 → 8 not taken.
78982 std::any visitAdditiveExpr(SpiceParser::AdditiveExprContext *ctx) override { return buildRule(ctx); }
89
2/4
✓ Branch 2 → 3 taken 83302 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 83302 times.
✗ Branch 3 → 8 not taken.
83302 std::any visitMultiplicativeExpr(SpiceParser::MultiplicativeExprContext *ctx) override { return buildRule(ctx); }
90
2/4
✓ Branch 2 → 3 taken 84699 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 84699 times.
✗ Branch 3 → 8 not taken.
84699 std::any visitCastExpr(SpiceParser::CastExprContext *ctx) override { return buildRule(ctx); }
91
2/4
✓ Branch 2 → 3 taken 90954 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 90954 times.
✗ Branch 3 → 8 not taken.
90954 std::any visitPrefixUnaryExpr(SpiceParser::PrefixUnaryExprContext *ctx) override { return buildRule(ctx); }
92
2/4
✓ Branch 2 → 3 taken 115477 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 115477 times.
✗ Branch 3 → 8 not taken.
115477 std::any visitPostfixUnaryExpr(SpiceParser::PostfixUnaryExprContext *ctx) override { return buildRule(ctx); }
93
2/4
✓ Branch 2 → 3 taken 89802 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 89802 times.
✗ Branch 3 → 8 not taken.
89802 std::any visitAtomicExpr(SpiceParser::AtomicExprContext *ctx) override { return buildRule(ctx); }
94
2/4
✓ Branch 2 → 3 taken 18876 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 18876 times.
✗ Branch 3 → 8 not taken.
18876 std::any visitValue(SpiceParser::ValueContext *ctx) override { return buildRule(ctx); }
95
2/4
✓ Branch 2 → 3 taken 17147 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 17147 times.
✗ Branch 3 → 8 not taken.
17147 std::any visitFctCall(SpiceParser::FctCallContext *ctx) override { return buildRule(ctx); }
96
2/4
✓ Branch 2 → 3 taken 9 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 9 times.
✗ Branch 3 → 8 not taken.
9 std::any visitArrayInitialization(SpiceParser::ArrayInitializationContext *ctx) override { return buildRule(ctx); }
97
2/4
✓ Branch 2 → 3 taken 177 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 177 times.
✗ Branch 3 → 8 not taken.
177 std::any visitStructInstantiation(SpiceParser::StructInstantiationContext *ctx) override { return buildRule(ctx); }
98 std::any visitLambdaFunc(SpiceParser::LambdaFuncContext *ctx) override { return buildRule(ctx); }
99
2/4
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
1 std::any visitLambdaProc(SpiceParser::LambdaProcContext *ctx) override { return buildRule(ctx); }
100 std::any visitLambdaExpr(SpiceParser::LambdaExprContext *ctx) override { return buildRule(ctx); }
101
2/4
✓ Branch 2 → 3 taken 16325 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 16325 times.
✗ Branch 3 → 8 not taken.
16325 std::any visitConstant(SpiceParser::ConstantContext *ctx) override { return buildRule(ctx); }
102
2/4
✓ Branch 2 → 3 taken 48638 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 48638 times.
✗ Branch 3 → 8 not taken.
48638 std::any visitDataType(SpiceParser::DataTypeContext *ctx) override { return buildRule(ctx); }
103
2/4
✓ Branch 2 → 3 taken 48638 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 48638 times.
✗ Branch 3 → 8 not taken.
48638 std::any visitBaseDataType(SpiceParser::BaseDataTypeContext *ctx) override { return buildRule(ctx); }
104
2/4
✓ Branch 2 → 3 taken 18283 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 18283 times.
✗ Branch 3 → 8 not taken.
18283 std::any visitCustomDataType(SpiceParser::CustomDataTypeContext *ctx) override { return buildRule(ctx); }
105
2/4
✓ Branch 2 → 3 taken 48 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 48 times.
✗ Branch 3 → 8 not taken.
48 std::any visitFunctionDataType(SpiceParser::FunctionDataTypeContext *ctx) override { return buildRule(ctx); }
106
2/4
✓ Branch 2 → 3 taken 7939 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 7939 times.
✗ Branch 3 → 8 not taken.
7939 std::any visitAssignOp(SpiceParser::AssignOpContext *ctx) override { return buildRule(ctx); }
107
2/4
✓ Branch 2 → 3 taken 1844 times.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1844 times.
✗ Branch 3 → 8 not taken.
1844 std::any visitOverloadableOp(SpiceParser::OverloadableOpContext *ctx) override { return buildRule(ctx); }
108
109 private:
110 // Members
111 const antlr4::dfa::Vocabulary &vocabulary;
112 const std::vector<std::string> ruleNames;
113 int currentTabs = 1;
114 std::string parentNodeId;
115
116 // Private methods
117 std::string buildRule(const antlr4::ParserRuleContext *ctx);
118 [[nodiscard]] std::string getSpaces() const;
119 [[nodiscard]] static std::string tokenToCodeLoc(const antlr4::Token &token);
120 };
121
122 } // namespace spice::compiler
123