NJUPT-Compile/1/Classifier.h
2024-06-15 21:40:42 +08:00

26 lines
729 B
C++

//
// Created by kagura on 4/24/24.
//
#ifndef INC_1_CLASSIFIER_H
#define INC_1_CLASSIFIER_H
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Classifier {
private:
vector<string> reserveNames = {"if","else","while","for","return","switch","case","break","continue","default",
"int","char","float","double","long","short","unsigned","signed","void"};
vector<char> operators = {'+','-','*','/','%','<','>','&','|','=','!'};
vector<char> isolators = {'(',')','{','}','[',']',';',','};
public:
bool isreserveNames(const string &name);
bool isOperator(char c);
bool isIsolator(char c);
};
#endif //INC_1_CLASSIFIER_H