a. Merged bug fixes from R8 tree
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 13 May 2008 09:29:57 +0000 (09:29 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Tue, 13 May 2008 09:29:57 +0000 (09:29 +0000)
b. Fixed default storage issue
c. Changed the error message to standard format

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1223 7335b38e-4728-0410-8992-fb3ffe349368

Source/C/Common/EfiUtilityMsgs.c
Source/C/VfrCompile/VfrError.cpp
Source/C/VfrCompile/VfrFormPkg.h
Source/C/VfrCompile/VfrSyntax.g

index 36f2cf1..7f55155 100644 (file)
@@ -1,23 +1,23 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2004 - 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
 \r
-Module Name:  \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
 \r
   EfiUtilityMsgs.c\r
-  \r
+\r
 Abstract:\r
 \r
   EFI tools utility functions to display warning, error, and informational\r
   messages.\r
-  \r
+\r
 --*/\r
 \r
 #include <stdio.h>\r
@@ -75,33 +75,33 @@ Error (
 \r
 Routine Description:\r
   Prints an error message.\r
-  \r
+\r
 Arguments:\r
   All arguments are optional, though the printed message may be useless if\r
   at least something valid is not specified.\r
-  \r
+\r
   FileName - name of the file or application. If not specified, then the\r
              utilty name (as set by the utility calling SetUtilityName()\r
              earlier) is used. Otherwise "Unknown utility" is used.\r
-  \r
+\r
   LineNumber - the line number of error, typically used by parsers. If the\r
                utility is not a parser, then 0 should be specified. Otherwise\r
                the FileName and LineNumber info can be used to cause\r
                MS Visual Studio to jump to the error.\r
-               \r
+\r
   MessageCode - an application-specific error code that can be referenced in\r
-              other documentation. \r
+              other documentation.\r
 \r
   Text        - the text in question, typically used by parsers.\r
-  \r
+\r
   MsgFmt - the format string for the error message. Can contain formatting\r
            controls for use with the varargs.\r
-           \r
+\r
 Returns:\r
   None.\r
-  \r
+\r
 Notes:\r
-  We print the following (similar to the Warn() and Debug() \r
+  We print the following (similar to the Warn() and Debug()\r
   W\r
   Typical error/warning message format:\r
 \r
@@ -111,7 +111,7 @@ Notes:
   should be modified to share code.\r
 \r
   Visual Studio does not find error messages with:\r
-  \r
+\r
      " error :"\r
      " error 1:"\r
      " error c1:"\r
@@ -119,7 +119,7 @@ Notes:
      " error c100:"\r
 \r
   It does find:\r
-     " error c1000:"     \r
+     " error c1000:"\r
 --*/\r
 {\r
   va_list List;\r
@@ -296,25 +296,25 @@ Routine Description:
 Arguments:\r
   FileName    - name of the file where the warning was detected, or the name\r
                 of the application that detected the warning\r
-  \r
+\r
   LineNumber  - the line number where the warning was detected (parsers).\r
                 0 should be specified if the utility is not a parser.\r
-               \r
+\r
   MessageCode - an application-specific warning code that can be referenced in\r
-                other documentation. \r
+                other documentation.\r
 \r
   Text        - the text in question (parsers)\r
-  \r
+\r
   MsgFmt      - the format string for the warning message. Can contain formatting\r
                 controls for use with varargs.\r
-           \r
+\r
 Returns:\r
   None.\r
 \r
 --*/\r
 {\r
   va_list List;\r
-  \r
+\r
   //\r
   // Current Print Level not output warning information.\r
   //\r
@@ -368,16 +368,16 @@ Routine Description:
 Arguments:\r
   FileName    - typically the name of the utility printing the debug message, but\r
                 can be the name of a file being parsed.\r
-  \r
-  LineNumber  - the line number in FileName (parsers) \r
-               \r
+\r
+  LineNumber  - the line number in FileName (parsers)\r
+\r
   MsgLevel    - Debug message print level (0~9)\r
 \r
   Text        - the text in question (parsers)\r
-  \r
+\r
   MsgFmt      - the format string for the debug message. Can contain formatting\r
                 controls for use with varargs.\r
-           \r
+\r
 Returns:\r
   None.\r
 \r
@@ -421,25 +421,25 @@ Arguments:
 \r
   FileName    - name of the file where the warning was detected, or the name\r
                 of the application that detected the warning\r
-  \r
+\r
   LineNumber  - the line number where the warning was detected (parsers).\r
                 0 should be specified if the utility is not a parser.\r
-               \r
+\r
   MessageCode - an application-specific warning code that can be referenced in\r
-                other documentation. \r
+                other documentation.\r
 \r
   Text        - part of the message to print\r
-  \r
+\r
   MsgFmt      - the format string for the message. Can contain formatting\r
                 controls for use with varargs.\r
   List        - the variable list.\r
-           \r
+\r
 Returns:\r
   None.\r
 \r
 Notes:\r
-  If FileName == NULL then this utility will use the string passed into SetUtilityName(). \r
-  \r
+  If FileName == NULL then this utility will use the string passed into SetUtilityName().\r
+\r
   LineNumber is only used if the caller is a parser, in which case FileName refers to the\r
   file being parsed.\r
 \r
@@ -451,7 +451,7 @@ Notes:
 \r
     Parser (LineNumber != 0)\r
       VfrCompile.cpp(330) : error E2660: AddVfrDataStructField : function does not take 2 parameters\r
-    Generic utility (LineNumber == 0) \r
+    Generic utility (LineNumber == 0)\r
       UtilityName : error E1234 : Text string : MsgFmt string and args\r
 \r
 --*/\r
@@ -467,7 +467,7 @@ Notes:
   //\r
   Line[0] = '\0';\r
   Line2[0] = '\0';\r
-  \r
+\r
   //\r
   // If given a filename, then add it (and the line number) to the string.\r
   // If there's no filename, then use the program name if provided.\r
@@ -477,14 +477,14 @@ Notes:
   } else {\r
     Cptr = NULL;\r
   }\r
-  \r
+\r
   if (strcmp (Type, "DEBUG") == 0) {\r
     //\r
     // Debug Message requires current time.\r
     //\r
     time (&CurrentTime);\r
     NewTime = localtime (&CurrentTime);\r
-    fprintf (stdout, "%04d-%02d-%02d %02d:%02d:%02d", \r
+    fprintf (stdout, "%04d-%02d-%02d %02d:%02d:%02d",\r
                      NewTime->tm_year + 1900,\r
                      NewTime->tm_mon + 1,\r
                      NewTime->tm_mday,\r
@@ -524,7 +524,7 @@ Notes:
   // message for you. It has to be decimal digits too.\r
   //\r
   if (MessageCode != 0) {\r
-    sprintf (Line2, ": %s: %c%04d", Type, toupper (Type[0]), MessageCode);\r
+    sprintf (Line2, ": %s %04X", Type, MessageCode);\r
   } else {\r
     sprintf (Line2, ": %s", Type);\r
   }\r
@@ -556,12 +556,12 @@ PrintSimpleMessage (
 /*++\r
 Routine Description:\r
   Print message into stdout.\r
\r
+\r
 Arguments:\r
   MsgFmt      - the format string for the message. Can contain formatting\r
                 controls for use with varargs.\r
   List        - the variable list.\r
-           \r
+\r
 Returns:\r
   None.\r
 --*/\r
@@ -584,7 +584,7 @@ ParserSetPosition (
 /*++\r
 \r
 Routine Description:\r
-  Set the position in a file being parsed. This can be used to \r
+  Set the position in a file being parsed. This can be used to\r
   print error messages deeper down in a parser.\r
 \r
 Arguments:\r
@@ -612,14 +612,14 @@ Routine Description:
   text. However if a filename is not passed to the print routines, then\r
   they'll print the utility name if you call this function early in your\r
   app to set the utility name.\r
-  \r
+\r
 Arguments:\r
   UtilityName  -  name of the utility, which will be printed with all\r
                   error/warning/debug messags.\r
 \r
 Returns:\r
   NA\r
-  \r
+\r
 --*/\r
 {\r
   //\r
@@ -651,13 +651,13 @@ Routine Description:
   sets a local mStatus to STATUS_ERROR or STATUS_WARNING. When the utility\r
   exits, it can call this function to get the status and use it as a return\r
   value.\r
-  \r
+\r
 Arguments:\r
   None.\r
 \r
 Returns:\r
   Worst-case status reported, as defined by which print function was called.\r
-  \r
+\r
 --*/\r
 {\r
   return mStatus;\r
@@ -798,7 +798,7 @@ Routine Description:
 Arguments:\r
   MaxErrors       - maximum number of error messages to print\r
   MaxWarnings     - maximum number of warning messages to print\r
-  MaxWarningsPlusErrors \r
+  MaxWarningsPlusErrors\r
                   - maximum number of errors+warnings to print\r
 \r
 Returns:\r
index 119ded0..8241b13 100644 (file)
@@ -1,15 +1,15 @@
 /** @file\r
-  \r
+\r
   VfrCompiler error handler.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2004 - 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
 \r
@@ -38,8 +38,8 @@ static SVFR_ERROR_HANDLE VFR_ERROR_HANDLE_TABLE [] = {
   { VFR_RETURN_EFIVARSTORE_USE_ERROR, "can not use the efi varstore like this" },\r
   { VFR_RETURN_EFIVARSTORE_SIZE_ERROR, "unsupport efi varstore size should be <= 8 bytes" },\r
   { VFR_RETURN_GET_NVVARSTORE_ERROR, "get name value varstore error" },\r
-  { VFR_RETURN_QVAR_REUSE, "variable reused by more than one question" }, \r
-  { VFR_RETURN_FLAGS_UNSUPPORTED, "flags unsupported" }, \r
+  { VFR_RETURN_QVAR_REUSE, "variable reused by more than one question" },\r
+  { VFR_RETURN_FLAGS_UNSUPPORTED, "flags unsupported" },\r
   { VFR_RETURN_ERROR_ARRARY_NUM, "array number error" },\r
   { VFR_RETURN_DATA_STRING_ERROR, "data field string error or not support"},\r
   { VFR_RETURN_CODEUNDEFINED, "Undefined Error Code" }\r
@@ -88,7 +88,7 @@ CVfrErrorHandle::SetInputFile (
 }\r
 \r
 SVfrFileScopeRecord::SVfrFileScopeRecord (\r
-  IN CHAR8    *Record, \r
+  IN CHAR8    *Record,\r
   IN UINT32   LineNum\r
   )\r
 {\r
@@ -129,7 +129,7 @@ SVfrFileScopeRecord::~SVfrFileScopeRecord (
 \r
 VOID\r
 CVfrErrorHandle::ParseFileScopeRecord (\r
-  IN CHAR8     *Record, \r
+  IN CHAR8     *Record,\r
   IN UINT32    WholeScopeLine\r
   )\r
 {\r
@@ -201,7 +201,7 @@ CVfrErrorHandle::PrintMsg (
   UINT32                 FileLine;\r
 \r
   GetFileNameLineNum (LineNum, &FileName, &FileLine);\r
-  Error (NULL, 0, 3000, MsgType, "%s line %d: %s %s", FileName, FileLine, TokName, ErrorMsg);\r
+  Error (FileName, FileLine, 0x3000, TokName, "\t%s\n", ErrorMsg);\r
 }\r
 \r
 UINT8\r
@@ -229,7 +229,7 @@ CVfrErrorHandle::HandleError (
 \r
   if (ErrorMsg != NULL) {\r
     GetFileNameLineNum (LineNum, &FileName, &FileLine);\r
-    Error (NULL, 0, 3000, "Invalid", "%s line %d: error %s %s", FileName, FileLine, TokName, ErrorMsg);\r
+    Error (FileName, FileLine, 0x3000, TokName, "\t%s\n", ErrorMsg);\r
     return 1;\r
   } else {\r
     return 0;\r
index 69540a4..cb2ea8d 100644 (file)
@@ -833,7 +833,7 @@ public:
   CIfrCheckBox () : CIfrObj (EFI_IFR_CHECKBOX_OP, (CHAR8 **)&mCheckBox),\r
                      CIfrOpHeader (EFI_IFR_CHECKBOX_OP, &mCheckBox->Header), \r
                      CIfrQuestionHeader (&mCheckBox->Question) {\r
-    mCheckBox->Flags = EFI_IFR_CHECKBOX_DEFAULT;\r
+    mCheckBox->Flags = 0;\r
     gCurrentQuestion = this;\r
   }\r
 \r
@@ -859,6 +859,10 @@ public:
 \r
     return _FLAGS_ZERO (LFlags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;\r
   }\r
+\r
+  UINT8 GetFlags (VOID) {\r
+    return mCheckBox->Flags;\r
+  }\r
 };\r
 \r
 class CIfrAction : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {\r
index 303bd27..a6b3ad9 100644 (file)
@@ -1,3 +1,20 @@
+/*++\r
+Copyright (c) 2004 - 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+  VfrSyntax.g\r
+\r
+Abstract:\r
+\r
+--*/\r
+\r
 #header<<\r
 \r
 #include "EfiVfr.h"\r
@@ -12,7 +29,7 @@
 #include "stdio.h"\r
 #include "PBlackBox.h"\r
 #include "DLexerBase.h"\r
-#include "VfrLexer.h"    \r
+#include "VfrLexer.h"\r
 #include "AToken.h"\r
 \r
 #define GET_LINENO(Obj)       ((Obj)->getLine())\r
@@ -25,9 +42,9 @@ class CVfrDLGLexer : public VfrLexer
 {\r
 public:\r
   CVfrDLGLexer (DLGFileInput *F) : VfrLexer (F) {};\r
-  INT32 errstd (char *Text) \r
-  { \r
-    printf ("unrecognized input '%s'\n", Text); \r
+  INT32 errstd (char *Text)\r
+  {\r
+    printf ("unrecognized input '%s'\n", Text);\r
   }\r
 };\r
 \r
@@ -41,13 +58,19 @@ VfrParserStart (
 }\r
 >>\r
 \r
+#lexaction\r
+<<\r
+#include <Error.h>\r
+\r
+>>\r
+\r
 //\r
 // Define a lexical class for parsing quoted strings. Basically\r
 // starts with a double quote, and ends with a double quote that\r
 // is not preceeded with a backslash.\r
 //\r
 #lexclass QUOTED_STRING\r
-#token TheString            "~[\"]*\"" << mode (START); >>     \r
+#token TheString            "~[\"]*\"" << mode (START); >>\r
 \r
 //\r
 // Define a lexclass for skipping over C++ style comments\r
@@ -69,7 +92,7 @@ VfrParserStart (
 //\r
 // Skip whitespace\r
 //\r
-#token "[\ \t]"   << skip (); >> \r
+#token "[\ \t]"   << skip (); >>\r
 \r
 //\r
 // Skip over newlines, but count them\r
@@ -143,17 +166,17 @@ VfrParserStart (
 #token CheckBox("checkbox")                     "checkbox"\r
 #token EndCheckBox("endcheckbox")               "endcheckbox"\r
 #token Numeric("numeric")                       "numeric"\r
-#token EndNumeric("endnumeric")                 "endnumeric"            \r
-#token Minimum("minimum")                       "minimum"         \r
-#token Maximum("maximum")                       "maximum"         \r
-#token STEP("step")                             "step"      \r
-#token Default("default")                       "default"         \r
-#token Password("password")                     "password"          \r
-#token EndPassword("endpassword")               "endpassword"             \r
+#token EndNumeric("endnumeric")                 "endnumeric"\r
+#token Minimum("minimum")                       "minimum"\r
+#token Maximum("maximum")                       "maximum"\r
+#token STEP("step")                             "step"\r
+#token Default("default")                       "default"\r
+#token Password("password")                     "password"\r
+#token EndPassword("endpassword")               "endpassword"\r
 #token String("string")                         "string"\r
-#token EndString("endstring")                   "endstring"           \r
-#token MinSize("minsize")                       "minsize"         \r
-#token MaxSize("maxsize")                       "maxsize"         \r
+#token EndString("endstring")                   "endstring"\r
+#token MinSize("minsize")                       "minsize"\r
+#token MaxSize("maxsize")                       "maxsize"\r
 #token Encoding("encoding")                     "encoding"\r
 #token SuppressIf("suppressif")                 "suppressif"\r
 #token DisableIf("disableif")                   "disableif"\r
@@ -253,10 +276,10 @@ pragmaPackStackDef :
   (\r
       L1:"push"                                     << LineNum = L1->getLine(); PackAction = VFR_PACK_PUSH; >>\r
     | L2:"pop"                                      << LineNum = L2->getLine(); PackAction = VFR_PACK_POP; >>\r
-  ) \r
+  )\r
   {\r
     "," ID:StringIdentifier                         << Identifier = ID->getText(); >>\r
-  } \r
+  }\r
   {\r
     "," N:Number                                    << PackAction |= VFR_PACK_ASSIGN; PackNumber = _STOU32(N->getText()); >>\r
   }\r
@@ -273,7 +296,7 @@ pragmaPackNumber :
   ;\r
 \r
 vfrPragmaPackDefinition :\r
-  "\#pragma" "pack" "\(" \r
+  "\#pragma" "pack" "\("\r
   {\r
       pragmaPackShowDef\r
     | pragmaPackStackDef\r
@@ -288,10 +311,10 @@ vfrDataStructDefinition :
   {\r
     N1:StringIdentifier                             << _PCATCH(mCVfrVarDataTypeDB.SetNewTypeName (N1->getText()), N1); >>\r
   }\r
-  OpenBrace \r
+  OpenBrace\r
     vfrDataStructFields\r
-  CloseBrace \r
-  { \r
+  CloseBrace\r
+  {\r
     N2:StringIdentifier                             << _PCATCH(mCVfrVarDataTypeDB.SetNewTypeName (N2->getText()), N2); >>\r
   }\r
   ";"                                               << mCVfrVarDataTypeDB.DeclareDataTypeEnd (); >>\r
@@ -299,13 +322,13 @@ vfrDataStructDefinition :
 \r
 vfrDataStructFields :\r
   (\r
-     dataStructField64     | \r
-        dataStructField32     | \r
-        dataStructField16     | \r
-        dataStructField8      | \r
+     dataStructField64     |\r
+        dataStructField32     |\r
+        dataStructField16     |\r
+        dataStructField8      |\r
      dataStructFieldBool   |\r
         dataStructFieldString |\r
-        dataStructFieldDate   | \r
+        dataStructFieldDate   |\r
         dataStructFieldTime   |\r
      dataStructFieldUser\r
   )*\r
@@ -313,8 +336,8 @@ vfrDataStructFields :
 \r
 dataStructField64 :\r
   << UINT32 ArrayNum = 0; >>\r
-  "UINT64" \r
-  N:StringIdentifier \r
+  "UINT64"\r
+  N:StringIdentifier\r
   {\r
     OpenBracket I:Number CloseBracket               << ArrayNum = _STOU32(I->getText()); >>\r
   }\r
@@ -323,8 +346,8 @@ dataStructField64 :
 \r
 dataStructField32 :\r
   << UINT32 ArrayNum = 0; >>\r
-  "UINT32" \r
-  N:StringIdentifier \r
+  "UINT32"\r
+  N:StringIdentifier\r
   {\r
     OpenBracket I:Number CloseBracket               << ArrayNum = _STOU32(I->getText()); >>\r
   }\r
@@ -334,7 +357,7 @@ dataStructField32 :
 dataStructField16 :\r
   << UINT32 ArrayNum = 0; >>\r
   ("UINT16" | "CHAR16")\r
-  N:StringIdentifier \r
+  N:StringIdentifier\r
   {\r
     OpenBracket I:Number CloseBracket               << ArrayNum = _STOU32(I->getText()); >>\r
   }\r
@@ -344,7 +367,7 @@ dataStructField16 :
 dataStructField8 :\r
   << UINT32 ArrayNum = 0; >>\r
   "UINT8"\r
-  N:StringIdentifier \r
+  N:StringIdentifier\r
   {\r
     OpenBracket I:Number CloseBracket               << ArrayNum = _STOU32(I->getText()); >>\r
   }\r
@@ -354,7 +377,7 @@ dataStructField8 :
 dataStructFieldBool :\r
   << UINT32 ArrayNum = 0; >>\r
   "BOOLEAN"\r
-  N:StringIdentifier \r
+  N:StringIdentifier\r
   {\r
     OpenBracket I:Number CloseBracket               << ArrayNum = _STOU32(I->getText()); >>\r
   }\r
@@ -364,7 +387,7 @@ dataStructFieldBool :
 dataStructFieldString :\r
   << UINT32 ArrayNum = 0; >>\r
   "EFI_STRING_ID"\r
-  N:StringIdentifier \r
+  N:StringIdentifier\r
   {\r
     OpenBracket I:Number CloseBracket               << ArrayNum = _STOU32(I->getText()); >>\r
   }\r
@@ -373,8 +396,8 @@ dataStructFieldString :
 \r
 dataStructFieldDate :\r
   << UINT32 ArrayNum = 0; >>\r
-  "EFI_HII_DATE" \r
-  N:StringIdentifier \r
+  "EFI_HII_DATE"\r
+  N:StringIdentifier\r
   {\r
     OpenBracket I:Number CloseBracket               << ArrayNum = _STOU32(I->getText()); >>\r
   }\r
@@ -383,8 +406,8 @@ dataStructFieldDate :
 \r
 dataStructFieldTime :\r
   << UINT32 ArrayNum = 0; >>\r
-  "EFI_HII_TIME" \r
-  N:StringIdentifier \r
+  "EFI_HII_TIME"\r
+  N:StringIdentifier\r
   {\r
     OpenBracket I:Number CloseBracket               << ArrayNum = _STOU32(I->getText()); >>\r
   }\r
@@ -430,7 +453,7 @@ guidDefinition [EFI_GUID &Guid] :
     (\r
         OpenBrace guidSubDefinition[Guid] CloseBrace\r
       | guidSubDefinition[Guid]\r
-    ) \r
+    )\r
   CloseBrace\r
   ;\r
 \r
@@ -482,7 +505,7 @@ vfrStatementDefaultStore :
   {\r
     "," Attribute "=" A:Number                      << DefaultId = _STOU16(A->getText()); >>\r
   }\r
-                                                    << \r
+                                                    <<\r
                                                        if (mCVfrDefaultStore.DefaultIdRegistered (DefaultId) == FALSE) {\r
                                                          CIfrDefaultStore DSObj;\r
                                                          _PCATCH(mCVfrDefaultStore.RegisterDefaultStore (DSObj.GetObjBinAddr(), N->getText(), _STOSID(S->getText()), DefaultId)), D->getLine();\r
@@ -498,7 +521,7 @@ vfrStatementDefaultStore :
 \r
 vfrStatementVarStoreLinear :\r
   <<\r
-     EFI_GUID        Guid; \r
+     EFI_GUID        Guid;\r
      CIfrVarStore    VSObj;\r
      CHAR8           *TypeName;\r
         UINT32          LineNum;\r
@@ -523,15 +546,15 @@ vfrStatementVarStoreLinear :
   Uuid "=" guidDefinition[Guid]\r
                                                     <<\r
                                                        _PCATCH(mCVfrDataStorage.DeclareBufferVarStore (\r
-                                                                                  SN->getText(), \r
-                                                                                  &Guid, \r
-                                                                                  &mCVfrVarDataTypeDB, \r
+                                                                                  SN->getText(),\r
+                                                                                  &Guid,\r
+                                                                                  &mCVfrVarDataTypeDB,\r
                                                                                   TypeName,\r
                                                                                                                                                                  VarStoreId\r
                                                                                   ), LineNum);\r
                                                     >>\r
-                                                    << \r
-                                                       VSObj.SetGuid (&Guid); \r
+                                                    <<\r
+                                                       VSObj.SetGuid (&Guid);\r
                                                        _PCATCH(mCVfrDataStorage.GetVarStoreId(SN->getText(), &VarStoreId), SN);\r
                                                        VSObj.SetVarStoreId (VarStoreId);\r
                                                        _PCATCH(mCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &Size), LineNum);\r
@@ -555,10 +578,10 @@ vfrStatementVarStoreEfi :
   Name "=" "STRING_TOKEN" "\(" VN:Number "\)" ","\r
   VarSize "=" N:Number ","\r
   Uuid "=" guidDefinition[Guid]                     << mCVfrDataStorage.DeclareEfiVarStore (SN->getText(), &Guid, _STOSID(VN->getText()), _STOU32(N->getText())); >>\r
-                                                    << \r
+                                                    <<\r
                                                        VSEObj.SetGuid (&Guid);\r
                                                        _PCATCH(mCVfrDataStorage.GetVarStoreId(SN->getText(), &VarStoreId), SN);\r
-                                                       VSEObj.SetVarStoreId (VarStoreId); \r
+                                                       VSEObj.SetVarStoreId (VarStoreId);\r
                                                     >>\r
   ";"\r
   ;\r
@@ -569,7 +592,7 @@ vfrVarStoreEfiAttr [UINT32 & Attr] :
 \r
 vfrStatementVarStoreNameValue :\r
   <<\r
-     EFI_GUID              Guid; \r
+     EFI_GUID              Guid;\r
      CIfrVarStoreNameValue VSNVObj;\r
      EFI_VARSTORE_ID       VarStoreId;\r
   >>\r
@@ -579,10 +602,10 @@ vfrStatementVarStoreNameValue :
     Name "=" "STRING_TOKEN" "\(" N:Number "\)" ","  << _PCATCH(mCVfrDataStorage.NameTableAddItem (_STOSID(N->getText())), SN); >>\r
   )+\r
   Uuid "=" guidDefinition[Guid]                     << _PCATCH(mCVfrDataStorage.DeclareNameVarStoreEnd (&Guid), SN); >>\r
-                                                    << \r
+                                                    <<\r
                                                        VSNVObj.SetGuid (&Guid);\r
                                                        _PCATCH(mCVfrDataStorage.GetVarStoreId(SN->getText(), &VarStoreId), SN);\r
-                                                       VSNVObj.SetVarStoreId (VarStoreId); \r
+                                                       VSNVObj.SetVarStoreId (VarStoreId);\r
                                                     >>\r
   ";"\r
   ;\r
@@ -595,7 +618,7 @@ classDefinition[UINT16 & Class] :
   << $Class = 0; >>\r
   validClassNames[$Class] ( "\|" validClassNames[$Class] )*\r
   ;\r
-  \r
+\r
 validClassNames[UINT16 & Class] :\r
     ClassNonDevice                                  << $Class |= EFI_NON_DEVICE_CLASS; >>\r
   | ClassDiskDevice                                 << $Class |= EFI_DISK_DEVICE_CLASS; >>\r
@@ -636,7 +659,7 @@ vfrStatementHeader[CIfrStatementHeader *SHObj] :
 \r
 vfrQuestionHeader[CIfrQuestionHeader & QHObj, EFI_QUESION_TYPE QType = QUESTION_NORMAL]:\r
   <<\r
-     EFI_VARSTORE_INFO Info; \r
+     EFI_VARSTORE_INFO Info;\r
         EFI_QUESTION_ID   QId       = EFI_QUESTION_ID_INVALID;\r
      CHAR8             *QName    = NULL;\r
      CHAR8             *VarIdStr = NULL;\r
@@ -651,10 +674,10 @@ vfrQuestionHeader[CIfrQuestionHeader & QHObj, EFI_QUESION_TYPE QType = QUESTION_
   {\r
     QuestionId "=" ID:Number ","                    <<\r
                                                        QId = _STOQID(ID->getText());\r
-                                                       _PCATCH(mCVfrQuestionDB.FindQuestion (QId), VFR_RETURN_UNDEFINED, ID, "has already been used please assign another number"); \r
+                                                       _PCATCH(mCVfrQuestionDB.FindQuestion (QId), VFR_RETURN_UNDEFINED, ID, "has already been used please assign another number");\r
                                                     >>\r
   }\r
-                                                    << \r
+                                                    <<\r
                                                        switch (QType) {\r
                                                        case QUESTION_NORMAL:\r
                                                          mCVfrQuestionDB.RegisterQuestion (QName, VarIdStr, QId);\r
@@ -690,10 +713,10 @@ vfrQuestionHeaderWithNoStorage[CIfrQuestionHeader *QHObj] :
   {\r
     QuestionId "=" ID:Number ","                    <<\r
                                                        QId = _STOQID(ID->getText());\r
-                                                       _PCATCH(mCVfrQuestionDB.FindQuestion (QId), VFR_RETURN_UNDEFINED, ID, "redefined quesiont ID"); \r
+                                                       _PCATCH(mCVfrQuestionDB.FindQuestion (QId), VFR_RETURN_UNDEFINED, ID, "redefined quesiont ID");\r
                                                     >>\r
   }\r
-                                                    << \r
+                                                    <<\r
                                                        mCVfrQuestionDB.RegisterQuestion (QName, NULL, QId);\r
                                                        $QHObj->SetQuestionId (QId);\r
                                                     >>\r
@@ -722,7 +745,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr] :
     OpenBracket I1:Number CloseBracket              << Idx = _STOU32(I1->getText()); _STRCAT(&VarIdStr, "["); _STRCAT(&VarIdStr, I1->getText()); _STRCAT(&VarIdStr, "]"); >>\r
                                                     <<\r
                                                        _PCATCH(mCVfrDataStorage.GetVarStoreType (SName, VarStoreType), SN1);\r
-                                                       _PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN1); \r
+                                                       _PCATCH(mCVfrDataStorage.GetVarStoreId (SName, &$Info.mVarStoreId), SN1);\r
                                                                                                           _PCATCH(mCVfrDataStorage.GetNameVarStoreInfo (&$Info, Idx), SN1);\r
                                                                                                        >>\r
   )\r
@@ -737,7 +760,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr] :
                                                                                                                 _STRCAT(&VarStr, TName);\r
                                                                                                           }\r
                                                     >>\r
-  \r
+\r
     (\r
       "."                                           <<\r
                                                        _PCATCH(((VarStoreType != EFI_VFR_VARSTORE_BUFFER) ? VFR_RETURN_EFIVARSTORE_USE_ERROR : VFR_RETURN_SUCCESS), SN2);\r
@@ -748,7 +771,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr] :
         OpenBracket I2:Number CloseBracket          << _STRCAT(&VarIdStr, "["); _STRCAT(&VarIdStr, I2->getText()); _STRCAT(&VarIdStr, "]"); >>\r
                                                     << _STRCAT(&VarStr, "["); _STRCAT(&VarStr, I2->getText()); _STRCAT(&VarStr, "]"); >>\r
       }\r
-    )*                                              << \r
+    )*                                              <<\r
                                                        switch (VarStoreType) {\r
                                                        case EFI_VFR_VARSTORE_EFI:\r
                                                          _PCATCH(mCVfrDataStorage.GetEfiVarStoreInfo (&$Info), SN2);\r
@@ -789,7 +812,7 @@ vfrQuestionDataFieldName [EFI_QUESTION_ID &QId, UINT32 &Mask, CHAR8 *&VarIdStr,
   ;\r
 \r
 vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] :\r
-    N1:Number                                       << \r
+    N1:Number                                       <<\r
                                                        switch ($Type) {\r
                                                        case EFI_IFR_TYPE_NUM_SIZE_8 :\r
                                                                                                             $Value.u8     = _STOU8(N1->getText());\r
@@ -813,7 +836,7 @@ vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] :
                                                                                                           case EFI_IFR_TYPE_DATE :\r
                                                                                                           default :\r
                                                                                                                 break;\r
-                                                                                                          } \r
+                                                                                                          }\r
                                                     >>\r
   | B1:True                                         << $Value.b      = TRUE; >>\r
   | B2:False                                        << $Value.b      = FALSE; >>\r
@@ -843,7 +866,7 @@ vfrFormDefinition :
     vfrStatementQuestions                    |\r
     vfrStatementConditional                  |\r
     vfrStatementLabel                        |\r
-    vfrStatementBanner                       \r
+    vfrStatementBanner\r
     // Just for framework vfr compatibility\r
     //vfrStatementInvalid\r
   )*\r
@@ -851,12 +874,12 @@ vfrFormDefinition :
   ";"\r
   ;\r
 \r
-vfrStatementRules : \r
+vfrStatementRules :\r
   << CIfrRule RObj; >>\r
   R:Rule                                            << RObj.SetLineNo(R->getLine()); >>\r
   S1:StringIdentifier ","                           <<\r
                                                        mCVfrRulesDB.RegisterRule (S1->getText());\r
-                                                       RObj.SetRuleId (mCVfrRulesDB.GetRuleId(S1->getText())); \r
+                                                       RObj.SetRuleId (mCVfrRulesDB.GetRuleId(S1->getText()));\r
                                                     >>\r
   vfrStatementExpression[0]\r
   E:EndRule                                         << CRT_END_OP (E); >>\r
@@ -866,7 +889,7 @@ vfrStatementRules :
 vfrStatementDefault :\r
   <<\r
      BOOLEAN               IsExp         = FALSE;\r
-     EFI_IFR_TYPE_VALUE    Val; \r
+     EFI_IFR_TYPE_VALUE    Val;\r
      CIfrDefault           DObj;\r
      EFI_DEFAULT_ID        DefaultId     = EFI_HII_DEFAULT_CLASS_STANDARD;\r
      CHAR8                 *VarStoreName = NULL;\r
@@ -876,29 +899,29 @@ vfrStatementDefault :
   (\r
     (\r
         vfrStatementValue ","                       << IsExp = TRUE; DObj.SetScope (1); >>\r
-      | "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] ","  \r
+      | "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] ","\r
                                                     << DObj.SetType (_GET_CURRQEST_DATATYPE()); DObj.SetValue(Val); >>\r
     )\r
     {\r
       DefaultStore "=" SN:StringIdentifier ","      << _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN); DObj.SetDefaultId (DefaultId); >>\r
     }\r
-                                                    << \r
+                                                    <<\r
                                                                                                           _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), D->getLine());\r
                                                                                                           _PCATCH(mCVfrDataStorage.GetVarStoreType (VarStoreName, VarStoreType), D->getLine());\r
-                                                                                                          if ((IsExp == FALSE) && (VarStoreType == EFI_VFR_VARSTORE_BUFFER)) { \r
+                                                                                                          if ((IsExp == FALSE) && (VarStoreType == EFI_VFR_VARSTORE_BUFFER)) {\r
                                                                                                             _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
-                                                                                                                                                    DefaultId, \r
-                                                                                                                                                                        _GET_CURRQEST_VARTINFO(), \r
-                                                                                                                                                                        VarStoreName, \r
-                                                                                                                                                                        _GET_CURRQEST_DATATYPE (), \r
-                                                                                                                                                                        Val), D->getLine()); \r
+                                                                                                                                                    DefaultId,\r
+                                                                                                                                                                        _GET_CURRQEST_VARTINFO(),\r
+                                                                                                                                                                        VarStoreName,\r
+                                                                                                                                                                        _GET_CURRQEST_DATATYPE (),\r
+                                                                                                                                                                        Val), D->getLine());\r
                                                                                                           }\r
                                                                                                        >>\r
   )\r
   ;\r
 \r
 vfrStatementStat :\r
