Enhance StringRef to support STRING_TOKEN syntax.
authorlgao4 <lgao4@c2973edb-eda0-4c78-bc6a-9341b269661f>
Mon, 8 Feb 2010 05:50:15 +0000 (05:50 +0000)
committerlgao4 <lgao4@c2973edb-eda0-4c78-bc6a-9341b269661f>
Mon, 8 Feb 2010 05:50:15 +0000 (05:50 +0000)
git-svn-id: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools@1849 c2973edb-eda0-4c78-bc6a-9341b269661f

Source/C/VfrCompile/VfrSyntax.g

index 9c20877..c4511fd 100644 (file)
@@ -2993,8 +2993,19 @@ rulerefExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
 //   stringref (STR_FORM_SET_TITLE)\r
 //\r
 stringref1Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :\r
+  <<\r
+    EFI_STRING_ID RefStringId = EFI_STRING_ID_INVALID;\r
+  >>\r
   L:StringRef\r
-  "\(" S:Number "\)"                                   << { CIfrStringRef1 SR1Obj(L->getLine()); _SAVE_OPHDR_COND (SR1Obj, ($ExpOpCount == 0), L->getLine()); SR1Obj.SetStringId (_STOSID(S->getText())); $ExpOpCount++; } >>\r
+  "\("\r
+      ( \r
+        "STRING_TOKEN"\r
+        "\(" \r
+          S:Number << RefStringId = _STOSID(S->getText()); >>\r
+        "\)"\r
+        | I:Number << RefStringId = _STOSID(I->getText()); >>\r
+      )\r
+  "\)" << { CIfrStringRef1 SR1Obj(L->getLine()); _SAVE_OPHDR_COND (SR1Obj, ($ExpOpCount == 0), L->getLine()); SR1Obj.SetStringId (RefStringId); $ExpOpCount++; } >>\r
   ;\r
 \r
 pushthisExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :\r