aboutsummaryrefslogtreecommitdiffstats
path: root/lexer.h
diff options
context:
space:
mode:
authorAdam Branes <adam@adam>2021-05-02 17:45:58 +0300
committerAdam Branes <adam@adam>2021-05-02 17:45:58 +0300
commita3e36c1918e63761dfc4d2221cca3636b98e93aa (patch)
tree143722876a02156b0b423de6248298b5cf8c0707 /lexer.h
downloadMEGATRON-a3e36c1918e63761dfc4d2221cca3636b98e93aa.tar.gz
initial housekeeping done
Diffstat (limited to 'lexer.h')
-rw-r--r--lexer.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/lexer.h b/lexer.h
new file mode 100644
index 0000000..27b69d5
--- /dev/null
+++ b/lexer.h
@@ -0,0 +1,26 @@
+#ifndef LEXER_H
+#define LEXER_H
+#include <program.h>
+#include <queue.h>
+
+enum Keyword
+{
+ KW_MACHINE,
+ KW_STATE,
+ KW_FROM,
+ KW_TO,
+ KW_ON,
+ KW_ID,
+};
+struct token
+{
+ size_t size;
+ enum Keyword type;
+ char *data;
+};
+void lex(struct Queue *token_destination,struct Source *src,struct Translation_Data *translation_data);
+struct token* get_token(char *data,size_t size);
+void delete_token(struct token *token);
+
+
+#endif