From 1ff55d4c9acb9e1688bf76f12ae5ae26027ce113 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 29 Jul 2013 21:00:11 +0200 Subject: Implement simple packet loss simulation --- mmss/config.l | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'mmss/config.l') 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 @@ %} { -[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 ; } +{ +s { TOKEN(TOK_S); } +m { TOKEN(TOK_M); } +h { TOKEN(TOK_H); } +days { TOKEN(TOK_DAYS); } +} + { [;:\{\}] { UPDATE_LOCATION; BEGIN(INITIAL); return yytext[0]; } -- cgit v1.2.3