~ubuntu-branches/ubuntu/lucid/igraph/lucid

« back to all changes in this revision

Viewing changes to src/foreign-lgl-lexer.l

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Malaterre
  • Date: 2009-11-16 18:12:42 UTC
  • Revision ID: james.westby@ubuntu.com-20091116181242-mzv9p5fz9uj57xd1
Tags: upstream-0.5.3
ImportĀ upstreamĀ versionĀ 0.5.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
   IGraph library.
 
3
   Copyright (C) 2006  Gabor Csardi <csardi@rmki.kfki.hu>
 
4
   MTA RMKI, Konkoly-Thege Miklos st. 29-33, Budapest 1121, Hungary
 
5
   
 
6
   This program is free software; you can redistribute it and/or modify
 
7
   it under the terms of the GNU General Public License as published by
 
8
   the Free Software Foundation; either version 2 of the License, or
 
9
   (at your option) any later version.
 
10
   
 
11
   This program is distributed in the hope that it will be useful,
 
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
   GNU General Public License for more details.
 
15
   
 
16
   You should have received a copy of the GNU General Public License
 
17
   along with this program; if not, write to the Free Software
 
18
   Foundation, Inc.,  51 Franklin Street, Fifth Floor, Boston, MA 
 
19
   02110-1301 USA
 
20
 
 
21
*/
 
22
 
 
23
%{
 
24
 
 
25
/* 
 
26
   IGraph library.
 
27
   Copyright (C) 2006  Gabor Csardi <csardi@rmki.kfki.hu>
 
28
   MTA RMKI, Konkoly-Thege Miklos st. 29-33, Budapest 1121, Hungary
 
29
   
 
30
   This program is free software; you can redistribute it and/or modify
 
31
   it under the terms of the GNU General Public License as published by
 
32
   the Free Software Foundation; either version 2 of the License, or
 
33
   (at your option) any later version.
 
34
   
 
35
   This program is distributed in the hope that it will be useful,
 
36
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
37
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
38
   GNU General Public License for more details.
 
39
   
 
40
   You should have received a copy of the GNU General Public License
 
41
   along with this program; if not, write to the Free Software
 
42
   Foundation, Inc.,  51 Franklin Street, Fifth Floor, Boston, MA 
 
43
   02110-1301 USA
 
44
 
 
45
*/
 
46
 
 
47
#include "config.h"
 
48
#include <stdlib.h>
 
49
#include "foreign-lgl-parser.h"
 
50
extern long int igraph_lgl_mylineno;
 
51
int igraph_i_lgl_eof;
 
52
void igraph_i_lgl_reset_scanner() {
 
53
  YY_FLUSH_BUFFER;
 
54
}
 
55
%}
 
56
 
 
57
%option noyywrap
 
58
%option prefix="igraph_lgl_yy"
 
59
%option outfile="lex.yy.c"
 
60
%option nounput
 
61
%option noinput
 
62
 
 
63
alnum [^ \t\r\n#]
 
64
 
 
65
%%
 
66
 
 
67
 /* --------------------------------------------------hashmark------*/
 
68
#                    { return HASH; }
 
69
 
 
70
 /* ------------------------------------------------whitespace------*/
 
71
[ \t]*               { }
 
72
 
 
73
 /* ---------------------------------------------------newline------*/
 
74
\n\r|\r\n|\n|\r      { igraph_lgl_mylineno++; return NEWLINE; }
 
75
 
 
76
 /* ----------------------------------------------alphanumeric------*/
 
77
{alnum}+             { return ALNUM; }
 
78
 
 
79
<<EOF>>           { if (igraph_i_lgl_eof) {
 
80
                       yyterminate();
 
81
                    } else {
 
82
                       igraph_i_lgl_eof=1;
 
83
                       return NEWLINE; 
 
84
                    }
 
85
                  }
 
86
 
 
87
%%