NJUPT-Compile/1/Classifier.h

27 lines
729 B
C
Raw Normal View History

2024-06-15 15:40:42 +02:00
//
// 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