summaryrefslogtreecommitdiffstats
path: root/src/tools/vppapigen/lex.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-09-28 15:11:16 -0400
committerOle Troan <ot@cisco.com>2017-10-09 13:32:40 +0200
commit0d056e5ede136cd0111dc3f9f41ef7b36a938027 (patch)
tree2f7c61d50f922a55ab7da199e0304a581ee7516f /src/tools/vppapigen/lex.c
parent87da476db0cd804e11463cc453a2bb41c6808542 (diff)
vppapigen: support per-file (major,minor,patch) version stamps
Add one of these statements to foo.api: vl_api_version 1.2.3 to generate a version tuple stanza in foo.api.h: /****** Version tuple *****/ vl_api_version_tuple(foo, 1, 2, 3) Change-Id: Ic514439e4677999daa8463a94f948f76b132ff15 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/tools/vppapigen/lex.c')
-rw-r--r--src/tools/vppapigen/lex.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/vppapigen/lex.c b/src/tools/vppapigen/lex.c
index e63581433b7..d9f82c2b9f1 100644
--- a/src/tools/vppapigen/lex.c
+++ b/src/tools/vppapigen/lex.c
@@ -581,6 +581,9 @@ static int yylex_1 (void)
case ',':
return (COMMA);
+ case '.':
+ return (DOT);
+
case '"':
nameidx = 0;
the_lexer_state = STRING_STATE;
@@ -937,6 +940,8 @@ int yylex (void)
case TYPEONLY: code = 278; break;
case DONT_TRACE: code = 279; break;
case AUTOREPLY: code = 280; break;
+ case DOT: code = 281; break;
+ case VL_API_VERSION: code = 282; break;
case EOF: code = ~0; break; /* hysterical compatibility */
@@ -996,6 +1001,7 @@ static struct keytab {
{"u8", NODE_U8},
{"union", NODE_UNION},
{"uword", NODE_UWORD},
+ {"vl_api_version", NODE_VERSION},
};
static int name_check (const char *s, YYSTYPE *token_value)
@@ -1061,6 +1067,9 @@ static int name_check (const char *s, YYSTYPE *token_value)
case NODE_NOVERSION:
return(NOVERSION);
+ case NODE_VERSION:
+ return(VL_API_VERSION);
+
case NODE_UNION:
return(UNION);