Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81350 / py2html / Token.h
diff options
context:
space:
mode:
Commit76b849fbaa276566fa8838d745c0e5fbd2f138bc (patch)
Author
 Ralitsa Dardjonova <dardzhonov@uni-sofia.bg>
2018-11-07 16:01:18 +0200
Committer
 dtrendafilov <trendafilov.dn@gmail.com>
2018-11-07 16:01:18 +0200
Files903597ade32e9f2cce2a52b90aa70ff90668bbbe /homework/81350/py2html/Token.h
IPL-76b849fbaa276566fa8838d745c0e5fbd2f138bc.tar
IPL-76b849fbaa276566fa8838d745c0e5fbd2f138bc.tar.gz
IPL-76b849fbaa276566fa8838d745c0e5fbd2f138bc.zip
Parent97a58430a248b9ea89a7da0120cfceb0e6b11af5 (diff)
First homework - highlighter for python (#17)
* Initial commit * Fix some typos modified: README * Delete index.html
1 files changed, 52 insertions, 0 deletions
-rw-r--r--homework/81350/py2html/Token.h52
diff --git a/homework/81350/py2html/Token.h b/homework/81350/py2html/Token.h
new file mode 100644
index 0000000..97dda8d
--- /dev/null
+++ b/homework/81350/py2html/Token.h
@@ -0,0 +1,52 @@
+#pragma once
+#include<string>
+#include<unordered_map>
+
+typedef std::string IPLString ;
+
+ enum TokenType{
+ False,
+ None,
+ True,
+ And,
+ As,
+ Assert,
+ Break,
+ Class,
+ Continue,
+ Def,
+ Del,
+ Elif,
+ Else,
+ Except,
+ Finally,
+ For,
+ From,
+ Global,
+ If,
+ Import,
+ In,
+ Is,
+ Lambda,
+ Nonlocal,
+ Not,
+ Or,
+ Pass,
+ Print,
+ Raise,
+ Return,
+ Try,
+ While,
+ With,
+ Yield
+ };
+
+struct Token
+{
+ TokenType Type;
+ unsigned Line;
+ IPLString Lexeme;
+ double Number = 0.0;
+};
+
+extern std::unordered_map<std::string, TokenType> keywords;