]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Added common folder with tokens.h header for use by lexer and parser
authorMike D. Lowis <mike@mdlowis.com>
Fri, 15 Mar 2013 17:45:48 +0000 (13:45 -0400)
committerMike D. Lowis <mike@mdlowis.com>
Fri, 15 Mar 2013 17:45:48 +0000 (13:45 -0400)
premake4.lua
source/common/tokens.h [new file with mode: 0644]
source/lexer/lex.h
source/lexer/tok.h

index 7ab860356c70a386a351b96ac687a04138f39c5b..5bd8aca2b9295ac21f1c74d99a3a85be477d4632 100644 (file)
@@ -30,8 +30,15 @@ project "sclpl-lex"
     kind "ConsoleApp"
     language "C"
     location "build"
-    includedirs { "source/lexer/**", "source/runtime/**" }
-    files { "source/lexer/**.*", "source/runtime/collector/**.*"}
+    includedirs {
+        "source/lexer/**",
+        "source/common/",
+        "source/runtime/**"
+    }
+    files {
+        "source/lexer/**.*",
+        "source/runtime/collector/**.*"
+    }
 
 project "sclpl-lex-tests"
     kind "ConsoleApp"
diff --git a/source/common/tokens.h b/source/common/tokens.h
new file mode 100644 (file)
index 0000000..fb28466
--- /dev/null
@@ -0,0 +1,25 @@
+/**
+    @file tokens.h
+    @brief TODO: Describe this file
+    $Revision$
+    $HeadURL$
+*/
+#ifndef TOKENS_H
+#define TOKENS_H
+
+typedef enum {
+    TOK_EOF    = 0,
+    TOK_ID     = 1,
+    TOK_NUM    = 2,
+    TOK_LPAR   = 3,
+    TOK_RPAR   = 4,
+    TOK_LBRACK = 5,
+    TOK_RBRACK = 6,
+    TOK_LBRACE = 7,
+    TOK_RBRACE = 8,
+    TOK_TERM   = 9,
+    TOK_BOOL   = 10,
+    TOK_MAX    = 11,
+} tok_type_t;
+
+#endif /* TOKENS_H */
index 62d89774cb0c3707dc567733b474859da2dd6057..859816503d84ef3bbc1e6798ca337b17cc9504da 100644 (file)
@@ -9,21 +9,7 @@
 
 #include "tok.h"
 #include "classes.h"
-
-typedef enum {
-    TOK_EOF    = 0,
-    TOK_ID     = 1,
-    TOK_NUM    = 2,
-    TOK_LPAR   = 3,
-    TOK_RPAR   = 4,
-    TOK_LBRACK = 5,
-    TOK_RBRACK = 6,
-    TOK_LBRACE = 7,
-    TOK_RBRACE = 8,
-    TOK_TERM   = 9,
-    TOK_BOOL   = 10,
-    TOK_MAX    = 11,
-} lex_tok_t;
+#include "tokens.h"
 
 typedef struct {
     const char* p_text;
index 28603014fdada4957b8aa7e089faf0e3f83a2d6d..c6521f045c481d261feedf52cbd41dd627c1d614 100644 (file)
@@ -7,8 +7,6 @@
 #ifndef TOK_H
 #define TOK_H
 
-typedef int tok_type_t;
-
 typedef struct
 {
     int line;