File: csv.lex

package info (click to toggle)
dynare 4.4.3-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 41,356 kB
  • ctags: 15,842
  • sloc: cpp: 77,029; ansic: 29,056; pascal: 13,241; sh: 4,811; objc: 3,061; yacc: 3,013; makefile: 1,479; lex: 1,258; python: 162; lisp: 54; xml: 8
file content (35 lines) | stat: -rw-r--r-- 540 bytes parent folder | download | duplicates (4)
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);
}