From fa42e25c4e498c57e15ebb0ded56502a61b7dc08 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Wed, 15 Jun 2016 16:38:33 +0200 Subject: VPP-118: add support for variable length arrays to jvpp * extends VPP's message definition language with the following syntax: u32 count: u8 array[count]; which is traslated to: u32 count; u8 array[0]; but now, python API representation generated by vppapigen contains information about where the array length is stored. * modifies existing response messages to use the new syntax Change-Id: I68210bc7a3a755d03d067e9b79a567f40e2d31f3 Signed-off-by: Marek Gradzki --- vppapigen/gram.y | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vppapigen/gram.y') diff --git a/vppapigen/gram.y b/vppapigen/gram.y index 09e20067128..ccdcc8f2573 100644 --- a/vppapigen/gram.y +++ b/vppapigen/gram.y @@ -31,6 +31,7 @@ void generate (YYSTYPE); YYSTYPE add_union(YYSTYPE, YYSTYPE); YYSTYPE add_scalar_vbl(YYSTYPE); YYSTYPE add_vector_vbl(YYSTYPE, YYSTYPE); + YYSTYPE add_variable_length_vector_vbl(YYSTYPE, YYSTYPE); YYSTYPE set_flags(YYSTYPE, YYSTYPE); %} @@ -86,4 +87,5 @@ onedef: PRIMTYPE vbl SEMI {$$ = add_primtype($1, $2, 0);} vbl: NAME {$$ = add_scalar_vbl($1);} | NAME LBRACK NUMBER RBRACK {$$ = add_vector_vbl($1, $3);} + | NAME LBRACK NAME RBRACK {$$ = add_variable_length_vector_vbl($1, $3);} ; -- cgit 1.2.3-korg