/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Development/parsers/test/lexer.fl

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
stdnum          [0-9]+(\.[0-9]*)?
 
2
scinum          [0-9]\.[0-9]+([eE][+\-][0-9]+)
 
3
num             ({stdnum}|{scinum})
 
4
var             [[:alpha:]][[:alnum:]]*
 
5
open_prnt       [\({\[]
 
6
close_prnt      [\)}\]]
 
7
operator        [+\-*/=]
 
8
endline         [\n]
 
9
 
 
10
%%
 
11
 
 
12
{num}           printf("%s", yytext);
 
13
{var}           printf("%s", yytext);
 
14
{operator}      printf("%s", yytext);
 
15
{open_prnt}     printf("(");
 
16
{close_prnt}    printf(")");
 
17
{endline}       printf(".\n");
 
18
.               ;
 
19
 
 
20
 
 
21
%%
 
22
 
 
23
main() {
 
24
    yylex();
 
25
}