diff options
author | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-10-18 10:00:38 +0200 |
---|---|---|
committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-11-24 21:20:27 +0100 |
commit | 2d6cc3704e7affeb56c798b39a942daca95385dc (patch) | |
tree | dd339c0bbc9305fa4352deff86da4d14f3a96c9d /src/config-flex.l | |
parent | e2052e8c5f9fa4dc50bdcf33ff96c6bcc71ca59e (diff) | |
download | latrace-2d6cc3704e7affeb56c798b39a942daca95385dc.tar.gz latrace-2d6cc3704e7affeb56c798b39a942daca95385dc.tar.xz latrace-2d6cc3704e7affeb56c798b39a942daca95385dc.zip |
error simulation: application part
Diffstat (limited to 'src/config-flex.l')
-rw-r--r-- | src/config-flex.l | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/config-flex.l b/src/config-flex.l index 433992f..3b761d7 100644 --- a/src/config-flex.l +++ b/src/config-flex.l @@ -30,6 +30,7 @@ extern struct lt_include *lt_config_sinc; +static int block_cnt; #define NEW_LINE() \ do { \ @@ -46,6 +47,17 @@ do { \ lt_config_lval.l = atol(lt_config_text); return token; \ } while(0) +#define BLOCK_BEGIN() \ +do { \ + block_cnt++; \ +} while(0) + +#define BLOCK_END() \ +do { \ + if (!--block_cnt) \ + BEGIN(INITIAL); \ +} while(0) + %} num [-0-9] @@ -54,7 +66,7 @@ name ([-0-9a-zA-Z\./_\-\*])+ bool YES|NO comment ^([\s\t])*#.* -%x comment include options +%x comment include options error %% @@ -106,6 +118,28 @@ OPTIONS { BEGIN(options); return OPTIONS; } <options>"\n" { NEW_LINE(); } <options>. { ; } +ERROR { BEGIN(error); return ERROR; } +<error>DIR { return ERR_DIR; } +<error>RUN { return ERR_RUN; } +<error>GO { return ERR_GO; } +<error>RETURN { return ERR_RETURN; } +<error>PROG { return ERR_PROG; } +<error>ARGS { return ERR_ARGS; } +<error>N { return ERR_N; } +<error>FILTER { return ERR_FILTER; } +<error>SEQ { return ERR_SEQ; } + +<error>{value} { RETURN_LONG(VALUE); } +<error>{name} { RETURN_STR(NAME); } +<error>{comment} { ; } +<error>"}" { BLOCK_END(); return '}'; } +<error>"{" { BLOCK_BEGIN(); return '{'; } +<error>"=" { return '='; } +<error>"\"" { return '"'; } +<error>"\\" { ; } +<error>"," { return ','; } +<error>"\n" { NEW_LINE(); } +<error>. { ; } %% #ifndef yywrap |