summaryrefslogtreecommitdiff
path: root/comm/OLD/ReqMgr.l
diff options
context:
space:
mode:
authorchatty1993-04-07 11:50:31 +0000
committerchatty1993-04-07 11:50:31 +0000
commitba066c34dde204aa192d03a23a81356374d93731 (patch)
tree39391f6235d2cf8a59a0634ac5ea430cdd21f5d4 /comm/OLD/ReqMgr.l
parent05ab076e1c2a9ca16472f9a6b47b8d22914b3783 (diff)
downloadivy-league-ba066c34dde204aa192d03a23a81356374d93731.zip
ivy-league-ba066c34dde204aa192d03a23a81356374d93731.tar.gz
ivy-league-ba066c34dde204aa192d03a23a81356374d93731.tar.bz2
ivy-league-ba066c34dde204aa192d03a23a81356374d93731.tar.xz
Initial revision
Diffstat (limited to 'comm/OLD/ReqMgr.l')
-rw-r--r--comm/OLD/ReqMgr.l95
1 files changed, 95 insertions, 0 deletions
diff --git a/comm/OLD/ReqMgr.l b/comm/OLD/ReqMgr.l
new file mode 100644
index 0000000..bad288c
--- /dev/null
+++ b/comm/OLD/ReqMgr.l
@@ -0,0 +1,95 @@
+%{
+/*
+ * The Unix Channel
+ *
+ * by Michel Beaudouin-Lafon
+ *
+ * Copyright 1993
+ * Centre d'Etudes de la Navigation Aerienne (CENA)
+ *
+ * Request management, by Stephane Chatty
+ *
+ * $Id$
+ * $CurLog$
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "ccu/HashTable.h"
+#include "ccu/String.h"
+#include "ReqMgr.yacc.h" // produced from the parser file with '-d' option of yacc
+
+extern int tee (int);
+#define RETURN(x) return (tee(x))
+
+extern "C" {
+ int atoi (const char *);
+ void exit (int);
+ int read (int, char*, int);
+}
+
+
+CcuDictionnary* ResWords;
+int LineNo = 1;
+static char IdBuf [1024];
+
+void
+LexInit ()
+{
+ if (!ResWords) {
+ ResWords = new CcuDictionnary (10);
+ (*ResWords)["client"] = (void*) (Y_CLIENT);
+ (*ResWords)["request"] = (void*) (Y_REQUEST);
+ (*ResWords)["getters"] = (void*) (Y_GETTERS);
+ (*ResWords)["setters"] = (void*) (Y_SETTERS);
+ (*ResWords)["const"] = (void*) (Y_CONST);
+// (*ResWords)[""] = (void*) (Y_);
+ }
+ LineNo = 1;
+
+#ifdef FLEX_SCANNER
+static void yyrestart (FILE*);
+ yyrestart (0);
+#endif
+}
+
+%}
+
+Int [-]?[0-9]+
+Ident [a-zA-Z_][a-zA-Z_0-9]*
+nl [\n]
+sp0 [ \t]*
+sp1 [ \t]+
+LocHeader \"{Ident}.h\"
+GlobHeader \<Ident.h\>
+
+%%
+
+[,();{}*] RETURN (yytext[0]);
+
+\%.*\n { /* comments */
+ ++LineNo;
+ }
+
+{sp1} {}
+
+{nl} {
+ ++LineNo;
+ }
+
+-> { RETURN (Y_YIELDS); }
+
+#include
+{Ident} {
+ CcuHashCell* c;
+ if (c = ResWords->Get (yytext)) {
+ RETURN(int (c->GetInfo ()));
+ } else {
+ yylval.string = NewString (yytext);
+ RETURN (Y_ID);
+ }
+ }
+
+. {
+ RETURN (-1);
+ }