8
code for parsing calibration file, generated by flex
10
Copyright (C) 2003 Frank Mori Hess <fmhess@users.sourceforge.net
12
This library is free software; you can redistribute it and/or
13
modify it under the terms of the GNU Lesser General Public
14
License as published by the Free Software Foundation, version 2.1
17
This library is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
Lesser General Public License for more details.
22
You should have received a copy of the GNU Lesser General Public
23
License along with this library; if not, write to the Free Software
24
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
29
#include "libinternal.h"
30
#include "calib_yacc.h"
40
calib_llocp->first_line = 1;
43
<STRING,INITIAL>\n { calib_llocp->first_line++; }
45
"#" { BEGIN(COMMENT); }
46
<COMMENT>\n { calib_llocp->first_line++; BEGIN(INITIAL); }
51
if( strlen( calib_yytext ) > 0 )
52
calib_yytext[ strlen( calib_yytext ) - 1 ] = 0;
53
calib_lvalp->sval = calib_yytext;
58
driver_name { return ( T_DRIVER_NAME ); }
59
board_name { return ( T_BOARD_NAME ); }
60
calibrations { return ( T_CALIBRATIONS ); }
61
subdevice { return ( T_SUBDEVICE); }
62
channels { return (T_CHANNELS); }
63
ranges { return ( T_RANGES ); }
64
arefs { return ( T_AREFS ); }
65
caldacs { return ( T_CALDACS ); }
66
channel { return ( T_CHANNEL ); }
67
value { return ( T_VALUE ); }
68
=> { return ( T_ASSIGN ); };
70
(0[xX])?(00)?[0-9a-fA-F]+ { calib_lvalp->ival = strtol( calib_yytext, NULL, 0 );
75
. { return( calib_yytext[0] ); }