flush
[m6w6/ext-psi] / idl / lexer.h
index e3f7c5f2d350d9cbbbd439338e744cf267ed2339..c41bd1d6a8796da192428de9e01fd5f4baa7dff8 100644 (file)
@@ -1,36 +1,18 @@
-#define BSIZE 256
+#ifndef _PSI_LEXER_H
+#define _PSI_LEXER_H
 
-typedef int token_t;
-typedef unsigned char text;
-
-typedef struct PSI_Token {
-       token_t type;
-       unsigned line;
-       text text[1];
-} PSI_Token;
-
-typedef struct impl impl;
-typedef struct decl decl;
+#ifndef BSIZE
+# define BSIZE 256
+#endif
 
 typedef struct PSI_Lexer {
-       FILE *fp;
-       char *fn;
-       struct {
-               size_t count;
-               decl **list;
-       } decl;
-       struct {
-               size_t count;
-               impl **list;
-       } impl;
-       size_t line;
-       text *cur, *tok, *lim, *eof, *ctx, *mrk, buf[BSIZE];
+
 } PSI_Lexer;
 
-PSI_Lexer *PSI_LexerInit(PSI_Lexer *L, const char *filename);
 size_t PSI_LexerFill(PSI_Lexer *L, size_t n);
-token_t PSI_LexerScan(PSI_Lexer *L);
 void PSI_LexerDtor(PSI_Lexer *L);
 void PSI_LexerFree(PSI_Lexer **L);
+PSI_Lexer *PSI_LexerInit(PSI_Lexer *L, const char *filename);
+token_t PSI_LexerScan(PSI_Lexer *L);
 
-PSI_Token *PSI_TokenAlloc(PSI_Lexer *L, token_t t);
+#endif