-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReversePolishNotation.h
More file actions
30 lines (25 loc) · 922 Bytes
/
ReversePolishNotation.h
File metadata and controls
30 lines (25 loc) · 922 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
#pragma once
#ifndef REVERSEPOLISHNOTATION_H
#define REVERSEPOLISHNOTATION_H
#include "LexicalAnalisator.h"
typedef std::vector<std::map<std::string, int>> mystack;
class ReversePolishNotation : public LexicalAnalisator
{
public:
ReversePolishNotation();
protected:
void reversePolishNotationAnalyze(std::string from_file_lexical, std::string to_file_RPN);
size_t positionTypeConversion(std::string line);
~ReversePolishNotation();
private:
mystack stack;
int getPriority(std::string word);
bool isFunctionDeclaration(std::string line);
bool isExistsComma(std::string line);
bool upElemNotNameExpression(std::string upElem);
bool isBeginFunctionName(std::string word);
bool isExistsFunctionExpression(std::vector<std::map<std::string, int>>& stack);
bool isEmptyArray(std::string line);
void recordFileFromStack(std::ofstream& file, std::map<std::string, int>::reverse_iterator upElemStack);
};
#endif