-  vfrStatementSubTitle        | \r
+  vfrStatementSubTitle        |\r
   vfrStatementStaticText      |\r
   vfrStatementCrossReference\r
   ;\r
@@ -930,7 +953,7 @@ vfrStatementInvalid :
   ;\r
 \r
 flagsField :\r
-  Number | InteractiveFlag | ManufacturingFlag | DefaultFlag | \r
+  Number | InteractiveFlag | ManufacturingFlag | DefaultFlag |\r
   NVAccessFlag | ResetRequiredFlag | LateCheckFlag\r
   ;\r
 \r
@@ -963,7 +986,7 @@ subtitleFlagsField [UINT8 & Flags] :
   ;\r
 \r
 vfrStatementStaticText :\r
-  << \r
+  <<\r
      UINT8           Flags   = 0;\r
      EFI_QUESTION_ID QId     = EFI_QUESTION_ID_INVALID;\r
      EFI_STRING_ID   TxtTwo  = EFI_STRING_ID_INVALID;\r
@@ -1011,7 +1034,7 @@ vfrStatementCrossReference :
   ;\r
 \r
 vfrStatementGoto :\r
-  << \r
+  <<\r
      UINT8               RefType = 1;\r
      EFI_STRING_ID       DevPath;\r
      EFI_GUID            FSId;\r
