File: driveprm.lex

package info (click to toggle)
fdutils 5.3-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,004 kB
  • ctags: 621
  • sloc: ansic: 6,098; sh: 2,236; makefile: 279; sed: 4
file content (59 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (9)
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
%{
#include <stdio.h>
#include <string.h>
#include "parse.h"
#include "driveprmP.h"
#include "driveprm.h"
static int lineno;
static int col;
%}

%option noyywrap

vid     [A-Za-z_][A-Za-z0-9_]*
number	(0x[a-zA-Z0-9]+|-?[0-9]+)(KB|s)?

%%
\n { col = 0; lineno++;}
[ \t]  col++;
#.*\n   { col = 0; lineno++;}
drive[0-7]: {
	col += yyleng;
        if(*found) return 0;
	_zero_all(ids, size, mask);

	yytext[yyleng-1]='\0';
	if(yytext[5] - '0' == drivenum)
		*found = 1;
}

3.5      |
5.25     |
8        |
ss       |
SS       |
ds       |
DS       |
sd       |
SD       |
dd       |
DD       |
qd       |
QD       |
hd       |
HD       |
ed       |
ED       |
{vid}={number} {
	col += yyleng;
	_set_int(yytext, ids, size, mask);
}

[^\t \n][^\t =\n]* {
	fprintf(stderr,
		"Syntax error in " DRIVEPRMFILE 
		" at line %d col %d: %s unexpected\n",
		lineno + 1, col + 1, yytext_ptr);
	return 1;
}
%%