-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSemanticAnalyzer.h
More file actions
34 lines (25 loc) · 801 Bytes
/
SemanticAnalyzer.h
File metadata and controls
34 lines (25 loc) · 801 Bytes
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
#pragma once
#include "Ast.h"
#include "ErrorHandling.h"
#include <vector>
namespace AST
{
class SemanticAnalyzer : public AstVisitor
{
public:
virtual void Visit(CommandNode* node) override;
virtual void Visit(OneOperandCommandNode* node) override;
virtual void Visit(DoubleOperandCommandNode* node) override;
inline const std::vector<Error>& GetErrors() const;
private:
void CheckOneAndHalfCommand(const DoubleOperandCommandNode* node);
void CheckBranchCommand(const OneOperandCommandNode* node);
void CheckOneOperandCommand(const OneOperandCommandNode* node);
private:
std::vector<Error> Errors;
};
const std::vector<Error>& SemanticAnalyzer::GetErrors() const
{
return Errors;
}
}