~ubuntu-branches/ubuntu/trusty/c++-annotations/trusty

« back to all changes in this revision

Viewing changes to yo/concrete/unrestricted/scanner/lexer

  • Committer: Package Import Robot
  • Author(s): Frank B. Brokken
  • Date: 2012-01-20 11:53:17 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20120120115317-v4wiq9sttx72fabk
Tags: 9.1.0-1
New upstream release (covering C++11 to a large extend)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%{
 
2
    #define SKIP_FLEXLEXER_
 
3
    #include "scanner.ih"
 
4
 
 
5
    #include "../parser/preinclude.h"
 
6
    #include "../parser/parserbase.h"
 
7
%}
 
8
 
 
9
%option yyclass="Scanner" outfile="yylex.cc"
 
10
%option c++ 8bit warn noyywrap yylineno
 
11
%option debug
 
12
 
 
13
%%
 
14
 
 
15
[ \t]+                          // skip white space
 
16
\n                              // same
 
17
 
 
18
[0-9]+      {
 
19
                *d_semval = Semantic(Semantic::INT, yytext);
 
20
                return Parser::INT;
 
21
            }
 
22
 
 
23
[a-zA-Z_][a-zA-Z0-9_]*  {
 
24
                *d_semval = Semantic(Semantic::IDENTIFIER, yytext);
 
25
                return Parser::IDENTIFIER;
 
26
            }
 
27
 
 
28
.           return yytext[0];
 
29
 
 
30
 
 
31
%%
 
32
 
 
33
 
 
34