diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-29 21:00:11 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-29 21:00:11 +0200 |
commit | 1ff55d4c9acb9e1688bf76f12ae5ae26027ce113 (patch) | |
tree | f2181f8b1d558cd8dd34ccb1ad4306aae5391c01 /mmss/config.l | |
parent | b15c16f12ca6838e5ebefc80c11dcf7933bce8bc (diff) | |
download | gmrf-1ff55d4c9acb9e1688bf76f12ae5ae26027ce113.tar gmrf-1ff55d4c9acb9e1688bf76f12ae5ae26027ce113.zip |
Implement simple packet loss simulation
Diffstat (limited to 'mmss/config.l')
-rw-r--r-- | mmss/config.l | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mmss/config.l b/mmss/config.l index 4fdd346..33d9631 100644 --- a/mmss/config.l +++ b/mmss/config.l @@ -57,7 +57,8 @@ %} <INITIAL>{ -[0-9]+ { UPDATE_LOCATION; yylval->num = atoi(yytext); BEGIN(NEEDSPACE); return TOK_INTEGER; } +[0-9]+ { UPDATE_LOCATION; yylval->num = std::atoi(yytext); BEGIN(NEEDSPACE); return TOK_INTEGER; } +[0-9]*\.[0-9]+ { UPDATE_LOCATION; yylval->fnum = float(std::atof(yytext)); BEGIN(NEEDSPACE); return TOK_FLOAT; } yes { TOKEN(TOK_YES); } no { TOKEN(TOK_NO); } @@ -68,6 +69,13 @@ load { TOKEN(TOK_LOAD); } default { TOKEN(TOK_DEFAULT); } interface { TOKEN(TOK_INTERFACE); } address { TOKEN(TOK_ADDRESS); } +etx { TOKEN(TOK_ETX); } +const { TOKEN(TOK_CONST); } +min { TOKEN(TOK_MIN); } +max { TOKEN(TOK_MAX); } +sine { TOKEN(TOK_SINE); } +period { TOKEN(TOK_PERIOD); } +phase { TOKEN(TOK_PHASE); } ([[:xdigit:]]{2}:){7}[[:xdigit:]]{2} { UPDATE_LOCATION; @@ -86,6 +94,13 @@ address { TOKEN(TOK_ADDRESS); } \r ; } +<INITIAL,NEEDSPACE>{ +s { TOKEN(TOK_S); } +m { TOKEN(TOK_M); } +h { TOKEN(TOK_H); } +days { TOKEN(TOK_DAYS); } +} + <NEEDSPACE>{ [;:\{\}] { UPDATE_LOCATION; BEGIN(INITIAL); return yytext[0]; } |