ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/trunk/src/config-lexer.l
(Generate patch)

Comparing hopm/trunk/src/config-lexer.l (file contents):
Revision 5134 by michael, Thu Dec 25 18:50:02 2014 UTC vs.
Revision 6046 by michael, Thu Jun 4 11:09:23 2015 UTC

# Line 1 | Line 1
1   /*
2 < * Copyright (C) 2002  Erik Fears
2 > *  Copyright (c) 2002 Erik Fears
3 > *  Copyright (c) 2014-2015 ircd-hybrid development team
4   *
5 < *    QSTRING , ccomment and hashcomment taken from Hybrid7:
6 < *    Copyright (C) 2002 by the past and present ircd coders, and others.
7 < *
8 < * This program is free software; you can redistribute it and/or
8 < * modify it under the terms of the GNU General Public License
9 < * as published by the Free Software Foundation; either version 2
10 < * of the License, or (at your option) any later version.
11 < *
12 < * This program is distributed in the hope that it will be useful,
13 < * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 < * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 < * GNU General Public License for more details.
16 < *
17 < * You should have received a copy of the GNU General Public License
18 < * along with this program; if not, write to
19 < *
20 < *       The Free Software Foundation, Inc.
21 < *       59 Temple Place - Suite 330
22 < *       Boston, MA  02111-1307, USA.
5 > *  This program is free software; you can redistribute it and/or modify
6 > *  it under the terms of the GNU General Public License as published by
7 > *  the Free Software Foundation; either version 2 of the License, or
8 > *  (at your option) any later version.
9   *
10 + *  This program is distributed in the hope that it will be useful,
11 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 + *  GNU General Public License for more details.
14   *
15 + *  You should have received a copy of the GNU General Public License
16 + *  along with this program; if not, write to the Free Software
17 + *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18 + *  USA
19   */
20  
21   %option case-insensitive
22   %option noyywrap
23   %option nounput
24 + %option never-interactive
25  
26   %{
27   #include <stdio.h>
28   #include <string.h>
29  
35 #include "inet.h"
30   #include "compat.h"
31   #include "config.h"
32   #include "config-parser.h"
33  
34  
35 < void ccomment(void);
35 > static void ccomment(void);
36  
37 < int linenum = 1;
37 > unsigned int linenum = 1;
38   char linebuf[512];
39  
40   %}
# Line 91 | Line 85 | whitespace             [ \t\r]*
85                                   return STRING;
86                                }
87                             }
94            
88                          }
89  
90   AWAY                    { return AWAY;         }
# Line 113 | Line 106 | MAX_READ                { return MAX_REA
106   MODE                    { return MODE;         }
107   NAME                    { return NAME;         }
108   NEGCACHE                { return NEGCACHE;     }
109 + NEGCACHE_REBUILD        { return NEGCACHE_REBUILD; }
110   NICK                    { return NICK;         }
111   NICKSERV                { return NICKSERV;     }
112 + NOTICE                  { return NOTICE;       }
113   OPER                    { return OPER;         }
114   OPM                     { return OPM;          }
115   OPTIONS                 { return OPTIONS;      }
# Line 123 | Line 118 | PERFORM                 { return PERFORM
118   PIDFILE                 { return PIDFILE;      }
119   PORT                    { return PORT;         }
120   PROTOCOL                { return PROTOCOL;     }
121 + READTIMEOUT             { return READTIMEOUT;  }
122   REALNAME                { return REALNAME;     }
123   REPLY                   { return REPLY;        }
124   SCANLOG                 { return SCANLOG;      }
# Line 196 | Line 192 | ROUTER                  {
192                            return PROTOCOLTYPE;
193                          }
194  
195 + DREAMBOX                {
196 +                          yylval.number = OPM_TYPE_DREAMBOX;
197 +                          return PROTOCOLTYPE;
198 +                        }
199 +
200 +
201  
202   [0-9]+                  {
203 <                           yylval.number=atoi(yytext);
203 >                           yylval.number=atoi(yytext);
204                             return NUMBER;
205                          }
206  
# Line 245 | Line 247 | OFF                      {
247  
248   {whitespace}            /* ignore whitespace */;
249  
250 < .                       return yytext[0];
250 > .                       return yytext[0];
251  
252   %%
253  
254  
255   /* C-comment ignoring routine -kre*/
256 < void ccomment(void)
256 > static void
257 > ccomment(void)
258   {
259 <  int c;
259 >  int c = 0;
260  
261    /* log(L_NOTICE, "got comment"); */
262    while (1)
263    {
264 <     while ((c = input()) != '*' && c != EOF)
265 <        if (c == '\n') ++linenum;
266 <     if (c == '*')
267 <     {
268 <        while ((c = input()) == '*');
269 <        if (c == '/') break;
270 <     }
264 >    while ((c = input()) != '*' && c != EOF)
265 >      if (c == '\n')
266 >        ++linenum;
267 >
268 >    if (c == '*')
269 >    {
270 >      while ((c = input()) == '*')
271 >        /* Nothing */ ;
272 >      if (c == '/')
273 >        break;
274 >      else if (c == '\n')
275 >        ++linenum;
276 >    }
277 >
278      if (c == EOF)
279      {
280 <       YY_FATAL_ERROR("EOF in comment");
281 <       /* XXX hack alert this disables
282 <        * the stupid unused function warning
283 <        * gcc generates
284 <        */
285 <       if(1 == 0)
286 <          yy_fatal_error("EOF in comment");
287 <       break;
280 >      YY_FATAL_ERROR("EOF in comment");
281 >
282 >      /* XXX hack alert this disables
283 >       * the stupid unused function warning
284 >       * gcc generates
285 >       */
286 >      if (1 == 0)
287 >        yy_fatal_error("EOF in comment");
288 >      break;
289      }
290    }
291   }
281

Comparing hopm/trunk/src/config-lexer.l (property svn:eol-style):
Revision 5134 by michael, Thu Dec 25 18:50:02 2014 UTC vs.
Revision 6046 by michael, Thu Jun 4 11:09:23 2015 UTC

# Line 0 | Line 1
1 + native

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)