From d3563bc21018a5f76bb888c607226153ea02de0c Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 17 Jul 2012 23:51:40 +0100 Subject: [PATCH] V0.9: Allow a UDP instance to have a simple real delay. The parser does not distinguish between module and UDP instances, so a UDP delay is handled by the rules used for parsing module parameter overrides. Although these rules had been relaxed to accept the case of a simple decimal value (e.g. #10), they did not allow a simple real value (e.g. #0.1). --- parse.y | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/parse.y b/parse.y index 8e6b91458..7af5dde5b 100644 --- a/parse.y +++ b/parse.y @@ -2758,7 +2758,9 @@ from_exclude : K_from { $$ = false; } | K_exclude { $$ = true; } ; Although the BNF in IEEE1364-1995 implies that parameter value lists must be in parentheses, in practice most compilers will accept simple expressions outside of parentheses if there is only - one value, so I'll accept simple numbers here. + one value, so I'll accept simple numbers here. This also catches + the case of a UDP with a single delay value, so we need to accept + real values as well as decimal ones. The parameter value by name syntax is OVI enhancement BTF-B06 as approved by WG1364 on 6/28/1998. */ @@ -2788,6 +2790,17 @@ parameter_value_opt $$ = lst; based_size = 0; } + | '#' REALTIME + { assert($2); + PEFNumber*tmp = new PEFNumber($2); + FILE_NAME(tmp, @1); + + struct parmvalue_t*lst = new struct parmvalue_t; + lst->by_order = new svector(1); + (*lst->by_order)[0] = tmp; + lst->by_name = 0; + $$ = lst; + } | '#' error { yyerror(@1, "error: syntax error in parameter value " "assignment list.");