-
Notifications
You must be signed in to change notification settings - Fork 0
/
mmcVisitor.h
128 lines (67 loc) · 4.88 KB
/
mmcVisitor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#include <stdlib.h>
#include "wci/intermediate/TypeSpec.h"
using namespace wci::intermediate;
extern string program_name;
// Generated from mmc.g4 by ANTLR 4.7.1
#pragma once
#include "antlr4-runtime.h"
#include "mmcParser.h"
/**
* This class defines an abstract visitor for a parse tree
* produced by mmcParser.
*/
class mmcVisitor : public antlr4::tree::AbstractParseTreeVisitor {
public:
/**
* Visit parse trees produced by mmcParser.
*/
virtual antlrcpp::Any visitRoot(mmcParser::RootContext *context) = 0;
virtual antlrcpp::Any visitVariableDeclaration(mmcParser::VariableDeclarationContext *context) = 0;
virtual antlrcpp::Any visitArrayDeclaration(mmcParser::ArrayDeclarationContext *context) = 0;
virtual antlrcpp::Any visitVariableDef(mmcParser::VariableDefContext *context) = 0;
virtual antlrcpp::Any visitArrayDef(mmcParser::ArrayDefContext *context) = 0;
virtual antlrcpp::Any visitFunctionDefinition(mmcParser::FunctionDefinitionContext *context) = 0;
virtual antlrcpp::Any visitFunctionCall(mmcParser::FunctionCallContext *context) = 0;
virtual antlrcpp::Any visitParameters(mmcParser::ParametersContext *context) = 0;
virtual antlrcpp::Any visitIdentifiers(mmcParser::IdentifiersContext *context) = 0;
virtual antlrcpp::Any visitTypeID(mmcParser::TypeIDContext *context) = 0;
virtual antlrcpp::Any visitFunctionID(mmcParser::FunctionIDContext *context) = 0;
virtual antlrcpp::Any visitFunction(mmcParser::FunctionContext *context) = 0;
virtual antlrcpp::Any visitVariableID(mmcParser::VariableIDContext *context) = 0;
virtual antlrcpp::Any visitVariable(mmcParser::VariableContext *context) = 0;
virtual antlrcpp::Any visitNumber(mmcParser::NumberContext *context) = 0;
virtual antlrcpp::Any visitStr(mmcParser::StrContext *context) = 0;
virtual antlrcpp::Any visitSignedNumber(mmcParser::SignedNumberContext *context) = 0;
virtual antlrcpp::Any visitSign(mmcParser::SignContext *context) = 0;
virtual antlrcpp::Any visitStatement(mmcParser::StatementContext *context) = 0;
virtual antlrcpp::Any visitDeclarationStatement(mmcParser::DeclarationStatementContext *context) = 0;
virtual antlrcpp::Any visitDefinitionStatement(mmcParser::DefinitionStatementContext *context) = 0;
virtual antlrcpp::Any visitExpressionStatement(mmcParser::ExpressionStatementContext *context) = 0;
virtual antlrcpp::Any visitPrintfStatement(mmcParser::PrintfStatementContext *context) = 0;
virtual antlrcpp::Any visitIfStatement(mmcParser::IfStatementContext *context) = 0;
virtual antlrcpp::Any visitForStatement(mmcParser::ForStatementContext *context) = 0;
virtual antlrcpp::Any visitUnaryStatement(mmcParser::UnaryStatementContext *context) = 0;
virtual antlrcpp::Any visitStatementList(mmcParser::StatementListContext *context) = 0;
virtual antlrcpp::Any visitAssignmentStatement(mmcParser::AssignmentStatementContext *context) = 0;
virtual antlrcpp::Any visitAddSubExpr(mmcParser::AddSubExprContext *context) = 0;
virtual antlrcpp::Any visitArrayExpr(mmcParser::ArrayExprContext *context) = 0;
virtual antlrcpp::Any visitBitIndexExpr(mmcParser::BitIndexExprContext *context) = 0;
virtual antlrcpp::Any visitMulDivModExpr(mmcParser::MulDivModExprContext *context) = 0;
virtual antlrcpp::Any visitFuncCallExpr(mmcParser::FuncCallExprContext *context) = 0;
virtual antlrcpp::Any visitParenExpr(mmcParser::ParenExprContext *context) = 0;
virtual antlrcpp::Any visitStringExpr(mmcParser::StringExprContext *context) = 0;
virtual antlrcpp::Any visitVariableExpr(mmcParser::VariableExprContext *context) = 0;
virtual antlrcpp::Any visitBitExpr(mmcParser::BitExprContext *context) = 0;
virtual antlrcpp::Any visitUnaryExpr(mmcParser::UnaryExprContext *context) = 0;
virtual antlrcpp::Any visitBoolExpr(mmcParser::BoolExprContext *context) = 0;
virtual antlrcpp::Any visitUnsignedNumberExpr(mmcParser::UnsignedNumberExprContext *context) = 0;
virtual antlrcpp::Any visitSignedNumberExpr(mmcParser::SignedNumberExprContext *context) = 0;
virtual antlrcpp::Any visitMathExpr(mmcParser::MathExprContext *context) = 0;
virtual antlrcpp::Any visitPreInc(mmcParser::PreIncContext *context) = 0;
virtual antlrcpp::Any visitPreDec(mmcParser::PreDecContext *context) = 0;
virtual antlrcpp::Any visitPostInc(mmcParser::PostIncContext *context) = 0;
virtual antlrcpp::Any visitPostDec(mmcParser::PostDecContext *context) = 0;
virtual antlrcpp::Any visitVariableAssignment(mmcParser::VariableAssignmentContext *context) = 0;
virtual antlrcpp::Any visitArrayAssignment(mmcParser::ArrayAssignmentContext *context) = 0;
virtual antlrcpp::Any visitBitIndexAssignment(mmcParser::BitIndexAssignmentContext *context) = 0;
};