summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/Lexer.h
diff options
context:
space:
mode:
authorJustyna Att Ilczuk <justyna.ilczuk@gmail.com>2012-11-03 00:07:00 +0100
committerJustyna Att Ilczuk <justyna.ilczuk@gmail.com>2012-11-03 00:07:00 +0100
commite8018808e184818ccb1e99593d674d79ceaac2e6 (patch)
tree693211dcba668c0be498cb2ac57f6a8e62e76223 /Sencha-lang/Lexer.h
parent67b2379d0383e1d389e98b0313bb317211c7dd5a (diff)
downloadsencha-lang-e8018808e184818ccb1e99593d674d79ceaac2e6.tar.gz
sencha-lang-e8018808e184818ccb1e99593d674d79ceaac2e6.tar.bz2
sencha-lang-e8018808e184818ccb1e99593d674d79ceaac2e6.tar.xz
sencha-lang-e8018808e184818ccb1e99593d674d79ceaac2e6.zip
I did some migration to eclipse. Old code-blocks version still exists. I installed new very simple test framework called minunit. If eclipse doesn't explode, I will use it as main IDE.
Diffstat (limited to 'Sencha-lang/Lexer.h')
-rw-r--r--Sencha-lang/Lexer.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/Sencha-lang/Lexer.h b/Sencha-lang/Lexer.h
new file mode 100644
index 0000000..c7e2906
--- /dev/null
+++ b/Sencha-lang/Lexer.h
@@ -0,0 +1,39 @@
+#ifndef LEXER_H
+#define LEXER_H
+#include <vector>
+#include <string>
+#include <utility>
+#include <cctype>
+#include <iostream>
+#include "Token.h"
+
+using namespace std;
+class Lexer
+{
+ public:
+ Lexer();
+ virtual ~Lexer();
+
+
+
+ void add_keyword(string word);
+ void add_punctuation_char(char c);
+ void add_operator(string oper);
+
+ vector<Token> parse_line(string line);
+ pair<string, Token> parse_token(string line);
+ type_of_token guess_type(string value);
+
+ protected:
+ private:
+
+ bool is_keyword(string value);
+ bool is_punctuation(char c);
+ bool is_operator(string value );
+
+ vector<string> keywords;
+ vector<char> punctuation;
+ vector<string> operators;
+};
+
+#endif // LEXER_H