@@ -1031,9 +1054,9 @@ vfrStatementGoto :
       FormSetGuid "=" guidDefinition[FSId] ","\r
       FormId "=" F1:Number ","\r
       Question "=" QN1:Number ","\r
-                                                       << \r
+                                                       <<\r
                                                           RefType = 4;\r
-                                                          DevPath = _STOSID(P->getText()); \r
+                                                          DevPath = _STOSID(P->getText());\r
                                                           FId = _STOFID(F1->getText());\r
                                                           QId = _STOQID(QN1->getText());\r
                                                        >>\r
@@ -1052,7 +1075,7 @@ vfrStatementGoto :
     |\r
     (\r
       FormId "=" F3:Number ","                         << RefType = 2; FId = _STOFID(F3->getText()); >>\r
-      Question "=" \r
+      Question "="\r
       (\r
           QN3:StringIdentifier ","                     << mCVfrQuestionDB.GetQuestionId (QN3->getText (), NULL, QId, BitMask); >>\r
         | QN4:Number ","                               << QId = _STOQID(QN4->getText()); >>\r
@@ -1060,7 +1083,7 @@ vfrStatementGoto :
     )\r
     |\r
     (\r
-      F4:Number ","                                    << \r
+      F4:Number ","                                    <<\r
                                                           RefType = 1;\r
                                                           FId = _STOFID(F4->getText());\r
                                                        >>\r
@@ -1070,31 +1093,31 @@ vfrStatementGoto :
                                                           switch (RefType) {\r
                                                           case 4:\r
                                                             {\r
-                                                              R4Obj = new CIfrRef4; \r
-                                                              QHObj = R4Obj; \r
-                                                              R4Obj->SetLineNo(G->getLine()); \r
-                                                              R4Obj->SetDevicePath (DevPath); \r
-                                                              R4Obj->SetFormSetId (FSId); \r
-                                                              R4Obj->SetFormId (FId); \r
-                                                              R4Obj->SetQuestionId (QId); \r
+                                                              R4Obj = new CIfrRef4;\r
+                                                              QHObj = R4Obj;\r
+                                                              R4Obj->SetLineNo(G->getLine());\r
+                                                              R4Obj->SetDevicePath (DevPath);\r
+                                                              R4Obj->SetFormSetId (FSId);\r
+                                                              R4Obj->SetFormId (FId);\r
+                                                              R4Obj->SetQuestionId (QId);\r
                                                               break;\r
                                                             }\r
                                                           case 3:\r
                                                             {\r
-                                                              R3Obj = new CIfrRef3; \r
-                                                              QHObj = R3Obj; \r
-                                                              R3Obj->SetLineNo(G->getLine()); \r
-                                                              R3Obj->SetFormSetId (FSId); \r
-                                                              R3Obj->SetFormId (FId); \r
-                                                              R3Obj->SetQuestionId (QId); \r
+                                                              R3Obj = new CIfrRef3;\r
+                                                              QHObj = R3Obj;\r
+                                                              R3Obj->SetLineNo(G->getLine());\r
+                                                              R3Obj->SetFormSetId (FSId);\r
+                                                              R3Obj->SetFormId (FId);\r
+                                                              R3Obj->SetQuestionId (QId);\r
                                                               break;\r
                                                             }\r
                                                           case 2:\r
                                                             {\r
-                                                              R2Obj = new CIfrRef2; \r
-                                                              QHObj = R2Obj; \r
-                                                              R2Obj->SetLineNo(G->getLine()); \r
-                                                              R2Obj->SetFormId (FId); \r
+                                                              R2Obj = new CIfrRef2;\r
+                                                              QHObj = R2Obj;\r
+                                                              R2Obj->SetLineNo(G->getLine());\r
+                                                              R2Obj->SetFormId (FId);\r
                                                               _PCATCH(R2Obj->SetQuestionId (QId), QN3);\r
                                                               break;\r
                                                             }\r
@@ -1137,12 +1160,12 @@ getStringId :
 \r
 vfrStatementResetButton :\r
   <<\r
-     CIfrResetButton RBObj; \r
+     CIfrResetButton RBObj;\r
      UINT16          DefaultId;\r
   >>\r
   L:ResetButton                                        << RBObj.SetLineNo(L->getLine()); >>\r
-  DefaultStore \r
-  "=" N:StringIdentifier ","                           << \r
+  DefaultStore\r
+  "=" N:StringIdentifier ","                           <<\r
                                                           _PCATCH(mCVfrDefaultStore.GetDefaultId (N->getText(), &DefaultId), N->getLine());\r
                                                           RBObj.SetDefaultId (DefaultId);\r
                                                        >>\r
@@ -1166,23 +1189,59 @@ vfrStatementBooleanType :
 //     prompt      = STRING_TOKEN(STR_CHECK_BOX_PROMPT),\r
 //     help        = STRING_TOKEN(STR_CHECK_BOX_HELP),\r
 //     flags       = CHECKBOX_DEFAULT | CALLBACK,\r
-//     default value = TRUE, defaultstore = MyDefaultStore, \r
+//     default value = TRUE, defaultstore = MyDefaultStore,\r
 //   endcheckbox;\r
 //\r
 vfrStatementCheckBox :\r
   <<\r
-     CIfrCheckBox CBObj;\r
+     CIfrCheckBox       CBObj;\r
+     EFI_IFR_TYPE_VALUE Val;\r
+     CHAR8              *VarStoreName = NULL;\r
   >>\r
   L:CheckBox                                           << CBObj.SetLineNo(L->getLine()); >>\r
   vfrQuestionHeader[CBObj] ","\r
-  { F:FLAGS "=" vfrCheckBoxFlags[CBObj, F->getLine()] "," }\r
+  {\r
+    F:FLAGS "=" vfrCheckBoxFlags[CBObj, F->getLine()] ","\r
+                                                       <<\r
+                                                          _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), VFR_RETURN_SUCCESS, L, "Failed to retrieve varstore name");\r
+                                                          Val.b = TRUE;\r
+                                                          if (CBObj.GetFlags () & 0x01) {\r
+                                                            _PCATCH(\r
+                                                              mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
+                                                                                  EFI_HII_DEFAULT_CLASS_STANDARD,\r
+                                                                                  _GET_CURRQEST_VARTINFO(),\r
+                                                                                  VarStoreName,\r
+                                                                                  _GET_CURRQEST_DATATYPE (),\r
+                                                                                  Val\r
+                                                                                  ),\r
+                                                              VFR_RETURN_SUCCESS,\r
+                                                              L,\r
+                                                              "No standard default storage found"\r
+                                                              );\r
+                                                          }\r
+                                                          if (CBObj.GetFlags () & 0x02) {\r
+                                                            _PCATCH(\r
+                                                              mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
+                                                                                  EFI_HII_DEFAULT_CLASS_MANUFACTURING,\r
+                                                                                  _GET_CURRQEST_VARTINFO(),\r
+                                                                                  VarStoreName,\r
+                                                                                  _GET_CURRQEST_DATATYPE (),\r
+                                                                                  Val\r
+                                                                                  ),\r
+                                                              VFR_RETURN_SUCCESS,\r
+                                                              L,\r
+                                                              "No manufacturing default storage found"\r
+                                                              );\r
+                                                                                                                 }\r
+                                                                                                          >>\r
+  }\r
   {\r
     Key "=" KN:Number  ","                             << AssignQuestionKey (CBObj, KN); >>\r
   }\r
   vfrStatementQuestionOptionList\r
   E:EndCheckBox                                        << CRT_END_OP (E); >>\r
   ";"\r
