1999-03-18 16:08:57 +01:00
|
|
|
|
%{
|
|
|
|
|
/*
|
1999-03-30 11:42:51 +02:00
|
|
|
|
* File: lexer.l
|
|
|
|
|
* Date created: March 15, 1999 (Monday, 17:16h)
|
1999-07-22 14:21:14 +02:00
|
|
|
|
* Author: Copyright (C) 1999 Thomas Jensen
|
1999-03-30 11:42:51 +02:00
|
|
|
|
* tsjensen@stud.informatik.uni-erlangen.de
|
1999-07-22 14:21:14 +02:00
|
|
|
|
* Version: $Id: lexer.l,v 1.12 1999/07/02 11:58:15 tsjensen Exp tsjensen $
|
1999-03-30 11:42:51 +02:00
|
|
|
|
* Language: lex (ANSI C)
|
|
|
|
|
* Purpose: flex lexical analyzer for boxes configuration files
|
1999-07-22 14:21:14 +02:00
|
|
|
|
*
|
|
|
|
|
* Remarks: o This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
|
* o This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
* o You should have received a copy of the GNU General Public
|
|
|
|
|
* License along with this program; if not, write to the Free
|
|
|
|
|
* Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
|
* MA 02111-1307 USA
|
1999-03-18 16:08:57 +01:00
|
|
|
|
*
|
1999-03-30 11:42:51 +02:00
|
|
|
|
* Revision History:
|
1999-03-18 16:08:57 +01:00
|
|
|
|
*
|
1999-04-04 18:11:39 +02:00
|
|
|
|
* $Log: lexer.l,v $
|
1999-07-22 14:21:14 +02:00
|
|
|
|
* Revision 1.12 1999/07/02 11:58:15 tsjensen
|
|
|
|
|
* Added begin_speedmode() which is called by parser.y
|
|
|
|
|
* Added state SPEEDMODE for fast skipping of designs
|
|
|
|
|
* Introduced definitions for PWORD, PBOX, and PWHITE (whitespace)
|
|
|
|
|
* Added %options nounput and noyywrap for easier compilation/linking
|
|
|
|
|
*
|
1999-07-02 13:58:15 +02:00
|
|
|
|
* Revision 1.11 1999/06/28 18:37:38 tsjensen
|
|
|
|
|
* Replaced DEBUG macro with LEXER_DEBUG, which is now activated in boxes.h
|
|
|
|
|
* New tokens to, with, global, once
|
|
|
|
|
* Added LEX_MAX_WARN macro to limit number of lex errors printed per design
|
|
|
|
|
* Replaced exit()s with return YUNREC where errors are not fatal
|
|
|
|
|
*
|
1999-06-28 20:37:38 +02:00
|
|
|
|
* Revision 1.10 1999/06/28 12:17:46 tsjensen
|
|
|
|
|
* Added tokens YBOX and YEND (thus, BOX and END are no longer YKEYWORDs)
|
|
|
|
|
* Added #define FILE_LEXER_L around #include boxes.h to please compiler
|
|
|
|
|
*
|
1999-06-28 14:17:46 +02:00
|
|
|
|
* Revision 1.9 1999/06/22 12:00:05 tsjensen
|
|
|
|
|
* Added #undef DEBUG, because DEBUGging is now activated in boxes.h
|
|
|
|
|
* Added #include tools.h
|
|
|
|
|
*
|
1999-06-22 14:00:05 +02:00
|
|
|
|
* Revision 1.8 1999/06/20 14:17:58 tsjensen
|
|
|
|
|
* Added "padding" keyword and recogintion of numbers (YNUMBER)
|
|
|
|
|
*
|
1999-06-20 16:17:58 +02:00
|
|
|
|
* Revision 1.7 1999/06/17 19:05:46 tsjensen
|
|
|
|
|
* Bugfix: Sample block analysis didn't handle empty blocks
|
|
|
|
|
*
|
1999-06-17 21:05:46 +02:00
|
|
|
|
* Revision 1.6 1999/06/14 12:13:41 tsjensen
|
|
|
|
|
* Added Reverse pattern
|
|
|
|
|
*
|
1999-06-14 14:13:41 +02:00
|
|
|
|
* Revision 1.5 1999/06/03 18:54:55 tsjensen
|
|
|
|
|
* *** empty log message ***
|
|
|
|
|
*
|
1999-06-03 20:54:33 +02:00
|
|
|
|
* Revision 1.4 1999/04/09 13:31:13 tsjensen
|
|
|
|
|
* Removed all code related to OFFSET blocks (obsolete)
|
|
|
|
|
*
|
1999-04-09 15:31:13 +02:00
|
|
|
|
* Revision 1.3 1999/04/04 16:11:39 tsjensen
|
|
|
|
|
* Added indent keyword
|
|
|
|
|
* Added Replace token
|
|
|
|
|
* Some fiddling which will hopefully fix a line counting bug
|
|
|
|
|
*
|
1999-04-04 18:11:39 +02:00
|
|
|
|
* Revision 1.2 1999/03/30 09:42:51 tsjensen
|
|
|
|
|
* Added rcs keywords and standard file header.
|
|
|
|
|
*
|
|
|
|
|
* Revision 1.1 1999/03/18 15:09:48 tsjensen
|
|
|
|
|
* Initial revision
|
1999-03-30 11:42:51 +02:00
|
|
|
|
*
|
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
1999-03-18 16:08:57 +01:00
|
|
|
|
*/
|
|
|
|
|
|
1999-07-22 14:21:14 +02:00
|
|
|
|
#include "config.h"
|
1999-03-18 16:08:57 +01:00
|
|
|
|
#include <string.h>
|
1999-06-28 14:17:46 +02:00
|
|
|
|
#include "shape.h"
|
|
|
|
|
#define FILE_LEXER_L
|
1999-03-18 16:08:57 +01:00
|
|
|
|
#include "boxes.h"
|
1999-06-28 14:17:46 +02:00
|
|
|
|
#undef FILE_LEXER_L
|
1999-06-22 14:00:05 +02:00
|
|
|
|
#include "tools.h"
|
1999-07-02 13:58:15 +02:00
|
|
|
|
#include "parser.h"
|
1999-07-22 14:21:14 +02:00
|
|
|
|
#include "lexer.h"
|
1999-03-18 16:08:57 +01:00
|
|
|
|
|
1999-06-28 20:37:38 +02:00
|
|
|
|
|
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
#define LEX_MAX_WARN 3 /* number of lex errors per design */
|
1999-06-22 14:00:05 +02:00
|
|
|
|
|
1999-06-28 14:17:46 +02:00
|
|
|
|
|
|
|
|
|
static const char rcsid_lexer_l[] =
|
1999-07-22 14:21:14 +02:00
|
|
|
|
"$Id: lexer.l,v 1.12 1999/07/02 11:58:15 tsjensen Exp tsjensen $";
|
1999-06-28 14:17:46 +02:00
|
|
|
|
|
1999-03-30 11:42:51 +02:00
|
|
|
|
|
1999-03-18 16:08:57 +01:00
|
|
|
|
int yylineno = 1;
|
1999-06-28 20:37:38 +02:00
|
|
|
|
int yyerrcnt = 0;
|
1999-03-18 16:08:57 +01:00
|
|
|
|
|
|
|
|
|
%}
|
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
%option nounput
|
|
|
|
|
%option noyywrap
|
|
|
|
|
|
1999-03-18 16:08:57 +01:00
|
|
|
|
%x SAMPLE1
|
|
|
|
|
%x SAMPLE2
|
1999-07-02 13:58:15 +02:00
|
|
|
|
%x SPEEDMODE
|
1999-03-18 16:08:57 +01:00
|
|
|
|
%s SHAPES
|
|
|
|
|
%s ELASTIC
|
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
PWORD [a-zA-Z<><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD>][a-zA-Z0-9\-_<><5F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]*
|
|
|
|
|
PWHITE [\n \r\t]
|
|
|
|
|
PBOX Box
|
|
|
|
|
|
1999-03-18 16:08:57 +01:00
|
|
|
|
%%
|
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
<SAMPLE1,SHAPES,ELASTIC,INITIAL>[ \r\t] /* ignore whitespace */
|
1999-03-18 16:08:57 +01:00
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
<SAMPLE1,SHAPES,ELASTIC,INITIAL>\n ++yylineno;
|
1999-03-18 16:08:57 +01:00
|
|
|
|
|
|
|
|
|
\"[^"\n]*$ {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
if (yyerrcnt++ < 5)
|
|
|
|
|
yyerror ("Unterminated String at %s", yytext);
|
|
|
|
|
return YUNREC;
|
1999-03-18 16:08:57 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
\"[^"\n]*\" {
|
|
|
|
|
int bidx = yyleng-2; /* backslash index */
|
|
|
|
|
|
|
|
|
|
while (yytext[bidx] == '\\') bidx--;
|
|
|
|
|
|
|
|
|
|
if ((yyleng-2-bidx) % 2) {
|
|
|
|
|
yyless (yyleng-1); /* give back last quote */
|
|
|
|
|
yymore(); /* append next string */
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
for (bidx=0; bidx<yyleng-1; ++bidx) {
|
|
|
|
|
if (yytext[bidx] == '\\') {
|
|
|
|
|
memmove (yytext+bidx, yytext+bidx+1, yyleng-bidx-1);
|
|
|
|
|
yytext[yyleng-1] = '\0';
|
|
|
|
|
--yyleng; /* inefficient */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
memmove (yytext, yytext+1, yyleng-1); /* cut quotes */
|
|
|
|
|
--yyleng;
|
|
|
|
|
yytext[yyleng-1] = '\0';
|
|
|
|
|
--yyleng;
|
|
|
|
|
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\n STRING: \"%s\"", yytext);
|
|
|
|
|
#endif
|
|
|
|
|
yylval.s = (char *) strdup (yytext);
|
1999-06-28 20:37:38 +02:00
|
|
|
|
if (yylval.s == NULL) {
|
|
|
|
|
perror (PROJECT);
|
|
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
|
}
|
1999-03-18 16:08:57 +01:00
|
|
|
|
return STRING;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Sample {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\n WORD: %s -- STATE SAMPLE1", yytext);
|
|
|
|
|
#endif
|
|
|
|
|
BEGIN SAMPLE1;
|
|
|
|
|
return YSAMPLE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<SAMPLE1>\{ {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\n SYMBOL: \'%c\' -- STATE SAMPLE2", yytext[0]);
|
|
|
|
|
#endif
|
|
|
|
|
BEGIN SAMPLE2;
|
|
|
|
|
return yytext[0];
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
<SAMPLE1>[^\{\n\r\t ]+ {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
if (yyerrcnt++ < 5)
|
|
|
|
|
yyerror ("Syntax Error at \"%s\"", yytext);
|
|
|
|
|
return YUNREC;
|
1999-03-18 16:08:57 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<SAMPLE2>\n {
|
|
|
|
|
++yylineno;
|
|
|
|
|
if (yyleng > 1)
|
|
|
|
|
yymore();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<SAMPLE2>\} {
|
|
|
|
|
int bidx = yyleng-2; /* backslash index */
|
|
|
|
|
|
|
|
|
|
if (bidx >= 0) {
|
|
|
|
|
while (bidx >= 0 && yytext[bidx] == '\\') bidx--;
|
|
|
|
|
|
|
|
|
|
if ((yyleng-2-bidx) % 2) { /* odd number of backslashes */
|
|
|
|
|
yymore(); /* append next string */
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
yyless (yyleng-1); /* have him recognize '}' symbol */
|
|
|
|
|
|
|
|
|
|
for (bidx=yyleng-1; yytext[bidx]=='\n'; --bidx) {
|
|
|
|
|
yytext[bidx] = '\0'; /* remove trailing newlines */
|
|
|
|
|
--yyleng;
|
|
|
|
|
}
|
|
|
|
|
for (bidx=0; bidx<yyleng-1; ++bidx) {
|
|
|
|
|
if (yytext[bidx] == '\\') {
|
|
|
|
|
memmove (yytext+bidx, yytext+bidx+1, yyleng-bidx-1);
|
|
|
|
|
yytext[yyleng-1] = '\0';
|
|
|
|
|
--yyleng; /* inefficient */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
BEGIN INITIAL;
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\n SAMPLE: %s -- STATE INITIAL", yytext);
|
|
|
|
|
#endif
|
|
|
|
|
yylval.s = (char *) strdup (yytext);
|
1999-06-28 20:37:38 +02:00
|
|
|
|
if (yylval.s == NULL) {
|
|
|
|
|
perror (PROJECT);
|
|
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
|
}
|
1999-03-18 16:08:57 +01:00
|
|
|
|
return STRING;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
if (yyerrcnt++ < 5)
|
|
|
|
|
yyerror ("SAMPLE entry must not be empty");
|
|
|
|
|
return YUNREC;
|
1999-03-18 16:08:57 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<SAMPLE2>. {
|
|
|
|
|
yymore();
|
|
|
|
|
}
|
|
|
|
|
|
1999-06-28 20:37:38 +02:00
|
|
|
|
Elastic {
|
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\nYELASTC: %s -- STATE ELASTIC", yytext);
|
|
|
|
|
#endif
|
|
|
|
|
BEGIN ELASTIC;
|
|
|
|
|
return YELASTIC;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Shapes {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\nYSHAPES: %s -- STATE SHAPES", yytext);
|
|
|
|
|
#endif
|
|
|
|
|
BEGIN SHAPES;
|
|
|
|
|
return YSHAPES;
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
{PBOX} {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-07-02 13:58:15 +02:00
|
|
|
|
fprintf (stderr, "\n YBOX: %s", yytext);
|
1999-06-28 14:17:46 +02:00
|
|
|
|
#endif
|
1999-06-28 20:37:38 +02:00
|
|
|
|
yyerrcnt = 0;
|
1999-06-28 14:17:46 +02:00
|
|
|
|
return YBOX;
|
|
|
|
|
}
|
|
|
|
|
|
1999-06-28 20:37:38 +02:00
|
|
|
|
Replace { return YREPLACE; }
|
|
|
|
|
Reverse { return YREVERSE; }
|
|
|
|
|
Padding { return YPADDING; }
|
|
|
|
|
End { return YEND; }
|
|
|
|
|
To { return YTO; }
|
|
|
|
|
With { return YWITH; }
|
|
|
|
|
Global { yylval.c = 'g'; return YRXPFLAG; }
|
|
|
|
|
Once { yylval.c = 'o'; return YRXPFLAG; }
|
1999-06-28 14:17:46 +02:00
|
|
|
|
|
1999-03-18 16:08:57 +01:00
|
|
|
|
|
|
|
|
|
<SHAPES,ELASTIC>nw { yylval.shape = NW; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>nnw { yylval.shape = NNW; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>n { yylval.shape = N; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>nne { yylval.shape = NNE; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>ne { yylval.shape = NE; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>ene { yylval.shape = ENE; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>e { yylval.shape = E; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>ese { yylval.shape = ESE; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>se { yylval.shape = SE; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>sse { yylval.shape = SSE; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>s { yylval.shape = S; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>ssw { yylval.shape = SSW; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>sw { yylval.shape = SW; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>wsw { yylval.shape = WSW; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>w { yylval.shape = W; return SHAPE; }
|
|
|
|
|
<SHAPES,ELASTIC>wnw { yylval.shape = WNW; return SHAPE; }
|
|
|
|
|
|
|
|
|
|
<ELASTIC>\) {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\n SYMBOL: \'%c\' -- STATE INITIAL", yytext[0]);
|
|
|
|
|
#endif
|
|
|
|
|
BEGIN INITIAL;
|
|
|
|
|
return yytext[0];
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-09 15:31:13 +02:00
|
|
|
|
<SHAPES>\} {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\n SYMBOL: \'%c\' -- STATE INITIAL", yytext[0]);
|
|
|
|
|
#endif
|
|
|
|
|
BEGIN INITIAL;
|
|
|
|
|
return yytext[0];
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-09 15:31:13 +02:00
|
|
|
|
|
1999-06-28 14:17:46 +02:00
|
|
|
|
author|created|revision|revdate|indent {
|
1999-03-18 16:08:57 +01:00
|
|
|
|
/*
|
1999-04-04 18:11:39 +02:00
|
|
|
|
* general key words
|
1999-03-18 16:08:57 +01:00
|
|
|
|
*/
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\nKEYWORD: %s", yytext);
|
|
|
|
|
#endif
|
|
|
|
|
yylval.s = (char *) strdup (yytext);
|
1999-06-28 20:37:38 +02:00
|
|
|
|
if (yylval.s == NULL) {
|
|
|
|
|
perror (PROJECT);
|
|
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
|
}
|
1999-03-18 16:08:57 +01:00
|
|
|
|
return KEYWORD;
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-09 15:31:13 +02:00
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
{PWORD} {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\n WORD: %s", yytext);
|
|
|
|
|
#endif
|
|
|
|
|
yylval.s = (char *) strdup (yytext);
|
1999-06-28 20:37:38 +02:00
|
|
|
|
if (yylval.s == NULL) {
|
|
|
|
|
perror (PROJECT);
|
|
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
|
}
|
1999-03-18 16:08:57 +01:00
|
|
|
|
return WORD;
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-09 15:31:13 +02:00
|
|
|
|
|
1999-06-20 16:17:58 +02:00
|
|
|
|
[\+-]?[0-9]+ {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-06-20 16:17:58 +02:00
|
|
|
|
fprintf (stderr, "\nYNUMBER: %s", yytext);
|
|
|
|
|
#endif
|
|
|
|
|
yylval.num = atoi (yytext);
|
|
|
|
|
return YNUMBER;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1999-03-18 16:08:57 +01:00
|
|
|
|
[,(){}] {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-03-18 16:08:57 +01:00
|
|
|
|
fprintf (stderr, "\n SYMBOL: \'%c\'", yytext[0]);
|
|
|
|
|
#endif
|
|
|
|
|
return yytext[0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1999-04-04 18:11:39 +02:00
|
|
|
|
#.*$ {
|
|
|
|
|
/* ignore comments */
|
1999-06-28 20:37:38 +02:00
|
|
|
|
#ifdef LEXER_DEBUG
|
1999-04-04 18:11:39 +02:00
|
|
|
|
fprintf (stderr, "\nCOMMENT: %s", yytext+1);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-09 15:31:13 +02:00
|
|
|
|
|
1999-03-18 16:08:57 +01:00
|
|
|
|
. {
|
1999-06-28 20:37:38 +02:00
|
|
|
|
if (yyerrcnt++ < LEX_MAX_WARN)
|
1999-07-02 13:58:15 +02:00
|
|
|
|
yyerror ("Unrecognized input char \'%s\'", yytext);
|
1999-06-28 20:37:38 +02:00
|
|
|
|
return YUNREC;
|
1999-03-18 16:08:57 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
<SPEEDMODE>{PBOX}{PWHITE}+{PWORD} {
|
|
|
|
|
#ifdef LEXER_DEBUG
|
|
|
|
|
fprintf (stderr, "\n STATUS: %s -- BEGIN INITIAL", yytext);
|
|
|
|
|
#endif
|
|
|
|
|
yyless (0);
|
|
|
|
|
speeding = 0;
|
|
|
|
|
BEGIN INITIAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<SPEEDMODE>\n ++yylineno;
|
|
|
|
|
|
|
|
|
|
<SPEEDMODE>. /* ignore anything else */
|
|
|
|
|
|
|
|
|
|
|
1999-03-18 16:08:57 +01:00
|
|
|
|
%%
|
|
|
|
|
|
|
|
|
|
|
1999-07-02 13:58:15 +02:00
|
|
|
|
void begin_speedmode()
|
|
|
|
|
{
|
|
|
|
|
#ifdef LEXER_DEBUG
|
|
|
|
|
fprintf (stderr, "\n STATUS: begin_speedmode() -- STATE SPEEDMODE");
|
|
|
|
|
#endif
|
|
|
|
|
BEGIN SPEEDMODE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1999-03-18 16:08:57 +01:00
|
|
|
|
/*EOF*/ /* vim: set cindent sw=4: */
|