From f5dc138f53ca4eb98063be5723785b79557e9cc3 Mon Sep 17 00:00:00 2001 From: Dimitar Milev Date: Thu, 25 Oct 2018 14:28:25 +0300 Subject: homework1: typescript syntax highlighter (#22) --- homework/81352/ts2html/token.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 homework/81352/ts2html/token.h (limited to 'homework/81352/ts2html/token.h') diff --git a/homework/81352/ts2html/token.h b/homework/81352/ts2html/token.h new file mode 100644 index 0000000..977a57c --- /dev/null +++ b/homework/81352/ts2html/token.h @@ -0,0 +1,35 @@ +#ifndef TOKEN +#define TOKEN + +#include + +enum TokenType { + KEYWORD, + IDENTIFIER, + NUMBER, + OPERATOR, + STRING, + SEMICOLON, + LEFT_BLOCK_BRACKET, + RIGHT_BLOCK_BRACKET, + LEFT_BRACKET, + RIGHT_BRACKET, + NEWLINE, + WHITESPACE, + DECORATOR, + COMMENT, + OTHER, + UNRECOGNIZED +}; + +class Token { + private: + std::string text; + TokenType type; + public: + Token(std::string, TokenType); + std::string getTypeName(); + std::string getTextValue(); + TokenType getTokenType(); +}; +#endif \ No newline at end of file -- cgit v1.3.1-26-gb76a