-  ; \r
+  ;\r
 \r
 vfrCheckBoxFlags [CIfrCheckBox & CBObj, UINT32 LineNum] :\r
   <<\r
@@ -1267,7 +1326,7 @@ vfrStatementDate :
       Help   "=" "STRING_TOKEN" "\(" DH:Number "\)" ","\r
       minMaxDateStepDefault[Val.date, 2]\r
                                                        <<\r
-                                                          mCVfrQuestionDB.RegisterOldDateQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId); \r
+                                                          mCVfrQuestionDB.RegisterOldDateQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId);\r
                                                           DObj.SetQuestionId (QId);\r
                                                           DObj.SetFlags (EFI_IFR_QUESTION_FLAG_DEFAULT, QF_DATE_STORAGE_TIME);\r
                                                                                                                  DObj.SetPrompt (_STOSID(YP->getText()));\r
@@ -1289,10 +1348,10 @@ minMaxDateStepDefault[EFI_HII_DATE & D, UINT8 KeyValue] :
   {\r
     "default" "=" N:Number ","                         <<\r
                                                           switch (KeyValue) {\r
-                                                          case 0: D.Year  = _STOU16(N->getText()); break; \r
-                                                          case 1: D.Month = _STOU8(N->getText()); break; \r
+                                                          case 0: D.Year  = _STOU16(N->getText()); break;\r
+                                                          case 1: D.Month = _STOU8(N->getText()); break;\r
                                                           case 2: D.Day   = _STOU8(N->getText()); break;\r
-                                                                                                                 } \r
+                                                                                                                 }\r
                                                        >>\r
   }\r
   ;\r
