bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Simpler lexer regexps of case insensitive keywords.


From: Flavio Cruz
Subject: [PATCH] Simpler lexer regexps of case insensitive keywords.
Date: Tue, 15 Mar 2016 05:06:12 -0400
User-agent: Mutt/1.5.24 (2015-08-30)

* lexxer.l: Use (?i) for matching case insensitive keywords.
* README: Fix typo.
---
 README   |   2 +-
 lexxer.l | 100 +++++++++++++++++++++++++++++++--------------------------------
 2 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/README b/README
index e4c0639..2c693d8 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ This is GNU MIG, the GNU distribution of the Mach 3.0 Interface 
Generator
 (MIG), <http://www.gnu.org/software/hurd/microkernel/mach/mig/gnu_mig.html>.
 Welcome.
 
-This tool translates Remore Procedure Call (RPC) definition files to C
+This tool translates Remote Procedure Call (RPC) definition files to C
 code, and is required to compile any packages that are receiving or
 invoking RPCs, such as GNU Mach, GNU Hurd, and the GNU C Library (glibc)
 when compiled for the Hurd.
diff --git a/lexxer.l b/lexxer.l
index c71f85a..06b04e2 100644
--- a/lexxer.l
+++ b/lexxer.l
@@ -107,56 +107,56 @@ static void doSharp(const char *body); /* process body of 
# directives */
 
 %%
 
