35 lines
596 B
C++
35 lines
596 B
C++
#pragma once
|
|
|
|
#include "LexAnalyzer.h"
|
|
|
|
|
|
struct VmCall
|
|
{
|
|
enum Type
|
|
{
|
|
FunctionCall,
|
|
Label
|
|
};
|
|
|
|
CString name;
|
|
Type type;
|
|
std::vector<int> arguments;
|
|
CString labelReference;
|
|
};
|
|
|
|
class SemAnalyzer
|
|
{
|
|
public:
|
|
LanguageSpecifier language;
|
|
std::vector<CString> texts;
|
|
std::vector<VmCall> vmCalls;
|
|
std::map<CString, int> usedFunctions;
|
|
|
|
SemAnalyzer();
|
|
virtual ~SemAnalyzer();
|
|
|
|
void Parse(const CString& fileName, std::vector<Keyword> keywords);
|
|
|
|
private:
|
|
int ParseFunction(const CString& fileName, std::vector<Keyword>::iterator& iter, std::vector<int>& args, CString& labelReference);
|
|
}; |