@@ -1404,7 +1463,7 @@ vfrStatementOneOf :
   L:OneOf                                              << OObj.SetLineNo(L->getLine()); >>\r
   vfrQuestionHeader[OObj] ","                          << _PCATCH(OObj.SetFlags (OObj.FLAGS(), _GET_CURRQEST_DATATYPE()), L->getLine()); >>\r
   { F:FLAGS "=" vfrOneofFlagsField[OObj, F->getLine()] "," }\r
-  { \r
+  {\r
     vfrSetMinMaxStep[OObj]\r
   }\r
   vfrStatementQuestionOptionList\r
@@ -1460,7 +1519,7 @@ stringFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
 \r
 vfrStatementPassword :\r
   <<\r
-     CIfrPassword PObj; \r
+     CIfrPassword PObj;\r
   >>\r
   L:Password                                           << PObj.SetLineNo(L->getLine()); >>\r
   vfrQuestionHeader[PObj] ","\r
@@ -1489,12 +1548,12 @@ passwordFlagsField [UINT8 & HFlags] :
 \r
 vfrStatementOrderedList :\r
   <<\r
-     CIfrOrderedList OLObj; \r
+     CIfrOrderedList OLObj;\r
   >>\r
   L:OrderedList                                        << OLObj.SetLineNo(L->getLine()); >>\r
   vfrQuestionHeader[OLObj] ","\r
                                                        << OLObj.SetMaxContainers ((UINT8)_GET_CURRQEST_VARSIZE()); >>\r
-  { \r
+  {\r
     MaxContainers "=" M:Number ","                     << OLObj.SetMaxContainers (_STOU8(M->getText())); >>\r
   }\r
   { F:FLAGS "=" vfrOrderedListFlags[OLObj, F->getLine()] }\r
@@ -1553,7 +1612,7 @@ vfrStatementTime :
       Help   "=" "STRING_TOKEN" "\(" SH:Number "\)" ","\r
       minMaxTimeStepDefault[Val.time, 2]\r
                                                        <<\r
-                                                          mCVfrQuestionDB.RegisterOldTimeQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId); \r
+                                                          mCVfrQuestionDB.RegisterOldTimeQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId);\r
                                                           TObj.SetQuestionId (QId);\r
                                                           TObj.SetFlags (EFI_IFR_QUESTION_FLAG_DEFAULT, QF_TIME_STORAGE_TIME);\r
                                                                                                                  TObj.SetPrompt (_STOSID(HP->getText()));\r
