diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-18 12:17:25 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-18 12:17:25 +0000 |
commit | b36d134faf4305247830522b8e2bb255e98c5699 (patch) | |
tree | ec37795cbc86b693528a062030cb516039bcb1c2 /BaseTools/Source/C/VfrCompile/VfrSyntax.g | |
parent | e7fe4028631b6a7d70e3c02c7c40ff1504321daa (diff) | |
download | edk2-platforms-b36d134faf4305247830522b8e2bb255e98c5699.tar.xz |
Sync BaseTools Branch (version r2321) to EDKII main trunk.
Signed-off-by: lgao4
Reviewed-by: gikidy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12372 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/C/VfrCompile/VfrSyntax.g')
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrSyntax.g | 64 |
1 files changed, 50 insertions, 14 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g index 081c67d715..0cd87bb5e8 100644 --- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g +++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g @@ -1387,19 +1387,21 @@ vfrFormDefinition : CIfrLabel LObj3;
LObj3.SetLineNo(E->getLine());
LObj3.SetNumber (0xffff); //add end label for UEFI, label number hardcode 0xffff
- //
- // Declare undefined Question
- //
- if (gCFormPkg.HavePendingUnassigned()) {
- gCFormPkg.DeclarePendingQuestion (
- gCVfrVarDataTypeDB,
- mCVfrDataStorage,
- mCVfrQuestionDB,
- &mFormsetGuid,
- E->getLine()
- );
- }
}
+
+ //
+ // Declare undefined Question so that they can be used in expression.
+ //
+ if (gCFormPkg.HavePendingUnassigned()) {
+ gCFormPkg.DeclarePendingQuestion (
+ gCVfrVarDataTypeDB,
+ mCVfrDataStorage,
+ mCVfrQuestionDB,
+ &mFormsetGuid,
+ E->getLine()
+ );
+ }
+
//
// mCVfrQuestionDB.PrintAllQuestion();
//
@@ -2110,6 +2112,7 @@ vfrStatementNumeric : <<
CIfrNumeric NObj;
UINT32 DataTypeSize;
+ BOOLEAN IsSupported;
>>
L:Numeric << NObj.SetLineNo(L->getLine()); >>
vfrQuestionHeader[NObj] "," << // check data type
@@ -2125,7 +2128,23 @@ vfrStatementNumeric : }
vfrSetMinMaxStep[NObj]
vfrStatementQuestionOptionList
- E:EndNumeric << CRT_END_OP (E); >>
+ E:EndNumeric <<
+ IsSupported = FALSE;
+ switch (_GET_CURRQEST_DATATYPE()) {
+ case EFI_IFR_TYPE_NUM_SIZE_8:
+ case EFI_IFR_TYPE_NUM_SIZE_16:
+ case EFI_IFR_TYPE_NUM_SIZE_32:
+ case EFI_IFR_TYPE_NUM_SIZE_64:
+ IsSupported = TRUE;
+ break;
+ default:
+ break;
+ }
+ if (!IsSupported) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Numeric question only support UINT8, UINT16, UINT32 and UINT64 data type.");
+ }
+ CRT_END_OP (E);
+ >>
";"
;
@@ -2170,6 +2189,7 @@ vfrStatementOneOf : <<
CIfrOneOf OObj;
UINT32 DataTypeSize;
+ BOOLEAN IsSupported;
>>
L:OneOf << OObj.SetLineNo(L->getLine()); >>
vfrQuestionHeader[OObj] "," << //check data type
@@ -2184,7 +2204,23 @@ vfrStatementOneOf : vfrSetMinMaxStep[OObj]
}
vfrStatementQuestionOptionList
- E:EndOneOf << CRT_END_OP (E); >>
+ E:EndOneOf <<
+ IsSupported = FALSE;
+ switch (_GET_CURRQEST_DATATYPE()) {
+ case EFI_IFR_TYPE_NUM_SIZE_8:
+ case EFI_IFR_TYPE_NUM_SIZE_16:
+ case EFI_IFR_TYPE_NUM_SIZE_32:
+ case EFI_IFR_TYPE_NUM_SIZE_64:
+ IsSupported = TRUE;
+ break;
+ default:
+ break;
+ }
+ if (!IsSupported) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "OneOf question only support UINT8, UINT16, UINT32 and UINT64 data type.");
+ }
+ CRT_END_OP (E);
+ >>
";"
;
|