~ubuntu-branches/ubuntu/saucy/gperiodic/saucy

« back to all changes in this revision

Viewing changes to src/gplexer.l

  • Committer: Bazaar Package Importer
  • Author(s): Josip Rodin
  • Date: 2002-02-19 23:35:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020219233523-gamxg27l3zc18oh9
Tags: upstream-1.3.3
ImportĀ upstreamĀ versionĀ 1.3.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%option noyywrap
 
2
 
 
3
%{
 
4
#include "gparser.h"
 
5
int line = 0;
 
6
int col  = 0;
 
7
%}
 
8
 
 
9
%%
 
10
 
 
11
[a-zA-Z][a-zA-Z0-9]*    { col += strlen(yytext); return WORD; }
 
12
 
 
13
[0-9]+                  { col += strlen(yytext); return INT_NUMBER; }
 
14
 
 
15
;                       { ++col;                 return COMMAND_SEPERATOR; }
 
16
 
 
17
[\t ]+                  { col += strlen(yytext); }
 
18
 
 
19
\n                      { col = 0; ++line; }
 
20
 
 
21
.                       { return *yytext; }
 
22
 
 
23
%%
 
24
 
 
25
void init_lexer(void)
 
26
{
 
27
  line = 0;
 
28
  col  = 0;
 
29
}
 
30
 
 
31
void cleanup_lexer(void)
 
32
{
 
33
}