@@ -1574,10 +1633,10 @@ minMaxTimeStepDefault[EFI_HII_TIME & T, UINT8 KeyValue] :
   {\r
     "default" "=" N:Number ","                         <<\r
                                                           switch (KeyValue) {\r
-                                                          case 0: T.Hour   = _STOU8(N->getText()); break; \r
-                                                          case 1: T.Minute = _STOU8(N->getText()); break; \r
+                                                          case 0: T.Hour   = _STOU8(N->getText()); break;\r
+                                                          case 1: T.Minute = _STOU8(N->getText()); break;\r
                                                           case 2: T.Second = _STOU8(N->getText()); break;\r
-                                                                                                                 } \r
+                                                                                                                 }\r
                                                        >>\r
   }\r
   ;\r
@@ -1604,7 +1663,7 @@ vfrStatementQuestionTag :
   vfrStatementNoSubmitIf        |\r
   vfrStatementDisableIfQuest    |\r
   vfrStatementRefresh           |\r
-  vfrStatementVarstoreDevice \r
+  vfrStatementVarstoreDevice\r
   ;\r
 \r
 vfrStatementQuestionTagList :\r
@@ -1621,7 +1680,7 @@ vfrStatementQuestionOptionTag :
 vfrStatementQuestionOptionList :\r
   (\r
     vfrStatementQuestionTag     |\r
-    vfrStatementQuestionOptionTag \r
+    vfrStatementQuestionOptionTag\r
   )*\r
   ;\r
 \r
@@ -1630,7 +1689,7 @@ vfrStatementStatList :
   vfrStatementQuestions                   |\r
   vfrStatementConditional                 |\r
   // Just for framework vfr compatibility\r
-  vfrStatementLabel                       \r
+  vfrStatementLabel\r
   //vfrStatementInvalid\r
   ;\r
 \r
@@ -1749,7 +1808,7 @@ vfrStatementOneOfOption :
      EFI_IFR_TYPE_VALUE Val;\r
      CIfrOneOfOption    OOOObj;\r
      CHAR8              *VarStoreName = NULL;\r
-     \r
+\r
   >>\r
   L:Option                                             << OOOObj.SetLineNo(L->getLine()); >>\r
   Text  "=" "STRING_TOKEN" "\(" S:Number "\)" ","      << OOOObj.SetOption (_STOSID(S->getText())); >>\r
@@ -1759,10 +1818,10 @@ vfrStatementOneOfOption :
                                                           if (OOOObj.GetFlags () & 0x10) {\r
                                                             _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), L->getLine());\r
                                                             _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (\r
-                                                                                                                                                   EFI_HII_DEFAULT_CLASS_STANDARD, \r
-                                                                                                                                                                       _GET_CURRQEST_VARTINFO(), \r
-                                                                                                                                                                       VarStoreName, \r
-                                                                                                                                                                   _GET_CURRQEST_DATATYPE (), \r
+                                                                                                                                                   EFI_HII_DEFAULT_CLASS_STANDARD,\r
+                                                                                                                                                                       _GET_CURRQEST_VARTINFO(),\r
+                                                                                                                                                                       VarStoreName,\r
+                                                                                                                                                                   _GET_CURRQEST_DATATYPE (),\r
                                                                                                                                                                        Val\r
                                                                                                                                                                        ), L->getLine());\r
                                                           }\r
