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
|
%{
// Copyright (C) 2007-2011, Ondra Kamenik
#include "location.h"
#include "csv_tab.hh"
extern YYLTYPE csv_lloc;
#define YY_USER_ACTION SET_LLOC(csv_);
%}
%option nounput
%option noyy_top_state
%option yylineno
%option prefix="csv_"
%option never-interactive
%%
, {return COMMA;}
\n {return NEWLINE;}
\r\n {return NEWLINE;}
[^,\n\r]+ {return ITEM;}
%%
int csv_wrap()
{
return 1;
}
void csv__destroy_buffer(void* p)
{
csv__delete_buffer((YY_BUFFER_STATE)p);
}
|