Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81352 / ts2html-hw1 / token.h
diff options
context:
space:
mode:
Commitccd71ee220093774a35708d8c1e31936b012930a (patch)
Author
 Dimitar Milev <milev.1996@gmail.com>
2018-11-03 12:52:28 +0100
Committer
 Martin Dobrev <martindobrev0@gmail.com>
2018-11-03 13:52:28 +0200
Filesfc889ec3aec35a9e97506d79fee1814239a37dfd /homework/81352/ts2html-hw1/token.h
IPL-ccd71ee220093774a35708d8c1e31936b012930a.tar
IPL-ccd71ee220093774a35708d8c1e31936b012930a.tar.gz
IPL-ccd71ee220093774a35708d8c1e31936b012930a.zip
Parent06811744a002f4ab332d94d510475231afcd45a1 (diff)
81352 - homework 2 (#32)
* fix(hw1): use yyextra instead global variable * hw2: extended the typescript syntax highlighter with collapsible block structures
1 files changed, 35 insertions, 0 deletions
-rw-r--r--homework/81352/ts2html-hw1/token.h35
diff --git a/homework/81352/ts2html-hw1/token.h b/homework/81352/ts2html-hw1/token.h
new file mode 100644
index 0000000..977a57c
--- /dev/null
+++ b/homework/81352/ts2html-hw1/token.h
@@ -0,0 +1,35 @@
+#ifndef TOKEN
+#define TOKEN
+
+#include <string>
+
+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