-<Normal>[Rr][Oo][Uu][Tt][Ii][Nn][Ee]           RETURN(syRoutine);
-<Normal>[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]       RETURN(syFunction);
-<Normal>[Pp][Rr][Oo][Cc][Ee][Dd][Uu][Rr][Ee]   RETURN(syProcedure);
-<Normal>[Ss][Ii][Mm][Pp][Ll][Ee][Pp][Rr][Oo][Cc][Ee][Dd][Uu][Rr][Ee] 
RETURN(sySimpleProcedure);
-<Normal>[Ss][Ii][Mm][Pp][Ll][Ee][Rr][Oo][Uu][Tt][Ii][Nn][Ee] 
RETURN(sySimpleRoutine);
-<Normal>[Ss][Uu][Bb][Ss][Yy][Ss][Tt][Ee][Mm]   RETURN(sySubsystem);
-<Normal>[Mm][Ss][Gg][Oo][Pp][Tt][Ii][Oo][Nn]   RETURN(syMsgOption);
-<Normal>[Mm][Ss][Gg][Ss][Ee][Qq][Nn][Oo]       RETURN(syMsgSeqno);
-<Normal>[Ww][Aa][Ii][Tt][Tt][Ii][Mm][Ee]       RETURN(syWaitTime);
-<Normal>[Nn][Oo][Ww][Aa][Ii][Tt][Tt][Ii][Mm][Ee]       RETURN(syNoWaitTime);
-<Normal>[Ii][Nn]                               RETURN(syIn);
-<Normal>[Oo][Uu][Tt]                           RETURN(syOut);
-<Normal>[Ii][Nn][Oo][Uu][Tt]                   RETURN(syInOut);
-<Normal>[Rr][Ee][Qq][Uu][Ee][Ss][Tt][Pp][Oo][Rr][Tt]   RETURN(syRequestPort);
-<Normal>[Rr][Ee][Pp][Ll][Yy][Pp][Oo][Rr][Tt]           RETURN(syReplyPort);
-<Normal>[Uu][Rr][Ee][Pp][Ll][Yy][Pp][Oo][Rr][Tt]       RETURN(syUReplyPort);
-<Normal>[Ss][Rr][Ee][Pp][Ll][Yy][Pp][Oo][Rr][Tt]       RETURN(sySReplyPort);
-<Normal>[Aa][Rr][Rr][Aa][Yy]                   RETURN(syArray);
-<Normal>[Oo][Ff]                               RETURN(syOf);
-<Normal>[Ee][Rr][Rr][Oo][Rr]                   RETURN(syErrorProc);
-<Normal>[Ss][Ee][Rr][Vv][Ee][Rr][Pp][Rr][Ee][Ff][Ii][Xx] 
RETURN(syServerPrefix);
-<Normal>[Uu][Ss][Ee][Rr][Pp][Rr][Ee][Ff][Ii][Xx]       RETURN(syUserPrefix);
-<Normal>[Ss][Ee][Rr][Vv][Ee][Rr][Dd][Ee][Mm][Uu][Xx]   RETURN(syServerDemux);
-<Normal>[Rr][Cc][Ss][Ii][Dd]                   RETURN(syRCSId);
-<Normal>[Ii][Mm][Pp][Oo][Rr][Tt]               RETURN(syImport);
-<Normal>[Uu][Ii][Mm][Pp][Oo][Rr][Tt]           RETURN(syUImport);
-<Normal>[Ss][Ii][Mm][Pp][Oo][Rr][Tt]           RETURN(sySImport);
-<Normal>[Tt][Yy][Pp][Ee]                       RETURN(syType);
-<Normal>[Kk][Ee][Rr][Nn][Ee][Ll][Ss][Ee][Rr][Vv][Ee][Rr] 
RETURN(syKernelServer);
-<Normal>[Kk][Ee][Rr][Nn][Ee][Ll][Uu][Ss][Ee][Rr]       RETURN(syKernelUser);
-<Normal>[Ss][Kk][Ii][Pp]                       RETURN(sySkip);
-<Normal>[Ss][Tt][Rr][Uu][Cc][Tt]               RETURN(syStruct);
-<Normal>[Ii][Nn][Tt][Rr][Aa][Nn]               RETURN(syInTran);
-<Normal>[Ii][Nn][Tt][Rr][Aa][Nn][Pp][Aa][Yy][Ll][Oo][Aa][Dd] 
RETURN(syInTranPayload);
-<Normal>[Oo][Uu][Tt][Tt][Rr][Aa][Nn]           RETURN(syOutTran);
-<Normal>[Dd][Ee][Ss][Tt][Rr][Uu][Cc][Tt][Oo][Rr]       RETURN(syDestructor);
-<Normal>[Cc][Tt][Yy][Pp][Ee]                           RETURN(syCType);
-<Normal>[Cc][Uu][Ss][Ee][Rr][Tt][Yy][Pp][Ee]           RETURN(syCUserType);
-<Normal>[Cc][Ss][Ee][Rr][Vv][Ee][Rr][Tt][Yy][Pp][Ee]   RETURN(syCServerType);
-<Normal>[Cc]_[Ss][Tt][Rr][Ii][Nn][Gg]                  RETURN(syCString);
-
-<Normal>[Ii][Ss][Ll][Oo][Nn][Gg]               FRETURN(flLong);
-<Normal>[Ii][Ss][Nn][Oo][Tt][Ll][Oo][Nn][Gg]   FRETURN(flNotLong);
-<Normal>[Dd][Ee][Aa][Ll][Ll][Oo][Cc]           FRETURN(flDealloc);
-<Normal>[Nn][Oo][Tt][Dd][Ee][Aa][Ll][Ll][Oo][Cc] FRETURN(flNotDealloc);
-<Normal>[Ss][Ee][Rr][Vv][Ee][Rr][Cc][Oo][Pp][Yy] FRETURN(flServerCopy);
-<Normal>[Cc][Oo][Uu][Nn][Tt][Ii][Nn][Oo][Uu][Tt] FRETURN(flCountInOut);
-<Normal>[Rr][Ee][Tt][Cc][Oo][Dd][Ee]           FRETURN(flNone);
-
-<Normal>[Pp][Oo][Ll][Yy][Mm][Oo][Rr][Pp][Hh][Ii][Cc]   
TRETURN(MACH_MSG_TYPE_POLYMORPHIC,word_size_in_bits);
+<Normal>(?i:routine)           RETURN(syRoutine);
+<Normal>(?i:function)          RETURN(syFunction);
+<Normal>(?i:procedure)         RETURN(syProcedure);
+<Normal>(?i:simpleprocedure)   RETURN(sySimpleProcedure);
+<Normal>(?i:simpleroutine)     RETURN(sySimpleRoutine);
+<Normal>(?i:subsystem)         RETURN(sySubsystem);
+<Normal>(?i:msgoption)         RETURN(syMsgOption);
+<Normal>(?i:msgseqno)          RETURN(syMsgSeqno);
+<Normal>(?i:waittime)          RETURN(syWaitTime);
+<Normal>(?i:nowaittime)                RETURN(syNoWaitTime);
+<Normal>(?i:in)                        RETURN(syIn);
+<Normal>(?i:out)               RETURN(syOut);
+<Normal>(?i:inout)             RETURN(syInOut);
+<Normal>(?i:requestport)       RETURN(syRequestPort);
+<Normal>(?i:replyport)         RETURN(syReplyPort);
+<Normal>(?i:ureplyport)                RETURN(syUReplyPort);
+<Normal>(?i:sreplyport)                RETURN(sySReplyPort);
+<Normal>(?i:array)             RETURN(syArray);
+<Normal>(?i:of)                        RETURN(syOf);
+<Normal>(?i:error)             RETURN(syErrorProc);
+<Normal>(?i:serverprefix)       RETURN(syServerPrefix);
+<Normal>(?i:userprefix)                RETURN(syUserPrefix);
+<Normal>(?i:serverdemux)       RETURN(syServerDemux);
+<Normal>(?i:rcsid)             RETURN(syRCSId);
+<Normal>(?i:import)            RETURN(syImport);
+<Normal>(?i:uimport)           RETURN(syUImport);
+<Normal>(?i:simport)           RETURN(sySImport);
+<Normal>(?i:type)              RETURN(syType);
+<Normal>(?i:kernelserver)      RETURN(syKernelServer);
+<Normal>(?i:kerneluser)                RETURN(syKernelUser);
+<Normal>(?i:skip)              RETURN(sySkip);
+<Normal>(?i:struct)            RETURN(syStruct);
+<Normal>(?i:intran)            RETURN(syInTran);
+<Normal>(?i:intranpayload)      RETURN(syInTranPayload);
+<Normal>(?i:outtran)           RETURN(syOutTran);
+<Normal>(?i:destructor)                RETURN(syDestructor);
+<Normal>(?i:ctype)             RETURN(syCType);
+<Normal>(?i:cusertype)         RETURN(syCUserType);
+<Normal>(?i:cservertype)       RETURN(syCServerType);
+<Normal>(?i:c_string)          RETURN(syCString);
+
+<Normal>(?i:islong)            FRETURN(flLong);
+<Normal>(?i:isnotlong)         FRETURN(flNotLong);
+<Normal>(?i:dealloc)           FRETURN(flDealloc);
+<Normal>(?i:notdealloc)         FRETURN(flNotDealloc);
+<Normal>(?i:servercopy)         FRETURN(flServerCopy);
+<Normal>(?i:countinout)                FRETURN(flCountInOut);
+<Normal>(?i:retcode)           FRETURN(flNone);
+
+<Normal>(?i:polymorphic)       
TRETURN(MACH_MSG_TYPE_POLYMORPHIC,word_size_in_bits);
 
 <Normal>"MACH_MSG_TYPE_UNSTRUCTURED"   TRETURN(MACH_MSG_TYPE_UNSTRUCTURED,0);
 <Normal>"MACH_MSG_TYPE_BIT"            TRETURN(MACH_MSG_TYPE_BIT,1);
-- 
2.6.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]