Tim: Got your point. We will update VFR doc to explain it. Thanks Liming From: Tim Lewis [mailto:tim.le...@insyde.com] Sent: Wednesday, June 10, 2015 6:46 PM To: edk2-devel@lists.sourceforge.net Cc: Lawrence Chiu Subject: Re: [edk2] "cond" vs. ?
There is already an example in the VFR specification. But there is no comment to indicate which is "TRUE" and which is "FALSE" From: Gao, Liming [mailto:liming....@intel.com] Sent: Wednesday, June 10, 2015 6:04 PM To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net> Cc: Lawrence Chiu Subject: Re: [edk2] "cond" vs. ? Tim: How about add one example in VFR spec to explain it? Thanks Liming From: Tim Lewis [mailto:tim.le...@insyde.com] Sent: Wednesday, June 10, 2015 5:11 PM To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net> Cc: Lawrence Chiu Subject: Re: [edk2] "cond" vs. ? Yes. But this is confusing because the VFR specification is not clear. As a result, many programmers assume that the cond() operator will work like the C ? operator. How do we get the VFR specification updated? Thanks, Tim From: Gao, Liming [mailto:liming....@intel.com] Sent: Wednesday, June 10, 2015 5:01 PM To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net> Cc: Lawrence Chiu Subject: Re: [edk2] "cond" vs. ? Lewis: Second way. If (expr1) then x = expr3 else expr2 Thanks Liming From: Tim Lewis [mailto:tim.le...@insyde.com] Sent: Wednesday, June 10, 2015 10:48 AM To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net> Cc: Lawrence Chiu Subject: [edk2] "cond" vs. ? Folks - It appears that the VFR spec is not clear about how the 2nd and 3rd parameters of the "cond" operator are handled. cond(expr1, expr2, expr3) Is it: if (expr1) then x = expr2 else expr3 Or If (expr1) then x = expr3 else expr2 We have seen alternate implementations in the wild. Thanks, Tim The VFR spec says: conditionalExp ::= "cond" "(" vfrStatementExpression "?" vfrStatementExpression ":" vfrStatementExpression ")" BEHAVIORS AND RESTRICTIONS: Generates EFI_IFR_CONDITIONAL op-codes.VFR Description in BNF 52 Example: numeric varid = MyData.Data, prompt = STRING_TOKEN(STR_PROMPT), help = STRING_TOKEN(STR_HELP), minimum = 0, maximum = 255, default value = cond(2 == 1 ? 5 : 10), endnumeric;
------------------------------------------------------------------------------
_______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel