summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Sample
diff options
context:
space:
mode:
authorTian, Hot <hot.tian@intel.com>2014-01-23 05:27:14 +0000
committerhhtian <hhtian@6f19259b-4bc3-4df7-8a09-765794883524>2014-01-23 05:27:14 +0000
commit2b53e39435ee46ccf7addaef2a9b32fdfbc30fc0 (patch)
tree34621bd9212da64d0ba5f806a9d2e24c2d9f224d /EdkCompatibilityPkg/Sample
parent675723cbcaa67746062d8af9af16f5d342ba12f6 (diff)
downloadedk2-2b53e39435ee46ccf7addaef2a9b32fdfbc30fc0.zip
edk2-2b53e39435ee46ccf7addaef2a9b32fdfbc30fc0.tar.gz
edk2-2b53e39435ee46ccf7addaef2a9b32fdfbc30fc0.tar.bz2
Fix CRLF format
Signed-off-by: Tian, Hot <hot.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15172 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Sample')
-rw-r--r--EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrCompiler.h36
-rw-r--r--EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrSyntax.g708
2 files changed, 372 insertions, 372 deletions
diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrCompiler.h b/EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrCompiler.h
index bc487f8..006f0bd 100644
--- a/EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrCompiler.h
+++ b/EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrCompiler.h
@@ -1,20 +1,20 @@
-/*++
-
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- VfrCompiler.h
-
-Abstract:
-
+/*++
+
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ VfrCompiler.h
+
+Abstract:
+
--*/
#ifndef _VFRCOMPILER_H_
@@ -56,7 +56,7 @@ typedef struct {
INT8 PreprocessorOutputFileName[MAX_PATH];
INT8 VfrBaseFileName[MAX_PATH]; // name of input VFR file with no path or extension
INT8 *IncludePaths;
- bool SkipCPreprocessor;
+ bool SkipCPreprocessor;
INT8 *CPreprocessorOptions;
} OPTIONS;
diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrSyntax.g b/EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrSyntax.g
index 85060c8..f5b7d5d 100644
--- a/EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrSyntax.g
+++ b/EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrSyntax.g
@@ -1,18 +1,18 @@
-/*++
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
- VfrSyntax.g
-
-Abstract:
-
+/*++
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+ VfrSyntax.g
+
+Abstract:
+
--*/
#header<<
@@ -156,7 +156,7 @@ VfrParserStart (
#token Inventory("inventory") "inventory"
#token NonNvDataMap("_NON_NV_DATA_MAP") "_NON_NV_DATA_MAP"
#token Struct("struct") "struct"
-#token Boolean("BOOLEAN") "BOOLEAN"
+#token Boolean("BOOLEAN") "BOOLEAN"
#token Uint64("UINT64") "UINT64"
#token Uint32("UINT32") "UINT32"
#token Uint16("UINT16") "UINT16"
@@ -198,7 +198,7 @@ VfrParserStart (
#token OptionOnlyFlag("OPTIONS_ONLY") "OPTIONS_ONLY"
#token Class("class") "class"
#token Subclass("subclass") "subclass"
-#token ClassGuid("classguid") "classguid"
+#token ClassGuid("classguid") "classguid"
#token TypeDef("typedef") "typedef"
#token Restore("restore") "restore"
#token Save("save") "save"
@@ -254,9 +254,9 @@ VfrParserStart (
//
vfrProgram > [UINT8 Return] :
- <<
+ <<
mParserStatus = 0;
- mConstantOnlyInExpression = FALSE;
+ mConstantOnlyInExpression = FALSE;
>>
(
vfrPragmaPackDefinition
@@ -267,48 +267,48 @@ vfrProgram > [UINT8 Return] :
;
pragmaPackShowDef :
- L:"show" << mCVfrVarDataTypeDB.Pack (L->getLine(), VFR_PACK_SHOW); >>
- ;
+ L:"show" << mCVfrVarDataTypeDB.Pack (L->getLine(), VFR_PACK_SHOW); >>
+ ;
pragmaPackStackDef :
- <<
- UINT32 LineNum;
- UINT8 PackAction;
- INT8 *Identifier = NULL;
- UINT32 PackNumber = DEFAULT_PACK_ALIGN;
- >>
- (
- L1:"push" << LineNum = L1->getLine(); PackAction = VFR_PACK_PUSH; >>
- | L2:"pop" << LineNum = L2->getLine(); PackAction = VFR_PACK_POP; >>
- )
- {
- "," ID:StringIdentifier << Identifier = ID->getText(); >>
- }
- {
- "," N:Number << PackAction |= VFR_PACK_ASSIGN; PackNumber = _STOU32(N->getText()); >>
- }
- << mCVfrVarDataTypeDB.Pack (LineNum, PackAction, Identifier, PackNumber); >>
- ;
-
-pragmaPackNumber :
- <<
- UINT32 LineNum;
- UINT32 PackNumber = DEFAULT_PACK_ALIGN;
- >>
- N:Number << LineNum = N->getLine(); PackNumber = _STOU32(N->getText()); >>
- << mCVfrVarDataTypeDB.Pack (LineNum, VFR_PACK_ASSIGN, NULL, PackNumber); >>
- ;
-
-vfrPragmaPackDefinition :
- "\#pragma" "pack" "\("
- {
- pragmaPackShowDef
- | pragmaPackStackDef
- | pragmaPackNumber
- }
- "\)"
- ;
-
+ <<
+ UINT32 LineNum;
+ UINT8 PackAction;
+ INT8 *Identifier = NULL;
+ UINT32 PackNumber = DEFAULT_PACK_ALIGN;
+ >>
+ (
+ L1:"push" << LineNum = L1->getLine(); PackAction = VFR_PACK_PUSH; >>
+ | L2:"pop" << LineNum = L2->getLine(); PackAction = VFR_PACK_POP; >>
+ )
+ {
+ "," ID:StringIdentifier << Identifier = ID->getText(); >>
+ }
+ {
+ "," N:Number << PackAction |= VFR_PACK_ASSIGN; PackNumber = _STOU32(N->getText()); >>
+ }
+ << mCVfrVarDataTypeDB.Pack (LineNum, PackAction, Identifier, PackNumber); >>
+ ;
+
+pragmaPackNumber :
+ <<
+ UINT32 LineNum;
+ UINT32 PackNumber = DEFAULT_PACK_ALIGN;
+ >>
+ N:Number << LineNum = N->getLine(); PackNumber = _STOU32(N->getText()); >>
+ << mCVfrVarDataTypeDB.Pack (LineNum, VFR_PACK_ASSIGN, NULL, PackNumber); >>
+ ;
+
+vfrPragmaPackDefinition :
+ "\#pragma" "pack" "\("
+ {
+ pragmaPackShowDef
+ | pragmaPackStackDef
+ | pragmaPackNumber
+ }
+ "\)"
+ ;
+
vfrDataStructDefinition :
{ TypeDef } Struct << mCVfrVarDataTypeDB.DeclareDataTypeBegin (); >>
{ NonNvDataMap }
@@ -433,86 +433,86 @@ dataStructFieldUser :
// the syntax of GUID definition
//
guidSubDefinition [EFI_GUID &Guid] :
- G4:Number "," G5:Number "," G6:Number "," G7:Number "," G8:Number "," G9:Number "," G10:Number "," G11:Number
+ G4:Number "," G5:Number "," G6:Number "," G7:Number "," G8:Number "," G9:Number "," G10:Number "," G11:Number
<<
Guid.Data4[0] = _STOU8(G4->getText());
Guid.Data4[1] = _STOU8(G5->getText());
Guid.Data4[2] = _STOU8(G6->getText());
- Guid.Data4[3] = _STOU8(G7->getText());
- Guid.Data4[4] = _STOU8(G8->getText());
- Guid.Data4[5] = _STOU8(G9->getText());
- Guid.Data4[6] = _STOU8(G10->getText());
- Guid.Data4[7] = _STOU8(G11->getText());
+ Guid.Data4[3] = _STOU8(G7->getText());
+ Guid.Data4[4] = _STOU8(G8->getText());
+ Guid.Data4[5] = _STOU8(G9->getText());
+ Guid.Data4[6] = _STOU8(G10->getText());
+ Guid.Data4[7] = _STOU8(G11->getText());
>>
;
-guidDefinition [EFI_GUID &Guid] :
+guidDefinition [EFI_GUID &Guid] :
OpenBrace
G1:Number "," G2:Number "," G3:Number ","
- <<
- Guid.Data1 = _STOU32 (G1->getText());
- Guid.Data2 = _STOU16 (G2->getText());
- Guid.Data3 = _STOU16 (G3->getText());
- >>
- (
- OpenBrace guidSubDefinition[Guid] CloseBrace
- | guidSubDefinition[Guid]
- )
+ <<
+ Guid.Data1 = _STOU32 (G1->getText());
+ Guid.Data2 = _STOU16 (G2->getText());
+ Guid.Data3 = _STOU16 (G3->getText());
+ >>
+ (
+ OpenBrace guidSubDefinition[Guid] CloseBrace
+ | guidSubDefinition[Guid]
+ )
CloseBrace
- ;
-
-//*****************************************************************************
-//
-// the syntax of form set definition
-//
-vfrFormSetDefinition :
+ ;
+
+//*****************************************************************************
+//
+// the syntax of form set definition
+//
+vfrFormSetDefinition :
<<
EFI_GUID Guid;
EFI_GUID DefaultClassGuid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID;
EFI_GUID ClassGuids[10];
UINT8 ClassGuidNum = 0;
CIfrFormSet *FSObj = NULL;
- UINT16 C, SC;
+ UINT16 C, SC;
>>
- L:FormSet
- Uuid "=" guidDefinition[Guid] ","
- Title "=" "STRING_TOKEN" "\(" S1:Number "\)" ","
- Help "=" "STRING_TOKEN" "\(" S2:Number "\)" ","
- {
- ClassGuid "=" guidDefinition[ClassGuids[ClassGuidNum]] << ++ClassGuidNum; >>
- (
- "\|" guidDefinition[ClassGuids[ClassGuidNum]] << ++ClassGuidNum; >>
- )*
+ L:FormSet
+ Uuid "=" guidDefinition[Guid] ","
+ Title "=" "STRING_TOKEN" "\(" S1:Number "\)" ","
+ Help "=" "STRING_TOKEN" "\(" S2:Number "\)" ","
+ {
+ ClassGuid "=" guidDefinition[ClassGuids[ClassGuidNum]] << ++ClassGuidNum; >>
+ (
+ "\|" guidDefinition[ClassGuids[ClassGuidNum]] << ++ClassGuidNum; >>
+ )*
","
- }
- <<
- switch (ClassGuidNum) {
- case 0:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET));
- FSObj->SetClassGuid(&DefaultClassGuid);
- break;
- case 1:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET));
- FSObj->SetClassGuid(&ClassGuids[0]);
- break;
- case 2:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + sizeof(EFI_GUID));
- FSObj->SetClassGuid(&ClassGuids[0]);
- FSObj->SetClassGuid(&ClassGuids[1]);
- break;
- default:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + 2 * sizeof(EFI_GUID));
- FSObj->SetClassGuid(&ClassGuids[0]);
- FSObj->SetClassGuid(&ClassGuids[1]);
- FSObj->SetClassGuid(&ClassGuids[2]);
- break;
- }
-
- SET_LINE_INFO (*FSObj, L);
- FSObj->SetGuid (&Guid);
+ }
+ <<
+ switch (ClassGuidNum) {
+ case 0:
+ FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET));
+ FSObj->SetClassGuid(&DefaultClassGuid);
+ break;
+ case 1:
+ FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET));
+ FSObj->SetClassGuid(&ClassGuids[0]);
+ break;
+ case 2:
+ FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + sizeof(EFI_GUID));
+ FSObj->SetClassGuid(&ClassGuids[0]);
+ FSObj->SetClassGuid(&ClassGuids[1]);
+ break;
+ default:
+ FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + 2 * sizeof(EFI_GUID));
+ FSObj->SetClassGuid(&ClassGuids[0]);
+ FSObj->SetClassGuid(&ClassGuids[1]);
+ FSObj->SetClassGuid(&ClassGuids[2]);
+ break;
+ }
+
+ SET_LINE_INFO (*FSObj, L);
+ FSObj->SetGuid (&Guid);
FSObj->SetFormSetTitle (_STOSID(S1->getText()));
FSObj->SetHelp (_STOSID(S2->getText()));
- >>
+ >>
{
Class "=" classDefinition[C] "," << {CIfrClass CObj; CObj.SetClass(C);} >>
}
@@ -582,14 +582,14 @@ vfrStatementVarStoreLinear :
)
{ Key "=" Number "," } // Key is used to assign Varid in Framework VFR but no use in UEFI2.1 VFR
{
- VarId "=" ID:Number "," <<
- _PCATCH(
+ VarId "=" ID:Number "," <<
+ _PCATCH(
(INTN)(VarStoreId = _STOU16(ID->getText())) != 0,
- (INTN)TRUE,
- ID,
- "varid 0 is not allowed."
- );
- >>
+ (INTN)TRUE,
+ ID,
+ "varid 0 is not allowed."
+ );
+ >>
}
Name "=" SN:StringIdentifier ","
Uuid "=" guidDefinition[Guid]
@@ -689,10 +689,10 @@ subclassDefinition[UINT16 & SubClass] :
;
vfrStatementDisableIfFormSet :
- <<
+ <<
CIfrDisableIf DIObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
D:DisableIf << DIObj.SetLineNo(D->getLine()); >>
vfrStatementExpression[0, ExpOpCount] ";" << mConstantOnlyInExpression = FALSE; >>
vfrFormSetList
@@ -791,7 +791,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, INT8 *&QuestVarIdStr] :
INT8 *VarStr = NULL;
INT8 *SName = NULL;
INT8 *TName = NULL;
- EFI_IFR_TYPE_VALUE Dummy = {0};
+ EFI_IFR_TYPE_VALUE Dummy = {0};
>>
(
SN1:StringIdentifier << SName = SN1->getText(); _STRCAT(&VarIdStr, SN1->getText()); >>
@@ -832,19 +832,19 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, INT8 *&QuestVarIdStr] :
case EFI_VFR_VARSTORE_BUFFER:
_PCATCH(mCVfrVarDataTypeDB.GetDataFieldInfo (VarStr, $Info.mInfo.mVarOffset, $Info.mVarType, $Info.mVarTotalSize), SN2->getLine());
//_PCATCH(mCVfrDataStorage.BufferVarStoreRequestElementAdd (SName, Info), SN2);
- _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Register (
- SName,
- NULL),
- SN2->getLine());
- _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Write (
- 'a',
- SName,
- NULL,
- $Info.mVarType,
- $Info.mInfo.mVarOffset,
- $Info.mVarTotalSize,
- Dummy),
- SN2->getLine());
+ _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Register (
+ SName,
+ NULL),
+ SN2->getLine());
+ _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Write (
+ 'a',
+ SName,
+ NULL,
+ $Info.mVarType,
+ $Info.mInfo.mVarOffset,
+ $Info.mVarTotalSize,
+ Dummy),
+ SN2->getLine());
break;
case EFI_VFR_VARSTORE_NAME:
default: break;
@@ -863,10 +863,10 @@ vfrQuestionDataFieldName [EFI_QUESTION_ID &QId, UINT32 &Mask, INT8 *&VarIdStr, U
OpenBracket I1:Number CloseBracket << _STRCAT(&VarIdStr, "["); _STRCAT(&VarIdStr, I1->getText()); _STRCAT(&VarIdStr, "]"); >>
<< mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, $QId, $Mask); >>
) <<
- if (mConstantOnlyInExpression) {
- _PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo);
- }
- >>
+ if (mConstantOnlyInExpression) {
+ _PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo);
+ }
+ >>
|
(
SN2:StringIdentifier << _STRCAT (&VarIdStr, SN2->getText()); LineNo = SN2->getLine(); >>
@@ -879,10 +879,10 @@ vfrQuestionDataFieldName [EFI_QUESTION_ID &QId, UINT32 &Mask, INT8 *&VarIdStr, U
)*
<< mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, $QId, $Mask); >>
) <<
- if (mConstantOnlyInExpression) {
- _PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo);
- }
- >>
+ if (mConstantOnlyInExpression) {
+ _PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo);
+ }
+ >>
;
vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] :
@@ -949,10 +949,10 @@ vfrFormDefinition :
;
vfrStatementRules :
- <<
+ <<
CIfrRule RObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
R:Rule << RObj.SetLineNo(R->getLine()); >>
S1:StringIdentifier "," <<
mCVfrRulesDB.RegisterRule (S1->getText());
@@ -977,15 +977,15 @@ vfrStatementDefault :
(
vfrStatementValue "," << IsExp = TRUE; DObj.SetScope (1); CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >>
| "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] "," <<
- if (gCurrentMinMaxData != NULL && gCurrentMinMaxData->IsNumericOpcode()) {
- //check default value is valid for Numeric Opcode
- if (Val.u64 < gCurrentMinMaxData->GetMinData(_GET_CURRQEST_DATATYPE()) || Val.u64 > gCurrentMinMaxData->GetMaxData(_GET_CURRQEST_DATATYPE())) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, D->getLine(), "Numeric default value must be between MinValue and MaxValue.");
- }
- }
+ if (gCurrentMinMaxData != NULL && gCurrentMinMaxData->IsNumericOpcode()) {
+ //check default value is valid for Numeric Opcode
+ if (Val.u64 < gCurrentMinMaxData->GetMinData(_GET_CURRQEST_DATATYPE()) || Val.u64 > gCurrentMinMaxData->GetMaxData(_GET_CURRQEST_DATATYPE())) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, D->getLine(), "Numeric default value must be between MinValue and MaxValue.");
+ }
+ }
DObj.SetType (_GET_CURRQEST_DATATYPE());
- DObj.SetValue(Val);
- >>
+ DObj.SetValue(Val);
+ >>
)
{
DefaultStore "=" SN:StringIdentifier "," << _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN); DObj.SetDefaultId (DefaultId); >>
@@ -999,9 +999,9 @@ vfrStatementDefault :
_GET_CURRQEST_VARTINFO(),
VarStoreName,
_GET_CURRQEST_DATATYPE (),
- Val),
+ Val),
D->getLine()
- );
+ );
}
>>
)
@@ -1045,13 +1045,13 @@ flagsField :
;
vfrStatementValue :
- <<
+ <<
CIfrValue VObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
V:Value << VObj.SetLineNo(V->getLine()); >>
"=" vfrStatementExpression[0, ExpOpCount]
- << { CIfrEnd EndObj; EndObj.SetLineNo(0); } >>
+ << { CIfrEnd EndObj; EndObj.SetLineNo(0); } >>
;
vfrStatementSubTitle :
@@ -1095,7 +1095,7 @@ vfrStatementStaticText :
<<
if (Flags & EFI_IFR_FLAG_CALLBACK) {
CIfrAction AObj;
- AObj.SetLineNo (T->getLine());
+ AObj.SetLineNo (T->getLine());
mCVfrQuestionDB.RegisterQuestion (NULL, NULL, QId);
AObj.SetQuestionId (QId);
AObj.SetPrompt (_STOSID(S2->getText()));
@@ -1287,46 +1287,46 @@ vfrStatementBooleanType :
vfrStatementCheckBox :
<<
CIfrCheckBox CBObj;
- EFI_IFR_TYPE_VALUE Val = {0};
- INT8 *VarStoreName = NULL;
+ EFI_IFR_TYPE_VALUE Val = {0};
+ INT8 *VarStoreName = NULL;
>>
L:CheckBox << CBObj.SetLineNo(L->getLine()); >>
vfrQuestionHeader[CBObj] ","
- {
+ {
F:FLAGS "=" vfrCheckBoxFlags[CBObj, F->getLine()] ","
- <<
- _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), VFR_RETURN_SUCCESS, L, "Failed to retrieve varstore name");
- Val.b = TRUE;
- if (CBObj.GetFlags () & 0x01) {
- _PCATCH(
- mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
- EFI_HII_DEFAULT_CLASS_STANDARD,
- _GET_CURRQEST_VARTINFO(),
- VarStoreName,
- _GET_CURRQEST_DATATYPE (),
- Val
- ),
- VFR_RETURN_SUCCESS,
- L,
- "No standard default storage found"
- );
- }
- if (CBObj.GetFlags () & 0x02) {
- _PCATCH(
- mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
- EFI_HII_DEFAULT_CLASS_MANUFACTURING,
- _GET_CURRQEST_VARTINFO(),
- VarStoreName,
- _GET_CURRQEST_DATATYPE (),
- Val
- ),
- VFR_RETURN_SUCCESS,
- L,
- "No manufacturing default storage found"
- );
- }
- >>
- }
+ <<
+ _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), VFR_RETURN_SUCCESS, L, "Failed to retrieve varstore name");
+ Val.b = TRUE;
+ if (CBObj.GetFlags () & 0x01) {
+ _PCATCH(
+ mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
+ EFI_HII_DEFAULT_CLASS_STANDARD,
+ _GET_CURRQEST_VARTINFO(),
+ VarStoreName,
+ _GET_CURRQEST_DATATYPE (),
+ Val
+ ),
+ VFR_RETURN_SUCCESS,
+ L,
+ "No standard default storage found"
+ );
+ }
+ if (CBObj.GetFlags () & 0x02) {
+ _PCATCH(
+ mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
+ EFI_HII_DEFAULT_CLASS_MANUFACTURING,
+ _GET_CURRQEST_VARTINFO(),
+ VarStoreName,
+ _GET_CURRQEST_DATATYPE (),
+ Val
+ ),
+ VFR_RETURN_SUCCESS,
+ L,
+ "No manufacturing default storage found"
+ );
+ }
+ >>
+ }
{
Key "=" KN:Number "," << AssignQuestionKey (CBObj, KN); >>
}
@@ -1535,25 +1535,25 @@ vfrNumericFlags [CIfrNumeric & NObj, UINT32 LineNum] :
<<
UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE;
UINT8 HFlags = 0;
- EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
+ EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
>>
numericFlagsField[HFlags, LFlags] ( "\|" numericFlagsField[HFlags, LFlags] )*
- <<
- //check data type flag
- VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);
- if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {
- if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {
- _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");
- }
- } else {
- // update data type for name/value store
- UINT32 DataTypeSize;
- _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
- mCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);
- _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;
- }
+ <<
+ //check data type flag
+ VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);
+ if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {
+ if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {
+ _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");
+ }
+ } else {
+ // update data type for name/value store
+ UINT32 DataTypeSize;
+ _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
+ mCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);
+ _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;
+ }
_PCATCH(NObj.SetFlags (HFlags, LFlags), LineNum);
- >>
+ >>
;
numericFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
@@ -1561,10 +1561,10 @@ numericFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
| "NUMERIC_SIZE_1" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_1; >>
| "NUMERIC_SIZE_2" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_2; >>
| "NUMERIC_SIZE_4" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_4; >>
- | "NUMERIC_SIZE_8" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_8; >>
- | "DISPLAY_INT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_INT_DEC; >>
- | "DISPLAY_UINT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_DEC; >>
- | "DISPLAY_UINT_HEX" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_HEX; >>
+ | "NUMERIC_SIZE_8" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_8; >>
+ | "DISPLAY_INT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_INT_DEC; >>
+ | "DISPLAY_UINT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_DEC; >>
+ | "DISPLAY_UINT_HEX" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_HEX; >>
| questionheaderFlagsField[HFlags]
;
@@ -1587,25 +1587,25 @@ vfrOneofFlagsField [CIfrOneOf & OObj, UINT32 LineNum] :
<<
UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE;
UINT8 HFlags = 0;
- EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
+ EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
>>
numericFlagsField[HFlags, LFlags] ( "\|" numericFlagsField[HFlags, LFlags] )*
- <<
- //check data type flag
- VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);
- if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {
- if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {
- _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");
- }
- } else {
- // update data type for Name/Value store
- UINT32 DataTypeSize;
- _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
- mCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);
- _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;
- }
+ <<
+ //check data type flag
+ VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);
+ if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {
+ if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {
+ _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");
+ }
+ } else {
+ // update data type for Name/Value store
+ UINT32 DataTypeSize;
+ _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
+ mCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);
+ _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;
+ }
_PCATCH(OObj.SetFlags (HFlags, LFlags), LineNum);
- >>
+ >>
;
vfrStatementStringType :
@@ -1822,10 +1822,10 @@ vfrStatementStatList :
;
vfrStatementDisableIfStat :
- <<
+ <<
CIfrDisableIf DIObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
L:DisableIf << DIObj.SetLineNo(L->getLine()); >>
vfrStatementExpression[0, ExpOpCount] ";" << mConstantOnlyInExpression = FALSE; >>
( vfrStatementStatList )*
@@ -1834,10 +1834,10 @@ vfrStatementDisableIfStat :
;
vfrStatementSuppressIfStat :
- <<
+ <<
CIfrSuppressIf SIObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
L:SuppressIf << SIObj.SetLineNo(L->getLine()); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
vfrStatementExpression[0, ExpOpCount] ";"
@@ -1847,10 +1847,10 @@ vfrStatementSuppressIfStat :
;
vfrStatementGrayOutIfStat :
- <<
+ <<
CIfrGrayOutIf GOIObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
L:GrayOutIf << GOIObj.SetLineNo(L->getLine()); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
vfrStatementExpression[0, ExpOpCount]
@@ -1890,10 +1890,10 @@ vfrStatementLocked :
;
vfrStatementInconsistentIf :
- <<
+ <<
CIfrInconsistentIf IIObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
L:InconsistentIf << IIObj.SetLineNo(L->getLine()); >>
Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << IIObj.SetError (_STOSID(S->getText())); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
@@ -1902,10 +1902,10 @@ vfrStatementInconsistentIf :
;
vfrStatementNoSubmitIf :
- <<
+ <<
CIfrNoSubmitIf NSIObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
L:NoSubmitIf << NSIObj.SetLineNo(L->getLine()); >>
Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << NSIObj.SetError (_STOSID(S->getText())); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
@@ -1914,10 +1914,10 @@ vfrStatementNoSubmitIf :
;
vfrStatementDisableIfQuest :
- <<
+ <<
CIfrDisableIf DIObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
L:DisableIf << DIObj.SetLineNo(L->getLine()); >>
vfrStatementExpression[0, ExpOpCount] ";" << mConstantOnlyInExpression = FALSE; >>
vfrStatementQuestionOptionList
@@ -1937,10 +1937,10 @@ vfrStatementVarstoreDevice :
;
vfrStatementSuppressIfQuest :
- <<
+ <<
CIfrSuppressIf SIObj;
- UINT32 ExpOpCount = 0;
- >>
+ UINT32 ExpOpCount = 0;
+ >>
L:SuppressIf << SIObj.SetLineNo(L->getLine()); >>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
vfrStatementExpression[0, ExpOpCount] ";"
@@ -1962,30 +1962,30 @@ vfrStatementOneOfOption :
L:Option << OOOObj.SetLineNo(L->getLine()); >>
Text "=" "STRING_TOKEN" "\(" S:Number "\)" "," << OOOObj.SetOption (_STOSID(S->getText())); >>
Value "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] >[Val] ","
- <<
- if (gCurrentMinMaxData != NULL) {
- //set min/max value for oneof opcode
- UINT64 Step = gCurrentMinMaxData->GetStepData(_GET_CURRQEST_DATATYPE());
- switch (_GET_CURRQEST_DATATYPE()) {
- case EFI_IFR_TYPE_NUM_SIZE_64:
- gCurrentMinMaxData->SetMinMaxStepData(Val.u64, Val.u64, Step);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32:
- gCurrentMinMaxData->SetMinMaxStepData(Val.u32, Val.u32, (UINT32) Step);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16:
- gCurrentMinMaxData->SetMinMaxStepData(Val.u16, Val.u16, (UINT16) Step);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_8:
- gCurrentMinMaxData->SetMinMaxStepData(Val.u8, Val.u8, (UINT8) Step);
- break;
- default:
- break;
- }
- }
- OOOObj.SetType (_GET_CURRQEST_DATATYPE());
- OOOObj.SetValue (Val);
- >>
+ <<
+ if (gCurrentMinMaxData != NULL) {
+ //set min/max value for oneof opcode
+ UINT64 Step = gCurrentMinMaxData->GetStepData(_GET_CURRQEST_DATATYPE());
+ switch (_GET_CURRQEST_DATATYPE()) {
+ case EFI_IFR_TYPE_NUM_SIZE_64:
+ gCurrentMinMaxData->SetMinMaxStepData(Val.u64, Val.u64, Step);
+ break;
+ case EFI_IFR_TYPE_NUM_SIZE_32:
+ gCurrentMinMaxData->SetMinMaxStepData(Val.u32, Val.u32, (UINT32) Step);
+ break;
+ case EFI_IFR_TYPE_NUM_SIZE_16:
+ gCurrentMinMaxData->SetMinMaxStepData(Val.u16, Val.u16, (UINT16) Step);
+ break;
+ case EFI_IFR_TYPE_NUM_SIZE_8:
+ gCurrentMinMaxData->SetMinMaxStepData(Val.u8, Val.u8, (UINT8) Step);
+ break;
+ default:
+ break;
+ }
+ }
+ OOOObj.SetType (_GET_CURRQEST_DATATYPE());
+ OOOObj.SetValue (Val);
+ >>
F:FLAGS "=" vfrOneOfOptionFlags[OOOObj, F->getLine()]
<<
if (OOOObj.GetFlags () & 0x10) {
@@ -2066,7 +2066,7 @@ vfrStatementInvalidHidden :
;
vfrStatementInvalidInconsistentIf :
- << UINT32 ExpOpCount = 0; >>
+ << UINT32 ExpOpCount = 0; >>
InconsistentIf
Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" ","
{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
@@ -2237,28 +2237,28 @@ multdivmodTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
L3:"%" castTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrModulo MObj(L3->getLine()); >>
)
)*
- ;
-
-castTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- << UINT8 CastType = 0xFF; >>
- (
- L:"\("
- (
- Boolean << CastType = 0; >>
- | Uint64 << CastType = 1; >>
- | Uint32 << CastType = 1; >>
- | Uint16 << CastType = 1; >>
- | Uint8 << CastType = 1; >>
- )
- "\)"
- )*
- atomTerm[$RootLevel, $ExpOpCount]
- <<
- switch (CastType) {
- case 0: { CIfrToBoolean TBObj(L->getLine()); $ExpOpCount++; } break;
- case 1: { CIfrToUint TUObj(L->getLine()); $ExpOpCount++; } break;
- }
- >>
+ ;
+
+castTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
+ << UINT8 CastType = 0xFF; >>
+ (
+ L:"\("
+ (
+ Boolean << CastType = 0; >>
+ | Uint64 << CastType = 1; >>
+ | Uint32 << CastType = 1; >>
+ | Uint16 << CastType = 1; >>
+ | Uint8 << CastType = 1; >>
+ )
+ "\)"
+ )*
+ atomTerm[$RootLevel, $ExpOpCount]
+ <<
+ switch (CastType) {
+ case 0: { CIfrToBoolean TBObj(L->getLine()); $ExpOpCount++; } break;
+ case 1: { CIfrToUint TUObj(L->getLine()); $ExpOpCount++; } break;
+ }
+ >>
;
atomTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
@@ -2544,7 +2544,7 @@ vfrExpressionUnaryOp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
| bitwisenotExp[$RootLevel, $ExpOpCount]
| question2refExp[$RootLevel, $ExpOpCount]
| stringref2Exp[$RootLevel, $ExpOpCount]
- | toboolExp[$RootLevel, $ExpOpCount]
+ | toboolExp[$RootLevel, $ExpOpCount]
| unintExp[$RootLevel, $ExpOpCount]
| toupperExp[$RootLevel, $ExpOpCount]
| tolwerExp[$RootLevel, $ExpOpCount]
@@ -2700,7 +2700,7 @@ class EfiVfrParser {
<<
private:
UINT8 mParserStatus;
- BOOLEAN mConstantOnlyInExpression;
+ BOOLEAN mConstantOnlyInExpression;
CVfrDefaultStore mCVfrDefaultStore;
CVfrVarDataTypeDB mCVfrVarDataTypeDB;
@@ -2723,14 +2723,14 @@ private:
UINT8 _GET_CURRQEST_DATATYPE ();
UINT32 _GET_CURRQEST_VARSIZE ();
- UINT32 _GET_CURRQEST_ARRAY_SIZE ();
+ UINT32 _GET_CURRQEST_ARRAY_SIZE ();
public:
VOID _PCATCH (IN INTN, IN INTN, IN ANTLRTokenPtr, IN INT8 *);
VOID _PCATCH (IN EFI_VFR_RETURN_CODE);
VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN ANTLRTokenPtr);
VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32);
- VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32, IN INT8 *);
+ VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32, IN INT8 *);
VOID syn (ANTLRAbstractToken *, ANTLRChar *, SetWordType *, ANTLRTokenType, INT32);
@@ -2845,37 +2845,37 @@ EfiVfrParser::_GET_CURRQEST_VARSIZE (
return mCurrQestVarInfo.mVarTotalSize;
}
-UINT32
-EfiVfrParser::_GET_CURRQEST_ARRAY_SIZE (
- VOID
- )
-{
- UINT8 Size = 1;
-
- switch (mCurrQestVarInfo.mVarType) {
- case EFI_IFR_TYPE_NUM_SIZE_8:
- Size = 1;
- break;
-
- case EFI_IFR_TYPE_NUM_SIZE_16:
- Size = 2;
- break;
-
- case EFI_IFR_TYPE_NUM_SIZE_32:
- Size = 4;
- break;
-
- case EFI_IFR_TYPE_NUM_SIZE_64:
- Size = 8;
- break;
-
- default:
- break;
- }
-
- return (mCurrQestVarInfo.mVarTotalSize / Size);
-}
-
+UINT32
+EfiVfrParser::_GET_CURRQEST_ARRAY_SIZE (
+ VOID
+ )
+{
+ UINT8 Size = 1;
+
+ switch (mCurrQestVarInfo.mVarType) {
+ case EFI_IFR_TYPE_NUM_SIZE_8:
+ Size = 1;
+ break;
+
+ case EFI_IFR_TYPE_NUM_SIZE_16:
+ Size = 2;
+ break;
+
+ case EFI_IFR_TYPE_NUM_SIZE_32:
+ Size = 4;
+ break;
+
+ case EFI_IFR_TYPE_NUM_SIZE_64:
+ Size = 8;
+ break;
+
+ default:
+ break;
+ }
+
+ return (mCurrQestVarInfo.mVarTotalSize / Size);
+}
+
VOID
EfiVfrParser::_PCATCH (
IN INTN ReturnCode,
@@ -2914,16 +2914,16 @@ EfiVfrParser::_PCATCH (
)
{
mParserStatus += gCVfrErrorHandle.HandleError (ReturnCode, LineNum);
-}
-
-VOID
-EfiVfrParser::_PCATCH (
- IN EFI_VFR_RETURN_CODE ReturnCode,
- IN UINT32 LineNum,
- IN INT8 *ErrorMsg
- )
-{
- mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (ReturnCode, LineNum, ErrorMsg);
+}
+
+VOID
+EfiVfrParser::_PCATCH (
+ IN EFI_VFR_RETURN_CODE ReturnCode,
+ IN UINT32 LineNum,
+ IN INT8 *ErrorMsg
+ )
+{
+ mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (ReturnCode, LineNum, ErrorMsg);
}
VOID