BaseTools: Enable Match2 Opcode.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17338 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong 2015-05-06 10:38:04 +00:00 committed by ydong10
parent 1f9837b41e
commit 5d37761661
4 changed files with 39 additions and 1 deletions

View File

@ -690,6 +690,7 @@ typedef union {
#define EFI_IFR_MODAL_TAG_OP 0x61
#define EFI_IFR_REFRESH_ID_OP 0x62
#define EFI_IFR_WARNING_IF_OP 0x63
#define EFI_IFR_MATCH2_OP 0x64
typedef struct _EFI_IFR_OP_HEADER {
@ -1268,6 +1269,11 @@ typedef struct _EFI_IFR_MATCH {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_MATCH;
typedef struct _EFI_IFR_MATCH2 {
EFI_IFR_OP_HEADER Header;
EFI_GUID SyntaxType;
} EFI_IFR_MATCH2;
typedef struct _EFI_IFR_MULTIPLY {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_MULTIPLY;

View File

@ -1663,6 +1663,7 @@ static struct {
{ sizeof (EFI_IFR_MODAL_TAG), 0}, // EFI_IFR_MODAL_TAG_OP - 0x61
{ sizeof (EFI_IFR_REFRESH_ID), 0}, // EFI_IFR_REFRESH_ID_OP - 0x62
{ sizeof (EFI_IFR_WARNING_IF), 1}, // EFI_IFR_WARNING_IF_OP - 0x63
{ sizeof (EFI_IFR_MATCH2), 0 }, // EFI_IFR_MATCH2_OP - 0x64
};
#ifdef CIFROBJ_DEUBG
@ -1685,7 +1686,7 @@ static struct {
"EFI_IFR_STRING_REF1","EFI_IFR_STRING_REF2", "EFI_IFR_CONDITIONAL", "EFI_IFR_QUESTION_REF3", "EFI_IFR_ZERO", "EFI_IFR_ONE",
"EFI_IFR_ONES", "EFI_IFR_UNDEFINED", "EFI_IFR_LENGTH", "EFI_IFR_DUP", "EFI_IFR_THIS", "EFI_IFR_SPAN",
"EFI_IFR_VALUE", "EFI_IFR_DEFAULT", "EFI_IFR_DEFAULTSTORE", "EFI_IFR_FORM_MAP", "EFI_IFR_CATENATE", "EFI_IFR_GUID",
"EFI_IFR_SECURITY", "EFI_IFR_MODAL_TAG", "EFI_IFR_REFRESH_ID", "EFI_IFR_WARNING_IF",
"EFI_IFR_SECURITY", "EFI_IFR_MODAL_TAG", "EFI_IFR_REFRESH_ID", "EFI_IFR_WARNING_IF", "EFI_IFR_MATCH2",
};
VOID

View File

@ -2656,6 +2656,21 @@ public:
}
};
class CIfrMatch2 : public CIfrObj, public CIfrOpHeader {
private:
EFI_IFR_MATCH2 *mMatch2;
public:
CIfrMatch2 (
IN UINT32 LineNo,
IN EFI_GUID *Guid
) : CIfrObj (EFI_IFR_MATCH2_OP, (CHAR8 **)&mMatch2),
CIfrOpHeader (EFI_IFR_MATCH2_OP, &mMatch2->Header) {
SetLineNo (LineNo);
memmove (&mMatch2->SyntaxType, Guid, sizeof (EFI_GUID));
}
};
class CIfrMultiply : public CIfrObj, public CIfrOpHeader {
private:
EFI_IFR_MULTIPLY *mMultiply;

View File

@ -3401,6 +3401,7 @@ vfrStatementInvalidSaveRestoreDefaults :
#token ToUpper("toupper") "toupper"
#token ToLower("tolower") "tolower"
#token Match("match") "match"
#token Match2("match2") "match2"
#token Catenate("catenate") "catenate"
#token QuestionRefVal("questionrefval") "questionrefval"
#token StringRefVal("stringrefval") "stringrefval"
@ -3569,6 +3570,7 @@ castTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
atomTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
vfrExpressionCatenate[$RootLevel, $ExpOpCount]
| vfrExpressionMatch[$RootLevel, $ExpOpCount]
| vfrExpressionMatch2[$RootLevel, $ExpOpCount]
| vfrExpressionParen[$RootLevel, $ExpOpCount]
| vfrExpressionBuildInFunction[$RootLevel, $ExpOpCount]
| vfrExpressionConstant[$RootLevel, $ExpOpCount]
@ -3599,6 +3601,20 @@ vfrExpressionMatch [UINT32 & RootLevel, UINT32 & ExpOpCount]:
"\)" << { CIfrMatch MObj(L->getLine()); $ExpOpCount++; } >>
;
vfrExpressionMatch2 [UINT32 & RootLevel, UINT32 & ExpOpCount]:
<<
EFI_GUID Guid;
>>
L:Match2
"\("
vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
","
vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
","
guidDefinition[Guid]
"\)" << { CIfrMatch2 M2Obj(L->getLine(), &Guid); $ExpOpCount++; } >>
;
vfrExpressionParen [UINT32 & RootLevel, UINT32 & ExpOpCount]:
"\("
vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]