@@ -1807,9 +1866,9 @@ vfrStatementBanner :
   B:Banner { "," }                                     << BObj.SetLineNo(B->getLine()); >>\r
   Title "=" "STRING_TOKEN" "\(" S:Number "\)" ","      << BObj.SetTitle (_STOSID(S->getText())); >>\r
   (\r
-    ( \r
+    (\r
       Line L:Number ","                                << BObj.SetLine (_STOU16(L->getText())); >>\r
-      Align \r
+      Align\r
       (\r
           Left                                         << BObj.SetAlign (0); >>\r
         | Center                                       << BObj.SetAlign (1); >>\r
@@ -1827,7 +1886,7 @@ vfrStatementBanner :
 //\r
 // keep some syntax for compatibility but not generate any IFR object\r
 //\r
-vfrStatementInvalidHidden : \r
+vfrStatementInvalidHidden :\r
   Hidden\r
   Value "=" Number ","\r
   Key "=" Number ";"\r
@@ -1849,15 +1908,15 @@ vfrStatementInvalidInventory :
   {\r
     Text  "=" "STRING_TOKEN" "\(" Number "\)"\r
   }\r
-  ";" \r
+  ";"\r
   ;\r
 \r
-vfrStatementInvalidSaveRestoreDefaults : \r
+vfrStatementInvalidSaveRestoreDefaults :\r
   (Save | Restore)\r
   Defaults ","\r
   FormId "=" Number  ","\r
   Prompt "=" "STRING_TOKEN" "\(" Number "\)" ","\r
-  Help   "=" "STRING_TOKEN" "\(" Number "\)" \r
+  Help   "=" "STRING_TOKEN" "\(" Number "\)"\r
   { "," FLAGS "=" flagsField ( "\|" flagsField )* }\r
   { "," Key   "=" Number }\r
   ";"\r
@@ -1916,7 +1975,7 @@ andTerm[UINT32 & RootLevel, UINT32 & ExpOpCount] :
   ;\r
 \r
 bitwiseorTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:\r
-  bitwiseandTerm[$RootLevel, $ExpOpCount]          \r
+  bitwiseandTerm[$RootLevel, $ExpOpCount]\r
   (\r
     L:"\|" bitwiseandTerm[$RootLevel, $ExpOpCount]      << $ExpOpCount++; CIfrBitWiseOr BWOObj(L->getLine()); >>\r
   )*\r
@@ -1964,7 +2023,7 @@ compareTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
   ;\r
 \r
 shiftTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:\r
-  addMinusTerm[$RootLevel, $ExpOpCount]           \r
+  addMinusTerm[$RootLevel, $ExpOpCount]\r
   (\r
     (\r
       L1:"\<<" addMinusTerm[$RootLevel, $ExpOpCount]    << $ExpOpCount++; CIfrShiftLeft SLObj(L1->getLine()); >>\r
@@ -1991,7 +2050,7 @@ addMinusTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
 \r
 multdivmodTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:\r
   castTerm[$RootLevel, $ExpOpCount]\r
-  ( \r
+  (\r
     (\r
       L1:"\*" castTerm[$RootLevel, $ExpOpCount]         << $ExpOpCount++; CIfrMultiply MObj(L1->getLine()); >>\r
     )\r
@@ -2002,7 +2061,7 @@ multdivmodTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
     |\r
     (\r
       L3:"%" castTerm[$RootLevel, $ExpOpCount]          << $ExpOpCount++; CIfrModulo MObj(L3->getLine()); >>\r
-    ) \r
+    )\r
   )*\r
   ;\r
 \r
@@ -2101,7 +2160,7 @@ ideqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
                                                                                                                        _SAVE_OPHDR_COND (EIVObj, ($ExpOpCount == 0));\r
                                                                                                                        EIVObj.SetQuestionId (QId, VarIdStr, LineNo);\r
                                                                                                                        EIVObj.SetValue (ConstVal);\r
-                                                                                                                       $ExpOpCount++;                                                                                                                  \r
+                                                                                                                       $ExpOpCount++;\r
                                                                                                                  } else {\r
                                                                                                                        IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, EQUAL);\r
                                                                                                                  }\r
@@ -2145,7 +2204,7 @@ ideqidExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
   vfrQuestionDataFieldName[QId[0], Mask[0], VarIdStr[0], LineNo[0]]\r
   (\r
     (\r
-      "==" \r
+      "=="\r
       vfrQuestionDataFieldName[QId[1], Mask[1], VarIdStr[1], LineNo[1]]\r
                                                        <<\r
                                                                                                              if (Mask[0] & Mask[1]) {\r
@@ -2155,7 +2214,7 @@ ideqidExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
                                                                                                                        _SAVE_OPHDR_COND (EIIObj, ($ExpOpCount == 0));\r
                                                             EIIObj.SetQuestionId1 (QId[0], VarIdStr[0], LineNo[0]);\r
                                                                                                                        EIIObj.SetQuestionId2 (QId[1], VarIdStr[1], LineNo[1]);\r
-                                                                                                                       $ExpOpCount++;                                                                                                                  \r
+                                                                                                                       $ExpOpCount++;\r
                                                                                                                  }\r
                                                                                                           >>\r
     )\r
@@ -2197,7 +2256,7 @@ ideqvallistExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
   >>\r
   L:IdEqValList\r
   vfrQuestionDataFieldName[QId, Mask, VarIdStr, LineNo]\r
-  "==" \r
+  "=="\r
   (\r
     V:Number                                           << ValueList[ListLen] = _STOU16(V->getText()); ListLen++; >>\r
   )+\r
@@ -2221,9 +2280,9 @@ ideqvallistExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
 vareqvarlExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :\r
   L:VarEqVal Var "\(" V1:Number "\)" "==" V2:Number    <<\r
                                                           {\r
-                                                            CIfrUint64 U64Obj1(L->getLine()), U64Obj2(L->getLine()); \r
-                                                            _SAVE_OPHDR_COND (U64Obj1, ($ExpOpCount == 0)); \r
-                                                            U64Obj1.SetValue (_STOU64(V1->getText())); \r
+                                                            CIfrUint64 U64Obj1(L->getLine()), U64Obj2(L->getLine());\r
+                                                            _SAVE_OPHDR_COND (U64Obj1, ($ExpOpCount == 0));\r
+                                                            U64Obj1.SetValue (_STOU64(V1->getText()));\r
                                                             U64Obj2.SetValue (_STOU64(V2->getText()));\r
                                                           }\r
                                                        >>\r
@@ -2256,7 +2315,7 @@ questionref13Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
     (\r
       "\("\r
          (\r
-          QN:StringIdentifier                          << \r
+          QN:StringIdentifier                          <<\r
                                                           QName  = QN->getText();\r
                                                                                                                  LineNo = QN->getLine();\r
                                                           mCVfrQuestionDB.GetQuestionId (QN->getText(), NULL, QId, BitMask);\r
@@ -2405,7 +2464,7 @@ findExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
   findFormat[Format] ( "\|" findFormat[Format] )*\r
   ","\r
   vfrStatementExpression[$RootLevel + 1, $ExpOpCount]\r
-  "," \r
+  ","\r
   vfrStatementExpression[$RootLevel + 1, $ExpOpCount]\r
   ","\r
   vfrStatementExpression[$RootLevel + 1, $ExpOpCount]\r
@@ -2432,7 +2491,7 @@ tokenExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
   vfrStatementExpression[$RootLevel + 1, $ExpOpCount]\r
   ","\r
   vfrStatementExpression[$RootLevel + 1, $ExpOpCount]\r
-  "," \r
+  ","\r
   vfrStatementExpression[$RootLevel + 1, $ExpOpCount]\r
   "\)"                                                 << { CIfrToken TObj(L->getLine()); $ExpOpCount++; } >>\r
   ;\r
@@ -2461,8 +2520,8 @@ spanFlags [UINT8 & Flags] :
 \r
 //******************************************************************************\r
 //\r
-// Parser class definition. \r
-//  \r
+// Parser class definition.\r
+//\r
 class EfiVfrParser {\r
 <<\r
 private:\r
@@ -2529,7 +2588,7 @@ public:
 <<\r
 VOID\r
 EfiVfrParser::_SAVE_OPHDR_COND (\r
-  IN CIfrOpHeader &OpHdr, \r
+  IN CIfrOpHeader &OpHdr,\r
   IN BOOLEAN      Cond\r
   )\r
 {\r
@@ -2649,12 +2708,12 @@ EfiVfrParser::_PCATCH (
   mParserStatus += gCVfrErrorHandle.HandleError (ReturnCode, LineNum);\r
 }\r
 \r
-VOID \r
+VOID\r
 EfiVfrParser::syn (\r
-  ANTLRAbstractToken  *Tok, \r
-  ANTLRChar           *Egroup, \r
-  SetWordType         *Eset, \r
-  ANTLRTokenType      ETok, \r
+  ANTLRAbstractToken  *Tok,\r
+  ANTLRChar           *Egroup,\r
+  SetWordType         *Eset,\r
+  ANTLRTokenType      ETok,\r
   INT32               Huh\r
   )\r
 {\r
@@ -2709,7 +2768,7 @@ EfiVfrParser::_STOU8 (
     }\r
     if (c >= '0' && c <= '9') {\r
       Value += (c - '0');\r
-    } \r
+    }\r
   }\r
 \r
   return Value;\r
@@ -2739,7 +2798,7 @@ EfiVfrParser::_STOU16 (
     }\r
     if (c >= '0' && c <= '9') {\r
       Value += (c - '0');\r
-    } \r
+    }\r
   }\r
 \r
   return Value;\r
@@ -2769,7 +2828,7 @@ EfiVfrParser::_STOU32 (
     }\r
     if (c >= '0' && c <= '9') {\r
       Value += (c - '0');\r
-    } \r
+    }\r
   }\r
 \r
   return Value;\r
@@ -2779,7 +2838,7 @@ UINT64
 EfiVfrParser::_STOU64 (\r
   IN CHAR8*Str\r
   )\r
-{ \r
+{\r
   BOOLEAN IsHex;\r
   UINT64  Value;\r
   CHAR8   c;\r
@@ -2799,16 +2858,16 @@ EfiVfrParser::_STOU64 (
     }\r
     if (c >= '0' && c <= '9') {\r
       Value += (c - '0');\r
-    } \r
+    }\r
   }\r
 \r
   return Value;\r
-} \r
+}\r
 \r
 EFI_HII_DATE\r
 EfiVfrParser::_STOD (\r
-  IN CHAR8 *Year, \r
-  IN CHAR8 *Month, \r
+  IN CHAR8 *Year,\r
+  IN CHAR8 *Month,\r
   IN CHAR8 *Day\r
   )\r
 {\r
@@ -2823,8 +2882,8 @@ EfiVfrParser::_STOD (
 \r
 EFI_HII_TIME\r
 EfiVfrParser::_STOT (\r
-  IN CHAR8 *Hour, \r
-  IN CHAR8 *Minute, \r
+  IN CHAR8 *Hour,\r
+  IN CHAR8 *Minute,\r
   IN CHAR8 *Second\r
   )\r
 {\r
@@ -2853,7 +2912,7 @@ EfiVfrParser::_STOFID (
   return (EFI_FORM_ID)_STOU16(Str);\r
 }\r
 \r
-EFI_QUESTION_ID \r
+EFI_QUESTION_ID\r
 EfiVfrParser::_STOQID (\r
   IN CHAR8 *Str\r
   )\r
@@ -2890,17 +2949,17 @@ EfiVfrParser::_STRCAT (
 \r
 VOID\r
 EfiVfrParser::_CRGUID (\r
-  IN EFI_GUID *Guid, \r
-  IN CHAR8    *G1, \r
-  IN CHAR8    *G2, \r
-  IN CHAR8    *G3, \r
-  IN CHAR8    *G4, \r
-  IN CHAR8    *G5, \r
-  IN CHAR8    *G6, \r
-  IN CHAR8    *G7, \r
-  IN CHAR8    *G8, \r
-  IN CHAR8    *G9, \r
-  IN CHAR8    *G10, \r
+  IN EFI_GUID *Guid,\r
+  IN CHAR8    *G1,\r
+  IN CHAR8    *G2,\r
+  IN CHAR8    *G3,\r
+  IN CHAR8    *G4,\r
+  IN CHAR8    *G5,\r
+  IN CHAR8    *G6,\r
+  IN CHAR8    *G7,\r
+  IN CHAR8    *G8,\r
+  IN CHAR8    *G9,\r
+  IN CHAR8    *G10,\r
   IN CHAR8    *G11\r
   )\r
 {\r
@@ -2936,9 +2995,9 @@ EfiVfrParser::_DeclareDefaultLinearVarStore (
 \r
     VSObj.SetLineNo (LineNo);\r
     mCVfrDataStorage.DeclareBufferVarStore (\r
-                       TypeNameList[Index], \r
-                       &DefaultGuid, \r
-                       &mCVfrVarDataTypeDB, \r
+                       TypeNameList[Index],\r
+                       &DefaultGuid,\r
+                       &mCVfrVarDataTypeDB,\r
                        TypeNameList[Index],\r
                        EFI_VARSTORE_ID_INVALID\r
                        );\r
@@ -2957,9 +3016,9 @@ EfiVfrParser::_DeclareDefaultLinearVarStore (
 \r
     VSObj.SetLineNo (LineNo);\r
     mCVfrDataStorage.DeclareBufferVarStore (\r
-                       "Date", \r
-                                          &DefaultGuid, \r
-                                          &mCVfrVarDataTypeDB, \r
+                       "Date",\r
+                                          &DefaultGuid,\r
+                                          &mCVfrVarDataTypeDB,\r
                                           "EFI_HII_DATE",\r
                        EFI_VARSTORE_ID_INVALID\r
                        );\r
@@ -2978,9 +3037,9 @@ EfiVfrParser::_DeclareDefaultLinearVarStore (
 \r
     VSObj.SetLineNo (LineNo);\r
     mCVfrDataStorage.DeclareBufferVarStore (\r
-                       "Time", \r
-                       &DefaultGuid, \r
-                       &mCVfrVarDataTypeDB, \r
+                       "Time",\r
+                       &DefaultGuid,\r
+                       &mCVfrVarDataTypeDB,\r
                        "EFI_HII_TIME",\r
                        EFI_VARSTORE_ID_INVALID\r
                        );\r
@@ -2998,7 +3057,7 @@ EfiVfrParser::_DeclareStandardDefaultStorage (
   IN UINT32 LineNo\r
   )\r
 {\r
-  CIfrDefaultStore DSObj; \r
+  CIfrDefaultStore DSObj;\r
 \r
   mCVfrDefaultStore.RegisterDefaultStore (DSObj.GetObjBinAddr(), "Standard Defaults", EFI_STRING_ID_INVALID, EFI_HII_DEFAULT_CLASS_STANDARD);\r
   DSObj.SetLineNo (LineNo);\r
@@ -3008,7 +3067,7 @@ EfiVfrParser::_DeclareStandardDefaultStorage (
 \r
 VOID\r
 EfiVfrParser::AssignQuestionKey (\r
-  IN CIfrQuestionHeader   &QHObj, \r
+  IN CIfrQuestionHeader   &QHObj,\r
   IN ANTLRTokenPtr        KeyTok\r
   )\r
 {\r
@@ -3031,7 +3090,7 @@ EfiVfrParser::AssignQuestionKey (
 \r
 VOID\r
 EfiVfrParser::ConvertIdExpr (\r
-  IN UINT32          &ExpOpCount, \r
+  IN UINT32          &ExpOpCount,\r
   IN UINT32          LineNo,\r
   IN EFI_QUESTION_ID QId,\r
   IN CHAR8           *VarIdStr,\r
@@ -3065,7 +3124,7 @@ EfiVfrParser::ConvertIdExpr (
 \r
 VOID\r
 EfiVfrParser::IdEqValDoSpecial (\r
-  IN UINT32           &ExpOpCount, \r
+  IN UINT32           &ExpOpCount,\r
   IN UINT32           LineNo,\r
   IN EFI_QUESTION_ID  QId,\r
   IN CHAR8            *VarIdStr,\r
@@ -3117,7 +3176,7 @@ EfiVfrParser::IdEqValDoSpecial (
 \r
 VOID\r
 EfiVfrParser::IdEqIdDoSpecial (\r
-  IN UINT32           &ExpOpCount, \r
+  IN UINT32           &ExpOpCount,\r
   IN UINT32           LineNo,\r
   IN EFI_QUESTION_ID  QId1,\r
   IN CHAR8            *VarId1Str,\r
@@ -3164,7 +3223,7 @@ EfiVfrParser::IdEqIdDoSpecial (
 \r
 VOID\r
 EfiVfrParser::IdEqListDoSpecial (\r
-  IN UINT32          &ExpOpCount, \r
+  IN UINT32          &ExpOpCount,\r
   IN UINT32          LineNo,\r
   IN EFI_QUESTION_ID QId,\r
   IN CHAR8           *VarIdStr,\r