/* lang.l 1.12 82/10/25 */
#define tprintf if (do_trace) printf
"cpu", CPU, "ident", IDENT, "config", CONFIG, "options", OPTIONS,
"device", DEVICE, "controller", CONTROLLER, "uba", UBA, "mba", MBA,
"csr", CSR, "nexus", NEXUS, "drive", DRIVE, "vector", VECTOR,
"pseudo-device", PSEUDO_DEVICE, "flags", FLAGS, "trace", TRACE,
"disk", DISK, "tape", DEVICE, "slave", SLAVE, "at", AT,
"hz", HZ, "timezone", TIMEZONE, "dst", DST, "maxusers", MAXUSERS,
"master", MASTER, "priority", PRIORITY,
WORD [A-Za-z_][-A-Za-z_]*
if ((i = kw_lookup(yytext)) == -1)
tprintf("id(%s) ", yytext);
tprintf("(%s) ", yytext);
yytext[strlen(yytext)-1] = '\0';
yylval.val = octal(yytext);
tprintf("#O:%o ", yylval.val);
yylval.val = hex(yytext);
tprintf("#X:%x ", yylval.val);
yylval.val = atoi(yytext);
tprintf("#D:%d ", yylval.val);
yylval.val = (int) (60 * atof(yytext) + 0.5);
#.* { /* Ignored (comment) */; }
[ \t]* { /* Ignored (white space) */; }
";" { return SEMICOLON; }
* Look up a string in the keyword table. Returns a -1 if the
* string is not a keyword otherwise it returns the keyword number
for (kp = key_words; kp->kt_name != 0; kp++)
if (eq(word, kp->kt_name))
* Number conversion routines
(void) sscanf(str, "%o", &num);
(void) sscanf(str+2, "%x", &num);