Lewis:
Second way. If (expr1) then x = expr3 else expr2
Thanks
Liming
From: Tim Lewis [mailto:[email protected]]
Sent: Wednesday, June 10, 2015 10:48 AM
To: [email protected]
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel