lex.l (240365) | lex.l (250984) |
---|---|
1/* $FreeBSD: head/usr.bin/mkesdb/lex.l 240365 2012-09-11 16:32:31Z dim $ */ | 1/* $FreeBSD: head/usr.bin/mkesdb/lex.l 250984 2013-05-25 15:36:15Z ed $ */ |
2/* $NetBSD: lex.l,v 1.3 2006/02/09 22:03:15 dogcow Exp $ */ 3 4%{ 5/*- 6 * Copyright (c)2003 Citrus Project, 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 28 unchanged lines hidden (view full) --- 38#include <limits.h> 39#include <stdio.h> 40#include <stdlib.h> 41#include <string.h> 42 43#include "ldef.h" 44#include "yacc.h" 45 | 2/* $NetBSD: lex.l,v 1.3 2006/02/09 22:03:15 dogcow Exp $ */ 3 4%{ 5/*- 6 * Copyright (c)2003 Citrus Project, 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 28 unchanged lines hidden (view full) --- 38#include <limits.h> 39#include <stdio.h> 40#include <stdlib.h> 41#include <string.h> 42 43#include "ldef.h" 44#include "yacc.h" 45 |
46int line_number = 1; | 46int linenumber = 1; |
47%} 48%option noinput 49%option nounput 50 51%x COMMENT 52 53%% 54 55[ \t]+ { } | 47%} 48%option noinput 49%option nounput 50 51%x COMMENT 52 53%% 54 55[ \t]+ { } |
56#.*[\n]|"//".*[\n]|[\n] { line_number++; return (R_LN); } | 56#.*[\n]|"//".*[\n]|[\n] { linenumber++; return (R_LN); } |
57 58"/*" { BEGIN COMMENT; } 59<COMMENT>"*/" { BEGIN 0; } | 57 58"/*" { BEGIN COMMENT; } 59<COMMENT>"*/" { BEGIN 0; } |
60<COMMENT>[\n] { line_number++; } | 60 |
61<COMMENT>. { } 62<COMMENT><<EOF>> { 63 yyerror("unexpected file end (unterminated comment)\n"); 64 exit(1); 65 } 66 67([1-9][0-9]*)|(0[0-9]*)|(0[xX][0-9A-Fa-f]+) { 68 yylval.i_value = strtoul(yytext, NULL, 0); --- 32 unchanged lines hidden --- | 61<COMMENT>. { } 62<COMMENT><<EOF>> { 63 yyerror("unexpected file end (unterminated comment)\n"); 64 exit(1); 65 } 66 67([1-9][0-9]*)|(0[0-9]*)|(0[xX][0-9A-Fa-f]+) { 68 yylval.i_value = strtoul(yytext, NULL, 0); --- 32 unchanged lines hidden --- |