1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
%{
/*
* +-------------------------------------------------------+
* | |
* | videogen |
* | |
* | a simple XFree86 Modeline calculator |
* | (c) 1997-2002, Szabolcs Rumi |
* | |
* | http://www.rtfm.hu/videogen |
* | |
* | the videogen package is distributed under the |
* | GNU General Public License Version 2 (GPLv2) |
* | |
* +-------------------------------------------------------+
*/
/* this should be generated as a case insensitive lexer */
#include <stdlib.h>
#include "config.h"
#include "videogen.h"
#include "cfg.tab.h"
unsigned int lexer_num_lines = 1; /* start line counting from 1 */
%}
%option outfile="cfg.yy.c"
%option noyywrap
%%
= { return ('='); }
[0-9]+[.][0-9]+ { yylval.fval = atof (yytext);
return (T_FLOAT); }
[0-9]+ { yylval.ival = atol (yytext);
return (T_INTEGER); }
yes|y|on { yylval.bval = 1;
return (T_BOOLEAN); }
no|n|off { yylval.bval = 0;
return (T_BOOLEAN); }
verbose { return (T_VERBOSE); }
fbset { return (T_FBSET); }
nvidia { return (T_NVIDIA); }
mode { return (T_MODE); }
max_dotclk { return (T_MAX_DOTCLK); }
max_hfreq { return (T_MAX_HFREQ); }
max_vfreq { return (T_MAX_VFREQ); }
desired_vfreq { return (T_DESIRED_VFREQ); }
hvisible { return (T_HVISIBLE); }
vvisible { return (T_VVISIBLE); }
hfporch { return (T_HFPORCH); }
hbporch { return (T_HBPORCH); }
hsync { return (T_HSYNC); }
vfporch { return (T_VFPORCH); }
vbporch { return (T_VBPORCH); }
vsync { return (T_VSYNC); }
; { return (';'); }
\n { lexer_num_lines++;
return ('\n'); }
#[^\n]* /* eat up shell-style comments */
[ \t]+ /* eat up blanks */
x { return ('x'); }
. {
pmsg(VL_DEBUG, "[lexer] unrecognized character: %s\n", yytext );
}
%%
/* EOF */
|