From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 4A16E74003C for ; Mon, 11 Dec 2023 00:35:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HS6lRQNJqUAO85oZDCqxtNST1S3Td7MZ9MO18cA4cMQ=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702254925; v=1; b=j121PWRMCbBxTEG+RH64CI1Eg4Kg17GUcP+unnhmCo8N1CMBYVgL01nryfaijAxyxAORFGCW 42WSqRmveDe2fyJGq10JMHr62S1GjfI5IOYRU05vRplBuLhbkoixOZR/3DooncSbPHz7qMH9GY0 pJaX21kz6JFrDNIMcxUk7iCw= X-Received: by 127.0.0.2 with SMTP id VffdYY7687511xAuB9k0erow; Sun, 10 Dec 2023 16:35:25 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by mx.groups.io with SMTP id smtpd.web11.97237.1702254923904189442 for ; Sun, 10 Dec 2023 16:35:24 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10920"; a="1647463" X-IronPort-AV: E=Sophos;i="6.04,266,1695711600"; d="scan'208";a="1647463" X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2023 16:35:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10920"; a="772835594" X-IronPort-AV: E=Sophos;i="6.04,266,1695711600"; d="scan'208";a="772835594" X-Received: from yuweipc.ccr.corp.intel.com ([10.239.158.55]) by orsmga002.jf.intel.com with ESMTP; 10 Dec 2023 16:35:13 -0800 From: "Yuwei Chen" To: devel@edk2.groups.io Cc: Yang , Rebecca Cran , Liming Gao , Bob Feng Subject: [edk2-devel] [PATCH] [edk2-staging]BaseTools: Python VfrCompiler Tool Update Date: Mon, 11 Dec 2023 08:35:11 +0800 Message-Id: <20231211003511.1491-1-yuwei.chen@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,yuwei.chen@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: G60LtqVRR3C63JJQN6zJhbNjx7686176AA= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=j121PWRM; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: Yang This python VfrCompiler tool is the python implementation of the edk2 VfrCompiler tool which C implementation locates at https://github.com/tianocore/edk2/tree/master/BaseTools/Source/C/VfrCompile= . This python implementation not only covers the same usage as the C version VfrCompiler, but also extends several new features. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4596 Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Signed-off-by: Yuting Yang Signed-off-by: Yuwei Chen --- .../Source/Python/VfrCompiler/CommonCtypes.py | 1394 --- .../Source/Python/VfrCompiler/IfrCommon.py | 100 + .../Source/Python/VfrCompiler/IfrCompiler.py | 586 ++ .../Source/Python/VfrCompiler/IfrCtypes.py | 1811 ++++ .../Source/Python/VfrCompiler/IfrError.py | 153 + .../Source/Python/VfrCompiler/IfrFormPkg.py | 2937 ++++++ .../Python/VfrCompiler/IfrPreProcess.py | 245 + .../Source/Python/VfrCompiler/IfrTree.py | 1132 +++ .../Source/Python/VfrCompiler/IfrUtility.py | 2226 +++++ BaseTools/Source/Python/VfrCompiler/README.md | 68 +- .../Source/Python/VfrCompiler/VfrError.py | 162 - .../Source/Python/VfrCompiler/VfrFormPkg.py | 2738 ------ .../Source/Python/VfrCompiler/VfrSyntax.g4 | 472 +- .../Python/VfrCompiler/VfrSyntaxLexer.py | 17 +- .../Python/VfrCompiler/VfrSyntaxParser.py | 8145 +++++++++-------- .../Python/VfrCompiler/VfrSyntaxVisitor.py | 5816 ++++++------ .../Source/Python/VfrCompiler/VfrTree.py | 88 - .../Source/Python/VfrCompiler/VfrUtility.py | 1991 ---- .../Source/Python/VfrCompiler/__init__.py | 1 + BaseTools/Source/Python/VfrCompiler/main.py | 27 - 20 files changed, 16697 insertions(+), 13412 deletions(-) delete mode 100644 BaseTools/Source/Python/VfrCompiler/CommonCtypes.py create mode 100644 BaseTools/Source/Python/VfrCompiler/IfrCommon.py create mode 100644 BaseTools/Source/Python/VfrCompiler/IfrCompiler.py create mode 100644 BaseTools/Source/Python/VfrCompiler/IfrCtypes.py create mode 100644 BaseTools/Source/Python/VfrCompiler/IfrError.py create mode 100644 BaseTools/Source/Python/VfrCompiler/IfrFormPkg.py create mode 100644 BaseTools/Source/Python/VfrCompiler/IfrPreProcess.py create mode 100644 BaseTools/Source/Python/VfrCompiler/IfrTree.py create mode 100644 BaseTools/Source/Python/VfrCompiler/IfrUtility.py delete mode 100644 BaseTools/Source/Python/VfrCompiler/VfrError.py delete mode 100644 BaseTools/Source/Python/VfrCompiler/VfrFormPkg.py delete mode 100644 BaseTools/Source/Python/VfrCompiler/VfrTree.py delete mode 100644 BaseTools/Source/Python/VfrCompiler/VfrUtility.py create mode 100644 BaseTools/Source/Python/VfrCompiler/__init__.py delete mode 100644 BaseTools/Source/Python/VfrCompiler/main.py diff --git a/BaseTools/Source/Python/VfrCompiler/CommonCtypes.py b/BaseTool= s/Source/Python/VfrCompiler/CommonCtypes.py deleted file mode 100644 index b62145d980..0000000000 --- a/BaseTools/Source/Python/VfrCompiler/CommonCtypes.py +++ /dev/null @@ -1,1394 +0,0 @@ -from ctypes import * -from re import A, X -from telnetlib import X3PAD -from tkinter import YView -import uuid -from VfrCompiler.VfrError import * -from struct import * - -EFI_STRING_ID_INVALID =3D 0x0 -EFI_HII_DEFAULT_CLASS_STANDARD =3D 0x0000 -EFI_HII_DEFAULT_CLASS_MANUFACTURING =3D 0x0001 -EFI_IFR_MAX_LENGTH =3D 0xFF -EFI_VARSTORE_ID_INVALID =3D 0 -EFI_VARSTORE_ID_START =3D 0x20 -EFI_VAROFFSET_INVALID =3D 0xFFFF -EFI_IMAGE_ID_INVALID =3D 0xFFFF - -EFI_NON_DEVICE_CLASS =3D 0x00 -EFI_DISK_DEVICE_CLASS =3D 0x01 -EFI_VIDEO_DEVICE_CLASS =3D 0x02 -EFI_NETWORK_DEVICE_CLASS =3D 0x04 -EFI_INPUT_DEVICE_CLASS =3D 0x08 -EFI_ON_BOARD_DEVICE_CLASS =3D 0x10 -EFI_OTHER_DEVICE_CLASS =3D 0x20 - -EFI_SETUP_APPLICATION_SUBCLASS =3D 0x00 -EFI_GENERAL_APPLICATION_SUBCLASS =3D 0x01 -EFI_FRONT_PAGE_SUBCLASS =3D 0x02 -EFI_SINGLE_USE_SUBCLASS =3D 0x03 - -# EFI_HII_PACKAGE_TYPE_x. - -EFI_HII_PACKAGE_TYPE_ALL =3D 0x00 -EFI_HII_PACKAGE_TYPE_GUID =3D 0x01 -EFI_HII_PACKAGE_FORM =3D 0x02 -EFI_HII_PACKAGE_KEYBOARD_LAYOUT =3D 0x03 -EFI_HII_PACKAGE_STRINGS =3D 0x04 -EFI_HII_PACKAGE_FONTS =3D 0x05 -EFI_HII_PACKAGE_IMAGES =3D 0x06 -EFI_HII_PACKAGE_SIMPLE_FONTS =3D 0x07 -EFI_HII_PACKAGE_DEVICE_PATH =3D 0x08 -EFI_HII_PACKAGE_END =3D 0xDF -EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN =3D 0xE0 -EFI_HII_PACKAGE_TYPE_SYSTEM_END =3D 0xFF - -EFI_IFR_EXTEND_OP_LABEL =3D 0x0 -EFI_IFR_EXTEND_OP_BANNER =3D 0x1 -EFI_IFR_EXTEND_OP_TIMEOUT =3D 0x2 -EFI_IFR_EXTEND_OP_CLASS =3D 0x3 -EFI_IFR_EXTEND_OP_SUBCLASS =3D 0x4 - -MAX_IFR_EXPRESSION_DEPTH =3D 0x9 - -INVALID_ARRAY_INDEX =3D 0xFFFFFFFF - -EFI_IFR_TYPE_NUM_SIZE_8 =3D 0x00 -EFI_IFR_TYPE_NUM_SIZE_16 =3D 0x01 -EFI_IFR_TYPE_NUM_SIZE_32 =3D 0x02 -EFI_IFR_TYPE_NUM_SIZE_64 =3D 0x03 -EFI_IFR_TYPE_BOOLEAN =3D 0x04 -EFI_IFR_TYPE_TIME =3D 0x05 -EFI_IFR_TYPE_DATE =3D 0x06 -EFI_IFR_TYPE_STRING =3D 0x07 -EFI_IFR_TYPE_OTHER =3D 0x08 -EFI_IFR_TYPE_UNDEFINED =3D 0x09 -EFI_IFR_TYPE_ACTION =3D 0x0A -EFI_IFR_TYPE_BUFFER =3D 0x0B -EFI_IFR_TYPE_REF =3D 0x0C - - -EFI_IFR_FLAGS_HORIZONTAL =3D 0x01 - -EFI_IFR_FLAG_READ_ONLY =3D 0x01 -EFI_IFR_FLAG_CALLBACK =3D 0x04 -EFI_IFR_FLAG_RESET_REQUIRED =3D 0x10 -EFI_IFR_FLAG_REST_STYLE =3D 0x20 -EFI_IFR_FLAG_RECONNECT_REQUIRED =3D 0x40 -EFI_IFR_FLAG_OPTIONS_ONLY =3D 0x80 - -EFI_IFR_STRING_MULTI_LINE =3D 0x01 - -EDKII_IFR_DISPLAY_BIT =3D 0xC0 -EDKII_IFR_DISPLAY_INT_DEC_BIT =3D 0x00 -EDKII_IFR_DISPLAY_UINT_DEC_BIT =3D 0x40 -EDKII_IFR_DISPLAY_UINT_HEX_BIT =3D 0x80 - -EDKII_IFR_NUMERIC_SIZE_BIT =3D 0x3F - -EFI_IFR_MAX_DEFAULT_TYPE =3D 0x10 - - -class EFI_GUID(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Data1', c_uint32), - ('Data2', c_uint16), - ('Data3', c_uint16), - ('Data4', c_ubyte * 8), - ] - - def from_list(self, listformat: list) -> None: - self.Data1 =3D listformat[0] - self.Data2 =3D listformat[1] - self.Data3 =3D listformat[2] - for i in range(8): - self.Data4[i] =3D listformat[i + 3] - - def __cmp__(self, otherguid) -> bool: - if not isinstance(otherguid, EFI_GUID): - return 'Input is not the GUID instance!' - rt =3D False - if self.Data1 =3D=3D otherguid.Data1 and self.Data2 =3D=3D othergu= id.Data2 and self.Data3 =3D=3D otherguid.Data3: - rt =3D True - for i in range(8): - rt =3D rt & (self.Data4[i] =3D=3D otherguid.Data4[i]) - return rt - - -GuidArray =3D c_ubyte * 8 -EFI_HII_PLATFORM_SETUP_FORMSET_GUID =3D EFI_GUID( - 0x93039971, 0x8545, 0x4b04, - GuidArray(0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe)) - -EFI_IFR_TIANO_GUID =3D EFI_GUID( - 0xf0b1735, 0x87a0, 0x4193, - GuidArray(0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce)) - -EDKII_IFR_BIT_VARSTORE_GUID =3D (0x82DDD68B, 0x9163, 0x4187, - GuidArray(0x9B, 0x27, 0x20, 0xA8, 0xFD, 0x6= 0, - 0xA7, 0x1D)) - -EFI_IFR_FRAMEWORK_GUID =3D (0x31ca5d1a, 0xd511, 0x4931, - GuidArray(0xb7, 0x82, 0xae, 0x6b, 0x2b, 0x17, 0x= 8c, - 0xd7)) - -class EFI_IFR_OP_HEADER(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('OpCode', c_ubyte), - ('Length', c_ubyte, 7), # - ('Scope', c_ubyte, 1), # - ] - - -class EFI_IFR_FORM_SET(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ('FormSetTitle', c_uint16), - ('Help', c_uint16), - ('Flags', c_ubyte), - ] - - -class EFI_IFR_GUID_CLASS(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ('ExtendOpCode', c_ubyte), - ('Class', c_uint16), - ] - - -class EFI_IFR_GUID_SUBCLASS(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ('ExtendOpCode', c_ubyte), - ('SubClass', c_uint16), - ] - - -class EFI_IFR_DEFAULTSTORE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('DefaultName', c_uint16), - ('DefaultId', c_uint16), - ] - - -class EFI_IFR_VARSTORE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ('VarStoreId', c_uint16), - ('Size', c_uint16), - ('Name', c_wchar_p), - ] - - -class EFI_IFR_VARSTORE_EFI(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ('VarStoreId', c_uint16), - ('Attributes', c_uint32), - ('Size', c_uint16), - ('Name', c_wchar_p), - ] - - -class EFI_IFR_GUID(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ] - - -class EFI_HII_PACKAGE_HEADER(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Length', c_uint32, 24), - ('Type', c_uint32, 8), - ] - - -class EFI_HII_STRING_PACKAGE_HDR(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_HII_PACKAGE_HEADER), - ('HdrSize', c_uint32), - ('StringInfoOffset', c_uint32), - ('LanguageWindow', c_ushort * 16), - ('LanguageName', c_uint16), - ('Language', c_char * 2), - ] - - -class EFI_IFR_VARSTORE_NAME_VALUE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('VarStoreId', c_uint16), - ('Guid', EFI_GUID), - ] - - -class EFI_IFR_FORM(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('FormId', c_uint16), - ('FormTitle', c_uint16), - ] - - -class EFI_IFR_GUID_BANNER(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ('ExtendOpCode', c_ubyte), - ('Title', c_uint16), - ('LineNumber', c_uint16), - ('Alignment', c_ubyte), - ] - - -class EFI_IFR_GUID_TIMEOUT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ('ExtendOpCode', c_ubyte), - ('TimeOut', c_uint16), - ] - - -class EFI_IFR_GUID_LABEL(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ('ExtendOpCode', c_ubyte), - ('Number', c_uint16), - ] - - -class EFI_IFR_RULE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('RuleId', c_ubyte), - ] - - -class EFI_IFR_STATEMENT_HEADER(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Prompt', c_uint16), - ('Help', c_uint16), - ] - - -class EFI_IFR_SUBTITLE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Statement', EFI_IFR_STATEMENT_HEADER), - ('Flags', c_ubyte), - ] - - -class EFI_IFR_TEXT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Statement', EFI_IFR_STATEMENT_HEADER), - ('TextTwo', c_uint16), - ] - - -class EFI_IFR_IMAGE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Id', c_uint16), - ] - - -class VarStoreInfoNode(Union): - _pack_ =3D 1 - _fields_ =3D [ - ('VarName', c_uint16), - ('VarOffset', c_uint16), - ] - - -class EFI_IFR_QUESTION_HEADER(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_STATEMENT_HEADER), - ('QuestionId', c_uint16), - ('VarStoreId', c_uint16), - ('VarStoreInfo', VarStoreInfoNode), - ('Flags', c_ubyte), - ] - - -class u8Node(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('MinValue', c_ubyte), - ('MaxValue', c_ubyte), - ('Step', c_ubyte), - ] - - -class u16Node(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('MinValue', c_uint16), - ('MaxValue', c_uint16), - ('Step', c_uint16), - ] - - -class u32Node(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('MinValue', c_uint32), - ('MaxValue', c_uint32), - ('Step', c_uint32), - ] - - -class u64Node(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('MinValue', c_uint64), - ('MaxValue', c_uint64), - ('Step', c_uint64), - ] - - -class MINMAXSTEP_DATA(Union): - _pack_ =3D 1 - _fields_ =3D [ - ('u8', u8Node), - ('u16', u16Node), - ('u32', u32Node), - ('u64', u64Node), - ] - - -EFI_IFR_NUMERIC_SIZE =3D 0x03 -EFI_IFR_NUMERIC_SIZE_1 =3D 0x00 -EFI_IFR_NUMERIC_SIZE_2 =3D 0x01 -EFI_IFR_NUMERIC_SIZE_4 =3D 0x02 -EFI_IFR_NUMERIC_SIZE_8 =3D 0x03 - -EFI_IFR_DISPLAY =3D 0x30 -EFI_IFR_DISPLAY_INT_DEC =3D 0x00 -EFI_IFR_DISPLAY_UINT_DEC =3D 0x10 -EFI_IFR_DISPLAY_UINT_HEX =3D 0x20 - -class EFI_IFR_ONE_OF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('Flags', c_ubyte), - ('data', MINMAXSTEP_DATA), - ] - - -EFI_IFR_CHECKBOX_DEFAULT =3D 0x01 -EFI_IFR_CHECKBOX_DEFAULT_MFG =3D 0x02 - - -class EFI_IFR_CHECKBOX(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('Flags', c_ubyte), - ] - - -class EFI_IFR_NUMERIC(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('Flags', c_ubyte), - ('Data', MINMAXSTEP_DATA), - ] - - -class EFI_IFR_PASSWORD(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('MinSize', c_uint16), - ('MaxSize', c_uint16), - ] - - -class EFI_HII_TIME(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Hour', c_ubyte), - ('Minute', c_ubyte), - ('Second', c_ubyte), - ] - - -class EFI_HII_DATE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Year', c_uint16), - ('Month', c_ubyte), - ('Day', c_ubyte), - ] - - -class EFI_HII_REF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('QuestionId', c_uint16), - ('FormId', c_uint16), - ('FormSetGuid', EFI_GUID), - ('DevicePath', c_uint16), - ] - - -class EFI_IFR_TYPE_VALUE(Union): - _pack_ =3D 1 - _fields_ =3D [ - ('u8', c_ubyte), - ('u16', c_uint16), - ('u32', c_uint32), - ('u64', c_uint64), - ('b', c_bool), - ('time', EFI_HII_TIME), - ('date', EFI_HII_DATE), - ('string', c_uint16), - ('ref', EFI_HII_REF), - ] - - -class EFI_IFR_ONE_OF_OPTION(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Option', c_uint16), - ('Flags', c_ubyte), - ('Type', c_ubyte), - ('Value', EFI_IFR_TYPE_VALUE), - ] - -def Refine_EFI_IFR_ONE_OF_OPTION(Nums): - class EFI_IFR_ONE_OF_OPTION(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Option', c_uint16), - ('Flags', c_ubyte), - ('Type', c_ubyte), - ('Value', EFI_IFR_TYPE_VALUE * Nums), - ] - return EFI_IFR_ONE_OF_OPTION - - -EFI_IFR_OPTION_DEFAULT =3D 0x10 -EFI_IFR_OPTION_DEFAULT_MFG =3D 0x20 - - -class EFI_IFR_SUPPRESS_IF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_LOCKED(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_ACTION(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('QuestionConfig', c_uint16), - ] - - -class EFI_IFR_REF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('FormId', c_uint16), - ] - - -class EFI_IFR_REF2(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('FormId', c_uint16), - ('QuestionId', c_uint16), - ] - - -class EFI_IFR_REF3(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('FormId', c_uint16), - ('QuestionId', c_uint16), - ('FormSetId', EFI_GUID), - ] - - -class EFI_IFR_REF4(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('FormId', c_uint16), - ('QuestionId', c_uint16), - ('FormSetId', EFI_GUID), - ('DevicePath', c_uint16), - ] - - -class EFI_IFR_REF5(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ] - - -class EFI_IFR_RESET_BUTTON(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Statement', EFI_IFR_STATEMENT_HEADER), - ('DefaultId', c_uint16), - ] - - -class EFI_IFR_NO_SUBMIT_IF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Error', c_uint16), - ] - - -class EFI_IFR_INCONSISTENT_IF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Error', c_uint16), - ] - - -class EFI_IFR_EQ_ID_VAL(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('QuestionId', c_uint16), - ('Value', c_uint16), - ] - - -class EFI_IFR_EQ_ID_ID(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('QuestionId1', c_uint16), - ('QuestionId2', c_uint16), - ] - -class EFI_IFR_EQ_ID_VAL_LIST(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('QuestionId', c_uint16), - ('ListLength', c_uint16), - ('ValueList', c_uint16), # - ] - - -def Refine_EFI_IFR_EQ_ID_VAL_LIST(Nums): - class EFI_IFR_EQ_ID_VAL_LIST(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('QuestionId', c_uint16), - ('ListLength', c_uint16), - ('ValueList', c_uint16 * Nums), # - ] - return EFI_IFR_EQ_ID_VAL_LIST - - -class EFI_IFR_AND(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_OR(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_NOT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_GRAY_OUT_IF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_DATE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('Flags', c_ubyte), - ] - - -EFI_QF_DATE_YEAR_SUPPRESS =3D 0x01 -EFI_QF_DATE_MONTH_SUPPRESS =3D 0x02 -EFI_QF_DATE_DAY_SUPPRESS =3D 0x04 - -EFI_QF_DATE_STORAGE =3D 0x30 -QF_DATE_STORAGE_NORMAL =3D 0x00 -QF_DATE_STORAGE_TIME =3D 0x10 -QF_DATE_STORAGE_WAKEUP =3D 0x20 - - -class EFI_IFR_TIME(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('Flags', c_ubyte), - ] - - -QF_TIME_HOUR_SUPPRESS =3D 0x01 -QF_TIME_MINUTE_SUPPRESS =3D 0x02 -QF_TIME_SECOND_SUPPRESS =3D 0x04 -QF_TIME_STORAGE =3D 0x30 -QF_TIME_STORAGE_NORMAL =3D 0x00 -QF_TIME_STORAGE_TIME =3D 0x10 -QF_TIME_STORAGE_WAKEUP =3D 0x20 - - -class EFI_IFR_STRING(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('MinSize', c_ubyte), - ('MaxSize', c_ubyte), - ('Flags', c_ubyte), - ] - - -class EFI_IFR_REFRESH(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('RefreshInterval', c_ubyte), - ] - - -class EFI_IFR_DISABLE_IF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_TO_LOWER(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_TO_UPPER(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_MAP(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_ORDERED_LIST(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Question', EFI_IFR_QUESTION_HEADER), - ('MaxContainers', c_ubyte), - ('Flags', c_ubyte), - ] - - -EFI_IFR_UNIQUE_SET =3D 0x01 -EFI_IFR_NO_EMPTY_SET =3D 0x02 - - -class EFI_IFR_VARSTORE_DEVICE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('DevicePath', c_uint16), - ] - - -class EFI_IFR_VERSION(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_END(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_MATCH(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_GET(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('VarStoreId', c_uint16), - ('VarStoreInfo', VarStoreInfoNode), ########## - ('VarStoreType', c_ubyte), - ] - - -class EFI_IFR_SET(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('VarStoreId', c_uint16), - ('VarStoreInfo', VarStoreInfoNode), ########## - ('VarStoreType', c_ubyte), - ] - - -class EFI_IFR_READ(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_WRITE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_EQUAL(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_NOT_EQUAL(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_GREATER_THAN(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_GREATER_EQUAL(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_LESS_EQUAL(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_LESS_THAN(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_BITWISE_AND(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_BITWISE_OR(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_BITWISE_NOT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_SHIFT_LEFT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_SHIFT_RIGHT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_ADD(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_SUBTRACT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_MULTIPLY(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_DIVIDE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_MODULO(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_RULE_REF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('RuleId', c_ubyte), - ] - - -class EFI_IFR_QUESTION_REF1(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('QuestionId', c_uint16), - ] - - -class EFI_IFR_QUESTION_REF2(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_QUESTION_REF3(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_QUESTION_REF3_2(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('DevicePath', c_uint16), - ] - - -class EFI_IFR_QUESTION_REF3_3(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('DevicePath', c_uint16), - ('Guid', EFI_GUID), - ] - - -class EFI_IFR_UINT8(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Value', c_ubyte), - ] - - -class EFI_IFR_UINT16(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Value', c_uint16), - ] - - -class EFI_IFR_UINT32(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Value', c_uint32), - ] - - -class EFI_IFR_UINT64(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Value', c_uint64), - ] - - -class EFI_IFR_TRUE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_FALSE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_TO_UINT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_TO_STRING(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Format', c_ubyte), - ] - - -class EFI_IFR_TO_BOOLEAN(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_MID(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_FIND(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Format', c_ubyte), - ] - - -class EFI_IFR_TOKEN(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_STRING_REF1(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('StringId', c_uint16), - ] - - -class EFI_IFR_STRING_REF2(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_CONDITIONAL(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_ZERO(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_ONE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_ONES(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_UNDEFINED(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_LENGTH(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_DUP(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_THIS(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -EFI_IFR_FLAGS_FIRST_MATCHING =3D 0x00 -EFI_IFR_FLAGS_FIRST_NON_MATCHING =3D 0x01 - -class EFI_IFR_SPAN(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Flags', c_ubyte), - ] - - -class EFI_IFR_VALUE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_DEFAULT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('DefaultId', c_uint16), - ('Type', c_ubyte), - ('Value', EFI_IFR_TYPE_VALUE), - ] - -def Refine_EFI_IFR_DEFAULT(Nums): - class EFI_IFR_DEFAULT(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('DefaultId', c_uint16), - ('Type', c_ubyte), - ('Value', EFI_IFR_TYPE_VALUE * Nums), - ] - return EFI_IFR_DEFAULT - - -class EFI_IFR_DEFAULT_2(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('DefaultId', c_uint16), - ('Type', c_ubyte), - ] - -class EFI_IFR_FORM_MAP(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('FormId', c_uint16), - ] - -class EFI_IFR_FORM_MAP_METHOD(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('MethodTitle', c_uint16), - ('MethodIdentifier', EFI_GUID), - ] - -class EFI_IFR_CATENATE(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_SECURITY(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Permissions', EFI_GUID), - ] - - -class EFI_IFR_MODAL_TAG(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ] - - -class EFI_IFR_REFRESH_ID(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('RefreshEventGroupId', EFI_GUID), - ] - - -class EFI_IFR_WARNING_IF(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Warning', c_uint16), - ('TimeOut', c_ubyte), - ] - - -class EFI_IFR_MATCH2(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('SyntaxType', EFI_GUID), - ] - - -EFI_IFR_FORM_OP =3D 0x01 -EFI_IFR_SUBTITLE_OP =3D 0x02 -EFI_IFR_TEXT_OP =3D 0x03 -EFI_IFR_IMAGE_OP =3D 0x04 -EFI_IFR_ONE_OF_OP =3D 0x05 -EFI_IFR_CHECKBOX_OP =3D 0x06 -EFI_IFR_NUMERIC_OP =3D 0x07 -EFI_IFR_PASSWORD_OP =3D 0x08 -EFI_IFR_ONE_OF_OPTION_OP =3D 0x09 -EFI_IFR_SUPPRESS_IF_OP =3D 0x0A -EFI_IFR_LOCKED_OP =3D 0x0B -EFI_IFR_ACTION_OP =3D 0x0C -EFI_IFR_RESET_BUTTON_OP =3D 0x0D -EFI_IFR_FORM_SET_OP =3D 0x0E -EFI_IFR_REF_OP =3D 0x0F -EFI_IFR_NO_SUBMIT_IF_OP =3D 0x10 -EFI_IFR_INCONSISTENT_IF_OP =3D 0x11 -EFI_IFR_EQ_ID_VAL_OP =3D 0x12 -EFI_IFR_EQ_ID_ID_OP =3D 0x13 -EFI_IFR_EQ_ID_VAL_LIST_OP =3D 0x14 -EFI_IFR_AND_OP =3D 0x15 -EFI_IFR_OR_OP =3D 0x16 -EFI_IFR_NOT_OP =3D 0x17 -EFI_IFR_RULE_OP =3D 0x18 -EFI_IFR_GRAY_OUT_IF_OP =3D 0x19 -EFI_IFR_DATE_OP =3D 0x1A -EFI_IFR_TIME_OP =3D 0x1B -EFI_IFR_STRING_OP =3D 0x1C -EFI_IFR_REFRESH_OP =3D 0x1D -EFI_IFR_DISABLE_IF_OP =3D 0x1E -EFI_IFR_TO_LOWER_OP =3D 0x20 -EFI_IFR_TO_UPPER_OP =3D 0x21 -EFI_IFR_MAP_OP =3D 0x22 -EFI_IFR_ORDERED_LIST_OP =3D 0x23 -EFI_IFR_VARSTORE_OP =3D 0x24 -EFI_IFR_VARSTORE_NAME_VALUE_OP =3D 0x25 -EFI_IFR_VARSTORE_EFI_OP =3D 0x26 -EFI_IFR_VARSTORE_DEVICE_OP =3D 0x27 -EFI_IFR_VERSION_OP =3D 0x28 -EFI_IFR_END_OP =3D 0x29 -EFI_IFR_MATCH_OP =3D 0x2A -EFI_IFR_GET_OP =3D 0x2B -EFI_IFR_SET_OP =3D 0x2C -EFI_IFR_READ_OP =3D 0x2D -EFI_IFR_WRITE_OP =3D 0x2E -EFI_IFR_EQUAL_OP =3D 0x2F -EFI_IFR_NOT_EQUAL_OP =3D 0x30 -EFI_IFR_GREATER_THAN_OP =3D 0x31 -EFI_IFR_GREATER_EQUAL_OP =3D 0x32 -EFI_IFR_LESS_THAN_OP =3D 0x33 -EFI_IFR_LESS_EQUAL_OP =3D 0x34 -EFI_IFR_BITWISE_AND_OP =3D 0x35 -EFI_IFR_BITWISE_OR_OP =3D 0x36 -EFI_IFR_BITWISE_NOT_OP =3D 0x37 -EFI_IFR_SHIFT_LEFT_OP =3D 0x38 -EFI_IFR_SHIFT_RIGHT_OP =3D 0x39 -EFI_IFR_ADD_OP =3D 0x3A -EFI_IFR_SUBTRACT_OP =3D 0x3B -EFI_IFR_MULTIPLY_OP =3D 0x3C -EFI_IFR_DIVIDE_OP =3D 0x3D -EFI_IFR_MODULO_OP =3D 0x3E -EFI_IFR_RULE_REF_OP =3D 0x3F -EFI_IFR_QUESTION_REF1_OP =3D 0x40 -EFI_IFR_QUESTION_REF2_OP =3D 0x41 -EFI_IFR_UINT8_OP =3D 0x42 -EFI_IFR_UINT16_OP =3D 0x43 -EFI_IFR_UINT32_OP =3D 0x44 -EFI_IFR_UINT64_OP =3D 0x45 -EFI_IFR_TRUE_OP =3D 0x46 -EFI_IFR_FALSE_OP =3D 0x47 -EFI_IFR_TO_UINT_OP =3D 0x48 -EFI_IFR_TO_STRING_OP =3D 0x49 -EFI_IFR_TO_BOOLEAN_OP =3D 0x4A -EFI_IFR_MID_OP =3D 0x4B -EFI_IFR_FIND_OP =3D 0x4C -EFI_IFR_TOKEN_OP =3D 0x4D -EFI_IFR_STRING_REF1_OP =3D 0x4E -EFI_IFR_STRING_REF2_OP =3D 0x4F -EFI_IFR_CONDITIONAL_OP =3D 0x50 -EFI_IFR_QUESTION_REF3_OP =3D 0x51 -EFI_IFR_ZERO_OP =3D 0x52 -EFI_IFR_ONE_OP =3D 0x53 -EFI_IFR_ONES_OP =3D 0x54 -EFI_IFR_UNDEFINED_OP =3D 0x55 -EFI_IFR_LENGTH_OP =3D 0x56 -EFI_IFR_DUP_OP =3D 0x57 -EFI_IFR_THIS_OP =3D 0x58 -EFI_IFR_SPAN_OP =3D 0x59 -EFI_IFR_VALUE_OP =3D 0x5A -EFI_IFR_DEFAULT_OP =3D 0x5B -EFI_IFR_DEFAULTSTORE_OP =3D 0x5C -EFI_IFR_FORM_MAP_OP =3D 0x5D -EFI_IFR_CATENATE_OP =3D 0x5E -EFI_IFR_GUID_OP =3D 0x5F -EFI_IFR_SECURITY_OP =3D 0x60 -EFI_IFR_MODAL_TAG_OP =3D 0x61 -EFI_IFR_REFRESH_ID_OP =3D 0x62 -EFI_IFR_WARNING_IF_OP =3D 0x63 -EFI_IFR_MATCH2_OP =3D 0x64 - -ConditionOps =3D [EFI_IFR_NO_SUBMIT_IF_OP, EFI_IFR_DISABLE_IF_OP, EFI_IFR_= SUPPRESS_IF_OP, EFI_IFR_GRAY_OUT_IF_OP, EFI_IFR_INCONSISTENT_IF_OP] -BasicDataTypes =3D ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'EFI_HII_DATE',= 'EFI_HII_TIME', 'EFI_HII_REF'] - -class EFI_IFR_GUID_OPTIONKEY(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('Header', EFI_IFR_OP_HEADER), - ('Guid', EFI_GUID), - ('ExtendOpCode', c_uint8), - ('QuestionId', c_uint16), - ('OptionValue', EFI_IFR_TYPE_VALUE), - ('KeyValue', c_uint16), - ] - - -EFI_IFR_EXTEND_OP_OPTIONKEY =3D 0x0 -EFI_IFR_EXTEND_OP_VAREQNAME =3D 0x1 - -class EFI_COMPARE_TYPE(Enum): - EQUAL =3D 0 - LESS_EQUAL =3D 1 - LESS_THAN =3D 2 - GREATER_THAN =3D 3 - GREATER_EQUAL =3D 4 \ No newline at end of file diff --git a/BaseTools/Source/Python/VfrCompiler/IfrCommon.py b/BaseTools/S= ource/Python/VfrCompiler/IfrCommon.py new file mode 100644 index 0000000000..7425abe9a9 --- /dev/null +++ b/BaseTools/Source/Python/VfrCompiler/IfrCommon.py @@ -0,0 +1,100 @@ +## @file +# This file is used to define common funtions. +# +# Copyright (c) 2022-, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +import Common.EdkLogger as EdkLogger +from VfrCompiler.IfrCtypes import EFI_GUID +from Common.BuildToolError import PARAMETER_INVALID + +# Enumeration of EFI_STATUS. +RETURN_SUCCESS =3D EFI_SUCCESS =3D 0 +EFI_BUFFER_TOO_SMALL =3D 0x8000000000000000 | (5) +EFI_ABORTED =3D 0x8000000000000000 | (21) +EFI_OUT_OF_RESOURCES =3D 0x8000000000000000 | (9) +EFI_INVALID_PARAMETER =3D 0x8000000000000000 | (2) +EFI_NOT_FOUND =3D 0x8000000000000000 | (14) +RETURN_INVALID_PARAMETER =3D 0x8000000000000000 | (2) +RETURN_UNSUPPORTED =3D 0x8000000000000000 | (3) + +ASCII_GUID_BUFFER_INDEX_1 =3D 8 +ASCII_GUID_BUFFER_INDEX_2 =3D 13 +ASCII_GUID_BUFFER_INDEX_3 =3D 18 +ASCII_GUID_BUFFER_INDEX_4 =3D 23 +ASCII_GUID_BUFFER_MAX_INDEX =3D 36 +GUID_BUFFER_VALUE_LEN =3D 11 + + +def EFI_ERROR(A): + return A < 0 + + +# Converts a string to an EFI_GUID. +def StringToGuid(AsciiGuidBuffer: str, GuidBuffer: EFI_GUID): + Data4 =3D [0] * 8 + if AsciiGuidBuffer is None or GuidBuffer is None: + return EFI_INVALID_PARAMETER + Index =3D 0 + while Index < ASCII_GUID_BUFFER_MAX_INDEX: + if ( + Index =3D=3D ASCII_GUID_BUFFER_INDEX_1 + or Index =3D=3D ASCII_GUID_BUFFER_INDEX_2 + or Index =3D=3D ASCII_GUID_BUFFER_INDEX_3 + or Index =3D=3D ASCII_GUID_BUFFER_INDEX_4 + ): + if AsciiGuidBuffer[Index] !=3D "-": + break + elif ( + (AsciiGuidBuffer[Index] >=3D "0" and AsciiGuidBuffer[Index] <= =3D "9") + or (AsciiGuidBuffer[Index] >=3D "a" and AsciiGuidBuffer[Index]= <=3D "f") + or (AsciiGuidBuffer[Index] >=3D "A" and AsciiGuidBuffer[Index]= <=3D "F") + ): + Index +=3D 1 + continue + else: + break + Index +=3D 1 + continue + + if Index < ASCII_GUID_BUFFER_MAX_INDEX: + EdkLogger.error("VfrCompiler", PARAMETER_INVALID, "Invalid option = value") + return EFI_ABORTED + Index =3D GUID_BUFFER_VALUE_LEN + try: + Data1 =3D int(AsciiGuidBuffer[0:8], 16) + Data2 =3D int(AsciiGuidBuffer[9:13], 16) + Data3 =3D int(AsciiGuidBuffer[14:18], 16) + Data4[0] =3D int(AsciiGuidBuffer[19:21], 16) + Data4[1] =3D int(AsciiGuidBuffer[21:23], 16) + Data4[2] =3D int(AsciiGuidBuffer[24:26], 16) + Data4[3] =3D int(AsciiGuidBuffer[26:28], 16) + Data4[4] =3D int(AsciiGuidBuffer[28:30], 16) + Data4[5] =3D int(AsciiGuidBuffer[30:32], 16) + Data4[6] =3D int(AsciiGuidBuffer[32:34], 16) + Data4[7] =3D int(AsciiGuidBuffer[34:36], 16) + except Exception: + EdkLogger.error("VfrCompiler", PARAMETER_INVALID, "Invalid Data va= lue!") + Index =3D 0 + + # Verify the correct number of items were scanned. + if Index !=3D GUID_BUFFER_VALUE_LEN: + EdkLogger.error("VfrCompiler", PARAMETER_INVALID, "Invalid option = value") + return EFI_ABORTED + + # Copy the data into our GUID. + GuidBuffer.Data1 =3D Data1 + GuidBuffer.Data2 =3D Data2 + GuidBuffer.Data3 =3D Data3 + GuidBuffer.Data4[0] =3D Data4[0] + GuidBuffer.Data4[1] =3D Data4[1] + GuidBuffer.Data4[2] =3D Data4[2] + GuidBuffer.Data4[3] =3D Data4[3] + GuidBuffer.Data4[4] =3D Data4[4] + GuidBuffer.Data4[5] =3D Data4[5] + GuidBuffer.Data4[6] =3D Data4[6] + GuidBuffer.Data4[7] =3D Data4[7] + Status =3D EFI_SUCCESS + + return Status, GuidBuffer diff --git a/BaseTools/Source/Python/VfrCompiler/IfrCompiler.py b/BaseTools= /Source/Python/VfrCompiler/IfrCompiler.py new file mode 100644 index 0000000000..15bf3d59ba --- /dev/null +++ b/BaseTools/Source/Python/VfrCompiler/IfrCompiler.py @@ -0,0 +1,586 @@ +## @file +# Extented Python VfrCompiler Tool. +# +# Copyright (c) 2022-, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +import os +import sys +import argparse +import Common.EdkLogger as EdkLogger +from pathlib import Path +from antlr4 import * +from enum import Enum +from Common.BuildToolError import * +from VfrCompiler.VfrSyntaxParser import VfrSyntaxParser +from VfrCompiler.VfrSyntaxVisitor import VfrSyntaxVisitor +from VfrCompiler.VfrSyntaxLexer import VfrSyntaxLexer +from VfrCompiler.IfrCommon import EFI_SUCCESS, EFI_ERROR, StringToGuid +from VfrCompiler.IfrTree import IfrTreeNode, IfrTree, VFR_COMPILER_VERSION= , BUILD_VERSION +from VfrCompiler.IfrPreProcess import Options, PreProcessDB +from VfrCompiler.IfrUtility import gVfrStringDB +from VfrCompiler.IfrFormPkg import ( + gFormPkg, + gVfrVarDataTypeDB, + gVfrDefaultStore, + gVfrDataStorage, + gIfrFormId, +) +from VfrCompiler.IfrError import gVfrErrorHandle + + +class COMPILER_RUN_STATUS(Enum): + STATUS_STARTED =3D 0 + STATUS_INITIALIZED =3D 1 + STATUS_VFR_PREPROCESSED =3D 2 + STATUS_VFR_COMPILEED =3D 3 + STATUS_VFR_GENBINARY =3D 4 + STATUS_YAML_GENERATED =3D 5 + STATUS_YAML_PREPROCESSED =3D 6 + STATUS_YAML_COMPILED =3D 7 + STATUS_YAML_DLT_CONSUMED =3D 8 + STATUS_YAML_GENBINARY =3D 9 + STATUS_FINISHED =3D 10 + STATUS_FAILED =3D 11 + STATUS_DEAD =3D 12 + + +""" + This is how we invoke the C preprocessor on the VFR source file + to resolve #defines, #includes, etc. To make C source files + shareable between VFR and drivers, define VFRCOMPILE so that + #ifdefs can be used in shared .h files. +""" +PREPROCESSOR_COMMAND =3D "cl " +PREPROCESSOR_OPTIONS =3D "/nologo /E /TC /DVFRCOMPILE " + +# Specify the filename extensions for the files we generate. +VFR__FILENAME_EXTENSION =3D ".vfr" +VFR_PREPROCESS_FILENAME_EXTENSION =3D ".i" +VFR_PACKAGE_FILENAME_EXTENSION =3D ".hpk" +VFR_RECORDLIST_FILENAME_EXTENSION =3D ".lst" +VFR_YAML_FILENAME_EXTENSION =3D ".yml" +VFR_JSON_FILENAME_EXTENSION =3D ".json" + +WARNING_LOG_LEVEL =3D 15 +UTILITY_NAME =3D "VfrCompiler" + +parser =3D argparse.ArgumentParser( + description=3D"VfrCompiler", + epilog=3Df"VfrCompile version {VFR_COMPILER_VERSION} \ + Build {BUILD_VERSION} Copyright (c) 2004-20= 16 Intel Corporation.\ + All rights reserved.", +) +parser.add_argument("InputFileName", help=3D"Input source file name") +parser.add_argument( + "--vfr", dest=3D"LanuchVfrCompiler", action=3D"store_true", help=3D"la= nuch VfrCompiler" +) +parser.add_argument( + "--version", + action=3D"version", + version=3Df"VfrCompile version {VFR_COMPILER_VERSION} Build {BUILD_VER= SION}", + help=3D"prints version info", +) +parser.add_argument("-l", dest=3D"CreateRecordListFile", help=3D"create an= output IFR listing file") +parser.add_argument("-c", dest=3D"CreateYamlFile", help=3D"create Yaml fil= e") +parser.add_argument("-j", dest=3D"CreateJsonFile", help=3D"create Json fil= e") +parser.add_argument("-w", dest=3D"Workspace", help=3D"workspace") +parser.add_argument( + "-o", + "--output-directory", + "-od", + dest=3D"OutputDirectory", + help=3D"deposit all output files to directory OutputDir, \ + default is current directory", +) +parser.add_argument( + "-oo", + "--old-output-directory", + "-ood", + dest=3D"OldOutputDirectory", + help=3D"Former directory OutputDir of output files, \ + default is current directory", +) +parser.add_argument( + "-b", + "--create-ifr-package", + "-ibin", + dest=3D"CreateIfrPkgFile", + help=3D"create an IFR HII pack file", +) +parser.add_argument( + "-n", + "--no-pre-processing", + "-nopp", + dest=3D"SkipCPreprocessor", + help=3D"do not preprocessing input file", +) +parser.add_argument( + "-f", + "--pre-processing-flag", + "-ppflag", + dest=3D"CPreprocessorOptions", + help=3D"C-preprocessor argument", +) # +parser.add_argument( + "-s", "--string-db", dest=3D"StringFileName", help=3D"input uni string= package file" +) +parser.add_argument( + "-g", + "--guid", + dest=3D"OverrideClassGuid", + help=3D"override class guid input,\ + format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", +) +parser.add_argument( + "-wae", "--warning-as-error", dest=3D"WarningAsError", help=3D"treat w= arning as an error" +) +parser.add_argument( + "-a", + "--autodefault", + dest=3D"AutoDefault", + help=3D"generate default value for question opcode if some default is = missing", +) +parser.add_argument( + "-d", + "--checkdefault", + dest=3D"CheckDefault", + help=3D"check the default information in a question opcode", +) +parser.add_argument("-m", "--modulename", dest=3D"ModuleName", help=3D"Mod= ule name") + + +class CmdParser: + def __init__(self, Args, Argc): + self.Options =3D Options() + self.RunStatus =3D COMPILER_RUN_STATUS.STATUS_STARTED + self.PreProcessCmd =3D PREPROCESSOR_COMMAND + self.PreProcessOpt =3D PREPROCESSOR_OPTIONS + self.OptionIntialization(Args, Argc) + + def OptionIntialization(self, Args, Argc): + Status =3D EFI_SUCCESS + + if Argc =3D=3D 1: + parser.print_help() + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + if Args.LanuchVfrCompiler: + self.Options.LanuchVfrCompiler =3D True + + if Args.CreateRecordListFile: + self.Options.CreateRecordListFile =3D True + + if Args.ModuleName: + self.Options.ModuleName =3D Args.ModuleName + + if Args.OutputDirectory: + self.Options.OutputDirectory =3D Args.OutputDirectory + if self.Options.OutputDirectory is None: + EdkLogger.error("VfrCompiler", OPTION_MISSING, "-o missing= output directory name") + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + self.Options.DebugDirectory =3D str(Path(self.Options.OutputDi= rectory).parent / "DEBUG") + EdkLogger.debug(EdkLogger.DEBUG_8, f"Output Directory {self.Op= tions.OutputDirectory}") + + if Args.Workspace: + self.Options.Workspace =3D Args.Workspace + IsInCludePathLine =3D False + HasVFRPPLine =3D False + self.Options.IncludePaths =3D [] + MakeFile =3D Path(self.Options.OutputDirectory).parent / "Make= file" + if MakeFile.exists(): + with MakeFile.open(mode=3D"r") as File: + for Line in File: + if Line.find("INC =3D \\") !=3D -1: + IsInCludePathLine =3D True + continue + if Line.find("VFRPP =3D ") !=3D -1: + HasVFRPPLine =3D True + self.Options.VFRPP =3D Line.split("=3D")[1].st= rip() + continue + if IsInCludePathLine: + Line =3D Line.lstrip().rstrip(" \\\n\r") + if Line.startswith("/IC"): + InCludePath =3D Line.replace("/IC", "C", 1= ) + self.Options.IncludePaths.append(InCludePa= th) + elif Line.startswith("/Ic"): + InCludePath =3D Line.replace("/Ic", "C", 1= ) + self.Options.IncludePaths.append(InCludePa= th) + elif Line.startswith("/I$(WORKSPACE)"): + InCludePath =3D Line.replace( + "/I$(WORKSPACE)", self.Options.Workspa= ce, 1 + ) + self.Options.IncludePaths.append(InCludePa= th) + elif Line.startswith("/I$(DEBUG_DIR)"): + InCludePath =3D self.Options.DebugDirector= y + self.Options.IncludePaths.append(InCludePa= th) + elif HasVFRPPLine is False: + IsInCludePathLine =3D False + else: + break + + if Args.OldOutputDirectory: + self.Options.OldOutputDirectory =3D Args.OldOutputDirectory + if self.Options.OldOutputDirectory is None: + EdkLogger.error("VfrCompiler", OPTION_MISSING, "-oo missin= g output directory name") + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + EdkLogger.debug( + EdkLogger.DEBUG_8, f"Old Output Directory {self.Options.Ol= dOutputDirectory}" + ) + + if Args.CreateIfrPkgFile: + self.Options.CreateIfrPkgFile =3D True + + if Args.CreateYamlFile: + self.Options.CreateYamlFile =3D True + + if Args.CreateJsonFile: + self.Options.CreateJsonFile =3D True + + if Args.SkipCPreprocessor: + self.Options.SkipCPreprocessor =3D True + + if Args.CPreprocessorOptions: + Options =3D Args.CPreprocessorOptions + if Options is None: + EdkLogger.error( + "VfrCompiler", + OPTION_MISSING, + "-od - missing C-preprocessor argument", + ) + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + self.Options.CPreprocessorOptions +=3D " " + Options + + if Args.StringFileName: + StringFileName =3D Args.StringFileName + if StringFileName is None: + EdkLogger.error("VfrCompiler", OPTION_MISSING, "-s missing= input string file name") + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + gVfrStringDB.SetStringFileName(StringFileName) + EdkLogger.debug(EdkLogger.DEBUG_8, f"Input string file path {S= tringFileName}") + + if Args.OverrideClassGuid: + res =3D StringToGuid(Args.OverrideClassGuid, self.Options.Over= rideClassGuid) + if type(res) =3D=3D "int": + Status =3D res + else: + Status =3D res[0] + self.Options.OverrideClassGuid =3D res[1] + + if EFI_ERROR(Status): + EdkLogger.error( + "VfrCompiler", + FORMAT_INVALID, + f"Invalid format: {Args.OverrideClassGuid}", + ) + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + self.Options.HasOverrideClassGuid =3D True + + if Args.WarningAsError: + self.Options.WarningAsError =3D True + + if Args.AutoDefault: + self.Options.AutoDefault =3D True + + if Args.CheckDefault: + self.Options.CheckDefault =3D True + + if Args.InputFileName: + self.Options.InputFileName =3D Args.InputFileName + if self.Options.InputFileName is None: + EdkLogger.error("VfrCompiler", OPTION_MISSING, "Input file= name is not specified.") + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + if self.Options.OutputDirectory is None: + self.Options.OutputDirectory =3D "" + + if self.SetBaseFileName() !=3D 0: + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + if self.SetPkgOutputFileName() !=3D 0: + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + if self.SetCOutputFileName() !=3D 0: + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + if self.SetPreprocessorOutputFileName() !=3D 0: + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + if self.SetRecordListFileName() !=3D 0: + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + if self.SetSourceYamlFileName() !=3D 0: + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + if self.SetJsonFileName() !=3D 0: + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + return + + def SetBaseFileName(self): + if self.Options.InputFileName is None: + return -1 + pFileName =3D self.Options.InputFileName + while (pFileName.find("\\") !=3D -1) or (pFileName.find("/") !=3D = -1): + if pFileName.find("\\") !=3D -1: + i =3D pFileName.find("\\") + else: + i =3D pFileName.find("/") + + if i =3D=3D len(pFileName) - 1: + return -1 + + pFileName =3D pFileName[i + 1 :] + + if pFileName =3D=3D "" or pFileName.find(".") =3D=3D -1: + return -1 + + self.Options.BaseFileName =3D pFileName[: pFileName.find(".")] + return 0 + + def SetPkgOutputFileName(self): + if self.Options.BaseFileName is None: + return -1 + if self.Options.LanuchVfrCompiler: + self.Options.PkgOutputFileName =3D str( + Path(self.Options.OutputDirectory) / f"PyVfr_{self.Options= .BaseFileName}.hpk" + ) + return 0 + + def SetCOutputFileName(self): + if self.Options.BaseFileName is None: + return -1 + if self.Options.LanuchVfrCompiler: + self.Options.COutputFileName =3D str( + Path(self.Options.DebugDirectory) / f"PyVfr_{self.Options.= BaseFileName}.c" + ) + return 0 + + def SetPreprocessorOutputFileName(self): + if self.Options.BaseFileName is None: + return -1 + self.Options.CProcessedVfrFileName =3D str( + Path(self.Options.OutputDirectory) / f"{self.Options.BaseFileN= ame}.i" + ) + return 0 + + def SetRecordListFileName(self): + if self.Options.BaseFileName is None: + return -1 + if self.Options.LanuchVfrCompiler: + self.Options.RecordListFileName =3D str( + Path(self.Options.DebugDirectory) / f"PyVfr_{self.Options.= BaseFileName}.lst" + ) + return 0 + + def SetSourceYamlFileName(self): + if self.Options.BaseFileName is None: + return -1 + self.Options.YamlFileName =3D str( + Path(self.Options.DebugDirectory) / f"{self.Options.BaseFileNa= me}.yml" + ) + self.Options.YamlOutputFileName =3D str( + Path(self.Options.DebugDirectory) / f"{self.Options.BaseFileNa= me}Compiled.yml" + ) + return 0 + + def SetJsonFileName(self): + if self.Options.BaseFileName is None: + return -1 + self.Options.JsonFileName =3D str( + Path(self.Options.DebugDirectory) / f"{self.Options.BaseFileNa= me}.json" + ) + return 0 + + def FindIncludeHeaderFile(self, Start, Name): + FileList =3D [] + for Relpath, _, Files in os.walk(Start): + if Name in Files: + FullPath =3D os.path.join(Start, Relpath, Name) + FileList.append(os.path.normpath(os.path.abspath(FullPath)= )) + return FileList + + def SET_RUN_STATUS(self, Status): + self.RunStatus =3D Status + + def IS_RUN_STATUS(self, Status): + return self.RunStatus =3D=3D Status + + +class VfrCompiler: + def __init__(self, Cmd: CmdParser): + self.Clear() + self.Options =3D Cmd.Options + self.RunStatus =3D Cmd.RunStatus + self.VfrRoot =3D IfrTreeNode() + self.PreProcessDB =3D PreProcessDB(self.Options) + self.VfrTree =3D IfrTree(self.VfrRoot, self.PreProcessDB, self.Opt= ions) + if (not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED)) and= ( + not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD) + ): + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_INITIALIZED) + + def Clear(self): + gVfrVarDataTypeDB.Clear() + gVfrDefaultStore.Clear() + gVfrDataStorage.Clear() + gFormPkg.Clear() + gIfrFormId.Clear() + + def PreProcess(self): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_INITIALIZED): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD): + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + elif self.Options.SkipCPreprocessor is False: + # call C preprocessor first in the tool itself, but currently = not support here + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + else: + # makefile will call cl commands to generate .i file + # do not need to run C preprocessor in this tool itself + self.PreProcessDB.Preprocess() + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_VFR_PREPROCESSE= D) + + def Compile(self): + InFileName =3D self.Options.CProcessedVfrFileName + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_VFR_PREPROCES= SED): + EdkLogger.error( + "VfrCompiler", + FILE_PARSE_FAILURE, + "compile error in file %s" % InFileName, + InFileName, + ) + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + else: + gVfrErrorHandle.SetInputFile(self.Options.InputFileName) + gVfrErrorHandle.SetWarningAsError(self.Options.WarningAsError) + + try: + InputStream =3D FileStream(InFileName) + VfrLexer =3D VfrSyntaxLexer(InputStream) + VfrStream =3D CommonTokenStream(VfrLexer) + VfrParser =3D VfrSyntaxParser(VfrStream) + except: + EdkLogger.error( + "VfrCompiler", + FILE_OPEN_FAILURE, + "File open failed for %s" % InFileName, + InFileName, + ) + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD)= : + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + return + self.Visitor =3D VfrSyntaxVisitor( + self.PreProcessDB, self.VfrRoot, self.Options.OverrideClas= sGuid + ) + self.Visitor.visit(VfrParser.vfrProgram()) + + if self.Visitor.ParserStatus !=3D 0: + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD)= : + EdkLogger.error( + "VfrCompiler", + FILE_PARSE_FAILURE, + "compile error in file %s" % InFileName, + InFileName, + ) + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + return + + if gFormPkg.HavePendingUnassigned() is True: + gFormPkg.PendingAssignPrintAll() + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD)= : + EdkLogger.error( + "VfrCompiler", + FILE_PARSE_FAILURE, + "compile error in file %s" % InFileName, + InFileName, + ) + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + return + + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_VFR_COMPILEED) + if self.Options.CreateJsonFile: + self.VfrTree.DumpJson() + + def GenBinary(self): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_VFR_COMPILEED= ): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD): + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + else: + if self.Options.CreateIfrPkgFile: + self.VfrTree.GenBinary() + + def GenCFile(self): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_VFR_COMPILEED= ): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD): + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + else: + if self.Options.CreateIfrPkgFile: + self.VfrTree.GenCFile() + + def GenRecordListFile(self): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_VFR_COMPILEED= ): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD): + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + else: + if self.Options.CreateRecordListFile: + self.VfrTree.GenRecordListFile() + + def GenBinaryFiles(self): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_VFR_COMPILEED= ): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD): + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + else: + self.VfrTree.GenBinaryFiles() + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FINISHED) + + def DumpSourceYaml(self): + if not self.IS_RUN_STATUS( + COMPILER_RUN_STATUS.STATUS_VFR_COMPILEED + ) and not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FINISHED): + if not self.IS_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_DEAD): + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FAILED) + else: + if self.Options.CreateYamlFile: + self.VfrTree.DumpYamlForXMLCLI() + self.SET_RUN_STATUS(COMPILER_RUN_STATUS.STATUS_FINISHED) + + def SET_RUN_STATUS(self, Status): + self.RunStatus =3D Status + + def IS_RUN_STATUS(self, Status): + return self.RunStatus =3D=3D Status + + +def main(): + Args =3D parser.parse_args() + Argc =3D len(sys.argv) + EdkLogger.SetLevel(WARNING_LOG_LEVEL) + Cmd =3D CmdParser(Args, Argc) + Compiler =3D VfrCompiler(Cmd) + Compiler.PreProcess() + Compiler.Compile() + Compiler.GenBinaryFiles() + Compiler.DumpSourceYaml() + Status =3D Compiler.RunStatus + if Status =3D=3D COMPILER_RUN_STATUS.STATUS_DEAD or Status =3D=3D COMP= ILER_RUN_STATUS.STATUS_FAILED: + return 2 + + return EFI_SUCCESS + + +if __name__ =3D=3D "__main__": + sys.exit(main()) diff --git a/BaseTools/Source/Python/VfrCompiler/IfrCtypes.py b/BaseTools/S= ource/Python/VfrCompiler/IfrCtypes.py new file mode 100644 index 0000000000..a7f7a32a27 --- /dev/null +++ b/BaseTools/Source/Python/VfrCompiler/IfrCtypes.py @@ -0,0 +1,1811 @@ +## @file +# This file is used to define the common C struct and functions. +# +# Copyright (c) 2022-, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +from ctypes import * +from struct import * +from enum import Enum + + +EFI_STRING_ID_INVALID =3D 0x0 +EFI_HII_DEFAULT_CLASS_STANDARD =3D 0x0000 +EFI_HII_DEFAULT_CLASS_MANUFACTURING =3D 0x0001 +EFI_IFR_MAX_LENGTH =3D 0xFF +EFI_VARSTORE_ID_INVALID =3D 0 +EFI_VARSTORE_ID_START =3D 0x20 +EFI_VAROFFSET_INVALID =3D 0xFFFF +EFI_IMAGE_ID_INVALID =3D 0xFFFF + +EFI_NON_DEVICE_CLASS =3D 0x00 +EFI_DISK_DEVICE_CLASS =3D 0x01 +EFI_VIDEO_DEVICE_CLASS =3D 0x02 +EFI_NETWORK_DEVICE_CLASS =3D 0x04 +EFI_INPUT_DEVICE_CLASS =3D 0x08 +EFI_ON_BOARD_DEVICE_CLASS =3D 0x10 +EFI_OTHER_DEVICE_CLASS =3D 0x20 + +EFI_SETUP_APPLICATION_SUBCLASS =3D 0x00 +EFI_GENERAL_APPLICATION_SUBCLASS =3D 0x01 +EFI_FRONT_PAGE_SUBCLASS =3D 0x02 +EFI_SINGLE_USE_SUBCLASS =3D 0x03 + +# EFI_HII_PACKAGE_TYPE_x. + +EFI_HII_PACKAGE_TYPE_ALL =3D 0x00 +EFI_HII_PACKAGE_TYPE_GUID =3D 0x01 +EFI_HII_PACKAGE_FORM =3D 0x02 +EFI_HII_PACKAGE_KEYBOARD_LAYOUT =3D 0x03 +EFI_HII_PACKAGE_STRINGS =3D 0x04 +EFI_HII_PACKAGE_FONTS =3D 0x05 +EFI_HII_PACKAGE_IMAGES =3D 0x06 +EFI_HII_PACKAGE_SIMPLE_FONTS =3D 0x07 +EFI_HII_PACKAGE_DEVICE_PATH =3D 0x08 +EFI_HII_PACKAGE_END =3D 0xDF +EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN =3D 0xE0 +EFI_HII_PACKAGE_TYPE_SYSTEM_END =3D 0xFF + +EFI_IFR_EXTEND_OP_LABEL =3D 0x0 +EFI_IFR_EXTEND_OP_BANNER =3D 0x1 +EFI_IFR_EXTEND_OP_TIMEOUT =3D 0x2 +EFI_IFR_EXTEND_OP_CLASS =3D 0x3 +EFI_IFR_EXTEND_OP_SUBCLASS =3D 0x4 + +MAX_IFR_EXPRESSION_DEPTH =3D 0x9 + +INVALID_ARRAY_INDEX =3D 0xFFFFFFFF + +EFI_IFR_TYPE_NUM_SIZE_8 =3D 0x00 +EFI_IFR_TYPE_NUM_8_BIT_SIZE =3D 0x01 +EFI_IFR_TYPE_NUM_SIZE_16 =3D 0x01 +EFI_IFR_TYPE_NUM_16_BIT_SIZE =3D 0x02 +EFI_IFR_TYPE_NUM_SIZE_32 =3D 0x02 +EFI_IFR_TYPE_NUM_32_BIT_SIZE =3D 0x04 +EFI_IFR_TYPE_NUM_SIZE_64 =3D 0x03 +EFI_IFR_TYPE_NUM_64_BIT_SIZE =3D 0x08 +EFI_IFR_TYPE_BOOLEAN =3D 0x04 +EFI_IFR_TYPE_TIME =3D 0x05 +EFI_IFR_TYPE_DATE =3D 0x06 +EFI_IFR_TYPE_STRING =3D 0x07 +EFI_IFR_TYPE_OTHER =3D 0x08 +EFI_IFR_TYPE_UNDEFINED =3D 0x09 +EFI_IFR_TYPE_ACTION =3D 0x0A +EFI_IFR_TYPE_BUFFER =3D 0x0B +EFI_IFR_TYPE_REF =3D 0x0C + + +EFI_IFR_FLAGS_HORIZONTAL =3D 0x01 + +EFI_IFR_FLAG_READ_ONLY =3D 0x01 +EFI_IFR_FLAG_CALLBACK =3D 0x04 +EFI_IFR_FLAG_RESET_REQUIRED =3D 0x10 +EFI_IFR_FLAG_REST_STYLE =3D 0x20 +EFI_IFR_FLAG_RECONNECT_REQUIRED =3D 0x40 +EFI_IFR_FLAG_OPTIONS_ONLY =3D 0x80 + +EFI_IFR_STRING_MULTI_LINE =3D 0x01 + +EDKII_IFR_DISPLAY_BIT =3D 0xC0 +EDKII_IFR_DISPLAY_INT_DEC_BIT =3D 0x00 +EDKII_IFR_DISPLAY_UINT_DEC_BIT =3D 0x40 +EDKII_IFR_DISPLAY_UINT_HEX_BIT =3D 0x80 + +EDKII_IFR_NUMERIC_SIZE_BIT =3D 0x3F + +EFI_IFR_MAX_DEFAULT_TYPE =3D 0x10 + +EFI_HII_SIBT_END =3D 0x00 +EFI_HII_SIBT_STRING_SCSU =3D 0x10 +EFI_HII_SIBT_STRING_SCSU_FONT =3D 0x11 +EFI_HII_SIBT_STRINGS_SCSU =3D 0x12 +EFI_HII_SIBT_STRINGS_SCSU_FONT =3D 0x13 +EFI_HII_SIBT_STRING_UCS2 =3D 0x14 +EFI_HII_SIBT_STRING_UCS2_FONT =3D 0x15 +EFI_HII_SIBT_STRINGS_UCS2 =3D 0x16 +EFI_HII_SIBT_STRINGS_UCS2_FONT =3D 0x17 +EFI_HII_SIBT_DUPLICATE =3D 0x20 +EFI_HII_SIBT_SKIP2 =3D 0x21 +EFI_HII_SIBT_SKIP1 =3D 0x22 +EFI_HII_SIBT_EXT1 =3D 0x30 +EFI_HII_SIBT_EXT2 =3D 0x31 +EFI_HII_SIBT_EXT4 =3D 0x32 +EFI_HII_SIBT_FONT =3D 0x40 + +BasicTypes =3D [ + EFI_IFR_TYPE_NUM_SIZE_8, + EFI_IFR_TYPE_NUM_SIZE_16, + EFI_IFR_TYPE_NUM_SIZE_32, + EFI_IFR_TYPE_NUM_SIZE_64, +] +BasicCInts =3D [c_uint64, c_uint32, c_uint16, c_uint8, c_ubyte, c_ushort] + + +class EFI_GUID(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Data1", c_uint32), + ("Data2", c_uint16), + ("Data3", c_uint16), + ("Data4", c_ubyte * 8), + ] + + def from_list(self, listformat: list) -> None: + self.Data1 =3D listformat[0] + self.Data2 =3D listformat[1] + self.Data3 =3D listformat[2] + for i in range(8): + self.Data4[i] =3D listformat[i + 3] + + def to_string(self) -> str: + GuidStr =3D f"{{{self.Data1:#x}, {self.Data2:#x}, {self.Data3:#x},= {{ {', '.join(f'{x:#x}' for x in self.Data4)}}}}}" + + return GuidStr + + def __cmp__(self, otherguid) -> bool: + if not isinstance(otherguid, EFI_GUID): + return "Input is not the GUID instance!" + rt =3D False + if ( + self.Data1 =3D=3D otherguid.Data1 + and self.Data2 =3D=3D otherguid.Data2 + and self.Data3 =3D=3D otherguid.Data3 + ): + rt =3D True + for i in range(8): + rt =3D rt & (self.Data4[i] =3D=3D otherguid.Data4[i]) + return rt + + +GuidArray =3D c_ubyte * 8 +EFI_HII_PLATFORM_SETUP_FORMSET_GUID =3D EFI_GUID( + 0x93039971, 0x8545, 0x4B04, GuidArray(0xB4, 0x5E, 0x32, 0xEB, 0x83, 0x= 26, 0x4, 0xE) +) + +EFI_IFR_TIANO_GUID =3D EFI_GUID( + 0xF0B1735, 0x87A0, 0x4193, GuidArray(0xB2, 0x66, 0x53, 0x8C, 0x38, 0xA= F, 0x48, 0xCE) +) + +EDKII_IFR_BIT_VARSTORE_GUID =3D ( + 0x82DDD68B, + 0x9163, + 0x4187, + GuidArray(0x9B, 0x27, 0x20, 0xA8, 0xFD, 0x60, 0xA7, 0x1D), +) + +EFI_IFR_FRAMEWORK_GUID =3D ( + 0x31CA5D1A, + 0xD511, + 0x4931, + GuidArray(0xB7, 0x82, 0xAE, 0x6B, 0x2B, 0x17, 0x8C, 0xD7), +) + + +class EFI_IFR_OP_HEADER(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("OpCode", c_ubyte), + ("Length", c_ubyte, 7), + ("Scope", c_ubyte, 1), + ] + + +class EFI_IFR_FORM_SET(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("FormSetTitle", c_uint16), + ("Help", c_uint16), + ("Flags", c_ubyte), + ] + + +class EFI_IFR_GUID_CLASS(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("ExtendOpCode", c_ubyte), + ("Class", c_uint16), + ] + + +class EFI_IFR_GUID_SUBCLASS(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("ExtendOpCode", c_ubyte), + ("SubClass", c_uint16), + ] + + +class EFI_IFR_DEFAULTSTORE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("DefaultName", c_uint16), + ("DefaultId", c_uint16), + ] + + +class EFI_IFR_VARSTORE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("VarStoreId", c_uint16), + ("Size", c_uint16), + ("Name", ARRAY(c_ubyte, 2)), + ] + + +def Refine_EFI_IFR_VARSTORE(Nums): + class EFI_IFR_VARSTORE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("VarStoreId", c_uint16), + ("Size", c_uint16), + ("Name", ARRAY(c_ubyte, Nums)), + ] + + def __init__(self) -> None: + self.Header =3D EFI_IFR_OP_HEADER() + + return EFI_IFR_VARSTORE() + + +class EFI_IFR_VARSTORE_EFI(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("VarStoreId", c_uint16), + ("Guid", EFI_GUID), + ("Attributes", c_uint32), + ("Size", c_uint16), + ("Name", ARRAY(c_ubyte, 2)), + ] + + +def Refine_EFI_IFR_VARSTORE_EFI(Nums): + class EFI_IFR_VARSTORE_EFI(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("VarStoreId", c_uint16), + ("Guid", EFI_GUID), + ("Attributes", c_uint32), + ("Size", c_uint16), + ("Name", ARRAY(c_ubyte, Nums)), + ] + + def __init__(self) -> None: + self.Header =3D EFI_IFR_OP_HEADER() + + return EFI_IFR_VARSTORE_EFI() + + +class EFI_IFR_GUID(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ] + + +def Refine_EFI_IFR_BUFFER(Nums): + class EFI_IFR_BUFFER(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Data", ARRAY(c_ubyte, Nums)), + ] + + def SetBuffer(self, Buffer): + self.Buffer =3D Buffer + + return EFI_IFR_BUFFER() + + +def Refine_EFI_IFR_BIT_BUFFER(Nums): + class EFI_IFR_BIT_BUFFER(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Data", ARRAY(c_ubyte, Nums)), + ] + + def SetBuffer(self, Buffer): + self.Buffer =3D Buffer + + return EFI_IFR_BIT_BUFFER + + +def Refine_EFI_IFR_BIT(Type, PreBits, Size, Data): + if PreBits =3D=3D 0: + + class Refine_EFI_IFR_BIT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Data", Type, Size), # the really needed data + ("Postfix", Type, sizeof(Type) * 8 - Size), + ] + + def __init__(self, Data): + self.Data =3D Data + + elif sizeof(Type) * 8 - Size - PreBits =3D=3D 0: + + class Refine_EFI_IFR_BIT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Prefix", Type, PreBits), + ("Data", Type, Size), # the really needed data + ] + + def __init__(self, Data): + self.Data =3D Data + + else: + + class Refine_EFI_IFR_BIT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Prefix", Type, PreBits), + ("Data", Type, Size), # the really needed data + ("Postfix", Type, sizeof(Type) * 8 - Size - PreBits), + ] + + def __init__(self, Data): + self.Data =3D Data + + return Refine_EFI_IFR_BIT(Data) + + +class EFI_IFR_GUID_VAREQNAME(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("ExtendOpCode", c_uint8), + ("QuestionId", c_uint16), + ("NameId", c_uint16), + ] + + +class EFI_HII_PACKAGE_HEADER(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Length", c_uint32, 24), + ("Type", c_uint32, 8), + ] + + +class EFI_HII_STRING_PACKAGE_HDR(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_PACKAGE_HEADER), + ("HdrSize", c_uint32), + ("StringInfoOffset", c_uint32), + ("LanguageWindow", c_ushort * 16), + ("LanguageName", c_uint16), + ("Language", c_char * 2), + ] + + +class EFI_IFR_VARSTORE_NAME_VALUE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("VarStoreId", c_uint16), + ("Guid", EFI_GUID), + ] + + +class EFI_IFR_FORM(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("FormId", c_uint16), + ("FormTitle", c_uint16), + ] + + +class EFI_IFR_GUID_BANNER(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("ExtendOpCode", c_ubyte), + ("Title", c_uint16), + ("LineNumber", c_uint16), + ("Alignment", c_ubyte), + ] + + +class EFI_IFR_GUID_TIMEOUT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("ExtendOpCode", c_ubyte), + ("TimeOut", c_uint16), + ] + + +class EFI_IFR_GUID_LABEL(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("ExtendOpCode", c_ubyte), + ("Number", c_uint16), + ] + + +class EFI_IFR_RULE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("RuleId", c_ubyte), + ] + + +class EFI_IFR_STATEMENT_HEADER(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Prompt", c_uint16), + ("Help", c_uint16), + ] + + +class EFI_IFR_SUBTITLE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Statement", EFI_IFR_STATEMENT_HEADER), + ("Flags", c_ubyte), + ] + + +class EFI_IFR_TEXT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Statement", EFI_IFR_STATEMENT_HEADER), + ("TextTwo", c_uint16), + ] + + +class EFI_IFR_IMAGE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Id", c_uint16), + ] + + +class VarStoreInfoNode(Union): + _pack_ =3D 1 + _fields_ =3D [ + ("VarName", c_uint16), + ("VarOffset", c_uint16), + ] + + +class EFI_IFR_QUESTION_HEADER(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_STATEMENT_HEADER), + ("QuestionId", c_uint16), + ("VarStoreId", c_uint16), + ("VarStoreInfo", VarStoreInfoNode), + ("Flags", c_ubyte), + ] + + +class u8Node(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("MinValue", c_ubyte), + ("MaxValue", c_ubyte), + ("Step", c_ubyte), + ] + + +class u16Node(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("MinValue", c_uint16), + ("MaxValue", c_uint16), + ("Step", c_uint16), + ] + + +class u32Node(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("MinValue", c_uint32), + ("MaxValue", c_uint32), + ("Step", c_uint32), + ] + + +class u64Node(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("MinValue", c_uint64), + ("MaxValue", c_uint64), + ("Step", c_uint64), + ] + + +class MINMAXSTEP_DATA(Union): + _pack_ =3D 1 + _fields_ =3D [ + ("u8", u8Node), + ("u16", u16Node), + ("u32", u32Node), + ("u64", u64Node), + ] + + +EFI_IFR_NUMERIC_SIZE =3D 0x03 +EFI_IFR_NUMERIC_SIZE_1 =3D 0x00 +EFI_IFR_NUMERIC_SIZE_2 =3D 0x01 +EFI_IFR_NUMERIC_SIZE_4 =3D 0x02 +EFI_IFR_NUMERIC_SIZE_8 =3D 0x03 +EFI_IFR_DISPLAY =3D 0x30 +EFI_IFR_DISPLAY_INT_DEC =3D 0x00 +EFI_IFR_DISPLAY_UINT_DEC =3D 0x10 +EFI_IFR_DISPLAY_UINT_HEX =3D 0x20 + + +class EFI_IFR_ONE_OF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("Flags", c_ubyte), + ("Data", MINMAXSTEP_DATA), + ] + + +def Refine_EFI_IFR_ONE_OF(Type): + if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: + DataType =3D u8Node + elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: + DataType =3D u16Node + elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: + DataType =3D u32Node + elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: + DataType =3D u64Node + else: + DataType =3D u32Node + + class EFI_IFR_ONE_OF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("Flags", c_ubyte), + ("Data", DataType), + ] + + return EFI_IFR_ONE_OF() + + +EFI_IFR_CHECKBOX_DEFAULT =3D 0x01 +EFI_IFR_CHECKBOX_DEFAULT_MFG =3D 0x02 + + +class EFI_IFR_CHECKBOX(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("Flags", c_ubyte), + ] + + +class EFI_IFR_NUMERIC(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("Flags", c_ubyte), + ("Data", MINMAXSTEP_DATA), + ] + + +def Refine_EFI_IFR_NUMERIC(Type): + if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: + DataType =3D u8Node + elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: + DataType =3D u16Node + elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: + DataType =3D u32Node + elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: + DataType =3D u64Node + else: + DataType =3D u32Node + + class EFI_IFR_NUMERIC(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("Flags", c_ubyte), + ("Data", DataType), + ] + + return EFI_IFR_NUMERIC() + + +class EFI_IFR_PASSWORD(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("MinSize", c_uint16), + ("MaxSize", c_uint16), + ] + + +class EFI_HII_TIME(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Hour", c_ubyte), + ("Minute", c_ubyte), + ("Second", c_ubyte), + ] + + +class EFI_HII_DATE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Year", c_uint16), + ("Month", c_ubyte), + ("Day", c_ubyte), + ] + + +class EFI_HII_REF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("QuestionId", c_uint16), + ("FormId", c_uint16), + ("FormSetGuid", EFI_GUID), + ("DevicePath", c_uint16), + ] + + +class EFI_IFR_TYPE_VALUE(Union): + _pack_ =3D 1 + _fields_ =3D [ + ("u8", c_ubyte), + ("u16", c_uint16), + ("u32", c_uint32), + ("u64", c_uint64), + ("b", c_ubyte), # + ("time", EFI_HII_TIME), + ("date", EFI_HII_DATE), + ("string", c_uint16), + ("ref", EFI_HII_REF), + ] + + +class EFI_IFR_ONE_OF_OPTION(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Option", c_uint16), + ("Flags", c_ubyte), + ("Type", c_ubyte), + ("Value", EFI_IFR_TYPE_VALUE), + ] + + +TypeDict =3D { + EFI_IFR_TYPE_NUM_SIZE_8: c_ubyte, + EFI_IFR_TYPE_NUM_SIZE_16: c_ushort, + EFI_IFR_TYPE_NUM_SIZE_32: c_ulong, + EFI_IFR_TYPE_NUM_SIZE_64: c_ulonglong, + EFI_IFR_TYPE_BOOLEAN: c_ubyte, + EFI_IFR_TYPE_TIME: EFI_HII_TIME, + EFI_IFR_TYPE_DATE: EFI_HII_DATE, + EFI_IFR_TYPE_STRING: c_uint16, + EFI_IFR_TYPE_REF: EFI_HII_REF, +} + +TypeSizeDict =3D { + EFI_IFR_TYPE_NUM_SIZE_8: 1, + EFI_IFR_TYPE_NUM_SIZE_16: 2, + EFI_IFR_TYPE_NUM_SIZE_32: 4, + EFI_IFR_TYPE_NUM_SIZE_64: 8, + EFI_IFR_TYPE_BOOLEAN: 1, + EFI_IFR_TYPE_STRING: 2, +} + +SizeTypeDict =3D { + 1: c_uint8, + 2: c_uint16, + 4: c_uint32, + 8: c_uint64, +} + + +def Refine_EFI_IFR_ONE_OF_OPTION(Type, Nums): + ValueType =3D TypeDict[Type] + + class EFI_IFR_ONE_OF_OPTION(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Option", c_uint16), + ("Flags", c_ubyte), + ("Type", c_ubyte), + ("Value", ValueType * Nums), + ] + + def __init__(self) -> None: + self.Header =3D EFI_IFR_OP_HEADER() + + return EFI_IFR_ONE_OF_OPTION() + + +EFI_IFR_OPTION_DEFAULT =3D 0x10 +EFI_IFR_OPTION_DEFAULT_MFG =3D 0x20 + + +class EFI_IFR_SUPPRESS_IF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_LOCKED(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_ACTION(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("QuestionConfig", c_uint16), + ] + + +class EFI_IFR_REF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("FormId", c_uint16), + ] + + +class EFI_IFR_REF2(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("FormId", c_uint16), + ("QuestionId", c_uint16), + ] + + +class EFI_IFR_REF3(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("FormId", c_uint16), + ("QuestionId", c_uint16), + ("FormSetId", EFI_GUID), + ] + + +class EFI_IFR_REF4(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("FormId", c_uint16), + ("QuestionId", c_uint16), + ("FormSetId", EFI_GUID), + ("DevicePath", c_uint16), + ] + + +class EFI_IFR_REF5(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ] + + +class EFI_IFR_RESET_BUTTON(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Statement", EFI_IFR_STATEMENT_HEADER), + ("DefaultId", c_uint16), + ] + + +class EFI_IFR_NO_SUBMIT_IF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Error", c_uint16), + ] + + +class EFI_IFR_INCONSISTENT_IF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Error", c_uint16), + ] + + +class EFI_IFR_EQ_ID_VAL(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("QuestionId", c_uint16), + ("Value", c_uint16), + ] + + +class EFI_IFR_EQ_ID_ID(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("QuestionId1", c_uint16), + ("QuestionId2", c_uint16), + ] + + +class EFI_IFR_EQ_ID_VAL_LIST(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("QuestionId", c_uint16), + ("ListLength", c_uint16), + ("ValueList", c_uint16), # + ] + + +def Refine_EFI_IFR_EQ_ID_VAL_LIST(Nums): + class EFI_IFR_EQ_ID_VAL_LIST(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("QuestionId", c_uint16), + ("ListLength", c_uint16), + ("ValueList", c_uint16 * Nums), + ] + + def __init__(self): + self.Header =3D EFI_IFR_OP_HEADER() + + return EFI_IFR_EQ_ID_VAL_LIST() + + +class EFI_IFR_AND(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_OR(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_NOT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_GRAY_OUT_IF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_DATE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("Flags", c_ubyte), + ] + + +EFI_QF_DATE_YEAR_SUPPRESS =3D 0x01 +EFI_QF_DATE_MONTH_SUPPRESS =3D 0x02 +EFI_QF_DATE_DAY_SUPPRESS =3D 0x04 + +EFI_QF_DATE_STORAGE =3D 0x30 +QF_DATE_STORAGE_NORMAL =3D 0x00 +QF_DATE_STORAGE_TIME =3D 0x10 +QF_DATE_STORAGE_WAKEUP =3D 0x20 + + +class EFI_IFR_TIME(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("Flags", c_ubyte), + ] + + +QF_TIME_HOUR_SUPPRESS =3D 0x01 +QF_TIME_MINUTE_SUPPRESS =3D 0x02 +QF_TIME_SECOND_SUPPRESS =3D 0x04 +QF_TIME_STORAGE =3D 0x30 +QF_TIME_STORAGE_NORMAL =3D 0x00 +QF_TIME_STORAGE_TIME =3D 0x10 +QF_TIME_STORAGE_WAKEUP =3D 0x20 + + +class EFI_IFR_STRING(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("MinSize", c_ubyte), + ("MaxSize", c_ubyte), + ("Flags", c_ubyte), + ] + + +class EFI_IFR_REFRESH(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("RefreshInterval", c_ubyte), + ] + + +class EFI_IFR_DISABLE_IF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_TO_LOWER(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_TO_UPPER(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_MAP(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_ORDERED_LIST(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Question", EFI_IFR_QUESTION_HEADER), + ("MaxContainers", c_ubyte), + ("Flags", c_ubyte), + ] + + +EFI_IFR_UNIQUE_SET =3D 0x01 +EFI_IFR_NO_EMPTY_SET =3D 0x02 + + +class EFI_IFR_VARSTORE_DEVICE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("DevicePath", c_uint16), + ] + + +class EFI_IFR_VERSION(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_END(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_MATCH(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_GET(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("VarStoreId", c_uint16), + ("VarStoreInfo", VarStoreInfoNode), + ("VarStoreType", c_ubyte), + ] + + +class EFI_IFR_SET(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("VarStoreId", c_uint16), + ("VarStoreInfo", VarStoreInfoNode), + ("VarStoreType", c_ubyte), + ] + + +class EFI_IFR_READ(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_WRITE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_EQUAL(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_NOT_EQUAL(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_GREATER_THAN(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_GREATER_EQUAL(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_LESS_EQUAL(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_LESS_THAN(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_BITWISE_AND(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_BITWISE_OR(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_BITWISE_NOT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_SHIFT_LEFT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_SHIFT_RIGHT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_ADD(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_SUBTRACT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_MULTIPLY(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_DIVIDE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_MODULO(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_RULE_REF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("RuleId", c_ubyte), + ] + + +class EFI_IFR_QUESTION_REF1(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("QuestionId", c_uint16), + ] + + +class EFI_IFR_QUESTION_REF2(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_QUESTION_REF3(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_QUESTION_REF3_2(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("DevicePath", c_uint16), + ] + + +class EFI_IFR_QUESTION_REF3_3(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("DevicePath", c_uint16), + ("Guid", EFI_GUID), + ] + + +class EFI_IFR_UINT8(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Value", c_ubyte), + ] + + +class EFI_IFR_UINT16(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Value", c_uint16), + ] + + +class EFI_IFR_UINT32(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Value", c_uint32), + ] + + +class EFI_IFR_UINT64(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Value", c_uint64), + ] + + +class EFI_IFR_TRUE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_FALSE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_TO_UINT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_TO_STRING(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Format", c_ubyte), + ] + + +class EFI_IFR_TO_BOOLEAN(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_MID(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_FIND(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Format", c_ubyte), + ] + + +class EFI_IFR_TOKEN(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_STRING_REF1(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("StringId", c_uint16), + ] + + +class EFI_IFR_STRING_REF2(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_CONDITIONAL(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_ZERO(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_ONE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_ONES(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_UNDEFINED(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_LENGTH(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_DUP(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_THIS(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +EFI_IFR_FLAGS_FIRST_MATCHING =3D 0x00 +EFI_IFR_FLAGS_FIRST_NON_MATCHING =3D 0x01 + + +class EFI_IFR_SPAN(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Flags", c_ubyte), + ] + + +class EFI_IFR_VALUE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_DEFAULT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("DefaultId", c_uint16), + ("Type", c_ubyte), + ("Value", EFI_IFR_TYPE_VALUE), + ] + + +def Refine_EFI_IFR_DEFAULT(Type, Nums): + ValueType =3D TypeDict[Type] + + class EFI_IFR_DEFAULT(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("DefaultId", c_uint16), + ("Type", c_ubyte), + ("Value", ARRAY(ValueType, Nums)), + ] + + def __init__(self): + self.Header =3D EFI_IFR_OP_HEADER() + + return EFI_IFR_DEFAULT() + + +class EFI_IFR_DEFAULT_2(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("DefaultId", c_uint16), + ("Type", c_ubyte), + ] + + +class EFI_IFR_FORM_MAP(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("FormId", c_uint16), + ] + + +class EFI_IFR_FORM_MAP_METHOD(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("MethodTitle", c_uint16), + ("MethodIdentifier", EFI_GUID), + ] + + +def Refine_EFI_IFR_FORM_MAP(Nums): + class EFI_IFR_FORM_MAP(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("FormId", c_uint16), + ("FormMapMethod", ARRAY(EFI_IFR_FORM_MAP_METHOD, Nums)), + ] + + return EFI_IFR_FORM_MAP() + + +class EFI_IFR_CATENATE(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_SECURITY(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Permissions", EFI_GUID), + ] + + +class EFI_IFR_MODAL_TAG(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ] + + +class EFI_IFR_REFRESH_ID(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("RefreshEventGroupId", EFI_GUID), + ] + + +class EFI_IFR_WARNING_IF(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Warning", c_uint16), + ("TimeOut", c_ubyte), + ] + + +class EFI_IFR_MATCH2(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("SyntaxType", EFI_GUID), + ] + + +class EFI_HII_STRING_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("BlockType", c_uint8), + ] + + +class EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("FontIdentifier", c_uint8), + ("StringText", ARRAY(c_uint8, 2)), + ] + + +class EFI_HII_SIBT_STRINGS_SCSU_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("StringCount", c_uint16), + ("StringText", ARRAY(c_uint8, 2)), + ] + + +class EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("FontIdentifier", c_uint8), + ("StringCount", c_uint16), + ("StringText", ARRAY(c_uint8, 2)), + ] + + +class EFI_HII_SIBT_STRING_UCS2_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("StringText", ARRAY(c_ushort, 2)), + ] + + +class EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("FontIdentifier", c_uint8), + ("StringText", ARRAY(c_ushort, 2)), + ] + + +class EFI_HII_SIBT_STRINGS_UCS2_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("StringCount", c_uint16), + ("StringText", ARRAY(c_ushort, 2)), + ] + + +class EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("FontIdentifier", c_uint8), + ("StringCount", c_uint16), + ("StringText", ARRAY(c_ushort, 2)), + ] + + +class EFI_HII_SIBT_DUPLICATE_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("StringId", c_uint16), + ] + + +class EFI_HII_SIBT_EXT1_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("BlockType2", c_uint8), + ("Length", c_uint8), + ] + + +class EFI_HII_SIBT_EXT2_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("BlockType2", c_uint8), + ("Length", c_uint16), + ] + + +class EFI_HII_SIBT_EXT4_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("BlockType2", c_uint8), + ("Length", c_uint32), + ] + + +class EFI_HII_SIBT_SKIP1_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("SkipCount", c_uint8), + ] + + +class EFI_HII_SIBT_SKIP2_BLOCK(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_HII_STRING_BLOCK), + ("SkipCount", c_uint16), + ] + + +EFI_IFR_FORM_OP =3D 0x01 +EFI_IFR_SUBTITLE_OP =3D 0x02 +EFI_IFR_TEXT_OP =3D 0x03 +EFI_IFR_IMAGE_OP =3D 0x04 +EFI_IFR_ONE_OF_OP =3D 0x05 +EFI_IFR_CHECKBOX_OP =3D 0x06 +EFI_IFR_NUMERIC_OP =3D 0x07 +EFI_IFR_PASSWORD_OP =3D 0x08 +EFI_IFR_ONE_OF_OPTION_OP =3D 0x09 +EFI_IFR_SUPPRESS_IF_OP =3D 0x0A +EFI_IFR_LOCKED_OP =3D 0x0B +EFI_IFR_ACTION_OP =3D 0x0C +EFI_IFR_RESET_BUTTON_OP =3D 0x0D +EFI_IFR_FORM_SET_OP =3D 0x0E +EFI_IFR_REF_OP =3D 0x0F +EFI_IFR_NO_SUBMIT_IF_OP =3D 0x10 +EFI_IFR_INCONSISTENT_IF_OP =3D 0x11 +EFI_IFR_EQ_ID_VAL_OP =3D 0x12 +EFI_IFR_EQ_ID_ID_OP =3D 0x13 +EFI_IFR_EQ_ID_VAL_LIST_OP =3D 0x14 +EFI_IFR_AND_OP =3D 0x15 +EFI_IFR_OR_OP =3D 0x16 +EFI_IFR_NOT_OP =3D 0x17 +EFI_IFR_RULE_OP =3D 0x18 +EFI_IFR_GRAY_OUT_IF_OP =3D 0x19 +EFI_IFR_DATE_OP =3D 0x1A +EFI_IFR_TIME_OP =3D 0x1B +EFI_IFR_STRING_OP =3D 0x1C +EFI_IFR_REFRESH_OP =3D 0x1D +EFI_IFR_DISABLE_IF_OP =3D 0x1E +EFI_IFR_TO_LOWER_OP =3D 0x20 +EFI_IFR_TO_UPPER_OP =3D 0x21 +EFI_IFR_MAP_OP =3D 0x22 +EFI_IFR_ORDERED_LIST_OP =3D 0x23 +EFI_IFR_VARSTORE_OP =3D 0x24 +EFI_IFR_VARSTORE_NAME_VALUE_OP =3D 0x25 +EFI_IFR_VARSTORE_EFI_OP =3D 0x26 +EFI_IFR_VARSTORE_DEVICE_OP =3D 0x27 +EFI_IFR_VERSION_OP =3D 0x28 +EFI_IFR_END_OP =3D 0x29 +EFI_IFR_MATCH_OP =3D 0x2A +EFI_IFR_GET_OP =3D 0x2B +EFI_IFR_SET_OP =3D 0x2C +EFI_IFR_READ_OP =3D 0x2D +EFI_IFR_WRITE_OP =3D 0x2E +EFI_IFR_EQUAL_OP =3D 0x2F +EFI_IFR_NOT_EQUAL_OP =3D 0x30 +EFI_IFR_GREATER_THAN_OP =3D 0x31 +EFI_IFR_GREATER_EQUAL_OP =3D 0x32 +EFI_IFR_LESS_THAN_OP =3D 0x33 +EFI_IFR_LESS_EQUAL_OP =3D 0x34 +EFI_IFR_BITWISE_AND_OP =3D 0x35 +EFI_IFR_BITWISE_OR_OP =3D 0x36 +EFI_IFR_BITWISE_NOT_OP =3D 0x37 +EFI_IFR_SHIFT_LEFT_OP =3D 0x38 +EFI_IFR_SHIFT_RIGHT_OP =3D 0x39 +EFI_IFR_ADD_OP =3D 0x3A +EFI_IFR_SUBTRACT_OP =3D 0x3B +EFI_IFR_MULTIPLY_OP =3D 0x3C +EFI_IFR_DIVIDE_OP =3D 0x3D +EFI_IFR_MODULO_OP =3D 0x3E +EFI_IFR_RULE_REF_OP =3D 0x3F +EFI_IFR_QUESTION_REF1_OP =3D 0x40 +EFI_IFR_QUESTION_REF2_OP =3D 0x41 +EFI_IFR_UINT8_OP =3D 0x42 +EFI_IFR_UINT16_OP =3D 0x43 +EFI_IFR_UINT32_OP =3D 0x44 +EFI_IFR_UINT64_OP =3D 0x45 +EFI_IFR_TRUE_OP =3D 0x46 +EFI_IFR_FALSE_OP =3D 0x47 +EFI_IFR_TO_UINT_OP =3D 0x48 +EFI_IFR_TO_STRING_OP =3D 0x49 +EFI_IFR_TO_BOOLEAN_OP =3D 0x4A +EFI_IFR_MID_OP =3D 0x4B +EFI_IFR_FIND_OP =3D 0x4C +EFI_IFR_TOKEN_OP =3D 0x4D +EFI_IFR_STRING_REF1_OP =3D 0x4E +EFI_IFR_STRING_REF2_OP =3D 0x4F +EFI_IFR_CONDITIONAL_OP =3D 0x50 +EFI_IFR_QUESTION_REF3_OP =3D 0x51 +EFI_IFR_ZERO_OP =3D 0x52 +EFI_IFR_ONE_OP =3D 0x53 +EFI_IFR_ONES_OP =3D 0x54 +EFI_IFR_UNDEFINED_OP =3D 0x55 +EFI_IFR_LENGTH_OP =3D 0x56 +EFI_IFR_DUP_OP =3D 0x57 +EFI_IFR_THIS_OP =3D 0x58 +EFI_IFR_SPAN_OP =3D 0x59 +EFI_IFR_VALUE_OP =3D 0x5A +EFI_IFR_DEFAULT_OP =3D 0x5B +EFI_IFR_DEFAULTSTORE_OP =3D 0x5C +EFI_IFR_FORM_MAP_OP =3D 0x5D +EFI_IFR_CATENATE_OP =3D 0x5E +EFI_IFR_GUID_OP =3D 0x5F +EFI_IFR_SECURITY_OP =3D 0x60 +EFI_IFR_MODAL_TAG_OP =3D 0x61 +EFI_IFR_REFRESH_ID_OP =3D 0x62 +EFI_IFR_WARNING_IF_OP =3D 0x63 +EFI_IFR_MATCH2_OP =3D 0x64 +EFI_IFR_SHOWN_DEFAULTSTORE_OP =3D 0x65 + +ConditionOps =3D [ + EFI_IFR_DISABLE_IF_OP, + EFI_IFR_SUPPRESS_IF_OP, + EFI_IFR_GRAY_OUT_IF_OP, + EFI_IFR_INCONSISTENT_IF_OP, +] +BasicDataTypes =3D [ + "UINT8", + "UINT16", + "UINT32", + "UINT64", + "EFI_HII_DATE", + "EFI_HII_TIME", + "EFI_HII_REF", +] + + +def Refine_EFI_IFR_GUID_OPTIONKEY(Type): + ValueType =3D TypeDict[Type] + + class EFI_IFR_GUID_OPTIONKEY(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("Header", EFI_IFR_OP_HEADER), + ("Guid", EFI_GUID), + ("ExtendOpCode", c_uint8), + ("QuestionId", c_uint16), + ("OptionValue", ValueType), + ("KeyValue", c_uint16), + ] + + return EFI_IFR_GUID_OPTIONKEY() + + +EFI_IFR_EXTEND_OP_OPTIONKEY =3D 0x0 +EFI_IFR_EXTEND_OP_VAREQNAME =3D 0x1 + + +class EFI_COMPARE_TYPE(Enum): + EQUAL =3D 0 + LESS_EQUAL =3D 1 + LESS_THAN =3D 2 + GREATER_THAN =3D 3 + GREATER_EQUAL =3D 4 diff --git a/BaseTools/Source/Python/VfrCompiler/IfrError.py b/BaseTools/So= urce/Python/VfrCompiler/IfrError.py new file mode 100644 index 0000000000..c50288e9e5 --- /dev/null +++ b/BaseTools/Source/Python/VfrCompiler/IfrError.py @@ -0,0 +1,153 @@ +## @file +# VfrCompiler error handler. +# +# Copyright (c) 2022-, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +from enum import Enum +from Common import EdkLogger +from Common.BuildToolError import * + + +class VfrReturnCode(Enum): + VFR_RETURN_SUCCESS =3D 0 + VFR_RETURN_ERROR_SKIPED =3D 1 + VFR_RETURN_FATAL_ERROR =3D 2 + VFR_RETURN_MISMATCHED =3D 3 + VFR_RETURN_INVALID_PARAMETER =3D 4 + VFR_RETURN_OUT_FOR_RESOURCES =3D 5 + VFR_RETURN_UNSUPPORTED =3D 6 + VFR_RETURN_REDEFINED =3D 7 + VFR_RETURN_FORMID_REDEFINED =3D 8 + VFR_RETURN_QUESTIONID_REDEFINED =3D 9 + VFR_RETURN_VARSTOREID_REDEFINED =3D 10 + VFR_RETURN_UNDEFINED =3D 11 + VFR_RETURN_VAR_NOTDEFINED_BY_QUESTION =3D 12 + VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR =3D 13 + VFR_RETURN_GET_EFIVARSTORE_ERROR =3D 14 + VFR_RETURN_EFIVARSTORE_USE_ERROR =3D 15 + VFR_RETURN_EFIVARSTORE_SIZE_ERROR =3D 16 + VFR_RETURN_GET_NVVARSTORE_ERROR =3D 17 + VFR_RETURN_QVAR_REUSE =3D 18 + VFR_RETURN_FLAGS_UNSUPPORTED =3D 19 + VFR_RETURN_ERROR_ARRARY_NUM =3D 20 + VFR_RETURN_DATA_STRING_ERROR =3D 21 + VFR_RETURN_DEFAULT_VALUE_REDEFINED =3D 22 + VFR_RETURN_CONSTANT_ONLY =3D 23 + VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR =3D 24 + VFR_RETURN_BIT_WIDTH_ERROR =3D 25 + VFR_RETURN_STRING_TO_UINT_OVERFLOW =3D 26 + VFR_RETURN_CODEUNDEFINED =3D 27 + + +vfrErrorMessage =3D { + VfrReturnCode.VFR_RETURN_SUCCESS: "", + VfrReturnCode.VFR_RETURN_ERROR_SKIPED: "", + VfrReturnCode.VFR_RETURN_FATAL_ERROR: "fatal error!!", + VfrReturnCode.VFR_RETURN_MISMATCHED: "unexpected token", + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER: "invalid parameter", + VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES: "system out of memory", + VfrReturnCode.VFR_RETURN_UNSUPPORTED: "unsupported", + VfrReturnCode.VFR_RETURN_REDEFINED: "already defined", + VfrReturnCode.VFR_RETURN_FORMID_REDEFINED: "form id already defined", + VfrReturnCode.VFR_RETURN_QUESTIONID_REDEFINED: "question id already de= fined", + VfrReturnCode.VFR_RETURN_VARSTOREID_REDEFINED: "varstore id already de= fined", + VfrReturnCode.VFR_RETURN_UNDEFINED: "undefined", + VfrReturnCode.VFR_RETURN_VAR_NOTDEFINED_BY_QUESTION: "some variable ha= s not defined by a question", + VfrReturnCode.VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR: "Data Stru= cture is defined by more than one varstores: \ + it can't be referred as varstore: only varstore name could be = used.", + VfrReturnCode.VFR_RETURN_GET_EFIVARSTORE_ERROR: "get efi varstore erro= r", + VfrReturnCode.VFR_RETURN_EFIVARSTORE_USE_ERROR: "can not use the efi v= arstore like this", + VfrReturnCode.VFR_RETURN_EFIVARSTORE_SIZE_ERROR: "unsupport efi varsto= re size should be <=3D 8 bytes", + VfrReturnCode.VFR_RETURN_GET_NVVARSTORE_ERROR: "get name value varstor= e error", + VfrReturnCode.VFR_RETURN_QVAR_REUSE: "variable reused by more than one= question", + VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED: "flags unsupported", + VfrReturnCode.VFR_RETURN_ERROR_ARRARY_NUM: "array number error: the va= lid value is in \ + (0 ~ MAX_INDEX-1 for UEFI vfr and in (1 ~ MAX_INDEX for Framework = Vfr", + VfrReturnCode.VFR_RETURN_DATA_STRING_ERROR: "data field string error o= r not support", + VfrReturnCode.VFR_RETURN_DEFAULT_VALUE_REDEFINED: "default value re-de= fined with different value", + VfrReturnCode.VFR_RETURN_CONSTANT_ONLY: "only constant is allowed in t= he expression", + VfrReturnCode.VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR: "Varstore name= is defined by more than one varstores: it can't be referred as varstore:\ + only varstore structure name could be used.", + VfrReturnCode.VFR_RETURN_BIT_WIDTH_ERROR: "bit width must be <=3D size= of (type * 8 and the max width can not > 32", + VfrReturnCode.VFR_RETURN_STRING_TO_UINT_OVERFLOW: "String to UINT* Ove= rflow", + VfrReturnCode.VFR_RETURN_CODEUNDEFINED: "undefined Error Code", +} + + +class EFI_VFR_WARNING_CODE(Enum): + VFR_WARNING_DEFAULT_VALUE_REDEFINED =3D 0 + VFR_WARNING_ACTION_WITH_TEXT_TWO =3D 1 + VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE =3D 2 + VFR_WARNING_CODEUNDEFINED =3D 3 + + +vfrWarningMessage =3D { + EFI_VFR_WARNING_CODE.VFR_WARNING_DEFAULT_VALUE_REDEFINED: ": default v= alue re-defined with different value", + EFI_VFR_WARNING_CODE.VFR_WARNING_ACTION_WITH_TEXT_TWO: ": Action opcod= e should not have TextTwo part", + EFI_VFR_WARNING_CODE.VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE: ": Not re= commend to use obsoleted framework opcode", + EFI_VFR_WARNING_CODE.VFR_WARNING_CODEUNDEFINED: ": undefined Warning C= ode", +} + + +class VfrErrorHandle: + def __init__(self): + self.InputFileName =3D None + self.vfrErrorMessage =3D vfrErrorMessage + self.vfrWarningMessage =3D vfrWarningMessage + self.WarningAsError =3D False + + def SetWarningAsError(self, WarningAsError): + self.WarningAsError =3D WarningAsError + + def SetInputFile(self, InputFile): + self.InputFileName =3D InputFile + + def HandleWarning(self, WarningCode, LineNum=3DNone, TokenValue=3DNone= ): + if self.vfrWarningMessage is None: + return 1 + WarningMsg =3D "" + for key in self.vfrWarningMessage.keys(): + if WarningCode =3D=3D self.vfrWarningMessage[key]: + WarningMsg =3D self.vfrWarningMessage[key] + break + if WarningMsg !=3D "": + if self.WarningAsError: + EdkLogger.error( + "VfrCompiler", + WarningCode.value, + WarningMsg, + self.InputFileName, + LineNum, + "warning treated as error", + ) + EdkLogger.warn( + "VfrCompiler", WarningCode.value, self.InputFileName, Line= Num, TokenValue + ) + + def PrintMsg(self, LineNum, MsgType=3D"Error", ErrorMsg=3DNone, TokenV= alue=3DNone): + if MsgType =3D=3D "Warning": + EdkLogger.verbose(ErrorMsg) + else: + EdkLogger.error( + "VfrCompiler", FORMAT_INVALID, ErrorMsg, self.InputFileNam= e, LineNum, TokenValue + ) + + def HandleError(self, ErrorCode, LineNum=3DNone, TokenValue=3DNone): + if self.vfrErrorMessage is None: + return 1 + ErrorMsg =3D "" + for Key in self.vfrErrorMessage.keys(): + if ErrorCode =3D=3D Key: + ErrorMsg =3D self.vfrErrorMessage[Key] + break + if ErrorMsg !=3D "": + EdkLogger.error( + "VfrCompiler", ErrorCode.value, ErrorMsg, self.InputFileNa= me, LineNum, TokenValue + ) + return 1 + return 0 + + +gVfrErrorHandle =3D VfrErrorHandle() diff --git a/BaseTools/Source/Python/VfrCompiler/IfrFormPkg.py b/BaseTools/= Source/Python/VfrCompiler/IfrFormPkg.py new file mode 100644 index 0000000000..35f50b0cef --- /dev/null +++ b/BaseTools/Source/Python/VfrCompiler/IfrFormPkg.py @@ -0,0 +1,2937 @@ +## @file +# The definition of FormPkg's member function +# +# Copyright (c) 2022-, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +from VfrCompiler.IfrCtypes import * +from VfrCompiler.IfrUtility import * +from VfrCompiler.IfrError import VfrReturnCode + +gVfrVarDataTypeDB =3D VfrVarDataTypeDB() +gVfrDefaultStore =3D VfrDefaultStore() +gVfrDataStorage =3D VfrDataStorage() + + +class OpNode: + def __init__(self, Size, Scope): + self.Size =3D Size + self.Scope =3D Scope + + +gOpcodeSizesScopeTable =3D [ + OpNode(0, 0), # EFI_IFR_INVALID - 0x00 + OpNode(sizeof(EFI_IFR_FORM), 1), # EFI_IFR_FORM_OP + OpNode(sizeof(EFI_IFR_SUBTITLE), 1), # EFI_IFR_SUBTITLE_OP + OpNode(sizeof(EFI_IFR_TEXT), 0), # EFI_IFR_TEXT_OP + OpNode(sizeof(EFI_IFR_IMAGE), 0), # EFI_IFR_IMAGE_OP + OpNode(sizeof(EFI_IFR_ONE_OF), 1), # EFI_IFR_ONE_OF_OP - 0x05 + OpNode(sizeof(EFI_IFR_CHECKBOX), 1), # EFI_IFR_CHECKBOX_OP + OpNode(sizeof(EFI_IFR_NUMERIC), 1), # EFI_IFR_NUMERIC_OP + OpNode(sizeof(EFI_IFR_PASSWORD), 1), # EFI_IFR_PASSWORD_OP + OpNode(sizeof(EFI_IFR_ONE_OF_OPTION), 0), # EFI_IFR_ONE_OF_OPTION_OP + OpNode(sizeof(EFI_IFR_SUPPRESS_IF), 1), # EFI_IFR_SUPPRESS_IF - 0x0A + OpNode(sizeof(EFI_IFR_LOCKED), 0), # EFI_IFR_LOCKED_OP + OpNode(sizeof(EFI_IFR_ACTION), 1), # EFI_IFR_ACTION_OP + OpNode(sizeof(EFI_IFR_RESET_BUTTON), 1), # EFI_IFR_RESET_BUTTON_OP + OpNode(sizeof(EFI_IFR_FORM_SET), 1), # EFI_IFR_FORM_SET_OP -0xE + OpNode(sizeof(EFI_IFR_REF), 0), # EFI_IFR_REF_OP + OpNode(sizeof(EFI_IFR_NO_SUBMIT_IF), 1), # EFI_IFR_NO_SUBMIT_IF_OP -0= x10 + OpNode(sizeof(EFI_IFR_INCONSISTENT_IF), 1), # EFI_IFR_INCONSISTENT_IF= _OP + OpNode(sizeof(EFI_IFR_EQ_ID_VAL), 0), # EFI_IFR_EQ_ID_VAL_OP + OpNode(sizeof(EFI_IFR_EQ_ID_ID), 0), # EFI_IFR_EQ_ID_ID_OP + OpNode(sizeof(EFI_IFR_EQ_ID_VAL_LIST), 0), # EFI_IFR_EQ_ID_LIST_OP - = 0x14 + OpNode(sizeof(EFI_IFR_AND), 0), # EFI_IFR_AND_OP + OpNode(sizeof(EFI_IFR_OR), 0), # EFI_IFR_OR_OP + OpNode(sizeof(EFI_IFR_NOT), 0), # EFI_IFR_NOT_OP + OpNode(sizeof(EFI_IFR_RULE), 1), # EFI_IFR_RULE_OP + OpNode(sizeof(EFI_IFR_GRAY_OUT_IF), 1), # EFI_IFR_GRAYOUT_IF_OP - 0x1= 9 + OpNode(sizeof(EFI_IFR_DATE), 1), # EFI_IFR_DATE_OP + OpNode(sizeof(EFI_IFR_TIME), 1), # EFI_IFR_TIME_OP + OpNode(sizeof(EFI_IFR_STRING), 1), # EFI_IFR_STRING_OP + OpNode(sizeof(EFI_IFR_REFRESH), 0), # EFI_IFR_REFRESH_OP + OpNode(sizeof(EFI_IFR_DISABLE_IF), 1), # EFI_IFR_DISABLE_IF_OP - 0x1E + OpNode(0, 0), # 0x1F + OpNode(sizeof(EFI_IFR_TO_LOWER), 0), # EFI_IFR_TO_LOWER_OP - 0x20 + OpNode(sizeof(EFI_IFR_TO_UPPER), 0), # EFI_IFR_TO_UPPER_OP - 0x21 + OpNode(sizeof(EFI_IFR_MAP), 1), # EFI_IFR_MAP - 0x22 + OpNode(sizeof(EFI_IFR_ORDERED_LIST), 1), # EFI_IFR_ORDERED_LIST_OP - = 0x23 + OpNode(sizeof(EFI_IFR_VARSTORE), 0), # EFI_IFR_VARSTORE_OP + OpNode(sizeof(EFI_IFR_VARSTORE_NAME_VALUE), 0), # EFI_IFR_VARSTORE_NA= ME_VALUE_OP + OpNode(sizeof(EFI_IFR_VARSTORE_EFI), 0), # EFI_IFR_VARSTORE_EFI_OP + OpNode(sizeof(EFI_IFR_VARSTORE_DEVICE), 1), # EFI_IFR_VARSTORE_DEVICE= _OP + OpNode(sizeof(EFI_IFR_VERSION), 0), # EFI_IFR_VERSION_OP - 0x28 + OpNode(sizeof(EFI_IFR_END), 0), # EFI_IFR_END_OP + OpNode(sizeof(EFI_IFR_MATCH), 0), # EFI_IFR_MATCH_OP - 0x2A + OpNode(sizeof(EFI_IFR_GET), 0), # EFI_IFR_GET - 0x2B + OpNode(sizeof(EFI_IFR_SET), 0), # EFI_IFR_SET - 0x2C + OpNode(sizeof(EFI_IFR_READ), 0), # EFI_IFR_READ - 0x2D + OpNode(sizeof(EFI_IFR_WRITE), 0), # EFI_IFR_WRITE - 0x2E + OpNode(sizeof(EFI_IFR_EQUAL), 0), # EFI_IFR_EQUAL_OP - 0x2F + OpNode(sizeof(EFI_IFR_NOT_EQUAL), 0), # EFI_IFR_NOT_EQUAL_OP + OpNode(sizeof(EFI_IFR_GREATER_THAN), 0), # EFI_IFR_GREATER_THAN_OP + OpNode(sizeof(EFI_IFR_GREATER_EQUAL), 0), # EFI_IFR_GREATER_EQUAL_OP + OpNode(sizeof(EFI_IFR_LESS_THAN), 0), # EFI_IFR_LESS_THAN_OP + OpNode(sizeof(EFI_IFR_LESS_EQUAL), 0), # EFI_IFR_LESS_EQUAL_OP - 0x34 + OpNode(sizeof(EFI_IFR_BITWISE_AND), 0), # EFI_IFR_BITWISE_AND_OP + OpNode(sizeof(EFI_IFR_BITWISE_OR), 0), # EFI_IFR_BITWISE_OR_OP + OpNode(sizeof(EFI_IFR_BITWISE_NOT), 0), # EFI_IFR_BITWISE_NOT_OP + OpNode(sizeof(EFI_IFR_SHIFT_LEFT), 0), # EFI_IFR_SHIFT_LEFT_OP + OpNode(sizeof(EFI_IFR_SHIFT_RIGHT), 0), # EFI_IFR_SHIFT_RIGHT_OP + OpNode(sizeof(EFI_IFR_ADD), 0), # EFI_IFR_ADD_OP - 0x3A + OpNode(sizeof(EFI_IFR_SUBTRACT), 0), # EFI_IFR_SUBTRACT_OP + OpNode(sizeof(EFI_IFR_MULTIPLY), 0), # EFI_IFR_MULTIPLY_OP + OpNode(sizeof(EFI_IFR_DIVIDE), 0), # EFI_IFR_DIVIDE_OP + OpNode(sizeof(EFI_IFR_MODULO), 0), # EFI_IFR_MODULO_OP - 0x3E + OpNode(sizeof(EFI_IFR_RULE_REF), 0), # EFI_IFR_RULE_REF_OP + OpNode(sizeof(EFI_IFR_QUESTION_REF1), 0), # EFI_IFR_QUESTION_REF1_OP + OpNode(sizeof(EFI_IFR_QUESTION_REF2), 0), # EFI_IFR_QUESTION_REF2_OP = - 0x41 + OpNode(sizeof(EFI_IFR_UINT8), 0), # EFI_IFR_UINT8 + OpNode(sizeof(EFI_IFR_UINT16), 0), # EFI_IFR_UINT16 + OpNode(sizeof(EFI_IFR_UINT32), 0), # EFI_IFR_UINT32 + OpNode(sizeof(EFI_IFR_UINT64), 0), # EFI_IFR_UTNT64 + OpNode(sizeof(EFI_IFR_TRUE), 0), # EFI_IFR_TRUE_OP - 0x46 + OpNode(sizeof(EFI_IFR_FALSE), 0), # EFI_IFR_FALSE_OP + OpNode(sizeof(EFI_IFR_TO_UINT), 0), # EFI_IFR_TO_UINT_OP + OpNode(sizeof(EFI_IFR_TO_STRING), 0), # EFI_IFR_TO_STRING_OP + OpNode(sizeof(EFI_IFR_TO_BOOLEAN), 0), # EFI_IFR_TO_BOOLEAN_OP + OpNode(sizeof(EFI_IFR_MID), 0), # EFI_IFR_MID_OP + OpNode(sizeof(EFI_IFR_FIND), 0), # EFI_IFR_FIND_OP + OpNode(sizeof(EFI_IFR_TOKEN), 0), # EFI_IFR_TOKEN_OP + OpNode(sizeof(EFI_IFR_STRING_REF1), 0), # EFI_IFR_STRING_REF1_OP - 0x= 4E + OpNode(sizeof(EFI_IFR_STRING_REF2), 0), # EFI_IFR_STRING_REF2_OP + OpNode(sizeof(EFI_IFR_CONDITIONAL), 0), # EFI_IFR_CONDITIONAL_OP + OpNode(sizeof(EFI_IFR_QUESTION_REF3), 0), # EFI_IFR_QUESTION_REF3_OP + OpNode(sizeof(EFI_IFR_ZERO), 0), # EFI_IFR_ZERO_OP + OpNode(sizeof(EFI_IFR_ONE), 0), # EFI_IFR_ONE_OP + OpNode(sizeof(EFI_IFR_ONES), 0), # EFI_IFR_ONES_OP + OpNode(sizeof(EFI_IFR_UNDEFINED), 0), # EFI_IFR_UNDEFINED_OP + OpNode(sizeof(EFI_IFR_LENGTH), 0), # EFI_IFR_LENGTH_OP + OpNode(sizeof(EFI_IFR_DUP), 0), # EFI_IFR_DUP_OP - 0x57 + OpNode(sizeof(EFI_IFR_THIS), 0), # EFI_IFR_THIS_OP + OpNode(sizeof(EFI_IFR_SPAN), 0), # EFI_IFR_SPAN_OP + OpNode(sizeof(EFI_IFR_VALUE), 1), # EFI_IFR_VALUE_OP + OpNode(sizeof(EFI_IFR_DEFAULT), 0), # EFI_IFR_DEFAULT_OP + OpNode(sizeof(EFI_IFR_DEFAULTSTORE), 0), # EFI_IFR_DEFAULTSTORE_OP - = 0x5C + OpNode(sizeof(EFI_IFR_FORM_MAP), 1), # EFI_IFR_FORM_MAP_OP - 0x5D + OpNode(sizeof(EFI_IFR_CATENATE), 0), # EFI_IFR_CATENATE_OP + OpNode(sizeof(EFI_IFR_GUID), 0), # EFI_IFR_GUID_OP + OpNode(sizeof(EFI_IFR_SECURITY), 0), # EFI_IFR_SECURITY_OP - 0x60 + OpNode(sizeof(EFI_IFR_MODAL_TAG), 0), # EFI_IFR_MODAL_TAG_OP - 0x61 + OpNode(sizeof(EFI_IFR_REFRESH_ID), 0), # EFI_IFR_REFRESH_ID_OP - 0x62 + OpNode(sizeof(EFI_IFR_WARNING_IF), 1), # EFI_IFR_WARNING_IF_OP - 0x63 + OpNode(sizeof(EFI_IFR_MATCH2), 0), +] + + +class OpBufferNode: + def __init__(self, Buffer=3DNone, Next=3DNone): + self.Buffer =3D Buffer + self.Next =3D Next + + +class ASSIGN_FLAG(Enum): + PENDING =3D 1 + ASSIGNED =3D 2 + + +VALUE_TYPE_ONE =3D 1 +VALUE_TYPE_TWO =3D 2 + + +class SPendingAssign: + def __init__(self, Key, ValAddr, LineNo, Msg, Type=3D0): + self.Key =3D Key + self.Addr =3D ValAddr + self.Flag =3D ASSIGN_FLAG.PENDING + self.LineNo =3D LineNo + self.Msg =3D Msg + self.Type =3D Type + self.Next =3D None + + def AssignValue(self, Val): + if self.Type =3D=3D VALUE_TYPE_ONE: + self.Addr.QuestionId1 =3D Val + elif self.Type =3D=3D VALUE_TYPE_TWO: + self.Addr.QuestionId2 =3D Val + else: + self.Addr.QuestionId =3D Val + + self.Flag =3D ASSIGN_FLAG.ASSIGNED + + +class InsertOpNode: + def __init__(self, Data, OpCode): + self.Data =3D Data + self.OpCode =3D OpCode + + +class FormPkg: + def __init__(self): + self.PkgLength =3D 0 + self.Offset =3D 0 + self.PendingAssignList =3D None + + def Clear(self): + self.PkgLength =3D 0 + self.Offset =3D 0 + self.PendingAssignList =3D None + + def BuildPkgHdr(self): + PkgHdr =3D EFI_HII_PACKAGE_HEADER() + PkgHdr.Type =3D EFI_HII_PACKAGE_FORM + PkgHdr.Length =3D self.PkgLength + sizeof(EFI_HII_PACKAGE_HEADER) + return PkgHdr + + def BuildPkg(self, Root): + if Root is None: + return + if Root.OpCode is not None and Root.OpCode !=3D EFI_IFR_SHOWN_DEFA= ULTSTORE_OP: + self.PkgLength +=3D Root.Data.GetInfo().Header.Length + Root.Offset =3D gFormPkg.Offset + self.Offset +=3D Root.Data.GetInfo().Header.Length + if Root.Child !=3D []: + for ChildNode in Root.Child: + self.BuildPkg(ChildNode) + + # Get data from ctypes to bytes. + def StructToStream(self, Struct) -> bytes: + Length =3D sizeof(Struct) + P =3D cast(pointer(Struct), POINTER(c_char * Length)) + return P.contents.raw + + def AssignPending(self, Key, VarAddr, LineNo, Msg, Type=3D0): + pNew =3D SPendingAssign(Key, VarAddr, LineNo, Msg, Type) + if pNew is None: + return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + pNew.Next =3D self.PendingAssignList + self.PendingAssignList =3D pNew + return VfrReturnCode.VFR_RETURN_SUCCESS + + def DoPendingAssign(self, Key, Val): + if Key is None or Val is None: + return + pNode =3D self.PendingAssignList + while pNode is not None: + if pNode.Key =3D=3D Key: + pNode.AssignValue(Val) + pNode =3D pNode.Next + + def HavePendingUnassigned(self): + pNode =3D self.PendingAssignList + while pNode is not None: + if pNode.Flag =3D=3D ASSIGN_FLAG.PENDING: + return True + pNode =3D pNode.Next + + return False + + def PendingAssignPrintAll(self): + pNode =3D self.PendingAssignList + while pNode is not None: + if pNode.Flag =3D=3D ASSIGN_FLAG.PENDING: + gVfrErrorHandle.PrintMsg(pNode.LineNo, "Error", pNode.Msg,= pNode.Key) + pNode =3D pNode.Next + + def DeclarePendingQuestion( + self, + lVfrVarDataTypeDB: VfrVarDataTypeDB, + lVfrDataStorage: VfrDataStorage, + lVfrQuestionDB: VfrQuestionDB, + LineNo=3DNone, + ): + # Declare all questions as Numeric in DisableIf True + ReturnList =3D [] + GuidObj =3D None + DIObj =3D IfrDisableIf() + DIObj.SetLineNo(LineNo) + ReturnList.append(InsertOpNode(DIObj, EFI_IFR_DISABLE_IF_OP)) + # TrueOpcode + TObj =3D IfrTrue(LineNo) + ReturnList.append(InsertOpNode(TObj, EFI_IFR_TRUE_OP)) + pNode =3D self.PendingAssignList + while pNode is not None: + if pNode.Flag =3D=3D ASSIGN_FLAG.PENDING: + Info =3D EFI_VARSTORE_INFO() + VarStr =3D pNode.Key + QId, ReturnCode =3D lVfrQuestionDB.RegisterQuestion( + None, VarStr, EFI_QUESTION_ID_INVALID, gFormPkg + ) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + gVfrErrorHandle.HandleError(ReturnCode, pNode.LineNo, = pNode.Key) + return ReturnList, ReturnCode + # ifdef VFREXP_DEBUG + # printf("Undefined Question name is %s and Id is 0x%x\n",= VarStr, QId); + # endif + # Get Question Info, framework vfr VarName =3D=3D StructNa= me + ArrayIdx, s, FName, ReturnCode =3D lVfrVarDataTypeDB.Extra= ctFieldNameAndArrary( + VarStr, 0 + ) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + gVfrErrorHandle.PrintMsg( + pNode.LineNo, "Error", "Var string is not the vali= d C variable", pNode.Key + ) + return ReturnList, ReturnCode + + # Get VarStoreType + Info.VarStoreId, ReturnCode =3D lVfrDataStorage.GetVarStor= eId(FName) + + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + gVfrErrorHandle.PrintMsg( + pNode.LineNo, "Error", "Var Store Type is not defi= ned", FName + ) + return ReturnList, ReturnCode + + VarStoreType =3D lVfrDataStorage.GetVarStoreType(Info.VarS= toreId) + if s =3D=3D len(VarStr) and ArrayIdx !=3D INVALID_ARRAY_IN= DEX: + ReturnCode =3D lVfrDataStorage.GetNameVarStoreInfo(Inf= o, ArrayIdx) + else: + if VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_V= ARSTORE_EFI: + ReturnCode =3D lVfrDataStorage.GetEfiVarStoreInfo(= Info) + elif ( + VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_= VARSTORE_BUFFER + or VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_V= FR_VARSTORE_BUFFER_BITS + ): + VarStr =3D pNode.Key + SName, ReturnCode =3D lVfrDataStorage.GetBufferVar= StoreDataTypeName( + Info.VarStoreId + ) + if ReturnCode =3D=3D VfrReturnCode.VFR_RETURN_SUCC= ESS: + NewStr =3D SName + "." + VarStr[s:] + ( + Info.Info.VarOffset, + Info.VarType, + Info.VarTotalSize, + Info.IsBitVar, + ReturnCode, + ) =3D lVfrVarDataTypeDB.GetDataFieldInfo(NewSt= r) + else: + ReturnCode =3D VfrReturnCode.VFR_RETURN_UNSUPPORTE= D + + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + gVfrErrorHandle.HandleError(ReturnCode, pNode.LineNo, = pNode.Key) + # If the storage is bit fields, create Guid opcode to wrap= the numeric opcode. + if Info.IsBitVar: + GuidObj =3D IfrGuid(0) + GuidObj.SetGuid(EDKII_IFR_BIT_VARSTORE_GUID) + GuidObj.SetLineNo(LineNo) + ReturnList.append(InsertOpNode(GuidObj, EFI_IFR_GUID_O= P)) + + if Info.IsBitVar: + Info.VarType =3D EFI_IFR_TYPE_NUM_SIZE_32 + + # Numeric doesn't support BOOLEAN data type. + # BOOLEAN type has the same data size to UINT8. + elif Info.VarType =3D=3D EFI_IFR_TYPE_BOOLEAN: + Info.VarType =3D EFI_IFR_TYPE_NUM_SIZE_8 + + CNObj =3D IfrNumeric(Info.VarType) + CNObj.SetLineNo(LineNo) + CNObj.SetPrompt(0x0) + CNObj.SetHelp(0x0) + CNObj.SetQuestionId(QId) + CNObj.SetVarStoreInfo(Info) + ReturnList.append(InsertOpNode(CNObj, EFI_IFR_GUID_OP)) + + if Info.IsBitVar: + MaxValue =3D (1 << Info.VarTotalSize) - 1 + CNObj.SetMinMaxStepData(0, MaxValue, 0) + LFlags =3D EDKII_IFR_NUMERIC_SIZE_BIT & Info.VarTotalS= ize + CNObj.SetFlagsForBitField(0, LFlags) + else: + CNObj.SetFlags(0, Info.VarType) + CNObj.SetMinMaxStepData(0, -1, 0) + + if VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARST= ORE_EFI: + VNObj =3D IfrVarEqName(QId, Info.Info.VarName) + VNObj.SetLineNo(LineNo) + ReturnList.append(InsertOpNode(VNObj, EFI_IFR_GUID_OP)= ) + + CEObj =3D IfrEnd() + CEObj.SetLineNo(LineNo) + ReturnList.append(InsertOpNode(CEObj, EFI_IFR_END_OP)) + + if GuidObj is not None: + CEObjGuid =3D IfrEnd() + CEObjGuid.SetLineNo(LineNo) + ReturnList.append(InsertOpNode(CEObjGuid, EFI_IFR_END_= OP)) + GuidObj.SetScope(1) + GuidObj =3D None + pNode =3D pNode.Next + + SEObj =3D IfrEnd() + SEObj.SetLineNo(LineNo) + ReturnList.append(InsertOpNode(SEObj, EFI_IFR_END_OP)) + return ReturnList, VfrReturnCode.VFR_RETURN_SUCCESS + + +gFormPkg =3D FormPkg() +gCreateOp =3D True + +gIfrObjPrintDebugTable =3D [ + "EFI_IFR_INVALID", + "EFI_IFR_FORM", + "EFI_IFR_SUBTITLE", + "EFI_IFR_TEXT", + "EFI_IFR_IMAGE", + "EFI_IFR_ONE_OF", + "EFI_IFR_CHECKBOX", + "EFI_IFR_NUMERIC", + "EFI_IFR_PASSWORD", + "EFI_IFR_ONE_OF_OPTION", + "EFI_IFR_SUPPRESS_IF", + "EFI_IFR_LOCKED", + "EFI_IFR_ACTION", + "EFI_IFR_RESET_BUTTON", + "EFI_IFR_FORM_SET", + "EFI_IFR_REF", + "EFI_IFR_NO_SUBMIT_IF", + "EFI_IFR_INCONSISTENT_IF", + "EFI_IFR_EQ_ID_VAL", + "EFI_IFR_EQ_ID_ID", + "EFI_IFR_EQ_ID_LIST", + "EFI_IFR_AND", + "EFI_IFR_OR", + "EFI_IFR_NOT", + "EFI_IFR_RULE", + "EFI_IFR_GRAY_OUT_IF", + "EFI_IFR_DATE", + "EFI_IFR_TIME", + "EFI_IFR_STRING", + "EFI_IFR_REFRESH", + "EFI_IFR_DISABLE_IF", + "EFI_IFR_INVALID", + "EFI_IFR_TO_LOWER", + "EFI_IFR_TO_UPPER", + "EFI_IFR_MAP", + "EFI_IFR_ORDERED_LIST", + "EFI_IFR_VARSTORE", + "EFI_IFR_VARSTORE_NAME_VALUE", + "EFI_IFR_VARSTORE_EFI", + "EFI_IFR_VARSTORE_DEVICE", + "EFI_IFR_VERSION", + "EFI_IFR_END", + "EFI_IFR_MATCH", + "EFI_IFR_GET", + "EFI_IFR_SET", + "EFI_IFR_READ", + "EFI_IFR_WRITE", + "EFI_IFR_EQUAL", + "EFI_IFR_NOT_EQUAL", + "EFI_IFR_GREATER_THAN", + "EFI_IFR_GREATER_EQUAL", + "EFI_IFR_LESS_THAN", + "EFI_IFR_LESS_EQUAL", + "EFI_IFR_BITWISE_AND", + "EFI_IFR_BITWISE_OR", + "EFI_IFR_BITWISE_NOT", + "EFI_IFR_SHIFT_LEFT", + "EFI_IFR_SHIFT_RIGHT", + "EFI_IFR_ADD", + "EFI_IFR_SUBTRACT", + "EFI_IFR_MULTIPLY", + "EFI_IFR_DIVIDE", + "EFI_IFR_MODULO", + "EFI_IFR_RULE_REF", + "EFI_IFR_QUESTION_REF1", + "EFI_IFR_QUESTION_REF2", + "EFI_IFR_UINT8", + "EFI_IFR_UINT16", + "EFI_IFR_UINT32", + "EFI_IFR_UINT64", + "EFI_IFR_TRUE", + "EFI_IFR_FALSE", + "EFI_IFR_TO_UINT", + "EFI_IFR_TO_STRING", + "EFI_IFR_TO_BOOLEAN", + "EFI_IFR_MID", + "EFI_IFR_FIND", + "EFI_IFR_TOKEN", + "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_MATCH2", +] + +gScopeCount =3D 0 +gIsOrderedList =3D False +gIsStringOp =3D False +gCurrentMinMaxData =3D None + + +class IfrLine: + def __init__(self, LineNo=3D0): + self.LineNo =3D LineNo + + def SetLineNo(self, LineNo): + self.LineNo =3D LineNo + + def GetLineNo(self): + return self.LineNo + + +class IfrBaseInfo: + def __init__(self, Obj=3DNone, QName=3DNone, VarIdStr=3D""): + self.Obj =3D Obj + self.QName =3D QName + self.VarIdStr =3D VarIdStr + + self.FlagsStream =3D "" + self.HasKey =3D False + self.HasQuestionId =3D False + + def SetQName(self, QName): + self.QName =3D QName + + def SetVarIdStr(self, VarIdStr): + self.VarIdStr =3D VarIdStr + + def SetFlagsStream(self, FlagsStream): + self.FlagsStream =3D FlagsStream + + def SetHasKey(self, HasKey): + self.HasKey =3D HasKey + + def SetHasQuestionId(self, HasQuestionId): + self.HasQuestionId =3D HasQuestionId + + def GetInfo(self): + return self.Obj + + +class IfrOpHeader: + def __init__(self, OpHeader: EFI_IFR_OP_HEADER, OpCode=3DNone, Length= =3D0): + self.OpHeader =3D OpHeader + if OpCode is not None: + self.OpHeader.OpCode =3D OpCode + + self.OpHeader.Length =3D gOpcodeSizesScopeTable[OpCode].Size i= f Length =3D=3D 0 else Length + self.OpHeader.Scope =3D ( + 1 if (gOpcodeSizesScopeTable[OpCode].Scope + gScopeCount >= 0) else 0 + ) + + def GetLength(self): + return self.OpHeader.Length + + def SetScope(self, Scope): + self.OpHeader.Scope =3D Scope + + def UpdateHeader(self, Header): + self.OpHeader =3D Header + + def IncLength(self, Size): + self.OpHeader.Length +=3D Size + + def DecLength(self, Size): + self.OpHeader.Length -=3D Size + + def AdjustLength(self, BeforeSize, AfterSize): + self.OpHeader.Length -=3D BeforeSize + self.OpHeader.Length +=3D AfterSize + self.OpHeader.Length +=3D 1 + + def GetOpCode(self): + return self.OpHeader.OpCode + + +class IfrStatementHeader: + def __init__(self, sHeader: EFI_IFR_STATEMENT_HEADER): + self.sHeader =3D sHeader + self.sHeader.Help =3D EFI_STRING_ID_INVALID + self.sHeader.Prompt =3D EFI_STRING_ID_INVALID + + def GetStatementHeader(self): + return self.sHeader + + def SetPrompt(self, Prompt): + self.sHeader.Prompt =3D Prompt + + def SetHelp(self, Help): + self.sHeader.Help =3D Help + + +class IfrMinMaxStepData: + def __init__(self, MinMaxStepData, NumericOpcode=3DFalse): + self.MinMaxStepData =3D MinMaxStepData + self.MinMaxStepData.MinValue =3D 0 + self.MinMaxStepData.MaxValue =3D 0 + self.MinMaxStepData.Step =3D 0 + self.ValueIsSet =3D False + self.IsNumeric =3D NumericOpcode + + def SetMinMaxStepData(self, MinValue, MaxValue, Step): + if self.ValueIsSet =3D=3D False: + self.MinMaxStepData.MinValue =3D MinValue + self.MinMaxStepData.MaxValue =3D MaxValue + self.MinMaxStepData.Step =3D Step + + self.ValueIsSet =3D True + else: + if MinValue < self.MinMaxStepData.MinValue: + self.MinMaxStepData.MinValue =3D MinValue + if MaxValue > self.MinMaxStepData.MaxValue: + self.MinMaxStepData.MaxValue =3D MaxValue + self.MinMaxStepData.Step =3D Step + + def IsNumericOpcode(self): + return self.IsNumeric + + def UpdateIfrMinMaxStepData(self, MinMaxStepData): + self.MinMaxStepData =3D MinMaxStepData + + def GetMinData(self): + return self.MinMaxStepData.MinValue + + def GetMaxData(self): + return self.MinMaxStepData.MaxValue + + def GetStepData(self): + return self.MinMaxStepData.Step + + +class IfrFormSet(IfrLine, IfrOpHeader): + def __init__(self, Size): + self.FormSet =3D EFI_IFR_FORM_SET() + self.ClassGuid =3D [] + IfrOpHeader.__init__(self, self.FormSet.Header, EFI_IFR_FORM_SET_O= P, Size) + self.FormSet.Help =3D EFI_STRING_ID_INVALID + self.FormSet.FormSetTitle =3D EFI_STRING_ID_INVALID + self.FormSet.Flags =3D 0 + self.FormSet.Guid =3D EFI_GUID(0, 0, 0, GuidArray(0, 0, 0, 0, 0, 0= , 0, 0)) + + self.ClassGuidNum =3D 0 + + def SetGuid(self, Guid): + self.FormSet.Guid =3D Guid + + def GetGuid(self): + return self.FormSet.Guid + + def SetFormSetTitle(self, FormSetTitle): + self.FormSet.FormSetTitle =3D FormSetTitle + + def GetFormSetTitle(self): + return self.FormSet.FormSetTitle + + def SetHelp(self, Help): + self.FormSet.Help =3D Help + + def GetHelp(self): + return self.FormSet.Help + + def SetClassGuid(self, Guid): + self.ClassGuid.append(Guid) + self.FormSet.Flags +=3D 1 + + def GetClassGuid(self): + return self.ClassGuid + + def GetFlags(self): + return self.FormSet.Flags + + def SetClassGuidNum(self, Num): + self.ClassGuidNum =3D Num + + def GetInfo(self): + return self.FormSet + + +class IfrOneOfOption(IfrLine, IfrOpHeader): + def __init__(self, ValueType, ValueList): + Nums =3D len(ValueList) + self.OneOfOption =3D Refine_EFI_IFR_ONE_OF_OPTION(ValueType, Nums) + IfrOpHeader.__init__( + self, self.OneOfOption.Header, EFI_IFR_ONE_OF_OPTION_OP, sizeo= f(self.OneOfOption) + ) + self.OneOfOption.Flags =3D 0 + self.OneOfOption.Option =3D EFI_STRING_ID_INVALID + self.OneOfOption.Type =3D EFI_IFR_TYPE_OTHER + self.ValueType =3D ValueType + if ValueList !=3D []: + ArrayType =3D TypeDict[ValueType] * Nums + ValueArray =3D ArrayType() + for i in range(0, len(ValueList)): + ValueArray[i] =3D ValueList[i] + self.OneOfOption.Value =3D ValueArray + + self.IfrOptionKey =3D None + self.FlagsStream =3D "" + self.ValueStream =3D "" + + def SetOption(self, Option): + self.OneOfOption.Option =3D Option + + def SetType(self, Type): + self.OneOfOption.Type =3D Type + + def SetIfrOptionKey(self, IfrOptionKey): + self.IfrOptionKey =3D IfrOptionKey + + def SetFlagsStream(self, FlagsStream): + self.FlagsStream =3D FlagsStream + + def SetValueStream(self, ValueStream): + self.ValueStream =3D ValueStream + + def GetValueType(self): + return self.ValueType + + def SetValue(self, ValueList): + ArrayType =3D TypeDict[self.ValueType] * (len(ValueList)) + ValueArray =3D ArrayType() + for i in range(0, len(ValueList)): + ValueArray[i] =3D ValueList[i] + self.OneOfOption.Value =3D ValueArray + + def GetFlags(self): + return self.OneOfOption.Flags + + def SetFlags(self, LFlags): + self.OneOfOption.Flags =3D 0 + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_OPTION_DEFAUL= T) + if Ret: + self.OneOfOption.Flags |=3D EFI_IFR_OPTION_DEFAULT + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_OPTION_DEFAUL= T_MFG) + if Ret: + self.OneOfOption.Flags |=3D EFI_IFR_OPTION_DEFAULT_MFG + + if LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: + LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_8) + self.OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_8 + + elif LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: + LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_16) + self.OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_16 + + elif LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: + LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_32) + self.OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_32 + + elif LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: + LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_64) + self.OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_64 + + elif LFlags =3D=3D EFI_IFR_TYPE_BOOLEAN: + LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_BOOLEAN) + self.OneOfOption.Flags |=3D EFI_IFR_TYPE_BOOLEAN + + elif LFlags =3D=3D EFI_IFR_TYPE_TIME: + LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_TIME) + self.OneOfOption.Flags |=3D EFI_IFR_TYPE_TIME + + elif LFlags =3D=3D EFI_IFR_TYPE_DATE: + LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_DATE) + self.OneOfOption.Flags |=3D EFI_IFR_TYPE_DATE + + elif LFlags =3D=3D EFI_IFR_TYPE_STRING: + LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_STRING) + self.OneOfOption.Flags |=3D EFI_IFR_TYPE_STRING + + elif LFlags =3D=3D EFI_IFR_TYPE_OTHER: + LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_OTHER) + self.OneOfOption.Flags |=3D EFI_IFR_TYPE_OTHER + + return ( + VfrReturnCode.VFR_RETURN_SUCCESS + if LFlags =3D=3D 0 + else VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED + ) + + def GetInfo(self): + return self.OneOfOption + + +class IfrOptionKey(IfrLine, IfrOpHeader): + def __init__(self, QuestionId, Type, OptionValue, KeyValue): + self.OptionKey =3D Refine_EFI_IFR_GUID_OPTIONKEY(Type) + IfrOpHeader.__init__(self, self.OptionKey.Header, EFI_IFR_GUID_OP,= sizeof(self.OptionKey)) + self.OptionKey.ExtendOpCode =3D EFI_IFR_EXTEND_OP_OPTIONKEY + self.OptionKey.Guid =3D EFI_IFR_FRAMEWORK_GUID + self.OptionKey.QuestionId =3D QuestionId + self.OptionKey.OptionValue =3D OptionValue + self.OptionKey.KeyValue =3D KeyValue + + def GetInfo(self): + return self.OptionKey + + +class IfrClass(IfrLine, IfrOpHeader): + def __init__( + self, + ): + self.Class =3D EFI_IFR_GUID_CLASS() # static guid + IfrOpHeader.__init__(self, self.Class.Header, EFI_IFR_GUID_OP, siz= eof(EFI_IFR_GUID_CLASS)) + self.Class.ExtendOpCode =3D EFI_IFR_EXTEND_OP_CLASS + self.Class.Guid =3D EFI_IFR_TIANO_GUID + self.Class.Class =3D EFI_NON_DEVICE_CLASS + + self.HasSubClass =3D False + self.ClassStr =3D None + + def SetClass(self, Class): + self.Class.Class =3D Class + + def SetClassStr(self, ClassStr): + self.ClassStr =3D ClassStr + + def GetInfo(self): + return self.Class + + +class IfrSubClass(IfrLine, IfrOpHeader): + def __init__( + self, + ): + self.SubClass =3D EFI_IFR_GUID_SUBCLASS() + IfrOpHeader.__init__( + self, self.SubClass.Header, EFI_IFR_GUID_OP, sizeof(EFI_IFR_GU= ID_SUBCLASS) + ) + self.SubClass.ExtendOpCode =3D EFI_IFR_EXTEND_OP_SUBCLASS + self.SubClass.Guid =3D EFI_IFR_TIANO_GUID + self.SubClass.SubClass =3D EFI_SETUP_APPLICATION_SUBCLASS + + self.SubClassStr =3D None + + def SetSubClass(self, SubClass): + self.SubClass.SubClass =3D SubClass + + def SetSubClassStr(self, SubClassStr): + self.SubClassStr =3D SubClassStr + + def GetInfo(self): + return self.SubClass + + +class IfrDefaultStore(IfrLine, IfrOpHeader): + def __init__(self, TypeName=3DNone): + self.DefaultStore =3D EFI_IFR_DEFAULTSTORE() + IfrOpHeader.__init__(self, self.DefaultStore.Header, EFI_IFR_DEFAU= LTSTORE_OP) + self.DefaultStore.DefaultName =3D EFI_STRING_ID_INVALID + self.DefaultStore.DefaultId =3D EFI_VARSTORE_ID_INVALID + self.Type =3D TypeName + self.HasAttr =3D False + + def SetDefaultName(self, DefaultName): + self.DefaultStore.DefaultName =3D DefaultName + + def SetType(self, Type): + self.Type =3D Type + + def SetDefaultId(self, DefaultId): + self.DefaultStore.DefaultId =3D DefaultId + + def SetDefaultStore(self, DefaultStore: EFI_IFR_DEFAULTSTORE): + self.DefaultStore =3D DefaultStore + IfrOpHeader.__init__(self, self.DefaultStore.Header, EFI_IFR_DEFAU= LTSTORE_OP) + + def GetDefaultId(self): + return self.DefaultStore.DefaultId + + def GetInfo(self): + return self.DefaultStore + + +class IfrVarStore(IfrLine, IfrOpHeader): + def __init__(self, TypeName, StoreName): + Nums =3D len(StoreName) + self.Varstore =3D Refine_EFI_IFR_VARSTORE(Nums) + IfrOpHeader.__init__( + self, self.Varstore.Header, EFI_IFR_VARSTORE_OP, sizeof(self.V= arstore) + 1 + ) + self.Varstore.VarStoreId =3D EFI_VARSTORE_ID_INVALID + self.Varstore.Size =3D 0 + ArrayType =3D c_ubyte * (Nums) + ValueArray =3D ArrayType() + for i in range(0, Nums): + ValueArray[i] =3D ord(StoreName[i]) + self.Varstore.Name =3D ValueArray + + # info saved for yaml generation + self.Type =3D TypeName + self.HasVarStoreId =3D False + + def SetGuid(self, Guid): + self.Varstore.Guid =3D Guid + + def SetSize(self, Size): + self.Varstore.Size =3D Size + + def SetVarStoreId(self, VarStoreId): + self.Varstore.VarStoreId =3D VarStoreId + + def SetHasVarStoreId(self, HasVarStoreId): + self.HasVarStoreId =3D HasVarStoreId + + def GetInfo(self): + return self.Varstore + + +class IfrVarStoreEfi(IfrLine, IfrOpHeader): + def __init__(self, TypeName, StoreName): + Nums =3D len(StoreName) + self.VarStoreEfi =3D Refine_EFI_IFR_VARSTORE_EFI(Nums) + IfrOpHeader.__init__( + self, self.VarStoreEfi.Header, EFI_IFR_VARSTORE_EFI_OP, sizeof= (self.VarStoreEfi) + 1 + ) + self.VarStoreEfi.VarStoreId =3D EFI_VAROFFSET_INVALID + self.VarStoreEfi.Size =3D 0 + ArrayType =3D c_ubyte * (Nums) + ValueArray =3D ArrayType() + for i in range(0, Nums): + ValueArray[i] =3D ord(StoreName[i]) + self.VarStoreEfi.Name =3D ValueArray + + # info saved for yaml generation + self.Type =3D TypeName + self.HasVarStoreId =3D False + self.AttributesText =3D None + self.NameStringId =3D None + self.VarSize =3D None + + def SetGuid(self, Guid): + self.VarStoreEfi.Guid =3D Guid + + def SetSize(self, Size): + self.VarStoreEfi.Size =3D Size + + def SetNameStringId(self, NameStringId): + self.NameStringId =3D NameStringId + + def SetVarSize(self, VarSize): + self.VarSize =3D VarSize + + def SetVarStoreId(self, VarStoreId): + self.VarStoreEfi.VarStoreId =3D VarStoreId + + def SetAttributes(self, Attributes): + self.VarStoreEfi.Attributes =3D Attributes + + def SetHasVarStoreId(self, HasVarStoreId): + self.HasVarStoreId =3D HasVarStoreId + + def SetAttributesText(self, AttributesText): + self.AttributesText =3D AttributesText + + def GetInfo(self): + return self.VarStoreEfi + + +class IfrVarStoreNameValue(IfrLine, IfrOpHeader): + def __init__(self, TypeName): + self.VarStoreNameValue =3D EFI_IFR_VARSTORE_NAME_VALUE() + IfrOpHeader.__init__(self, self.VarStoreNameValue.Header, EFI_IFR_= VARSTORE_NAME_VALUE_OP) + self.VarStoreNameValue.VarStoreId =3D EFI_VAROFFSET_INVALID + + self.Type =3D TypeName + self.NameItemList =3D [] + self.HasVarStoreId =3D False + + def SetGuid(self, Guid): + self.VarStoreNameValue.Guid =3D Guid + + def SetVarStoreId(self, VarStoreId): + self.VarStoreNameValue.VarStoreId =3D VarStoreId + + def SetNameItemList(self, NameItem): + self.NameItemList.append(NameItem) + + def SetHasVarStoreId(self, HasVarStoreId): + self.HasVarStoreId =3D HasVarStoreId + + def GetInfo(self): + return self.VarStoreNameValue + + +EFI_BITS_PER_UINT32 =3D 1 << EFI_BITS_SHIFT_PER_UINT32 +EFI_FORM_ID_MAX =3D 0xFFFF + +EFI_FREE_FORM_ID_BITMAP_SIZE =3D int((EFI_FORM_ID_MAX + 1) / EFI_BITS_PER_= UINT32) + + +class IfrFormId: + def __init__(self): + self.FormIdBitMap =3D [] + for _ in range(0, EFI_FREE_FORM_ID_BITMAP_SIZE): + self.FormIdBitMap.append(0) + + def Clear(self): + self.FormIdBitMap =3D [] + for _ in range(0, EFI_FREE_FORM_ID_BITMAP_SIZE): + self.FormIdBitMap.append(0) + + def CheckFormIdFree(self, FormId): + Index =3D int(FormId / EFI_BITS_PER_UINT32) + Offset =3D FormId % EFI_BITS_PER_UINT32 + + return (self.FormIdBitMap[Index] & (0x80000000 >> Offset)) =3D=3D = 0 + + def MarkFormIdUsed(self, FormId): + Index =3D int(FormId / EFI_BITS_PER_UINT32) + Offset =3D FormId % EFI_BITS_PER_UINT32 + self.FormIdBitMap[Index] |=3D 0x80000000 >> Offset + + +gIfrFormId =3D IfrFormId() + + +class IfrForm(IfrLine, IfrOpHeader): + def __init__(self): + self.Form =3D EFI_IFR_FORM() + IfrOpHeader.__init__(self, self.Form.Header, EFI_IFR_FORM_OP) + self.Form.FormId =3D 0 + self.Form.FormTitle =3D EFI_STRING_ID_INVALID + + def SetFormId(self, FormId): + # FormId can't be 0. + if FormId =3D=3D 0: + return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER + if gIfrFormId.CheckFormIdFree(FormId) =3D=3D False: + return VfrReturnCode.VFR_RETURN_FORMID_REDEFINED + self.Form.FormId =3D FormId + gIfrFormId.MarkFormIdUsed(FormId) + return VfrReturnCode.VFR_RETURN_SUCCESS + + def SetFormTitle(self, FormTitle): + self.Form.FormTitle =3D FormTitle + + def GetInfo(self): + return self.Form + + +class IfrFormMap(IfrLine, IfrOpHeader): + def __init__(self): + self.FormMap =3D EFI_IFR_FORM_MAP() + self.MethodMapList =3D [] + IfrOpHeader.__init__(self, self.FormMap.Header, EFI_IFR_FORM_MAP_O= P) + self.FormMap.FormId =3D 0 + + def SetFormId(self, FormId): + if FormId =3D=3D 0: + return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER + + if gIfrFormId.CheckFormIdFree(FormId) =3D=3D False: + return VfrReturnCode.VFR_RETURN_FORMID_REDEFINED + self.FormMap.FormId =3D FormId + gIfrFormId.MarkFormIdUsed(FormId) + return VfrReturnCode.VFR_RETURN_SUCCESS + + def SetFormMapMethod(self, MethodTitle, MethodGuid: EFI_GUID): + MethodMap =3D EFI_IFR_FORM_MAP_METHOD() + MethodMap.MethodTitle =3D MethodTitle + MethodMap.MethodIdentifier =3D MethodGuid + self.MethodMapList.append(MethodMap) + + def GetInfo(self): + return self.FormMap + + def GetMethodMapList(self): + return self.MethodMapList + + +class IfrEnd(IfrLine, IfrOpHeader): + def __init__(self): + self.End =3D EFI_IFR_END() + IfrOpHeader.__init__(self, self.End.Header, EFI_IFR_END_OP) + + def GetInfo(self): + return self.End + + +class IfrBanner(IfrLine, IfrOpHeader): + def __init__( + self, + ): + self.Banner =3D EFI_IFR_GUID_BANNER() + IfrOpHeader.__init__(self, self.Banner.Header, EFI_IFR_GUID_OP, si= zeof(EFI_IFR_GUID_BANNER)) + self.Banner.ExtendOpCode =3D EFI_IFR_EXTEND_OP_BANNER + self.Banner.Guid =3D EFI_IFR_TIANO_GUID + + self.HasTimeOut =3D False + self.TimeOut =3D None + + def SetTitle(self, StringId): + self.Banner.Title =3D StringId + + def SetLine(self, Line): + self.Banner.LineNumber =3D Line + + def SetAlign(self, Align): + self.Banner.Alignment =3D Align + + def SetHasTimeOut(self, HasTimeOut): + self.HasTimeOut =3D HasTimeOut + + def SetTimeOut(self, TimeOut): + self.TimeOut =3D TimeOut + + def GetInfo(self): + return self.Banner + + +class IfrVarEqName(IfrLine, IfrOpHeader): + def __init__(self, QuestionId, NameId): + self.VarEqName =3D EFI_IFR_GUID_VAREQNAME() + IfrOpHeader.__init__( + self, self.VarEqName.Header, EFI_IFR_GUID_OP, sizeof(EFI_IFR_G= UID_VAREQNAME) + ) + self.VarEqName.ExtendOpCode =3D EFI_IFR_EXTEND_OP_VAREQNAME + self.VarEqName.Guid =3D EFI_IFR_FRAMEWORK_GUID + self.VarEqName.QuestionId =3D QuestionId + self.VarEqName.NameId =3D NameId + + def GetInfo(self): + return self.VarEqName + + +class IfrTimeout(IfrLine, IfrOpHeader): + def __init__(self, Timeout=3D0): + self.Timeout =3D EFI_IFR_GUID_TIMEOUT() + IfrOpHeader.__init__( + self, self.Timeout.Header, EFI_IFR_GUID_OP, sizeof(EFI_IFR_GUI= D_TIMEOUT) + ) + self.Timeout.ExtendOpCode =3D EFI_IFR_EXTEND_OP_TIMEOUT + self.Timeout.Guid =3D EFI_IFR_TIANO_GUID + self.Timeout.TimeOut =3D Timeout + + def SetTimeout(self, Timeout): + self.Timeout.TimeOut =3D Timeout + + def GetInfo(self): + return self.Timeout + + +class IfrLabel(IfrLine, IfrOpHeader): + def __init__( + self, + ): + self.Label =3D EFI_IFR_GUID_LABEL() + IfrOpHeader.__init__(self, self.Label.Header, EFI_IFR_GUID_OP, siz= eof(EFI_IFR_GUID_LABEL)) + self.Label.ExtendOpCode =3D EFI_IFR_EXTEND_OP_LABEL + self.Label.Guid =3D EFI_IFR_TIANO_GUID + + def SetNumber(self, Number): + self.Label.Number =3D Number + + def GetInfo(self): + return self.Label + + +class IfrRule(IfrLine, IfrOpHeader): + def __init__(self, RuleName=3DNone): + self.Rule =3D EFI_IFR_RULE() + self.RuleName =3D RuleName + IfrOpHeader.__init__(self, self.Rule.Header, EFI_IFR_RULE_OP) + self.Rule.RuleId =3D EFI_RULE_ID_INVALID + + def SetRuleId(self, RuleId): + self.Rule.RuleId =3D RuleId + + def GetRuleName(self): + return self.RuleName + + def SetRuleName(self, RuleName): + self.RuleName =3D RuleName + + def GetInfo(self): + return self.Rule + + +def _FLAG_TEST_AND_CLEAR(Flags, Mask): + Ret =3D Flags & Mask + Flags &=3D ~Mask + return Flags, Ret + + +def _FLAG_CLEAR(Flags, Mask): + Flags &=3D ~Mask + return Flags + + +class IfrSubtitle(IfrLine, IfrOpHeader, IfrStatementHeader): + def __init__( + self, + ): + self.Subtitle =3D EFI_IFR_SUBTITLE() + + IfrOpHeader.__init__(self, self.Subtitle.Header, EFI_IFR_SUBTITLE_= OP) + IfrStatementHeader.__init__(self, self.Subtitle.Statement) + self.Subtitle.Flags =3D 0 + + self.FlagsStream =3D "" + + def SetFlags(self, Flags): + Flags, Result =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAGS_HORIZO= NTAL) + if Result: + self.Subtitle.Flags |=3D EFI_IFR_FLAGS_HORIZONTAL + + return ( + VfrReturnCode.VFR_RETURN_SUCCESS + if Flags =3D=3D 0 + else VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED + ) + + def SetFlagsStream(self, FlagsStream): + self.FlagsStream =3D FlagsStream + + def GetInfo(self): + return self.Subtitle + + +class IfrImage(IfrLine, IfrOpHeader): + def __init__( + self, + ): + self.Image =3D EFI_IFR_IMAGE() + IfrOpHeader.__init__(self, self.Image.Header, EFI_IFR_IMAGE_OP) + self.Image.Id =3D EFI_IMAGE_ID_INVALID + + def SetImageId(self, ImageId): + self.Image.Id =3D ImageId + + def GetInfo(self): + return self.Image + + +class IfrLocked(IfrLine, IfrOpHeader): + def __init__( + self, + ): + self.Lock =3D EFI_IFR_LOCKED() + IfrOpHeader.__init__(self, self.Lock.Header, EFI_IFR_LOCKED_OP) + + def GetInfo(self): + return self.Lock + + +class IfrModal(IfrLine, IfrOpHeader): + def __init__( + self, + ): + self.Modal =3D EFI_IFR_MODAL_TAG() + IfrOpHeader.__init__(self, self.Modal.Header, EFI_IFR_MODAL_TAG_OP= ) + + def GetInfo(self): + return self.Modal + + +EFI_IFR_QUESTION_FLAG_DEFAULT =3D 0 + + +class IfrQuestionHeader(IfrStatementHeader): + def __init__(self, QHeader, Flags=3DEFI_IFR_QUESTION_FLAG_DEFAULT): + self.QHeader =3D QHeader + IfrStatementHeader.__init__(self, self.QHeader.Header) + self.QHeader.QuestionId =3D EFI_QUESTION_ID_INVALID + self.QHeader.VarStoreId =3D EFI_VARSTORE_ID_INVALID + self.QHeader.VarStoreInfo.VarName =3D EFI_STRING_ID_INVALID + self.QHeader.VarStoreInfo.VarOffset =3D EFI_VAROFFSET_INVALID + self.QHeader.Flags =3D Flags + + def GetQuestionId(self): + return self.QHeader.QuestionId + + def SetQuestionId(self, QuestionId): + self.QHeader.QuestionId =3D QuestionId + + def GetVarStoreId(self): + return self.QHeader.VarStoreId + + def SetVarStoreInfo(self, BaseInfo): + self.QHeader.VarStoreId =3D BaseInfo.VarStoreId + self.QHeader.VarStoreInfo.VarName =3D BaseInfo.Info.VarName + self.QHeader.VarStoreInfo.VarOffset =3D BaseInfo.Info.VarOffset + + def GetVarStoreInfo(self, Info): + Info.VarStoreId =3D self.QHeader.VarStoreId + Info.VarStoreInfo =3D self.QHeader.VarStoreInfo + return Info + + def GetQFlags(self): + return self.QHeader.Flags + + def SetFlags(self, Flags): + Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAG_READ_ONLY) + if Ret: + self.QHeader.Flags |=3D EFI_IFR_FLAG_READ_ONLY + + Flags =3D _FLAG_CLEAR(Flags, 0x02) + + Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAG_CALLBACK) + if Ret: + self.QHeader.Flags |=3D EFI_IFR_FLAG_CALLBACK + + # ignore NVAccessFlag + Flags =3D _FLAG_CLEAR(Flags, 0x08) + + Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAG_RESET_REQU= IRED) + if Ret: + self.QHeader.Flags |=3D EFI_IFR_FLAG_RESET_REQUIRED + + Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAG_RECONNECT_= REQUIRED) + if Ret: + self.QHeader.Flags |=3D EFI_IFR_FLAG_RECONNECT_REQUIRED + + # Set LateCheck Flag to compatible for framework flag + # but it uses 0x20 as its flag, if in the future UEFI may take thi= s flag + + Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, 0x20) + if Ret: + self.QHeader.Flags |=3D 0x20 + + Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAG_OPTIONS_ON= LY) + if Ret: + self.QHeader.Flags |=3D EFI_IFR_FLAG_OPTIONS_ONLY + + return ( + VfrReturnCode.VFR_RETURN_SUCCESS + if Flags =3D=3D 0 + else VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED + ) + + def UpdateIfrQuestionHeader(self, qHeader): + self.QHeader =3D qHeader + + +class IfrRef(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Ref =3D EFI_IFR_REF() + IfrBaseInfo.__init__(self, self.Ref, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Ref.Header, EFI_IFR_REF_OP) + IfrQuestionHeader.__init__(self, self.Ref.Question) + self.Ref.FormId =3D 0 + + def SetFormId(self, FormId): + self.Ref.FormId =3D FormId + + +class IfrRef2(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Ref2 =3D EFI_IFR_REF2() + IfrBaseInfo.__init__(self, self.Ref2, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Ref2.Header, EFI_IFR_REF_OP, sizeo= f(EFI_IFR_REF2)) + IfrQuestionHeader.__init__(self, self.Ref2.Question) + self.Ref2.FormId =3D 0 + self.Ref2.QuestionId =3D EFI_QUESTION_ID_INVALID + + def SetFormId(self, FormId): + self.Ref2.FormId =3D FormId + + def SetQId(self, QuestionId): + self.Ref2.QuestionId =3D QuestionId + + +class IfrRef3(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Ref3 =3D EFI_IFR_REF3() + IfrBaseInfo.__init__(self, self.Ref3, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Ref3.Header, EFI_IFR_REF_OP, sizeo= f(EFI_IFR_REF3)) + IfrQuestionHeader.__init__(self, self.Ref3.Question) + self.Ref3.FormId =3D 0 + self.Ref3.QuestionId =3D EFI_QUESTION_ID_INVALID + EFI_IFR_DEFAULT_GUID =3D EFI_GUID(0, 0, 0, GuidArray(0, 0, 0, 0, 0= , 0, 0, 0)) + self.Ref3.FormSetId =3D EFI_IFR_DEFAULT_GUID + + def SetFormId(self, FormId): + self.Ref3.FormId =3D FormId + + def SetQId(self, QuestionId): + self.Ref3.QuestionId =3D QuestionId + + def SetFormSetId(self, FormSetId): + self.Ref3.FormSetId =3D FormSetId + + +class IfrRef4(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Ref4 =3D EFI_IFR_REF4() + IfrBaseInfo.__init__(self, self.Ref4, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Ref4.Header, EFI_IFR_REF_OP, sizeo= f(EFI_IFR_REF4)) + IfrQuestionHeader.__init__(self, self.Ref4.Question) + self.Ref4.FormId =3D 0 + self.Ref4.QuestionId =3D EFI_QUESTION_ID_INVALID + EFI_IFR_DEFAULT_GUID =3D EFI_GUID(0, 0, 0, GuidArray(0, 0, 0, 0, 0= , 0, 0, 0)) + self.Ref4.FormSetId =3D EFI_IFR_DEFAULT_GUID + self.Ref4.DevicePath =3D EFI_STRING_ID_INVALID + + def SetFormId(self, FormId): + self.Ref4.FormId =3D FormId + + def SetQId(self, QuestionId): + self.Ref4.QuestionId =3D QuestionId + + def SetFormSetId(self, FormSetId): + self.Ref4.FormSetId =3D FormSetId + + def SetDevicePath(self, DevicePath): + self.Ref4.DevicePath =3D DevicePath + + +class IfrRef5(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Ref5 =3D EFI_IFR_REF5() + IfrBaseInfo.__init__(self, self.Ref5, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Ref5.Header, EFI_IFR_REF_OP, sizeo= f(EFI_IFR_REF5)) + IfrQuestionHeader.__init__(self, self.Ref5.Question) + + +class IfrAction(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Action =3D EFI_IFR_ACTION() + IfrBaseInfo.__init__(self, self.Action, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Action.Header, EFI_IFR_ACTION_OP) + IfrQuestionHeader.__init__(self, self.Action.Question) + self.Action.QuestionConfig =3D EFI_STRING_ID_INVALID + + def SetQuestionConfig(self, QuestionConfig): + self.Action.QuestionConfig =3D QuestionConfig + + +class IfrText(IfrLine, IfrOpHeader, IfrStatementHeader): + def __init__( + self, + ): + self.Text =3D EFI_IFR_TEXT() + IfrOpHeader.__init__(self, self.Text.Header, EFI_IFR_TEXT_OP) + IfrStatementHeader.__init__(self, self.Text.Statement) + self.Text.TextTwo =3D EFI_STRING_ID_INVALID + self.HasTextTwo =3D False + + def SetTextTwo(self, StringId): + self.Text.TextTwo =3D StringId + + def SetHasTextTwo(self, Flag): + self.HasTextTwo =3D Flag + + def GetInfo(self): + return self.Text + + +class IfrGuid(IfrLine, IfrOpHeader): + def __init__(self, Size, Data=3DNone): + self.Guid =3D EFI_IFR_GUID() + self.Data =3D Data # databuffer is saved here + IfrOpHeader.__init__(self, self.Guid.Header, EFI_IFR_GUID_OP, size= of(EFI_IFR_GUID) + Size) + EFI_IFR_DEFAULT_GUID =3D EFI_GUID(0, 0, 0, GuidArray(0, 0, 0, 0, 0= , 0, 0, 0)) + self.Guid.Guid =3D EFI_IFR_DEFAULT_GUID + + def SetGuid(self, Guid): + self.Guid.Guid =3D Guid + + def SetData(self, Data): + self.Data =3D Data + + def GetData(self): + return self.Data + + def GetInfo(self): # + return self.Guid + + +class IfrExtensionGuid(IfrLine, IfrOpHeader): + def __init__(self, Size=3D0, TypeName=3D"", ArraySize=3D0, Data=3DNone= ): + self.Guid =3D EFI_IFR_GUID() + if ArraySize !=3D 0: + self.DataType =3D TypeName + "[" + str(ArraySize) + "]" + else: + self.DataType =3D TypeName + self.FieldList =3D [] + self.Data =3D Data + IfrOpHeader.__init__(self, self.Guid.Header, EFI_IFR_GUID_OP, size= of(EFI_IFR_GUID) + Size) + EFI_IFR_DEFAULT_GUID =3D EFI_GUID(0, 0, 0, GuidArray(0, 0, 0, 0, 0= , 0, 0, 0)) + self.Guid.Guid =3D EFI_IFR_DEFAULT_GUID + + def SetGuid(self, Guid): + self.Guid.Guid =3D Guid + + def SetData(self, Data): + self.Data =3D Data + + def GetDataType(self): + return self.DataType + + def GetFieldList(self): + return self.FieldList + + def SetFieldList(self, TFName, TFValue): + self.FieldList.append([TFName, TFValue]) + + def GetData(self): + return self.Data + + def GetInfo(self): # + return self.Guid + + +class IfrOrderedList(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader)= : + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.OrderedList =3D EFI_IFR_ORDERED_LIST() + IfrBaseInfo.__init__(self, self.OrderedList, QName, VarIdStr) + IfrOpHeader.__init__(self, self.OrderedList.Header, EFI_IFR_ORDERE= D_LIST_OP) + IfrQuestionHeader.__init__(self, self.OrderedList.Question) + self.OrderedList.MaxContainers =3D 0 + self.OrderedList.Flags =3D 0 + + self.HasMaxContainers =3D False + + def GetQuestion(self): + return self + + def SetQHeaderFlags(self, Flags): + IfrQuestionHeader.SetFlags(self, Flags) + + def SetMaxContainers(self, MaxContainers): + self.OrderedList.MaxContainers =3D MaxContainers + + def SetHasMaxContainers(self, HasMaxContainers): + self.HasMaxContainers =3D HasMaxContainers + + def SetFlags(self, HFlags, LFlags): + ReturnCode =3D IfrQuestionHeader.SetFlags(self, HFlags) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_UNIQUE_SET) + if Ret: + self.OrderedList.Flags |=3D EFI_IFR_UNIQUE_SET + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_NO_EMPTY_SET) + if Ret: + self.OrderedList.Flags |=3D EFI_IFR_NO_EMPTY_SET + + return ( + VfrReturnCode.VFR_RETURN_SUCCESS + if LFlags =3D=3D 0 + else VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED + ) + + +class IfrString(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Str =3D EFI_IFR_STRING() + IfrBaseInfo.__init__(self, self.Str, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Str.Header, EFI_IFR_STRING_OP) + IfrQuestionHeader.__init__(self, self.Str.Question) + self.Str.Flags =3D 0 + self.Str.MinSize =3D 0 + self.Str.MaxSize =3D 0 + + def GetQuestion(self): + return self + + def SetQHeaderFlags(self, Flags): + IfrQuestionHeader.SetFlags(self, Flags) + + def SetFlags(self, HFlags, LFlags): + ReturnCode =3D IfrQuestionHeader.SetFlags(self, HFlags) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_STRING_MULTI_= LINE) + if Ret: + self.Str.Flags |=3D EFI_IFR_STRING_MULTI_LINE + + return ( + VfrReturnCode.VFR_RETURN_SUCCESS + if LFlags =3D=3D 0 + else VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED + ) + + def SetMinSize(self, MinSize): + self.Str.MinSize =3D MinSize + + def SetMaxSize(self, MaxSize): + self.Str.MaxSize =3D MaxSize + + +class IfrPassword(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Password =3D EFI_IFR_PASSWORD() + IfrBaseInfo.__init__(self, self.Password, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Password.Header, EFI_IFR_PASSWORD_= OP) + IfrQuestionHeader.__init__(self, self.Password.Question) + self.Password.MinSize =3D 0 + self.Password.MaxSize =3D 0 + + def GetQuestion(self): + return self + + def SetQHeaderFlags(self, Flags): + IfrQuestionHeader.SetFlags(self, Flags) + + def SetMinSize(self, MinSize): + self.Password.MinSize =3D MinSize + + def SetMaxSize(self, MaxSize): + self.Password.MaxSize =3D MaxSize + + +class IfrDefault(IfrLine, IfrOpHeader): + def __init__( + self, + ValueType, + ValueList, + DefaultId=3DEFI_HII_DEFAULT_CLASS_STANDARD, + Type=3DEFI_IFR_TYPE_OTHER, + ): + Nums =3D len(ValueList) + self.Default =3D Refine_EFI_IFR_DEFAULT(ValueType, Nums) + IfrOpHeader.__init__(self, self.Default.Header, EFI_IFR_DEFAULT_OP= , sizeof(self.Default)) + self.Default.Type =3D Type + self.Default.DefaultId =3D DefaultId + + self.ValueType =3D ValueType + self.DefaultStore =3D "" + self.ValueStream =3D "" + + if ValueList !=3D []: + ArrayType =3D TypeDict[ValueType] * Nums + ValueArray =3D ArrayType() + for i in range(0, len(ValueList)): + ValueArray[i] =3D ValueList[i] + self.Default.Value =3D ValueArray + + def SetDefaultId(self, DefaultId): + self.Default.DefaultId =3D DefaultId + + def GetValueType(self): + return self.ValueType + + def SetType(self, Type): + self.Default.Type =3D Type + + def SetValue(self, ValueList): + ArrayType =3D TypeDict[self.ValueType] * (len(ValueList)) + ValueArray =3D ArrayType() + for i in range(0, len(ValueList)): + ValueArray[i] =3D ValueList[i] + self.Default.Value =3D ValueArray + + def SetDefaultStore(self, DefaultStore): + self.DefaultStore =3D DefaultStore + + def SetValueStream(self, ValueStream): + self.ValueStream =3D ValueStream + + def GetInfo(self): + return self.Default + + +class IfrDefault2(IfrLine, IfrOpHeader): + def __init__(self, DefaultId=3DEFI_HII_DEFAULT_CLASS_STANDARD, Type=3D= EFI_IFR_TYPE_OTHER): + self.Default =3D EFI_IFR_DEFAULT_2() + IfrOpHeader.__init__( + self, self.Default.Header, EFI_IFR_DEFAULT_OP, sizeof(EFI_IFR_= DEFAULT_2) + ) + self.Default.Type =3D Type + self.Default.DefaultId =3D DefaultId + + self.DefaultStore =3D "" + + def SetDefaultId(self, DefaultId): + self.Default.DefaultId =3D DefaultId + + def SetType(self, Type): + self.Default.Type =3D Type + + def SetDefaultStore(self, DefaultStore): + self.DefaultStore =3D DefaultStore + + def GetInfo(self): + return self.Default + + +class IfrInconsistentIf(IfrLine, IfrOpHeader): + def __init__(self): + self.InconsistentIf =3D EFI_IFR_INCONSISTENT_IF() + IfrOpHeader.__init__(self, self.InconsistentIf.Header, EFI_IFR_INC= ONSISTENT_IF_OP) + self.InconsistentIf.Error =3D EFI_STRING_ID_INVALID + self.FlagsStream =3D "" + + def SetError(self, Error): + self.InconsistentIf.Error =3D Error + + def SetFlagsStream(self, Flag): + self.FlagsStream =3D Flag + + def GetInfo(self): + return self.InconsistentIf + + +class IfrInconsistentIf2(IfrLine, IfrOpHeader): + def __init__(self): + self.InconsistentIf =3D EFI_IFR_INCONSISTENT_IF() + IfrOpHeader.__init__(self, self.InconsistentIf.Header, EFI_IFR_INC= ONSISTENT_IF_OP) + self.InconsistentIf.Error =3D EFI_STRING_ID_INVALID + self.FlagsStream =3D "" + + def SetError(self, Error): + self.InconsistentIf.Error =3D Error + + def SetFlagsStream(self, Flag): + self.FlagsStream =3D Flag + + def GetInfo(self): + return self.InconsistentIf + + +class IfrNoSubmitIf(IfrLine, IfrOpHeader): + def __init__(self): + self.NoSubmitIf =3D EFI_IFR_NO_SUBMIT_IF() + IfrOpHeader.__init__(self, self.NoSubmitIf.Header, EFI_IFR_NO_SUBM= IT_IF_OP) + self.NoSubmitIf.Error =3D EFI_STRING_ID_INVALID + + self.FlagsStream =3D "" + + def SetError(self, Error): + self.NoSubmitIf.Error =3D Error + + def SetFlagsStream(self, Flag): + self.FlagsStream =3D Flag + + def GetInfo(self): + return self.NoSubmitIf + + +class IfrDisableIf(IfrLine, IfrOpHeader): + def __init__(self): + self.DisableIf =3D EFI_IFR_DISABLE_IF() + IfrOpHeader.__init__(self, self.DisableIf.Header, EFI_IFR_DISABLE_= IF_OP) + + def GetInfo(self): + return self.DisableIf + + +class IfrSuppressIf(IfrLine, IfrOpHeader): + def __init__(self): + self.SuppressIf =3D EFI_IFR_SUPPRESS_IF() + IfrOpHeader.__init__(self, self.SuppressIf.Header, EFI_IFR_SUPPRES= S_IF_OP) + + def GetInfo(self): + return self.SuppressIf + + +class IfrGrayOutIf(IfrLine, IfrOpHeader): + def __init__(self): + self.GrayOutIf =3D EFI_IFR_GRAY_OUT_IF() + IfrOpHeader.__init__(self, self.GrayOutIf.Header, EFI_IFR_GRAY_OUT= _IF_OP) + + def GetInfo(self): + return self.GrayOutIf + + +class IfrValue(IfrLine, IfrOpHeader): + def __init__(self): + self.Value =3D EFI_IFR_VALUE() + IfrOpHeader.__init__(self, self.Value.Header, EFI_IFR_VALUE_OP) + + def GetInfo(self): + return self.Value + + +class IfrRead(IfrLine, IfrOpHeader): + def __init__(self): + self.Read =3D EFI_IFR_READ() + IfrOpHeader.__init__(self, self.Read.Header, EFI_IFR_READ_OP) + + def GetInfo(self): + return self.Read + + +class IfrWrite(IfrLine, IfrOpHeader): + def __init__(self): + self.Write =3D EFI_IFR_WRITE() + IfrOpHeader.__init__(self, self.Write.Header, EFI_IFR_WRITE_OP) + + def GetInfo(self): + return self.Write + + +class IfrWarningIf(IfrLine, IfrOpHeader): + def __init__(self): + self.WarningIf =3D EFI_IFR_WARNING_IF() + IfrOpHeader.__init__(self, self.WarningIf.Header, EFI_IFR_WARNING_= IF_OP) + self.WarningIf.Warning =3D EFI_STRING_ID_INVALID + self.WarningIf.TimeOut =3D 0 + + self.HasTimeOut =3D False + + def SetWarning(self, WarnMessage): + self.WarningIf.Warning =3D WarnMessage + + def SetHasHasTimeOut(self, HasTimeOut): + self.HasTimeOut =3D HasTimeOut + + def SetTimeOut(self, TimeOut): + self.WarningIf.TimeOut =3D TimeOut + + def GetInfo(self): + return self.WarningIf + + +class IfrRefresh(IfrLine, IfrOpHeader): + def __init__(self): + self.Refresh =3D EFI_IFR_REFRESH() + IfrOpHeader.__init__(self, self.Refresh.Header, EFI_IFR_REFRESH_OP= ) + self.Refresh.RefreshInterval =3D 0 + + def SetRefreshInterval(self, RefreshInterval): + self.Refresh.RefreshInterval =3D RefreshInterval + + def GetInfo(self): + return self.Refresh + + +class IfrRefreshId(IfrLine, IfrOpHeader): + def __init__(self): + self.RefreshId =3D EFI_IFR_REFRESH_ID() + IfrOpHeader.__init__(self, self.RefreshId.Header, EFI_IFR_REFRESH_= ID_OP) + self.RefreshId.RefreshEventGroupId =3D EFI_GUID(0, 0, 0, GuidArray= (0, 0, 0, 0, 0, 0, 0, 0)) + + def SetRefreshEventGroutId(self, RefreshEventGroupId): + self.RefreshId.RefreshEventGroupId =3D RefreshEventGroupId + + def GetInfo(self): + return self.RefreshId + + +class IfrVarStoreDevice(IfrLine, IfrOpHeader): + def __init__(self): + self.VarStoreDevice =3D EFI_IFR_VARSTORE_DEVICE() + IfrOpHeader.__init__(self, self.VarStoreDevice.Header, EFI_IFR_VAR= STORE_DEVICE_OP) + self.VarStoreDevice.DevicePath =3D EFI_STRING_ID_INVALID + + def SetDevicePath(self, DevicePath): + self.VarStoreDevice.DevicePath =3D DevicePath + + def GetInfo(self): + return self.VarStoreDevice + + +class IfrDate(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Date =3D EFI_IFR_DATE() + IfrBaseInfo.__init__(self, self.Date, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Date.Header, EFI_IFR_DATE_OP) + IfrQuestionHeader.__init__(self, self.Date.Question) + self.Date.Flags =3D 0 + + self.Year =3D None + self.Month =3D None + self.Day =3D None + + self.D_Year =3D None + self.D_Month =3D None + self.D_Day =3D None + self.Step =3D None + self.Min =3D None + self.Max =3D None + + def SetFlags(self, HFlags, LFlags): + ReturnCode =3D IfrQuestionHeader.SetFlags(self, HFlags) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_QF_DATE_YEAR_SUPP= RESS) + if Ret: + self.Date.Flags |=3D EFI_QF_DATE_YEAR_SUPPRESS + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_QF_DATE_MONTH_SUP= PRESS) + if Ret: + self.Date.Flags |=3D EFI_QF_DATE_MONTH_SUPPRESS + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_QF_DATE_DAY_SUPPR= ESS) + if Ret: + self.Date.Flags |=3D EFI_QF_DATE_DAY_SUPPRESS + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_DATE_STORAGE_NORMA= L) + if Ret: + self.Date.Flags |=3D QF_DATE_STORAGE_NORMAL + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_DATE_STORAGE_TIME) + if Ret: + self.Date.Flags |=3D QF_DATE_STORAGE_TIME + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_DATE_STORAGE_WAKEU= P) + if Ret: + self.Date.Flags |=3D QF_DATE_STORAGE_WAKEUP + + return ( + VfrReturnCode.VFR_RETURN_SUCCESS + if LFlags =3D=3D 0 + else VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED + ) + + +class IfrTime(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.Time =3D EFI_IFR_TIME() + IfrBaseInfo.__init__(self, self.Time, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Time.Header, EFI_IFR_TIME_OP) + IfrQuestionHeader.__init__(self, self.Time.Question) + self.Time.Flags =3D 0 + + self.Hour =3D None + self.Minute =3D None + self.Second =3D None + + self.D_Hour =3D None + self.D_Minute =3D None + self.D_Second =3D None + + self.Step =3D None + self.Min =3D None + self.Max =3D None + + def SetHour(self, Hour): + self.Hour =3D Hour + + def SetMinute(self, Minute): + self.Minute =3D Minute + + def SetSecond(self, Second): + self.Second =3D Second + + def SetFlags(self, HFlags, LFlags): + ReturnCode =3D IfrQuestionHeader.SetFlags(self, HFlags) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_HOUR_SUPPRESS= ) + if Ret: + self.Time.Flags |=3D QF_TIME_HOUR_SUPPRESS + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_MINUTE_SUPPRE= SS) + if Ret: + self.Time.Flags |=3D QF_TIME_MINUTE_SUPPRESS + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_SECOND_SUPPRE= SS) + if Ret: + self.Time.Flags |=3D QF_TIME_SECOND_SUPPRESS + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_STORAGE_NORMA= L) + if Ret: + self.Time.Flags |=3D QF_TIME_STORAGE_NORMAL + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_STORAGE_TIME) + if Ret: + self.Time.Flags |=3D QF_TIME_STORAGE_TIME + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_STORAGE_WAKEU= P) + if Ret: + self.Time.Flags |=3D QF_TIME_STORAGE_WAKEUP + + return ( + VfrReturnCode.VFR_RETURN_SUCCESS + if LFlags =3D=3D 0 + else VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED + ) + + +class IfrNumeric(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader, Ifr= MinMaxStepData): + def __init__(self, Type, QName=3DNone, VarIdStr=3D""): + self.Numeric =3D Refine_EFI_IFR_NUMERIC(Type) + IfrBaseInfo.__init__(self, self.Numeric, QName, VarIdStr) + IfrOpHeader.__init__(self, self.Numeric.Header, EFI_IFR_NUMERIC_OP= , sizeof(self.Numeric)) + IfrQuestionHeader.__init__(self, self.Numeric.Question) + IfrMinMaxStepData.__init__(self, self.Numeric.Data, True) + self.Numeric.Flags =3D EFI_IFR_NUMERIC_SIZE_1 | EFI_IFR_DISPLAY_UI= NT_DEC + + self.HasStep =3D False + + def GetQuestion(self): + return self + + def GetMinMaxData(self): + return self + + def SetQHeaderFlags(self, Flags): + IfrQuestionHeader.SetFlags(self, Flags) + + def SetFlags(self, HFlags, LFlags, DisplaySettingsSpecified=3DFalse): + ReturnCode =3D IfrQuestionHeader.SetFlags(self, HFlags) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + if DisplaySettingsSpecified =3D=3D False: + self.Numeric.Flags =3D LFlags | EFI_IFR_DISPLAY_UINT_DEC + else: + self.Numeric.Flags =3D LFlags + return VfrReturnCode.VFR_RETURN_SUCCESS + + def SetFlagsForBitField(self, HFlags, LFlags, DisplaySettingsSpecified= =3DFalse): + ReturnCode =3D IfrQuestionHeader.SetFlags(self, HFlags) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + if DisplaySettingsSpecified =3D=3D False: + self.Numeric.Flags =3D LFlags | EDKII_IFR_DISPLAY_UINT_DEC_BIT + else: + self.Numeric.Flags =3D LFlags + return VfrReturnCode.VFR_RETURN_SUCCESS + + def GetNumericFlags(self): + return self.Numeric.Flags + + def SetHasStep(self, HasStep): + self.HasStep =3D HasStep + + +class IfrOneOf(IfrQuestionHeader, IfrLine, IfrBaseInfo, IfrOpHeader, IfrMi= nMaxStepData): + def __init__(self, Type, QName=3DNone, VarIdStr=3D""): + self.OneOf =3D Refine_EFI_IFR_ONE_OF(Type) + IfrBaseInfo.__init__(self, self.OneOf, QName, VarIdStr) + IfrOpHeader.__init__(self, self.OneOf.Header, EFI_IFR_ONE_OF_OP, s= izeof(self.OneOf)) + IfrQuestionHeader.__init__(self, self.OneOf.Question) + IfrMinMaxStepData.__init__(self, self.OneOf.Data) + self.OneOf.Flags =3D 0 + + self.HasMinMax =3D False + + self.HasStep =3D False + + def GetQuestion(self): + return self + + def GetMinMaxData(self): + return self + + def SetQHeaderFlags(self, Flags): + IfrQuestionHeader.SetFlags(self, Flags) + + def SetFlags(self, HFlags, LFlags): + ReturnCode =3D IfrQuestionHeader.SetFlags(self, HFlags) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + if LFlags & EFI_IFR_DISPLAY: + self.OneOf.Flags =3D LFlags + else: + self.OneOf.Flags =3D LFlags | EFI_IFR_DISPLAY_UINT_DEC + return VfrReturnCode.VFR_RETURN_SUCCESS + + def SetFlagsForBitField(self, HFlags, LFlags): + ReturnCode =3D IfrQuestionHeader.SetFlags(self, HFlags) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + if LFlags & EDKII_IFR_DISPLAY_BIT: + self.OneOf.Flags =3D LFlags + else: + self.OneOf.Flags =3D LFlags | EDKII_IFR_DISPLAY_UINT_DEC_BIT + return VfrReturnCode.VFR_RETURN_SUCCESS + + def SetHasMinMax(self, HasMinMax): + self.HasMinMax =3D HasMinMax + + def SetHasStep(self, HasStep): + self.HasStep =3D HasStep + + +class IfrCheckBox(IfrLine, IfrBaseInfo, IfrOpHeader, IfrQuestionHeader): + def __init__(self, QName=3DNone, VarIdStr=3D""): + self.CheckBox =3D EFI_IFR_CHECKBOX() + IfrBaseInfo.__init__(self, self.CheckBox, QName, VarIdStr) + IfrOpHeader.__init__(self, self.CheckBox.Header, EFI_IFR_CHECKBOX_= OP) + IfrQuestionHeader.__init__(self, self.CheckBox.Question) + self.CheckBox.Flags =3D 0 + + def GetQuestion(self): + return self + + def SetQHeaderFlags(self, Flags): + IfrQuestionHeader.SetFlags(self, Flags) + + def GetFlags(self): + return self.CheckBox.Flags + + def SetFlags(self, HFlags, LFlags): + ReturnCode =3D IfrQuestionHeader.SetFlags(self, HFlags) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_CHECKBOX_DEFA= ULT) + if Ret: + self.CheckBox.Flags |=3D EFI_IFR_CHECKBOX_DEFAULT + + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_CHECKBOX_DEFA= ULT_MFG) + + if Ret: + self.CheckBox.Flags |=3D EFI_IFR_CHECKBOX_DEFAULT_MFG + + return ( + VfrReturnCode.VFR_RETURN_SUCCESS + if LFlags =3D=3D 0 + else VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED + ) + + +class IfrResetButton(IfrLine, IfrOpHeader, IfrStatementHeader): + def __init__(self, DefaultStore=3DNone): + self.ResetButton =3D EFI_IFR_RESET_BUTTON() + IfrOpHeader.__init__(self, self.ResetButton.Header, EFI_IFR_RESET_= BUTTON_OP) + IfrStatementHeader.__init__(self, self.ResetButton.Statement) + self.ResetButton.DefaultId =3D EFI_HII_DEFAULT_CLASS_STANDARD + + self.DefaultStore =3D DefaultStore + + def SetDefaultId(self, DefaultId): + self.ResetButton.DefaultId =3D DefaultId + + def SetDefaultStore(self, DefaultStore): + self.DefaultStore =3D DefaultStore + + def GetInfo(self): + return self.ResetButton + + +class IfrOr(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Or =3D EFI_IFR_OR() + IfrOpHeader.__init__(self, self.Or.Header, EFI_IFR_OR_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Or + + +class IfrAnd(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.And =3D EFI_IFR_AND() + IfrOpHeader.__init__(self, self.And.Header, EFI_IFR_AND_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.And + + +class IfrBitWiseOr(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.BitWiseOr =3D EFI_IFR_BITWISE_OR() + IfrOpHeader.__init__(self, self.BitWiseOr.Header, EFI_IFR_BITWISE_= OR_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.BitWiseOr + + +class IfrCatenate(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Catenate =3D EFI_IFR_CATENATE() + IfrOpHeader.__init__(self, self.Catenate.Header, EFI_IFR_CATENATE_= OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Catenate + + +class IfrDivide(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Divide =3D EFI_IFR_DIVIDE() + IfrOpHeader.__init__(self, self.Divide.Header, EFI_IFR_DIVIDE_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Divide + + +class IfrEqual(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Equal =3D EFI_IFR_EQUAL() + IfrOpHeader.__init__(self, self.Equal.Header, EFI_IFR_EQUAL_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Equal + + +class IfrGreaterEqual(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.GreaterEqual =3D EFI_IFR_GREATER_EQUAL() + IfrOpHeader.__init__(self, self.GreaterEqual.Header, EFI_IFR_GREAT= ER_EQUAL_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.GreaterEqual + + +class IfrGreaterThan(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.GreaterThan =3D EFI_IFR_GREATER_THAN() + IfrOpHeader.__init__(self, self.GreaterThan.Header, EFI_IFR_GREATE= R_THAN_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.GreaterThan + + +class IfrLessEqual(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.LessEqual =3D EFI_IFR_LESS_EQUAL() + IfrOpHeader.__init__(self, self.LessEqual.Header, EFI_IFR_LESS_EQU= AL_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.LessEqual + + +class IfrLessThan(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.LessThan =3D EFI_IFR_LESS_THAN() + IfrOpHeader.__init__(self, self.LessThan.Header, EFI_IFR_LESS_THAN= _OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.LessThan + + +class IfrMap(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Map =3D EFI_IFR_MAP() + IfrOpHeader.__init__(self, self.Map.Header, EFI_IFR_MAP_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Map + + +class IfrMatch(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Match =3D EFI_IFR_MATCH() + IfrOpHeader.__init__(self, self.Match.Header, EFI_IFR_MATCH_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Match + + +class IfrMatch2(IfrLine, IfrOpHeader): + def __init__(self, LineNo, Guid): + self.Match2 =3D EFI_IFR_MATCH2() + IfrOpHeader.__init__(self, self.Match2.Header, EFI_IFR_MATCH2_OP) + self.SetLineNo(LineNo) + self.Match2.SyntaxType =3D Guid + + def GetInfo(self): + return self.Match2 + + +class IfrMultiply(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Multiply =3D EFI_IFR_MULTIPLY() + IfrOpHeader.__init__(self, self.Multiply.Header, EFI_IFR_MULTIPLY_= OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Multiply + + +class IfrModulo(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Modulo =3D EFI_IFR_MODULO() + IfrOpHeader.__init__(self, self.Modulo.Header, EFI_IFR_MODULO_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Modulo + + +class IfrNotEqual(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.NotEqual =3D EFI_IFR_NOT_EQUAL() + IfrOpHeader.__init__(self, self.NotEqual.Header, EFI_IFR_NOT_EQUAL= _OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.NotEqual + + +class IfrShiftLeft(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.ShiftLeft =3D EFI_IFR_SHIFT_LEFT() + IfrOpHeader.__init__(self, self.ShiftLeft.Header, EFI_IFR_SHIFT_LE= FT_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.ShiftLeft + + +class IfrShiftRight(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.ShiftRight =3D EFI_IFR_SHIFT_RIGHT() + IfrOpHeader.__init__(self, self.ShiftRight.Header, EFI_IFR_SHIFT_R= IGHT_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.ShiftRight + + +class IfrSubtract(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Subtract =3D EFI_IFR_SUBTRACT() + IfrOpHeader.__init__(self, self.Subtract.Header, EFI_IFR_SUBTRACT_= OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Subtract + + +class IfrConditional(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Conditional =3D EFI_IFR_CONDITIONAL() + IfrOpHeader.__init__(self, self.Conditional.Header, EFI_IFR_CONDIT= IONAL_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Conditional + + +class IfrFind(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Find =3D EFI_IFR_FIND() + IfrOpHeader.__init__(self, self.Find.Header, EFI_IFR_FIND_OP) + self.SetLineNo(LineNo) + + def SetFormat(self, Format): + self.Find.Format =3D Format + + def GetInfo(self): + return self.Find + + +class IfrMid(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Mid =3D EFI_IFR_MID() + IfrOpHeader.__init__(self, self.Mid.Header, EFI_IFR_MID_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Mid + + +class IfrToken(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Token =3D EFI_IFR_TOKEN() + IfrOpHeader.__init__(self, self.Token.Header, EFI_IFR_TOKEN_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Token + + +class IfrSpan(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Span =3D EFI_IFR_SPAN() + IfrOpHeader.__init__(self, self.Span.Header, EFI_IFR_SPAN_OP) + self.SetLineNo(LineNo) + self.Span.Flags =3D EFI_IFR_FLAGS_FIRST_MATCHING + + def SetFlags(self, LFlags): + if LFlags =3D=3D EFI_IFR_FLAGS_FIRST_MATCHING: + self.Span.Flags |=3D EFI_IFR_FLAGS_FIRST_MATCHING + else: + LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_FLAGS_FIR= ST_NON_MATCHING) + if Ret: + self.Span.Flags |=3D EFI_IFR_FLAGS_FIRST_NON_MATCHING + + return ( + VfrReturnCode.VFR_RETURN_SUCCESS + if LFlags =3D=3D 0 + else VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED + ) + + def GetInfo(self): + return self.Span + + +class IfrBitWiseAnd(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.BitWiseAnd =3D EFI_IFR_BITWISE_AND() + IfrOpHeader.__init__(self, self.BitWiseAnd.Header, EFI_IFR_BITWISE= _AND_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.BitWiseAnd + + +class IfrAdd(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Add =3D EFI_IFR_ADD() + IfrOpHeader.__init__(self, self.Add.Header, EFI_IFR_ADD_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Add + + +class IfrToString(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.ToString =3D EFI_IFR_TO_STRING() + IfrOpHeader.__init__(self, self.ToString.Header, EFI_IFR_TO_STRING= _OP) + self.SetLineNo(LineNo) + + def SetFormat(self, Format): + self.ToString.Format =3D Format + + def GetInfo(self): + return self.ToString + + +class IfrToUpper(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.ToUppper =3D EFI_IFR_TO_UPPER() + IfrOpHeader.__init__(self, self.ToUppper.Header, EFI_IFR_TO_UPPER_= OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.ToUppper + + +class IfrToUint(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.ToUint =3D EFI_IFR_TO_UINT() + IfrOpHeader.__init__(self, self.ToUint.Header, EFI_IFR_TO_UINT_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.ToUint + + +class IfrToLower(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.ToLower =3D EFI_IFR_TO_LOWER() + IfrOpHeader.__init__(self, self.ToLower.Header, EFI_IFR_TO_LOWER_O= P) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.ToLower + + +class IfrToBoolean(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Boolean =3D EFI_IFR_TO_BOOLEAN() + IfrOpHeader.__init__(self, self.Boolean.Header, EFI_IFR_TO_BOOLEAN= _OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Boolean + + +class IfrNot(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Not =3D EFI_IFR_NOT() + IfrOpHeader.__init__(self, self.Not.Header, EFI_IFR_NOT_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Not + + +class IfrDup(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Dup =3D EFI_IFR_DUP() + IfrOpHeader.__init__(self, self.Dup.Header, EFI_IFR_DUP_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.Dup.Header + + def GetInfo(self): + return self.Dup + + +class IfrEqIdId(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.EqIdId =3D EFI_IFR_EQ_ID_ID() + IfrOpHeader.__init__(self, self.EqIdId.Header, EFI_IFR_EQ_ID_ID_OP= ) + self.SetLineNo(LineNo) + self.EqIdId.QuestionId1 =3D EFI_QUESTION_ID_INVALID + self.EqIdId.QuestionId2 =3D EFI_QUESTION_ID_INVALID + + def GetHeader(self): + return self.EqIdId.Header + + def SetQuestionId1(self, QuestionId, VarIdStr, LineNo): + if QuestionId !=3D EFI_QUESTION_ID_INVALID: + self.EqIdId.QuestionId1 =3D QuestionId + else: + gFormPkg.AssignPending(VarIdStr, self.EqIdId, LineNo, "no ques= tion refered", 1) + + def SetQuestionId2(self, QuestionId, VarIdStr, LineNo): + if QuestionId !=3D EFI_QUESTION_ID_INVALID: + self.EqIdId.QuestionId2 =3D QuestionId + else: + gFormPkg.AssignPending(VarIdStr, self.EqIdId, LineNo, "no ques= tion refered", 2) + + def GetInfo(self): + return self.EqIdId + + +class IfrEqIdVal(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.EqIdVal =3D EFI_IFR_EQ_ID_VAL() + IfrOpHeader.__init__(self, self.EqIdVal.Header, EFI_IFR_EQ_ID_VAL_= OP) + self.SetLineNo(LineNo) + self.EqIdVal.QuestionId =3D EFI_QUESTION_ID_INVALID + + def SetQuestionId(self, QuestionId, VarIdStr, LineNo): + if QuestionId !=3D EFI_QUESTION_ID_INVALID: + self.EqIdVal.QuestionId =3D QuestionId + else: + gFormPkg.AssignPending(VarIdStr, self.EqIdVal, LineNo, "no que= stion refered") + + def SetValue(self, Value): + self.EqIdVal.Value =3D Value + + def GetHeader(self): + return self.EqIdVal.Header + + def GetInfo(self): + return self.EqIdVal + + +class IfrEqIdList(IfrLine, IfrOpHeader): + def __init__(self, LineNo, Nums, ValueList=3DNone): + self.EqIdVList =3D Refine_EFI_IFR_EQ_ID_VAL_LIST(Nums) + IfrOpHeader.__init__( + self, self.EqIdVList.Header, EFI_IFR_EQ_ID_VAL_LIST_OP, sizeof= (self.EqIdVList) + ) + self.SetLineNo(LineNo) + self.EqIdVList.QuestionId =3D EFI_QUESTION_ID_INVALID + self.EqIdVList.ListLength =3D 0 + if ValueList is not None and ValueList !=3D []: + ArrayType =3D c_uint16 * Nums + ValueArray =3D ArrayType() + for i in range(0, len(ValueList)): + ValueArray[i] =3D ValueList[i] + self.EqIdVList.ValueList =3D ValueArray + + def SetQuestionId(self, QuestionId, VarIdStr, LineNo): + if QuestionId !=3D EFI_QUESTION_ID_INVALID: + self.EqIdVList.QuestionId =3D QuestionId + else: + gFormPkg.AssignPending(VarIdStr, self.EqIdVList, LineNo, "no q= uestion refered") + + def SetListLength(self, ListLength): + self.EqIdVList.ListLength =3D ListLength + + def SetValueList(self, ValueList): + if ValueList !=3D []: + ArrayType =3D c_uint16 * len(ValueList) + ValueArray =3D ArrayType() + for i in range(0, len(ValueList)): + ValueArray[i] =3D ValueList[i] + self.EqIdVList.ValueList =3D ValueArray + + def GetHeader(self): + return self.EqIdVList.Header + + def GetInfo(self): + return self.EqIdVList + + +class IfrUint8(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Uint8 =3D EFI_IFR_UINT8() + IfrOpHeader.__init__(self, self.Uint8.Header, EFI_IFR_UINT8_OP) + self.SetLineNo(LineNo) + + def SetValue(self, Value): + self.Uint8.Value =3D Value + + def GetHeader(self): + return self.Uint8.Header + + def GetInfo(self): + return self.Uint8 + + +class IfrUint16(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Uint16 =3D EFI_IFR_UINT16() + IfrOpHeader.__init__(self, self.Uint16.Header, EFI_IFR_UINT16_OP) + self.SetLineNo(LineNo) + + def SetValue(self, Value): + self.Uint16.Value =3D Value + + def GetHeader(self): + return self.Uint16.Header + + def GetInfo(self): + return self.Uint16 + + +class IfrUint32(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Uint32 =3D EFI_IFR_UINT32() + IfrOpHeader.__init__(self, self.Uint32.Header, EFI_IFR_UINT32_OP) + self.SetLineNo(LineNo) + + def SetValue(self, Value): + self.Uint32.Value =3D Value + + def GetHeader(self): + return self.Uint32.Header + + def GetInfo(self): + return self.Uint32 + + +class IfrUint64(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Uint64 =3D EFI_IFR_UINT64() + IfrOpHeader.__init__(self, self.Uint64.Header, EFI_IFR_UINT64_OP, = sizeof(EFI_IFR_UINT64)) + self.SetLineNo(LineNo) + + def SetValue(self, Value): + self.Uint64.Value =3D Value + + def GetHeader(self): + return self.Uint64.Header + + def GetInfo(self): + return self.Uint64 + + +class IfrQuestionRef1(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.QuestionRef1 =3D EFI_IFR_QUESTION_REF1() + IfrOpHeader.__init__(self, self.QuestionRef1.Header, EFI_IFR_QUEST= ION_REF1_OP) + self.SetLineNo(LineNo) + self.QuestionRef1.QuestionId =3D EFI_QUESTION_ID_INVALID + + def GetHeader(self): + return self.QuestionRef1.Header + + def SetQuestionId(self, QuestionId, VarIdStr, LineNo): + if QuestionId !=3D EFI_QUESTION_ID_INVALID: + self.QuestionRef1.QuestionId =3D QuestionId + else: + gFormPkg.AssignPending(VarIdStr, self.QuestionRef1, LineNo, "n= o question refered") + + def GetInfo(self): + return self.QuestionRef1 + + +class IfrQuestionRef2(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.QuestionRef2 =3D EFI_IFR_QUESTION_REF2() + IfrOpHeader.__init__(self, self.QuestionRef2.Header, EFI_IFR_QUEST= ION_REF2_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.QuestionRef2.Header + + def GetInfo(self): + return self.QuestionRef2 + + +class IfrQuestionRef3(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.QuestionRef3 =3D EFI_IFR_QUESTION_REF3() + IfrOpHeader.__init__( + self, self.QuestionRef3.Header, EFI_IFR_QUESTION_REF3_OP, size= of(EFI_IFR_QUESTION_REF3) + ) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.QuestionRef3.Header + + def GetInfo(self): + return self.QuestionRef3 + + +class IfrQuestionRef3_2(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.QuestionRef3_2 =3D EFI_IFR_QUESTION_REF3_2() + IfrOpHeader.__init__( + self, + self.QuestionRef3_2.Header, + EFI_IFR_QUESTION_REF3_OP, + sizeof(EFI_IFR_QUESTION_REF3_2), + ) + self.SetLineNo(LineNo) + self.QuestionRef3_2.DevicePath =3D EFI_STRING_ID_INVALID + + def SetDevicePath(self, DevicePath): + self.QuestionRef3_2.DevicePath =3D DevicePath + + def GetHeader(self): + return self.QuestionRef3_2.Header + + def GetInfo(self): + return self.QuestionRef3_2 + + +class IfrQuestionRef3_3(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.QuestionRef3_3 =3D EFI_IFR_QUESTION_REF3_3() + IfrOpHeader.__init__( + self, + self.QuestionRef3_3.Header, + EFI_IFR_QUESTION_REF3_OP, + sizeof(EFI_IFR_QUESTION_REF3_3), + ) + self.SetLineNo(LineNo) + self.QuestionRef3_3.DevicePath =3D EFI_STRING_ID_INVALID + self.QuestionRef3_3.Guid =3D EFI_GUID(0, 0, 0, GuidArray(0, 0, 0, = 0, 0, 0, 0, 0)) + + def SetDevicePath(self, DevicePath): + self.QuestionRef3_3.DevicePath =3D DevicePath + + def SetGuid(self, Guid): + self.QuestionRef3_3.Guid =3D Guid + + def GetHeader(self): + return self.QuestionRef3_3.Header + + def GetInfo(self): + return self.QuestionRef3_3 + + +class IfrRuleRef(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.RuleRef =3D EFI_IFR_RULE_REF() + IfrOpHeader.__init__(self, self.RuleRef.Header, EFI_IFR_RULE_REF_O= P) + self.SetLineNo(LineNo) + self.RuleRef.RuleId =3D EFI_RULE_ID_INVALID + + def SetRuleId(self, RuleId): + self.RuleRef.RuleId =3D RuleId + + def GetHeader(self): + return self.RuleRef.Header + + def GetInfo(self): + return self.RuleRef + + +class IfrStringRef1(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.StringRef1 =3D EFI_IFR_STRING_REF1() + IfrOpHeader.__init__(self, self.StringRef1.Header, EFI_IFR_STRING_= REF1_OP) + self.SetLineNo(LineNo) + self.StringRef1.StringId =3D EFI_STRING_ID_INVALID + + def SetStringId(self, StringId): + self.StringRef1.StringId =3D StringId + + def GetHeader(self): + return self.StringRef1.Header + + def GetInfo(self): + return self.StringRef1 + + +class IfrStringRef2(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.StringRef2 =3D EFI_IFR_STRING_REF2() + IfrOpHeader.__init__(self, self.StringRef2.Header, EFI_IFR_STRING_= REF2_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.StringRef2.Header + + def GetInfo(self): + return self.StringRef2 + + +class IfrThis(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.This =3D EFI_IFR_THIS() + IfrOpHeader.__init__(self, self.This.Header, EFI_IFR_THIS_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.This.Header + + def GetInfo(self): + return self.This + + +class IfrSecurity(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Security =3D EFI_IFR_SECURITY() + IfrOpHeader.__init__(self, self.Security.Header, EFI_IFR_SECURITY_= OP) + self.SetLineNo(LineNo) + self.Security.Permissions =3D EFI_GUID(0, 0, 0, GuidArray(0, 0, 0,= 0, 0, 0, 0, 0)) + + def SetPermissions(self, Permissions): + self.Security.Permissions =3D Permissions + + def GetHeader(self): + return self.Security.Header + + def GetInfo(self): + return self.Security + + +class IfrGet(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Get =3D EFI_IFR_GET() + IfrOpHeader.__init__(self, self.Get.Header, EFI_IFR_GET_OP) + self.SetLineNo(LineNo) + + def SetVarInfo(self, BaseInfo: EFI_VARSTORE_INFO): + self.Get.VarStoreId =3D BaseInfo.VarStoreId + self.Get.VarStoreInfo.VarName =3D BaseInfo.Info.VarName + self.Get.VarStoreInfo.VarOffset =3D BaseInfo.Info.VarOffset + self.Get.VarStoreType =3D BaseInfo.VarType + + def GetHeader(self): + return self.Get.Header + + def GetInfo(self): + return self.Get + + +class IfrSet(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Set =3D EFI_IFR_SET() + IfrOpHeader.__init__(self, self.Set.Header, EFI_IFR_SET_OP) + self.SetLineNo(LineNo) + + def SetVarInfo(self, BaseInfo: EFI_VARSTORE_INFO): + self.Set.VarStoreId =3D BaseInfo.VarStoreId + self.Set.VarStoreInfo.VarName =3D BaseInfo.Info.VarName + self.Set.VarStoreInfo.VarOffset =3D BaseInfo.Info.VarOffset + self.Set.VarStoreType =3D BaseInfo.VarType + + def GetHeader(self): + return self.Set.Header + + def GetInfo(self): + return self.Set + + +class IfrTrue(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.TrueOp =3D EFI_IFR_TRUE() + IfrOpHeader.__init__(self, self.TrueOp.Header, EFI_IFR_TRUE_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.TrueOp.Header + + def GetInfo(self): + return self.TrueOp + + +class IfrFalse(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.FalseOp =3D EFI_IFR_TRUE() + IfrOpHeader.__init__(self, self.FalseOp.Header, EFI_IFR_FALSE_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.FalseOp.Header + + def GetInfo(self): + return self.FalseOp + + +class IfrOne(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.One =3D EFI_IFR_ONE() + IfrOpHeader.__init__(self, self.One.Header, EFI_IFR_ONE_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.One.Header + + def GetInfo(self): + return self.One + + +class IfrOnes(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Ones =3D EFI_IFR_ONE() + IfrOpHeader.__init__(self, self.Ones.Header, EFI_IFR_ONES_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.Ones.Header + + def GetInfo(self): + return self.Ones + + +class IfrZero(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Zero =3D EFI_IFR_ZERO() + IfrOpHeader.__init__(self, self.Zero.Header, EFI_IFR_ZERO_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.Zero.Header + + def GetInfo(self): + return self.Zero + + +class IfrUndefined(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Undefined =3D EFI_IFR_ZERO() + IfrOpHeader.__init__(self, self.Undefined.Header, EFI_IFR_UNDEFINE= D_OP) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.Undefined.Header + + def GetInfo(self): + return self.Undefined + + +class IfrVersion(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Version =3D EFI_IFR_VERSION() + IfrOpHeader.__init__(self, self.Version.Header, EFI_IFR_VERSION_OP= ) + self.SetLineNo(LineNo) + + def GetHeader(self): + return self.Version.Header + + def GetInfo(self): + return self.Version + + +class IfrLength(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.Length =3D EFI_IFR_LENGTH() + IfrOpHeader.__init__(self, self.Length.Header, EFI_IFR_LENGTH_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.Length + + +class IfrBitWiseNot(IfrLine, IfrOpHeader): + def __init__(self, LineNo): + self.BitWiseNot =3D EFI_IFR_BITWISE_NOT() + IfrOpHeader.__init__(self, self.BitWiseNot.Header, EFI_IFR_BITWISE= _NOT_OP) + self.SetLineNo(LineNo) + + def GetInfo(self): + return self.BitWiseNot + + +class ExpressionInfo: + def __init__(self): + self.RootLevel =3D 0 + self.ExpOpCount =3D 0 diff --git a/BaseTools/Source/Python/VfrCompiler/IfrPreProcess.py b/BaseToo= ls/Source/Python/VfrCompiler/IfrPreProcess.py new file mode 100644 index 0000000000..ed454cdcf3 --- /dev/null +++ b/BaseTools/Source/Python/VfrCompiler/IfrPreProcess.py @@ -0,0 +1,245 @@ +## @file +# The file is used to preprocess the source file. +# +# Copyright (c) 2022-, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +import re +import Common.EdkLogger as EdkLogger +from antlr4 import * +from pathlib import Path +from Common.BuildToolError import * +from VfrCompiler.IfrCtypes import EFI_GUID +from VfrCompiler.IfrUtility import VfrVarDataTypeDB +from Common.LongFilePathSupport import LongFilePath +from VfrCompiler.IfrCommon import GUID_BUFFER_VALUE_LEN + + +class Options: + def __init__(self): + # open/close VfrCompiler + self.LanuchVfrCompiler =3D False + self.ModuleName =3D None + self.Workspace =3D None + self.VFRPP =3D None + self.InputFileName =3D None + self.BaseFileName =3D None + self.IncludePaths =3D [] + self.OutputDirectory =3D None + self.DebugDirectory =3D None + self.CreateRecordListFile =3D True + self.RecordListFileName =3D None + self.CreateIfrPkgFile =3D True + self.PkgOutputFileName =3D None + self.COutputFileName =3D None + self.SkipCPreprocessor =3D True + self.CPreprocessorOptions =3D None + self.CProcessedVfrFileName =3D None + self.HasOverrideClassGuid =3D False + self.OverrideClassGuid =3D None + self.WarningAsError =3D False + self.AutoDefault =3D False + self.CheckDefault =3D False + self.CreateYamlFile =3D True + self.YamlFileName =3D None + self.CreateJsonFile =3D True + self.JsonFileName =3D None + self.UniStrDefFileName =3D None + self.YamlOutputFileName =3D None + self.UniStrDisplayFile =3D None + + +class KV: + def __init__(self, Key, Value) -> None: + self.Key =3D Key + self.Value =3D Value + + +class ValueDB: + def __init__(self, PreVal, PostVal) -> None: + self.PreVal =3D PreVal + self.PostVal =3D PostVal + + +class PreProcessDB: + def __init__(self, Options: Options) -> None: + self.Options =3D Options + self.VfrVarDataTypeDB =3D VfrVarDataTypeDB() + self.Preprocessed =3D False + + def Preprocess(self): + self.HeaderFiles =3D self._ExtractHeaderFiles() + # Read Uni string token/id definitions in StrDef.h file + self.UniDict =3D self._GetUniDicts() + # Read definitions in vfr file + self.VfrDict =3D self._GetVfrDicts() + self.Preprocessed =3D True + + def TransValue(self, Value): + if type(Value) =3D=3D EFI_GUID: + return Value + else: + StrValue =3D str(Value) + if self._IsDigit(StrValue): + return self._ToDigit(StrValue) + else: + GuidList =3D re.findall(r"0x[0-9a-fA-F]+", StrValue) + GuidList =3D [int(num, 16) for num in GuidList] + Guid =3D EFI_GUID() + Guid.from_list(GuidList) + return Guid + + def RevertValue(self, Value) -> str: + if type(Value) =3D=3D EFI_GUID: + return Value.to_string() + elif ("0x" in Value) or ("0X" in Value): + StrValue =3D hex(Value) + else: + StrValue =3D str(Value) + return StrValue + + def DisplayValue(self, Value, Flag=3DFalse): + if type(Value) =3D=3D EFI_GUID: + return Value.to_string() + StrValue =3D str(Value) + if self._IsDigit(StrValue): + if Flag: + return f"STRING_TOKEN({StrValue})" + return int(StrValue, 0) + return StrValue + + def GetKey(self, Value): + if type(Value) =3D=3D EFI_GUID: + Value =3D Value.to_string() + if Value in self.UniDict: + return self.UniDict[Value] + if Value in self.VfrDict: + return self.VfrDict[Value] + else: + Value =3D "0x%04x" % Value + Value =3D Value[:2] + Value[2:].upper() + if Value in self.UniDict: + return self.UniDict[Value] + return Value + + def _ExtractHeaderFiles(self): + FileName =3D self.Options.InputFileName + HeaderFiles =3D [] + try: + with open(LongFilePath(FileName), mode=3D"r") as fFile: + lines =3D fFile.readlines() + for line in lines: + if "#include" in line: + if line.find("<") !=3D -1: + HeaderFile =3D line[line.find("<") + 1 : line.find= (">")] + HeaderFiles.append(HeaderFile) + elif line.find('"') !=3D -1: + l =3D line.find('"') + 1 + r =3D l + line[l:].find('"') + HeaderFile =3D line[l:r] + HeaderFiles.append(HeaderFile) + except Exception: + EdkLogger.error( + "VfrCompiler", FILE_PARSE_FAILURE, "File parse failed for = %s" % FileName, None + ) + return HeaderFiles + + def _GetUniDicts(self): + if self.Options.UniStrDefFileName is None: + self.Options.UniStrDefFileName =3D str( + Path(self.Options.DebugDirectory) / f"{self.Options.Module= Name}StrDefs.h" + ) + # find UniFile + FileName =3D self.Options.UniStrDefFileName + UniDict =3D {} + self._ParseDefines(FileName, UniDict) + return UniDict + + def _GetVfrDicts(self): + VfrDict =3D {} + if self.Options.LanuchVfrCompiler: + FileName =3D self.Options.InputFileName + self._ParseDefines(FileName, VfrDict, True) + return VfrDict + + def _IsDigit(self, String): + return String.isdigit() or ( + String.startswith(("0x", "0X")) + and all(char in "0123456789ABCDEFabcdef" for char in String[2:= ]) + ) + + def _ToDigit(self, String): + if String.startswith(("0x", "0X")): + return int(String, 16) + return int(String) + + def _ParseDefines(self, FileName, Dict, IsVfrDef=3DFalse): + Pattern =3D r"#define\s+(\w+)\s+(.*?)(?:(?= GUID Defined Key. + if IsVfrDef: + # Save def info for yaml generation + Dict[SubKey] =3D SubValue + # tranfer value to key for yaml generation + if type(SubValue) =3D=3D EFI_GUID: + Dict[SubValue.to_string()] =3D SubKey + else: + SubValue =3D ( + str(SubValue) + if type(SubValue) !=3D EFI_GUID + else SubValue.to_string() + ) + Dict[SubValue] =3D SubKey + else: + if Value.find("//") !=3D -1: + Value =3D Value.split("//")[0].strip() + if Value.find("{") !=3D -1: + GuidList =3D re.findall(r"0x[0-9a-fA-F]+", Value) + GuidList =3D [int(num, 16) for num in GuidList] + Value =3D EFI_GUID() + if len(GuidList) =3D=3D GUID_BUFFER_VALUE_LEN: + Value.from_list(GuidList) + + if self.Options.LanuchVfrCompiler: + # GUID is unique, to transfer GUID Parsed Value -> GUI= D Defined Key. + if IsVfrDef: + Dict[Key] =3D Value + if type(Value) =3D=3D EFI_GUID: + Dict[Value.to_string()] =3D Key + else: + Value =3D str(Value) if type(Value) !=3D EFI_GUID = else Value.to_string() + Dict[Value] =3D Key + + def _FindIncludeHeaderFile(self, IncludePaths, File): + FileList =3D [] + Name =3D File.split("/")[-1] + for Start in IncludePaths: + Matches =3D list(Path(Start).rglob(Name)) + for MatchFile in Matches: + FileList.append(str(MatchFile)) + return list(set(FileList)) diff --git a/BaseTools/Source/Python/VfrCompiler/IfrTree.py b/BaseTools/Sou= rce/Python/VfrCompiler/IfrTree.py new file mode 100644 index 0000000000..faa2e4677d --- /dev/null +++ b/BaseTools/Source/Python/VfrCompiler/IfrTree.py @@ -0,0 +1,1132 @@ +## @file +# The file is used to define vfr tree structure and related operations. +# +# Copyright (c) 2022-, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +import Common.EdkLogger as EdkLogger +from Common.BuildToolError import * +from VfrCompiler.IfrCtypes import * +from VfrCompiler.IfrFormPkg import * +from VfrCompiler.IfrUtility import gVfrBufferConfig +from VfrCompiler.IfrPreProcess import PreProcessDB, Options + + +VFR_COMPILER_VERSION =3D "2.01 (UEFI 2.4)" +BUILD_VERSION =3D "Developer Build based on Revision: Unknown" +BYTES_PRE_LINE =3D 0x10 + + +# Ifr related Info -> ctypes obj +# conditional Info +# Structure Info +class IfrTreeNode: + def __init__(self, OpCode=3DNone, Data=3DNone, Buffer=3DNone, Position= =3DNone): + self.OpCode =3D OpCode + self.Data =3D Data + self.Buffer =3D Buffer + self.Position =3D Position + self.Condition =3D None + self.Expression =3D None + self.Dict =3D {} + self.Offset =3D None + self.Parent =3D None + self.Child =3D [] + self.Level =3D -1 + + def hasCondition(self): + return self.Condition + + def hasChild(self): + return self.Child =3D=3D [] + + def isFinalChild(self): + ParTree =3D self.Parent + if ParTree and ParTree.Child[-1] =3D=3D self: + return True + return False + + def insertChild(self, NewNode, pos: int =3D None): + if NewNode is not None: + if not pos: + self.Child.append(NewNode) + else: + self.Child.insert(pos, NewNode) + + NewNode.Parent =3D self + + def insertRel(self, newNode): + if self.Parent: + parentTree =3D self.Parent + new_index =3D parentTree.Child.index(self) + 1 + parentTree.Child.insert(new_index, newNode) + self.NextRel =3D newNode + newNode.LastRel =3D self + + def deleteNode(self, deletekey: str): + FindStatus, DeleteTree =3D self.FindNode(deletekey) + if FindStatus: + parentTree =3D DeleteTree.Parent + lastTree =3D DeleteTree.LastRel + nextTree =3D DeleteTree.NextRel + if parentTree: + index =3D parentTree.Child.index(DeleteTree) + del parentTree.Child[index] + if lastTree and nextTree: + lastTree.NextRel =3D nextTree + nextTree.LastRel =3D lastTree + elif lastTree: + lastTree.NextRel =3D None + elif nextTree: + nextTree.LastRel =3D None + return DeleteTree + return None + + +ExpOps =3D [ + EFI_IFR_DUP_OP, + EFI_IFR_EQ_ID_VAL_OP, + EFI_IFR_QUESTION_REF1_OP, + EFI_IFR_EQ_ID_VAL_OP, + EFI_IFR_EQ_ID_ID_OP, + EFI_IFR_EQ_ID_VAL_LIST_OP, + EFI_IFR_RULE_REF_OP, + EFI_IFR_STRING_REF1_OP, + EFI_IFR_THIS_OP, + EFI_IFR_SECURITY_OP, + EFI_IFR_GET_OP, + EFI_IFR_TRUE_OP, + EFI_IFR_FALSE_OP, + EFI_IFR_ONE_OP, + EFI_IFR_ONES_OP, + EFI_IFR_ZERO_OP, + EFI_IFR_UNDEFINED_OP, + EFI_IFR_VERSION_OP, + EFI_IFR_UINT64_OP, + EFI_IFR_QUESTION_REF2_OP, + EFI_IFR_QUESTION_REF3_OP, + EFI_IFR_SET_OP, + EFI_IFR_DEFAULTSTORE_OP, + EFI_IFR_OR_OP, +] + +DefaultDictList =3D [] + + +class ReCordNode(Structure): + def __init__(self, Record, LineNo): + self.Record =3D Record + self.LineNo =3D LineNo + + +class IfrTree: + def __init__(self, Root: IfrTreeNode, PreProcessDB: PreProcessDB, Opti= ons: Options) -> None: + self.Root =3D Root + self.Options =3D Options + self.PreProcessDB =3D PreProcessDB + + def GenBinaryFiles(self): + RecordLines =3D [] + HpkFile =3D self.Options.PkgOutputFileName + CFile =3D self.Options.COutputFileName + LstFile =3D self.Options.RecordListFileName + if self.Options.CreateIfrPkgFile: + # GenBinary + PkgHdr =3D gFormPkg.BuildPkgHdr() + try: + with open(HpkFile, "wb") as Hpk: + Hpk.write(gFormPkg.StructToStream(PkgHdr)) + except Exception as e: + EdkLogger.error( + "VfrCompiler", FILE_OPEN_FAILURE, f"File open failed f= or {HpkFile}: {e}" + ) + + # GenCFile + try: + with open(CFile, "w") as C: + C.write("//\n") + C.write("//" + " " + "DO NOT EDIT -- auto-generated fi= le\n") + C.write("//\n") + C.write("//" + " " + "This file is generated by the vf= rcompiler utility\n") + C.write("//\n\n") + BaseName =3D "unsigned char " + self.Options.BaseFileN= ame + "Bin[] =3D {\n" + C.write(BaseName) + C.write(" // ARRAY LENGTH\n\n") + PkgLength =3D PkgHdr.Length + sizeof(c_uint32) + for B in PkgLength.to_bytes(4, byteorder=3D"little", s= igned=3DTrue): + C.write(" 0x%02X," % B) + C.write("\n\n") + C.write(" // PACKAGE HEADER\n\n") + HeaderBuffer =3D gFormPkg.StructToStream(PkgHdr) + for B in HeaderBuffer: + C.write(" 0x%02X," % B) + C.write("\n\n") + C.write(" //" + " " + "PACKAGE DATA\n\n") + self.Index =3D 0 + except Exception as e: + EdkLogger.error( + "VfrCompiler", FILE_OPEN_FAILURE, f"File open failed f= or {CFile}: {e}" + ) + + if self.Options.CreateRecordListFile: + # GenRecordList + try: + with open(LstFile, "w") as Lst: + Lst.write( + f"//\n// VFR compiler version {VFR_COMPILER_VERSI= ON} {BUILD_VERSION}\n//\n" + ) + except Exception as e: + EdkLogger.error( + "VfrCompiler", FILE_OPEN_FAILURE, f"File open failed f= or {LstFile}: {e}" + ) + + self._GenBinaryFilesDfs(self.Root, HpkFile, CFile, RecordLines) + + if self.Options.CreateIfrPkgFile: + # GenCFile + try: + with open(CFile, "a") as C: + C.write("\n};\n") + except Exception as e: + EdkLogger.error( + "VfrCompiler", FILE_WRITE_FAILURE, f"File write failed= for {CFile}: {e}", None + ) + + if self.Options.CreateRecordListFile: + # GenRecordList + InFileLines =3D [] + try: + with open(self.Options.CProcessedVfrFileName, "r") as In: + for Line in In: + InFileLines.append(Line) + except Exception as e: + EdkLogger.error( + "VfrCompiler", + FILE_OPEN_FAILURE, + f"File open failed for {self.Options.CProcessedVfrFile= Name}: {e}", + None, + ) + try: + with open(LstFile, "a") as Lst: + InsertedLine =3D 0 + for RecordLine in RecordLines: + InFileLines.insert(RecordLine.LineNo + InsertedLin= e, RecordLine.Record) + InsertedLine +=3D 1 + for Line in InFileLines: + Lst.write(f"{Line}") + Lst.write("//\n// All Opcode Record List\n//\n") + for RecordLine in RecordLines: + Lst.write(f"{RecordLine.Record}") + Lst.write(f"\nTotal Size of all record is {gFormPkg.Of= fset:0>8x}") + gVfrVarDataTypeDB.Dump(Lst) + except Exception as e: + EdkLogger.error( + "VfrCompiler", FILE_WRITE_FAILURE, f"File write failed= for {LstFile}: {e}", None + ) + + def _GenBinaryFilesDfs(self, Root, HpkFile, CFile, RecordLines): + if Root is None: + return + + if Root.OpCode is not None: + if Root.OpCode in ExpOps: + # The Data is likely to be modified, so generate buffer he= re + Root.Buffer =3D gFormPkg.StructToStream(Root.Data.GetInfo(= )) + if Root.Buffer is not None: + if self.Options.CreateIfrPkgFile and self.Options.CreateRe= cordListFile: + try: + with open(HpkFile, "ab") as Hpk: + Hpk.write(Root.Buffer) + except Exception: + EdkLogger.error( + "VfrCompiler", + FILE_WRITE_FAILURE, + "File write failed for %s" % (self.Options.Pkg= OutputFileName), + ) + + try: + with open(CFile, "a") as C: + LineBuffer =3D "" + for i in range(0, len(Root.Buffer)): + self.Index +=3D 1 + Data =3D Root.Buffer[i] + if self.Index % BYTES_PRE_LINE =3D=3D 1: + C.write(" ") + C.write("0x%02X" % Data) + if self.Index !=3D gFormPkg.PkgLength: + if self.Index % BYTES_PRE_LINE =3D=3D = 0: + C.write(",\n") + else: + C.write(", ") + + LineBuffer +=3D f"{Root.Buffer[i]:0>2X} " + + Record =3D f">{Root.Offset:0>8X}: {LineBuffer}= \n" + LineNo =3D Root.Data.GetLineNo() + RecordLines.append(ReCordNode(Record, LineNo)) + except Exception: + EdkLogger.error( + "VfrCompiler", + FILE_WRITE_FAILURE, + "File write failed for %s" % (self.Options.COu= tputFileName), + ) + + if self.Options.CreateIfrPkgFile and not self.Options.Crea= teRecordListFile: + try: + with open(HpkFile, "ab") as Hpk: + Hpk.write(Root.Buffer) + except Exception: + EdkLogger.error( + "VfrCompiler", + FILE_WRITE_FAILURE, + "File write failed for %s" % (self.Options.Pkg= OutputFileName), + ) + + try: + with open(CFile, "a") as C: + for i in range(0, len(Root.Buffer)): + self.Index +=3D 1 + Data =3D Root.Buffer[i] + if self.Index % BYTES_PRE_LINE =3D=3D 1: + C.write(" ") + C.write("0x%02X" % Data) + if self.Index !=3D gFormPkg.PkgLength: + if self.Index % BYTES_PRE_LINE =3D=3D = 0: + C.write(",\n") + else: + C.write(", ") + except Exception as e: + EdkLogger.error( + "VfrCompiler", + FILE_WRITE_FAILURE, + f"File write failed for {self.Options.COutputF= ileName} : {e}", + ) + + if not self.Options.CreateIfrPkgFile and self.Options.Crea= teRecordListFile: + LineBuffer =3D "" + for i in range(0, len(Root.Buffer)): + LineBuffer +=3D f"{Root.Buffer[i]:0>2X} " + Record =3D f">{Root.Offset:0>8X}: {LineBuffer}\n" + LineNo =3D Root.Data.GetLineNo() + RecordLines.append(ReCordNode(Record, LineNo)) + + if Root.Child !=3D []: + for ChildNode in Root.Child: + self._GenBinaryFilesDfs(ChildNode, HpkFile, CFile, RecordL= ines) + + def GenRecordListFile(self): + FileName =3D self.Options.RecordListFileName + RecordLines =3D [] + self._GenRecordListFileDfs(self.Root, RecordLines) + + try: + Out =3D open(FileName, "w") + except Exception: + EdkLogger.error( + "VfrCompiler", FILE_OPEN_FAILURE, "File open failed for %s= " % FileName, None + ) + + try: + Out.write("//\n// All Opcode Record List\n//\n") + for RecordLine in RecordLines: + Out.write(f"{RecordLine}\n") + Out.write(f"\nTotal Size of all record is {gFormPkg.Offset:0>8= x}") + gVfrVarDataTypeDB.Dump(Out) + Out.close() + except Exception: + EdkLogger.error( + "VfrCompiler", FILE_WRITE_FAILURE, "File write failed for = %s" % FileName + ) + + def _GenRecordListFileDfs(self, Root, RecordLines): + if Root is None: + return + if Root.OpCode is not None: + LineBuffer =3D "" + if Root.Buffer is not None: + for i in range(0, len(Root.Buffer)): + LineBuffer +=3D f"{Root.Buffer[i]:0>2X} " + Record =3D f">{Root.Offset:0>8X}: {LineBuffer}\n" + RecordLines.append(Record) + + if Root.Child !=3D []: + for ChildNode in Root.Child: + self._GenRecordListFileDfs(ChildNode, RecordLines) + + def DumpJson(self): + FileName =3D self.Options.JsonFileName + try: + with open(FileName, "w") as f: + f.write("{\n") + f.write(' "DataStruct" : {\n') + pNode =3D gVfrVarDataTypeDB.GetDataTypeList() + while pNode is not None: + f.write(f' "{pNode.TypeName}" : [\n') + FNode =3D pNode.Members + while FNode is not None: + f.write("{\n") + f.write(f' "Name": "{FNode.FieldName}",\n') + if FNode.ArrayNum > 0: + f.write(f' "Type": "{FNode.FieldType.TypeName= }[{FNode.ArrayNum}]",\n') + else: + f.write(f' "Type": "{FNode.FieldType.TypeName= }",\n') + f.write(f' "Offset": {FNode.Offset}\n') + if FNode.Next is None: + f.write("}\n") + else: + f.write("}, \n") + FNode =3D FNode.Next + if pNode.Next is None: + f.write(" ]\n") + else: + f.write(" ],\n") + pNode =3D pNode.Next + f.write(" },\n") + f.write(' "DataStructAttribute": {\n') + pNode =3D gVfrVarDataTypeDB.GetDataTypeList() + while pNode is not None: + f.write(f' "{pNode.TypeName}": {{\n') + f.write(f' "Alignment": {pNode.Align},\n') + f.write(f' "TotalSize": {pNode.TotalSize}\n') + if pNode.Next is None: + f.write("}\n") + else: + f.write("},\n") + pNode =3D pNode.Next + f.write(" },\n") + f.write(' "VarDefine" : {\n') + pVsNode =3D gVfrDataStorage.GetBufferVarStoreList() + while pVsNode is not None: + f.write(f' "{pVsNode.VarStoreName}": {{\n') + f.write(f' "Type": "{pVsNode.DataType.TypeName}",\n') + f.write(f' "Attributes": {pVsNode.Attributes},\n') + f.write(f' "VarStoreId": {pVsNode.VarStoreId},\n') + f.write(f' "VendorGuid": {pVsNode.Guid.to_string()}\n= ') + if pVsNode.Next is None: + f.write("}\n") + else: + f.write("},\n") + + pVsNode =3D pVsNode.Next + f.write(" },\n") + f.write(' "Data" : [\n') + pVsNode =3D gVfrBufferConfig.GetVarItemList() + while pVsNode is not None: + if pVsNode.Id is None: + pVsNode =3D pVsNode.Next + continue + pInfoNode =3D pVsNode.InfoStrList + while pInfoNode is not None: + f.write("{\n") + f.write(f' "VendorGuid": {pVsNode.Guid.to_string(= )},\n') + f.write(f' "VarName": "{pVsNode.Name}",\n') + f.write(f' "DefaultStore": "{pVsNode.Id}",\n') + f.write(f' "Size": "{pInfoNode.Width}",\n') + f.write(f' "Offset": {pInfoNode.Offset},\n') + if ( + pInfoNode.Type =3D=3D EFI_IFR_TYPE_DATE + and type(pInfoNode.Value) =3D=3D EFI_HII_DATE + ): + f.write( + f' "Value": "{pInfoNode.Value.Year}/{pInf= oNode.Value.Month}/{pInfoNode.Value.Day}"\n' + ) + elif ( + pInfoNode.Type =3D=3D EFI_IFR_TYPE_TIME + and type(pInfoNode.Value) =3D=3D EFI_HII_TIME + ): + f.write( + f' "Value": "{pInfoNode.Value.Hour}:{pInf= oNode.Value.Minute}:{pInfoNode.Value.Second}"\n' + ) + elif ( + pInfoNode.Type =3D=3D EFI_IFR_TYPE_REF + and type(pInfoNode.Value) =3D=3D EFI_HII_REF + ): + f.write( + f' "Value": "{pInfoNode.Value.QuestionId}= ;{pInfoNode.Value.FormId};{pInfoNode.Value.FormSetGuid.to_string()};{pInfoN= ode.Value.DevicePath}"\n' + ) + else: + f.write(f' "Value": "{pInfoNode.Value}"\n') + + f.write("},\n") + pInfoNode =3D pInfoNode.Next + pVsNode =3D pVsNode.Next + f.write("{\n") + f.write(' "VendorGuid": "NA",\n') + f.write(' "VarName": "NA",\n') + f.write(' "DefaultStore": "NA",\n') + f.write(' "Size": 0,\n') + f.write(' "Offset": 0,\n') + f.write(' "Value": "0x00"\n') + f.write("}\n") + f.write(" ]\n") + f.write("}\n") + + f.close() + except Exception: + EdkLogger.error( + "VfrCompiler", FILE_OPEN_FAILURE, "File open failed for %s= " % FileName, None + ) + + def _DumpQuestionInfosForXMLCLI(self, Root, f, ValueIndent): + Info =3D Root.Data.GetInfo() + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Condition}'\n") + + if Root.Data.QName is not None: + f.write(f"{ValueIndent}name: {Root.Data.QName} # Optional I= nput\n") + + if Root.Data.VarIdStr !=3D "": + f.write(f"{ValueIndent}varid: {Root.Data.VarIdStr} # Option= al Input\n") + if Root.Data.HasQuestionId: + f.write( + f"{ValueIndent}questionid: {'0x%x' % Info.Question.Questi= onId} # Optional Input\n" + ) + f.write(f"{ValueIndent}prompt: '{self._DisplayUniStr(Info.Question= .Header.Prompt)}'\n") + f.write(f"{ValueIndent}help: '{self._DisplayUniStr(Info.Question.H= eader.Help)}'\n") + if Root.Data.FlagsStream !=3D "": + f.write(f"{ValueIndent}flags: {Root.Data.FlagsStream} # Opti= onal input , flags\n") + if Root.Data.HasKey: + f.write( + f"{ValueIndent}key: {'0x%0x ' % Info.Question.QuestionId}= # Optional input, key\n" + ) + + def _DisplayUniStr(self, Key): + StrId =3D f"0x{Key:04x}" + FormatedStrId =3D StrId[:2] + StrId[2:].upper() + return f"STRING_TOKEN({FormatedStrId})" + + def DumpYamlForXMLCLI(self): + FileName =3D self.Options.YamlFileName + try: + with open(FileName, "w", encoding=3D"utf-8") as f: + f.write("## DO NOT REMOVE -- YAML Mode\n") + self._DumpYamlForXMLCLIDfs(self.Root, f) + f.close() + except Exception: + EdkLogger.error( + "VfrCompiler", FILE_OPEN_FAILURE, "File open failed for %s= " % FileName, None + ) + + def _DumpYamlForXMLCLIDfs(self, Root, f): + try: + if Root is None: + return + if Root.OpCode is not None: + if Root.Level =3D=3D 0: + KeyIndent =3D "" + ValueIndent =3D "" + else: + KeyIndent =3D " " * ((Root.Level * 2 - 1) * 2) + ValueIndent =3D " " * ((Root.Level * 2 + 1) * 2) + + Info =3D Root.Data.GetInfo() + + if Root.OpCode =3D=3D EFI_IFR_FORM_SET_OP: + f.write(KeyIndent + "formset:\n") + ValueIndent =3D " " * (Root.Level + 1) * 2 + f.write( + f"{ValueIndent}guid: '{{{Info.Guid.Data1:#x}, {In= fo.Guid.Data2:#x}, {Info.Guid.Data3:#x}, {{ {', '.join(f'{x:#x}' for x in I= nfo.Guid.Data4)}}}}}'\n" + ) + f.write(f"{ValueIndent}title: '{self._DisplayUniStr(I= nfo.FormSetTitle)}'\n") + f.write(f"{ValueIndent}help: '{self._DisplayUniStr(In= fo.Help)}'\n") + + if Root.Data.ClassGuidNum !=3D 0: + f.write(ValueIndent + "classguid: ") + for i in range(0, len(Root.Data.ClassGuid)): + Guid =3D Root.Data.GetClassGuid()[i] + if i !=3D len(Root.Data.ClassGuid) - 1: + f.write( + f"'{{{Guid.Data1:#x}, {Guid.Data2:#x},= {Guid.Data3:#x}, {{ {', '.join(f'{x:#x}' for x in Guid.Data4)}}}}}' | " + ) + else: + f.write( + f"'{{{Guid.Data1:#x}, {Guid.Data2:#x},= {Guid.Data3:#x}, {{ {', '.join(f'{x:#x}' for x in Guid.Data4)}}}}}' # Opt= ional Input \n" + ) + + if ( + Root.Child !=3D [] + and Root.Child[0].OpCode !=3D EFI_IFR_END_OP + and type(Root.Child[0].Data) !=3D IfrSubClass + and type(Root.Child[0].Data) !=3D IfrClass + ): + f.write(ValueIndent + "component: \n") + elif ( + type(Root.Child[0].Data) =3D=3D IfrClass + and type(Root.Child[1].Data) =3D=3D IfrSubClass + ): + Root.Child[0].Data.HasSubClass =3D True + + if Root.OpCode =3D=3D EFI_IFR_VARSTORE_OP: + f.write(KeyIndent + "- varstore:\n") + f.write(f"{ValueIndent}type: {Root.Data.Type}\n") + if Root.Data.HasVarStoreId: + f.write(f"{ValueIndent}varid: {Info.VarStoreId:#0= 4x} # Optional Input\n") + Name =3D "".join(chr(x) for x in Info.Name) + f.write(f"{ValueIndent}name: {Name}\n") + f.write( + f"{ValueIndent}guid: '{{{Info.Guid.Data1:#x}, {Inf= o.Guid.Data2:#x}, {Info.Guid.Data3:#x}, {{ {', '.join(f'{x:#x}' for x in In= fo.Guid.Data4)}}}}}'\n" + ) + + if Root.OpCode =3D=3D EFI_IFR_VARSTORE_EFI_OP: + f.write(KeyIndent + "- efivarstore:\n") + f.write(f"{ValueIndent}type: {Root.Data.Type}\n") + if Root.Data.HasVarStoreId: + if "varid" in Root.Dict: + f.write( + f"{ValueIndent}varid: {Info.VarStoreId:#0= 4x} # Optional Input\n" + ) + f.write(f"{ValueIndent}attribute: {Root.Data.Attribut= esText} \n") + if Root.Data.NameStringId: + f.write( + f"{ValueIndent}name: '{self._DisplayUniStr(Roo= t.Data.NameStringId)}'\n" + ) + f.write(ValueIndent + "varsize: " + Root.Data.Var= Size + "\n") + else: + Name =3D "".join(chr(x) for x in Info.Name) + f.write(f"{ValueIndent}name: {Name}\n") + f.write( + f"{ValueIndent}guid: '{{{Info.Guid.Data1:#x}, {In= fo.Guid.Data2:#x}, {Info.Guid.Data3:#x}, {{ {', '.join(f'{x:#x}' for x in I= nfo.Guid.Data4)}}}}}'\n" + ) + + if Root.OpCode =3D=3D EFI_IFR_VARSTORE_NAME_VALUE_OP: + f.write(KeyIndent + "- namevaluevarstore:\n") + f.write(f"{ValueIndent}type: {Root.Data.Type}\n") + if Root.Data.HasVarStoreId: + f.write(f"{ValueIndent}varid: {Info.VarStoreId:#0= 4x} # Optional Input\n") + f.write( + f"{ValueIndent}guid: '{{{Info.Guid.Data1:#x}, {In= fo.Guid.Data2:#x}, {Info.Guid.Data3:#x}, {{ {', '.join(f'{x:#x}' for x in I= nfo.Guid.Data4)}}}}}'\n" + ) + if Root.Data.NameItemList !=3D []: + f.write(ValueIndent + "nametable: \n") + for NameItem in Root.Data.NameItemList: + f.write(f"{ValueIndent} - name: '{self._Displ= ayUniStr(NameItem)}'\n") + + if Root.OpCode =3D=3D EFI_IFR_DEFAULTSTORE_OP: + gVfrDefaultStore.UpdateDefaultType(Root) + + if Root.OpCode =3D=3D EFI_IFR_SHOWN_DEFAULTSTORE_OP: + f.write(KeyIndent + "- defaultstore:\n") + f.write(f"{ValueIndent}type: {Root.Data.Type}\n") + f.write(f"{ValueIndent}prompt: '{self._DisplayUniStr(= Info.DefaultName)}'\n") + if Root.Data.HasAttr: + f.write( + f"{ValueIndent}attribute: {'0x%04x' % Info.De= faultId} # Default ID, Optional input\n" + ) + + if Root.OpCode =3D=3D EFI_IFR_FORM_OP: + f.write(KeyIndent + "- form: \n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + + f.write(f"{ValueIndent}formid: {'0x%x' % Info.FormId}= \n") + f.write(f"{ValueIndent}title: '{self._DisplayUniStr(I= nfo.FormTitle)}'\n") + + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_FORM_MAP_OP: + MethodMapList =3D Root.Data.GetMethodMapList() + f.write(KeyIndent + "- formmap: \n") + f.write(f"{ValueIndent}formid: {'0x%x' % Info.FormId}= \n") + + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + + if MethodMapList !=3D []: + f.write(ValueIndent + "map: # optional input\n") + for MethodMap in MethodMapList: + f.write(f"{ValueIndent}- maptitle: {MethodMap= .MethodTitle}\n") + f.write( + f"{ValueIndent} mapguid: '{{{{" + f"{MethodMap.MethodIdentifier.Data1}, {Met= hodMap.MethodIdentifier.Data2}, {MethodMap.MethodIdentifier.Data3}," + f"{{ {', '.join('0x%x' % x for x in Method= Map.MethodIdentifier.Data4)} }}" + f"}}}}'\n" + ) + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_IMAGE_OP: + f.write(f"{ValueIndent}image: '{self._DisplayUniStr(I= nfo.Id)}'\n") + if Root.OpCode =3D=3D EFI_IFR_RULE_OP: # + f.write(f"{KeyIndent}- rule:\n") + + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + + f.write( + f"{ValueIndent}name: {Root.Data.GetRuleName()}\n" + f"{ValueIndent}expression: {Root.Expression} \n" + ) + + if Root.OpCode =3D=3D EFI_IFR_SUBTITLE_OP: + f.write(KeyIndent + "- subtitle:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(f"{ValueIndent}text: '{self._DisplayUniStr(Inf= o.Statement.Prompt)}'\n") + + if Root.Data.FlagsStream !=3D "": + f.write(f"{ValueIndent}flags: {Root.Data.FlagsStr= eam} # Optional Input\n") + + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(f"{ValueIndent}component: \n") + + if Root.OpCode =3D=3D EFI_IFR_TEXT_OP: + f.write(KeyIndent + "- text:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + if type(Info) =3D=3D EFI_IFR_TEXT: + f.write( + f"{ValueIndent}help: '{self._DisplayUniStr(In= fo.Statement.Help)}'\n" + ) + f.write( + f"{ValueIndent}prompt: '{self._DisplayUniStr(= Info.Statement.Prompt)}'\n" + ) + if Root.Data.HasTextTwo: + f.write(f"{ValueIndent}text: '{self._DisplayU= niStr(Info.TextTwo)}'\n") + if type(Info) =3D=3D EFI_IFR_ACTION: + f.write( + f"{ValueIndent}help: '{self._DisplayUniStr(In= fo.Question.Header.Help)}'\n" + ) + f.write( + f"{ValueIndent}prompt: '{self._DisplayUniStr(= Info.Question.Header.Prompt)}'\n" + ) + if Root.Data.FlagsStream !=3D "": + f.write( + f"{ValueIndent}flags: {Root.Data.FlagsStr= eam} # Optional Input, Question Flags\n" + ) + if Root.Data.HasKey: + f.write( + f"{ValueIndent}key: {'0x%04x' % Info.Ques= tion.QuestionId} # Optional Input, Question QuestionId\n" + ) + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_ACTION_OP: + f.write(KeyIndent + "- action:\n") + self._DumpQuestionInfosForXMLCLI(Root, f, ValueIndent) + f.write(f"{ValueIndent}config: {Info.QuestionConfig} = # QuestionConfig\n") + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_ONE_OF_OP: + f.write(KeyIndent + "- oneof:\n") + + self._DumpQuestionInfosForXMLCLI(Root, f, ValueIndent) + + if Root.Data.HasMinMax: + f.write( + f"{ValueIndent}maximum: {'0x%0x' % Info.Data.= MaxValue} # Optional Input\n" + ) + f.write( + f"{ValueIndent}minimum: {'0x%0x' % Info.Data.= MinValue} # Optional Input\n" + ) + + if Root.Data.HasStep: + f.write(f"{ValueIndent}step: {Info.Data.Step} # O= ptional Input\n") + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_ONE_OF_OPTION_OP: + f.write(KeyIndent + "- option: \n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(f"{ValueIndent}text: '{self._DisplayUniStr(Inf= o.Option)}'\n") + + if type(Root.Data) =3D=3D IfrOneOfOption: + if Root.Data.ValueStream !=3D "": + f.write(f"{ValueIndent}value: {Root.Data.Valu= eStream}\n") + + if Root.Data.FlagsStream !=3D "": + f.write(f"{ValueIndent}flags: {Root.Data.FlagsStr= eam} # Optional Input\n") + + if Root.Data.IfrOptionKey is not None: + f.write( + f"{ValueIndent}key: {'0x%04x' % Root.Data.Get= IfrOptionKey()} # Optional Input\n" + ) + + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_DEFAULT_OP: + # =E3=80=80specific condition here + if Root.Position !=3D "Do not display": + f.write(KeyIndent + "- default:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Cond= ition}'\n") + + if type(Root.Data) =3D=3D IfrDefault: + Str =3D Root.Data.ValueStream + if Str.find(";") !=3D -1: + RefList =3D Str.split(";") + Str =3D ( + RefList[0] + + ";" + + RefList[1] + + ";" + + f"{{{Info.Value[0].FormSetGuid.Data1= :#x}, {Info.Value[0].FormSetGuid.Data2:#x}, {Info.Value[0].FormSetGuid.Data= 3:#x}, {{ {', '.join(f'{x:#x}' for x in Info.Value[0].FormSetGuid.Data4)}}}= }}" + + ";" + + self._DisplayUniStr(Info.Value[0].De= vicePath) + ) + + if Str !=3D "": + Str =3D Str.replace("{", "[").replace("}",= "]") + if ( + Str.find(":") !=3D -1 + or Str.find("/") !=3D -1 + or Str.find(";") !=3D -1 + ): + Str =3D "(" + Str + ")" + f.write(f"{ValueIndent}value: {Str}\n") + + elif type(Root.Data) =3D=3D IfrDefault2: + f.write(f"{ValueIndent}value_exp: '{Root.Child= [0].Expression}'\n") + + if Root.Data.DefaultStore !=3D "": + f.write(f"{ValueIndent}defaultstore: {Root.Dat= a.DefaultStore}\n") + + if Root.OpCode =3D=3D EFI_IFR_ORDERED_LIST_OP: + f.write(KeyIndent + "- orderedlist:\n") + self._DumpQuestionInfosForXMLCLI(Root, f, ValueIndent) + if Root.Data.HasMaxContainers: + f.write( + f"{ValueIndent}maxcontainers: {Info.MaxContai= ners} # Optional Input\n" + ) + + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_NUMERIC_OP: + f.write(KeyIndent + "- numeric:\n") + self._DumpQuestionInfosForXMLCLI(Root, f, ValueIndent) + f.write(f"{ValueIndent}maximum: {'0x%0x' % Info.Data.= MaxValue}\n") + f.write(f"{ValueIndent}minimum: {'0x%0x' % Info.Data.= MinValue}\n") + + if Root.Data.HasStep: + f.write(f"{ValueIndent}step: {Info.Data.Step} # O= ptional Input\n") + + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_CHECKBOX_OP: + f.write(KeyIndent + "- checkbox:\n") + self._DumpQuestionInfosForXMLCLI(Root, f, ValueIndent) + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_TIME_OP: + f.write(KeyIndent + "- time:\n") + if Root.Data.Hour is None: + self._DumpQuestionInfosForXMLCLI(Root, f, ValueInd= ent) + if Root.Child !=3D [] and Root.Child[0].OpCode != =3D EFI_IFR_END_OP: + f.write(ValueIndent + "component: \n") + else: + f.write(f"{ValueIndent}hour: {Root.Data.Hour}\n") + + if Root.Data.D_Hour is not None: + f.write(f"{ValueIndent}default_hour: {Root.Da= ta.D_Hour}\n") + + f.write(f"{ValueIndent}minute: {Root.Data.Minute}= \n") + + if Root.Data.D_Minute is not None: + f.write(f"{ValueIndent}default_minute: {Root.= Data.D_Minute}\n") + + f.write(f"{ValueIndent}second: {Root.Data.Second}= \n") + + if Root.Data.D_Second is not None: + f.write(f"{ValueIndent}default_second: {Root.= Data.D_Second}\n") + f.write( + f"{ValueIndent}prompt: '{self._DisplayUniStr(= Info.Question.Header.Prompt)}'\n" + ) + f.write( + f"{ValueIndent}help: '{self._DisplayUniStr(In= fo.Question.Header.Help)}'\n" + ) + if Root.Data.FlagsStream !=3D "": + f.write( + f"{ValueIndent}flags: {Root.Data.FlagsStr= eam} # Optional input , flags\n" + ) + + if Root.Child !=3D [] and Root.Child[0].OpCode != =3D EFI_IFR_DEFAULT_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_DATE_OP: + f.write(KeyIndent + "- date:\n") + if Root.Data.Year is None: + self._DumpQuestionInfosForXMLCLI(Root, f, ValueInd= ent) + if Root.Child !=3D [] and Root.Child[0].OpCode != =3D EFI_IFR_END_OP: + f.write(ValueIndent + "component: \n") + else: + f.write(f"{ValueIndent}year: {Root.Data.Year}\n") + f.write(f"{ValueIndent}min_year: {Root.Data.Min}\= n") + f.write(f"{ValueIndent}max_year: {Root.Data.Max}\= n") + + if Root.Data.D_Year is not None: + f.write(f"{ValueIndent}default_year: {Root.Da= ta.D_Year}\n") + + f.write(f"{ValueIndent}month: {Root.Data.Month}\n= ") + + if Root.Data.D_Month is not None: + f.write(f"{ValueIndent}default_month: {Root.D= ata.D_Month}\n") + + f.write(f"{ValueIndent}day: {Root.Data.Day}\n") + + if Root.Data.D_Day is not None: + f.write(f"{ValueIndent}default_day: {Root.Dat= a.D_Day}\n") + + f.write( + f"{ValueIndent}prompt: '{self._DisplayUniStr(= Info.Question.Header.Prompt)}'\n" + ) + f.write( + f"{ValueIndent}help: '{self._DisplayUniStr(In= fo.Question.Header.Help)}'\n" + ) + + if Root.Data.FlagsStream !=3D "": + f.write( + f"{ValueIndent}flags: {Root.Data.FlagsStr= eam} # Optional input , flags\n" + ) + + if Root.Child !=3D [] and Root.Child[0].OpCode != =3D EFI_IFR_DEFAULT_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_STRING_OP: + f.write(KeyIndent + "- string:\n") + self._DumpQuestionInfosForXMLCLI(Root, f, ValueIndent) + f.write(f"{ValueIndent}minsize: {Info.MinSize}\n") + f.write(f"{ValueIndent}maxsize: {Info.MaxSize}\n") + + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(f"{ValueIndent}component: \n") + + if Root.OpCode =3D=3D EFI_IFR_PASSWORD_OP: + f.write(KeyIndent + "- password:\n") + self._DumpQuestionInfosForXMLCLI(Root, f, ValueIndent) + f.write( + f"{ValueIndent}minsize: {Root.Dict['minsize'].Key= if 'minsize' in Root.Dict else Info.MinSize}\n" + ) + f.write( + f"{ValueIndent}maxsize: {Root.Dict['maxsize'].Key= if 'maxsize' in Root.Dict else Info.MaxSize}\n" + ) + + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(f"{ValueIndent}component: \n") + + if Root.OpCode =3D=3D EFI_IFR_RESET_BUTTON_OP: + f.write(KeyIndent + "- resetbutton:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(f"{ValueIndent}defaultstore: {Root.Data.Defau= ltStore}\n") + f.write( + f"{ValueIndent}prompt: '{self._DisplayUniStr(Info.= Statement.Prompt)}'\n" + ) + f.write(f"{ValueIndent}help: '{self._DisplayUniStr(Inf= o.Statement.Help)}'\n") + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_REF_OP: + f.write(KeyIndent + "- goto:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + + if type(Root.Data) =3D=3D IfrRef4: + f.write( + f"{ValueIndent}devicepath: '{self._DisplayUniS= tr(Info.DevicePath)}' # Optional Input\n" + ) + f.write( + f"{ValueIndent}formsetguid: '{{{Info.FormSetI= d.Data1:#x}, {Info.FormSetId.Data2:#x}, {Info.FormSetId.Data3:#x}, {{ {', '= .join(f'{x:#x}' for x in Info.FormSetId.Data4)}}}}}' # Optional Input\n" + ) + f.write(f"{ValueIndent}formid: {'0x%x' % Info.For= mId}\n") + f.write( + f"{ValueIndent}question: {'0x%x' % Info.Quest= ionId} # Optional Input\n" + ) + + if type(Root.Data) =3D=3D IfrRef3: + f.write( + f"{ValueIndent}formsetguid: '{{{Info.FormSetI= d.Data1:#x}, {Info.FormSetId.Data2:#x}, {Info.FormSetId.Data3:#x}, {{ {', '= .join(f'{x:#x}' for x in Info.FormSetId.Data4)}}}}}' # Optional Input\n" + ) + f.write(f"{ValueIndent}formid: {'0x%x' % Info.For= mId}\n") + f.write( + f"{ValueIndent}question: {'0x%x' % Info.Quest= ionId} # Optional Input\n" + ) + + if type(Root.Data) =3D=3D IfrRef2: + f.write(f"{ValueIndent}formid: {'0x%x' % Info.For= mId}\n") + f.write( + f"{ValueIndent}question: {'0x%x' % Info.Quest= ionId} # Optional Input\n" + ) + + if type(Root.Data) =3D=3D IfrRef: + f.write(f"{ValueIndent}formid: {'0x%x' % Info.For= mId}\n") + + self._DumpQuestionInfosForXMLCLI(Root, f, ValueIndent) + + if Root.Child !=3D [] and Root.Child[0].OpCode !=3D EF= I_IFR_END_OP: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_REFRESH_OP: + f.write(KeyIndent + "- refresh:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(f"{ValueIndent}interval: {Info.RefreshInterva= l} # RefreshInterval\n") + + if Root.OpCode =3D=3D EFI_IFR_VARSTORE_DEVICE_OP: + f.write(KeyIndent + "- varstoredevice:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(f"{ValueIndent}devicepath: {Info.DevicePath} = # DevicePath\n") + + if Root.OpCode =3D=3D EFI_IFR_REFRESH_ID_OP: + f.write(KeyIndent + "- refreshguid:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write( + f"{ValueIndent}guid: '{{{Info.RefreshEventGroupId= .Data1:#x}, {Info.RefreshEventGroupId.Data2:#x}, {Info.RefreshEventGroupId.= Data3:#x}, {{ {', '.join(f'{x:#x}' for x in Info.RefreshEventGroupId.Data4)= }}}}}' \n" + ) + + if Root.OpCode =3D=3D EFI_IFR_WARNING_IF_OP: + f.write(KeyIndent + "- warningif:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write( + f"{ValueIndent}prompt: '{self._DisplayUniStr(Info.= Warning)}' # Optional Input\n" + ) + if Root.Data.HasTimeOut: + f.write(f"{ValueIndent}timeout: {Info.TimeOut} # = optional input \n") + f.write(f"{ValueIndent}expression: {Root.Expression}\= n") + + if Root.OpCode =3D=3D EFI_IFR_GUID_OP: + if type(Root.Data) =3D=3D IfrLabel: + f.write(KeyIndent + "- label:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Cond= ition}'\n") + f.write(f"{ValueIndent}number: {'0x%x' % Info.Num= ber} # Number\n") + + if type(Root.Data) =3D=3D IfrBanner: + f.write(KeyIndent + "- banner:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Cond= ition}'\n") + f.write( + f"{ValueIndent}title: '{self._DisplayUniStr(In= fo.Title)}' # Optional Input\n" + ) + if not Root.Data.HasTimeOut: + if "line" in Root.Dict: + f.write(f"{ValueIndent}line: {Root.Dict['= line'].Key}\n") + else: + f.write(f"{ValueIndent}line: {Info.LineNu= mber}\n") + f.write(f"{ValueIndent}align: {Root.Dict['ali= gn'].Key}\n") + else: + f.write(f"{ValueIndent}timeout: {Root.Data.Ti= meOut}\n") + + if type(Root.Data) =3D=3D IfrClass: + f.write(KeyIndent + "class: " + Root.Data.ClassSt= r + "\n") + if not Root.Data.HasSubClass: + f.write(KeyIndent + "component: \n") + + if type(Root.Data) =3D=3D IfrSubClass: + f.write(KeyIndent + "subclass: " + Root.Data.SubC= lassStr + "\n") + f.write(KeyIndent + "component: \n") + + if type(Root.Data) =3D=3D IfrExtensionGuid: + if type(Root.Parent.Data) =3D=3D IfrExtensionGuid: + Root.Level -=3D 1 + KeyIndent =3D " " * ((Root.Level * 2 - 1) * 2) + ValueIndent =3D " " * ((Root.Level * 2 + 1) * = 2) + f.write(KeyIndent + "- guidop:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Cond= ition}'\n") + f.write( + f"{ValueIndent}guid: '{{{Info.Guid.Data1:#x},= {Info.Guid.Data2:#x}, {Info.Guid.Data3:#x}, {{ {', '.join(f'{x:#x}' for x = in Info.Guid.Data4)}}}}}' \n" + ) + if Root.Data.GetDataType() !=3D "": + f.write(f"{ValueIndent}{Root.Data.GetDataType(= )}: \n") + for data in Root.Data.GetFieldList(): + f.write(f"{ValueIndent} {data[0]}: {data= [1]:#x}\n") + + if Root.OpCode =3D=3D EFI_IFR_NO_SUBMIT_IF_OP: + f.write(KeyIndent + "- nosubmitif:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(f"{ValueIndent}prompt: '{self._DisplayUniStr(I= nfo.Error)}'\n") + if Root.Data.FlagsStream !=3D "": + f.write(ValueIndent + "flags: " + Root.Data.Flags= Stream + "\n") + f.write(f"{ValueIndent}expression: '{Root.Expression}= '\n") + + if Root.OpCode =3D=3D EFI_IFR_READ_OP: + f.write(KeyIndent + "- read:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(f"{ValueIndent}expression: '{Root.Expression}= '\n") + + if Root.OpCode =3D=3D EFI_IFR_WRITE_OP: + f.write(KeyIndent + "- write:\n") + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(f"{ValueIndent}expression: '{Root.Expression}= '\n") + + if Root.OpCode =3D=3D EFI_IFR_VALUE_OP and Root.Parent.OpC= ode !=3D EFI_IFR_DEFAULT_OP: # + f.write(KeyIndent + "- value:\n") + f.write(f"{ValueIndent}expression: '{Root.Expression}= '\n") + + if Root.OpCode =3D=3D EFI_IFR_MODAL_TAG_OP: + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(KeyIndent + "- modal: null\n") + + if Root.OpCode =3D=3D EFI_IFR_LOCKED_OP: + if Root.Condition is not None: + f.write(f"{ValueIndent}condition: '{Root.Conditio= n}'\n") + f.write(KeyIndent + "- locked: null\n") + + if Root.OpCode =3D=3D EFI_IFR_SUPPRESS_IF_OP: + f.write(KeyIndent + "- suppressif:\n") + f.write(f"{ValueIndent}expression: '{Root.Expression}= '\n") + if len(Root.Child) > 2 and Root.Child[len(Root.Child) = - 2].OpCode not in ExpOps: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_DISABLE_IF_OP: + # If the disable node is inserted after the formset en= ds, do not show it in source yml + # use the expression content to tell if the disable n= ode is inserted after the formset ends + if Root.Expression is not None: + f.write(KeyIndent + "- disableif:\n") + f.write(f"{ValueIndent}expression: '{Root.Express= ion}'\n") + if ( + len(Root.Child) > 2 + and Root.Child[len(Root.Child) - 2].OpCode not= in ExpOps + ): + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_GRAY_OUT_IF_OP: + f.write(KeyIndent + "- grayoutif:\n") + f.write(f"{ValueIndent}expression: '{Root.Expression}= '\n") + if len(Root.Child) > 2 and Root.Child[len(Root.Child) = - 2].OpCode not in ExpOps: + f.write(ValueIndent + "component: \n") + + if Root.OpCode =3D=3D EFI_IFR_INCONSISTENT_IF_OP: + f.write(KeyIndent + "- inconsistentif:\n") + f.write(f"{ValueIndent}expression: '{Root.Expression}= '\n") + f.write(f"{ValueIndent}prompt: '{self._DisplayUniStr(I= nfo.Error)}'\n") + if Root.Data.FlagsStream !=3D "": + f.write(ValueIndent + "flags: " + Root.Data.Flags= Stream + "\n") + self.LastOp =3D Root.OpCode + + except Exception: + EdkLogger.error( + "VfrCompiler", + FILE_WRITE_FAILURE, + "File write failed for %s" % (self.Options.YamlFileName), + None, + ) + + if Root.Child !=3D []: + for ChildNode in Root.Child: + if Root.OpCode in ConditionOps: + ChildNode.Level =3D Root.Level + 1 + elif type(Root.Data) =3D=3D IfrGuid and ( + ChildNode.OpCode in [EFI_IFR_CHECKBOX_OP, EFI_IFR_NUME= RIC_OP, EFI_IFR_ONE_OF_OP] + ): + ChildNode.Level =3D Root.Level + else: + ChildNode.Level =3D Root.Level + 1 + + self._DumpYamlForXMLCLIDfs(ChildNode, f) + + return diff --git a/BaseTools/Source/Python/VfrCompiler/IfrUtility.py b/BaseTools/= Source/Python/VfrCompiler/IfrUtility.py new file mode 100644 index 0000000000..3c5cec25ce --- /dev/null +++ b/BaseTools/Source/Python/VfrCompiler/IfrUtility.py @@ -0,0 +1,2226 @@ +## @file +# Vfr common library functions. +# +# Copyright (c) 2022-, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## +import os +from enum import Enum +from VfrCompiler.IfrCtypes import * +from VfrCompiler.IfrError import gVfrErrorHandle, VfrReturnCode +from VfrCompiler.IfrCommon import EFI_SUCCESS, EFI_NOT_FOUND, RETURN_SUCCE= SS +from abc import ABCMeta, abstractmethod +from Common.LongFilePathSupport import LongFilePath + +VFR_PACK_SHOW =3D 0x02 +VFR_PACK_ASSIGN =3D 0x01 +VFR_PACK_PUSH =3D 0x04 +VFR_PACK_POP =3D 0x08 +DEFAULT_PACK_ALIGN =3D 0x8 +DEFAULT_ALIGN =3D 1 +ZERO_ALIGN =3D 0 +MAX_PACK_ALIGN =3D 0x10 +MAX_NAME_LEN =3D 64 +MAX_BIT_WIDTH =3D 32 +EFI_VARSTORE_ID_MAX =3D 0xFFFF +EFI_BITS_SHIFT_PER_UINT32 =3D 0x5 +EFI_BITS_PER_UINT32 =3D 1 << EFI_BITS_SHIFT_PER_UINT32 +EFI_FREE_VARSTORE_ID_BITMAP_SIZE =3D int((EFI_VARSTORE_ID_MAX + 1) / EFI_B= ITS_PER_UINT32) + + +class SVfrPackStackNode: + def __init__(self, Identifier, Number): + self.Identifier =3D Identifier + self.Number =3D Number + self.Next =3D None + + def Match(self, Identifier): + if Identifier is None: + return True + elif self.Identifier is None: + return False + return self.Identifier =3D=3D Identifier + + +class SVfrDataType: + def __init__(self, TypeName=3D""): + self.TypeName =3D TypeName + self.Type =3D 0 + self.Align =3D 1 + self.TotalSize =3D 0 + self.HasBitField =3D False + self.Members =3D None + self.Next =3D None + + +class SVfrDataField: + def __init__(self, FieldName=3DNone): + self.FieldName =3D FieldName + self.FieldType =3D None + self.Offset =3D 0 + self.ArrayNum =3D 0 + self.IsBitField =3D False + self.BitWidth =3D 0 + self.BitOffset =3D 0 + self.Next =3D None + + +class InternalTypes: + def __init__(self, TypeName, Type, Size, Align): + self.TypeName =3D TypeName + self.Type =3D Type + self.Size =3D Size + self.Align =3D Align + + +gInternalTypesTable =3D [ + InternalTypes("UINT64", EFI_IFR_TYPE_NUM_SIZE_64, sizeof(c_ulonglong),= sizeof(c_ulonglong)), + InternalTypes("UINT32", EFI_IFR_TYPE_NUM_SIZE_32, sizeof(c_ulong), siz= eof(c_ulong)), + InternalTypes("UINT16", EFI_IFR_TYPE_NUM_SIZE_16, sizeof(c_ushort), si= zeof(c_ushort)), + InternalTypes("UINT8", EFI_IFR_TYPE_NUM_SIZE_8, sizeof(c_ubyte), sizeo= f(c_ubyte)), + InternalTypes("BOOLEAN", EFI_IFR_TYPE_BOOLEAN, sizeof(c_ubyte), sizeof= (c_ubyte)), + InternalTypes("EFI_GUID", EFI_IFR_TYPE_OTHER, sizeof(EFI_GUID), sizeof= (c_ubyte * 8)), + InternalTypes("EFI_HII_DATE", EFI_IFR_TYPE_DATE, sizeof(EFI_HII_DATE),= sizeof(c_ushort)), + InternalTypes("EFI_STRING_ID", EFI_IFR_TYPE_STRING, sizeof(c_ushort), = sizeof(c_ushort)), + InternalTypes("EFI_HII_TIME", EFI_IFR_TYPE_TIME, sizeof(EFI_HII_TIME),= sizeof(c_ubyte)), + InternalTypes("EFI_HII_REF", EFI_IFR_TYPE_REF, sizeof(EFI_HII_REF), si= zeof(EFI_GUID)), +] + + +class VfrVarDataTypeDB: + def __init__(self): + self.PackAlign =3D DEFAULT_PACK_ALIGN + self.PackStack =3D None + self.DataTypeList =3D None + self.NewDataType =3D None + self.CurrDataType =3D None + self.CurrDataField =3D None + self.FirstNewDataTypeName =3D None + self.InternalTypesListInit() + + def Clear(self): + self.PackAlign =3D DEFAULT_PACK_ALIGN + self.PackStack =3D None + self.DataTypeList =3D None + self.NewDataType =3D None + self.CurrDataType =3D None + self.CurrDataField =3D None + self.FirstNewDataTypeName =3D None + self.InternalTypesListInit() + + def InternalTypesListInit(self): + for i in range(0, len(gInternalTypesTable)): + pNewType =3D SVfrDataType() + pNewType.TypeName =3D gInternalTypesTable[i].TypeName + pNewType.Type =3D gInternalTypesTable[i].Type + pNewType.Align =3D gInternalTypesTable[i].Align + pNewType.TotalSize =3D gInternalTypesTable[i].Size + + if gInternalTypesTable[i].TypeName =3D=3D "EFI_HII_DATE": + pYearField =3D SVfrDataField() + pMonthField =3D SVfrDataField() + pDayField =3D SVfrDataField() + + pYearField.FieldName =3D "Year" + pYearField.FieldType, _ =3D self.GetDataType("UINT16") + pYearField.Offset =3D 0 + pYearField.Next =3D pMonthField + pYearField.ArrayNum =3D 0 + pYearField.IsBitField =3D False + + pMonthField.FieldName =3D "Month" + pMonthField.FieldType, _ =3D self.GetDataType("UINT8") + pMonthField.Offset =3D 2 + pMonthField.Next =3D pDayField + pMonthField.ArrayNum =3D 0 + pMonthField.IsBitField =3D False + + pDayField.FieldName =3D "Day" + pDayField.FieldType, _ =3D self.GetDataType("UINT8") + pDayField.Offset =3D 3 + pDayField.Next =3D None + pDayField.ArrayNum =3D 0 + pDayField.IsBitField =3D False + + pNewType.Members =3D pYearField + + elif gInternalTypesTable[i].TypeName =3D=3D "EFI_HII_TIME": + pHoursField =3D SVfrDataField() + pMinutesField =3D SVfrDataField() + pSecondsField =3D SVfrDataField() + + pHoursField.FieldName =3D "Hours" + pHoursField.FieldType, _ =3D self.GetDataType("UINT8") + pHoursField.Offset =3D 0 + pHoursField.Next =3D pMinutesField + pHoursField.ArrayNum =3D 0 + pHoursField.IsBitField =3D False + + pMinutesField.FieldName =3D "Minutes" + pMinutesField.FieldType, _ =3D self.GetDataType("UINT8") + pMinutesField.Offset =3D 1 + pMinutesField.Next =3D pSecondsField + pMinutesField.ArrayNum =3D 0 + pMinutesField.IsBitField =3D False + + pSecondsField.FieldName =3D "Seconds" + pSecondsField.FieldType, _ =3D self.GetDataType("UINT8") + pSecondsField.Offset =3D 2 + pSecondsField.Next =3D None + pSecondsField.ArrayNum =3D 0 + pSecondsField.IsBitField =3D False + + pNewType.Members =3D pHoursField + + elif gInternalTypesTable[i].TypeName =3D=3D "EFI_HII_REF": + pQuestionIdField =3D SVfrDataField() + pFormIdField =3D SVfrDataField() + pFormSetGuidField =3D SVfrDataField() + pDevicePathField =3D SVfrDataField() + + pQuestionIdField.FieldName =3D "QuestionId" + pQuestionIdField.FieldType, _ =3D self.GetDataType("UINT16= ") + pQuestionIdField.Offset =3D 0 + pQuestionIdField.Next =3D pFormIdField + pQuestionIdField.ArrayNum =3D 0 + pQuestionIdField.IsBitField =3D False + + pFormIdField.FieldName =3D "FormId" + pFormIdField.FieldType, _ =3D self.GetDataType("UINT16") + pFormIdField.Offset =3D 2 + pFormIdField.Next =3D pFormSetGuidField + pFormIdField.ArrayNum =3D 0 + pFormIdField.IsBitField =3D False + + pFormSetGuidField.FieldName =3D "FormSetGuid" + pFormSetGuidField.FieldType, _ =3D self.GetDataType("EFI_G= UID") + pFormSetGuidField.Offset =3D 4 + pFormSetGuidField.Next =3D pDevicePathField + pFormSetGuidField.ArrayNum =3D 0 + pFormSetGuidField.IsBitField =3D False + + pDevicePathField.FieldName =3D "DevicePath" + pDevicePathField.FieldType, _ =3D self.GetDataType("EFI_ST= RING_ID") + pDevicePathField.Offset =3D 20 + pDevicePathField.Next =3D None + pDevicePathField.ArrayNum =3D 0 + pDevicePathField.IsBitField =3D False + + pNewType.Members =3D pQuestionIdField + + pNewType.Next =3D None + pNewType.Next =3D self.DataTypeList + self.DataTypeList =3D pNewType + pNewType =3D None + + def GetDataTypeList(self): + return self.DataTypeList + + def Pack(self, LineNum, Action, Identifier=3DNone, Number=3DDEFAULT_PA= CK_ALIGN): + if Action & VFR_PACK_SHOW: + Msg =3D str.format("value of pragma pack(show) =3D=3D %d" % (s= elf.PackAlign)) + gVfrErrorHandle.PrintMsg(LineNum, "Warning", Msg) + + if Action & VFR_PACK_PUSH: + pNew =3D SVfrPackStackNode(Identifier, self.PackAlign) + if pNew is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + pNew.Next =3D self.PackStack + self.PackStack =3D pNew + + if Action & VFR_PACK_POP: + pNode =3D None + if self.PackStack is None: + gVfrErrorHandle.PrintMsg(LineNum, "Error", "#pragma pack(p= op...) : more pops than pushes") + + pNode =3D self.PackStack + while pNode is not None: + if pNode.Match(Identifier) is True: + self.PackAlign =3D pNode.Number + self.PackStack =3D pNode.Next + pNode =3D pNode.Next + + if Action & VFR_PACK_ASSIGN: + PackAlign =3D (Number + Number % 2) if (Number > 1) else Numbe= r + if PackAlign =3D=3D ZERO_ALIGN or PackAlign > MAX_PACK_ALIGN: + gVfrErrorHandle.PrintMsg(LineNum, "Error", "expected pragm= a parameter to be '1', '2', '4', '8', or '16'") + else: + self.PackAlign =3D PackAlign + + return VfrReturnCode.VFR_RETURN_SUCCESS + + def DeclareDataTypeBegin(self): + pNewType =3D SVfrDataType() + + pNewType.TypeName =3D "" + pNewType.Type =3D EFI_IFR_TYPE_OTHER + pNewType.Align =3D DEFAULT_ALIGN + pNewType.TotalSize =3D 0 + pNewType.HasBitField =3D False + pNewType.Members =3D None + pNewType.Next =3D None + self.NewDataType =3D pNewType + + def SetNewTypeType(self, Type): + if self.NewDataType is None: + return VfrReturnCode.VFR_RETURN_ERROR_SKIPED + + if Type is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + # need to limit the value of the type + self.NewDataType.Type =3D Type + + return VfrReturnCode.VFR_RETURN_SUCCESS + + def SetNewTypeTotalSize(self, Size): + self.NewDataType.TotalSize =3D Size + + def SetNewTypeAlign(self, Align): + self.NewDataType.Align =3D Align + + def SetNewTypeName(self, TypeName): + if self.NewDataType is None: + return VfrReturnCode.VFR_RETURN_ERROR_SKIPED + + if TypeName is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + if len(TypeName) >=3D MAX_NAME_LEN: + return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER + + pType =3D self.DataTypeList + while pType is not None: + if pType.TypeName =3D=3D TypeName: + return VfrReturnCode.VFR_RETURN_REDEFINED + pType =3D pType.Next + + self.NewDataType.TypeName =3D TypeName + return VfrReturnCode.VFR_RETURN_SUCCESS + + def AlignStuff(self, Size, Align): + return Align - (Size) % (Align) + + def DeclareDataTypeEnd(self): + if self.NewDataType.TypeName =3D=3D "": + return + + if self.NewDataType.TotalSize % self.NewDataType.Align !=3D 0: + self.NewDataType.TotalSize +=3D self.AlignStuff(self.NewDataTy= pe.TotalSize, self.NewDataType.Align) + self.NewDataType.Next =3D self.DataTypeList + self.DataTypeList =3D self.NewDataType + if self.FirstNewDataTypeName is None: + self.FirstNewDataTypeName =3D self.NewDataType.TypeName + + self.NewDataType =3D None + + # two definitions + def GetDataTypeSizeByTypeName(self, TypeName): + Size =3D 0 + pDataType =3D self.DataTypeList + while pDataType is not None: + if pDataType.TypeName =3D=3D TypeName: + Size =3D pDataType.TotalSize + return Size, VfrReturnCode.VFR_RETURN_SUCCESS + pDataType =3D pDataType.Next + + return Size, VfrReturnCode.VFR_RETURN_UNDEFINED + + def GetDataTypeSizeByDataType(self, DataType): + Size =3D 0 + DataType =3D DataType & 0x0F + # For user defined data type, the size can't be got by this functi= on. + if DataType =3D=3D EFI_IFR_TYPE_OTHER: + return Size, VfrReturnCode.VFR_RETURN_SUCCESS + pDataType =3D self.DataTypeList + while pDataType is not None: + if DataType =3D=3D pDataType.Type: + Size =3D pDataType.TotalSize + return Size, VfrReturnCode.VFR_RETURN_SUCCESS + pDataType =3D pDataType.Next + + return Size, VfrReturnCode.VFR_RETURN_UNDEFINED + + def ExtractStructTypeName(self, VarStr): + try: + index =3D VarStr.index(".") + except ValueError: + return VarStr, len(VarStr) + else: + return VarStr[0:index], index + 1 + + def ExtractFieldNameAndArrary(self, VarStr, s): + ArrayIdx =3D INVALID_ARRAY_INDEX + s_copy =3D s + while s < len(VarStr) and VarStr[s] !=3D "." and VarStr[s] !=3D "[= " and VarStr[s] !=3D "]": + s +=3D 1 + + FName =3D VarStr[s_copy:s] + + if s =3D=3D len(VarStr): + return ArrayIdx, s, FName, VfrReturnCode.VFR_RETURN_SUCCESS + + if VarStr[s] =3D=3D ".": + s +=3D 1 + return ArrayIdx, s, FName, VfrReturnCode.VFR_RETURN_SUCCESS + + if VarStr[s] =3D=3D "[": + s +=3D 1 + try: + e =3D s + VarStr[s:].index("]") + + except ValueError: + return None, None, None, VfrReturnCode.VFR_RETURN_DATA_STR= ING_ERROR + else: + ArrayStr =3D VarStr[s:e] + ArrayIdx =3D int(ArrayStr) + if VarStr[e] =3D=3D "]": + e +=3D 1 + if e < len(VarStr) and (VarStr[e] =3D=3D "."): + e +=3D 1 + return ArrayIdx, e, FName, VfrReturnCode.VFR_RETURN_SUCCES= S + + if VarStr[s] =3D=3D "]": + return None, None, None, VfrReturnCode.VFR_RETURN_DATA_STRING_= ERROR + + return ArrayIdx, s, FName, VfrReturnCode.VFR_RETURN_SUCCESS + + def GetTypeField(self, FName, Type): + if FName is None or Type is None: + return None, VfrReturnCode.VFR_RETURN_FATAL_ERROR + + pField =3D Type.Members + while pField is not None: + if Type.Type =3D=3D EFI_IFR_TYPE_TIME: + if FName =3D=3D "Hour": + FName =3D "Hours" + elif FName =3D=3D "Minute": + FName =3D=3D "Minutes" + elif FName =3D=3D "Second": + FName =3D "Seconds" + if pField.FieldName =3D=3D FName: + Field =3D pField + return Field, VfrReturnCode.VFR_RETURN_SUCCESS + + pField =3D pField.Next + + return None, VfrReturnCode.VFR_RETURN_UNDEFINED + + def IsThisBitField(self, VarStrName): + TName, i =3D self.ExtractStructTypeName(VarStrName) + pType, ReturnCode =3D self.GetDataType(TName) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return None, ReturnCode + pField =3D None + while i < len(VarStrName): + # i start from field + _, i, FName, ReturnCode =3D self.ExtractFieldNameAndArrary(Var= StrName, i) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return None, ReturnCode + pField, ReturnCode =3D self.GetTypeField(FName, pType) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return None, ReturnCode + pType =3D pField.FieldType + + if pField is not None and pField.IsBitField: + return True, ReturnCode + return False, ReturnCode + + def GetFieldOffset(self, Field, ArrayIdx, IsBitField): + if Field is None: + return None, VfrReturnCode.VFR_RETURN_FATAL_ERROR + + if (ArrayIdx !=3D INVALID_ARRAY_INDEX) and (Field.ArrayNum =3D=3D = 0 or Field.ArrayNum <=3D ArrayIdx): + return None, VfrReturnCode.VFR_RETURN_ERROR_ARRARY_NUM + + Idx =3D 0 if ArrayIdx =3D=3D INVALID_ARRAY_INDEX else ArrayIdx + if IsBitField: + Offset =3D Field.BitOffset + Field.FieldType.TotalSize * Idx *= 8 + else: + Offset =3D Field.Offset + Field.FieldType.TotalSize * Idx + + return Offset, VfrReturnCode.VFR_RETURN_SUCCESS + + def GetFieldWidth(self, Field): + if Field is None: + return 0 + return Field.FieldType.Type + + def GetFieldSize(self, Field, ArrayIdx, BitField): + if Field is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + if (ArrayIdx =3D=3D INVALID_ARRAY_INDEX) and (Field.ArrayNum !=3D = 0): + return Field.FieldType.TotalSize * Field.ArrayNum + elif BitField: + return Field.BitWidth + return Field.FieldType.TotalSize + + def GetDataFieldInfo(self, VarStr): + # VarStr -> Type.Field + Offset =3D 0 + Type =3D EFI_IFR_TYPE_OTHER + Size =3D 0 + BitField =3D False + + TName, i =3D self.ExtractStructTypeName(VarStr) + + pType, ReturnCode =3D self.GetDataType(TName) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return Offset, Type, Size, BitField, ReturnCode + + BitField, ReturnCode =3D self.IsThisBitField(VarStr) + + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return Offset, Type, Size, BitField, ReturnCode + + # if it is not struct data type + Type =3D pType.Type + Size =3D pType.TotalSize + + while i < len(VarStr): + ArrayIdx, i, FName, ReturnCode =3D self.ExtractFieldNameAndArr= ary(VarStr, i) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return Offset, Type, Size, BitField, ReturnCode + pField, ReturnCode =3D self.GetTypeField(FName, pType) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return Offset, Type, Size, BitField, ReturnCode + pType =3D pField.FieldType + Tmp, ReturnCode =3D self.GetFieldOffset(pField, ArrayIdx, pFie= ld.IsBitField) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return Offset, Type, Size, BitField, ReturnCode + + if BitField and pField.IsBitField is False: + Offset =3D int(Offset + Tmp * 8) + else: + Offset =3D int(Offset + Tmp) + + Type =3D self.GetFieldWidth(pField) + Size =3D self.GetFieldSize(pField, ArrayIdx, BitField) + + return Offset, Type, Size, BitField, VfrReturnCode.VFR_RETURN_SUCC= ESS + + + def DataTypeAddField(self, FieldName, TypeName, ArrayNum, FieldInUnion= ): + pFieldType, ReturnCode =3D self.GetDataType(TypeName) + + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + + MaxDataTypeSize =3D self.NewDataType.TotalSize + + if len(FieldName) >=3D MAX_NAME_LEN: + return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER + + pTmp =3D self.NewDataType.Members + while pTmp is not None: + if pTmp.FieldName =3D=3D FieldName: + return VfrReturnCode.VFR_RETURN_REDEFINED + pTmp =3D pTmp.Next + + Align =3D min(self.PackAlign, pFieldType.Align) + pNewField =3D SVfrDataField() + if pNewField is None: + return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + pNewField.FieldName =3D FieldName + pNewField.FieldType =3D pFieldType + pNewField.ArrayNum =3D ArrayNum + pNewField.IsBitField =3D False + + if self.NewDataType.TotalSize % Align =3D=3D 0: + pNewField.Offset =3D self.NewDataType.TotalSize + else: + pNewField.Offset =3D self.NewDataType.TotalSize + self.AlignSt= uff(self.NewDataType.TotalSize, Align) + + if self.NewDataType.Members is None: + self.NewDataType.Members =3D pNewField + pNewField.Next =3D None + else: + pTmp =3D self.NewDataType.Members + while pTmp.Next is not None: + pTmp =3D pTmp.Next + pTmp.Next =3D pNewField + pNewField.Next =3D None + + self.NewDataType.Align =3D min(self.PackAlign, max(pFieldType.Alig= n, self.NewDataType.Align)) + + if FieldInUnion: + if MaxDataTypeSize < pNewField.FieldType.TotalSize: + self.NewDataType.TotalSize =3D pNewField.FieldType.TotalSi= ze + pNewField.Offset =3D 0 + else: + Num =3D ArrayNum if ArrayNum !=3D 0 else 1 + self.NewDataType.TotalSize =3D pNewField.Offset + (pNewField.F= ieldType.TotalSize) * Num + + return VfrReturnCode.VFR_RETURN_SUCCESS + + def DataTypeAddBitField(self, FieldName, TypeName, Width, FieldInUnion= ): + pFieldType, ReturnCode =3D self.GetDataType(TypeName) + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + + if Width > MAX_BIT_WIDTH: + return VfrReturnCode.VFR_RETURN_BIT_WIDTH_ERROR + + if Width > (pFieldType.TotalSize) * 8: + return VfrReturnCode.VFR_RETURN_BIT_WIDTH_ERROR + + if (FieldName is not None) and (len(FieldName) >=3D MAX_NAME_LEN): + return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER + + if Width =3D=3D 0 and FieldName is not None: + return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER + + pTmp =3D self.NewDataType.Members + while pTmp is not None: + if FieldName is not None and pTmp.FieldName =3D=3D FieldName: + return VfrReturnCode.VFR_RETURN_REDEFINED + pTmp =3D pTmp.Next + + Align =3D min(self.PackAlign, pFieldType.Align) + UpdateTotalSize =3D False + + pNewField =3D SVfrDataField() + if pNewField is None: + return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + MaxDataTypeSize =3D self.NewDataType.TotalSize + + pNewField.FieldName =3D FieldName + pNewField.FieldType =3D pFieldType + pNewField.IsBitField =3D True + pNewField.BitWidth =3D Width + pNewField.ArrayNum =3D 0 + pNewField.BitOffset =3D 0 + pNewField.Offset =3D 0 + + if self.NewDataType.Members is None: + self.NewDataType.Members =3D pNewField + pNewField.Next =3D None + else: + pTmp =3D self.NewDataType.Members + while pTmp.Next is not None: + pTmp =3D pTmp.Next + pTmp.Next =3D pNewField + pNewField.Next =3D None + + if FieldInUnion: + pNewField.Offset =3D 0 + if MaxDataTypeSize < pNewField.FieldType.TotalSize: + self.NewDataType.TotalSize =3D pNewField.FieldType.TotalSi= ze + else: + # Check whether the bit fields can be contained within one Fie= ldType. + cond1 =3D (pTmp is not None) and (pTmp.IsBitField) and (pTmp.F= ieldType.TypeName =3D=3D pNewField.FieldType.TypeName) + cond2 =3D (pTmp is not None) and (pTmp.BitOffset - pTmp.Offset= * 8 + pTmp.BitWidth + pNewField.BitWidth <=3D pNewField.FieldType.TotalSiz= e * 8) + if cond1 and cond2: + pNewField.BitOffset =3D pTmp.BitOffset + pTmp.BitWidth + pNewField.Offset =3D pTmp.Offset + + if pNewField.BitWidth =3D=3D 0: + pNewField.BitWidth =3D pNewField.FieldType.TotalSize *= 8 - (pNewField.BitOffset - pTmp.Offset * 8) + else: + pNewField.BitOffset =3D self.NewDataType.TotalSize * 8 + UpdateTotalSize =3D True + + if UpdateTotalSize: + if self.NewDataType.TotalSize % Align =3D=3D 0: + pNewField.Offset =3D self.NewDataType.TotalSize + else: + pNewField.Offset =3D self.NewDataType.TotalSize + self.Ali= gnStuff(self.NewDataType.TotalSize, Align) + self.NewDataType.TotalSize =3D pNewField.Offset + pNewField.Fi= eldType.TotalSize + + self.NewDataType.Align =3D min(self.PackAlign, max(pFieldType.Alig= n, self.NewDataType.Align)) + self.NewDataType.HasBitField =3D True + return VfrReturnCode.VFR_RETURN_SUCCESS + + def GetDataType(self, TypeName): + if TypeName is None: + return None, VfrReturnCode.VFR_RETURN_ERROR_SKIPED + + DataType =3D self.DataTypeList + while DataType is not None: + if DataType.TypeName =3D=3D TypeName: + return DataType, VfrReturnCode.VFR_RETURN_SUCCESS + DataType =3D DataType.Next + return None, VfrReturnCode.VFR_RETURN_UNDEFINED + + def DataTypeHasBitField(self, TypeName): + if TypeName is None: + return False + + pType =3D self.DataTypeList + while pType is not None: + if pType.TypeName =3D=3D TypeName: + break + pType =3D pType.Next + + if pType is None: + return False + + pTmp =3D pType.Members + while pTmp is not None: + if pTmp.IsBitField: + return True + pTmp =3D pTmp.Next + return False + + def Dump(self, f): + f.write("\n\n*************\n") + f.write("\t\tPackAlign =3D " + str(self.PackAlign) + "\n") + pNode =3D self.DataTypeList + while pNode is not None: + f.write("\t\tstruct {} : Align : [{}] TotalSize : [{:#x}]\n\n= ".format(pNode.TypeName, pNode.Align, pNode.TotalSize)) + f.write("\t\tstruct {}".format(str(pNode.TypeName)) + "\t{\n") + FNode =3D pNode.Members + while FNode is not None: + if FNode.ArrayNum > 0: + f.write("\t\t\t+{:0>8d}[{:0>8x}] {}[{}] <{}>\n".format= (FNode.Offset, FNode.Offset, FNode.FieldName, FNode.ArrayNum, FNode.FieldTy= pe.TypeName)) + f.write("\t\t\t+{:0>8d}[{:0>8x}] {}[{}] <{}>\n".format= (FNode.Offset, FNode.BitOffset, FNode.FieldName, FNode.ArrayNum, FNode.Fiel= dType.TypeName)) + elif FNode.FieldName is not None: + f.write("\t\t\t+{:0>8d}[{:0>8x}] {} <{}>\n".format(FNo= de.Offset, FNode.Offset, FNode.FieldName, FNode.FieldType.TypeName)) + f.write("\t\t\t+{:0>8d}[{:0>8x}] {} <{}>\n".format(FNo= de.Offset, FNode.BitOffset, FNode.FieldName, FNode.FieldType.TypeName)) + else: + f.write("\t\t\t+{:0>8d}[{:0>8x}] <{}>\n".format(FNode.= Offset, FNode.Offset, FNode.FieldType.TypeName)) + f.write("\t\t\t+{:0>8d}[{:0>8x}] <{}>\n".format(FNode.= Offset, FNode.BitOffset, FNode.FieldType.TypeName)) + FNode =3D FNode.Next + f.write("\t\t};\n") + f.write("-----------------------------------------------------= ----------\n") + pNode =3D pNode.Next + f.write("*********************************************************= ******\n") + + +class SVfrDefaultStoreNode: + def __init__(self, ObjAddr=3DNone, RefName=3D"", DefaultStoreNameId=3D= 0, DefaultId=3D0): + self.ObjAddr =3D ObjAddr + self.RefName =3D RefName + self.DefaultStoreNameId =3D DefaultStoreNameId + self.DefaultId =3D DefaultId + self.Next =3D None + + +class VfrDefaultStore: + def __init__(self): + self.DefaultStoreList =3D None + + def Clear(self): + self.DefaultStoreList =3D None + + def RegisterDefaultStore(self, ObjAddr: EFI_IFR_DEFAULTSTORE, RefName,= DefaultStoreNameId, DefaultId): + if RefName =3D=3D "" or RefName is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + pNode =3D self.DefaultStoreList + while pNode is not None: + if pNode.RefName =3D=3D RefName: + return VfrReturnCode.VFR_RETURN_REDEFINED + pNode =3D pNode.Next + + pNode =3D SVfrDefaultStoreNode(ObjAddr, RefName, DefaultStoreNameI= d, DefaultId) + + if pNode is None: + return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + pNode.Next =3D self.DefaultStoreList + self.DefaultStoreList =3D pNode + + return VfrReturnCode.VFR_RETURN_SUCCESS + + def UpdateDefaultType(self, DefaultNode): + pNode =3D self.DefaultStoreList + while pNode is not None: + if pNode.ObjAddr.DefaultId =3D=3D DefaultNode.Data.GetDefaultI= d(): + DefaultNode.Data.SetType(pNode.RefName) + pNode =3D pNode.Next + + def DefaultIdRegistered(self, DefaultId): + pNode =3D self.DefaultStoreList + while pNode is not None: + if pNode.DefaultId =3D=3D DefaultId: + return True + pNode =3D pNode.Next + + return False + + def ReRegisterDefaultStoreById(self, DefaultId, RefName, DefaultStoreN= ameId): + pNode =3D self.DefaultStoreList + while pNode is not None: + if pNode.DefaultId =3D=3D DefaultId: + break + pNode =3D pNode.Next + + if pNode is None: + return None, VfrReturnCode.VFR_RETURN_UNDEFINED + + if pNode.DefaultStoreNameId =3D=3D EFI_STRING_ID_INVALID: + pNode.DefaultStoreNameId =3D DefaultStoreNameId + pNode.RefName =3D RefName + if pNode.ObjAddr is not None: + pNode.ObjAddr.DefaultName =3D DefaultStoreNameId + else: + return None, VfrReturnCode.VFR_RETURN_REDEFINED + + return pNode, VfrReturnCode.VFR_RETURN_SUCCESS + + def GetDefaultId(self, RefName): + pTmp =3D self.DefaultStoreList + while pTmp is not None: + if pTmp.RefName =3D=3D RefName: + DefaultId =3D pTmp.DefaultId + return DefaultId, VfrReturnCode.VFR_RETURN_SUCCESS + pTmp =3D pTmp.Next + return None, VfrReturnCode.VFR_RETURN_UNDEFINED + + def BufferVarStoreAltConfigAdd(self, DefaultId, BaseInfo, VarStoreName= , VarStoreGuid, Type, Value): + if VarStoreName is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + pNode =3D self.DefaultStoreList + while pNode is not None: + if pNode.DefaultId =3D=3D DefaultId: + break + pNode =3D pNode.Next + if pNode is None: + return VfrReturnCode.VFR_RETURN_UNDEFINED + gVfrBufferConfig.Open() + if gVfrBufferConfig.Select(VarStoreName, VarStoreGuid) =3D=3D 0: + Returnvalue =3D gVfrBufferConfig.Write( + "a", + VarStoreName, + VarStoreGuid, + pNode.DefaultId, + Type, + BaseInfo.Info.VarOffset, + BaseInfo.VarTotalSize, + Value, + ) + if Returnvalue !=3D 0: + gVfrBufferConfig.Close() + return VfrReturnCode(Returnvalue) + gVfrBufferConfig.Close() + return VfrReturnCode.VFR_RETURN_SUCCESS + + +class EFI_VFR_VARSTORE_TYPE(Enum): + EFI_VFR_VARSTORE_INVALID =3D 0 + EFI_VFR_VARSTORE_BUFFER =3D 1 + EFI_VFR_VARSTORE_EFI =3D 2 + EFI_VFR_VARSTORE_NAME =3D 3 + EFI_VFR_VARSTORE_BUFFER_BITS =3D 4 + + +class EfiVar: + def __init__(self, VarName=3D0, VarSize=3D0): + self.EfiVarName =3D VarName + self.EfiVarSize =3D VarSize + + +DEFAULT_NAME_TABLE_ITEMS =3D 1024 + + +class SVfrVarStorageNode: + def __init__( + self, + VarStoreName=3D"", + VarStoreId=3D0, + Guid=3DNone, + Attributes=3D0, + Flag=3DTrue, + EfiValue=3DNone, + DataType=3DNone, + BitsVarstore=3DFalse, + ): + self.Guid =3D Guid + self.VarStoreName =3D VarStoreName + self.VarStoreId =3D VarStoreId + self.AssignedFlag =3D Flag + self.Attributes =3D Attributes + self.Next =3D None + self.EfiVar =3D EfiValue + self.DataType =3D DataType + self.NameSpace =3D [] + + if EfiValue is not None: + self.VarstoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_E= FI + elif DataType is not None: + if BitsVarstore: + self.VarstoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTO= RE_BUFFER_BITS + else: + self.VarstoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTO= RE_BUFFER + else: + self.VarstoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_N= AME + + +class SConfigItem: + def __init__(self, Name=3DNone, Guid=3DNone, Id=3DNone, Type=3DNone, O= ffset=3DNone, Width=3DNone, Value=3DNone): + self.Name =3D Name + self.Guid =3D Guid + self.Id =3D Id + if Type is not None: + # list of Offset/Value in the varstore + self.InfoStrList =3D SConfigInfo(Type, Offset, Width, Value) + else: + self.InfoStrList =3D None + self.Next =3D None + + +class SConfigInfo: + def __init__(self, Type, Offset, Width, Value): + self.Type =3D Type + self.Offset =3D Offset + self.Width =3D Width + self.Next =3D None + self.Value =3D Value + + +class VfrBufferConfig: + __metaclass__ =3D ABCMeta + + def __init__(self): + self.ItemListHead =3D None + self.ItemListTail =3D None + self.ItemListPos =3D None + + def GetVarItemList(self): + return self.ItemListHead + + @abstractmethod + def Open(self): + self.ItemListPos =3D self.ItemListHead + + @abstractmethod + def Close(self): + self.ItemListPos =3D None + + @abstractmethod + def Select(self, Name, Guid, Id=3DNone): + if Name is None or Guid is None: + self.ItemListPos =3D self.ItemListHead + return 0 + p =3D self.ItemListHead + while p is not None: + if p.Name !=3D Name or p.Guid.__cmp__(Guid) is False: + p =3D p.Next + continue + if Id is not None: + if p.Id is None or p.Id !=3D Id: + p =3D p.Next + continue + elif p.Id is not None: + p =3D p.Next + continue + self.ItemListPos =3D p + return 0 + return 1 + + @abstractmethod + def Register(self, Name, Guid, Id=3DNone): + if self.Select(Name, Guid) =3D=3D 0: + return 1 + pNew =3D SConfigItem(Name, Guid, Id) + if pNew is None: + return 2 + if self.ItemListHead is None: + self.ItemListHead =3D pNew + self.ItemListTail =3D pNew + else: + self.ItemListTail.Next =3D pNew + self.ItemListTail =3D pNew + self.ItemListPos =3D pNew + return 0 + + @abstractmethod + def Write(self, Mode, Name, Guid, Id, Type, Offset, Width, Value): + Ret =3D self.Select(Name, Guid) + if Ret !=3D 0: + return Ret + + if Mode =3D=3D "a": + if self.Select(Name, Guid, Id) !=3D 0: + pItem =3D SConfigItem(Name, Guid, Id, Type, Offset, Width,= Value) + if pItem is None: + return 2 + + if self.ItemListHead is None: + self.ItemListHead =3D pItem + self.ItemListTail =3D pItem + else: + self.ItemListTail.Next =3D pItem + self.ItemListTail =3D pItem + + self.ItemListPos =3D pItem + + else: + # tranverse the list to find out if there's already the va= lue for the same Offset + pInfo =3D self.ItemListPos.InfoStrList + while pInfo is not None: + if pInfo.Offset =3D=3D Offset: + return 0 + pInfo =3D pInfo.Next + + pInfo =3D SConfigInfo(Type, Offset, Width, Value) + if pInfo is None: + return 2 + + pInfo.Next =3D self.ItemListPos.InfoStrList + self.ItemListPos.InfoStrList =3D pInfo + + elif Mode =3D=3D "d": + if self.ItemListHead =3D=3D self.ItemListPos: + self.ItemListHead =3D self.ItemListPos.Next + + pItem =3D self.ItemListHead + while pItem.Next !=3D self.ItemListPos: + pItem =3D pItem.Next + pItem.Next =3D self.ItemListPos.Next + + if self.ItemListTail =3D=3D self.ItemListPos: + self.ItemListTail =3D pItem + + self.ItemListPos =3D pItem.Next + + elif Mode =3D=3D "i": + if Id is not None: + self.ItemListPos.Id =3D Id + else: + return 1 + return 0 + + +gVfrBufferConfig =3D VfrBufferConfig() + + +class EFI_VARSTORE_INFO(Structure): + _pack_ =3D 1 + _fields_ =3D [ + ("VarStoreId", c_uint16), + ("Info", VarStoreInfoNode), + ("VarType", c_uint8), + ("VarTotalSize", c_uint32), + ("IsBitVar", c_bool), + ] + + def __init__( + self, + VarStoreId=3DEFI_VARSTORE_ID_INVALID, + VarName=3DEFI_STRING_ID_INVALID, + VarOffset=3DEFI_VAROFFSET_INVALID, + VarType=3DEFI_IFR_TYPE_OTHER, + VarTotalSize=3D0, + IsBitVar=3DFalse, + ): + self.VarStoreId =3D VarStoreId + self.Info.VarName =3D VarName + self.Info.VarOffset =3D VarOffset + self.VarTotalSize =3D VarTotalSize + self.IsBitVar =3D IsBitVar + self.VarType =3D VarType + + +class BufferVarStoreFieldInfoNode: + def __init__(self, BaseInfo: EFI_VARSTORE_INFO): + self.VarStoreInfo =3D EFI_VARSTORE_INFO() + self.VarStoreInfo.VarType =3D BaseInfo.VarType + self.VarStoreInfo.VarTotalSize =3D BaseInfo.VarTotalSize + self.VarStoreInfo.Info.VarOffset =3D BaseInfo.Info.VarOffset + self.VarStoreInfo.VarStoreId =3D BaseInfo.VarStoreId + self.Next =3D None + + +class VfrDataStorage: + def __init__(self): + # SVfrVarStorageNode + self.BufferVarStoreList =3D None + self.EfiVarStoreList =3D None + self.NameVarStoreList =3D None + self.CurrVarStorageNode =3D None + self.NewVarStorageNode =3D None + self.BufferFieldInfoListHead =3D None + self.mBufferFieldInfoListTail =3D None + self.FreeVarStoreIdBitMap =3D [] + for i in range(0, EFI_FREE_VARSTORE_ID_BITMAP_SIZE): + self.FreeVarStoreIdBitMap.append(0) + # Question ID0 is reserved + self.FreeVarStoreIdBitMap[0] =3D 0x80000000 + + def Clear(self): + # SVfrVarStorageNode + self.BufferVarStoreList =3D None + self.EfiVarStoreList =3D None + self.NameVarStoreList =3D None + self.CurrVarStorageNode =3D None + self.NewVarStorageNode =3D None + self.BufferFieldInfoListHead =3D None + self.mBufferFieldInfoListTail =3D None + self.FreeVarStoreIdBitMap =3D [] + for _ in range(0, EFI_FREE_VARSTORE_ID_BITMAP_SIZE): + self.FreeVarStoreIdBitMap.append(0) + # Question ID0 is reserved + self.FreeVarStoreIdBitMap[0] =3D 0x80000000 + + def GetBufferVarStoreList(self): + return self.BufferVarStoreList + + def CheckGuidField(self, pNode, StoreGuid, HasFoundOne, ReturnCode): + if StoreGuid is not None: + # If has guid info, compare the guid field. + if pNode.Guid.__cmp__(StoreGuid): + self.CurrVarStorageNode =3D pNode + ReturnCode =3D VfrReturnCode.VFR_RETURN_SUCCESS + return True, ReturnCode, HasFoundOne + else: + # not has Guid field, check whether this name is the only one= . + if HasFoundOne: + # The name has conflict, return name redefined. + ReturnCode =3D VfrReturnCode.VFR_RETURN_VARSTORE_NAME_REDE= FINED_ERROR + return True, ReturnCode, HasFoundOne + + self.CurrVarStorageNode =3D pNode + HasFoundOne =3D True + return False, ReturnCode, HasFoundOne + + def GetVarStoreByDataType(self, DataTypeName, VarGuid): + MatchNode =3D None + pNode =3D self.BufferVarStoreList + while pNode is not None: + if pNode.DataType.TypeName !=3D DataTypeName: + pNode =3D pNode.Next + continue + if VarGuid is not None: + if pNode.Guid.__cmp__(VarGuid): + return pNode, VfrReturnCode.VFR_RETURN_SUCCESS + elif MatchNode is None: + MatchNode =3D pNode + else: + # More than one varstores referred the same data structure= s + return None, VfrReturnCode.VFR_RETURN_VARSTORE_DATATYPE_RE= DEFINED_ERROR + pNode =3D pNode.Next + + if MatchNode is None: + return MatchNode, VfrReturnCode.VFR_RETURN_UNDEFINED + + return MatchNode, VfrReturnCode.VFR_RETURN_SUCCESS + + """ + Base on the input store name and guid to find the varstore id. + If both name and guid are inputed, base on the name and guid to + found the varstore. If only name inputed, base on the name to + found the varstore and go on to check whether more than one varstor= e + has the same name. If only has found one varstore, return this + varstore; if more than one varstore has same name, return varstore + name redefined error. If no varstore found by varstore name, call + function GetVarStoreByDataType and use inputed varstore name as + data type name to search. + """ + + def GetVarStoreId(self, StoreName, StoreGuid=3DNone): + ReturnCode =3D None + HasFoundOne =3D False + self.CurrVarStorageNode =3D None + + pNode =3D self.BufferVarStoreList + while pNode is not None: + if pNode.VarStoreName =3D=3D StoreName: + Result, ReturnCode, HasFoundOne =3D self.CheckGuidField(pN= ode, StoreGuid, HasFoundOne, ReturnCode) + if Result: + VarStoreId =3D self.CurrVarStorageNode.VarStoreId + return VarStoreId, ReturnCode + pNode =3D pNode.Next + + pNode =3D self.EfiVarStoreList + while pNode is not None: + if pNode.VarStoreName =3D=3D StoreName: + Result, ReturnCode, HasFoundOne =3D self.CheckGuidField(pN= ode, StoreGuid, HasFoundOne, ReturnCode) + if Result: + VarStoreId =3D self.CurrVarStorageNode.VarStoreId + return VarStoreId, ReturnCode + pNode =3D pNode.Next + + pNode =3D self.NameVarStoreList + while pNode is not None: + if pNode.VarStoreName =3D=3D StoreName: + Result, ReturnCode, HasFoundOne =3D self.CheckGuidField(pN= ode, StoreGuid, HasFoundOne, ReturnCode) + if Result: + VarStoreId =3D self.CurrVarStorageNode.VarStoreId + return VarStoreId, ReturnCode + pNode =3D pNode.Next + + if HasFoundOne: + VarStoreId =3D self.CurrVarStorageNode.VarStoreId + return VarStoreId, VfrReturnCode.VFR_RETURN_SUCCESS + + VarStoreId =3D EFI_VARSTORE_ID_INVALID + pNode, ReturnCode =3D self.GetVarStoreByDataType(StoreName, StoreG= uid) + if pNode is not None: + self.CurrVarStorageNode =3D pNode + VarStoreId =3D pNode.VarStoreId + + return VarStoreId, ReturnCode + + def GetFreeVarStoreId(self, VarType): + Index =3D 0 + for i in range(0, EFI_FREE_VARSTORE_ID_BITMAP_SIZE): + if self.FreeVarStoreIdBitMap[i] !=3D 0xFFFFFFFF: + Index =3D i + break + if Index =3D=3D EFI_FREE_VARSTORE_ID_BITMAP_SIZE: + return EFI_VARSTORE_ID_INVALID + + Offset =3D 0 + Mask =3D 0x80000000 + while Mask !=3D 0: + if (self.FreeVarStoreIdBitMap[Index] & Mask) =3D=3D 0: + self.FreeVarStoreIdBitMap[Index] |=3D Mask + return (Index << EFI_BITS_SHIFT_PER_UINT32) + Offset + Mask >>=3D 1 + Offset +=3D 1 + return EFI_VARSTORE_ID_INVALID + + def CheckVarStoreIdFree(self, VarStoreId): + Index =3D int(VarStoreId / EFI_BITS_PER_UINT32) + Offset =3D VarStoreId % EFI_BITS_PER_UINT32 + return (self.FreeVarStoreIdBitMap[Index] & (0x80000000 >> Offset))= =3D=3D 0 + + def MarkVarStoreIdUsed(self, VarStoreId): + Index =3D int(VarStoreId / EFI_BITS_PER_UINT32) + Offset =3D VarStoreId % EFI_BITS_PER_UINT32 + self.FreeVarStoreIdBitMap[Index] |=3D 0x80000000 >> Offset + + def DeclareBufferVarStore(self, StoreName, Guid, DataTypeDB, TypeName,= VarStoreId, IsBitVarStore, Attr=3D0, Flag=3DTrue): + if StoreName is None or Guid is None or DataTypeDB is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + _, ReturnCode =3D self.GetVarStoreId(StoreName, Guid) + + if ReturnCode =3D=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return VfrReturnCode.VFR_RETURN_REDEFINED + + DataType, ReturnCode =3D DataTypeDB.GetDataType(TypeName) + + if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return ReturnCode + + if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: + VarStoreId =3D self.GetFreeVarStoreId(EFI_VFR_VARSTORE_TYPE.EF= I_VFR_VARSTORE_BUFFER) + else: + if self.CheckVarStoreIdFree(VarStoreId) is False: + return VfrReturnCode.VFR_RETURN_VARSTOREID_REDEFINED + self.MarkVarStoreIdUsed(VarStoreId) + pNew =3D SVfrVarStorageNode(StoreName, VarStoreId, Guid, Attr, Fla= g, None, DataType, IsBitVarStore) + + if pNew is None: + return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + pNew.Next =3D self.BufferVarStoreList + self.BufferVarStoreList =3D pNew + + if gVfrBufferConfig.Register(StoreName, Guid) !=3D 0: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + return VfrReturnCode.VFR_RETURN_SUCCESS + + def DeclareNameVarStoreBegin(self, StoreName, VarStoreId): + if StoreName is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + _, ReturnCode =3D self.GetVarStoreId(StoreName) + if ReturnCode =3D=3D VfrReturnCode.VFR_RETURN_SUCCESS: + return VfrReturnCode.VFR_RETURN_REDEFINED + + if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: + VarStoreId =3D self.GetFreeVarStoreId(EFI_VFR_VARSTORE_TYPE.EF= I_VFR_VARSTORE_NAME) + else: + if self.CheckVarStoreIdFree(VarStoreId) is False: + return VfrReturnCode.VFR_RETURN_VARSTOREID_REDEFINED + self.MarkVarStoreIdUsed(VarStoreId) + + pNode =3D SVfrVarStorageNode(StoreName, VarStoreId) + + if pNode is None: + return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + self.NewVarStorageNode =3D pNode + return VfrReturnCode.VFR_RETURN_SUCCESS + + def DeclareNameVarStoreEnd(self, Guid): + self.NewVarStorageNode.Guid =3D Guid + self.NewVarStorageNode.Next =3D self.NameVarStoreList + self.NameVarStoreList =3D self.NewVarStorageNode + self.NewVarStorageNode =3D None + + def NameTableAddItem(self, Item): + self.NewVarStorageNode.NameSpace.append(Item) + return VfrReturnCode.VFR_RETURN_SUCCESS + + def GetNameVarStoreInfo(self, BaseInfo, Index): + if BaseInfo is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + if self.CurrVarStorageNode is None: + return VfrReturnCode.VFR_RETURN_GET_NVVARSTORE_ERROR + + BaseInfo.Info.VarName =3D self.CurrVarStorageNode.NameSpace[Index] + + return VfrReturnCode.VFR_RETURN_SUCCESS + + def GetVarStoreType(self, VarStoreId): + VarStoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_INVALID + + if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: + return VarStoreType + + pNode =3D self.BufferVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + return pNode.VarstoreType + pNode =3D pNode.Next + + pNode =3D self.EfiVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + return pNode.VarstoreType + pNode =3D pNode.Next + + pNode =3D self.NameVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + return pNode.VarstoreType + pNode =3D pNode.Next + + return VarStoreType + + def GetVarStoreName(self, VarStoreId): + pNode =3D self.BufferVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + return pNode.VarStoreName, VfrReturnCode.VFR_RETURN_SUCCES= S + pNode =3D pNode.Next + + pNode =3D self.EfiVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + return pNode.VarStoreName, VfrReturnCode.VFR_RETURN_SUCCES= S + pNode =3D pNode.Next + + pNode =3D self.NameVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + return pNode.VarStoreName, VfrReturnCode.VFR_RETURN_SUCCES= S + pNode =3D pNode.Next + + return None, VfrReturnCode.VFR_RETURN_UNDEFINED + + def GetBufferVarStoreDataTypeName(self, VarStoreId): + DataTypeName =3D None + if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: + return DataTypeName, VfrReturnCode.VFR_RETURN_FATAL_ERROR + + pNode =3D self.BufferVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + DataTypeName =3D pNode.DataType.TypeName + return DataTypeName, VfrReturnCode.VFR_RETURN_SUCCESS + pNode =3D pNode.Next + + return DataTypeName, VfrReturnCode.VFR_RETURN_UNDEFINED + + def GetEfiVarStoreInfo(self, BaseInfo: EFI_VARSTORE_INFO): + if BaseInfo is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + if self.CurrVarStorageNode is None: + return VfrReturnCode.VFR_RETURN_GET_EFIVARSTORE_ERROR + + BaseInfo.Info.VarName =3D self.CurrVarStorageNode.EfiVar.EfiVarNam= e + BaseInfo.VarTotalSize =3D self.CurrVarStorageNode.EfiVar.EfiVarSiz= e + + if BaseInfo.VarTotalSize =3D=3D EFI_IFR_TYPE_NUM_8_BIT_SIZE: + BaseInfo.VarType =3D EFI_IFR_TYPE_NUM_SIZE_8 + elif BaseInfo.VarTotalSize =3D=3D EFI_IFR_TYPE_NUM_16_BIT_SIZE: + BaseInfo.VarType =3D EFI_IFR_TYPE_NUM_SIZE_16 + elif BaseInfo.VarTotalSize =3D=3D EFI_IFR_TYPE_NUM_32_BIT_SIZE: + BaseInfo.VarType =3D EFI_IFR_TYPE_NUM_SIZE_32 + elif BaseInfo.VarTotalSize =3D=3D EFI_IFR_TYPE_NUM_64_BIT_SIZE: + BaseInfo.VarType =3D EFI_IFR_TYPE_NUM_SIZE_64 + else: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + return VfrReturnCode.VFR_RETURN_SUCCESS + + def GetVarStoreGuid(self, VarStoreId): + VarGuid =3D None + if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: + return VarGuid + + pNode =3D self.BufferVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + VarGuid =3D pNode.Guid + return VarGuid + pNode =3D pNode.Next + + pNode =3D self.EfiVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + VarGuid =3D pNode.Guid + return VarGuid + pNode =3D pNode.Next + + pNode =3D self.NameVarStoreList + while pNode is not None: + if pNode.VarStoreId =3D=3D VarStoreId: + VarGuid =3D pNode.Guid + return VarGuid + pNode =3D pNode.Next + + return VarGuid + + def AddBufferVarStoreFieldInfo(self, BaseInfo: EFI_VARSTORE_INFO): + pNew =3D BufferVarStoreFieldInfoNode(BaseInfo) + if pNew is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + if self.BufferFieldInfoListHead is None: + self.BufferFieldInfoListHead =3D pNew + self.mBufferFieldInfoListTail =3D pNew + else: + self.mBufferFieldInfoListTail.Next =3D pNew + self.mBufferFieldInfoListTail =3D pNew + + return VfrReturnCode.VFR_RETURN_SUCCESS + + +class VfrStringDB: + def __init__(self): + self.StringFileName =3D None + + def SetStringFileName(self, StringFileName): + self.StringFileName =3D StringFileName + + def GetBestLanguage(self, SupportedLanguages, Language): + if SupportedLanguages is None or Language is None: + return False + + LanguageLength =3D 0 + # Determine the length of the first RFC 4646 language code in Lang= uage + while LanguageLength < len(Language) and Language[LanguageLength] = !=3D 0 and Language[LanguageLength] !=3D ";": + LanguageLength +=3D 1 + + Supported =3D SupportedLanguages + # Trim back the length of Language used until it is empty + while LanguageLength > 0: + # Loop through all language codes in SupportedLanguages + while len(Supported) > 0: + # Skip ';' characters in Supported + while len(Supported) > 0 and Supported[0] =3D=3D ";": + Supported =3D Supported[1:] + + CompareLength =3D 0 + # Determine the length of the next language code in Suppor= ted + while CompareLength < len(Supported) and Supported[Compare= Length] !=3D 0 and Supported[CompareLength] !=3D ";": + CompareLength +=3D 1 + + # If Language is longer than the Supported, then skip to t= he next language + if LanguageLength > CompareLength: + continue + + # See if the first LanguageLength characters in Supported = match Language + if Supported[:LanguageLength] =3D=3D Language: + return True + + Supported =3D Supported[CompareLength:] + + # Trim Language from the right to the next '-' character + LanguageLength -=3D 1 + while LanguageLength > 0 and Language[LanguageLength] !=3D "-"= : + LanguageLength -=3D 1 + + # No matches were found + return False + + def GetUnicodeStringTextSize(self, StringSrc): + StringSize =3D sizeof(c_ushort) + StringStr =3D cast(StringSrc, POINTER(c_ushort)) + + while StringStr.contents.value !=3D "\0": + StringSize +=3D sizeof(c_ushort) + StringStr =3D cast(addressof(StringStr.contents) + sizeof(c_us= hort), POINTER(c_ushort)) + + return StringSize + + def FindStringBlock(self, string_data, string_id): + current_string_id =3D 1 + block_hdr =3D string_data + block_size =3D 0 + offset =3D 0 + + while block_hdr[0] !=3D EFI_HII_SIBT_END: + block_type =3D block_hdr[0] + + if block_type =3D=3D EFI_HII_SIBT_STRING_SCSU: + offset =3D sizeof(EFI_HII_STRING_BLOCK) + string_text_ptr =3D block_hdr + offset + block_size +=3D offset + len(str(string_text_ptr)) + 1 + current_string_id +=3D 1 + + elif block_type =3D=3D EFI_HII_SIBT_STRING_SCSU_FONT: + offset =3D sizeof(EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK) - s= izeof(c_uint8) + string_text_ptr =3D block_hdr + offset + block_size +=3D offset + len(str(string_text_ptr)) + 1 + current_string_id +=3D 1 + + elif block_type =3D=3D EFI_HII_SIBT_STRINGS_SCSU: + string_count =3D int.from_bytes( + block_hdr[sizeof(EFI_HII_STRING_BLOCK) : sizeof(EFI_HI= I_STRING_BLOCK) + sizeof(c_uint16)], + byteorder=3D"little", + ) + string_text_ptr =3D block_hdr + sizeof(EFI_HII_SIBT_STRING= S_SCSU_BLOCK) - sizeof(c_uint8) + block_size +=3D string_text_ptr - block_hdr + + for _ in range(string_count): + block_size +=3D len(str(string_text_ptr)) + 1 + + if current_string_id =3D=3D string_id: + block_type =3D block_hdr[0] + string_text_offset =3D string_text_ptr - string_da= ta + return EFI_SUCCESS + + string_text_ptr =3D string_text_ptr + len(str(string_t= ext_ptr)) + 1 + current_string_id +=3D 1 + + elif block_type =3D=3D EFI_HII_SIBT_STRINGS_SCSU_FONT: + string_count =3D int.from_bytes( + block_hdr[sizeof(EFI_HII_STRING_BLOCK) + sizeof(c_uint= 8) : sizeof(EFI_HII_STRING_BLOCK) + sizeof(c_uint8) + sizeof(c_uint16)], + byteorder=3D"little", + ) + string_text_ptr =3D block_hdr + sizeof(EFI_HII_SIBT_STRING= S_SCSU_FONT_BLOCK) - sizeof(c_uint8) + block_size +=3D string_text_ptr - block_hdr + + for _ in range(string_count): + block_size +=3D len(str(string_text_ptr)) + 1 + + if current_string_id =3D=3D string_id: + block_type =3D block_hdr[0] + string_text_offset =3D string_text_ptr - string_da= ta + return EFI_SUCCESS + + string_text_ptr =3D string_text_ptr + len(str(string_t= ext_ptr)) + 1 + current_string_id +=3D 1 + + elif block_type =3D=3D EFI_HII_SIBT_STRING_UCS2: + offset =3D sizeof(EFI_HII_STRING_BLOCK) + string_text_ptr =3D block_hdr + offset + string_size =3D self.GetUnicodeStringTextSize(string_text_= ptr) + block_size +=3D offset + string_size + current_string_id +=3D 1 + + elif block_type =3D=3D EFI_HII_SIBT_STRING_UCS2_FONT: + offset =3D sizeof(EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK) - s= izeof(c_ushort) + string_text_ptr =3D block_hdr + offset + string_size =3D self.GetUnicodeStringTextSize(string_text_= ptr) + block_size +=3D offset + string_size + current_string_id +=3D 1 + + elif block_type =3D=3D EFI_HII_SIBT_STRINGS_UCS2: + offset =3D len(EFI_HII_SIBT_STRINGS_UCS2_BLOCK) - len(c_us= hort) + string_text_ptr =3D block_hdr + offset + block_size +=3D offset + string_count =3D int.from_bytes( + block_hdr[sizeof(EFI_HII_STRING_BLOCK) : sizeof(EFI_HI= I_STRING_BLOCK) + sizeof(c_uint16)], + byteorder=3D"little", + ) + + for _ in range(string_count): + string_size =3D self.GetUnicodeStringTextSize(string_t= ext_ptr) + block_size +=3D string_size + + if current_string_id =3D=3D string_id: + block_type =3D block_hdr[0] + string_text_offset =3D string_text_ptr - string_da= ta + return EFI_SUCCESS + + string_text_ptr =3D string_text_ptr + string_size + current_string_id +=3D 1 + + elif block_type =3D=3D EFI_HII_SIBT_STRINGS_UCS2_FONT: + offset =3D len(EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK) - len= (c_ushort) + string_text_ptr =3D block_hdr + offset + block_size +=3D offset + string_count =3D int.from_bytes( + block_hdr[sizeof(EFI_HII_STRING_BLOCK) + sizeof(c_uint= 8) : sizeof(EFI_HII_STRING_BLOCK) + sizeof(c_uint8) + sizeof(c_uint16)], + byteorder=3D"little", + ) + + for _ in range(string_count): + string_size =3D self.GetUnicodeStringTextSize(string_t= ext_ptr) + block_size +=3D string_size + + if current_string_id =3D=3D string_id: + block_type =3D block_hdr[0] + string_text_offset =3D string_text_ptr - string_da= ta + return EFI_SUCCESS + + string_text_ptr =3D string_text_ptr + string_size + current_string_id +=3D 1 + + elif block_type =3D=3D EFI_HII_SIBT_DUPLICATE: + if current_string_id =3D=3D string_id: + string_id =3D int.from_bytes( + block_hdr[sizeof(EFI_HII_STRING_BLOCK) : sizeof(EF= I_HII_STRING_BLOCK) + sizeof(c_uint16)], + byteorder=3D"little", + ) + current_string_id =3D 1 + block_size =3D 0 + else: + block_size +=3D sizeof(EFI_HII_SIBT_DUPLICATE_BLOCK) + current_string_id +=3D 1 + + elif block_type =3D=3D EFI_HII_SIBT_SKIP1: + skip_count =3D int.from_bytes(block_hdr[sizeof(EFI_HII_STR= ING_BLOCK)], byteorder=3D"little") + current_string_id +=3D skip_count + block_size +=3D sizeof(EFI_HII_SIBT_SKIP1_BLOCK) + + elif block_type =3D=3D EFI_HII_SIBT_SKIP2: + skip_count =3D int.from_bytes( + block_hdr[sizeof(EFI_HII_STRING_BLOCK) : sizeof(EFI_HI= I_STRING_BLOCK) + sizeof(c_uint16)], + byteorder=3D"little", + ) + current_string_id +=3D skip_count + block_size +=3D sizeof(EFI_HII_SIBT_SKIP2_BLOCK) + + elif block_type =3D=3D EFI_HII_SIBT_EXT1: + length8 =3D int.from_bytes( + block_hdr[sizeof(EFI_HII_STRING_BLOCK) + sizeof(c_uint= 8) : sizeof(EFI_HII_STRING_BLOCK) + sizeof(c_uint8) + sizeof(c_uint8)], + byteorder=3D"little", + ) + block_size +=3D length8 + + elif block_type =3D=3D EFI_HII_SIBT_EXT2: + length32 =3D int.from_bytes( + block_hdr[sizeof(EFI_HII_STRING_BLOCK) + sizeof(c_uint= 8) : sizeof(EFI_HII_STRING_BLOCK) + sizeof(c_uint8) + sizeof(c_uint32)], + byteorder=3D"little", + ) + block_size +=3D length32 + + if string_id > 0 and string_id !=3D (c_uint16)(-1): + block_type =3D block_hdr[0] + + if string_id =3D=3D current_string_id - 1: + if block_type in (EFI_HII_SIBT_SKIP2, EFI_HII_SIBT_SKI= P1): + return EFI_NOT_FOUND + return EFI_SUCCESS + + if string_id < current_string_id - 1: + return EFI_NOT_FOUND + + block_hdr =3D string_data + block_size + + return EFI_NOT_FOUND + + def GetVarStoreNameFormStringId(self, StringId): + pInFile =3D None + NameOffset =3D 0 + Length =3D 0 + StringPtr =3D None + StringName =3D None + UnicodeString =3D None + VarStoreName =3D None + DestTmp =3D None + Current =3D None + Status =3D None + BlockType =3D 0 + PkgHeader =3D None + + if self.StringFileName is None: + return None + + try: + with open(LongFilePath(self.StringFileName), "rb") as pInFile: + # Get file length + pInFile.seek(0, os.SEEK_END) + Length =3D pInFile.tell() + pInFile.seek(0, os.SEEK_SET) + + # Get file data + StringPtr =3D bytearray(pInFile.read()) + except Exception: + return None + + PkgHeader =3D EFI_HII_STRING_PACKAGE_HDR.from_buffer(StringPtr) + + # Check the String package + if PkgHeader.Header.Type !=3D EFI_HII_PACKAGE_STRINGS: + return None + + # Search the language, get best language based on RFC 4647 matchin= g algorithm + Current =3D StringPtr + while not self.GetBestLanguage("en", PkgHeader.Language): + Current +=3D PkgHeader.Header.Length + PkgHeader =3D EFI_HII_STRING_PACKAGE_HDR.from_buffer(Current) + + # If can't find string package based on language, just return = the first string package + if Current - StringPtr >=3D Length: + Current =3D StringPtr + PkgHeader =3D EFI_HII_STRING_PACKAGE_HDR.from_buffer(Strin= gPtr) + break + + Current +=3D PkgHeader.HdrSize + + # Find the string block according to the stringId + Status, NameOffset, BlockType =3D self.FindStringBlock(Current, St= ringId) + if Status !=3D RETURN_SUCCESS: + return None + + # Get varstore name according to the string type + if BlockType in [ + EFI_HII_SIBT_STRING_SCSU, + EFI_HII_SIBT_STRING_SCSU_FONT, + EFI_HII_SIBT_STRINGS_SCSU, + EFI_HII_SIBT_STRINGS_SCSU_FONT, + ]: + StringName =3D Current + NameOffset + VarStoreName =3D StringName.decode("utf-8") + elif BlockType in [ + EFI_HII_SIBT_STRING_UCS2, + EFI_HII_SIBT_STRING_UCS2_FONT, + EFI_HII_SIBT_STRINGS_UCS2, + EFI_HII_SIBT_STRINGS_UCS2_FONT, + ]: + UnicodeString =3D Current + NameOffset + Length =3D self.GetUnicodeStringTextSize(UnicodeString) + DestTmp =3D bytearray(Length // 2 + 1) + VarStoreName =3D DestTmp + index =3D 0 + while UnicodeString[index] !=3D "\0": + DestTmp[index] =3D ord(UnicodeString[index]) + index +=3D 1 + DestTmp[index] =3D "\0" + else: + return None + + return VarStoreName + + +gVfrStringDB =3D VfrStringDB() + +EFI_RULE_ID_START =3D 0x01 +EFI_RULE_ID_INVALID =3D 0x00 + + +class SVfrRuleNode: + def __init__(self, RuleName=3DNone, RuleId=3D0): + self.RuleId =3D RuleId + self.RuleName =3D RuleName + self.Next =3D None + + +class VfrRulesDB: + def __init__(self): + self.RuleList =3D None + self.FreeRuleId =3D EFI_VARSTORE_ID_START + + def RegisterRule(self, RuleName): + if RuleName is None: + return + + pNew =3D SVfrRuleNode(RuleName, self.FreeRuleId) + if pNew is None: + return + self.FreeRuleId +=3D 1 + pNew.Next =3D self.RuleList + self.RuleList =3D pNew + + def GetRuleId(self, RuleName): + if RuleName is None: + return EFI_RULE_ID_INVALID + + pNode =3D self.RuleList + while pNode is not None: + if pNode.RuleName =3D=3D RuleName: + return pNode.RuleId + pNode =3D pNode.Next + + return EFI_RULE_ID_INVALID + + +EFI_QUESTION_ID_MAX =3D 0xFFFF +EFI_FREE_QUESTION_ID_BITMAP_SIZE =3D int((EFI_QUESTION_ID_MAX + 1) / EFI_B= ITS_PER_UINT32) +EFI_QUESTION_ID_INVALID =3D 0x0 + + +class EFI_QUESION_TYPE(Enum): + QUESTION_NORMAL =3D 0 + QUESTION_DATE =3D 1 + QUESTION_TIME =3D 2 + QUESTION_REF =3D 3 + + +class SVfrQuestionNode: + def __init__(self, Name=3DNone, VarIdStr=3DNone, BitMask=3D0): # + self.Name =3D Name + self.VarIdStr =3D VarIdStr + self.QuestionId =3D EFI_QUESTION_ID_INVALID + self.BitMask =3D BitMask + self.Next =3D None + self.QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL + + +DATE_YEAR_BITMASK =3D 0x0000FFFF +DATE_MONTH_BITMASK =3D 0x00FF0000 +DATE_DAY_BITMASK =3D 0xFF000000 +TIME_HOUR_BITMASK =3D 0x000000FF +TIME_MINUTE_BITMASK =3D 0x0000FF00 +TIME_SECOND_BITMASK =3D 0x00FF0000 + + +class VfrQuestionDB: + def __init__(self): + self.FreeQIdBitMap =3D [] + for i in range(0, EFI_FREE_QUESTION_ID_BITMAP_SIZE): + self.FreeQIdBitMap.append(0) + + # Question ID 0 is reserved. + self.FreeQIdBitMap[0] =3D 0x80000000 + + self.QuestionList =3D None + + def FindQuestionByName(self, Name): + if Name is None: + return VfrReturnCode.VFR_RETURN_FATAL_ERROR + + pNode =3D self.QuestionList + while pNode is not None: + if pNode.Name =3D=3D Name: + return VfrReturnCode.VFR_RETURN_SUCCESS + pNode =3D pNode.Next + + return VfrReturnCode.VFR_RETURN_UNDEFINED + + def FindQuestionById(self, QuestionId): + if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: + return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER + + pNode =3D self.QuestionList + while pNode is not None: + if pNode.QuestionId =3D=3D QuestionId: + return VfrReturnCode.VFR_RETURN_SUCCESS + pNode =3D pNode.Next + + return VfrReturnCode.VFR_RETURN_UNDEFINED + + def GetFreeQuestionId(self): + Index =3D 0 + for i in range(0, EFI_FREE_QUESTION_ID_BITMAP_SIZE): + if self.FreeQIdBitMap[i] !=3D 0xFFFFFFFF: + Index =3D i + break + if Index =3D=3D EFI_FREE_QUESTION_ID_BITMAP_SIZE: + return EFI_QUESTION_ID_INVALID + + Offset =3D 0 + Mask =3D 0x80000000 + while Mask !=3D 0: + if (self.FreeQIdBitMap[Index] & Mask) =3D=3D 0: + self.FreeQIdBitMap[Index] |=3D Mask + return (Index << EFI_BITS_SHIFT_PER_UINT32) + Offset + Mask >>=3D 1 + Offset +=3D 1 + + return EFI_QUESTION_ID_INVALID + + def CheckQuestionIdFree(self, QId): + Index =3D int(QId / EFI_BITS_PER_UINT32) + Offset =3D QId % EFI_BITS_PER_UINT32 + return (self.FreeQIdBitMap[Index] & (0x80000000 >> Offset)) =3D=3D= 0 + + def MarkQuestionIdUsed(self, QId): + Index =3D int(QId / EFI_BITS_PER_UINT32) + Offset =3D QId % EFI_BITS_PER_UINT32 + self.FreeQIdBitMap[Index] |=3D 0x80000000 >> Offset + + def MarkQuestionIdUnused(self, QId): + Index =3D int(QId / EFI_BITS_PER_UINT32) + Offset =3D QId % EFI_BITS_PER_UINT32 + self.FreeQIdBitMap[Index] &=3D ~(0x80000000 >> Offset) + + def RegisterQuestion(self, Name, VarIdStr, QuestionId, gFormPkg): + if (Name is not None) and (self.FindQuestionByName(Name) =3D=3D Vf= rReturnCode.VFR_RETURN_SUCCESS): + return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED + + pNode =3D SVfrQuestionNode(Name, VarIdStr) + if pNode is None: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: + QuestionId =3D self.GetFreeQuestionId() + else: + if self.CheckQuestionIdFree(QuestionId) is False: + return QuestionId, VfrReturnCode.VFR_RETURN_QUESTIONID_RED= EFINED + self.MarkQuestionIdUsed(QuestionId) + + pNode.QuestionId =3D QuestionId + pNode.Next =3D self.QuestionList + self.QuestionList =3D pNode + + gFormPkg.DoPendingAssign(VarIdStr, QuestionId) + + return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS + + def UpdateQuestionId(self, QId, NewQId, gFormPkg): + if QId =3D=3D NewQId: + # don't update + return VfrReturnCode.VFR_RETURN_SUCCESS + + if self.CheckQuestionIdFree(NewQId) is False: + return VfrReturnCode.VFR_RETURN_REDEFINED + + pNode =3D self.QuestionList + TempList =3D [] + while pNode is not None: + if pNode.QuestionId =3D=3D QId: + TempList.append(pNode) + pNode =3D pNode.Next + + if len(TempList) =3D=3D 0: + return VfrReturnCode.VFR_RETURN_UNDEFINED + + self.MarkQuestionIdUnused(QId) + + for pNode in TempList: + pNode.QuestionId =3D NewQId + gFormPkg.DoPendingAssign(pNode.VarIdStr, NewQId) + + self.MarkQuestionIdUsed(NewQId) + + return VfrReturnCode.VFR_RETURN_SUCCESS + + def GetQuestionId(self, Name, VarIdStr=3DNone, QType=3DNone): + QuestionId =3D EFI_QUESTION_ID_INVALID + BitMask =3D 0x00000000 + if QType is not None: + QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL + + if Name is None and VarIdStr is None: + return QuestionId, BitMask, QType + + pNode =3D self.QuestionList + while pNode is not None: + if Name is not None: + if pNode.Name !=3D Name: + pNode =3D pNode.Next + continue + + if VarIdStr is not None: + if pNode.VarIdStr !=3D VarIdStr: + pNode =3D pNode.Next + continue + + QuestionId =3D pNode.QuestionId + BitMask =3D pNode.BitMask + if QType is not None: + QType =3D pNode.QType + break + + return QuestionId, BitMask, QType + + def RegisterNewDateQuestion(self, Name, BaseVarId, QuestionId, gFormPk= g): + if BaseVarId =3D=3D "" and Name is None: + if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: + QuestionId =3D self.GetFreeQuestionId() + else: + if self.CheckQuestionIdFree(QuestionId) is False: + return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED + self.MarkQuestionIdUsed(QuestionId) + return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS + + VarIdStrList =3D [] + if BaseVarId !=3D "": + VarIdStrList.append(BaseVarId + ".Year") + VarIdStrList.append(BaseVarId + ".Month") + VarIdStrList.append(BaseVarId + ".Day") + + else: + VarIdStrList.append(Name + ".Year") + VarIdStrList.append(Name + ".Month") + VarIdStrList.append(Name + ".Day") + + pNodeList =3D [] + pNode =3D SVfrQuestionNode(Name, VarIdStrList[0], DATE_YEAR_BITMAS= K) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + pNode =3D SVfrQuestionNode(Name, VarIdStrList[1], DATE_MONTH_BITMA= SK) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + pNode =3D SVfrQuestionNode(Name, VarIdStrList[2], DATE_DAY_BITMASK= ) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: + QuestionId =3D self.GetFreeQuestionId() + else: + if self.CheckQuestionIdFree(QuestionId) is False: + return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED + self.MarkQuestionIdUsed(QuestionId) + + pNodeList[0].QuestionId =3D QuestionId + pNodeList[1].QuestionId =3D QuestionId + pNodeList[2].QuestionId =3D QuestionId + pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_DATE + pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_DATE + pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_DATE + pNodeList[0].Next =3D pNodeList[1] + pNodeList[1].Next =3D pNodeList[2] + pNodeList[2].Next =3D self.QuestionList + self.QuestionList =3D pNodeList[0] + + gFormPkg.DoPendingAssign(VarIdStrList[0], QuestionId) + gFormPkg.DoPendingAssign(VarIdStrList[1], QuestionId) + gFormPkg.DoPendingAssign(VarIdStrList[2], QuestionId) + + return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS + + def RegisterNewTimeQuestion(self, Name, BaseVarId, QuestionId, gFormPk= g): + if BaseVarId =3D=3D "" and Name is None: + if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: + QuestionId =3D self.GetFreeQuestionId() + else: + if self.CheckQuestionIdFree(QuestionId) is False: + return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED + self.MarkQuestionIdUsed(QuestionId) + return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS + + VarIdStrList =3D [] + if BaseVarId !=3D "": + VarIdStrList.append(BaseVarId + ".Hour") + VarIdStrList.append(BaseVarId + ".Minute") + VarIdStrList.append(BaseVarId + ".Second") + + else: + VarIdStrList.append(Name + ".Hour") + VarIdStrList.append(Name + ".Minute") + VarIdStrList.append(Name + ".Second") + + pNodeList =3D [] + pNode =3D SVfrQuestionNode(Name, VarIdStrList[0], TIME_HOUR_BITMAS= K) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + pNode =3D SVfrQuestionNode(Name, VarIdStrList[1], TIME_MINUTE_BITM= ASK) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + pNode =3D SVfrQuestionNode(Name, VarIdStrList[2], TIME_SECOND_BITM= ASK) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: + QuestionId =3D self.GetFreeQuestionId() + else: + if self.CheckQuestionIdFree(QuestionId) is False: + return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED + self.MarkQuestionIdUsed(QuestionId) + + pNodeList[0].QuestionId =3D QuestionId + pNodeList[1].QuestionId =3D QuestionId + pNodeList[2].QuestionId =3D QuestionId + pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_TIME + pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_TIME + pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_TIME + pNodeList[0].Next =3D pNodeList[1] + pNodeList[1].Next =3D pNodeList[2] + pNodeList[2].Next =3D self.QuestionList + self.QuestionList =3D pNodeList[0] + + gFormPkg.DoPendingAssign(VarIdStrList[0], QuestionId) + gFormPkg.DoPendingAssign(VarIdStrList[1], QuestionId) + gFormPkg.DoPendingAssign(VarIdStrList[2], QuestionId) + + return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS + + def RegisterRefQuestion(self, Name, BaseVarId, QuestionId, gFormPkg): + if BaseVarId =3D=3D "" and Name is None: + return QuestionId, VfrReturnCode.VFR_RETURN_FATAL_ERROR + + VarIdStrList =3D [] + if BaseVarId !=3D "": + VarIdStrList.append(BaseVarId + ".QuestionId") + VarIdStrList.append(BaseVarId + ".FormId") + VarIdStrList.append(BaseVarId + ".FormSetGuid") + VarIdStrList.append(BaseVarId + ".DevicePath") + + else: + VarIdStrList.append(BaseVarId + ".QuestionId") + VarIdStrList.append(BaseVarId + ".FormId") + VarIdStrList.append(BaseVarId + ".FormSetGuid") + VarIdStrList.append(BaseVarId + ".DevicePath") + + pNodeList =3D [] + pNode =3D SVfrQuestionNode(Name, VarIdStrList[0]) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + pNode =3D SVfrQuestionNode(Name, VarIdStrList[1]) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + pNode =3D SVfrQuestionNode(Name, VarIdStrList[2]) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + pNode =3D SVfrQuestionNode(Name, VarIdStrList[3]) + if pNode is not None: + pNodeList.append(pNode) + else: + return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES + + if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: + QuestionId =3D self.GetFreeQuestionId() + else: + if self.CheckQuestionIdFree(QuestionId) is False: + return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED + self.MarkQuestionIdUsed(QuestionId) + + pNodeList[0].QuestionId =3D QuestionId + pNodeList[1].QuestionId =3D QuestionId + pNodeList[2].QuestionId =3D QuestionId + pNodeList[3].QuestionId =3D QuestionId + + pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_REF + pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_REF + pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_REF + pNodeList[3].QType =3D EFI_QUESION_TYPE.QUESTION_REF + + pNodeList[0].Next =3D pNodeList[1] + pNodeList[1].Next =3D pNodeList[2] + pNodeList[2].Next =3D pNodeList[3] + pNodeList[3].Next =3D self.QuestionList + self.QuestionList =3D pNodeList[0] + + gFormPkg.DoPendingAssign(VarIdStrList[0], QuestionId) + gFormPkg.DoPendingAssign(VarIdStrList[1], QuestionId) + gFormPkg.DoPendingAssign(VarIdStrList[2], QuestionId) + gFormPkg.DoPendingAssign(VarIdStrList[3], QuestionId) + + return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS + + def RegisterOldDateQuestion(self, YearVarId, MonthVarId, DayVarId, Que= stionId, gFormPkg): + pNodeList =3D [] + if YearVarId =3D=3D "" or MonthVarId =3D=3D "" or DayVarId =3D=3D = "" or \ + YearVarId is None or MonthVarId is None or DayVarId is None: + return QuestionId, VfrReturnCode.VFR_RETURN_ERROR_SKIPED + + pNode =3D SVfrQuestionNode(None, YearVarId, DATE_YEAR_BITMASK) + if pNode is not None: + pNodeList.append(pNode) + else: + return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES + + pNode =3D SVfrQuestionNode(None, MonthVarId, DATE_MONTH_BITMASK) + if pNode is not None: + pNodeList.append(pNode) + else: + return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES + + pNode =3D SVfrQuestionNode(None, DayVarId, DATE_DAY_BITMASK) + if pNode is not None: + pNodeList.append(pNode) + else: + return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES + + if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: + QuestionId =3D self.GetFreeQuestionId() + else: + if self.CheckQuestionIdFree(QuestionId) is False: + return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_R= EDEFINED + self.MarkQuestionIdUsed(QuestionId) + + pNodeList[0].QuestionId =3D QuestionId + pNodeList[1].QuestionId =3D QuestionId + pNodeList[2].QuestionId =3D QuestionId + pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_DATE + pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_DATE + pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_DATE + pNodeList[0].Next =3D pNodeList[1] + pNodeList[1].Next =3D pNodeList[2] + pNodeList[2].Next =3D self.QuestionList + self.QuestionList =3D pNodeList[0] + + gFormPkg.DoPendingAssign(YearVarId, QuestionId) + gFormPkg.DoPendingAssign(MonthVarId, QuestionId) + gFormPkg.DoPendingAssign(DayVarId, QuestionId) + + return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS + + def RegisterOldTimeQuestion(self, HourVarId, MinuteVarId, SecondVarId,= QuestionId, gFormPkg): + pNodeList =3D [] + if HourVarId =3D=3D "" or MinuteVarId =3D=3D "" or SecondVarId =3D= =3D "" \ + or HourVarId is None or MinuteVarId is None or SecondVarId is = None: + return QuestionId, VfrReturnCode.VFR_RETURN_ERROR_SKIPED + + pNode =3D SVfrQuestionNode(None, HourVarId, TIME_HOUR_BITMASK) + if pNode is not None: + pNodeList.append(pNode) + else: + return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES + + pNode =3D SVfrQuestionNode(None, MinuteVarId, TIME_MINUTE_BITMASK) + if pNode is not None: + pNodeList.append(pNode) + else: + return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES + + pNode =3D SVfrQuestionNode(None, SecondVarId, TIME_SECOND_BITMASK) + if pNode is not None: + pNodeList.append(pNode) + else: + return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES + + if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: + QuestionId =3D self.GetFreeQuestionId() + else: + if self.CheckQuestionIdFree(QuestionId) is False: + return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_R= EDEFINED + self.MarkQuestionIdUsed(QuestionId) + + pNodeList[0].QuestionId =3D QuestionId + pNodeList[1].QuestionId =3D QuestionId + pNodeList[2].QuestionId =3D QuestionId + pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_TIME + pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_TIME + pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_TIME + pNodeList[0].Next =3D pNodeList[1] + pNodeList[1].Next =3D pNodeList[2] + pNodeList[2].Next =3D self.QuestionList + self.QuestionList =3D pNodeList[0] + + gFormPkg.DoPendingAssign(HourVarId, QuestionId) + gFormPkg.DoPendingAssign(MinuteVarId, QuestionId) + gFormPkg.DoPendingAssign(SecondVarId, QuestionId) + + return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS + + def PrintAllQuestion(self, FileName): + with open(FileName, "w") as f: + pNode =3D self.QuestionList + while pNode is not None: + f.write("Question VarId is {} and QuestionId is ".format(p= Node.VarIdStr)) + f.write("%d\n" % (pNode.QuestionId)) + pNode =3D pNode.Next + + f.close() diff --git a/BaseTools/Source/Python/VfrCompiler/README.md b/BaseTools/Sour= ce/Python/VfrCompiler/README.md index e91d41c88d..7bdc85023a 100644 --- a/BaseTools/Source/Python/VfrCompiler/README.md +++ b/BaseTools/Source/Python/VfrCompiler/README.md @@ -1,20 +1,68 @@ # Python VfrCompiler Tool ## Overview -This python VfrCompiler tool is the implementation of the edk2 VfrCompiler= tool which locates at https://github.com/tianocore/edk2/tree/master/BaseTo= ols/Source/C/VfrCompile. +This python VfrCompiler tool is the python implementation of the edk2 VfrC= ompiler tool which C implementation locates at https://github.com/tianocore= /edk2/tree/master/BaseTools/Source/C/VfrCompile. + +This python implementation not only covers the same usage as the C version= VfrCompiler, but also extends several new features. =20 ### Introduction -The core function of the original C VfrCompiler tool is to convert the vfr= file into IFR binary array. However, the vfr format file syntax is relativ= ely uncommon and has poor readability for users. What's more, the C tool do= es not collect and store extra information except for binary generation. Wh= en any modification is needed, developers have to read and deal with the IF= R binary, which is quite inefficient. To solve this issue, this python VfrC= ompiler tool proposes to generate the yaml format file on the basis of the = vfr format file. With the yaml file, the layout and hierarchy of all Opcod= es in the vfr file will be saved. Then modification will be much eaiser. In= addition, an extra json file will be generated for better variable related= information presentation. So the long-term aim of this tool is to cover th= e same usage as the edk2 C VfrCompiler and extend the yaml/json output for = better readability and variability. +The core function of the original C VfrCompiler tool is to convert VFR fil= es into IFR binaries. However, the VFR format syntax is uncommon and has po= or readability for users. Additionally, the C tool doesn't gather or store = default variable information, except for binary generation. When modificati= ons are required, developers have to deal with the abstract IFR binary, res= ulting in inefficiency. To address these challenges, this python tool gener= ates YAML format files from VFR files. This approach allows for preservatio= n of the VFR file's opcode layout and hierarchy, simplifying readability. M= oreover, the tool generates an additional JSON file to provide a more acces= sible presentation of variable-related information. In a few words, the new= tool offers the same usage as the original C VfrCompiler while expanding f= unctionality with the YAML/JSON output, enhancing readability and adaptabil= ity. =20 ### Main update in this commitment -- Update the vfr parser generator from ANTLR to ANTLR v4, which is more re= adable and is eaiser to add on new functions. -- Generate a yaml file for each vfr file. The yaml file displays all the c= ontents in the Vfr file by different Opcode types in sequence. -- Generate a json file for each vfr file. The json file contains all the d= efault values for different Opcode types in vfr files. +- Update the vfr parser generator from ANTLR to ANTLR v4, which is more re= adable and is eaiser to add on new grammars and functions. +- Cover the same usage as the edk2 C VfrCompiler. The tool is able to comp= iles VFR into .c/lst/hpk output files. +- Extract variable information from each VFR file to JSON. The output JSON= file stores the data structures and default values of variables. +- Convert each VFR source format to an equivalent YAML. The generated YAML= file covers the same format contents in the Vfr file. =20 ### Known issues - -- The python VfrCompiler tool aims to cover the same usage as the edk2 C V= frCompiler. But currently, the python VfrCompiler tool does not support IFR= binary generation feature, this feature will be added in future update. -- The python VfrCompiler tool will extend new functions, which is able to = compile both the vfr and yaml files. This feature will be added in future u= pdate. +- Issue 1 - Test Coverage and Method + - The current python vfrcompiler tool does not have a full code coverage= test. + - Should add unit tests for higher code coverage. + - The test should be enabled into Azure pipelines for retriggering. + - The current test script uses some output binaries for test input, will= remove these binaries, and save the necessary part content of it directly = into the test script itself. +- Issue 2 - Code style + - The current python vfrcompiler tool has some coding style still like C= style which not follows the python standardize rule. + - Should enhance GUID usage with 'uuid' pip module; + - Should figure out common way for Status Code processing; + - The current python vfrcompiler tool need docstring description for cod= e explanation. +- Issue 3 - New generated YAML format + - The current YAML format is a reference version, and we warmly welcome = everyone to provide feedback. +- Future extension + - The tool will extend new functions, which is able to compile yaml file= s. This feature will be added in future update. =20 ### Use with Build System -- To use the VfrCompiler Python Tool with Build System, please add the **= *'--vfr-yaml-enable'*** option in the build command. -- For Example: ***build -p OvmfPkg\OvmfPkgIa32X64.dsc -a IA32 -a X64 -j bu= ild.log --vfr-yaml-enable*** \ No newline at end of file +To use the VfrCompiler Python Tool with Build System, please do the follo= wing steps in the build command. +1. Locate the **VfrCompiler** folder to path **'\edk2\BaseTools\Source\Pyt= hon'.** +1. Open **'build_rule.template'** file in path **'\edk2\BaseTools\Conf\= '.** + - Find the C VFR command line `$(VFR)" $(VFR_FLAGS) --string-db $(OUTPUT= _DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory ${d_path} $(OUTPUT_DIR= )(+)${s_base}.i` in **build_rule.template** file. There are two C VFR comma= nds in it. + - Add new command line `"$(PYVFR)" ${src} --string-db $(OUTPUT_DIR)(+)$(= MODULE_NAME)StrDefs.hpk -w $(WORKSPACE) -m $(MODULE_NAME) -o $(OUTPUT_DIR) = --vfr` after each VFR command lines. +2. Open **'tools_def.template'** file in path **'\edk2\BaseTools\Conf\'= .** + - Find the C VFR_PATH command line `*_*_*_VFR_PATH = =3D VfrCompile` in **tools_def.template** file. + - Add new command line `*_*_*_PYVFR_PATH =3D PyVfrCom= pile` after the VFR_PATH command line. +3. For windows build, create a **PyVfrCompile.bat** file in path **'C:\edk= 2\BaseTools\BinWrappers\WindowsLike'.** + - Add the following lines in the created **PyVfrCompile.bat** file. + ``` + @setlocal + @set ToolName=3DIfrCompiler + @set PYTHONPATH=3D%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python;%BASE_T= OOLS_PATH%\Source\Python\VfrCompiler + @%PYTHON_COMMAND% -m %ToolName% %* + ``` +4. For Unix build, create a **PyVfrCompile** file in path **'C:\edk2\BaseT= ools\BinWrappers\PosixLike'.** + - Add the following lines in the created **PyVfrCompile** file. + ``` + #!/usr/bin/env bash + #python `dirname $0`/RunToolFromSource.py `basename $0` $* + + # If a ${PYTHON_COMMAND} command is available, use it in preference to= python + if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then + python_exe=3D${PYTHON_COMMAND} + fi + full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ= /028 for a discussion of why $0 is not a good choice here + dir=3D$(dirname "$full_cmd") + cmd=3D${full_cmd##*/} + + export PYTHONPATH=3D"$dir/../../Source/Python:$dir/../../Source/Python= /VfrCompiler:$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" + exec "${python_exe:-python}" -m IfrCompiler "$@" + ``` +5. Add Env: run `pip install antlr4-python3-runtime=3D=3D4.7.1` based on t= he original build environment. +6. Run Build Command: `build -p OvmfPkg\OvmfPkgIa32X64.dsc -a IA32 -a X64 = -j build.log` +` diff --git a/BaseTools/Source/Python/VfrCompiler/VfrError.py b/BaseTools/So= urce/Python/VfrCompiler/VfrError.py deleted file mode 100644 index 31c479a7d1..0000000000 --- a/BaseTools/Source/Python/VfrCompiler/VfrError.py +++ /dev/null @@ -1,162 +0,0 @@ -import imp -import sys -import os -from enum import Enum -from Common.BuildToolError import * -import Common.EdkLogger as EdkLogger - - -class VfrReturnCode(Enum): - VFR_RETURN_SUCCESS =3D 0 - VFR_RETURN_ERROR_SKIPED =3D 1 - VFR_RETURN_FATAL_ERROR =3D 2 - VFR_RETURN_MISMATCHED =3D 3 - VFR_RETURN_INVALID_PARAMETER =3D 4 - VFR_RETURN_OUT_FOR_RESOURCES =3D 5 - VFR_RETURN_UNSUPPORTED =3D 6 - VFR_RETURN_REDEFINED =3D 7 - VFR_RETURN_FORMID_REDEFINED =3D 8 - VFR_RETURN_QUESTIONID_REDEFINED =3D 9 - VFR_RETURN_VARSTOREID_REDEFINED =3D 10 - VFR_RETURN_UNDEFINED =3D 11 - VFR_RETURN_VAR_NOTDEFINED_BY_QUESTION =3D 12 - VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR =3D 13 - VFR_RETURN_GET_EFIVARSTORE_ERROR =3D 14 - VFR_RETURN_EFIVARSTORE_USE_ERROR =3D 15 - VFR_RETURN_EFIVARSTORE_SIZE_ERROR =3D 16 - VFR_RETURN_GET_NVVARSTORE_ERROR =3D 17 - VFR_RETURN_QVAR_REUSE =3D 18 - VFR_RETURN_FLAGS_UNSUPPORTED =3D 19 - VFR_RETURN_ERROR_ARRARY_NUM =3D 20 - VFR_RETURN_DATA_STRING_ERROR =3D 21 - VFR_RETURN_DEFAULT_VALUE_REDEFINED =3D 22 - VFR_RETURN_CONSTANT_ONLY =3D 23 - VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR =3D 24 - VFR_RETURN_BIT_WIDTH_ERROR =3D 25 - VFR_RETURN_STRING_TO_UINT_OVERFLOW =3D 26 - VFR_RETURN_CODEUNDEFINED =3D 27 - - -vfrErrorMessage =3D { - VfrReturnCode.VFR_RETURN_SUCCESS: '', - VfrReturnCode.VFR_RETURN_ERROR_SKIPED: '', - VfrReturnCode.VFR_RETURN_FATAL_ERROR: 'fatal error!!', - VfrReturnCode.VFR_RETURN_MISMATCHED: 'unexpected token', - VfrReturnCode.VFR_RETURN_INVALID_PARAMETER: 'invalid parameter', - VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES: 'system out of memory', - VfrReturnCode.VFR_RETURN_UNSUPPORTED: 'unsupported', - VfrReturnCode.VFR_RETURN_REDEFINED: 'already defined', - VfrReturnCode.VFR_RETURN_FORMID_REDEFINED: 'form id already defined', - VfrReturnCode.VFR_RETURN_QUESTIONID_REDEFINED: - 'question id already defined', - VfrReturnCode.VFR_RETURN_VARSTOREID_REDEFINED: - 'varstore id already defined', - VfrReturnCode.VFR_RETURN_UNDEFINED: 'undefined', - VfrReturnCode.VFR_RETURN_VAR_NOTDEFINED_BY_QUESTION: - 'some variable has not defined by a question', - VfrReturnCode.VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR: - 'Data Structure is defined by more than one varstores: it can\'t be re= ferred as varstore: only varstore name could be used.', - VfrReturnCode.VFR_RETURN_GET_EFIVARSTORE_ERROR: 'get efi varstore erro= r', - VfrReturnCode.VFR_RETURN_EFIVARSTORE_USE_ERROR: - 'can not use the efi varstore like this', - VfrReturnCode.VFR_RETURN_EFIVARSTORE_SIZE_ERROR: - 'unsupport efi varstore size should be <=3D 8 bytes', - VfrReturnCode.VFR_RETURN_GET_NVVARSTORE_ERROR: - 'get name value varstore error', - VfrReturnCode.VFR_RETURN_QVAR_REUSE: - 'variable reused by more than one question', - VfrReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED: 'flags unsupported', - VfrReturnCode.VFR_RETURN_ERROR_ARRARY_NUM: - 'array number error: the valid value is in (0 ~ MAX_INDEX-1 for UEFI v= fr and in (1 ~ MAX_INDEX for Framework Vfr', - VfrReturnCode.VFR_RETURN_DATA_STRING_ERROR: - 'data field string error or not support', - VfrReturnCode.VFR_RETURN_DEFAULT_VALUE_REDEFINED: - 'default value re-defined with different value', - VfrReturnCode.VFR_RETURN_CONSTANT_ONLY: - 'only constant is allowed in the expression', - VfrReturnCode.VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR: - 'Varstore name is defined by more than one varstores: it can\'t be ref= erred as varstore: only varstore structure name could be used.', - VfrReturnCode.VFR_RETURN_BIT_WIDTH_ERROR: - 'bit width must be <=3D sizeof (type * 8 and the max width can not > 3= 2', - VfrReturnCode.VFR_RETURN_STRING_TO_UINT_OVERFLOW: - 'String to UINT* Overflow', - VfrReturnCode.VFR_RETURN_CODEUNDEFINED: 'undefined Error Code' -} - - -class EFI_VFR_WARNING_CODE(Enum): - VFR_WARNING_DEFAULT_VALUE_REDEFINED =3D 0 - VFR_WARNING_ACTION_WITH_TEXT_TWO =3D 1 - VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE =3D 2 - VFR_WARNING_CODEUNDEFINED =3D 3 - - -vfrWarningMessage =3D { - EFI_VFR_WARNING_CODE.VFR_WARNING_DEFAULT_VALUE_REDEFINED: - ": default value re-defined with different value", - EFI_VFR_WARNING_CODE.VFR_WARNING_ACTION_WITH_TEXT_TWO: - ": Action opcode should not have TextTwo part", - EFI_VFR_WARNING_CODE.VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE: - ": Not recommend to use obsoleted framework opcode", - EFI_VFR_WARNING_CODE.VFR_WARNING_CODEUNDEFINED: ": undefined Warning C= ode" -} - - -class CVfrErrorHandle(): - - def __init__(self): - self.__InputFileName =3D None - self.__vfrErrorMessage =3D vfrErrorMessage - self.__vfrWarningMessage =3D vfrWarningMessage - self.__WarningAsError =3D False - - def SetWarningAsError(self, WarningAsError): - self.__WarningAsError =3D WarningAsError - - def SetInputFile(self, InputFile): - self.__InputFileName =3D InputFile - - def HandleWarning(self, WarningCode, LineNum, TokenValue=3DNone): - if self.__vfrWarningMessage =3D=3D None: - return 1 - WarningMsg =3D '' - for key in self.__vfrWarningMessage.keys(): - if WarningCode =3D=3D self.__vfrWarningMessage[key]: - WarningMsg =3D self.__vfrWarningMessage[key] - break - if WarningMsg !=3D '': - if self.__WarningAsError: - EdkLogger.error('VfrCompiler', WarningCode, WarningMsg, - self.__InputFileName, LineNum, - "warning treated as error") - EdkLogger.warn('VfrCompiler', WarningMsg, self.__InputFileName= , - LineNum, TokenValue) - - def PrintMsg(self, - LineNum, - MsgType=3D'Error', - ErrorMsg=3DNone, - TokenValue=3DNone): - if MsgType =3D=3D 'Warning': - EdkLogger.verbose(ErrorMsg) - else: - EdkLogger.error('VfrCompiler', 0x3000, ErrorMsg, - self.__InputFileName, LineNum, TokenValue) - - def HandleError(self, ErrorCode, LineNum=3DNone, TokenValue=3DNone): - if self.__vfrErrorMessage =3D=3D None: - return 1 - ErrorMsg =3D '' - for key in self.__vfrErrorMessage.keys(): - if ErrorCode =3D=3D self.__vfrErrorMessage[key]: - ErrorMsg =3D self.__vfrErrorMessage[key] - break - if ErrorMsg !=3D '': - EdkLogger.error('VfrCompiler', ErrorCode, ErrorMsg, - self.__InputFileName, LineNum, TokenValue) - return 1 - else: - return 0 - - -gCVfrErrorHandle =3D CVfrErrorHandle() \ No newline at end of file diff --git a/BaseTools/Source/Python/VfrCompiler/VfrFormPkg.py b/BaseTools/= Source/Python/VfrCompiler/VfrFormPkg.py deleted file mode 100644 index 944b1fe193..0000000000 --- a/BaseTools/Source/Python/VfrCompiler/VfrFormPkg.py +++ /dev/null @@ -1,2738 +0,0 @@ -from ast import For -from re import L -from sre_parse import FLAGS -from stat import FILE_ATTRIBUTE_SPARSE_FILE -from VfrCompiler.CommonCtypes import * -from VfrCompiler.VfrError import VfrReturnCode -from VfrCompiler.VfrUtility import * - -from ctypes import * - - -class OpcodeSizesScopeNode(): - - def __init__(self, Size, Scope): - self.Size =3D Size - self.Scope =3D Scope - - -gOpcodeSizesScopeTable =3D [ - OpcodeSizesScopeNode(0, 0), # EFI_IFR_INVALID - 0x00 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_FORM), 1), # EFI_IFR_FORM_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_SUBTITLE), - 1), # EFI_IFR_SUBTITLE_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_TEXT), 0), # EFI_IFR_TEXT_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_IMAGE), 0), # EFI_IFR_IMAG= E_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_ONE_OF), - 1), # EFI_IFR_ONE_OF_OP - 0x05 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_CHECKBOX), - 1), # EFI_IFR_CHECKBOX_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_NUMERIC), - 1), # EFI_IFR_NUMERIC_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_PASSWORD), - 1), # EFI_IFR_PASSWORD_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_ONE_OF_OPTION), - 0), # EFI_IFR_ONE_OF_OPTION_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_SUPPRESS_IF), - 1), # EFI_IFR_SUPPRESS_IF - 0x0A - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_LOCKED), - 0), # EFI_IFR_LOCKED_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_ACTION), - 1), # EFI_IFR_ACTION_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_RESET_BUTTON), - 1), # EFI_IFR_RESET_BUTTON_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_FORM_SET), - 1), # EFI_IFR_FORM_SET_OP -0xE - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_REF), 0), # EFI_IFR_REF_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_NO_SUBMIT_IF), - 1), # EFI_IFR_NO_SUBMIT_IF_OP -0x10 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_INCONSISTENT_IF), - 1), # EFI_IFR_INCONSISTENT_IF_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_EQ_ID_VAL), - 0), # EFI_IFR_EQ_ID_VAL_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_EQ_ID_ID), - 0), # EFI_IFR_EQ_ID_ID_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_EQ_ID_VAL_LIST), - 0), # EFI_IFR_EQ_ID_LIST_OP - 0x14 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_AND), 0), # EFI_IFR_AND_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_OR), 0), # EFI_IFR_OR_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_NOT), 0), # EFI_IFR_NOT_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_RULE), 1), # EFI_IFR_RULE_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_GRAY_OUT_IF), - 1), # EFI_IFR_GRAYOUT_IF_OP - 0x19 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_DATE), 1), # EFI_IFR_DATE_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_TIME), 1), # EFI_IFR_TIME_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_STRING), - 1), # EFI_IFR_STRING_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_REFRESH), - 0), # EFI_IFR_REFRESH_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_DISABLE_IF), - 1), # EFI_IFR_DISABLE_IF_OP - 0x1E - OpcodeSizesScopeNode(0, 0), # 0x1F - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_TO_LOWER), - 0), # EFI_IFR_TO_LOWER_OP - 0x20 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_TO_UPPER), - 0), # EFI_IFR_TO_UPPER_OP - 0x21 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_MAP), 1), # EFI_IFR_MAP - = 0x22 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_ORDERED_LIST), - 1), # EFI_IFR_ORDERED_LIST_OP - 0x23 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_VARSTORE), - 0), # EFI_IFR_VARSTORE_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_VARSTORE_NAME_VALUE), - 0), # EFI_IFR_VARSTORE_NAME_VALUE_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_VARSTORE_EFI), - 0), # EFI_IFR_VARSTORE_EFI_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_VARSTORE_DEVICE), - 1), # EFI_IFR_VARSTORE_DEVICE_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_VERSION), - 0), # EFI_IFR_VERSION_OP - 0x28 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_END), 0), # EFI_IFR_END_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_MATCH), - 0), # EFI_IFR_MATCH_OP - 0x2A - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_GET), 0), # EFI_IFR_GET - = 0x2B - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_SET), 0), # EFI_IFR_SET - = 0x2C - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_READ), - 0), # EFI_IFR_READ - 0x2D - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_WRITE), - 0), # EFI_IFR_WRITE - 0x2E - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_EQUAL), - 0), # EFI_IFR_EQUAL_OP - 0x2F - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_NOT_EQUAL), - 0), # EFI_IFR_NOT_EQUAL_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_GREATER_THAN), - 0), # EFI_IFR_GREATER_THAN_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_GREATER_EQUAL), - 0), # EFI_IFR_GREATER_EQUAL_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_LESS_THAN), - 0), # EFI_IFR_LESS_THAN_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_LESS_EQUAL), - 0), # EFI_IFR_LESS_EQUAL_OP - 0x34 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_BITWISE_AND), - 0), # EFI_IFR_BITWISE_AND_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_BITWISE_OR), - 0), # EFI_IFR_BITWISE_OR_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_BITWISE_NOT), - 0), # EFI_IFR_BITWISE_NOT_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_SHIFT_LEFT), - 0), # EFI_IFR_SHIFT_LEFT_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_SHIFT_RIGHT), - 0), # EFI_IFR_SHIFT_RIGHT_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_ADD), - 0), # EFI_IFR_ADD_OP - 0x3A - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_SUBTRACT), - 0), # EFI_IFR_SUBTRACT_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_MULTIPLY), - 0), # EFI_IFR_MULTIPLY_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_DIVIDE), - 0), # EFI_IFR_DIVIDE_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_MODULO), - 0), # EFI_IFR_MODULO_OP - 0x3E - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_RULE_REF), - 0), # EFI_IFR_RULE_REF_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_QUESTION_REF1), - 0), # EFI_IFR_QUESTION_REF1_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_QUESTION_REF2), - 0), # EFI_IFR_QUESTION_REF2_OP - 0x41 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_UINT8), 0), # EFI_IFR_UINT= 8 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_UINT16), 0), # EFI_IFR_UIN= T16 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_UINT32), 0), # EFI_IFR_UIN= T32 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_UINT64), 0), # EFI_IFR_UTN= T64 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_TRUE), - 0), # EFI_IFR_TRUE_OP - 0x46 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_FALSE), 0), # EFI_IFR_FALS= E_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_TO_UINT), - 0), # EFI_IFR_TO_UINT_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_TO_STRING), - 0), # EFI_IFR_TO_STRING_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_TO_BOOLEAN), - 0), # EFI_IFR_TO_BOOLEAN_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_MID), 0), # EFI_IFR_MID_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_FIND), 0), # EFI_IFR_FIND_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_TOKEN), 0), # EFI_IFR_TOKE= N_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_STRING_REF1), - 0), # EFI_IFR_STRING_REF1_OP - 0x4E - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_STRING_REF2), - 0), # EFI_IFR_STRING_REF2_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_CONDITIONAL), - 0), # EFI_IFR_CONDITIONAL_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_QUESTION_REF3), - 0), # EFI_IFR_QUESTION_REF3_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_ZERO), 0), # EFI_IFR_ZERO_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_ONE), 0), # EFI_IFR_ONE_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_ONES), 0), # EFI_IFR_ONES_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_UNDEFINED), - 0), # EFI_IFR_UNDEFINED_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_LENGTH), - 0), # EFI_IFR_LENGTH_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_DUP), - 0), # EFI_IFR_DUP_OP - 0x57 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_THIS), 0), # EFI_IFR_THIS_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_SPAN), 0), # EFI_IFR_SPAN_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_VALUE), 1), # EFI_IFR_VALU= E_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_DEFAULT), - 0), # EFI_IFR_DEFAULT_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_DEFAULTSTORE), - 0), # EFI_IFR_DEFAULTSTORE_OP - 0x5C - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_FORM_MAP), - 1), # EFI_IFR_FORM_MAP_OP - 0x5D - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_CATENATE), - 0), # EFI_IFR_CATENATE_OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_GUID), 0), # EFI_IFR_GUID_= OP - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_SECURITY), - 0), # EFI_IFR_SECURITY_OP - 0x60 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_MODAL_TAG), - 0), # EFI_IFR_MODAL_TAG_OP - 0x61 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_REFRESH_ID), - 0), # EFI_IFR_REFRESH_ID_OP - 0x62 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_WARNING_IF), - 1), # EFI_IFR_WARNING_IF_OP - 0x63 - OpcodeSizesScopeNode(ctypes.sizeof(EFI_IFR_MATCH2), 0) -] - - -class SBufferNode(): - - def __init__(self, Buffer=3D'', Next=3DNone): - self.Buffer =3D Buffer - self.Next =3D Next - - -class CFormPkg(): - - def __init__(self, BufferSize=3D4096): - - Node =3D SBufferNode() - self.__BufferNodeQueueHead =3D Node - self.__BufferNodeQueueTail =3D Node - self.__CurrBufferNode =3D Node - self.__ReadBufferNode =3D None - self.__ReadBufferOffset =3D 0 - self.__PkgLength =3D 0 - self.__PendingAssignList =3D None - self.__BufferSize =3D BufferSize - - def GetPkgLength(self): - return self.__PkgLength - - def __createNewNode(self): - Node =3D SBufferNode() - return Node - - def __GetNodeBefore(self, CurrentNode): - FirstNode =3D self.__BufferNodeQueueHead - LastNode =3D self.__BufferNodeQueueHead - while FirstNode !=3D None: - if FirstNode =3D=3D CurrentNode: - break - - LastNode =3D FirstNode - FirstNode =3D FirstNode.Next - - if FirstNode =3D=3D None: - LastNode =3D None - - return LastNode - - def __InsertNodeBefore(self, CurrentNode, NewNode): - LastNode =3D self.__GetNodeBefore(CurrentNode) - if LastNode =3D=3D None: - return VfrReturnCode.VFR_RETURN_MISMATCHED - - NewNode.Next =3D LastNode.Next - LastNode.Next =3D NewNode - - def IfrBinBufferGet(self, Len): - if Len =3D=3D 0 or Len > self.__BufferSize: - return None - if len(self.__CurrBufferNode.Buffer) + Len > self.__BufferSize: - Node =3D self.__createNewNode() - if Node =3D=3D None: - return None - - if self.__BufferNodeQueueTail =3D=3D None: - self.__BufferNodeQueueHead =3D self.__BufferNodeQueueTail = =3D Node - else: - self.__BufferNodeQueueTail.Next =3D Node - mBufferNodeQueueTail =3D Node - self.__CurrBufferNode =3D Node - - self.__PkgLength +=3D Len - - return self.__CurrBufferNode.Buffer - - - -gCFormPkg =3D CFormPkg() -gCreateOp =3D True - -gIfrObjPrintDebugTable =3D [ - "EFI_IFR_INVALID", - "EFI_IFR_FORM", - "EFI_IFR_SUBTITLE", - "EFI_IFR_TEXT", - "EFI_IFR_IMAGE", - "EFI_IFR_ONE_OF", - "EFI_IFR_CHECKBOX", - "EFI_IFR_NUMERIC", - "EFI_IFR_PASSWORD", - "EFI_IFR_ONE_OF_OPTION", - "EFI_IFR_SUPPRESS_IF", - "EFI_IFR_LOCKED", - "EFI_IFR_ACTION", - "EFI_IFR_RESET_BUTTON", - "EFI_IFR_FORM_SET", - "EFI_IFR_REF", - "EFI_IFR_NO_SUBMIT_IF", - "EFI_IFR_INCONSISTENT_IF", - "EFI_IFR_EQ_ID_VAL", - "EFI_IFR_EQ_ID_ID", - "EFI_IFR_EQ_ID_LIST", - "EFI_IFR_AND", - "EFI_IFR_OR", - "EFI_IFR_NOT", - "EFI_IFR_RULE", - "EFI_IFR_GRAY_OUT_IF", - "EFI_IFR_DATE", - "EFI_IFR_TIME", - "EFI_IFR_STRING", - "EFI_IFR_REFRESH", - "EFI_IFR_DISABLE_IF", - "EFI_IFR_INVALID", - "EFI_IFR_TO_LOWER", - "EFI_IFR_TO_UPPER", - "EFI_IFR_MAP", - "EFI_IFR_ORDERED_LIST", - "EFI_IFR_VARSTORE", - "EFI_IFR_VARSTORE_NAME_VALUE", - "EFI_IFR_VARSTORE_EFI", - "EFI_IFR_VARSTORE_DEVICE", - "EFI_IFR_VERSION", - "EFI_IFR_END", - "EFI_IFR_MATCH", - "EFI_IFR_GET", - "EFI_IFR_SET", - "EFI_IFR_READ", - "EFI_IFR_WRITE", - "EFI_IFR_EQUAL", - "EFI_IFR_NOT_EQUAL", - "EFI_IFR_GREATER_THAN", - "EFI_IFR_GREATER_EQUAL", - "EFI_IFR_LESS_THAN", - "EFI_IFR_LESS_EQUAL", - "EFI_IFR_BITWISE_AND", - "EFI_IFR_BITWISE_OR", - "EFI_IFR_BITWISE_NOT", - "EFI_IFR_SHIFT_LEFT", - "EFI_IFR_SHIFT_RIGHT", - "EFI_IFR_ADD", - "EFI_IFR_SUBTRACT", - "EFI_IFR_MULTIPLY", - "EFI_IFR_DIVIDE", - "EFI_IFR_MODULO", - "EFI_IFR_RULE_REF", - "EFI_IFR_QUESTION_REF1", - "EFI_IFR_QUESTION_REF2", - "EFI_IFR_UINT8", - "EFI_IFR_UINT16", - "EFI_IFR_UINT32", - "EFI_IFR_UINT64", - "EFI_IFR_TRUE", - "EFI_IFR_FALSE", - "EFI_IFR_TO_UINT", - "EFI_IFR_TO_STRING", - "EFI_IFR_TO_BOOLEAN", - "EFI_IFR_MID", - "EFI_IFR_FIND", - "EFI_IFR_TOKEN", - "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_MATCH2", -] - - -class CIfrObj(): - - def __init__(self, Obj=3DNone, OpCode=3DNone, ObjBinLen=3D0, DelayEmit= =3DFalse, LineNo=3D0): - - self.__DelayEmit =3D DelayEmit - self.__PkgOffset =3D gCFormPkg.GetPkgLength() - self.__ObjBinLen =3D gOpcodeSizesScopeTable[ - OpCode].Size if ObjBinLen =3D=3D 0 else ObjBinLen - - self.__ObjBinBuf =3D Obj - self.__LineNo =3D LineNo - - # print ("=3D=3D=3D=3D=3D=3DCreate IFR [%s]\n", gIfrObjPrintDebugT= able[OpCode]) - return self.__ObjBinBuf - - def SetObjBin(self, ObjBinLen): - - self.__ObjBinLen =3D ObjBinLen - if self.__DelayEmit =3D=3D False and gCreateOp =3D=3D True: - self.__ObjBinBuf =3D gCFormPkg.IfrBinBufferGet(self.__ObjBinLe= n) - - def SetLineNo(self, LineNo): - self.__LineNo =3D LineNo - - def GetObjBinAddr(self, Addr): - self.__ObjBinBuf =3D Addr - return self.__ObjBinBuf - - def GetObjBinOffset(self): - return self.__PkgOffset - - def GetObjBinLen(self): - return self.__ObjBinLen - - def ExpendObjBin(self, Size): - if (self.__DelayEmit) =3D=3D True and ( - (self.__ObjBinLen + Size) > self.__ObjBinLen): - self.__ObjBinLen =3D self.__ObjBinLen + Size - return True - else: - return False - - def ShrinkObjBin(self, Size): - if (self.__DelayEmit) =3D=3D True and (self.__ObjBinLen > Size): - self.__ObjBinLen =3D self.__ObjBinLen - Size - - def GetObjBin(self): - return self.__ObjBinBuf - - def EMIT_PENDING_OBJ(self): - if self.__DelayEmit =3D=3D False or gCreateOp =3D=3D False: - return - - self.__PkgOffset =3D gCFormPkg.GetPkgLength() - # update data buffer to package data - self.__ObjBinBuf =3D gCFormPkg.IfrBinBufferGet(self.__ObjBinLen) - - self.__DelayEmit =3D False - - -gScopeCount =3D 0 -gIsOrderedList =3D False -gIsStringOp =3D False -gCurrentQuestion =3D None -gCurrentMinMaxData =3D None - - -def SetCurrentQuestion(Question): - - gCurrentQuestion =3D Question - return gCurrentQuestion - - -class CIfrOpHeader(): - - def __init__(self, OpHeader: EFI_IFR_OP_HEADER, OpCode=3DNone, Length= =3D0): - self.__OpHeader =3D OpHeader - if OpCode !=3D None: - self.__OpHeader.OpCode =3D OpCode - - self.__OpHeader.Length =3D gOpcodeSizesScopeTable[ - OpCode].Size if Length =3D=3D 0 else Length - self.__OpHeader.Scope =3D 1 if ( - gOpcodeSizesScopeTable[OpCode].Scope + gScopeCount > 0) el= se 0 - - def GetLength(self): - return self.__OpHeader.Length - - def SetScope(self, Scope): - self.__OpHeader.Scope =3D Scope - - def GetScope(self): - return self.__OpHeader.Scope - - def UpdateHeader(self, Header): - self.__OpHeader =3D Header - - def IncLength(self, Size): - self.__OpHeader.Length +=3D Size - - def DecLength(self, Size): - self.__OpHeader.Length -=3D Size - - def GetOpCode(self): - return self.__OpHeader.OpCode - - -class CIfrStatementHeader(): - - def __init__(self, sHeader: EFI_IFR_STATEMENT_HEADER): - self.__sHeader =3D sHeader - self.__sHeader.Help =3D EFI_STRING_ID_INVALID - self.__sHeader.Prompt =3D EFI_STRING_ID_INVALID - - def GetStatementHeader(self): - return self.__sHeader - - def SetPrompt(self, Prompt): - self.__sHeader.Prompt =3D Prompt - - def SetHelp(self, Help): - self.__sHeader.Help =3D Help - - -class CIfrMinMaxStepData(): - - def __init__(self, MinMaxStepData, NumericOpcode=3DFalse): - self.__MinMaxStepData =3D MinMaxStepData - self.__MinMaxStepData.u64.MinValue =3D 0 - self.__MinMaxStepData.u64.MaxValue =3D 0 - self.__MinMaxStepData.u64.Step =3D 0 - self.__ValueIsSet =3D False - self.__IsNumeric =3D NumericOpcode - self.__VarType =3D EFI_IFR_TYPE_NUM_SIZE_64 - - def SetMinMaxStepData(self, MinValue, MaxValue, Step, VarType): - self.__VarType =3D VarType - - if self.__ValueIsSet =3D=3D False: - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - self.__MinMaxStepData.u64.MinValue =3D MinValue - self.__MinMaxStepData.u64.MaxValue =3D MaxValue - self.__MinMaxStepData.u64.Step =3D Step - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - self.__MinMaxStepData.u32.MinValue =3D MinValue - self.__MinMaxStepData.u32.MaxValue =3D MaxValue - self.__MinMaxStepData.u32.Step =3D Step - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - self.__MinMaxStepData.u16.MinValue =3D MinValue - self.__MinMaxStepData.u16.MaxValue =3D MaxValue - self.__MinMaxStepData.u16.Step =3D Step - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - self.__MinMaxStepData.u8.MinValue =3D MinValue - self.__MinMaxStepData.u8.MaxValue =3D MaxValue - self.__MinMaxStepData.u8.Step =3D Step - self.__ValueIsSet =3D True - else: - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - if MinValue < self.__MinMaxStepData.u64.MinValue: - self.__MinMaxStepData.u64.MinValue =3D MinValue - if MaxValue > self.__MinMaxStepData.u64.MaxValue: - self.__MinMaxStepData.u64.MaxValue =3D MaxValue - self.__MinMaxStepData.u64.Step =3D Step - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - if MinValue < self.__MinMaxStepData.u32.MinValue: - self.__MinMaxStepData.u32.MinValue =3D MinValue - if MaxValue > self.__MinMaxStepData.u32.MaxValue: - self.__MinMaxStepData.u32.MaxValue =3D MaxValue - self.__MinMaxStepData.u32.Step =3D Step - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - if MinValue < self.__MinMaxStepData.u16.MinValue: - self.__MinMaxStepData.u16.MinValue =3D MinValue - if MaxValue > self.__MinMaxStepData.u16.MaxValue: - self.__MinMaxStepData.u16.MaxValue =3D MaxValue - self.__MinMaxStepData.u16.Step =3D Step - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - if MinValue < self.__MinMaxStepData.u8.MinValue: - self.__MinMaxStepData.u8.MinValue =3D MinValue - if MaxValue > self.__MinMaxStepData.u8.MaxValue: - self.__MinMaxStepData.u8.MaxValue =3D MaxValue - self.__MinMaxStepData.u8.Step =3D Step - - def GetVarType(self): - return self.__VarType - - def IsNumericOpcode(self): - return self.__IsNumeric - - def UpdateCIfrMinMaxStepData(self, MinMaxStepData): - self.__MinMaxStepData =3D MinMaxStepData - - def GetMinData(self, VarType, IsBitVar): - - if IsBitVar: - return self.__MinMaxStepData.u32.MinValue - - else: - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - return self.__MinMaxStepData.u64.MinValue - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - return self.__MinMaxStepData.u32.MinValue - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - return self.__MinMaxStepData.u16.MinValue - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - return self.__MinMaxStepData.u8.MinValue - - return 0 - - def GetMaxData(self, VarType, IsBitVar): - - if IsBitVar: - return self.__MinMaxStepData.u32.MaxValue - - else: - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - return self.__MinMaxStepData.u64.MaxValue - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - return self.__MinMaxStepData.u32.MaxValue - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - return self.__MinMaxStepData.u16.MaxValue - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - return self.__MinMaxStepData.u8.MaxValue - - return 0 - - def GetStepData(self, VarType, IsBitVar): - - if IsBitVar: - return self.__MinMaxStepData.u32.Step - - else: - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - return self.__MinMaxStepData.u64.Step - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - return self.__MinMaxStepData.u32.Step - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - return self.__MinMaxStepData.u16.Step - if VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - return self.__MinMaxStepData.u8.Step - - return 0 - - -class CIfrFormSet(CIfrObj, CIfrOpHeader): - - def __init__(self, Size): - self.__FormSet =3D EFI_IFR_FORM_SET() - CIfrObj.__init__(self, self.__FormSet, EFI_IFR_FORM_SET_OP) - CIfrOpHeader.__init__(self, self.__FormSet.Header, EFI_IFR_FORM_SE= T_OP, - Size) - self.__FormSet.Help =3D EFI_STRING_ID_INVALID - self.__FormSet.FormSetTitle =3D EFI_STRING_ID_INVALID - self.__FormSet.Flags =3D 0 - self.__FormSet.Guid =3D EFI_GUID(0, 0, 0, - GuidArray(0, 0, 0, 0, 0, 0, 0, 0)) - self.__ClassGuid =3D [] - - def SetGuid(self, Guid): - self.__FormSet.Guid =3D Guid - - def GetGuid(self): - return self.__FormSet.Guid - - def SetFormSetTitle(self, FormSetTitle): - self.__FormSet.FormSetTitle =3D FormSetTitle - - def GetFormSetTitle(self): - return self.__FormSet.FormSetTitle - - def SetHelp(self, Help): - self.__FormSet.Help =3D Help - - def GetHelp(self): - return self.__FormSet.Help - - def SetClassGuid(self, Guid): - self.__ClassGuid.append(Guid) - self.__FormSet.Flags +=3D 1 - - def GetClassGuid(self): - return self.__ClassGuid - - def GetFlags(self): - return self.__FormSet.Flags - - def GetInfo(self): - return self.__FormSet - - -class CIfrOneOfOption(CIfrObj, CIfrOpHeader): - - def __init__(self, Size): - self.__OneOfOption =3D EFI_IFR_ONE_OF_OPTION() - CIfrOpHeader.__init__(self, self.__OneOfOption.Header, - EFI_IFR_ONE_OF_OPTION_OP, Size) - self.__OneOfOption.Flags =3D 0 - self.__OneOfOption.Option =3D EFI_STRING_ID_INVALID - self.__OneOfOption.Type =3D EFI_IFR_TYPE_OTHER - self.__OneOfOption.Value =3D EFI_IFR_TYPE_VALUE() - - def SetOption(self, Option): - self.__OneOfOption.Option =3D Option - - def SetType(self, Type): - self.__OneOfOption.Type =3D Type - - def SetValue(self, Value): - self.__OneOfOption.Value =3D Value - - def GetFlags(self): - return self.__OneOfOption.Flags - - def SetFlags(self, LFlags): - - self.__OneOfOption.Flags =3D 0 - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_OPTION_DEFAUL= T) - if Ret: - self.__OneOfOption.Flags |=3D EFI_IFR_OPTION_DEFAULT - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_OPTION_DEFAUL= T_MFG) - if Ret: - self.__OneOfOption.Flags |=3D EFI_IFR_OPTION_DEFAULT_MFG - - if LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_8) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_8 - - elif LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_16) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_16 - - elif LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_32) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_32 - - elif LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_64) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_64 - - elif LFlags =3D=3D EFI_IFR_TYPE_BOOLEAN: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_BOOLEAN) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_BOOLEAN - - elif LFlags =3D=3D EFI_IFR_TYPE_TIME: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_TIME) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_TIME - - elif LFlags =3D=3D EFI_IFR_TYPE_DATE: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_DATE) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_DATE - - elif LFlags =3D=3D EFI_IFR_TYPE_STRING: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_STRING) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_STRING - - elif LFlags =3D=3D EFI_IFR_TYPE_OTHER: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_OTHER) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_OTHER - - return VfrReturnCode.VFR_RETURN_SUCCESS if LFlags =3D=3D 0 else Vf= rReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - def GetInfo(self): - return self.__OneOfOption - - -class CIfrOneOfOption2(CIfrObj, CIfrOpHeader): - - def __init__(self, Size, Nums, ValueType, ValueList=3D[]): - self.__OneOfOption =3D Refine_EFI_IFR_ONE_OF_OPTION(Nums) - Header =3D EFI_IFR_OP_HEADER() - CIfrOpHeader.__init__(self, Header, EFI_IFR_ONE_OF_OPTION_OP, Size= ) - self.__OneOfOption.Header =3D Header - self.__OneOfOption.Flags =3D 0 - self.__OneOfOption.Option =3D EFI_STRING_ID_INVALID - self.__OneOfOption.Type =3D EFI_IFR_TYPE_OTHER - self.__ValueType =3D ValueType - if ValueList !=3D []: - ArrayType =3D EFI_IFR_TYPE_VALUE * Nums - ValueArray =3D ArrayType() - for i in range(0, len(ValueList)): - ValueArray[i] =3D ValueList[i] - self.__OneOfOption.Value =3D ValueArray - - def SetOption(self, Option): - self.__OneOfOption.Option =3D Option - - def SetType(self, Type): - self.__OneOfOption.Type =3D Type - - def GetValueType(self): - return self.__ValueType - - def SetValue(self, ValueList): - ArrayType =3D EFI_IFR_TYPE_VALUE * (len(ValueList)) - ValueArray =3D ArrayType() - for i in range(0, len(ValueList)): - ValueArray[i] =3D ValueList[i] - self.__OneOfOption.Value =3D ValueArray - - def GetFlags(self): - return self.__OneOfOption.Flags - - def SetFlags(self, LFlags): - - self.__OneOfOption.Flags =3D 0 - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_OPTION_DEFAUL= T) - if Ret: - self.__OneOfOption.Flags |=3D EFI_IFR_OPTION_DEFAULT - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_OPTION_DEFAUL= T_MFG) - if Ret: - self.__OneOfOption.Flags |=3D EFI_IFR_OPTION_DEFAULT_MFG - - if LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_8) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_8 - - elif LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_16) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_16 - - elif LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_32) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_32 - - elif LFlags =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_NUM_SIZE_64) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_NUM_SIZE_64 - - elif LFlags =3D=3D EFI_IFR_TYPE_BOOLEAN: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_BOOLEAN) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_BOOLEAN - - elif LFlags =3D=3D EFI_IFR_TYPE_TIME: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_TIME) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_TIME - - elif LFlags =3D=3D EFI_IFR_TYPE_DATE: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_DATE) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_DATE - - elif LFlags =3D=3D EFI_IFR_TYPE_STRING: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_STRING) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_STRING - - elif LFlags =3D=3D EFI_IFR_TYPE_OTHER: - LFlags =3D _FLAG_CLEAR(LFlags, EFI_IFR_TYPE_OTHER) - self.__OneOfOption.Flags |=3D EFI_IFR_TYPE_OTHER - - return VfrReturnCode.VFR_RETURN_SUCCESS if LFlags =3D=3D 0 else Vf= rReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - def GetInfo(self): - return self.__OneOfOption - - -class CIfrOptionKey(CIfrObj, CIfrOpHeader): - - def __init__(self, QuestionId, OptionValue, KeyValue): - - self.__OptionKey =3D EFI_IFR_GUID_OPTIONKEY() - CIfrOpHeader.__init__(self, self.__OptionKey.Header, EFI_IFR_GUID_= OP, - ctypes.sizeof(EFI_IFR_GUID_OPTIONKEY)) - self.__OptionKey.ExtendOpCode =3D EFI_IFR_EXTEND_OP_OPTIONKEY - self.__OptionKey.Guid =3D EFI_IFR_FRAMEWORK_GUID - self.__OptionKey.QuestionId =3D QuestionId - self.__OptionKey.OptionValue =3D OptionValue - self.__OptionKey.KeyValue =3D KeyValue - - def GetInfo(self): - return self.__OptionKey - - -class CIfrClass(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__Class =3D EFI_IFR_GUID_CLASS() # static guid - CIfrOpHeader.__init__(self, self.__Class.Header, EFI_IFR_GUID_OP, - ctypes.sizeof(EFI_IFR_GUID_CLASS)) - self.__Class.ExtendOpCode =3D EFI_IFR_EXTEND_OP_CLASS - self.__Class.Guid =3D EFI_IFR_TIANO_GUID - self.__Class.Class =3D EFI_NON_DEVICE_CLASS - - def SetClass(self, Class): - self.__Class.Class =3D Class - - def GetInfo(self): - return self.__Class - - -class CIfrSubClass(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__SubClass =3D EFI_IFR_GUID_SUBCLASS() # static guid - CIfrOpHeader.__init__(self, self.__SubClass.Header, EFI_IFR_GUID_O= P, - ctypes.sizeof(EFI_IFR_GUID_SUBCLASS)) - self.__SubClass.ExtendOpCode =3D EFI_IFR_EXTEND_OP_SUBCLASS - self.__SubClass.Guid =3D EFI_IFR_TIANO_GUID - self.__SubClass.SubClass =3D EFI_SETUP_APPLICATION_SUBCLASS - - def SetSubClass(self, SubClass): - self.__SubClass.SubClass =3D SubClass - - def GetInfo(self): - return self.__SubClass - - -class CIfrDefaultStore(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__DefaultStore =3D EFI_IFR_DEFAULTSTORE() - CIfrOpHeader.__init__(self, self.__DefaultStore.Header, - EFI_IFR_DEFAULTSTORE_OP) - self.__DefaultStore.DefaultName =3D EFI_STRING_ID_INVALID - self.__DefaultStore.DefaultId =3D EFI_VARSTORE_ID_INVALID - - def SetDefaultName(self, DefaultName): - self.__DefaultStore.DefaultName =3D DefaultName - - def SetDefaultId(self, DefaultId): - self.__DefaultStore.DefaultId =3D DefaultId - - def GetDefaultStore(self): - return self.__DefaultStore - - def SetDefaultStore(self, DefaultStore: EFI_IFR_DEFAULTSTORE): - self.__DefaultStore =3D DefaultStore - - def GetInfo(self): - return self.__DefaultStore - - -class CIfrVarStore(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__Varstore =3D EFI_IFR_VARSTORE() - CIfrOpHeader.__init__(self, self.__Varstore.Header, - EFI_IFR_VARSTORE_OP) - self.__Varstore.VarStoreId =3D EFI_VARSTORE_ID_INVALID - self.__Varstore.Size =3D 0 - self.__Varstore.Name =3D '' - - def SetGuid(self, Guid): - self.__Varstore.Guid =3D Guid - - def SetSize(self, Size): - self.__Varstore.Size =3D Size - - def SetVarStoreId(self, VarStoreId): - self.__Varstore.VarStoreId =3D VarStoreId - - def SetName(self, Name): - self.__Varstore.Name =3D Name - - def GetInfo(self): - return self.__Varstore - - -class CIfrVarStoreEfi(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__VarStoreEfi =3D EFI_IFR_VARSTORE_EFI() - CIfrOpHeader.__init__(self, self.__VarStoreEfi.Header, - EFI_IFR_VARSTORE_EFI_OP) - self.__VarStoreEfi.VarStoreId =3D EFI_VAROFFSET_INVALID - self.__VarStoreEfi.Size =3D 0 - self.__VarStoreEfi.Name =3D '' - - def SetGuid(self, Guid): - self.__VarStoreEfi.Guid =3D Guid - - def SetSize(self, Size): - self.__VarStoreEfi.Size =3D Size - - def SetVarStoreId(self, VarStoreId): - self.__VarStoreEfi.VarStoreId =3D VarStoreId - - def SetName(self, Name): - self.__VarStoreEfi.Name =3D Name - - def SetAttributes(self, Attributes): - self.__VarStoreEfi.Attributes =3D Attributes - - def GetInfo(self): - return self.__VarStoreEfi - - -class CIfrVarStoreNameValue(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__VarStoreNameValue =3D EFI_IFR_VARSTORE_NAME_VALUE() - CIfrOpHeader.__init__(self, self.__VarStoreNameValue.Header, - EFI_IFR_VARSTORE_NAME_VALUE_OP) - self.__VarStoreNameValue.VarStoreId =3D EFI_VAROFFSET_INVALID - - def SetGuid(self, Guid): - self.__VarStoreNameValue.Guid =3D Guid - - def SetVarStoreId(self, VarStoreId): - self.__VarStoreNameValue.VarStoreId =3D VarStoreId - - def GetInfo(self): - return self.__VarStoreNameValue - - -EFI_BITS_PER_UINT32 =3D 1 << EFI_BITS_SHIFT_PER_UINT32 -EFI_FORM_ID_MAX =3D 0xFFFF - -EFI_FREE_FORM_ID_BITMAP_SIZE =3D int((EFI_FORM_ID_MAX + 1) / EFI_BITS_PER_= UINT32) - - -class CIfrFormId(): - - FormIdBitMap =3D [] - for i in range(0, EFI_FREE_FORM_ID_BITMAP_SIZE): - FormIdBitMap.append(0) - - @classmethod - def CheckFormIdFree(cls, FormId): - - Index =3D int(FormId / EFI_BITS_PER_UINT32) - Offset =3D FormId % EFI_BITS_PER_UINT32 - - return (cls.FormIdBitMap[Index] & (0x80000000 >> Offset)) =3D=3D 0 - - @classmethod - def MarkFormIdUsed(cls, FormId): - - Index =3D int(FormId / EFI_BITS_PER_UINT32) - Offset =3D FormId % EFI_BITS_PER_UINT32 - cls.FormIdBitMap[Index] |=3D (0x80000000 >> Offset) - - -class CIfrForm(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__Form =3D EFI_IFR_FORM() - CIfrOpHeader.__init__(self, self.__Form.Header, EFI_IFR_FORM_OP) - self.__Form.FormId =3D 0 - self.__Form.FormTitle =3D EFI_STRING_ID_INVALID - - def SetFormId(self, FormId): - # FormId can't be 0. - if FormId =3D=3D 0: - return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER - if CIfrFormId.CheckFormIdFree(FormId) =3D=3D False: - return VfrReturnCode.VFR_RETURN_FORMID_REDEFINED - self.__Form.FormId =3D FormId - CIfrFormId.MarkFormIdUsed(FormId) - return VfrReturnCode.VFR_RETURN_SUCCESS - - def SetFormTitle(self, FormTitle): - self.__Form.FormTitle =3D FormTitle - - def GetInfo(self): - return self.__Form - - -class CIfrFormMap(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__FormMap =3D EFI_IFR_FORM_MAP() - self.__MethodMapList =3D [] # EFI_IFR_FORM_MAP_METHOD() - CIfrOpHeader.__init__(self, self.__FormMap.Header, EFI_IFR_FORM_MA= P_OP) - self.__FormMap.FormId =3D 0 - - def SetFormId(self, FormId): - if FormId =3D=3D 0: - return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER - - if CIfrFormId.CheckFormIdFree(FormId) =3D=3D False: - return VfrReturnCode.VFR_RETURN_FORMID_REDEFINED - self.__FormMap.FormId =3D FormId - CIfrFormId.MarkFormIdUsed(FormId) - return VfrReturnCode.VFR_RETURN_SUCCESS - - def SetFormMapMethod(self, MethodTitle, MethodGuid: EFI_GUID): - MethodMap =3D EFI_IFR_FORM_MAP_METHOD() - MethodMap.MethodTitle =3D MethodTitle - MethodMap.MethodIdentifier =3D MethodGuid - self.__MethodMapList.append(MethodMap) - - def GetInfo(self): - return self.__FormMap, self.__MethodMapList - - -class CIfrEnd(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__End =3D EFI_IFR_END() - CIfrOpHeader.__init__(self, self.__End.Header, EFI_IFR_END_OP) - - -class CIfrBanner(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__Banner =3D EFI_IFR_GUID_BANNER() - CIfrOpHeader.__init__(self, self.__Banner.Header, EFI_IFR_GUID_OP, - ctypes.sizeof(EFI_IFR_GUID_BANNER)) - self.__Banner.ExtendOpCode =3D EFI_IFR_EXTEND_OP_BANNER - self.__Banner.Guid =3D EFI_IFR_TIANO_GUID - - def SetTitle(self, StringId): - self.__Banner.Title =3D StringId - - def SetLine(self, Line): - self.__Banner.LineNumber =3D Line - - def SetAlign(self, Align): - self.__Banner.Alignment =3D Align - - def GetInfo(self): - return self.__Banner - - -class CIfrTimeout(CIfrObj, CIfrOpHeader): - - def __init__(self, Timeout=3D0): - self.__Timeout =3D EFI_IFR_GUID_TIMEOUT() - CIfrOpHeader.__init__(self, self.__Timeout.Header, EFI_IFR_GUID_OP= , - ctypes.sizeof(EFI_IFR_GUID_TIMEOUT)) - self.__Timeout.ExtendOpCode =3D EFI_IFR_EXTEND_OP_TIMEOUT - self.__Timeout.Guid =3D EFI_IFR_TIANO_GUID - self.__Timeout.TimeOut =3D Timeout - - def SetTimeout(self, Timeout): - self.__Timeout.TimeOut =3D Timeout - - def GetInfo(self): - return self.__Timeout - - -class CIfrLabel(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__Label =3D EFI_IFR_GUID_LABEL() - CIfrOpHeader.__init__(self, self.__Label.Header, EFI_IFR_GUID_OP, - ctypes.sizeof(EFI_IFR_GUID_LABEL)) - self.__Label.ExtendOpCode =3D EFI_IFR_EXTEND_OP_LABEL - self.__Label.Guid =3D EFI_IFR_TIANO_GUID - - def SetNumber(self, Number): - self.__Label.Number =3D Number - - def GetInfo(self): - return self.__Label - - -class CIfrRule(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__Rule =3D EFI_IFR_RULE() - CIfrOpHeader.__init__(self, self.__Rule.Header, EFI_IFR_RULE_OP) - self.__Rule.RuleId =3D EFI_RULE_ID_INVALID - - def SetRuleId(self, RuleId): - self.__Rule.RuleId =3D RuleId - - def GetInfo(self): - return self.__Rule - - -def _FLAG_TEST_AND_CLEAR(Flags, Mask): - - Ret =3D Flags & Mask - Flags &=3D (~Mask) - return Flags, Ret - - -def _FLAG_CLEAR(Flags, Mask): - - Flags &=3D (~Mask) - return Flags - - -class CIfrSubtitle(CIfrObj, CIfrOpHeader, CIfrStatementHeader): - - def __init__(self, ): - self.__Subtitle =3D EFI_IFR_SUBTITLE() - - CIfrOpHeader.__init__(self, self.__Subtitle.Header, - EFI_IFR_SUBTITLE_OP) - CIfrStatementHeader.__init__(self, self.__Subtitle.Statement) - - self.__Subtitle.Flags =3D 0 - - def SetFlags(self, Flags): - Flags, Result =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAGS_HORIZO= NTAL) - if Result: - self.__Subtitle.Flags |=3D EFI_IFR_FLAGS_HORIZONTAL - - return VfrReturnCode.VFR_RETURN_SUCCESS if Flags =3D=3D 0 else Vfr= ReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - def GetInfo(self): - return self.__Subtitle - - -class CIfrImage(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__Image =3D EFI_IFR_IMAGE() - CIfrOpHeader.__init__(self, self.__Image.Header, EFI_IFR_IMAGE_OP) - self.__Image.Id =3D EFI_IMAGE_ID_INVALID - - def SetImageId(self, ImageId): - self.__Image.Id =3D ImageId - - def GetInfo(self): - return self.__Image - - -class CIfrLocked(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__Lock =3D EFI_IFR_LOCKED() - CIfrOpHeader.__init__(self, self.__Lock.Header, EFI_IFR_LOCKED_OP) - - -class CIfrModal(CIfrObj, CIfrOpHeader): - - def __init__(self, ): - self.__Modal =3D EFI_IFR_MODAL_TAG() - CIfrOpHeader.__init__(self, self.__Modal.Header, EFI_IFR_MODAL_TAG= _OP) - - -EFI_IFR_QUESTION_FLAG_DEFAULT =3D 0 - - -class CIfrQuestionHeader(CIfrStatementHeader): - - def __init__(self, qHeader, Flags=3DEFI_IFR_QUESTION_FLAG_DEFAULT): - - self.__qHeader =3D qHeader - CIfrStatementHeader.__init__(self, self.__qHeader.Header) - self.__qHeader.QuestionId =3D EFI_QUESTION_ID_INVALID - self.__qHeader.VarStoreId =3D EFI_VARSTORE_ID_INVALID - self.__qHeader.VarStoreInfo.VarName =3D EFI_STRING_ID_INVALID - self.__qHeader.VarStoreInfo.VarOffset =3D EFI_VAROFFSET_INVALID - self.__qHeader.Flags =3D Flags - - def GetQuestionId(self): - return self.__qHeader.QuestionId - - def SetQuestionId(self, QuestionId): - - self.__qHeader.QuestionId =3D QuestionId - - def GetVarStoreId(self): - return self.__qHeader.VarStoreId - - def SetVarStoreInfo(self, BaseInfo): - - self.__qHeader.VarStoreId =3D BaseInfo.VarStoreId - self.__qHeader.VarStoreInfo.VarName =3D BaseInfo.Info.VarName - self.__qHeader.VarStoreInfo.VarOffset =3D BaseInfo.Info.VarOffset - - def GetVarStoreInfo(self, Info): # Bug - - Info.VarStoreId =3D self.__qHeader.VarStoreId - Info.VarStoreInfo =3D self.__qHeader.VarStoreInfo - return Info - - def GetFlags(self): - return self.__qHeader.Flags - - def SetFlags(self, Flags): - - Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAG_READ_ONLY) - if Ret: - self.__qHeader.Flags |=3D EFI_IFR_FLAG_READ_ONLY - - Flags =3D _FLAG_CLEAR(Flags, 0x02) - - Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAG_CALLBACK) - if Ret: - self.__qHeader.Flags |=3D EFI_IFR_FLAG_CALLBACK - - # ignore NVAccessFlag - Flags =3D _FLAG_CLEAR(Flags, 0x08) - - Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAG_RESET_REQU= IRED) - if Ret: - self.__qHeader.Flags |=3D EFI_IFR_FLAG_RESET_REQUIRED - - Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, - EFI_IFR_FLAG_RECONNECT_REQUIRED) - if Ret: - self.__qHeader.Flags |=3D EFI_IFR_FLAG_RECONNECT_REQUIRED - - # Set LateCheck Flag to compatible for framework flag - # but it uses 0x20 as its flag, if in the future UEFI may take thi= s flag - - Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, 0x20) - if Ret: - self.__qHeader.Flags |=3D 0x20 - - Flags, Ret =3D _FLAG_TEST_AND_CLEAR(Flags, EFI_IFR_FLAG_OPTIONS_ON= LY) - if Ret: - self.__qHeader.Flags |=3D EFI_IFR_FLAG_OPTIONS_ONLY - - return VfrReturnCode.VFR_RETURN_SUCCESS if Flags =3D=3D 0 else Vfr= ReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - def UpdateCIfrQuestionHeader(self, qHeader): - self.__qHeader =3D qHeader - - -class CIfrRef(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self, ): - self.__Ref =3D EFI_IFR_REF() - CIfrOpHeader.__init__(self, self.__Ref.Header, EFI_IFR_REF_OP) - CIfrQuestionHeader.__init__(self, self.__Ref.Question) - self.__Ref.FormId =3D 0 - - def SetFormId(self, FormId): - self.__Ref.FormId =3D FormId - - def GetInfo(self): - return self.__Ref - - -class CIfrRef2(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self, ): - self.__Ref2 =3D EFI_IFR_REF2() - CIfrOpHeader.__init__(self, self.__Ref2.Header, EFI_IFR_REF_OP) - CIfrQuestionHeader.__init__(self, self.__Ref2.Question) - self.__Ref2.FormId =3D 0 - self.__Ref2.QuestionId =3D EFI_QUESTION_ID_INVALID - - def SetFormId(self, FormId): - self.__Ref2.FormId =3D FormId - - def SetQuestionId(self, QuestionId): - - self.__Ref2.QuestionId =3D QuestionId - - def GetInfo(self): - return self.__Ref2 - - -class CIfrRef3(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self, ): - self.__Ref3 =3D EFI_IFR_REF3() - CIfrOpHeader.__init__(self, self.__Ref3.Header, EFI_IFR_REF_OP) - CIfrQuestionHeader.__init__(self, self.__Ref3.Question) - self.__Ref3.FormId =3D 0 - self.__Ref3.QuestionId =3D EFI_QUESTION_ID_INVALID - EFI_IFR_DEFAULT_GUID =3D EFI_GUID(0, 0, 0, - GuidArray(0, 0, 0, 0, 0, 0, 0, 0)) - self.__Ref3.FormSetId =3D EFI_IFR_DEFAULT_GUID - - def SetFormId(self, FormId): - self.__Ref3.FormId =3D FormId - - def SetQuestionId(self, QuestionId): - - self.__Ref3.QuestionId =3D QuestionId - - def SetFormSetId(self, FormSetId): - self.__Ref3.FormSetId =3D FormSetId - - def GetInfo(self): - return self.__Ref3 - - -class CIfrRef4(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self, ): - self.__Ref4 =3D EFI_IFR_REF4() - CIfrOpHeader.__init__(self, self.__Ref4.Header, EFI_IFR_REF_OP) - CIfrQuestionHeader.__init__(self, self.__Ref4.Question) - self.__Ref4.FormId =3D 0 - self.__Ref4.QuestionId =3D EFI_QUESTION_ID_INVALID - EFI_IFR_DEFAULT_GUID =3D EFI_GUID(0, 0, 0, - GuidArray(0, 0, 0, 0, 0, 0, 0, 0)) - self.__Ref4.FormSetId =3D EFI_IFR_DEFAULT_GUID - self.__Ref4.DevicePath =3D EFI_STRING_ID_INVALID - - def SetFormId(self, FormId): - self.__Ref4.FormId =3D FormId - - def SetQuestionId(self, QuestionId): - - self.__Ref4.QuestionId =3D QuestionId - - def SetFormSetId(self, FormSetId): - self.__Ref4.FormSetId =3D FormSetId - - def SetDevicePath(self, DevicePath): - self.__Ref4.DevicePath =3D DevicePath - - def GetInfo(self): - return self.__Ref4 - - -class CIfrRef5(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self, ): - self.__Ref5 =3D EFI_IFR_REF5() - CIfrOpHeader.__init__(self, self.__Ref5.Header, EFI_IFR_REF_OP) - CIfrQuestionHeader.__init__(self, self.__Ref5.Question) - - def GetInfo(self): - return self.__Ref5 - - -class CIfrAction(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self, ): - self.__Action =3D EFI_IFR_ACTION() - CIfrOpHeader.__init__(self, self.__Action.Header, EFI_IFR_ACTION_O= P) - CIfrQuestionHeader.__init__(self, self.__Action.Question) - self.__Action.QuestionConfig =3D EFI_STRING_ID_INVALID - - def SetQuestionConfig(self, QuestionConfig): - self.__Action.QuestionConfig =3D QuestionConfig - - def GetInfo(self): - return self.__Action - - -class CIfrText(CIfrObj, CIfrOpHeader, CIfrStatementHeader): - - def __init__(self, ): - self.__Text =3D EFI_IFR_TEXT() - CIfrOpHeader.__init__(self, self.__Text.Header, EFI_IFR_TEXT_OP) - CIfrStatementHeader.__init__(self, self.__Text.Statement) - self.__Text.TextTwo =3D EFI_STRING_ID_INVALID - - def SetTextTwo(self, StringId): - self.__Text.TextTwo =3D StringId - - def GetInfo(self): - return self.__Text - - -class CIfrGuid(CIfrObj, CIfrOpHeader): - - def __init__(self, Size, Databuff=3DNone): - self.__Guid =3D EFI_IFR_GUID() - self.__Data =3D Databuff - CIfrOpHeader.__init__(self, self.__Guid.Header, EFI_IFR_GUID_OP, - ctypes.sizeof(EFI_IFR_GUID) + Size) - EFI_IFR_DEFAULT_GUID =3D EFI_GUID(0, 0, 0, - GuidArray(0, 0, 0, 0, 0, 0, 0, 0)) - self.__Guid.Guid =3D EFI_IFR_DEFAULT_GUID - - def SetGuid(self, Guid): - self.__Guid.Guid =3D Guid - - def SetData(self, Databuff): - self.__Data =3D Databuff - - def GetInfo(self): - return self.__Guid - - -class CIfrOrderedList(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self): - self.__OrderedList =3D EFI_IFR_ORDERED_LIST() - CIfrOpHeader.__init__(self, self.__OrderedList.Header, - EFI_IFR_ORDERED_LIST_OP) - CIfrQuestionHeader.__init__(self, self.__OrderedList.Question) - self.__OrderedList.MaxContainers =3D 0 - self.__OrderedList.Flags =3D 0 - - def GetQuestion(self): - return self - - def SetQHeaderFlags(self, Flags): - CIfrQuestionHeader.SetFlags(self, Flags) - - def SetMaxContainers(self, MaxContainers): - self.__OrderedList.MaxContainers =3D MaxContainers - - def SetFlags(self, HFlags, LFlags): - - ReturnCode =3D CIfrQuestionHeader.SetFlags(self, HFlags) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_UNIQUE_SET) - if Ret: - self.__OrderedList.Flags |=3D EFI_IFR_UNIQUE_SET - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_NO_EMPTY_SET) - if Ret: - self.__OrderedList.Flags |=3D EFI_IFR_NO_EMPTY_SET - - return VfrReturnCode.VFR_RETURN_SUCCESS if LFlags =3D=3D 0 else Vf= rReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - def GetInfo(self): - return self.__OrderedList - - -class CIfrString(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self): - self.__Str =3D EFI_IFR_STRING() - CIfrOpHeader.__init__(self, self.__Str.Header, EFI_IFR_STRING_OP) - CIfrQuestionHeader.__init__(self, self.__Str.Question) - self.__Str.Flags =3D 0 - self.__Str.MinSize =3D 0 - self.__Str.MaxSize =3D 0 - - def GetQuestion(self): - return self - - def SetQHeaderFlags(self, Flags): - CIfrQuestionHeader.SetFlags(self, Flags) - - def SetFlags(self, HFlags, LFlags): - - ReturnCode =3D CIfrQuestionHeader.SetFlags(self, HFlags) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_STRING_MULTI_= LINE) - if Ret: - self.__Str.Flags |=3D EFI_IFR_STRING_MULTI_LINE - - return VfrReturnCode.VFR_RETURN_SUCCESS if LFlags =3D=3D 0 else Vf= rReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - def SetMinSize(self, MinSize): - self.__Str.MinSize =3D MinSize - - def SetMaxSize(self, MaxSize): - self.__Str.MaxSize =3D MaxSize - - def GetInfo(self): - return self.__Str - - -class CIfrPassword(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self): - self.__Password =3D EFI_IFR_PASSWORD() - CIfrOpHeader.__init__(self, self.__Password.Header, - EFI_IFR_PASSWORD_OP) - CIfrQuestionHeader.__init__(self, self.__Password.Question) - self.__Password.MinSize =3D 0 - self.__Password.MaxSize =3D 0 - - def GetQuestion(self): - return self - - def SetQHeaderFlags(self, Flags): - CIfrQuestionHeader.SetFlags(self, Flags) - - def SetMinSize(self, MinSize): - self.__Password.MinSize =3D MinSize - - def SetMaxSize(self, MaxSize): - self.__Password.MaxSize =3D MaxSize - - def GetInfo(self): - return self.__Password - - -class CIfrDefault(CIfrObj, CIfrOpHeader): - - def __init__(self, - Size, - DefaultId=3DEFI_HII_DEFAULT_CLASS_STANDARD, - Type=3DEFI_IFR_TYPE_OTHER, - Value=3DEFI_IFR_TYPE_VALUE()): - self.__Default =3D EFI_IFR_DEFAULT() - CIfrOpHeader.__init__(self, self.__Default.Header, EFI_IFR_DEFAULT= _OP, - Size) - self.__Default.Type =3D Type - self.__Default.DefaultId =3D DefaultId - self.__Default.Value =3D Value - - def SetDefaultId(self, DefaultId): - self.__Default.DefaultId =3D DefaultId - - def SetType(self, Type): - self.__Default.Type =3D Type - - def SetValue(self, Value): - self.__Default.Value =3D Value - - def GetInfo(self): - return self.__Default - - -class CIfrDefault3(CIfrObj, CIfrOpHeader): - - def __init__(self, - Size, - Nums, - ValueType, - DefaultId=3DEFI_HII_DEFAULT_CLASS_STANDARD, - Type=3DEFI_IFR_TYPE_OTHER, - ValueList=3D[]): - Header =3D EFI_IFR_OP_HEADER() - CIfrOpHeader.__init__(self, Header, EFI_IFR_DEFAULT_OP, Size) - self.__Default =3D Refine_EFI_IFR_DEFAULT(Nums) - self.__Default.Header =3D Header - self.__Default.Type =3D Type - self.__Default.DefaultId =3D DefaultId - self.__ValueType =3D ValueType - - if ValueList !=3D []: - ArrayType =3D EFI_IFR_TYPE_VALUE * Nums - ValueArray =3D ArrayType() - for i in range(0, len(ValueList)): - ValueArray[i] =3D ValueList[i] - self.__Default.Value =3D ValueArray - - def SetDefaultId(self, DefaultId): - self.__Default.DefaultId =3D DefaultId - - def GetValueType(self): - return self.__ValueType - - def SetType(self, Type): - self.__Default.Type =3D Type - - def SetValue(self, ValueList): - ArrayType =3D EFI_IFR_TYPE_VALUE * (len(ValueList)) - ValueArray =3D ArrayType() - for i in range(0, len(ValueList)): - ValueArray[i] =3D ValueList[i] - self.__Default.Value =3D ValueArray - - def GetInfo(self): - return self.__Default - - -class CIfrDefault2(CIfrObj, CIfrOpHeader): - - def __init__(self, - DefaultId=3DEFI_HII_DEFAULT_CLASS_STANDARD, - Type=3DEFI_IFR_TYPE_OTHER): - self.__Default =3D EFI_IFR_DEFAULT_2() - CIfrOpHeader.__init__(self, self.__Default.Header, EFI_IFR_DEFAULT= _OP) - self.__Default.Type =3D Type - self.__Default.DefaultId =3D DefaultId - - def SetDefaultId(self, DefaultId): - self.__Default.DefaultId =3D DefaultId - - def SetType(self, Type): - self.__Default.Type =3D Type - - def GetInfo(self): - return self.__Default - - -class CIfrInconsistentIf(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__InconsistentIf =3D EFI_IFR_INCONSISTENT_IF() - CIfrOpHeader.__init__(self, self.__InconsistentIf.Header, - EFI_IFR_INCONSISTENT_IF_OP) - self.__InconsistentIf.Error =3D EFI_STRING_ID_INVALID - - def SetError(self, Error): - self.__InconsistentIf.Error =3D Error - - -class CIfrNoSubmitIf(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__NoSubmitIf =3D EFI_IFR_NO_SUBMIT_IF() - CIfrOpHeader.__init__(self, self.__NoSubmitIf.Header, - EFI_IFR_NO_SUBMIT_IF_OP) - self.__NoSubmitIf.Error =3D EFI_STRING_ID_INVALID - - def SetError(self, Error): - self.__NoSubmitIf.Error =3D Error - - -class CIfrDisableIf(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__DisableIf =3D EFI_IFR_DISABLE_IF() - CIfrOpHeader.__init__(self, self.__DisableIf.Header, - EFI_IFR_DISABLE_IF_OP) - - -class CIfrSuppressIf(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__SuppressIf =3D EFI_IFR_SUPPRESS_IF() - CIfrOpHeader.__init__(self, self.__SuppressIf.Header, - EFI_IFR_SUPPRESS_IF_OP) - - -class CIfrGrayOutIf(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__GrayOutIf =3D EFI_IFR_GRAY_OUT_IF() - CIfrOpHeader.__init__(self, self.__GrayOutIf.Header, - EFI_IFR_GRAY_OUT_IF_OP) - - -class CIfrValue(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__Value =3D EFI_IFR_VALUE() - CIfrOpHeader.__init__(self, self.__Value.Header, EFI_IFR_VALUE_OP) - - -class CIfrRead(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__Read =3D EFI_IFR_READ() - CIfrOpHeader.__init__(self, self.__Read.Header, EFI_IFR_READ_OP) - - -class CIfrWrite(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__Write =3D EFI_IFR_WRITE() - CIfrOpHeader.__init__(self, self.__Write.Header, EFI_IFR_WRITE_OP) - - -class CIfrWarningIf(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__WarningIf =3D EFI_IFR_WARNING_IF() - CIfrOpHeader.__init__(self, self.__WarningIf.Header, - EFI_IFR_WARNING_IF_OP) - self.__WarningIf.Warning =3D EFI_STRING_ID_INVALID - self.__WarningIf.TimeOut =3D 0 - - def SetWarning(self, Warning): - self.__WarningIf.Warning =3D Warning - - def SetTimeOut(self, TimeOut): - self.__WarningIf.TimeOut =3D TimeOut - - def GetInfo(self): - return self.__WarningIf - - -class CIfrRefresh(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__Refresh =3D EFI_IFR_REFRESH() - CIfrOpHeader.__init__(self, self.__Refresh.Header, EFI_IFR_REFRESH= _OP) - self.__Refresh.RefreshInterval =3D 0 - - def SetRefreshInterval(self, RefreshInterval): - self.__Refresh.RefreshInterval =3D RefreshInterval - - def GetInfo(self): - return self.__Refresh - - -class CIfrRefreshId(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__RefreshId =3D EFI_IFR_REFRESH_ID() - CIfrOpHeader.__init__(self, self.__RefreshId.Header, - EFI_IFR_REFRESH_ID_OP) - self.__RefreshId.RefreshEventGroupId =3D EFI_GUID( - 0, 0, 0, GuidArray(0, 0, 0, 0, 0, 0, 0, 0)) - - def SetRefreshEventGroutId(self, RefreshEventGroupId): - self.__RefreshId.RefreshEventGroupId =3D RefreshEventGroupId - - def GetInfo(self): - return self.__RefreshId - - -class CIfrVarStoreDevice(CIfrObj, CIfrOpHeader): - - def __init__(self): - self.__VarStoreDevice =3D EFI_IFR_VARSTORE_DEVICE() - CIfrOpHeader.__init__(self, self.__VarStoreDevice.Header, - EFI_IFR_VARSTORE_DEVICE_OP) - self.__VarStoreDevice.DevicePath =3D EFI_STRING_ID_INVALID - - def SetDevicePath(self, DevicePath): - self.__VarStoreDevice.DevicePath =3D DevicePath - - def GetInfo(self): - return self.__VarStoreDevice - - -class CIfrDate(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self): - self.__Date =3D EFI_IFR_DATE() - CIfrOpHeader.__init__(self, self.__Date.Header, EFI_IFR_DATE_OP) - CIfrQuestionHeader.__init__(self, self.__Date.Question) - self.__Date.Flags =3D 0 - - def SetFlags(self, HFlags, LFlags): - - ReturnCode =3D CIfrQuestionHeader.SetFlags(self, HFlags) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_QF_DATE_YEAR_SUPP= RESS) - if Ret: - self.__Date.Flags |=3D EFI_QF_DATE_YEAR_SUPPRESS - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_QF_DATE_MONTH_SUP= PRESS) - if Ret: - self.__Date.Flags |=3D EFI_QF_DATE_MONTH_SUPPRESS - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_QF_DATE_DAY_SUPPR= ESS) - if Ret: - self.__Date.Flags |=3D EFI_QF_DATE_DAY_SUPPRESS - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_DATE_STORAGE_NORMA= L) - if Ret: - self.__Date.Flags |=3D QF_DATE_STORAGE_NORMAL - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_DATE_STORAGE_TIME) - if Ret: - self.__Date.Flags |=3D QF_DATE_STORAGE_TIME - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_DATE_STORAGE_WAKEU= P) - if Ret: - self.__Date.Flags |=3D QF_DATE_STORAGE_WAKEUP - - return VfrReturnCode.VFR_RETURN_SUCCESS if LFlags =3D=3D 0 else Vf= rReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - def GetInfo(self): - return self.__Date - - -class CIfrTime(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self): - self.__Time =3D EFI_IFR_TIME() - CIfrOpHeader.__init__(self, self.__Time.Header, EFI_IFR_TIME_OP) - CIfrQuestionHeader.__init__(self, self.__Time.Question) - self.__Time.Flags =3D 0 - - def SetFlags(self, HFlags, LFlags): - - ReturnCode =3D CIfrQuestionHeader.SetFlags(self, HFlags) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_HOUR_SUPPRESS= ) - if Ret: - self.__Time.Flags |=3D QF_TIME_HOUR_SUPPRESS - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_MINUTE_SUPPRE= SS) - if Ret: - self.__Time.Flags |=3D QF_TIME_MINUTE_SUPPRESS - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_SECOND_SUPPRE= SS) - if Ret: - self.__Time.Flags |=3D QF_TIME_SECOND_SUPPRESS - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_STORAGE_NORMA= L) - if Ret: - self.__Time.Flags |=3D QF_TIME_STORAGE_NORMAL - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_STORAGE_TIME) - if Ret: - self.__Time.Flags |=3D QF_TIME_STORAGE_TIME - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, QF_TIME_STORAGE_WAKEU= P) - if Ret: - self.__Time.Flags |=3D QF_TIME_STORAGE_WAKEUP - - return VfrReturnCode.VFR_RETURN_SUCCESS if LFlags =3D=3D 0 else Vf= rReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - def GetInfo(self): - return self.__Time - - -class CIfrNumeric(CIfrObj, CIfrOpHeader, CIfrQuestionHeader, - CIfrMinMaxStepData): - - def __init__(self): - self.__Numeric =3D EFI_IFR_NUMERIC() # data - CIfrOpHeader.__init__(self, self.__Numeric.Header, EFI_IFR_NUMERIC= _OP) - CIfrQuestionHeader.__init__(self, self.__Numeric.Question) - CIfrMinMaxStepData.__init__(self, self.__Numeric.Data, True) - self.__Numeric.Flags =3D EFI_IFR_NUMERIC_SIZE_1 | EFI_IFR_DISPLAY_= UINT_DEC - - def GetQuestion(self): - return self - - def GetMinMaxData(self): - return self - - def SetQHeaderFlags(self, Flags): - CIfrQuestionHeader.SetFlags(self, Flags) - - def SetFlags(self, HFlags, LFlags, DisplaySettingsSpecified=3DFalse): - ReturnCode =3D CIfrQuestionHeader.SetFlags(self, HFlags) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - if DisplaySettingsSpecified =3D=3D False: - self.__Numeric.Flags =3D LFlags | EFI_IFR_DISPLAY_UINT_DEC - else: - self.__Numeric.Flags =3D LFlags - return VfrReturnCode.VFR_RETURN_SUCCESS - - def SetFlagsForBitField(self, - HFlags, - LFlags, - DisplaySettingsSpecified=3DFalse): - ReturnCode =3D CIfrQuestionHeader.SetFlags(self, HFlags) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - if DisplaySettingsSpecified =3D=3D False: - self.__Numeric.Flags =3D LFlags | EDKII_IFR_DISPLAY_UINT_DEC_B= IT - else: - self.__Numeric.Flags =3D LFlags - return VfrReturnCode.VFR_RETURN_SUCCESS - - def GetNumericFlags(self): - return self.__Numeric.Flags - - def ShrinkBinSize(self, Size): - self.ShrinkBinSize(Size) - self.DecLength(Size) - # _EMIT_PENDING_OBJ(); - Numeric =3D EFI_IFR_NUMERIC() - self.UpdateHeader(Numeric.Header) - - def GetInfo(self): - return self.__Numeric - - -class CIfrOneOf( - CIfrQuestionHeader, - CIfrObj, - CIfrOpHeader, -): - - def __init__(self): - self.__OneOf =3D EFI_IFR_ONE_OF() - CIfrOpHeader.__init__(self, self.__OneOf.Header, EFI_IFR_ONE_OF_OP= ) - CIfrQuestionHeader.__init__(self, self.__OneOf.Question) - self.__OneOf.Flags =3D 0 - - def GetQuestion(self): - return self - - def GetMinMaxData(self): - return self - - def SetQHeaderFlags(self, Flags): - CIfrQuestionHeader.SetFlags(self, Flags) - - def SetFlags(self, HFlags, LFlags): - ReturnCode =3D CIfrQuestionHeader.SetFlags(self, HFlags) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - if LFlags & EFI_IFR_DISPLAY: - self.__OneOf.Flags =3D LFlags - else: - self.__OneOf.Flags =3D LFlags | EFI_IFR_DISPLAY_UINT_DEC - return VfrReturnCode.VFR_RETURN_SUCCESS - - def SetFlagsForBitField(self, HFlags, LFlags): - ReturnCode =3D CIfrQuestionHeader.SetFlags(self, HFlags) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - if LFlags & EDKII_IFR_DISPLAY_BIT: - self.__OneOf.Flags =3D LFlags - else: - self.__OneOf.Flags =3D LFlags | EDKII_IFR_DISPLAY_UINT_DEC_BIT - return VfrReturnCode.VFR_RETURN_SUCCESS - - def GetInfo(self): - return self.__OneOf - - -class CIfrCheckBox(CIfrObj, CIfrOpHeader, CIfrQuestionHeader): - - def __init__(self): - self.__CheckBox =3D EFI_IFR_CHECKBOX() - CIfrOpHeader.__init__(self, self.__CheckBox.Header, - EFI_IFR_CHECKBOX_OP) - CIfrQuestionHeader.__init__(self, self.__CheckBox.Question) - self.__CheckBox.Flags =3D 0 - - def GetQuestion(self): - return self - - def SetQHeaderFlags(self, Flags): - CIfrQuestionHeader.SetFlags(self, Flags) - - def GetFlags(self): - return self.__CheckBox.Flags - - def SetFlags(self, HFlags, LFlags): - - ReturnCode =3D CIfrQuestionHeader.SetFlags(self, HFlags) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, EFI_IFR_CHECKBOX_DEFA= ULT) - if Ret: - self.__CheckBox.Flags |=3D EFI_IFR_CHECKBOX_DEFAULT - - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR(LFlags, - EFI_IFR_CHECKBOX_DEFAULT_MFG) - - if Ret: - self.__CheckBox.Flags |=3D EFI_IFR_CHECKBOX_DEFAULT_MFG - - return VfrReturnCode.VFR_RETURN_SUCCESS if LFlags =3D=3D 0 else Vf= rReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - def GetInfo(self): - return self.__CheckBox - - -class CIfrResetButton(CIfrObj, CIfrOpHeader, CIfrStatementHeader): - - def __init__(self): - self.__ResetButton =3D EFI_IFR_RESET_BUTTON() - CIfrOpHeader.__init__(self, self.__ResetButton.Header, - EFI_IFR_RESET_BUTTON_OP) - CIfrStatementHeader.__init__(self, self.__ResetButton.Statement) - self.__ResetButton.DefaultId =3D EFI_HII_DEFAULT_CLASS_STANDARD - - def SetDefaultId(self, DefaultId): - self.__ResetButton.DefaultId =3D DefaultId - - def GetInfo(self): - return self.__ResetButton - - -class CIfrOr(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Or =3D EFI_IFR_OR() - CIfrOpHeader.__init__(self, self.__Or.Header, EFI_IFR_OR_OP) - self.SetLineNo(LineNo) - - -class CIfrAnd(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__And =3D EFI_IFR_AND() - CIfrOpHeader.__init__(self, self.__And.Header, EFI_IFR_AND_OP) - self.SetLineNo(LineNo) - - -class CIfrBitWiseOr(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__BitWiseOr =3D EFI_IFR_BITWISE_OR() - CIfrOpHeader.__init__(self, self.__BitWiseOr.Header, - EFI_IFR_BITWISE_OR_OP) - self.SetLineNo(LineNo) - - -class CIfrCatenate(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Catenate =3D EFI_IFR_CATENATE() - CIfrOpHeader.__init__(self, self.__Catenate.Header, - EFI_IFR_CATENATE_OP) - self.SetLineNo(LineNo) - - -class CIfrDivide(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Divide =3D EFI_IFR_DIVIDE() - CIfrOpHeader.__init__(self, self.__Divide.Header, EFI_IFR_DIVIDE_O= P) - self.SetLineNo(LineNo) - - -class CIfrEqual(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Equal =3D EFI_IFR_EQUAL() - CIfrOpHeader.__init__(self, self.__Equal.Header, EFI_IFR_EQUAL_OP) - self.SetLineNo(LineNo) - - -class CIfrGreaterEqual(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__GreaterEqual =3D EFI_IFR_GREATER_EQUAL() - CIfrOpHeader.__init__(self, self.__GreaterEqual.Header, - EFI_IFR_GREATER_EQUAL_OP) - self.SetLineNo(LineNo) - - -class CIfrGreaterThan(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__GreaterThan =3D EFI_IFR_GREATER_THAN() - CIfrOpHeader.__init__(self, self.__GreaterThan.Header, - EFI_IFR_GREATER_THAN_OP) - self.SetLineNo(LineNo) - - -class CIfrLessEqual(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__LessEqual =3D EFI_IFR_LESS_EQUAL() - CIfrOpHeader.__init__(self, self.__LessEqual.Header, - EFI_IFR_LESS_EQUAL_OP) - self.SetLineNo(LineNo) - - -class CIfrLessThan(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__LessThan =3D EFI_IFR_LESS_THAN() - CIfrOpHeader.__init__(self, self.__LessThan.Header, - EFI_IFR_LESS_THAN_OP) - self.SetLineNo(LineNo) - - -class CIfrMap(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Map =3D EFI_IFR_MAP() - CIfrOpHeader.__init__(self, self.__Map.Header, EFI_IFR_MAP_OP) - self.SetLineNo(LineNo) - - -class CIfrMatch(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Match =3D EFI_IFR_MATCH() - CIfrOpHeader.__init__(self, self.__Match.Header, EFI_IFR_MATCH_OP) - self.SetLineNo(LineNo) - - -class CIfrMatch2(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo, Guid): - self.__Match2 =3D EFI_IFR_MATCH2() - CIfrOpHeader.__init__(self, self.__Match2.Header, EFI_IFR_MATCH2_O= P) - self.SetLineNo(LineNo) - self.__Match2.SyntaxType =3D Guid - - -class CIfrMultiply(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Multiply =3D EFI_IFR_MULTIPLY() - CIfrOpHeader.__init__(self, self.__Multiply.Header, - EFI_IFR_MULTIPLY_OP) - self.SetLineNo(LineNo) - - -class CIfrModulo(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Modulo =3D EFI_IFR_MODULO() - CIfrOpHeader.__init__(self, self.__Modulo.Header, EFI_IFR_MODULO_O= P) - self.SetLineNo(LineNo) - - -class CIfrNotEqual(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__NotEqual =3D EFI_IFR_NOT_EQUAL() - CIfrOpHeader.__init__(self, self.__NotEqual.Header, - EFI_IFR_NOT_EQUAL_OP) - self.SetLineNo(LineNo) - - -class CIfrShiftLeft(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__ShiftLeft =3D EFI_IFR_SHIFT_LEFT() - CIfrOpHeader.__init__(self, self.__ShiftLeft.Header, - EFI_IFR_SHIFT_LEFT_OP) - self.SetLineNo(LineNo) - - -class CIfrShiftRight(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__ShiftRight =3D EFI_IFR_SHIFT_RIGHT() - CIfrOpHeader.__init__(self, self.__ShiftRight.Header, - EFI_IFR_SHIFT_RIGHT_OP) - self.SetLineNo(LineNo) - - -class CIfrSubtract(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Subtract =3D EFI_IFR_SUBTRACT() - CIfrOpHeader.__init__(self, self.__Subtract.Header, - EFI_IFR_SUBTRACT_OP) - self.SetLineNo(LineNo) - - -class CIfrConditional(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Conditional =3D EFI_IFR_CONDITIONAL() - CIfrOpHeader.__init__(self, self.__Conditional.Header, - EFI_IFR_CONDITIONAL_OP) - self.SetLineNo(LineNo) - - -class CIfrFind(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Find =3D EFI_IFR_FIND() - CIfrOpHeader.__init__(self, self.__Find.Header, EFI_IFR_FIND_OP) - self.SetLineNo(LineNo) - - def SetFormat(self, Format): - self.__Find.Format =3D Format - - -class CIfrMid(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Mid =3D EFI_IFR_MID() - CIfrOpHeader.__init__(self, self.__Mid.Header, EFI_IFR_MID_OP) - self.SetLineNo(LineNo) - - -class CIfrToken(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Token =3D EFI_IFR_TOKEN() - CIfrOpHeader.__init__(self, self.__Token.Header, EFI_IFR_TOKEN_OP) - self.SetLineNo(LineNo) - - -class CIfrSpan(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Span =3D EFI_IFR_SPAN() - CIfrOpHeader.__init__(self, self.__Span.Header, EFI_IFR_SPAN_OP) - self.SetLineNo(LineNo) - self.__Span.Flags =3D EFI_IFR_FLAGS_FIRST_MATCHING - - def SetFlags(self, LFlags): - if LFlags =3D=3D EFI_IFR_FLAGS_FIRST_MATCHING: - self.__Span.Flags |=3D EFI_IFR_FLAGS_FIRST_MATCHING - else: - LFlags, Ret =3D _FLAG_TEST_AND_CLEAR( - LFlags, EFI_IFR_FLAGS_FIRST_NON_MATCHING) - if Ret: - self.__Span.Flags |=3D EFI_IFR_FLAGS_FIRST_NON_MATCHING - - return VfrReturnCode.VFR_RETURN_SUCCESS if LFlags =3D=3D 0 else Vf= rReturnCode.VFR_RETURN_FLAGS_UNSUPPORTED - - -class CIfrBitWiseAnd(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__BitWiseAnd =3D EFI_IFR_BITWISE_AND() - CIfrOpHeader.__init__(self, self.__BitWiseAnd.Header, - EFI_IFR_BITWISE_AND_OP) - self.SetLineNo(LineNo) - - -class CIfrBitWiseOr(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__BitWiseOr =3D EFI_IFR_BITWISE_OR() - CIfrOpHeader.__init__(self, self.__BitWiseOr.Header, - EFI_IFR_BITWISE_OR_OP) - self.SetLineNo(LineNo) - - -class CIfrAdd(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Add =3D EFI_IFR_ADD() - CIfrOpHeader.__init__(self, self.__Add.Header, EFI_IFR_ADD_OP) - self.SetLineNo(LineNo) - - -class CIfrToString(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__ToString =3D EFI_IFR_TO_STRING() - CIfrOpHeader.__init__(self, self.__ToString.Header, - EFI_IFR_TO_STRING_OP) - self.SetLineNo(LineNo) - - def SetFormat(self, Format): - self.__ToString.Format =3D Format - - -class CIfrToUpper(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__ToUppper =3D EFI_IFR_TO_UPPER() - CIfrOpHeader.__init__(self, self.__ToUppper.Header, - EFI_IFR_TO_UPPER_OP) - self.SetLineNo(LineNo) - - -class CIfrToUint(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__ToUint =3D EFI_IFR_TO_UINT() - CIfrOpHeader.__init__(self, self.__ToUint.Header, EFI_IFR_TO_UINT_= OP) - self.SetLineNo(LineNo) - - -class CIfrToLower(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__ToLower =3D EFI_IFR_TO_LOWER() - CIfrOpHeader.__init__(self, self.__ToLower.Header, EFI_IFR_TO_LOWE= R_OP) - self.SetLineNo(LineNo) - - -class CIfrToBoolean(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Boolean =3D EFI_IFR_TO_BOOLEAN() - CIfrOpHeader.__init__(self, self.__Boolean.Header, - EFI_IFR_TO_BOOLEAN_OP) - self.SetLineNo(LineNo) - - -class CIfrNot(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Not =3D EFI_IFR_NOT() - CIfrOpHeader.__init__(self, self.__Not.Header, EFI_IFR_NOT_OP) - self.SetLineNo(LineNo) - - -class CIfrDup(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Dup =3D EFI_IFR_DUP() - CIfrOpHeader.__init__(self, self.__Dup.Header, EFI_IFR_DUP_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__Dup.Header - - -class CIfrEqIdId(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__EqIdId =3D EFI_IFR_EQ_ID_ID() - CIfrOpHeader.__init__(self, self.__EqIdId.Header, EFI_IFR_EQ_ID_ID= _OP) - self.SetLineNo(LineNo) - self.__EqIdId.QuestionId1 =3D EFI_QUESTION_ID_INVALID - self.__EqIdId.QuestionId2 =3D EFI_QUESTION_ID_INVALID - - def GetHeader(self): - return self.__EqIdId.Header - - def SetQuestionId1(self, QuestionId, VarIdStr, LineNo): - if QuestionId !=3D EFI_QUESTION_ID_INVALID: - self.__EqIdId.QuestionId1 =3D QuestionId - else: - pass - - def SetQuestionId2(self, QuestionId, VarIdStr, LineNo): - if QuestionId !=3D EFI_QUESTION_ID_INVALID: - self.__EqIdId.QuestionId2 =3D QuestionId - else: - pass - - -class CIfrEqIdVal(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__EqIdVal =3D EFI_IFR_EQ_ID_VAL() - CIfrOpHeader.__init__(self, self.__EqIdVal.Header, - EFI_IFR_EQ_ID_VAL_OP) - self.SetLineNo(LineNo) - self.__EqIdVal.QuestionId =3D EFI_QUESTION_ID_INVALID - - def SetQuestionId(self, QuestionId, VarIdStr, LineNo): - if QuestionId !=3D EFI_QUESTION_ID_INVALID: - self.__EqIdVal.QuestionId =3D QuestionId - else: - pass - - def SetValue(self, Value): - self.__EqIdVal.Value =3D Value - - def GetHeader(self): - return self.__EqIdVal.Header - - -class CIfrEqIdList(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo, Nums, ValueList=3D[]): - self.__EqIdVList =3D Refine_EFI_IFR_EQ_ID_VAL_LIST(Nums) - Header =3D EFI_IFR_OP_HEADER() - CIfrOpHeader.__init__(self, Header, EFI_IFR_EQ_ID_VAL_OP) - self.SetLineNo(LineNo) - self.__EqIdVList.Header =3D Header - self.__EqIdVList.QuestionId =3D EFI_QUESTION_ID_INVALID - self.__EqIdVList.ListLength =3D 0 - if ValueList !=3D []: - ArrayType =3D c_uint16 * Nums - ValueArray =3D ArrayType() - for i in range(0, len(ValueList)): - ValueArray[i] =3D ValueList[i] - self.__EqIdVList.ValueList =3D ValueArray - - def SetQuestionId(self, QuestionId, VarIdStr, LineNo): - if QuestionId !=3D EFI_QUESTION_ID_INVALID: - self.__EqIdVList.QuestionId =3D QuestionId - else: - pass - - def SetListLength(self, ListLength): - self.__EqIdVList.ListLength =3D ListLength - - def SetValueList(self, ValueList): - if ValueList !=3D []: - ArrayType =3D c_uint16 * len(ValueList) - ValueArray =3D ArrayType() - for i in range(0, len(ValueList)): - ValueArray[i] =3D ValueList[i] - self.__EqIdVList.ValueList =3D ValueArray - - def GetHeader(self): - return self.__EqIdVList.Header - - -class CIfrUint8(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Uint8 =3D EFI_IFR_UINT8() - CIfrOpHeader.__init__(self, self.__Uint8.Header, EFI_IFR_UINT8_OP) - self.SetLineNo(LineNo) - - def SetValue(self, Value): - self.__Uint8.Value =3D Value - - def GetHeader(self): - return self.__Uint8.Header - - -class CIfrUint16(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Uint16 =3D EFI_IFR_UINT16() - CIfrOpHeader.__init__(self, self.__Uint16.Header, EFI_IFR_UINT16_O= P) - self.SetLineNo(LineNo) - - def SetValue(self, Value): - self.__Uint16.Value =3D Value - - def GetHeader(self): - return self.__Uint16.Header - - -class CIfrUint32(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Uint32 =3D EFI_IFR_UINT32() - CIfrOpHeader.__init__(self, self.__Uint32.Header, EFI_IFR_UINT32_O= P) - self.SetLineNo(LineNo) - - def SetValue(self, Value): - self.__Uint32.Value =3D Value - - def GetHeader(self): - return self.__Uint32.Header - - -class CIfrUint64(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Uint64 =3D EFI_IFR_UINT64() - CIfrOpHeader.__init__(self, self.__Uint64.Header, EFI_IFR_UINT64_O= P) - self.SetLineNo(LineNo) - - def SetValue(self, Value): - self.__Uint64.Value =3D Value - - def GetHeader(self): - return self.__Uint64.Header - - -class CIfrQuestionRef1(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__QuestionRef1 =3D EFI_IFR_QUESTION_REF1() - CIfrOpHeader.__init__(self, self.__QuestionRef1.Header, - EFI_IFR_QUESTION_REF1_OP) - self.SetLineNo(LineNo) - self.__QuestionRef1.QuestionId =3D EFI_QUESTION_ID_INVALID - - def GetHeader(self): - return self.__QuestionRef1.Header - - def SetQuestionId(self, QuestionId, VarIdStr, LineNo): - if QuestionId !=3D EFI_QUESTION_ID_INVALID: - self.__QuestionRef1.QuestionId =3D QuestionId - else: - pass - - -class CIfrQuestionRef2(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__QuestionRef2 =3D EFI_IFR_QUESTION_REF2() - CIfrOpHeader.__init__(self, self.__QuestionRef2.Header, - EFI_IFR_QUESTION_REF2_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__QuestionRef2.Header - - -class CIfrQuestionRef3(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__QuestionRef3 =3D EFI_IFR_QUESTION_REF3() - CIfrOpHeader.__init__(self, self.__QuestionRef3.Header, - EFI_IFR_QUESTION_REF3_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__QuestionRef3.Header - - -class CIfrQuestionRef3_2(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__QuestionRef3_2 =3D EFI_IFR_QUESTION_REF3_2() - CIfrOpHeader.__init__(self, self.__QuestionRef3_2.Header, - EFI_IFR_QUESTION_REF3_OP) - self.SetLineNo(LineNo) - self.__QuestionRef3_2.DevicePath =3D EFI_STRING_ID_INVALID - - def SetDevicePath(self, DevicePath): - self.__QuestionRef3_2.DevicePath =3D DevicePath - - def GetHeader(self): - return self.__QuestionRef3_2.Header - - -class CIfrQuestionRef3_3(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__QuestionRef3_3 =3D EFI_IFR_QUESTION_REF3_3() - CIfrOpHeader.__init__(self, self.__QuestionRef3_3.Header, - EFI_IFR_QUESTION_REF3_OP) - self.SetLineNo(LineNo) - self.__QuestionRef3_3.DevicePath =3D EFI_STRING_ID_INVALID - self.__QuestionRef3_3.Guid =3D EFI_GUID( - 0, 0, 0, GuidArray(0, 0, 0, 0, 0, 0, 0, 0)) - - def SetDevicePath(self, DevicePath): - self.__QuestionRef3_3.DevicePath =3D DevicePath - - def SetGuid(self, Guid): - self.__QuestionRef3_3.Guid =3D Guid - - def GetHeader(self): - return self.__QuestionRef3_3.Header - - -class CIfrRuleRef(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__RuleRef =3D EFI_IFR_RULE_REF() - CIfrOpHeader.__init__(self, self.__RuleRef.Header, EFI_IFR_RULE_RE= F_OP) - self.SetLineNo(LineNo) - self.__RuleRef.RuleId =3D EFI_RULE_ID_INVALID - - def SetRuleId(self, RuleId): - self.__RuleRef.RuleId =3D RuleId - - def GetHeader(self): - return self.__RuleRef.Header - - -class CIfrStringRef1(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__StringRef1 =3D EFI_IFR_STRING_REF1() - CIfrOpHeader.__init__(self, self.__StringRef1.Header, - EFI_IFR_STRING_REF1_OP) - self.SetLineNo(LineNo) - self.__StringRef1.StringId =3D EFI_STRING_ID_INVALID - - def SetStringId(self, StringId): - self.__StringRef1.StringId =3D StringId - - def GetHeader(self): - return self.__StringRef1.Header - - -class CIfrStringRef2(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__StringRef2 =3D EFI_IFR_STRING_REF2() - CIfrOpHeader.__init__(self, self.__StringRef2.Header, - EFI_IFR_STRING_REF2_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__StringRef2.Header - - -class CIfrThis(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__This =3D EFI_IFR_THIS() - CIfrOpHeader.__init__(self, self.__This.Header, EFI_IFR_THIS_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__This.Header - - -class CIfrSecurity(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Security =3D EFI_IFR_SECURITY() - CIfrOpHeader.__init__(self, self.__Security.Header, - EFI_IFR_SECURITY_OP) - self.SetLineNo(LineNo) - self.__Security.Permissions =3D EFI_GUID( - 0, 0, 0, GuidArray(0, 0, 0, 0, 0, 0, 0, 0)) - - def SetPermissions(self, Permissions): - self.__Security.Permissions =3D Permissions - - def GetHeader(self): - return self.__Security.Header - - -class CIfrGet(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Get =3D EFI_IFR_GET() - CIfrOpHeader.__init__(self, self.__Get.Header, EFI_IFR_GET_OP) - self.SetLineNo(LineNo) - - def SetVarInfo(self, BaseInfo: EFI_VARSTORE_INFO): - self.__Get.VarStoreId =3D BaseInfo.VarStoreId - self.__Get.VarStoreInfo.VarName =3D BaseInfo.Info.VarName - self.__Get.VarStoreInfo.VarOffset =3D BaseInfo.Info.VarOffset - self.__Get.VarStoreType =3D BaseInfo.VarType - - def GetHeader(self): - return self.__Get.Header - - -class CIfrSet(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Set =3D EFI_IFR_SET() - CIfrOpHeader.__init__(self, self.__Set.Header, EFI_IFR_SET_OP) - self.SetLineNo(LineNo) - - def SetVarInfo(self, BaseInfo: EFI_VARSTORE_INFO): - self.__Set.VarStoreId =3D BaseInfo.VarStoreId - self.__Set.VarStoreInfo.VarName =3D BaseInfo.Info.VarName - self.__Set.VarStoreInfo.VarOffset =3D BaseInfo.Info.VarOffset - self.__Set.VarStoreType =3D BaseInfo.VarType - - def GetHeader(self): - return self.__Set.Header - - -class CIfrTrue(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__True =3D EFI_IFR_TRUE() - CIfrOpHeader.__init__(self, self.__True.Header, EFI_IFR_TRUE_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__True.Header - - -class CIfrFalse(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__False =3D EFI_IFR_TRUE() - CIfrOpHeader.__init__(self, self.__False.Header, EFI_IFR_FALSE_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__False.Header - - -class CIfrOne(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__One =3D EFI_IFR_ONE() - CIfrOpHeader.__init__(self, self.__One.Header, EFI_IFR_ONE_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__One.Header - - -class CIfrOnes(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Ones =3D EFI_IFR_ONE() - CIfrOpHeader.__init__(self, self.__Ones.Header, EFI_IFR_ONES_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__Ones.Header - - -class CIfrZero(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Zero =3D EFI_IFR_ZERO() - CIfrOpHeader.__init__(self, self.__Zero.Header, EFI_IFR_ZERO_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__Zero.Header - - -class CIfrUndefined(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Undefined =3D EFI_IFR_ZERO() - CIfrOpHeader.__init__(self, self.__Undefined.Header, - EFI_IFR_UNDEFINED_OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__Undefined.Header - - -class CIfrVersion(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Version =3D EFI_IFR_VERSION() - CIfrOpHeader.__init__(self, self.__Version.Header, EFI_IFR_VERSION= _OP) - self.SetLineNo(LineNo) - - def GetHeader(self): - return self.__Version.Header - - -class CIfrLength(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__Length =3D EFI_IFR_LENGTH() - CIfrOpHeader.__init__(self, self.__Length.Header, EFI_IFR_LENGTH_O= P) - self.SetLineNo(LineNo) - - -class CIfrBitWiseNot(CIfrObj, CIfrOpHeader): - - def __init__(self, LineNo): - self.__BitWiseNot =3D EFI_IFR_BITWISE_NOT() - CIfrOpHeader.__init__(self, self.__BitWiseNot.Header, - EFI_IFR_BITWISE_NOT_OP) - self.SetLineNo(LineNo) - - -class ExpressionInfo(): - - def __init__(self): - self.RootLevel =3D 0 - self.ExpOpCount =3D 0 \ No newline at end of file diff --git a/BaseTools/Source/Python/VfrCompiler/VfrSyntax.g4 b/BaseTools/S= ource/Python/VfrCompiler/VfrSyntax.g4 index 39de106a52..21aa81d195 100644 --- a/BaseTools/Source/Python/VfrCompiler/VfrSyntax.g4 +++ b/BaseTools/Source/Python/VfrCompiler/VfrSyntax.g4 @@ -1,17 +1,25 @@ +//// @file +// vfr syntax +// +// Copyright (c) 2022-, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: BSD-2-Clause-Patent +//// grammar VfrSyntax; options { language=3DPython; } @header{ =20 -from VfrCompiler.CommonCtypes import * -from VfrCompiler.VfrFormPkg import * -from VfrCompiler.VfrUtility import * -from VfrCompiler.VfrTree import * +from VfrCompiler.IfrCtypes import * +from VfrCompiler.IfrFormPkg import * +from VfrCompiler.IfrUtility import * +from VfrCompiler.IfrTree import * +from VfrCompiler.IfrError import * +from VfrCompiler.IfrPreProcess import * } =20 vfrProgram - : (vfrPragmaPackDefinition | vfrDataStructDefinition | vfrDataUnionD= efinition)* vfrFormSetDefinition + : (vfrPragmaPackDefinition | vfrDataStructDefinition | vfrDataUnionD= efinition)* vfrFormSetDefinition? ; =20 pragmaPackShowDef @@ -115,9 +123,9 @@ dataStructBitField8[FieldInUnion] : D=3D'UINT8' N=3DStringIdentifier? ':' Number ';' ; =20 -// 2.4 VFR FormSet Definition +// VFR FormSet Definition vfrFormSetDefinition -locals[Node=3DVfrTreeNode(EFI_IFR_FORM_SET_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_FORM_SET_OP)] : 'formset' 'guid' '=3D' guidDefinition ',' 'title' '=3D' 'STRING_TOKEN' '(' Number ')' ',' @@ -135,7 +143,7 @@ locals[GuidList=3D[]] ; =20 classDefinition -locals[Node=3DVfrTreeNode(EFI_IFR_GUID_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_GUID_OP)] : validClassNames ('|' validClassNames)* ; =20 @@ -152,7 +160,7 @@ locals[ClassName=3D0] ; =20 subclassDefinition -locals[Node=3DVfrTreeNode(EFI_IFR_GUID_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_GUID_OP)] : SubclassSetupApplication | SubclassGeneralApplication | SubclassFrontPage @@ -185,7 +193,7 @@ locals[Node=3DNone] =20 //2.6 VFR Default Stores Definition vfrStatementDefaultStore -locals[Node=3DVfrTreeNode(EFI_IFR_DEFAULTSTORE_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_DEFAULTSTORE_OP)] : 'defaultstore' N=3DStringIdentifier ',' 'prompt' '=3D' 'STRING_TOKEN' '(' S=3DNumber ')' (',' 'attribute' '=3D' A=3DNumber)? ';' @@ -193,7 +201,7 @@ locals[Node=3DVfrTreeNode(EFI_IFR_DEFAULTSTORE_OP)] =20 //2.7 VFR Variable Store Definition vfrStatementVarStoreLinear -locals[Node=3DVfrTreeNode(EFI_IFR_VARSTORE_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_VARSTORE_OP)] : 'varstore' ( TN=3DStringIdentifier ',' | 'UINT8' ',' @@ -210,7 +218,7 @@ locals[Node=3DVfrTreeNode(EFI_IFR_VARSTORE_OP)] ; =20 vfrStatementVarStoreEfi -locals[Node=3DVfrTreeNode(EFI_IFR_VARSTORE_EFI_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_VARSTORE_EFI_OP)] : 'efivarstore' ( TN=3DStringIdentifier ',' | 'UINT8' ',' @@ -234,7 +242,7 @@ locals[Attr=3D0] : Number; =20 vfrStatementVarStoreNameValue -locals[Node=3DVfrTreeNode(EFI_IFR_VARSTORE_NAME_VALUE_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_VARSTORE_NAME_VALUE_OP)] : 'namevaluevarstore' SN=3DStringIdentifier ',' ('varid' '=3D' ID=3DNumber ',')? ('name' '=3D' 'STRING_TOKEN' '(' Number ')' ',')+ @@ -242,15 +250,15 @@ locals[Node=3DVfrTreeNode(EFI_IFR_VARSTORE_NAME_VALUE= _OP)] ; =20 vfrStatementDisableIfFormSet -locals[Node=3DVfrTreeNode(EFI_IFR_DISABLE_IF_OP)] - : 'disableif' vfrStatementExpression ';' +locals[Node=3DIfrTreeNode(EFI_IFR_DISABLE_IF_OP)] + : 'disableif' vfrStatementExpression[localctx.Node] ';' vfrFormSetList[localctx.Node] 'endif' ';' ; =20 vfrStatementSuppressIfFormSet -locals[Node=3DVfrTreeNode(EFI_IFR_SUPPRESS_IF_OP)] - : 'suppressif' vfrStatementExpression ';' +locals[Node=3DIfrTreeNode(EFI_IFR_SUPPRESS_IF_OP)] + : 'suppressif' vfrStatementExpression[localctx.Node] ';' vfrFormSetList[localctx.Node] 'endif' ';' ; @@ -261,7 +269,7 @@ guidSubDefinition[Guid] ; =20 guidDefinition -locals[Node=3DVfrTreeNode(), Guid=3DEFI_GUID()] +locals[Node=3DIfrTreeNode(), Guid=3DEFI_GUID()] : '{' Number ',' Number ',' Number ',' ( '{' guidSubDefinition[localctx.Guid] '}' @@ -275,19 +283,19 @@ locals[StringId=3D''] : 'STRING_TOKEN' '(' Number ')' ; =20 -vfrQuestionHeader[OpObj, QType] - : vfrQuestionBaseInfo[OpObj, QType] - vfrStatementHeader[OpObj] +vfrQuestionHeader[Node, QType] + : vfrQuestionBaseInfo[Node, QType] + vfrStatementHeader[Node] ; =20 -vfrQuestionBaseInfo[OpObj, QType] -locals[BaseInfo=3DEFI_VARSTORE_INFO(), QId=3DEFI_QUESTION_ID_INVALID, Chec= kFlag=3DTrue] +vfrQuestionBaseInfo[Node, QType] +locals[BaseInfo=3DEFI_VARSTORE_INFO(), QId=3DEFI_QUESTION_ID_INVALID, Chec= kFlag=3DTrue, QName=3DNone, VarIdStr=3D''] : ('name' '=3D' QN=3DStringIdentifier ',')? ('varid' '=3D' vfrStorageVarId[localctx.BaseInfo, localctx.CheckFl= ag] ',')? ('questionid' '=3D' ID=3DNumber ',')? ; =20 -vfrStatementHeader[OpObj] +vfrStatementHeader[Node] : 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' 'help' '=3D' 'STRING_TOKEN' '(' Number ')' ; @@ -311,7 +319,7 @@ locals[VarIdStr=3D''] ; =20 vfrConstantValueField -locals[Value=3DEFI_IFR_TYPE_VALUE(), ValueList=3D[], ListType=3DFalse] +locals[ValueList=3D[], ListType=3DFalse] : ('-')? Number | 'TRUE' | 'FALSE' @@ -326,12 +334,12 @@ locals[Value=3DEFI_IFR_TYPE_VALUE(), ValueList=3D[], = ListType=3DFalse] ; =20 vfrImageTag -locals[Node=3DVfrTreeNode(EFI_IFR_IMAGE_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_IMAGE_OP)] : 'image' '=3D' 'IMAGE_TOKEN' '(' Number ')' ; =20 vfrLockedTag -locals[Node=3DVfrTreeNode(EFI_IFR_LOCKED_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_LOCKED_OP)] : 'locked' ; =20 @@ -345,7 +353,7 @@ vfrStatementStatTagList[Node] ; =20 vfrFormDefinition -locals[Node=3DVfrTreeNode(EFI_IFR_FORM_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_FORM_OP)] : 'form' 'formid' '=3D' Number ',' 'title' '=3D' 'STRING_TOKEN' '(' Number ')' ';' (vfrForm)* @@ -372,7 +380,7 @@ locals[Node] ; =20 vfrFormMapDefinition -locals[Node=3DVfrTreeNode(EFI_IFR_FORM_MAP_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_FORM_MAP_OP)] : 'formmap' 'formid' '=3D' S1=3DNumber ',' ( 'maptitle' '=3D' 'STRING_TOKEN' '(' Number ')' ';' 'mapguid' '=3D' guidDefinition ';' @@ -392,9 +400,9 @@ locals[Node] ; =20 vfrStatementRules -locals[Node=3DVfrTreeNode(EFI_IFR_RULE_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_RULE_OP)] : 'rule' StringIdentifier ',' - vfrStatementExpression + vfrStatementExpression[localctx.Node] 'endrule' ';' ; =20 @@ -406,7 +414,7 @@ locals[Node] ; =20 vfrStatementSubTitle -locals[Node=3DVfrTreeNode(EFI_IFR_SUBTITLE_OP), OpObj=3DCIfrSubtitle()] +locals[Node=3DIfrTreeNode(EFI_IFR_SUBTITLE_OP)] : 'subtitle' =20 'text' '=3D' 'STRING_TOKEN' '(' Number ')' @@ -434,7 +442,7 @@ locals[Flag=3D0] ; =20 vfrStatementStaticText -locals[Node=3DVfrTreeNode(EFI_IFR_TEXT_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_TEXT_OP)] : 'text' 'help' '=3D' 'STRING_TOKEN' '(' S1=3DNumber ')' ',' 'text' '=3D' 'STRING_TOKEN' '(' S2=3DNumber ')' @@ -454,7 +462,7 @@ locals[Node] ; =20 vfrStatementGoto -locals[Node=3DVfrTreeNode(EFI_IFR_REF_OP), OpObj=3DNone, OHObj=3DNone, QTy= pe=3DEFI_QUESION_TYPE.QUESTION_REF] +locals[Node=3DIfrTreeNode(EFI_IFR_REF_OP), QType=3DEFI_QUESION_TYPE.QUESTI= ON_REF] : 'goto' ( ( DevicePath '=3D' 'STRING_TOKEN' '(' Number ')' ',' FormSetGuid '=3D' guidDefinition ',' @@ -471,15 +479,15 @@ locals[Node=3DVfrTreeNode(EFI_IFR_REF_OP), OpObj=3DNo= ne, OHObj=3DNone, QType=3DEFI_QUESI Question '=3D' (QN=3DStringIdentifier ',' | Number ',') ) | - ( Number ',' ) + ( N=3DNumber ',' ) )? - vfrQuestionHeader[localctx.OpObj, localctx.QType] - (',' 'flags' '=3D' vfrGotoFlags[localctx.OpObj])? + vfrQuestionHeader[localctx.Node, localctx.QType] + (',' 'flags' '=3D' vfrGotoFlags)? (',' 'key' '=3D' Number)? - (',' vfrStatementQuestionOptionList[localctx.Node])? ';' + (E=3D',' vfrStatementQuestionOptionList[localctx.Node])? ';' ; =20 -vfrGotoFlags[Obj] +vfrGotoFlags locals[GotoFlags=3D0] : gotoFlagsField('|' gotoFlagsField)* ; @@ -490,10 +498,10 @@ locals[Flag=3D0] ; =20 vfrStatementResetButton -locals[Node=3DVfrTreeNode(EFI_IFR_RESET_BUTTON_OP), OpObj=3DCIfrResetButto= n()] +locals[Node=3DIfrTreeNode(EFI_IFR_RESET_BUTTON_OP)] : 'resetbutton' 'defaultstore' '=3D' N=3DStringIdentifier ',' - vfrStatementHeader[localctx.OpObj] ',' + vfrStatementHeader[localctx.Node] ',' (vfrStatementStatTagList[localctx.Node] ',')? 'endresetbutton' ';' ; @@ -521,52 +529,52 @@ locals[Node] | vfrStatementWarningIf ; =20 -vfrStatementInconsistentIf -locals[Node=3DVfrTreeNode(EFI_IFR_INCONSISTENT_IF_OP)] +vfrStatementInconsistentIf // +locals[Node=3DIfrTreeNode(EFI_IFR_INCONSISTENT_IF_OP)] : 'inconsistentif' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' ('flags' '=3D' flagsField ('|' flagsField)* ',')? - vfrStatementExpression + vfrStatementExpression[localctx.Node] 'endif' (';')? ; =20 -vfrStatementNoSubmitIf -locals[Node=3DVfrTreeNode(EFI_IFR_NO_SUBMIT_IF_OP)] +vfrStatementNoSubmitIf // +locals[Node=3DIfrTreeNode(EFI_IFR_NO_SUBMIT_IF_OP)] : 'nosubmitif' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' ('flags' '=3D' flagsField ('|' flagsField)* ',')? - vfrStatementExpression + vfrStatementExpression[localctx.Node] 'endif' (';')? ; =20 vfrStatementDisableIfQuest -locals[Node=3DVfrTreeNode(EFI_IFR_DISABLE_IF_OP)] - : 'disableif' vfrStatementExpression ';' +locals[Node=3DIfrTreeNode(EFI_IFR_DISABLE_IF_OP)] + : 'disableif' vfrStatementExpression[localctx.Node] ';' vfrStatementQuestionOptionList[localctx.Node] 'endif' (';')? ; =20 vfrStatementRefresh -locals[Node=3DVfrTreeNode(EFI_IFR_REFRESH_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_REFRESH_OP)] : 'refresh' 'interval' '=3D' Number ; =20 vfrStatementVarstoreDevice -locals[Node=3DVfrTreeNode(EFI_IFR_VARSTORE_DEVICE_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_VARSTORE_DEVICE_OP)] : 'varstoredevice' '=3D' 'STRING_TOKEN' '(' Number ')' ',' ; =20 vfrStatementRefreshEvent -locals[Node=3DVfrTreeNode(EFI_IFR_REFRESH_ID_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_REFRESH_ID_OP)] : 'refreshguid' '=3D' guidDefinition ',' ; =20 -vfrStatementWarningIf -locals[Node=3DVfrTreeNode(EFI_IFR_WARNING_IF_OP)] +vfrStatementWarningIf // +locals[Node=3DIfrTreeNode(EFI_IFR_WARNING_IF_OP)] : 'warningif' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' ('timeout' '=3D' Number ',')? - vfrStatementExpression + vfrStatementExpression[localctx.Node] 'endif' (';')? ; =20 @@ -597,16 +605,16 @@ flagsField ; =20 vfrStatementSuppressIfQuest -locals[Node=3DVfrTreeNode(EFI_IFR_SUPPRESS_IF_OP)] - : 'suppressif' vfrStatementExpression ';' +locals[Node=3DIfrTreeNode(EFI_IFR_SUPPRESS_IF_OP)] + : 'suppressif' vfrStatementExpression[localctx.Node] ';' ('flags' '=3D' flagsField ('|' flagsField )* ',')? vfrStatementQuestionOptionList[localctx.Node] 'endif' (';')? ; =20 vfrStatementGrayOutIfQuest -locals[Node=3DVfrTreeNode(EFI_IFR_SUPPRESS_IF_OP)] - : 'grayoutif' vfrStatementExpression ';' +locals[Node=3DIfrTreeNode(EFI_IFR_SUPPRESS_IF_OP)] + : 'grayoutif' vfrStatementExpression[localctx.Node] ';' ('flags' '=3D' flagsField ('|' flagsField )* ',')? vfrStatementQuestionOptionList[localctx.Node] 'endif' (';')? @@ -614,9 +622,9 @@ locals[Node=3DVfrTreeNode(EFI_IFR_SUPPRESS_IF_OP)] =20 =20 vfrStatementDefault -locals[Node=3DVfrTreeNode(EFI_IFR_DEFAULT_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_DEFAULT_OP)] : D=3D'default' - ( ( vfrStatementValue ',' + ( ( V=3DvfrStatementValue ',' | '=3D' vfrConstantValueField ',' ) ( 'defaultstore' '=3D' SN=3DStringIdentifier ',' @@ -625,8 +633,8 @@ locals[Node=3DVfrTreeNode(EFI_IFR_DEFAULT_OP)] ; =20 vfrStatementValue -locals[Node=3DVfrTreeNode(EFI_IFR_VALUE_OP)] - : 'value' '=3D' vfrStatementExpression +locals[Node=3DIfrTreeNode(EFI_IFR_VALUE_OP)] + : 'value' '=3D' vfrStatementExpression[localctx.Node] ; =20 vfrStatementOptions @@ -635,11 +643,11 @@ locals[Node] ; =20 vfrStatementOneOfOption -locals[Node=3DVfrTreeNode(EFI_IFR_ONE_OF_OPTION_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_ONE_OF_OPTION_OP)] : 'option' 'text' '=3D' 'STRING_TOKEN' '(' Number ')' ',' 'value' '=3D' vfrConstantValueField ',' - F=3D'flags' '=3D' vfrOneOfOptionFlags (',' 'key' '=3D' KN=3DNumber= ) ? (',' vfrImageTag)* ';' + F=3D'flags' '=3D' vfrOneOfOptionFlags (',' 'key' '=3D' KN=3DNumber= ) ? (T=3D',' vfrImageTag)* ';' ; =20 vfrOneOfOptionFlags @@ -662,13 +670,13 @@ oneofoptionFlagsField ; =20 vfrStatementRead -locals[Node=3DVfrTreeNode(EFI_IFR_READ_OP)] - : 'read' vfrStatementExpression ';' +locals[Node=3DIfrTreeNode(EFI_IFR_READ_OP)] + : 'read' vfrStatementExpression[localctx.Node] ';' ; =20 vfrStatementWrite -locals[Node=3DVfrTreeNode(EFI_IFR_WRITE_OP)] - : 'write' vfrStatementExpression ';' +locals[Node=3DIfrTreeNode(EFI_IFR_WRITE_OP)] + : 'write' vfrStatementExpression[localctx.Node] ';' ; =20 vfrStatementQuestionOptionList[Node] @@ -688,10 +696,10 @@ locals[Node] ; =20 vfrStatementCheckBox -locals[Node=3DVfrTreeNode(EFI_IFR_CHECKBOX_OP), OpObj=3DCIfrCheckBox(), QT= ype=3DEFI_QUESION_TYPE.QUESTION_NORMAL] +locals[Node=3DIfrTreeNode(EFI_IFR_CHECKBOX_OP),GuidNode=3DIfrTreeNode(EFI_= IFR_GUID_OP), QType=3DEFI_QUESION_TYPE.QUESTION_NORMAL] : L=3D'checkbox' - vfrQuestionBaseInfo[localctx.OpObj, localctx.QType] - vfrStatementHeader[localctx.OpObj] ',' + vfrQuestionBaseInfo[localctx.Node, localctx.QType] + vfrStatementHeader[localctx.Node] ',' (F=3D'flags' '=3D' vfrCheckBoxFlags ',')? ('key' '=3D' Number ',')? vfrStatementQuestionOptionList[localctx.Node] @@ -714,9 +722,9 @@ locals[LFlag=3D0, HFlag=3D0] ; =20 vfrStatementAction -locals[Node=3DVfrTreeNode(EFI_IFR_ACTION_OP),OpObj=3DCIfrAction(), QType= =3DEFI_QUESION_TYPE.QUESTION_NORMAL] +locals[Node=3DIfrTreeNode(EFI_IFR_ACTION_OP), QType=3DEFI_QUESION_TYPE.QUE= STION_NORMAL] : 'action' - vfrQuestionHeader[localctx.OpObj, localctx.QType] ',' + vfrQuestionHeader[localctx.Node, localctx.QType] ',' ('flags' '=3D' vfrActionFlags ',')? 'config' '=3D' 'STRING_TOKEN' '(' Number ')' ',' vfrStatementQuestionTagList[localctx.Node] @@ -738,25 +746,25 @@ locals[Node] ; =20 vfrStatementNumeric -locals[Node=3DVfrTreeNode(EFI_IFR_NUMERIC_OP), OpObj=3DCIfrNumeric(), QTyp= e=3DEFI_QUESION_TYPE.QUESTION_NORMAL] +locals[Node=3DIfrTreeNode(EFI_IFR_NUMERIC_OP), GuidNode=3DIfrTreeNode(EFI_= IFR_GUID_OP), QType=3DEFI_QUESION_TYPE.QUESTION_NORMAL] : 'numeric' - vfrQuestionBaseInfo[localctx.OpObj, localctx.QType] - vfrStatementHeader[localctx.OpObj] ',' + vfrQuestionBaseInfo[localctx.Node, localctx.QType] + vfrStatementHeader[localctx.Node] ',' (F=3D'flags' '=3D' vfrNumericFlags ',')? ('key' '=3D' Number ',')? - vfrSetMinMaxStep[localctx.OpObj] + vfrSetMinMaxStep[localctx.Node] vfrStatementQuestionOptionList[localctx.Node] 'endnumeric' ';' ; =20 -vfrSetMinMaxStep[OpObj] // CIfrMinMaxStepData +vfrSetMinMaxStep[Node] // CIfrMinMaxStepData : 'minimum' '=3D' (N1=3D'-')? I=3DNumber ',' 'maximum' '=3D' (N2=3D'-')? A=3DNumber ',' ('step' '=3D' S=3DNumber ',')? ; =20 vfrNumericFlags -locals[HFlags=3D0, LFlags=3D0,IsDisplaySpecified=3DFalse] +locals[HFlags=3D0, LFlags=3D0, IsDisplaySpecified=3DFalse, UpdateVarType= =3DFalse] : numericFlagsField ('|' numericFlagsField)* ; =20 @@ -774,18 +782,18 @@ locals[HFlag=3D0,IsSetType=3DFalse,IsDisplaySpecified= =3DFalse] ; =20 vfrStatementOneOf -locals[Node=3DVfrTreeNode(EFI_IFR_ONE_OF_OP), OpObj=3DCIfrOneOf(), QType= =3DEFI_QUESION_TYPE.QUESTION_NORMAL] +locals[Node=3DIfrTreeNode(EFI_IFR_ONE_OF_OP), GuidNode=3DIfrTreeNode(EFI_I= FR_GUID_OP), QType=3DEFI_QUESION_TYPE.QUESTION_NORMAL] : 'oneof' - vfrQuestionBaseInfo[localctx.OpObj, localctx.QType] - vfrStatementHeader[localctx.OpObj] ',' - (F=3D'flags' '=3D' vfrOneofFlagsField ',')? - (vfrSetMinMaxStep[localctx.OpObj])? + vfrQuestionBaseInfo[localctx.Node, localctx.QType] + vfrStatementHeader[localctx.Node] ',' + (F=3D'flags' '=3D' vfrOneofFlagsField ',')? // + (vfrSetMinMaxStep[localctx.Node])? vfrStatementQuestionOptionList[localctx.Node] 'endoneof' ';' ; =20 vfrOneofFlagsField -locals[HFlags=3D0, LFlags=3D0] +locals[HFlags=3D0, LFlags=3D0, UpdateVarType=3DFalse] : numericFlagsField ('|' numericFlagsField)* ; =20 @@ -795,9 +803,9 @@ locals[Node] ; =20 vfrStatementString -locals[Node=3DVfrTreeNode(EFI_IFR_STRING_OP), OpObj=3DCIfrString(), QType= =3DEFI_QUESION_TYPE.QUESTION_NORMAL] +locals[Node=3DIfrTreeNode(EFI_IFR_STRING_OP), QType=3DEFI_QUESION_TYPE.QUE= STION_NORMAL] : 'string' - vfrQuestionHeader[localctx.OpObj, localctx.QType] ',' + vfrQuestionHeader[localctx.Node, localctx.QType] ',' (F=3D'flags' '=3D' vfrStringFlagsField ',')? ('key' '=3D' Number ',')? Min=3D'minsize' '=3D' Number ',' @@ -819,9 +827,9 @@ locals[HFlag=3D0, LFlag=3D0] ; =20 vfrStatementPassword -locals[Node=3DVfrTreeNode(EFI_IFR_PASSWORD_OP), OpObj=3DCIfrPassword(), QT= ype=3DEFI_QUESION_TYPE.QUESTION_NORMAL] +locals[Node=3DIfrTreeNode(EFI_IFR_PASSWORD_OP), QType=3DEFI_QUESION_TYPE.Q= UESTION_NORMAL] : 'password' - vfrQuestionHeader[localctx.OpObj, localctx.QType]',' + vfrQuestionHeader[localctx.Node, localctx.QType]',' (F=3D'flags' '=3D' vfrPasswordFlagsField ',')? ('key' '=3D' Number ',')? Min=3D'minsize' '=3D' Number ',' @@ -843,9 +851,9 @@ locals[HFlag=3D0] ; =20 vfrStatementOrderedList -locals[Node=3DVfrTreeNode(EFI_IFR_ORDERED_LIST_OP), OpObj=3DCIfrOrderedLis= t(), QType=3DEFI_QUESION_TYPE.QUESTION_NORMAL] +locals[Node=3DIfrTreeNode(EFI_IFR_ORDERED_LIST_OP), QType=3DEFI_QUESION_TY= PE.QUESTION_NORMAL] : 'orderedlist' - vfrQuestionHeader[localctx.OpObj, localctx.QType] ',' + vfrQuestionHeader[localctx.Node, localctx.QType] ',' (M=3D'maxcontainers' '=3D' Number ',')? (F=3D'flags' '=3D' vfrOrderedListFlags ',')? vfrStatementQuestionOptionList[localctx.Node] @@ -866,9 +874,9 @@ locals[HFlag=3D0, LFlag=3D0] ; =20 vfrStatementDate -locals[Node=3DVfrTreeNode(EFI_IFR_DATE_OP), OpObj=3DCIfrDate(), QType=3DEF= I_QUESION_TYPE.QUESTION_DATE, Val=3DEFI_IFR_TYPE_VALUE()] +locals[Node=3DIfrTreeNode(EFI_IFR_DATE_OP), QType=3DEFI_QUESION_TYPE.QUEST= ION_DATE, Val=3DEFI_HII_DATE()] : 'date' - ( ( vfrQuestionHeader[localctx.OpObj, localctx.QType] ',' + ( ( vfrQuestionHeader[localctx.Node, localctx.QType] ',' (F1=3D'flags' '=3D' vfrDateFlags ',')? vfrStatementQuestionOptionList[localctx.Node] ) @@ -876,15 +884,15 @@ locals[Node=3DVfrTreeNode(EFI_IFR_DATE_OP), OpObj=3DC= IfrDate(), QType=3DEFI_QUESION_TY ( 'year' 'varid' '=3D' StringIdentifier '.' StringIdentifier= ',' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' 'help' '=3D' 'STRING_TOKEN' '(' Number ')' ',' - minMaxDateStepDefault[localctx.Val.date, 0] + minMaxDateStepDefault[localctx.Node, localctx.Val, 0] 'month' 'varid' '=3D' StringIdentifier '.' StringIdentifie= r ',' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' 'help' '=3D' 'STRING_TOKEN' '(' Number ')' ',' - minMaxDateStepDefault[localctx.Val.date, 1] + minMaxDateStepDefault[localctx.Node, localctx.Val, 1] 'day' 'varid' '=3D' StringIdentifier '.' StringIdentifier = ',' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' 'help' '=3D' 'STRING_TOKEN' '(' Number ')' ',' - minMaxDateStepDefault[localctx.Val.date, 2] + minMaxDateStepDefault[localctx.Node, localctx.Val, 2] (F2=3D'flags' '=3D' vfrDateFlags ',')? (vfrStatementInconsistentIf)* ) @@ -892,7 +900,7 @@ locals[Node=3DVfrTreeNode(EFI_IFR_DATE_OP), OpObj=3DCIf= rDate(), QType=3DEFI_QUESION_TY 'enddate' ';' ; =20 -minMaxDateStepDefault[Date, KeyValue] +minMaxDateStepDefault[Node, Date, KeyValue] : 'minimum' '=3D' Number ',' 'maximum' '=3D' Number ',' ('step' '=3D' Number ',')? @@ -915,9 +923,9 @@ locals[LFlag=3D0] ; =20 vfrStatementTime -locals[Node=3DVfrTreeNode(EFI_IFR_TIME_OP), OpObj=3DCIfrTime(), QType=3DEF= I_QUESION_TYPE.QUESTION_TIME, Val=3DEFI_IFR_TYPE_VALUE()] +locals[Node=3DIfrTreeNode(EFI_IFR_TIME_OP), QType=3DEFI_QUESION_TYPE.QUEST= ION_TIME, Val=3DEFI_HII_TIME()] : 'time' - ( ( vfrQuestionHeader[localctx.OpObj, localctx.QType] ',' + ( ( vfrQuestionHeader[localctx.Node, localctx.QType] ',' (F1=3D'flags' '=3D' vfrTimeFlags ',')? vfrStatementQuestionOptionList[localctx.Node] ) @@ -926,15 +934,15 @@ locals[Node=3DVfrTreeNode(EFI_IFR_TIME_OP), OpObj=3DC= IfrTime(), QType=3DEFI_QUESION_TY 'hour' 'varid' '=3D' StringIdentifier '.' StringIdentifier= ',' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' 'help' '=3D' 'STRING_TOKEN' '(' Number ')' ',' - minMaxTimeStepDefault[localctx.Val.time, 0] + minMaxTimeStepDefault[localctx.Node, localctx.Val, 0] 'minute' 'varid' '=3D' StringIdentifier '.' StringIdentifi= er ',' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' 'help' '=3D' 'STRING_TOKEN' '(' Number ')' ',' - minMaxTimeStepDefault[localctx.Val.time, 1] + minMaxTimeStepDefault[localctx.Node, localctx.Val, 1] 'second' 'varid' '=3D' StringIdentifier '.' StringIdentifi= er ',' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' 'help' '=3D' 'STRING_TOKEN' '(' Number ')' ',' - minMaxTimeStepDefault[localctx.Val.time, 2] + minMaxTimeStepDefault[localctx.Node, localctx.Val, 2] (F2=3D'flags' '=3D' vfrTimeFlags ',')? (vfrStatementInconsistentIf)* ) @@ -942,7 +950,7 @@ locals[Node=3DVfrTreeNode(EFI_IFR_TIME_OP), OpObj=3DCIf= rTime(), QType=3DEFI_QUESION_TY 'endtime' ';' ; =20 -minMaxTimeStepDefault[Time, KeyValue] +minMaxTimeStepDefault[Node, Time, KeyValue] : 'minimum' '=3D' Number ',' 'maximum' '=3D' Number ',' ('step' '=3D' Number ',')? @@ -1011,51 +1019,52 @@ vfrStatementStatListOld ; =20 vfrStatementDisableIfStat -locals[Node=3DVfrTreeNode(EFI_IFR_DISABLE_IF_OP)] - : 'disableif' vfrStatementExpression ';' +locals[Node=3DIfrTreeNode(EFI_IFR_DISABLE_IF_OP)] + : 'disableif' vfrStatementExpression[localctx.Node] ';' (vfrStatementStatList)* 'endif' ';' ; =20 =20 // Compatible for framework vfr file -// vfrStatementgrayoutIfSuppressIf +locals[Node] : 'suppressif' ('flags' '=3D' flagsField ('|' flagsField)* ',')? - vfrStatementExpression ';' + vfrStatementExpression[localctx.Node] ';' ; =20 vfrStatementsuppressIfGrayOutIf +locals[Node] : 'grayoutif' ('flags' '=3D' flagsField ('|' flagsField)* ',')? - vfrStatementExpression ';' + vfrStatementExpression[localctx.Node] ';' ; =20 vfrStatementSuppressIfStatNew -locals[Node=3DVfrTreeNode(EFI_IFR_SUPPRESS_IF_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_SUPPRESS_IF_OP)] : 'suppressif' ('flags' '=3D' flagsField ('|' flagsField)* ',')? - vfrStatementExpression ';' + vfrStatementExpression[localctx.Node] ';' (vfrStatementStatList)* 'endif' ';' ; =20 vfrStatementGrayOutIfStatNew -locals[Node=3DVfrTreeNode(EFI_IFR_GRAY_OUT_IF_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_GRAY_OUT_IF_OP)] : 'grayoutif' ('flags' '=3D' flagsField ('|' flagsField)* ',')? - vfrStatementExpression ';' + vfrStatementExpression[localctx.Node] ';' (vfrStatementStatList)* 'endif' ';' ; =20 vfrStatementInconsistentIfStat -locals[Node=3DVfrTreeNode(EFI_IFR_INCONSISTENT_IF_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_INCONSISTENT_IF_OP)] : 'inconsistentif' 'prompt' '=3D' 'STRING_TOKEN' '(' Number ')' ',' ('flags' '=3D' flagsField ('|' flagsField)* ',')? - vfrStatementExpression + vfrStatementExpression[localctx.Node] 'endif' ';' ; =20 @@ -1092,12 +1101,12 @@ vfrStatementInvalidSaveRestoreDefaults ';' ; vfrStatementLabel -locals[Node=3DVfrTreeNode(EFI_IFR_GUID_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_GUID_OP)] : 'label' Number ';' ; =20 -vfrStatementBanner // Is TimeOut needed -locals[Node=3DVfrTreeNode(EFI_IFR_GUID_OP)] +vfrStatementBanner +locals[Node=3DIfrTreeNode(EFI_IFR_GUID_OP)] : 'banner' (',')? 'title' '=3D' 'STRING_TOKEN' '(' Number ')' ',' ( ( 'line' Number ',' @@ -1110,7 +1119,7 @@ locals[Node=3DVfrTreeNode(EFI_IFR_GUID_OP)] ; =20 vfrStatementExtension -locals[Node=3DVfrTreeNode(EFI_IFR_GUID_OP), DataBuff, Size=3D0, TypeName= =3D'', TypeSize=3D0, IsStruct=3DFalse, ArrayNum=3D0] +locals[Node=3DIfrTreeNode(EFI_IFR_GUID_OP), Buffer=3DNone, Size=3D0, TypeN= ame=3D'', TypeSize=3D0, IsStruct=3DFalse, ArrayNum=3D0] : 'guidop' 'guid' '=3D' guidDefinition ( ',' D=3D'datatype' '=3D' @@ -1125,7 +1134,7 @@ locals[Node=3DVfrTreeNode(EFI_IFR_GUID_OP), DataBuff,= Size=3D0, TypeName=3D'', TypeSiz | 'EFI_HII_REF' ('[' Number ']')? | StringIdentifier ('[' Number ']')? ) - (vfrExtensionData[localctx.DataBuff])* + (vfrExtensionData)* )? ( ',' (vfrStatementExtension)* @@ -1135,9 +1144,9 @@ locals[Node=3DVfrTreeNode(EFI_IFR_GUID_OP), DataBuff,= Size=3D0, TypeName=3D'', TypeSiz ; =20 =20 -vfrExtensionData[DataBuff] -locals[IsStruct] - : ',' 'data' ('[' Number ']')? +vfrExtensionData +locals[TFName=3D'', FName=3D'', TFValue=3DNone] + : ',' 'data' ('[' I=3DNumber ']')? ( '.' arrayName)* '=3D' N=3DNumber ; =20 @@ -1148,57 +1157,59 @@ locals[Node] ; =20 vfrModalTag -locals[Node=3DVfrTreeNode(EFI_IFR_MODAL_TAG_OP)] +locals[Node=3DIfrTreeNode(EFI_IFR_MODAL_TAG_OP)] : 'modal' ; =20 -vfrStatementExpression -locals[ExpInfo=3DExpressionInfo()] - : andTerm[localctx.ExpInfo] ('OR' andTerm[localctx.ExpInfo])* +vfrStatementExpression[ParentNode] +locals[ExpInfo=3DExpressionInfo(), Nodes=3D[]] + : andTerm[localctx.ExpInfo] (L=3D'OR' andTerm[localctx.ExpInfo])* ; =20 -vfrStatementExpressionSub -locals[ExpInfo=3DExpressionInfo()] +vfrStatementExpressionSub[ParentNodes] +locals[ExpInfo=3DExpressionInfo(), Nodes=3D[]] : andTerm[localctx.ExpInfo] ('OR' andTerm[localctx.ExpInfo])* ; =20 andTerm[ExpInfo] -locals[CIfrAndList=3D[]] - : bitwiseorTerm[ExpInfo] ('AND' bitwiseorTerm[ExpInfo])* +locals[Nodes=3D[], Line] + : bitwiseorTerm[ExpInfo] (L=3D'AND' bitwiseorTerm[ExpInfo])* ; =20 bitwiseorTerm[ExpInfo] -locals[CIfrBitWiseOrList=3D[]] - : bitwiseandTerm[ExpInfo] ('|' bitwiseandTerm[ExpInfo])* +locals[Nodes=3D[], Line] + : bitwiseandTerm[ExpInfo] (L=3D'|' bitwiseandTerm[ExpInfo])* ; =20 =20 bitwiseandTerm[ExpInfo] -locals[CIfrBitWiseAndList=3D[]] - : equalTerm[ExpInfo] ('&' equalTerm[ExpInfo])* +locals[Nodes=3D[], Line] + : equalTerm[ExpInfo] (L=3D'&' equalTerm[ExpInfo])* ; =20 =20 equalTerm[ExpInfo] -locals[CIfrEqualList=3D[], CIfrNotEqualList=3D[]] - : compareTerm[localctx.ExpInfo] - (equalTermSupplementary[localctx.CIfrEqualList, localctx.CIfrNotEq= ualList, ExpInfo])* +locals[Nodes=3D[], Line] + : compareTerm[ExpInfo] + (equalTermSupplementary[ExpInfo])* ; =20 =20 -equalTermSupplementary[CIfrEqualList, CIfrNotEqualList, ExpInfo] +equalTermSupplementary[ExpInfo] +locals[Nodes=3D[]] : ('=3D=3D' compareTerm[ExpInfo]) # equalTermEqualRule | ('!=3D' compareTerm[ExpInfo]) # equalTermNotEqualRule ; =20 compareTerm[ExpInfo] -locals[CIfrLessThanList=3D[], CIfrLessEqualList=3D[], CIfrGreaterThanList= =3D[], CIfrGreaterEqualList=3D[]] +locals[Nodes=3D[]] : shiftTerm[ExpInfo] - (compareTermSupplementary[localctx.CIfrLessThanList, localctx.CIfr= LessEqualList, localctx.CIfrGreaterThanList, localctx.CIfrGreaterEqualList,= ExpInfo])* + (compareTermSupplementary[ExpInfo])* ; =20 -compareTermSupplementary[CIfrLessThanList, CIfrLessEqualList, CIfrGreaterT= hanList, CIfrGreaterEqualList, ExpInfo] +compareTermSupplementary[ExpInfo] +locals[Nodes=3D[]] : ('<' shiftTerm[ExpInfo]) # compareTermLessRule | ('<=3D' shiftTerm[ExpInfo]) # compareTermLessEqualRule @@ -1209,36 +1220,39 @@ compareTermSupplementary[CIfrLessThanList, CIfrLess= EqualList, CIfrGreaterThanLis ; =20 shiftTerm[ExpInfo] -locals[CIfrShiftLeftList=3D[], CIfrShiftRightList=3D[]] +locals[Nodes=3D[]] : addMinusTerm[ExpInfo] - (shiftTermSupplementary[localctx.CIfrShiftLeftList, localctx.CIfrS= hiftRightList, ExpInfo])* + (shiftTermSupplementary[ExpInfo])* ; =20 -shiftTermSupplementary[CIfrShiftLeftList, CIfrShiftRightList, ExpInfo] +shiftTermSupplementary[ExpInfo] +locals[Nodes=3D[]] : ('<<' addMinusTerm[ExpInfo]) # shiftTermLeft | ('>>' addMinusTerm[ExpInfo]) # shiftTermRight ; =20 addMinusTerm[ExpInfo] -locals[CIfrAddList=3D[], CIfrSubtractList=3D[]] +locals[Nodes=3D[]] : multdivmodTerm[ExpInfo] - (addMinusTermSupplementary[localctx.CIfrAddList, localctx.CIfrSubt= ractList, ExpInfo])* + (addMinusTermSupplementary[ExpInfo])* ; =20 -addMinusTermSupplementary[CIfrAddList, CIfrSubtractList, ExpInfo] +addMinusTermSupplementary[ExpInfo] +locals[Nodes=3D[]] : ('+' multdivmodTerm[ExpInfo]) # addMinusTermpAdd | ('-' multdivmodTerm[ExpInfo]) # addMinusTermSubtract ; =20 multdivmodTerm[ExpInfo] -locals[CIfrMultiplyList=3D[], CIfrDivideList=3D[], CIfrModuloList=3D[]] +locals[Nodes=3D[]] : castTerm[ExpInfo] - (multdivmodTermSupplementary[localctx.CIfrMultiplyList, localctx.C= IfrDivideList, localctx.CIfrModuloList, ExpInfo])* + (multdivmodTermSupplementary[ExpInfo])* ; =20 -multdivmodTermSupplementary[CIfrMultiplyList, CIfrDivideList, CIfrModuloLi= st, ExpInfo] +multdivmodTermSupplementary[ExpInfo] +locals[Nodes=3D[]] : ('*' castTerm[ExpInfo]) # multdivmodTermMul | ('/' castTerm[ExpInfo]) # multdivmodTermDiv @@ -1247,20 +1261,26 @@ multdivmodTermSupplementary[CIfrMultiplyList, CIfrD= ivideList, CIfrModuloList, Ex ; =20 castTerm[ExpInfo] -locals[TBObj=3DNone, TUObj=3DNone] - : ( '(' - ( 'BOOLEAN' - | 'UINT64' - | 'UINT32' - | 'UINT16' - | 'UINT8' - ) - ')' - )* +locals[Nodes=3D[]] + : (castTermSub)* atomTerm[ExpInfo] ; =20 +castTermSub +locals[CastType=3D0xFF] + : '(' + ( 'BOOLEAN' + | 'UINT64' + | 'UINT32' + | 'UINT16' + | 'UINT8' + ) + ')' + + ; + atomTerm[ExpInfo] +locals[Nodes=3D[]] : vfrExpressionCatenate[ExpInfo] | vfrExpressionMatch[ExpInfo] | vfrExpressionMatch2[ExpInfo] @@ -1271,34 +1291,35 @@ atomTerm[ExpInfo] | vfrExpressionTernaryOp[ExpInfo] | vfrExpressionMap[ExpInfo] | ('NOT' atomTerm[ExpInfo]) - | vfrExpressionMatch2[ExpInfo] ; =20 vfrExpressionCatenate[ExpInfo] -locals[CObj=3DNone] +locals[Nodes=3D[]] : 'catenate' - '(' vfrStatementExpressionSub ',' vfrStatementExpressionSub ')' + '(' vfrStatementExpressionSub[localctx.Nodes] ',' vfrStatementExpr= essionSub[localctx.Nodes] ')' ; =20 vfrExpressionMatch[ExpInfo] -locals[MObj=3DNone] +locals[Nodes=3D[]] : 'match' - '(' vfrStatementExpressionSub ',' vfrStatementExpressionSub ')' + '(' vfrStatementExpressionSub[localctx.Nodes] ',' vfrStatementExp= ressionSub[localctx.Nodes] ')' ; =20 vfrExpressionMatch2[ExpInfo] -locals[M2Obj=3DNone] +locals[Nodes=3D[]] : 'match2' - '(' vfrStatementExpressionSub',' - vfrStatementExpressionSub ',' + '(' vfrStatementExpressionSub[localctx.Nodes] ',' + vfrStatementExpressionSub[localctx.Nodes] ',' guidDefinition ')' ; =20 vfrExpressionParen[ExpInfo] - : '(' vfrStatementExpressionSub ')' +locals[Nodes=3D[]] + : '(' vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 vfrExpressionBuildInFunction[ExpInfo] +locals[Node] : dupExp[ExpInfo] | vareqvalExp[ExpInfo] | ideqvalExp[ExpInfo] @@ -1313,23 +1334,25 @@ vfrExpressionBuildInFunction[ExpInfo] ; =20 dupExp[ExpInfo] -locals[DObj=3DNone] +locals[Node=3DIfrTreeNode(EFI_IFR_DUP_OP)] : 'dup' ; =20 =20 vareqvalExp[ExpInfo] +locals[Node] : 'vareqval' - 'var' '(' Number ')' + 'var' '(' VN=3DNumber ')' ( '=3D=3D' Number | '<=3D' Number - | '<' Number + | '<' Number | '>=3D' Number - | '>' Number + | '>' Number ) ; =20 ideqvalExp[ExpInfo] +locals[Node] : I=3D'ideqval' vfrQuestionDataFieldName ( '=3D=3D' Number | '<=3D' Number @@ -1340,6 +1363,7 @@ ideqvalExp[ExpInfo] ; =20 ideqidExp[ExpInfo] +locals[Node] : I=3D'ideqid' vfrQuestionDataFieldName ( E=3D'=3D=3D' vfrQuestionDataFieldName | LE=3D'<=3D' vfrQuestionDataFieldName @@ -1350,6 +1374,7 @@ ideqidExp[ExpInfo] ; =20 ideqvallistExp[ExpInfo] +locals[Node] : 'ideqvallist' vfrQuestionDataFieldName '=3D=3D' (Number)+ ; =20 @@ -1365,15 +1390,18 @@ locals[SubStr=3D'', SubStrZ=3D''] ; =20 questionref1Exp[ExpInfo] +locals[Node=3DIfrTreeNode(EFI_IFR_QUESTION_REF1_OP)] : 'questionref' '(' ( StringIdentifier | Number ) ')' ; =20 rulerefExp[ExpInfo] +locals[Node=3DIfrTreeNode(EFI_IFR_RULE_REF_OP)] : 'ruleref' '(' StringIdentifier ')' ; =20 stringref1Exp[ExpInfo] +locals[Node=3DIfrTreeNode(EFI_IFR_STRING_REF1_OP)] : 'stringref' '(' ( 'STRING_TOKEN' '(' Number ')' @@ -1385,10 +1413,12 @@ stringref1Exp[ExpInfo] ; =20 pushthisExp[ExpInfo] +locals[Node=3DIfrTreeNode(EFI_IFR_THIS_OP)] : 'pushthis' ; =20 securityExp[ExpInfo] +locals[Node=3DIfrTreeNode(EFI_IFR_SECURITY_OP)] : 'security' '(' guidDefinition ')' ; =20 @@ -1401,11 +1431,12 @@ locals[VarType] ; =20 getExp[ExpInfo] -locals[BaseInfo=3DEFI_VARSTORE_INFO(), GObj=3DNone] +locals[BaseInfo=3DEFI_VARSTORE_INFO(), Node=3DIfrTreeNode(EFI_IFR_GET_OP)] : 'get' '(' vfrStorageVarId[localctx.BaseInfo, False]('|' 'flags' '= =3D' numericVarStoreType)? ')' ; =20 vfrExpressionConstant[ExpInfo] +locals[Node] : 'TRUE' | 'FALSE' | 'ONE' @@ -1417,6 +1448,7 @@ vfrExpressionConstant[ExpInfo] ; =20 vfrExpressionUnaryOp[ExpInfo] +locals[Nodes] : lengthExp[ExpInfo] | bitwisenotExp[ExpInfo] | question23refExp[ExpInfo] @@ -1430,65 +1462,67 @@ vfrExpressionUnaryOp[ExpInfo] ; =20 lengthExp[ExpInfo] -locals[LObj=3DNone] - : 'length' '(' vfrStatementExpressionSub ')' +locals[Nodes=3D[]] + : 'length' '(' vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 bitwisenotExp[ExpInfo] -locals[BWNObj=3DNone] - : '~' '(' vfrStatementExpressionSub ')' +locals[Nodes=3D[]] + : '~' '(' vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 question23refExp[ExpInfo] +locals[Nodes=3D[]] : 'questionrefval' '(' (DevicePath '=3D' 'STRING_TOKEN' '(' Number ')' ',' )? (Uuid '=3D' guidDefinition ',' )? - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 stringref2Exp[ExpInfo] -locals[SR2Obj=3DNone] - : 'stringrefval' '(' vfrStatementExpressionSub ')' +locals[Nodes=3D[]] + : 'stringrefval' '(' vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 toboolExp[ExpInfo] -locals[TBObj=3DNone] - : 'boolval' '(' vfrStatementExpressionSub ')' +locals[Nodes=3D[]] + : 'boolval' '(' vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 tostringExp[ExpInfo] -locals[TSObj=3DNone] +locals[Nodes=3D[]] : 'stringval' ('format' '=3D' Number ',' )? - '(' vfrStatementExpressionSub ')' + '(' vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 unintExp[ExpInfo] -locals[TUObj=3DNone] - : 'unintval' '(' vfrStatementExpressionSub ')' +locals[Nodes=3D[]] + : 'unintval' '(' vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 toupperExp[ExpInfo] -locals[TUObj=3DNone] - : 'toupper' '(' vfrStatementExpressionSub ')' +locals[Nodes=3D[]] + : 'toupper' '(' vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 tolwerExp[ExpInfo] -locals[TLObj=3DNone] - : 'tolower' '(' vfrStatementExpressionSub ')' +locals[Nodes=3D[]] + : 'tolower' '(' vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 setExp[ExpInfo] -locals[BaseInfo=3DEFI_VARSTORE_INFO(), TSObj=3DNone] +locals[BaseInfo=3DEFI_VARSTORE_INFO(), Nodes=3D[]] : 'set' '(' vfrStorageVarId[localctx.BaseInfo, False]('|' 'flags' '=3D' numeri= cVarStoreType)? ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 vfrExpressionTernaryOp[ExpInfo] +locals[Nodes] : conditionalExp[ExpInfo] | findExp[ExpInfo] | midExp[ExpInfo] @@ -1497,28 +1531,28 @@ vfrExpressionTernaryOp[ExpInfo] ; =20 conditionalExp[ExpInfo] -locals[CObj=3DNone] +locals[Nodes=3D[]] : 'cond' '(' - vfrStatementExpressionSub // + vfrStatementExpressionSub[localctx.Nodes] '?' - vfrStatementExpressionSub // + vfrStatementExpressionSub[localctx.Nodes] ':' - vfrStatementExpressionSub // + vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 findExp[ExpInfo] -locals[FObj=3DNone] +locals[Nodes=3D[]] : 'find' '(' findFormat[ExpInfo] ('|' findFormat[ExpInfo])* ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 @@ -1528,40 +1562,40 @@ locals[Format=3D0] ; =20 midExp[ExpInfo] -locals[MObj=3DNone] +locals[Nodes=3D[]] : 'mid' '(' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 tokenExp[ExpInfo] -locals[TObj=3DNone] +locals[Nodes=3D[]] : 'token' '(' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 spanExp[ExpInfo] -locals[SObj=3DNone] +locals[Nodes=3D[]] : 'span' '(' 'flags' '=3D' spanFlags ('|' spanFlags)* ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ',' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ')' ; =20 @@ -1573,14 +1607,14 @@ locals[Flag=3D0] ; =20 vfrExpressionMap[ExpInfo] -locals[MObj=3DNone] +locals[Nodes=3D[], Node=3DIfrTreeNode()] : 'map' '(' - vfrStatementExpressionSub + vfrStatementExpressionSub[localctx.Nodes] ':' - ( vfrStatementExpression + ( vfrStatementExpression[localctx.Node] ',' - vfrStatementExpression + vfrStatementExpression[localctx.Node] ';' )* ')' @@ -1884,4 +1918,4 @@ LineComment Extern : 'extern' ~[#\r\n]* -> skip - ; \ No newline at end of file + ; diff --git a/BaseTools/Source/Python/VfrCompiler/VfrSyntaxLexer.py b/BaseTo= ols/Source/Python/VfrCompiler/VfrSyntaxLexer.py index 2b7a5c32a3..0e165a0446 100644 --- a/BaseTools/Source/Python/VfrCompiler/VfrSyntaxLexer.py +++ b/BaseTools/Source/Python/VfrCompiler/VfrSyntaxLexer.py @@ -1,16 +1,15 @@ # Generated from VfrSyntax.g4 by ANTLR 4.7.2 + +import sys from antlr4 import * from io import StringIO from typing import TextIO -import sys - - - -from VfrCompiler.CommonCtypes import * -from VfrCompiler.VfrFormPkg import * -from VfrCompiler.VfrUtility import * -from VfrCompiler.VfrTree import * - +from VfrCompiler.IfrCtypes import * +from VfrCompiler.IfrFormPkg import * +from VfrCompiler.IfrUtility import * +from VfrCompiler.IfrTree import * +from VfrCompiler.IfrError import * +from VfrCompiler.IfrPreProcess import * =20 =20 def serializedATN(): diff --git a/BaseTools/Source/Python/VfrCompiler/VfrSyntaxParser.py b/BaseT= ools/Source/Python/VfrCompiler/VfrSyntaxParser.py index b6af21b795..d5d61a26a9 100644 --- a/BaseTools/Source/Python/VfrCompiler/VfrSyntaxParser.py +++ b/BaseTools/Source/Python/VfrCompiler/VfrSyntaxParser.py @@ -1,22 +1,23 @@ # Generated from VfrSyntax.g4 by ANTLR 4.7.2 # encoding: utf-8 + +import os +import sys from antlr4 import * from io import StringIO from typing import TextIO -import sys - - - -from VfrCompiler.CommonCtypes import * -from VfrCompiler.VfrFormPkg import * -from VfrCompiler.VfrUtility import * -from VfrCompiler.VfrTree import * +from VfrCompiler.IfrCtypes import * +from VfrCompiler.IfrFormPkg import * +from VfrCompiler.IfrUtility import * +from VfrCompiler.IfrTree import * +from VfrCompiler.IfrError import * +from VfrCompiler.IfrPreProcess import * =20 =20 def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\u0= 102") - buf.write("\u0ba3\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7"= ) + buf.write("\u0ba7\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7"= ) buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16= ") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23= ") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31= ") @@ -54,1528 +55,1530 @@ def serializedATN(): buf.write("\4\u00c0\t\u00c0\4\u00c1\t\u00c1\4\u00c2\t\u00c2\4\u00c= 3") buf.write("\t\u00c3\4\u00c4\t\u00c4\4\u00c5\t\u00c5\4\u00c6\t\u00c= 6") buf.write("\4\u00c7\t\u00c7\4\u00c8\t\u00c8\4\u00c9\t\u00c9\4\u00c= a") - buf.write("\t\u00ca\4\u00cb\t\u00cb\3\2\3\2\3\2\7\2\u019a\n\2\f\2"= ) - buf.write("\16\2\u019d\13\2\3\2\3\2\3\3\3\3\3\4\3\4\3\4\5\4\u01a6"= ) - buf.write("\n\4\3\4\3\4\5\4\u01aa\n\4\3\5\5\5\u01ad\n\5\3\6\3\6\3"= ) - buf.write("\6\3\6\3\6\3\6\5\6\u01b5\n\6\3\6\3\6\3\7\5\7\u01ba\n\7"= ) - buf.write("\3\7\3\7\5\7\u01be\n\7\3\7\5\7\u01c1\n\7\3\7\3\7\3\7\3"= ) - buf.write("\7\5\7\u01c7\n\7\3\7\3\7\3\b\5\b\u01cc\n\b\3\b\3\b\5\b"= ) - buf.write("\u01d0\n\b\3\b\5\b\u01d3\n\b\3\b\3\b\3\b\3\b\5\b\u01d9"= ) - buf.write("\n\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3"= ) - buf.write("\t\3\t\3\t\3\t\7\t\u01eb\n\t\f\t\16\t\u01ee\13\t\3\n\3"= ) - buf.write("\n\3\n\3\n\3\n\5\n\u01f5\n\n\3\n\3\n\3\13\3\13\3\13\3") - buf.write("\13\3\13\5\13\u01fe\n\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f"= ) - buf.write("\5\f\u0207\n\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\5\r\u0210\n"= ) - buf.write("\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\5\16\u0219\n\16\3") - buf.write("\16\3\16\3\17\3\17\3\17\3\17\3\17\5\17\u0222\n\17\3\17"= ) - buf.write("\3\17\3\20\3\20\3\20\3\20\3\20\5\20\u022b\n\20\3\20\3") - buf.write("\20\3\21\3\21\3\21\3\21\3\21\5\21\u0234\n\21\3\21\3\21"= ) - buf.write("\3\22\3\22\3\22\3\22\3\22\5\22\u023d\n\22\3\22\3\22\3") - buf.write("\23\3\23\3\23\3\23\3\23\5\23\u0246\n\23\3\23\3\23\3\24"= ) - buf.write("\3\24\5\24\u024c\n\24\3\24\3\24\3\24\3\24\3\25\3\25\5") - buf.write("\25\u0254\n\25\3\25\3\25\3\25\3\25\3\26\3\26\5\26\u025c= ") - buf.write("\n\26\3\26\3\26\3\26\3\26\3\27\3\27\5\27\u0264\n\27\3") - buf.write("\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\30\3\30") + buf.write("\t\u00ca\4\u00cb\t\u00cb\4\u00cc\t\u00cc\3\2\3\2\3\2\7"= ) + buf.write("\2\u019c\n\2\f\2\16\2\u019f\13\2\3\2\5\2\u01a2\n\2\3\3"= ) + buf.write("\3\3\3\4\3\4\3\4\5\4\u01a9\n\4\3\4\3\4\5\4\u01ad\n\4\3"= ) + buf.write("\5\5\5\u01b0\n\5\3\6\3\6\3\6\3\6\3\6\3\6\5\6\u01b8\n\6"= ) + buf.write("\3\6\3\6\3\7\5\7\u01bd\n\7\3\7\3\7\5\7\u01c1\n\7\3\7\5"= ) + buf.write("\7\u01c4\n\7\3\7\3\7\3\7\3\7\5\7\u01ca\n\7\3\7\3\7\3\b"= ) + buf.write("\5\b\u01cf\n\b\3\b\3\b\5\b\u01d3\n\b\3\b\5\b\u01d6\n\b"= ) + buf.write("\3\b\3\b\3\b\3\b\5\b\u01dc\n\b\3\b\3\b\3\t\3\t\3\t\3\t"= ) + buf.write("\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\7\t\u01ee\n\t"= ) + buf.write("\f\t\16\t\u01f1\13\t\3\n\3\n\3\n\3\n\3\n\5\n\u01f8\n\n"= ) + buf.write("\3\n\3\n\3\13\3\13\3\13\3\13\3\13\5\13\u0201\n\13\3\13"= ) + buf.write("\3\13\3\f\3\f\3\f\3\f\3\f\5\f\u020a\n\f\3\f\3\f\3\r\3") + buf.write("\r\3\r\3\r\3\r\5\r\u0213\n\r\3\r\3\r\3\16\3\16\3\16\3") + buf.write("\16\3\16\5\16\u021c\n\16\3\16\3\16\3\17\3\17\3\17\3\17"= ) + buf.write("\3\17\5\17\u0225\n\17\3\17\3\17\3\20\3\20\3\20\3\20\3") + buf.write("\20\5\20\u022e\n\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21"= ) + buf.write("\5\21\u0237\n\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22\5") + buf.write("\22\u0240\n\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\5\23"= ) + buf.write("\u0249\n\23\3\23\3\23\3\24\3\24\5\24\u024f\n\24\3\24\3"= ) + buf.write("\24\3\24\3\24\3\25\3\25\5\25\u0257\n\25\3\25\3\25\3\25"= ) + buf.write("\3\25\3\26\3\26\5\26\u025f\n\26\3\26\3\26\3\26\3\26\3") + buf.write("\27\3\27\5\27\u0267\n\27\3\27\3\27\3\27\3\27\3\30\3\30"= ) buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30= ") - buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\5\30\u0282\n\30\3\30\3") - buf.write("\30\3\30\3\30\3\30\5\30\u0289\n\30\3\30\3\30\3\30\3\30"= ) - buf.write("\3\30\5\30\u0290\n\30\3\30\3\30\3\30\3\30\3\31\3\31\3") - buf.write("\31\5\31\u0299\n\31\3\31\3\31\5\31\u029d\n\31\3\31\3\31= ") - buf.write("\5\31\u02a1\n\31\3\32\3\32\3\32\7\32\u02a6\n\32\f\32\16= ") - buf.write("\32\u02a9\13\32\3\33\3\33\3\34\3\34\3\35\7\35\u02b0\n") - buf.write("\35\f\35\16\35\u02b3\13\35\3\36\3\36\3\36\3\36\3\36\3") - buf.write("\36\3\36\3\36\3\36\3\36\5\36\u02bf\n\36\3\37\3\37\3\37"= ) - buf.write("\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\5\37= ") - buf.write("\u02ce\n\37\3\37\3\37\3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3") - buf.write(" \3 \3 \3 \3 \3 \3 \5 \u02e3\n \3 \3 \3 \3 \5 \u02e9\n"= ) - buf.write(" \3 \3 \3 \3 \3 \3 \3 \3 \3 \3!\3!\3!\3!\3!\3!\3!\3!\3"= ) - buf.write("!\3!\3!\3!\3!\3!\3!\3!\3!\5!\u0305\n!\3!\3!\3!\3!\5!\u0= 30b") - buf.write("\n!\3!\3!\3!\3!\3!\7!\u0312\n!\f!\16!\u0315\13!\3!\3!") - buf.write("\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\5!\u0327\n") - buf.write("!\3!\3!\3!\3!\3!\3\"\3\"\3#\3#\3#\3#\3#\3#\3#\5#\u0337"= ) - buf.write("\n#\3#\3#\3#\3#\3#\3#\3#\6#\u0340\n#\r#\16#\u0341\3#\3"= ) - buf.write("#\3#\3#\3#\3$\3$\3$\3$\3$\3$\3$\3%\3%\3%\3%\3%\3%\3%\3"= ) - buf.write("&\3&\3&\3&\3&\3&\3&\3&\3&\3&\3&\3&\3&\3&\3&\3&\3\'\3\'"= ) - buf.write("\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\5\'\u0373\n\'"= ) - buf.write("\3\'\3\'\3(\3(\3(\3(\3(\3)\3)\3)\3*\3*\3*\3*\5*\u0383") - buf.write("\n*\3*\3*\3*\3*\3*\5*\u038a\n*\3*\3*\3*\3*\5*\u0390\n") - buf.write("*\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3,\3,\3,\3"= ) - buf.write(",\3,\3,\3,\3,\5,\u03a8\n,\3-\3-\3-\3-\3-\3-\3-\7-\u03b1= ") - buf.write("\n-\f-\16-\u03b4\13-\5-\u03b6\n-\3.\5.\u03b9\n.\3.\3.") - buf.write("\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3") - buf.write(".\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\7.\u03de= ") - buf.write("\n.\f.\16.\u03e1\13.\3.\5.\u03e4\n.\3/\3/\3/\3/\3/\3/") - buf.write("\3/\3\60\3\60\3\61\3\61\5\61\u03f1\n\61\3\62\3\62\3\62"= ) - buf.write("\7\62\u03f6\n\62\f\62\16\62\u03f9\13\62\3\63\3\63\3\63"= ) - buf.write("\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\7\63= ") - buf.write("\u0408\n\63\f\63\16\63\u040b\13\63\3\63\3\63\3\63\3\64"= ) - buf.write("\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64= ") - buf.write("\3\64\3\64\3\64\5\64\u041f\n\64\3\65\3\65\3\65\3\65\3") - buf.write("\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65") - buf.write("\3\65\3\65\7\65\u0432\n\65\f\65\16\65\u0435\13\65\3\65"= ) - buf.write("\7\65\u0438\n\65\f\65\16\65\u043b\13\65\3\65\3\65\3\65"= ) - buf.write("\3\66\3\66\3\66\3\67\3\67\3\67\38\38\38\38\38\38\38\3") - buf.write("9\39\39\59\u0450\n9\3:\3:\3:\3:\3:\3:\3:\3:\3:\3:\3:\5"= ) - buf.write(":\u045d\n:\3:\3:\5:\u0461\n:\3:\3:\3:\5:\u0466\n:\3:\3"= ) - buf.write(":\7:\u046a\n:\f:\16:\u046d\13:\5:\u046f\n:\3:\3:\5:\u04= 73") - buf.write("\n:\3;\3;\5;\u0477\n;\3<\3<\3<\7<\u047c\n<\f<\16<\u047f= ") - buf.write("\13<\3=3D\3=3D\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3= >\3") - buf.write(">\3>\3>\3>\3>\3>\3>\5>\u0498\n>\3>\3>\3>\3>\3>\3>\7>\u0= 4a0") - buf.write("\n>\f>\16>\u04a3\13>\3>\3>\3>\3>\3>\5>\u04aa\n>\3>\3>") - buf.write("\5>\u04ae\n>\3>\3>\3?\3?\5?\u04b4\n?\3@\3@\5@\u04b8\n") - buf.write("@\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3"= ) + buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30= ") + buf.write("\5\30\u0285\n\30\3\30\3\30\3\30\3\30\3\30\5\30\u028c\n"= ) + buf.write("\30\3\30\3\30\3\30\3\30\3\30\5\30\u0293\n\30\3\30\3\30"= ) + buf.write("\3\30\3\30\3\31\3\31\3\31\5\31\u029c\n\31\3\31\3\31\5") + buf.write("\31\u02a0\n\31\3\31\3\31\5\31\u02a4\n\31\3\32\3\32\3\32= ") + buf.write("\7\32\u02a9\n\32\f\32\16\32\u02ac\13\32\3\33\3\33\3\34"= ) + buf.write("\3\34\3\35\7\35\u02b3\n\35\f\35\16\35\u02b6\13\35\3\36"= ) + buf.write("\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\5\36\u02c= 2") + buf.write("\n\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37= ") + buf.write("\3\37\3\37\3\37\5\37\u02d1\n\37\3\37\3\37\3 \3 \3 \3 ") + buf.write("\3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \5 \u02e6\n \3") + buf.write(" \3 \3 \3 \5 \u02ec\n \3 \3 \3 \3 \3 \3 \3 \3 \3 \3!\3"= ) + buf.write("!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\5!\u0308= ") + buf.write("\n!\3!\3!\3!\3!\5!\u030e\n!\3!\3!\3!\3!\3!\7!\u0315\n") + buf.write("!\f!\16!\u0318\13!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3") + buf.write("!\3!\3!\3!\3!\5!\u032a\n!\3!\3!\3!\3!\3!\3\"\3\"\3#\3") + buf.write("#\3#\3#\3#\3#\3#\5#\u033a\n#\3#\3#\3#\3#\3#\3#\3#\6#\u0= 343") + buf.write("\n#\r#\16#\u0344\3#\3#\3#\3#\3#\3$\3$\3$\3$\3$\3$\3$\3"= ) + buf.write("%\3%\3%\3%\3%\3%\3%\3&\3&\3&\3&\3&\3&\3&\3&\3&\3&\3&\3"= ) + buf.write("&\3&\3&\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'") + buf.write("\3\'\3\'\5\'\u0376\n\'\3\'\3\'\3(\3(\3(\3(\3(\3)\3)\3") + buf.write(")\3*\3*\3*\3*\5*\u0386\n*\3*\3*\3*\3*\3*\5*\u038d\n*\3"= ) + buf.write("*\3*\3*\3*\5*\u0393\n*\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3"= ) + buf.write("+\3+\3+\3+\3,\3,\3,\3,\3,\3,\3,\3,\5,\u03ab\n,\3-\3-\3"= ) + buf.write("-\3-\3-\3-\3-\7-\u03b4\n-\f-\16-\u03b7\13-\5-\u03b9\n") + buf.write("-\3.\5.\u03bc\n.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3"= ) + buf.write(".\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3"= ) + buf.write(".\3.\3.\3.\3.\7.\u03e1\n.\f.\16.\u03e4\13.\3.\5.\u03e7"= ) + buf.write("\n.\3/\3/\3/\3/\3/\3/\3/\3\60\3\60\3\61\3\61\5\61\u03f4= ") + buf.write("\n\61\3\62\3\62\3\62\7\62\u03f9\n\62\f\62\16\62\u03fc") + buf.write("\13\62\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3") + buf.write("\63\3\63\3\63\3\63\7\63\u040b\n\63\f\63\16\63\u040e\13"= ) + buf.write("\63\3\63\3\63\3\63\3\64\3\64\3\64\3\64\3\64\3\64\3\64") + buf.write("\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\5\64\u0422\n") + buf.write("\64\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65") + buf.write("\3\65\3\65\3\65\3\65\3\65\3\65\3\65\7\65\u0435\n\65\f") + buf.write("\65\16\65\u0438\13\65\3\65\7\65\u043b\n\65\f\65\16\65") + buf.write("\u043e\13\65\3\65\3\65\3\65\3\66\3\66\3\66\3\67\3\67\3"= ) + buf.write("\67\38\38\38\38\38\38\38\39\39\39\59\u0453\n9\3:\3:\3") + buf.write(":\3:\3:\3:\3:\3:\3:\3:\3:\5:\u0460\n:\3:\3:\5:\u0464\n"= ) + buf.write(":\3:\3:\3:\5:\u0469\n:\3:\3:\7:\u046d\n:\f:\16:\u0470") + buf.write("\13:\5:\u0472\n:\3:\3:\5:\u0476\n:\3;\3;\5;\u047a\n;\3"= ) + buf.write("<\3<\3<\7<\u047f\n<\f<\16<\u0482\13<\3=3D\3=3D\3>\3>\3>= \3") + buf.write(">\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\5"= ) + buf.write(">\u049b\n>\3>\3>\3>\3>\3>\3>\7>\u04a3\n>\f>\16>\u04a6") + buf.write("\13>\3>\3>\3>\3>\3>\5>\u04ad\n>\3>\3>\5>\u04b1\n>\3>\3"= ) + buf.write(">\3?\3?\5?\u04b7\n?\3@\3@\5@\u04bb\n@\3A\3A\3A\3A\3A\3"= ) + buf.write("A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3"= ) buf.write("A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3A\3"= ) - buf.write("A\3A\3A\3A\3A\3A\3A\3A\3A\5A\u04e6\nA\3A\3A\5A\u04ea\n"= ) - buf.write("A\3A\3A\3A\3A\3A\5A\u04f1\nA\3A\3A\3A\3A\5A\u04f7\nA\3"= ) - buf.write("A\3A\5A\u04fb\nA\3A\3A\3B\3B\3B\7B\u0502\nB\fB\16B\u050= 5") - buf.write("\13B\3C\3C\5C\u0509\nC\3D\3D\3D\3D\3D\3D\3D\3D\3D\3D\5"= ) - buf.write("D\u0515\nD\3D\3D\3D\3E\3E\3E\3E\3E\3E\5E\u0520\nE\3F\3"= ) - buf.write("F\3F\3F\3F\3F\3F\3F\3F\3F\3F\5F\u052d\nF\3G\3G\3G\3G\3"= ) - buf.write("G\3G\3G\3G\3G\3G\3G\3G\3G\7G\u053c\nG\fG\16G\u053f\13") - buf.write("G\3G\3G\5G\u0543\nG\3G\3G\3G\5G\u0548\nG\3H\3H\3H\3H\3"= ) - buf.write("H\3H\3H\3H\3H\3H\3H\3H\3H\7H\u0557\nH\fH\16H\u055a\13") - buf.write("H\3H\3H\5H\u055e\nH\3H\3H\3H\5H\u0563\nH\3I\3I\3I\3I\3"= ) - buf.write("I\3I\5I\u056b\nI\3J\3J\3J\3J\3J\3K\3K\3K\3K\3K\3K\3K\3"= ) - buf.write("K\3L\3L\3L\3L\3L\3M\3M\3M\3M\3M\3M\3M\3M\3M\3M\3M\3M\5"= ) - buf.write("M\u058b\nM\3M\3M\3M\5M\u0590\nM\3N\7N\u0593\nN\fN\16N") - buf.write("\u0596\13N\3O\3O\3O\3O\3O\3O\3O\5O\u059f\nO\3P\3P\3P\3"= ) - buf.write("P\3P\3P\3P\3P\5P\u05a9\nP\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\7Q\u0= 5b3") - buf.write("\nQ\fQ\16Q\u05b6\13Q\3Q\3Q\5Q\u05ba\nQ\3Q\3Q\3Q\5Q\u05b= f") - buf.write("\nQ\3R\3R\3R\3R\3R\3R\3R\3R\7R\u05c9\nR\fR\16R\u05cc\13= ") - buf.write("R\3R\3R\5R\u05d0\nR\3R\3R\3R\5R\u05d5\nR\3S\3S\3S\3S\3"= ) - buf.write("S\3S\3S\3S\5S\u05df\nS\3S\3S\3S\3S\5S\u05e5\nS\3T\3T\3"= ) - buf.write("T\3T\3U\3U\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3"= ) - buf.write("V\3V\3V\3V\3V\5V\u0600\nV\3V\3V\7V\u0604\nV\fV\16V\u060= 7") - buf.write("\13V\3V\3V\3W\3W\3W\7W\u060e\nW\fW\16W\u0611\13W\3X\3") - buf.write("X\3X\3X\3X\3X\3X\3X\3X\3X\3X\5X\u061e\nX\3Y\3Y\3Y\3Y\3"= ) - buf.write("Z\3Z\3Z\3Z\3[\7[\u0629\n[\f[\16[\u062c\13[\3\\\3\\\5\\"= ) - buf.write("\u0630\n\\\3]\3]\5]\u0634\n]\3^\3^\3^\3^\3^\3^\3^\3^\3"= ) - buf.write("^\5^\u063f\n^\3^\3^\3^\3^\5^\u0645\n^\3^\3^\3^\3^\3_\3"= ) - buf.write("_\3_\7_\u064e\n_\f_\16_\u0651\13_\3`\3`\3`\3`\3`\3`\5") - buf.write("`\u0659\n`\3a\3a\3a\3a\3a\3a\3a\3a\5a\u0663\na\3a\3a\3"= ) - buf.write("a\3a\3a\3a\3a\3a\3a\3a\3a\3b\3b\3b\7b\u0673\nb\fb\16b") - buf.write("\u0676\13b\3c\3c\5c\u067a\nc\3d\3d\5d\u067e\nd\3e\3e\3"= ) - buf.write("e\3e\3e\3e\3e\3e\3e\5e\u0689\ne\3e\3e\3e\3e\5e\u068f\n"= ) - buf.write("e\3e\3e\3e\3e\3e\3f\3f\3f\5f\u0699\nf\3f\3f\3f\3f\3f\5"= ) - buf.write("f\u06a0\nf\3f\3f\3f\3f\3f\3f\5f\u06a8\nf\3g\3g\3g\7g\u0= 6ad") - buf.write("\ng\fg\16g\u06b0\13g\3h\3h\3h\3h\3h\3h\3h\3h\3h\5h\u06b= b") - buf.write("\nh\3i\3i\3i\3i\3i\3i\3i\3i\3i\5i\u06c6\ni\3i\5i\u06c9"= ) - buf.write("\ni\3i\3i\3i\3i\3j\3j\3j\7j\u06d2\nj\fj\16j\u06d5\13j") - buf.write("\3k\3k\5k\u06d9\nk\3l\3l\3l\3l\3l\3l\3l\3l\5l\u06e3\n") - buf.write("l\3l\3l\3l\3l\5l\u06e9\nl\3l\3l\3l\3l\3l\3l\3l\3l\3l\3"= ) - buf.write("l\3l\3l\3m\3m\3m\7m\u06fa\nm\fm\16m\u06fd\13m\3n\3n\3") - buf.write("n\5n\u0702\nn\3o\3o\3o\3o\3o\3o\3o\3o\5o\u070c\no\3o\3"= ) - buf.write("o\3o\3o\5o\u0712\no\3o\3o\3o\3o\3o\3o\3o\3o\3o\3o\3o\3"= ) - buf.write("o\5o\u0720\no\3o\3o\3o\3o\3p\3p\3p\7p\u0729\np\fp\16p") - buf.write("\u072c\13p\3q\3q\5q\u0730\nq\3r\3r\3r\3r\3r\3r\3r\5r\u0= 739") - buf.write("\nr\3r\3r\3r\3r\3r\5r\u0740\nr\3r\3r\3r\3r\3s\3s\3s\7") - buf.write("s\u0749\ns\fs\16s\u074c\13s\3t\3t\3t\3t\5t\u0752\nt\3") - buf.write("u\3u\3u\3u\3u\3u\3u\3u\5u\u075c\nu\3u\3u\3u\3u\3u\3u\3"= ) + buf.write("A\3A\3A\5A\u04e9\nA\3A\3A\5A\u04ed\nA\3A\3A\3A\3A\3A\5"= ) + buf.write("A\u04f4\nA\3A\3A\3A\3A\5A\u04fa\nA\3A\3A\5A\u04fe\nA\3"= ) + buf.write("A\3A\3B\3B\3B\7B\u0505\nB\fB\16B\u0508\13B\3C\3C\5C\u05= 0c") + buf.write("\nC\3D\3D\3D\3D\3D\3D\3D\3D\3D\3D\5D\u0518\nD\3D\3D\3") + buf.write("D\3E\3E\3E\3E\3E\3E\5E\u0523\nE\3F\3F\3F\3F\3F\3F\3F\3"= ) + buf.write("F\3F\3F\3F\5F\u0530\nF\3G\3G\3G\3G\3G\3G\3G\3G\3G\3G\3"= ) + buf.write("G\3G\3G\7G\u053f\nG\fG\16G\u0542\13G\3G\3G\5G\u0546\n") + buf.write("G\3G\3G\3G\5G\u054b\nG\3H\3H\3H\3H\3H\3H\3H\3H\3H\3H\3"= ) + buf.write("H\3H\3H\7H\u055a\nH\fH\16H\u055d\13H\3H\3H\5H\u0561\n") + buf.write("H\3H\3H\3H\5H\u0566\nH\3I\3I\3I\3I\3I\3I\5I\u056e\nI\3"= ) + buf.write("J\3J\3J\3J\3J\3K\3K\3K\3K\3K\3K\3K\3K\3L\3L\3L\3L\3L\3"= ) + buf.write("M\3M\3M\3M\3M\3M\3M\3M\3M\3M\3M\3M\5M\u058e\nM\3M\3M\3"= ) + buf.write("M\5M\u0593\nM\3N\7N\u0596\nN\fN\16N\u0599\13N\3O\3O\3") + buf.write("O\3O\3O\3O\3O\5O\u05a2\nO\3P\3P\3P\3P\3P\3P\3P\3P\5P\u0= 5ac") + buf.write("\nP\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\7Q\u05b6\nQ\fQ\16Q\u05b9\13= ") + buf.write("Q\3Q\3Q\5Q\u05bd\nQ\3Q\3Q\3Q\5Q\u05c2\nQ\3R\3R\3R\3R\3"= ) + buf.write("R\3R\3R\3R\7R\u05cc\nR\fR\16R\u05cf\13R\3R\3R\5R\u05d3"= ) + buf.write("\nR\3R\3R\3R\5R\u05d8\nR\3S\3S\3S\3S\3S\3S\3S\3S\5S\u05= e2") + buf.write("\nS\3S\3S\3S\3S\5S\u05e8\nS\3T\3T\3T\3T\3U\3U\3V\3V\3") + buf.write("V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\3V\5V\u0= 603") + buf.write("\nV\3V\3V\7V\u0607\nV\fV\16V\u060a\13V\3V\3V\3W\3W\3W") + buf.write("\7W\u0611\nW\fW\16W\u0614\13W\3X\3X\3X\3X\3X\3X\3X\3X") + buf.write("\3X\3X\3X\5X\u0621\nX\3Y\3Y\3Y\3Y\3Z\3Z\3Z\3Z\3[\7[\u06= 2c") + buf.write("\n[\f[\16[\u062f\13[\3\\\3\\\5\\\u0633\n\\\3]\3]\5]\u06= 37") + buf.write("\n]\3^\3^\3^\3^\3^\3^\3^\3^\3^\5^\u0642\n^\3^\3^\3^\3") + buf.write("^\5^\u0648\n^\3^\3^\3^\3^\3_\3_\3_\7_\u0651\n_\f_\16_") + buf.write("\u0654\13_\3`\3`\3`\3`\3`\3`\5`\u065c\n`\3a\3a\3a\3a\3"= ) + buf.write("a\3a\3a\3a\5a\u0666\na\3a\3a\3a\3a\3a\3a\3a\3a\3a\3a\3"= ) + buf.write("a\3b\3b\3b\7b\u0676\nb\fb\16b\u0679\13b\3c\3c\5c\u067d"= ) + buf.write("\nc\3d\3d\5d\u0681\nd\3e\3e\3e\3e\3e\3e\3e\3e\3e\5e\u06= 8c") + buf.write("\ne\3e\3e\3e\3e\5e\u0692\ne\3e\3e\3e\3e\3e\3f\3f\3f\5") + buf.write("f\u069c\nf\3f\3f\3f\3f\3f\5f\u06a3\nf\3f\3f\3f\3f\3f\3"= ) + buf.write("f\5f\u06ab\nf\3g\3g\3g\7g\u06b0\ng\fg\16g\u06b3\13g\3") + buf.write("h\3h\3h\3h\3h\3h\3h\3h\3h\5h\u06be\nh\3i\3i\3i\3i\3i\3"= ) + buf.write("i\3i\3i\3i\5i\u06c9\ni\3i\5i\u06cc\ni\3i\3i\3i\3i\3j\3"= ) + buf.write("j\3j\7j\u06d5\nj\fj\16j\u06d8\13j\3k\3k\5k\u06dc\nk\3") + buf.write("l\3l\3l\3l\3l\3l\3l\3l\5l\u06e6\nl\3l\3l\3l\3l\5l\u06ec= ") + buf.write("\nl\3l\3l\3l\3l\3l\3l\3l\3l\3l\3l\3l\3l\3m\3m\3m\7m\u06= fd") + buf.write("\nm\fm\16m\u0700\13m\3n\3n\3n\5n\u0705\nn\3o\3o\3o\3o") + buf.write("\3o\3o\3o\3o\5o\u070f\no\3o\3o\3o\3o\5o\u0715\no\3o\3") + buf.write("o\3o\3o\3o\3o\3o\3o\3o\3o\3o\3o\5o\u0723\no\3o\3o\3o\3"= ) + buf.write("o\3p\3p\3p\7p\u072c\np\fp\16p\u072f\13p\3q\3q\5q\u0733"= ) + buf.write("\nq\3r\3r\3r\3r\3r\3r\3r\5r\u073c\nr\3r\3r\3r\3r\3r\5") + buf.write("r\u0743\nr\3r\3r\3r\3r\3s\3s\3s\7s\u074c\ns\fs\16s\u074= f") + buf.write("\13s\3t\3t\3t\3t\5t\u0755\nt\3u\3u\3u\3u\3u\3u\3u\3u\5"= ) + buf.write("u\u075f\nu\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3"= ) buf.write("u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3"= ) buf.write("u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3"= ) buf.write("u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3"= ) - buf.write("u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\3u\5u\u07a7\nu\3u\7"= ) - buf.write("u\u07aa\nu\fu\16u\u07ad\13u\5u\u07af\nu\3u\3u\3u\3v\3") - buf.write("v\3v\3v\3v\3v\3v\3v\3v\3v\3v\3v\5v\u07c0\nv\3v\3v\3v\3"= ) - buf.write("v\5v\u07c6\nv\3w\3w\3w\7w\u07cb\nw\fw\16w\u07ce\13w\3") - buf.write("x\3x\3y\3y\3y\3y\3y\3y\3y\3y\5y\u07da\ny\3y\3y\3y\3y\3"= ) + buf.write("u\3u\3u\3u\3u\5u\u07aa\nu\3u\7u\u07ad\nu\fu\16u\u07b0") + buf.write("\13u\5u\u07b2\nu\3u\3u\3u\3v\3v\3v\3v\3v\3v\3v\3v\3v\3"= ) + buf.write("v\3v\3v\5v\u07c3\nv\3v\3v\3v\3v\5v\u07c9\nv\3w\3w\3w\7"= ) + buf.write("w\u07ce\nw\fw\16w\u07d1\13w\3x\3x\3y\3y\3y\3y\3y\3y\3") + buf.write("y\3y\5y\u07dd\ny\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3"= ) buf.write("y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3"= ) buf.write("y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3"= ) buf.write("y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3"= ) - buf.write("y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y\5y\u0825\n"= ) - buf.write("y\3y\7y\u0828\ny\fy\16y\u082b\13y\5y\u082d\ny\3y\3y\3") - buf.write("y\3z\3z\3z\3z\3z\3z\3z\3z\3z\3z\3z\3z\5z\u083e\nz\3z\3"= ) - buf.write("z\3z\3z\5z\u0844\nz\3{\3{\3{\7{\u0849\n{\f{\16{\u084c") - buf.write("\13{\3|\3|\3}\3}\3}\3}\5}\u0854\n}\3~\3~\3~\3~\3~\3\177= ") - buf.write("\3\177\3\u0080\3\u0080\3\u0081\3\u0081\3\u0081\3\u0081"= ) - buf.write("\3\u0081\3\u0081\5\u0081\u0865\n\u0081\3\u0082\3\u0082"= ) - buf.write("\3\u0082\3\u0082\5\u0082\u086b\n\u0082\3\u0083\3\u0083"= ) - buf.write("\3\u0083\3\u0083\7\u0083\u0871\n\u0083\f\u0083\16\u0083= ") - buf.write("\u0874\13\u0083\3\u0083\3\u0083\3\u0083\3\u0084\3\u0084= ") - buf.write("\3\u0084\3\u0084\3\u0084\3\u0084\7\u0084\u087f\n\u0084"= ) - buf.write("\f\u0084\16\u0084\u0882\13\u0084\3\u0084\3\u0084\5\u008= 4") - buf.write("\u0886\n\u0084\3\u0084\3\u0084\3\u0084\3\u0085\3\u0085"= ) - buf.write("\3\u0085\3\u0085\3\u0085\3\u0085\7\u0085\u0891\n\u0085"= ) - buf.write("\f\u0085\16\u0085\u0894\13\u0085\3\u0085\3\u0085\5\u008= 5") - buf.write("\u0898\n\u0085\3\u0085\3\u0085\3\u0085\3\u0086\3\u0086"= ) - buf.write("\3\u0086\3\u0086\3\u0086\3\u0086\7\u0086\u08a3\n\u0086"= ) - buf.write("\f\u0086\16\u0086\u08a6\13\u0086\3\u0086\3\u0086\5\u008= 6") - buf.write("\u08aa\n\u0086\3\u0086\3\u0086\3\u0086\7\u0086\u08af\n"= ) - buf.write("\u0086\f\u0086\16\u0086\u08b2\13\u0086\3\u0086\3\u0086"= ) - buf.write("\3\u0086\3\u0087\3\u0087\3\u0087\3\u0087\3\u0087\3\u008= 7") - buf.write("\7\u0087\u08bd\n\u0087\f\u0087\16\u0087\u08c0\13\u0087"= ) - buf.write("\3\u0087\3\u0087\5\u0087\u08c4\n\u0087\3\u0087\3\u0087"= ) - buf.write("\3\u0087\7\u0087\u08c9\n\u0087\f\u0087\16\u0087\u08cc") - buf.write("\13\u0087\3\u0087\3\u0087\3\u0087\3\u0088\3\u0088\3\u00= 88") + buf.write("y\3y\3y\3y\3y\3y\3y\5y\u0828\ny\3y\7y\u082b\ny\fy\16y") + buf.write("\u082e\13y\5y\u0830\ny\3y\3y\3y\3z\3z\3z\3z\3z\3z\3z\3"= ) + buf.write("z\3z\3z\3z\3z\5z\u0841\nz\3z\3z\3z\3z\5z\u0847\nz\3{\3"= ) + buf.write("{\3{\7{\u084c\n{\f{\16{\u084f\13{\3|\3|\3}\3}\3}\3}\5") + buf.write("}\u0857\n}\3~\3~\3~\3~\3~\3\177\3\177\3\u0080\3\u0080") + buf.write("\3\u0081\3\u0081\3\u0081\3\u0081\3\u0081\3\u0081\5\u008= 1") + buf.write("\u0868\n\u0081\3\u0082\3\u0082\3\u0082\3\u0082\5\u0082"= ) + buf.write("\u086e\n\u0082\3\u0083\3\u0083\3\u0083\3\u0083\7\u0083"= ) + buf.write("\u0874\n\u0083\f\u0083\16\u0083\u0877\13\u0083\3\u0083"= ) + buf.write("\3\u0083\3\u0083\3\u0084\3\u0084\3\u0084\3\u0084\3\u008= 4") + buf.write("\3\u0084\7\u0084\u0882\n\u0084\f\u0084\16\u0084\u0885") + buf.write("\13\u0084\3\u0084\3\u0084\5\u0084\u0889\n\u0084\3\u0084= ") + buf.write("\3\u0084\3\u0084\3\u0085\3\u0085\3\u0085\3\u0085\3\u008= 5") + buf.write("\3\u0085\7\u0085\u0894\n\u0085\f\u0085\16\u0085\u0897") + buf.write("\13\u0085\3\u0085\3\u0085\5\u0085\u089b\n\u0085\3\u0085= ") + buf.write("\3\u0085\3\u0085\3\u0086\3\u0086\3\u0086\3\u0086\3\u008= 6") + buf.write("\3\u0086\7\u0086\u08a6\n\u0086\f\u0086\16\u0086\u08a9") + buf.write("\13\u0086\3\u0086\3\u0086\5\u0086\u08ad\n\u0086\3\u0086= ") + buf.write("\3\u0086\3\u0086\7\u0086\u08b2\n\u0086\f\u0086\16\u0086= ") + buf.write("\u08b5\13\u0086\3\u0086\3\u0086\3\u0086\3\u0087\3\u0087= ") + buf.write("\3\u0087\3\u0087\3\u0087\3\u0087\7\u0087\u08c0\n\u0087"= ) + buf.write("\f\u0087\16\u0087\u08c3\13\u0087\3\u0087\3\u0087\5\u008= 7") + buf.write("\u08c7\n\u0087\3\u0087\3\u0087\3\u0087\7\u0087\u08cc\n"= ) + buf.write("\u0087\f\u0087\16\u0087\u08cf\13\u0087\3\u0087\3\u0087"= ) + buf.write("\3\u0087\3\u0088\3\u0088\3\u0088\3\u0088\3\u0088\3\u008= 8") buf.write("\3\u0088\3\u0088\3\u0088\3\u0088\3\u0088\3\u0088\3\u008= 8") - buf.write("\3\u0088\3\u0088\3\u0088\7\u0088\u08de\n\u0088\f\u0088"= ) - buf.write("\16\u0088\u08e1\13\u0088\3\u0088\3\u0088\5\u0088\u08e5"= ) - buf.write("\n\u0088\3\u0088\3\u0088\3\u0088\3\u0088\3\u0089\3\u008= 9") - buf.write("\3\u0089\5\u0089\u08ee\n\u0089\3\u008a\3\u008a\3\u008a"= ) - buf.write("\3\u008a\3\u008a\3\u008a\3\u008a\3\u008a\3\u008a\3\u008= a") + buf.write("\7\u0088\u08e1\n\u0088\f\u0088\16\u0088\u08e4\13\u0088"= ) + buf.write("\3\u0088\3\u0088\5\u0088\u08e8\n\u0088\3\u0088\3\u0088"= ) + buf.write("\3\u0088\3\u0088\3\u0089\3\u0089\3\u0089\5\u0089\u08f1"= ) + buf.write("\n\u0089\3\u008a\3\u008a\3\u008a\3\u008a\3\u008a\3\u008= a") + buf.write("\3\u008a\3\u008a\3\u008a\3\u008a\3\u008b\3\u008b\3\u008= b") buf.write("\3\u008b\3\u008b\3\u008b\3\u008b\3\u008b\3\u008b\3\u008= b") buf.write("\3\u008b\3\u008b\3\u008b\3\u008b\3\u008b\3\u008b\3\u008= b") - buf.write("\3\u008b\3\u008b\3\u008b\3\u008b\3\u008b\3\u008b\3\u008= b") - buf.write("\5\u008b\u090f\n\u008b\3\u008b\3\u008b\3\u008c\3\u008c"= ) + buf.write("\3\u008b\3\u008b\3\u008b\3\u008b\5\u008b\u0912\n\u008b"= ) + buf.write("\3\u008b\3\u008b\3\u008c\3\u008c\3\u008c\3\u008c\3\u008= c") buf.write("\3\u008c\3\u008c\3\u008c\3\u008c\3\u008c\3\u008c\3\u008= c") buf.write("\3\u008c\3\u008c\3\u008c\3\u008c\3\u008c\3\u008c\3\u008= c") buf.write("\3\u008c\3\u008c\3\u008c\3\u008c\3\u008c\3\u008c\3\u008= c") - buf.write("\3\u008c\3\u008c\3\u008c\7\u008c\u092d\n\u008c\f\u008c"= ) - buf.write("\16\u008c\u0930\13\u008c\5\u008c\u0932\n\u008c\3\u008c"= ) - buf.write("\3\u008c\3\u008c\3\u008c\5\u008c\u0938\n\u008c\3\u008c"= ) - buf.write("\3\u008c\3\u008d\3\u008d\3\u008d\3\u008d\3\u008e\3\u008= e") - buf.write("\5\u008e\u0942\n\u008e\3\u008e\3\u008e\3\u008e\3\u008e"= ) + buf.write("\7\u008c\u0930\n\u008c\f\u008c\16\u008c\u0933\13\u008c"= ) + buf.write("\5\u008c\u0935\n\u008c\3\u008c\3\u008c\3\u008c\3\u008c"= ) + buf.write("\5\u008c\u093b\n\u008c\3\u008c\3\u008c\3\u008d\3\u008d"= ) + buf.write("\3\u008d\3\u008d\3\u008e\3\u008e\5\u008e\u0945\n\u008e"= ) + buf.write("\3\u008e\3\u008e\3\u008e\3\u008e\3\u008e\3\u008e\3\u008= e") buf.write("\3\u008e\3\u008e\3\u008e\3\u008e\3\u008e\3\u008e\3\u008= e") - buf.write("\3\u008e\3\u008e\3\u008e\3\u008e\3\u008e\3\u008e\5\u008= e") - buf.write("\u0955\n\u008e\3\u008f\3\u008f\3\u008f\3\u008f\3\u008f"= ) - buf.write("\3\u008f\3\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008= f") - buf.write("\u0962\n\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f"= ) - buf.write("\u0968\n\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f"= ) - buf.write("\u096e\n\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f"= ) - buf.write("\u0974\n\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f"= ) - buf.write("\u097a\n\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f"= ) - buf.write("\u0980\n\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f"= ) - buf.write("\u0986\n\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f"= ) - buf.write("\u098c\n\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f"= ) - buf.write("\u0992\n\u008f\3\u008f\3\u008f\3\u008f\3\u008f\5\u008f"= ) - buf.write("\u0998\n\u008f\5\u008f\u099a\n\u008f\3\u008f\7\u008f\u0= 99d") - buf.write("\n\u008f\f\u008f\16\u008f\u09a0\13\u008f\5\u008f\u09a2"= ) - buf.write("\n\u008f\3\u008f\3\u008f\7\u008f\u09a6\n\u008f\f\u008f"= ) - buf.write("\16\u008f\u09a9\13\u008f\3\u008f\5\u008f\u09ac\n\u008f"= ) - buf.write("\3\u008f\3\u008f\3\u0090\3\u0090\3\u0090\3\u0090\3\u009= 0") - buf.write("\5\u0090\u09b5\n\u0090\3\u0090\3\u0090\7\u0090\u09b9\n"= ) - buf.write("\u0090\f\u0090\16\u0090\u09bc\13\u0090\3\u0090\3\u0090"= ) - buf.write("\3\u0090\3\u0091\3\u0091\3\u0091\3\u0092\3\u0092\3\u009= 3") - buf.write("\3\u0093\3\u0093\7\u0093\u09c9\n\u0093\f\u0093\16\u0093= ") - buf.write("\u09cc\13\u0093\3\u0094\3\u0094\3\u0094\7\u0094\u09d1") - buf.write("\n\u0094\f\u0094\16\u0094\u09d4\13\u0094\3\u0095\3\u009= 5") - buf.write("\3\u0095\7\u0095\u09d9\n\u0095\f\u0095\16\u0095\u09dc") - buf.write("\13\u0095\3\u0096\3\u0096\3\u0096\7\u0096\u09e1\n\u0096= ") - buf.write("\f\u0096\16\u0096\u09e4\13\u0096\3\u0097\3\u0097\3\u009= 7") - buf.write("\7\u0097\u09e9\n\u0097\f\u0097\16\u0097\u09ec\13\u0097"= ) - buf.write("\3\u0098\3\u0098\7\u0098\u09f0\n\u0098\f\u0098\16\u0098= ") - buf.write("\u09f3\13\u0098\3\u0099\3\u0099\3\u0099\3\u0099\5\u0099= ") - buf.write("\u09f9\n\u0099\3\u009a\3\u009a\7\u009a\u09fd\n\u009a\f"= ) - buf.write("\u009a\16\u009a\u0a00\13\u009a\3\u009b\3\u009b\3\u009b"= ) - buf.write("\3\u009b\3\u009b\3\u009b\3\u009b\3\u009b\5\u009b\u0a0a"= ) - buf.write("\n\u009b\3\u009c\3\u009c\7\u009c\u0a0e\n\u009c\f\u009c"= ) - buf.write("\16\u009c\u0a11\13\u009c\3\u009d\3\u009d\3\u009d\3\u009= d") - buf.write("\5\u009d\u0a17\n\u009d\3\u009e\3\u009e\7\u009e\u0a1b\n"= ) - buf.write("\u009e\f\u009e\16\u009e\u0a1e\13\u009e\3\u009f\3\u009f"= ) - buf.write("\3\u009f\3\u009f\5\u009f\u0a24\n\u009f\3\u00a0\3\u00a0"= ) - buf.write("\7\u00a0\u0a28\n\u00a0\f\u00a0\16\u00a0\u0a2b\13\u00a0"= ) - buf.write("\3\u00a1\3\u00a1\3\u00a1\3\u00a1\3\u00a1\3\u00a1\5\u00a= 1") - buf.write("\u0a33\n\u00a1\3\u00a2\3\u00a2\3\u00a2\7\u00a2\u0a38\n"= ) - buf.write("\u00a2\f\u00a2\16\u00a2\u0a3b\13\u00a2\3\u00a2\3\u00a2"= ) - buf.write("\3\u00a3\3\u00a3\3\u00a3\3\u00a3\3\u00a3\3\u00a3\3\u00a= 3") - buf.write("\3\u00a3\3\u00a3\3\u00a3\3\u00a3\3\u00a3\5\u00a3\u0a4b"= ) - buf.write("\n\u00a3\3\u00a4\3\u00a4\3\u00a4\3\u00a4\3\u00a4\3\u00a= 4") - buf.write("\3\u00a4\3\u00a5\3\u00a5\3\u00a5\3\u00a5\3\u00a5\3\u00a= 5") - buf.write("\3\u00a5\3\u00a6\3\u00a6\3\u00a6\3\u00a6\3\u00a6\3\u00a= 6") - buf.write("\3\u00a6\3\u00a6\3\u00a6\3\u00a7\3\u00a7\3\u00a7\3\u00a= 7") - buf.write("\3\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a= 8") - buf.write("\3\u00a8\3\u00a8\3\u00a8\3\u00a8\5\u00a8\u0a73\n\u00a8"= ) - buf.write("\3\u00a9\3\u00a9\3\u00aa\3\u00aa\3\u00aa\3\u00aa\3\u00a= a") - buf.write("\3\u00aa\3\u00aa\3\u00aa\3\u00aa\3\u00aa\3\u00aa\3\u00a= a") - buf.write("\3\u00aa\3\u00aa\3\u00aa\5\u00aa\u0a86\n\u00aa\3\u00ab"= ) + buf.write("\3\u008e\3\u008e\3\u008e\5\u008e\u0958\n\u008e\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\3\u008f\3\u008f\3\u008f\3\u008= f") + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u0965\n\u008f\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u096b\n\u008f\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u0971\n\u008f\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u0977\n\u008f\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u097d\n\u008f\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u0983\n\u008f\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u0989\n\u008f\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u098f\n\u008f\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u0995\n\u008f\3\u008f"= ) + buf.write("\3\u008f\3\u008f\3\u008f\5\u008f\u099b\n\u008f\5\u008f"= ) + buf.write("\u099d\n\u008f\3\u008f\7\u008f\u09a0\n\u008f\f\u008f\16= ") + buf.write("\u008f\u09a3\13\u008f\5\u008f\u09a5\n\u008f\3\u008f\3") + buf.write("\u008f\7\u008f\u09a9\n\u008f\f\u008f\16\u008f\u09ac\13"= ) + buf.write("\u008f\3\u008f\5\u008f\u09af\n\u008f\3\u008f\3\u008f\3"= ) + buf.write("\u0090\3\u0090\3\u0090\3\u0090\3\u0090\5\u0090\u09b8\n"= ) + buf.write("\u0090\3\u0090\3\u0090\7\u0090\u09bc\n\u0090\f\u0090\16= ") + buf.write("\u0090\u09bf\13\u0090\3\u0090\3\u0090\3\u0090\3\u0091") + buf.write("\3\u0091\3\u0091\3\u0092\3\u0092\3\u0093\3\u0093\3\u009= 3") + buf.write("\7\u0093\u09cc\n\u0093\f\u0093\16\u0093\u09cf\13\u0093"= ) + buf.write("\3\u0094\3\u0094\3\u0094\7\u0094\u09d4\n\u0094\f\u0094"= ) + buf.write("\16\u0094\u09d7\13\u0094\3\u0095\3\u0095\3\u0095\7\u009= 5") + buf.write("\u09dc\n\u0095\f\u0095\16\u0095\u09df\13\u0095\3\u0096"= ) + buf.write("\3\u0096\3\u0096\7\u0096\u09e4\n\u0096\f\u0096\16\u0096= ") + buf.write("\u09e7\13\u0096\3\u0097\3\u0097\3\u0097\7\u0097\u09ec") + buf.write("\n\u0097\f\u0097\16\u0097\u09ef\13\u0097\3\u0098\3\u009= 8") + buf.write("\7\u0098\u09f3\n\u0098\f\u0098\16\u0098\u09f6\13\u0098"= ) + buf.write("\3\u0099\3\u0099\3\u0099\3\u0099\5\u0099\u09fc\n\u0099"= ) + buf.write("\3\u009a\3\u009a\7\u009a\u0a00\n\u009a\f\u009a\16\u009a= ") + buf.write("\u0a03\13\u009a\3\u009b\3\u009b\3\u009b\3\u009b\3\u009b= ") + buf.write("\3\u009b\3\u009b\3\u009b\5\u009b\u0a0d\n\u009b\3\u009c"= ) + buf.write("\3\u009c\7\u009c\u0a11\n\u009c\f\u009c\16\u009c\u0a14") + buf.write("\13\u009c\3\u009d\3\u009d\3\u009d\3\u009d\5\u009d\u0a1a= ") + buf.write("\n\u009d\3\u009e\3\u009e\7\u009e\u0a1e\n\u009e\f\u009e"= ) + buf.write("\16\u009e\u0a21\13\u009e\3\u009f\3\u009f\3\u009f\3\u009= f") + buf.write("\5\u009f\u0a27\n\u009f\3\u00a0\3\u00a0\7\u00a0\u0a2b\n"= ) + buf.write("\u00a0\f\u00a0\16\u00a0\u0a2e\13\u00a0\3\u00a1\3\u00a1"= ) + buf.write("\3\u00a1\3\u00a1\3\u00a1\3\u00a1\5\u00a1\u0a36\n\u00a1"= ) + buf.write("\3\u00a2\7\u00a2\u0a39\n\u00a2\f\u00a2\16\u00a2\u0a3c") + buf.write("\13\u00a2\3\u00a2\3\u00a2\3\u00a3\3\u00a3\3\u00a3\3\u00= a3") + buf.write("\3\u00a4\3\u00a4\3\u00a4\3\u00a4\3\u00a4\3\u00a4\3\u00a= 4") + buf.write("\3\u00a4\3\u00a4\3\u00a4\3\u00a4\5\u00a4\u0a4f\n\u00a4"= ) + buf.write("\3\u00a5\3\u00a5\3\u00a5\3\u00a5\3\u00a5\3\u00a5\3\u00a= 5") + buf.write("\3\u00a6\3\u00a6\3\u00a6\3\u00a6\3\u00a6\3\u00a6\3\u00a= 6") + buf.write("\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a= 7") + buf.write("\3\u00a7\3\u00a7\3\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a= 9") + buf.write("\3\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00a= 9") + buf.write("\3\u00a9\3\u00a9\3\u00a9\5\u00a9\u0a77\n\u00a9\3\u00aa"= ) + buf.write("\3\u00aa\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00a= b") buf.write("\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00a= b") - buf.write("\3\u00ab\3\u00ab\3\u00ab\3\u00ab\5\u00ab\u0a94\n\u00ab"= ) + buf.write("\3\u00ab\3\u00ab\5\u00ab\u0a8a\n\u00ab\3\u00ac\3\u00ac"= ) buf.write("\3\u00ac\3\u00ac\3\u00ac\3\u00ac\3\u00ac\3\u00ac\3\u00a= c") - buf.write("\3\u00ac\3\u00ac\3\u00ac\3\u00ac\3\u00ac\5\u00ac\u0aa2"= ) - buf.write("\n\u00ac\3\u00ad\3\u00ad\3\u00ad\3\u00ad\6\u00ad\u0aa8"= ) - buf.write("\n\u00ad\r\u00ad\16\u00ad\u0aa9\3\u00ae\3\u00ae\3\u00ae= ") - buf.write("\3\u00ae\3\u00ae\3\u00ae\3\u00ae\7\u00ae\u0ab3\n\u00ae"= ) - buf.write("\f\u00ae\16\u00ae\u0ab6\13\u00ae\5\u00ae\u0ab8\n\u00ae"= ) - buf.write("\3\u00af\3\u00af\3\u00af\3\u00af\5\u00af\u0abe\n\u00af"= ) - buf.write("\3\u00b0\3\u00b0\3\u00b0\3\u00b0\3\u00b0\3\u00b1\3\u00b= 1") - buf.write("\3\u00b1\3\u00b1\3\u00b1\3\u00b2\3\u00b2\3\u00b2\3\u00b= 2") - buf.write("\3\u00b2\3\u00b2\3\u00b2\5\u00b2\u0ad1\n\u00b2\3\u00b2"= ) - buf.write("\3\u00b2\3\u00b3\3\u00b3\3\u00b4\3\u00b4\3\u00b4\3\u00b= 4") - buf.write("\3\u00b4\3\u00b5\3\u00b5\3\u00b6\3\u00b6\3\u00b6\3\u00b= 6") - buf.write("\3\u00b6\3\u00b6\3\u00b6\5\u00b6\u0ae5\n\u00b6\3\u00b6"= ) - buf.write("\3\u00b6\3\u00b7\3\u00b7\3\u00b8\3\u00b8\3\u00b8\3\u00b= 8") - buf.write("\3\u00b8\3\u00b8\3\u00b8\3\u00b8\3\u00b8\3\u00b8\5\u00b= 8") - buf.write("\u0af5\n\u00b8\3\u00b9\3\u00b9\3\u00b9\3\u00b9\3\u00b9"= ) - buf.write("\3\u00ba\3\u00ba\3\u00ba\3\u00ba\3\u00ba\3\u00bb\3\u00b= b") - buf.write("\3\u00bb\3\u00bb\3\u00bb\3\u00bb\3\u00bb\3\u00bb\3\u00b= b") - buf.write("\5\u00bb\u0b0a\n\u00bb\3\u00bb\3\u00bb\3\u00bb\3\u00bb"= ) - buf.write("\3\u00bb\5\u00bb\u0b11\n\u00bb\3\u00bb\3\u00bb\3\u00bb"= ) - buf.write("\3\u00bc\3\u00bc\3\u00bc\3\u00bc\3\u00bc\3\u00bd\3\u00b= d") - buf.write("\3\u00bd\3\u00bd\3\u00bd\3\u00be\3\u00be\3\u00be\3\u00b= e") - buf.write("\3\u00be\5\u00be\u0b25\n\u00be\3\u00be\3\u00be\3\u00be"= ) - buf.write("\3\u00be\3\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00c= 0") - buf.write("\3\u00c0\3\u00c0\3\u00c0\3\u00c0\3\u00c1\3\u00c1\3\u00c= 1") - buf.write("\3\u00c1\3\u00c1\3\u00c2\3\u00c2\3\u00c2\3\u00c2\3\u00c= 2") - buf.write("\3\u00c2\3\u00c2\5\u00c2\u0b41\n\u00c2\3\u00c2\3\u00c2"= ) - buf.write("\3\u00c2\3\u00c2\3\u00c3\3\u00c3\3\u00c3\3\u00c3\3\u00c= 3") - buf.write("\5\u00c3\u0b4c\n\u00c3\3\u00c4\3\u00c4\3\u00c4\3\u00c4"= ) - buf.write("\3\u00c4\3\u00c4\3\u00c4\3\u00c4\3\u00c4\3\u00c5\3\u00c= 5") - buf.write("\3\u00c5\3\u00c5\3\u00c5\7\u00c5\u0b5c\n\u00c5\f\u00c5"= ) - buf.write("\16\u00c5\u0b5f\13\u00c5\3\u00c5\3\u00c5\3\u00c5\3\u00c= 5") - buf.write("\3\u00c5\3\u00c5\3\u00c5\3\u00c5\3\u00c6\3\u00c6\3\u00c= 7") - buf.write("\3\u00c7\3\u00c7\3\u00c7\3\u00c7\3\u00c7\3\u00c7\3\u00c= 7") - buf.write("\3\u00c7\3\u00c8\3\u00c8\3\u00c8\3\u00c8\3\u00c8\3\u00c= 8") - buf.write("\3\u00c8\3\u00c8\3\u00c8\3\u00c9\3\u00c9\3\u00c9\3\u00c= 9") - buf.write("\3\u00c9\3\u00c9\3\u00c9\7\u00c9\u0b84\n\u00c9\f\u00c9"= ) - buf.write("\16\u00c9\u0b87\13\u00c9\3\u00c9\3\u00c9\3\u00c9\3\u00c= 9") - buf.write("\3\u00c9\3\u00c9\3\u00c9\3\u00c9\3\u00ca\3\u00ca\3\u00c= b") - buf.write("\3\u00cb\3\u00cb\3\u00cb\3\u00cb\3\u00cb\3\u00cb\3\u00c= b") - buf.write("\3\u00cb\7\u00cb\u0b9c\n\u00cb\f\u00cb\16\u00cb\u0b9f") - buf.write("\13\u00cb\3\u00cb\3\u00cb\3\u00cb\2\2\u00cc\2\4\6\b\n") - buf.write("\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<") - buf.write(">@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz|~\u0080\u0082\u0084\u0= 086") - buf.write("\u0088\u008a\u008c\u008e\u0090\u0092\u0094\u0096\u0098"= ) - buf.write("\u009a\u009c\u009e\u00a0\u00a2\u00a4\u00a6\u00a8\u00aa"= ) - buf.write("\u00ac\u00ae\u00b0\u00b2\u00b4\u00b6\u00b8\u00ba\u00bc"= ) - buf.write("\u00be\u00c0\u00c2\u00c4\u00c6\u00c8\u00ca\u00cc\u00ce"= ) - buf.write("\u00d0\u00d2\u00d4\u00d6\u00d8\u00da\u00dc\u00de\u00e0"= ) - buf.write("\u00e2\u00e4\u00e6\u00e8\u00ea\u00ec\u00ee\u00f0\u00f2"= ) - buf.write("\u00f4\u00f6\u00f8\u00fa\u00fc\u00fe\u0100\u0102\u0104"= ) - buf.write("\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116"= ) - buf.write("\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128"= ) - buf.write("\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0138\u013a"= ) - buf.write("\u013c\u013e\u0140\u0142\u0144\u0146\u0148\u014a\u014c"= ) - buf.write("\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e"= ) - buf.write("\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170"= ) - buf.write("\u0172\u0174\u0176\u0178\u017a\u017c\u017e\u0180\u0182"= ) - buf.write("\u0184\u0186\u0188\u018a\u018c\u018e\u0190\u0192\u0194"= ) + buf.write("\3\u00ac\3\u00ac\3\u00ac\5\u00ac\u0a98\n\u00ac\3\u00ad"= ) + buf.write("\3\u00ad\3\u00ad\3\u00ad\3\u00ad\3\u00ad\3\u00ad\3\u00a= d") + buf.write("\3\u00ad\3\u00ad\3\u00ad\3\u00ad\5\u00ad\u0aa6\n\u00ad"= ) + buf.write("\3\u00ae\3\u00ae\3\u00ae\3\u00ae\6\u00ae\u0aac\n\u00ae"= ) + buf.write("\r\u00ae\16\u00ae\u0aad\3\u00af\3\u00af\3\u00af\3\u00af= ") + buf.write("\3\u00af\3\u00af\3\u00af\7\u00af\u0ab7\n\u00af\f\u00af"= ) + buf.write("\16\u00af\u0aba\13\u00af\5\u00af\u0abc\n\u00af\3\u00b0"= ) + buf.write("\3\u00b0\3\u00b0\3\u00b0\5\u00b0\u0ac2\n\u00b0\3\u00b1"= ) + buf.write("\3\u00b1\3\u00b1\3\u00b1\3\u00b1\3\u00b2\3\u00b2\3\u00b= 2") + buf.write("\3\u00b2\3\u00b2\3\u00b3\3\u00b3\3\u00b3\3\u00b3\3\u00b= 3") + buf.write("\3\u00b3\3\u00b3\5\u00b3\u0ad5\n\u00b3\3\u00b3\3\u00b3"= ) + buf.write("\3\u00b4\3\u00b4\3\u00b5\3\u00b5\3\u00b5\3\u00b5\3\u00b= 5") + buf.write("\3\u00b6\3\u00b6\3\u00b7\3\u00b7\3\u00b7\3\u00b7\3\u00b= 7") + buf.write("\3\u00b7\3\u00b7\5\u00b7\u0ae9\n\u00b7\3\u00b7\3\u00b7"= ) + buf.write("\3\u00b8\3\u00b8\3\u00b9\3\u00b9\3\u00b9\3\u00b9\3\u00b= 9") + buf.write("\3\u00b9\3\u00b9\3\u00b9\3\u00b9\3\u00b9\5\u00b9\u0af9"= ) + buf.write("\n\u00b9\3\u00ba\3\u00ba\3\u00ba\3\u00ba\3\u00ba\3\u00b= b") + buf.write("\3\u00bb\3\u00bb\3\u00bb\3\u00bb\3\u00bc\3\u00bc\3\u00b= c") + buf.write("\3\u00bc\3\u00bc\3\u00bc\3\u00bc\3\u00bc\3\u00bc\5\u00b= c") + buf.write("\u0b0e\n\u00bc\3\u00bc\3\u00bc\3\u00bc\3\u00bc\3\u00bc"= ) + buf.write("\5\u00bc\u0b15\n\u00bc\3\u00bc\3\u00bc\3\u00bc\3\u00bd"= ) + buf.write("\3\u00bd\3\u00bd\3\u00bd\3\u00bd\3\u00be\3\u00be\3\u00b= e") + buf.write("\3\u00be\3\u00be\3\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00b= f") + buf.write("\5\u00bf\u0b29\n\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00bf"= ) + buf.write("\3\u00c0\3\u00c0\3\u00c0\3\u00c0\3\u00c0\3\u00c1\3\u00c= 1") + buf.write("\3\u00c1\3\u00c1\3\u00c1\3\u00c2\3\u00c2\3\u00c2\3\u00c= 2") + buf.write("\3\u00c2\3\u00c3\3\u00c3\3\u00c3\3\u00c3\3\u00c3\3\u00c= 3") + buf.write("\3\u00c3\5\u00c3\u0b45\n\u00c3\3\u00c3\3\u00c3\3\u00c3"= ) + buf.write("\3\u00c3\3\u00c4\3\u00c4\3\u00c4\3\u00c4\3\u00c4\5\u00c= 4") + buf.write("\u0b50\n\u00c4\3\u00c5\3\u00c5\3\u00c5\3\u00c5\3\u00c5"= ) + buf.write("\3\u00c5\3\u00c5\3\u00c5\3\u00c5\3\u00c6\3\u00c6\3\u00c= 6") + buf.write("\3\u00c6\3\u00c6\7\u00c6\u0b60\n\u00c6\f\u00c6\16\u00c6= ") + buf.write("\u0b63\13\u00c6\3\u00c6\3\u00c6\3\u00c6\3\u00c6\3\u00c6= ") + buf.write("\3\u00c6\3\u00c6\3\u00c6\3\u00c7\3\u00c7\3\u00c8\3\u00c= 8") + buf.write("\3\u00c8\3\u00c8\3\u00c8\3\u00c8\3\u00c8\3\u00c8\3\u00c= 8") + buf.write("\3\u00c9\3\u00c9\3\u00c9\3\u00c9\3\u00c9\3\u00c9\3\u00c= 9") + buf.write("\3\u00c9\3\u00c9\3\u00ca\3\u00ca\3\u00ca\3\u00ca\3\u00c= a") + buf.write("\3\u00ca\3\u00ca\7\u00ca\u0b88\n\u00ca\f\u00ca\16\u00ca= ") + buf.write("\u0b8b\13\u00ca\3\u00ca\3\u00ca\3\u00ca\3\u00ca\3\u00ca= ") + buf.write("\3\u00ca\3\u00ca\3\u00ca\3\u00cb\3\u00cb\3\u00cc\3\u00c= c") + buf.write("\3\u00cc\3\u00cc\3\u00cc\3\u00cc\3\u00cc\3\u00cc\3\u00c= c") + buf.write("\7\u00cc\u0ba0\n\u00cc\f\u00cc\16\u00cc\u0ba3\13\u00cc"= ) + buf.write("\3\u00cc\3\u00cc\3\u00cc\2\2\u00cd\2\4\6\b\n\f\16\20\22= ") + buf.write("\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPR") + buf.write("TVXZ\\^`bdfhjlnprtvxz|~\u0080\u0082\u0084\u0086\u0088") + buf.write("\u008a\u008c\u008e\u0090\u0092\u0094\u0096\u0098\u009a"= ) + buf.write("\u009c\u009e\u00a0\u00a2\u00a4\u00a6\u00a8\u00aa\u00ac"= ) + buf.write("\u00ae\u00b0\u00b2\u00b4\u00b6\u00b8\u00ba\u00bc\u00be"= ) + buf.write("\u00c0\u00c2\u00c4\u00c6\u00c8\u00ca\u00cc\u00ce\u00d0"= ) + buf.write("\u00d2\u00d4\u00d6\u00d8\u00da\u00dc\u00de\u00e0\u00e2"= ) + buf.write("\u00e4\u00e6\u00e8\u00ea\u00ec\u00ee\u00f0\u00f2\u00f4"= ) + buf.write("\u00f6\u00f8\u00fa\u00fc\u00fe\u0100\u0102\u0104\u0106"= ) + buf.write("\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118"= ) + buf.write("\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a"= ) + buf.write("\u012c\u012e\u0130\u0132\u0134\u0136\u0138\u013a\u013c"= ) + buf.write("\u013e\u0140\u0142\u0144\u0146\u0148\u014a\u014c\u014e"= ) + buf.write("\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160"= ) + buf.write("\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172"= ) + buf.write("\u0174\u0176\u0178\u017a\u017c\u017e\u0180\u0182\u0184"= ) + buf.write("\u0186\u0188\u018a\u018c\u018e\u0190\u0192\u0194\u0196"= ) buf.write("\2\20\3\2\4\5\4\2\u00ac\u00b2\u00fa\u00fa\4\2\u00b3\u00= b6") buf.write("\u00fa\u00fa\4\2\n\n\u00fa\u00fa\5\2\u00b7\u00b9\u00bd"= ) buf.write("\u00bf\u00fa\u00fa\4\2\u00ba\u00bf\u00fa\u00fa\3\2\u008= 5") buf.write("\u0086\3\2\u008a\u008c\3\2RV\3\2\u00fa\u00fb\3\2\u00ef"= ) buf.write("\u00f2\4\2\u00d3\u00d9\u00fa\u00fa\3\2\u00f6\u00f7\3\2"= ) - buf.write("\u00f8\u00fa\2\u0c6e\2\u019b\3\2\2\2\4\u01a0\3\2\2\2\6"= ) - buf.write("\u01a2\3\2\2\2\b\u01ac\3\2\2\2\n\u01ae\3\2\2\2\f\u01b9"= ) - buf.write("\3\2\2\2\16\u01cb\3\2\2\2\20\u01ec\3\2\2\2\22\u01ef\3") - buf.write("\2\2\2\24\u01f8\3\2\2\2\26\u0201\3\2\2\2\30\u020a\3\2") - buf.write("\2\2\32\u0213\3\2\2\2\34\u021c\3\2\2\2\36\u0225\3\2\2") - buf.write("\2 \u022e\3\2\2\2\"\u0237\3\2\2\2$\u0240\3\2\2\2&\u0249= ") - buf.write("\3\2\2\2(\u0251\3\2\2\2*\u0259\3\2\2\2,\u0261\3\2\2\2") - buf.write(".\u0269\3\2\2\2\60\u0295\3\2\2\2\62\u02a2\3\2\2\2\64\u0= 2aa") - buf.write("\3\2\2\2\66\u02ac\3\2\2\28\u02b1\3\2\2\2:\u02be\3\2\2") - buf.write("\2<\u02c0\3\2\2\2>\u02d1\3\2\2\2@\u02f3\3\2\2\2B\u032d"= ) - buf.write("\3\2\2\2D\u032f\3\2\2\2F\u0348\3\2\2\2H\u034f\3\2\2\2") - buf.write("J\u0356\3\2\2\2L\u0366\3\2\2\2N\u0376\3\2\2\2P\u037b\3"= ) - buf.write("\2\2\2R\u0382\3\2\2\2T\u0391\3\2\2\2V\u03a7\3\2\2\2X\u0= 3b5") - buf.write("\3\2\2\2Z\u03e3\3\2\2\2\\\u03e5\3\2\2\2^\u03ec\3\2\2\2"= ) - buf.write("`\u03f0\3\2\2\2b\u03f2\3\2\2\2d\u03fa\3\2\2\2f\u041e\3"= ) - buf.write("\2\2\2h\u0420\3\2\2\2j\u043f\3\2\2\2l\u0442\3\2\2\2n\u0= 445") - buf.write("\3\2\2\2p\u044f\3\2\2\2r\u0451\3\2\2\2t\u0476\3\2\2\2") - buf.write("v\u0478\3\2\2\2x\u0480\3\2\2\2z\u0482\3\2\2\2|\u04b3\3"= ) - buf.write("\2\2\2~\u04b7\3\2\2\2\u0080\u04b9\3\2\2\2\u0082\u04fe") - buf.write("\3\2\2\2\u0084\u0508\3\2\2\2\u0086\u050a\3\2\2\2\u0088"= ) - buf.write("\u051f\3\2\2\2\u008a\u052c\3\2\2\2\u008c\u052e\3\2\2\2"= ) - buf.write("\u008e\u0549\3\2\2\2\u0090\u0564\3\2\2\2\u0092\u056c\3"= ) - buf.write("\2\2\2\u0094\u0571\3\2\2\2\u0096\u0579\3\2\2\2\u0098\u0= 57e") - buf.write("\3\2\2\2\u009a\u0594\3\2\2\2\u009c\u059e\3\2\2\2\u009e"= ) - buf.write("\u05a8\3\2\2\2\u00a0\u05aa\3\2\2\2\u00a2\u05c0\3\2\2\2"= ) - buf.write("\u00a4\u05d6\3\2\2\2\u00a6\u05e6\3\2\2\2\u00a8\u05ea\3"= ) - buf.write("\2\2\2\u00aa\u05ec\3\2\2\2\u00ac\u060a\3\2\2\2\u00ae\u0= 61d") - buf.write("\3\2\2\2\u00b0\u061f\3\2\2\2\u00b2\u0623\3\2\2\2\u00b4"= ) - buf.write("\u062a\3\2\2\2\u00b6\u062f\3\2\2\2\u00b8\u0633\3\2\2\2"= ) - buf.write("\u00ba\u0635\3\2\2\2\u00bc\u064a\3\2\2\2\u00be\u0658\3"= ) - buf.write("\2\2\2\u00c0\u065a\3\2\2\2\u00c2\u066f\3\2\2\2\u00c4\u0= 679") - buf.write("\3\2\2\2\u00c6\u067d\3\2\2\2\u00c8\u067f\3\2\2\2\u00ca"= ) - buf.write("\u0695\3\2\2\2\u00cc\u06a9\3\2\2\2\u00ce\u06ba\3\2\2\2"= ) - buf.write("\u00d0\u06bc\3\2\2\2\u00d2\u06ce\3\2\2\2\u00d4\u06d8\3"= ) - buf.write("\2\2\2\u00d6\u06da\3\2\2\2\u00d8\u06f6\3\2\2\2\u00da\u0= 701") - buf.write("\3\2\2\2\u00dc\u0703\3\2\2\2\u00de\u0725\3\2\2\2\u00e0"= ) - buf.write("\u072f\3\2\2\2\u00e2\u0731\3\2\2\2\u00e4\u0745\3\2\2\2"= ) - buf.write("\u00e6\u0751\3\2\2\2\u00e8\u0753\3\2\2\2\u00ea\u07b3\3"= ) - buf.write("\2\2\2\u00ec\u07c7\3\2\2\2\u00ee\u07cf\3\2\2\2\u00f0\u0= 7d1") - buf.write("\3\2\2\2\u00f2\u0831\3\2\2\2\u00f4\u0845\3\2\2\2\u00f6"= ) - buf.write("\u084d\3\2\2\2\u00f8\u0853\3\2\2\2\u00fa\u0855\3\2\2\2"= ) - buf.write("\u00fc\u085a\3\2\2\2\u00fe\u085c\3\2\2\2\u0100\u0864\3"= ) - buf.write("\2\2\2\u0102\u086a\3\2\2\2\u0104\u086c\3\2\2\2\u0106\u0= 878") - buf.write("\3\2\2\2\u0108\u088a\3\2\2\2\u010a\u089c\3\2\2\2\u010c"= ) - buf.write("\u08b6\3\2\2\2\u010e\u08d0\3\2\2\2\u0110\u08ed\3\2\2\2"= ) - buf.write("\u0112\u08ef\3\2\2\2\u0114\u08f9\3\2\2\2\u0116\u0912\3"= ) - buf.write("\2\2\2\u0118\u093b\3\2\2\2\u011a\u093f\3\2\2\2\u011c\u0= 956") - buf.write("\3\2\2\2\u011e\u09af\3\2\2\2\u0120\u09c0\3\2\2\2\u0122"= ) - buf.write("\u09c3\3\2\2\2\u0124\u09c5\3\2\2\2\u0126\u09cd\3\2\2\2"= ) - buf.write("\u0128\u09d5\3\2\2\2\u012a\u09dd\3\2\2\2\u012c\u09e5\3"= ) - buf.write("\2\2\2\u012e\u09ed\3\2\2\2\u0130\u09f8\3\2\2\2\u0132\u0= 9fa") - buf.write("\3\2\2\2\u0134\u0a09\3\2\2\2\u0136\u0a0b\3\2\2\2\u0138"= ) - buf.write("\u0a16\3\2\2\2\u013a\u0a18\3\2\2\2\u013c\u0a23\3\2\2\2"= ) - buf.write("\u013e\u0a25\3\2\2\2\u0140\u0a32\3\2\2\2\u0142\u0a39\3"= ) - buf.write("\2\2\2\u0144\u0a4a\3\2\2\2\u0146\u0a4c\3\2\2\2\u0148\u0= a53") - buf.write("\3\2\2\2\u014a\u0a5a\3\2\2\2\u014c\u0a63\3\2\2\2\u014e"= ) - buf.write("\u0a72\3\2\2\2\u0150\u0a74\3\2\2\2\u0152\u0a76\3\2\2\2"= ) - buf.write("\u0154\u0a87\3\2\2\2\u0156\u0a95\3\2\2\2\u0158\u0aa3\3"= ) - buf.write("\2\2\2\u015a\u0ab7\3\2\2\2\u015c\u0ab9\3\2\2\2\u015e\u0= abf") - buf.write("\3\2\2\2\u0160\u0ac4\3\2\2\2\u0162\u0ac9\3\2\2\2\u0164"= ) - buf.write("\u0ad4\3\2\2\2\u0166\u0ad6\3\2\2\2\u0168\u0adb\3\2\2\2"= ) - buf.write("\u016a\u0add\3\2\2\2\u016c\u0ae8\3\2\2\2\u016e\u0af4\3"= ) - buf.write("\2\2\2\u0170\u0af6\3\2\2\2\u0172\u0afb\3\2\2\2\u0174\u0= b00") - buf.write("\3\2\2\2\u0176\u0b15\3\2\2\2\u0178\u0b1a\3\2\2\2\u017a"= ) - buf.write("\u0b1f\3\2\2\2\u017c\u0b2a\3\2\2\2\u017e\u0b2f\3\2\2\2"= ) - buf.write("\u0180\u0b34\3\2\2\2\u0182\u0b39\3\2\2\2\u0184\u0b4b\3"= ) - buf.write("\2\2\2\u0186\u0b4d\3\2\2\2\u0188\u0b56\3\2\2\2\u018a\u0= b68") - buf.write("\3\2\2\2\u018c\u0b6a\3\2\2\2\u018e\u0b73\3\2\2\2\u0190"= ) - buf.write("\u0b7c\3\2\2\2\u0192\u0b90\3\2\2\2\u0194\u0b92\3\2\2\2"= ) - buf.write("\u0196\u019a\5\n\6\2\u0197\u019a\5\f\7\2\u0198\u019a\5"= ) - buf.write("\16\b\2\u0199\u0196\3\2\2\2\u0199\u0197\3\2\2\2\u0199") - buf.write("\u0198\3\2\2\2\u019a\u019d\3\2\2\2\u019b\u0199\3\2\2\2"= ) - buf.write("\u019b\u019c\3\2\2\2\u019c\u019e\3\2\2\2\u019d\u019b\3"= ) - buf.write("\2\2\2\u019e\u019f\5.\30\2\u019f\3\3\2\2\2\u01a0\u01a1"= ) - buf.write("\7\3\2\2\u01a1\5\3\2\2\2\u01a2\u01a5\t\2\2\2\u01a3\u01a= 4") - buf.write("\7!\2\2\u01a4\u01a6\7\u00fb\2\2\u01a5\u01a3\3\2\2\2\u01= a5") - buf.write("\u01a6\3\2\2\2\u01a6\u01a9\3\2\2\2\u01a7\u01a8\7!\2\2") - buf.write("\u01a8\u01aa\7\u00fa\2\2\u01a9\u01a7\3\2\2\2\u01a9\u01a= a") - buf.write("\3\2\2\2\u01aa\7\3\2\2\2\u01ab\u01ad\7\u00fa\2\2\u01ac"= ) - buf.write("\u01ab\3\2\2\2\u01ac\u01ad\3\2\2\2\u01ad\t\3\2\2\2\u01a= e") - buf.write("\u01af\7\6\2\2\u01af\u01b0\7\7\2\2\u01b0\u01b4\7\30\2") - buf.write("\2\u01b1\u01b5\5\4\3\2\u01b2\u01b5\5\6\4\2\u01b3\u01b5"= ) - buf.write("\5\b\5\2\u01b4\u01b1\3\2\2\2\u01b4\u01b2\3\2\2\2\u01b4"= ) - buf.write("\u01b3\3\2\2\2\u01b4\u01b5\3\2\2\2\u01b5\u01b6\3\2\2\2"= ) - buf.write("\u01b6\u01b7\7\31\2\2\u01b7\13\3\2\2\2\u01b8\u01ba\7\u0= 084") - buf.write("\2\2\u01b9\u01b8\3\2\2\2\u01b9\u01ba\3\2\2\2\u01ba\u01b= b") - buf.write("\3\2\2\2\u01bb\u01bd\7P\2\2\u01bc\u01be\7O\2\2\u01bd\u0= 1bc") - buf.write("\3\2\2\2\u01bd\u01be\3\2\2\2\u01be\u01c0\3\2\2\2\u01bf"= ) - buf.write("\u01c1\7\u00fb\2\2\u01c0\u01bf\3\2\2\2\u01c0\u01c1\3\2"= ) - buf.write("\2\2\u01c1\u01c2\3\2\2\2\u01c2\u01c3\7\26\2\2\u01c3\u01= c4") - buf.write("\5\20\t\2\u01c4\u01c6\7\27\2\2\u01c5\u01c7\7\u00fb\2\2"= ) - buf.write("\u01c6\u01c5\3\2\2\2\u01c6\u01c7\3\2\2\2\u01c7\u01c8\3"= ) - buf.write("\2\2\2\u01c8\u01c9\7 \2\2\u01c9\r\3\2\2\2\u01ca\u01cc") - buf.write("\7\u0084\2\2\u01cb\u01ca\3\2\2\2\u01cb\u01cc\3\2\2\2\u0= 1cc") - buf.write("\u01cd\3\2\2\2\u01cd\u01cf\7Q\2\2\u01ce\u01d0\7O\2\2\u0= 1cf") - buf.write("\u01ce\3\2\2\2\u01cf\u01d0\3\2\2\2\u01d0\u01d2\3\2\2\2"= ) - buf.write("\u01d1\u01d3\7\u00fb\2\2\u01d2\u01d1\3\2\2\2\u01d2\u01d= 3") - buf.write("\3\2\2\2\u01d3\u01d4\3\2\2\2\u01d4\u01d5\7\26\2\2\u01d5= ") - buf.write("\u01d6\5\20\t\2\u01d6\u01d8\7\27\2\2\u01d7\u01d9\7\u00f= b") - buf.write("\2\2\u01d8\u01d7\3\2\2\2\u01d8\u01d9\3\2\2\2\u01d9\u01d= a") - buf.write("\3\2\2\2\u01da\u01db\7 \2\2\u01db\17\3\2\2\2\u01dc\u01e= b") - buf.write("\5\22\n\2\u01dd\u01eb\5\24\13\2\u01de\u01eb\5\26\f\2\u0= 1df") - buf.write("\u01eb\5\30\r\2\u01e0\u01eb\5\32\16\2\u01e1\u01eb\5\34"= ) - buf.write("\17\2\u01e2\u01eb\5\36\20\2\u01e3\u01eb\5 \21\2\u01e4") - buf.write("\u01eb\5\"\22\2\u01e5\u01eb\5$\23\2\u01e6\u01eb\5&\24") - buf.write("\2\u01e7\u01eb\5(\25\2\u01e8\u01eb\5*\26\2\u01e9\u01eb"= ) - buf.write("\5,\27\2\u01ea\u01dc\3\2\2\2\u01ea\u01dd\3\2\2\2\u01ea"= ) - buf.write("\u01de\3\2\2\2\u01ea\u01df\3\2\2\2\u01ea\u01e0\3\2\2\2"= ) - buf.write("\u01ea\u01e1\3\2\2\2\u01ea\u01e2\3\2\2\2\u01ea\u01e3\3"= ) - buf.write("\2\2\2\u01ea\u01e4\3\2\2\2\u01ea\u01e5\3\2\2\2\u01ea\u0= 1e6") - buf.write("\3\2\2\2\u01ea\u01e7\3\2\2\2\u01ea\u01e8\3\2\2\2\u01ea"= ) - buf.write("\u01e9\3\2\2\2\u01eb\u01ee\3\2\2\2\u01ec\u01ea\3\2\2\2"= ) - buf.write("\u01ec\u01ed\3\2\2\2\u01ed\21\3\2\2\2\u01ee\u01ec\3\2") - buf.write("\2\2\u01ef\u01f0\7S\2\2\u01f0\u01f4\7\u00fb\2\2\u01f1") - buf.write("\u01f2\7\32\2\2\u01f2\u01f3\7\u00fa\2\2\u01f3\u01f5\7") - buf.write("\33\2\2\u01f4\u01f1\3\2\2\2\u01f4\u01f5\3\2\2\2\u01f5") - buf.write("\u01f6\3\2\2\2\u01f6\u01f7\7 \2\2\u01f7\23\3\2\2\2\u01f= 8") - buf.write("\u01f9\7T\2\2\u01f9\u01fd\7\u00fb\2\2\u01fa\u01fb\7\32"= ) - buf.write("\2\2\u01fb\u01fc\7\u00fa\2\2\u01fc\u01fe\7\33\2\2\u01fd= ") - buf.write("\u01fa\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fe\u01ff\3\2\2\2"= ) - buf.write("\u01ff\u0200\7 \2\2\u0200\25\3\2\2\2\u0201\u0202\7U\2") - buf.write("\2\u0202\u0206\7\u00fb\2\2\u0203\u0204\7\32\2\2\u0204") - buf.write("\u0205\7\u00fa\2\2\u0205\u0207\7\33\2\2\u0206\u0203\3") - buf.write("\2\2\2\u0206\u0207\3\2\2\2\u0207\u0208\3\2\2\2\u0208\u0= 209") - buf.write("\7 \2\2\u0209\27\3\2\2\2\u020a\u020b\7V\2\2\u020b\u020f= ") - buf.write("\7\u00fb\2\2\u020c\u020d\7\32\2\2\u020d\u020e\7\u00fa") - buf.write("\2\2\u020e\u0210\7\33\2\2\u020f\u020c\3\2\2\2\u020f\u02= 10") - buf.write("\3\2\2\2\u0210\u0211\3\2\2\2\u0211\u0212\7 \2\2\u0212") - buf.write("\31\3\2\2\2\u0213\u0214\7R\2\2\u0214\u0218\7\u00fb\2\2"= ) - buf.write("\u0215\u0216\7\32\2\2\u0216\u0217\7\u00fa\2\2\u0217\u02= 19") - buf.write("\7\33\2\2\u0218\u0215\3\2\2\2\u0218\u0219\3\2\2\2\u0219= ") - buf.write("\u021a\3\2\2\2\u021a\u021b\7 \2\2\u021b\33\3\2\2\2\u021= c") - buf.write("\u021d\7W\2\2\u021d\u0221\7\u00fb\2\2\u021e\u021f\7\32"= ) - buf.write("\2\2\u021f\u0220\7\u00fa\2\2\u0220\u0222\7\33\2\2\u0221= ") - buf.write("\u021e\3\2\2\2\u0221\u0222\3\2\2\2\u0222\u0223\3\2\2\2"= ) - buf.write("\u0223\u0224\7 \2\2\u0224\35\3\2\2\2\u0225\u0226\7X\2") - buf.write("\2\u0226\u022a\7\u00fb\2\2\u0227\u0228\7\32\2\2\u0228") - buf.write("\u0229\7\u00fa\2\2\u0229\u022b\7\33\2\2\u022a\u0227\3") - buf.write("\2\2\2\u022a\u022b\3\2\2\2\u022b\u022c\3\2\2\2\u022c\u0= 22d") - buf.write("\7 \2\2\u022d\37\3\2\2\2\u022e\u022f\7Y\2\2\u022f\u0233= ") - buf.write("\7\u00fb\2\2\u0230\u0231\7\32\2\2\u0231\u0232\7\u00fa") - buf.write("\2\2\u0232\u0234\7\33\2\2\u0233\u0230\3\2\2\2\u0233\u02= 34") - buf.write("\3\2\2\2\u0234\u0235\3\2\2\2\u0235\u0236\7 \2\2\u0236") - buf.write("!\3\2\2\2\u0237\u0238\7Z\2\2\u0238\u023c\7\u00fb\2\2\u0= 239") - buf.write("\u023a\7\32\2\2\u023a\u023b\7\u00fa\2\2\u023b\u023d\7") - buf.write("\33\2\2\u023c\u0239\3\2\2\2\u023c\u023d\3\2\2\2\u023d") - buf.write("\u023e\3\2\2\2\u023e\u023f\7 \2\2\u023f#\3\2\2\2\u0240"= ) - buf.write("\u0241\7\u00fb\2\2\u0241\u0245\7\u00fb\2\2\u0242\u0243"= ) - buf.write("\7\32\2\2\u0243\u0244\7\u00fa\2\2\u0244\u0246\7\33\2\2"= ) - buf.write("\u0245\u0242\3\2\2\2\u0245\u0246\3\2\2\2\u0246\u0247\3"= ) - buf.write("\2\2\2\u0247\u0248\7 \2\2\u0248%\3\2\2\2\u0249\u024b\7"= ) - buf.write("S\2\2\u024a\u024c\7\u00fb\2\2\u024b\u024a\3\2\2\2\u024b= ") - buf.write("\u024c\3\2\2\2\u024c\u024d\3\2\2\2\u024d\u024e\7\36\2") - buf.write("\2\u024e\u024f\7\u00fa\2\2\u024f\u0250\7 \2\2\u0250\'") - buf.write("\3\2\2\2\u0251\u0253\7T\2\2\u0252\u0254\7\u00fb\2\2\u02= 53") - buf.write("\u0252\3\2\2\2\u0253\u0254\3\2\2\2\u0254\u0255\3\2\2\2"= ) - buf.write("\u0255\u0256\7\36\2\2\u0256\u0257\7\u00fa\2\2\u0257\u02= 58") - buf.write("\7 \2\2\u0258)\3\2\2\2\u0259\u025b\7U\2\2\u025a\u025c") - buf.write("\7\u00fb\2\2\u025b\u025a\3\2\2\2\u025b\u025c\3\2\2\2\u0= 25c") - buf.write("\u025d\3\2\2\2\u025d\u025e\7\36\2\2\u025e\u025f\7\u00fa= ") - buf.write("\2\2\u025f\u0260\7 \2\2\u0260+\3\2\2\2\u0261\u0263\7V") - buf.write("\2\2\u0262\u0264\7\u00fb\2\2\u0263\u0262\3\2\2\2\u0263"= ) - buf.write("\u0264\3\2\2\2\u0264\u0265\3\2\2\2\u0265\u0266\7\36\2") - buf.write("\2\u0266\u0267\7\u00fa\2\2\u0267\u0268\7 \2\2\u0268-\3"= ) - buf.write("\2\2\2\u0269\u026a\7+\2\2\u026a\u026b\7[\2\2\u026b\u026= c") - buf.write("\7\b\2\2\u026c\u026d\5L\'\2\u026d\u026e\7!\2\2\u026e\u0= 26f") - buf.write("\7.\2\2\u026f\u0270\7\b\2\2\u0270\u0271\7\u00ec\2\2\u02= 71") - buf.write("\u0272\7\30\2\2\u0272\u0273\7\u00fa\2\2\u0273\u0274\7") - buf.write("\31\2\2\u0274\u0275\7!\2\2\u0275\u0276\7=3D\2\2\u0276\u= 0277") - buf.write("\7\b\2\2\u0277\u0278\7\u00ec\2\2\u0278\u0279\7\30\2\2") - buf.write("\u0279\u027a\7\u00fa\2\2\u027a\u027b\7\31\2\2\u027b\u02= 81") - buf.write("\7!\2\2\u027c\u027d\7\u0083\2\2\u027d\u027e\7\b\2\2\u02= 7e") - buf.write("\u027f\5\60\31\2\u027f\u0280\7!\2\2\u0280\u0282\3\2\2") - buf.write("\2\u0281\u027c\3\2\2\2\u0281\u0282\3\2\2\2\u0282\u0288"= ) - buf.write("\3\2\2\2\u0283\u0284\7\u0081\2\2\u0284\u0285\7\b\2\2\u0= 285") - buf.write("\u0286\5\62\32\2\u0286\u0287\7!\2\2\u0287\u0289\3\2\2") - buf.write("\2\u0288\u0283\3\2\2\2\u0288\u0289\3\2\2\2\u0289\u028f"= ) - buf.write("\3\2\2\2\u028a\u028b\7\u0082\2\2\u028b\u028c\7\b\2\2\u0= 28c") - buf.write("\u028d\5\66\34\2\u028d\u028e\7!\2\2\u028e\u0290\3\2\2") - buf.write("\2\u028f\u028a\3\2\2\2\u028f\u0290\3\2\2\2\u0290\u0291"= ) - buf.write("\3\2\2\2\u0291\u0292\58\35\2\u0292\u0293\7-\2\2\u0293") - buf.write("\u0294\7 \2\2\u0294/\3\2\2\2\u0295\u0298\5L\'\2\u0296") - buf.write("\u0297\7(\2\2\u0297\u0299\5L\'\2\u0298\u0296\3\2\2\2\u0= 298") - buf.write("\u0299\3\2\2\2\u0299\u029c\3\2\2\2\u029a\u029b\7(\2\2") - buf.write("\u029b\u029d\5L\'\2\u029c\u029a\3\2\2\2\u029c\u029d\3") - buf.write("\2\2\2\u029d\u02a0\3\2\2\2\u029e\u029f\7(\2\2\u029f\u02= a1") - buf.write("\5L\'\2\u02a0\u029e\3\2\2\2\u02a0\u02a1\3\2\2\2\u02a1") - buf.write("\61\3\2\2\2\u02a2\u02a7\5\64\33\2\u02a3\u02a4\7(\2\2\u0= 2a4") - buf.write("\u02a6\5\64\33\2\u02a5\u02a3\3\2\2\2\u02a6\u02a9\3\2\2"= ) - buf.write("\2\u02a7\u02a5\3\2\2\2\u02a7\u02a8\3\2\2\2\u02a8\63\3") - buf.write("\2\2\2\u02a9\u02a7\3\2\2\2\u02aa\u02ab\t\3\2\2\u02ab\65= ") - buf.write("\3\2\2\2\u02ac\u02ad\t\4\2\2\u02ad\67\3\2\2\2\u02ae\u02= b0") - buf.write("\5:\36\2\u02af\u02ae\3\2\2\2\u02b0\u02b3\3\2\2\2\u02b1"= ) - buf.write("\u02af\3\2\2\2\u02b1\u02b2\3\2\2\2\u02b29\3\2\2\2\u02b3= ") - buf.write("\u02b1\3\2\2\2\u02b4\u02bf\5d\63\2\u02b5\u02bf\5h\65\2"= ) - buf.write("\u02b6\u02bf\5j\66\2\u02b7\u02bf\5> \2\u02b8\u02bf\5@") - buf.write("!\2\u02b9\u02bf\5D#\2\u02ba\u02bf\5<\37\2\u02bb\u02bf") - buf.write("\5F$\2\u02bc\u02bf\5H%\2\u02bd\u02bf\5\u011c\u008f\2\u0= 2be") - buf.write("\u02b4\3\2\2\2\u02be\u02b5\3\2\2\2\u02be\u02b6\3\2\2\2"= ) - buf.write("\u02be\u02b7\3\2\2\2\u02be\u02b8\3\2\2\2\u02be\u02b9\3"= ) - buf.write("\2\2\2\u02be\u02ba\3\2\2\2\u02be\u02bb\3\2\2\2\u02be\u0= 2bc") - buf.write("\3\2\2\2\u02be\u02bd\3\2\2\2\u02bf;\3\2\2\2\u02c0\u02c1= ") - buf.write("\7\u009b\2\2\u02c1\u02c2\7\u00fb\2\2\u02c2\u02c3\7!\2") - buf.write("\2\u02c3\u02c4\7\62\2\2\u02c4\u02c5\7\b\2\2\u02c5\u02c6= ") - buf.write("\7\u00ec\2\2\u02c6\u02c7\7\30\2\2\u02c7\u02c8\7\u00fa") - buf.write("\2\2\u02c8\u02cd\7\31\2\2\u02c9\u02ca\7!\2\2\u02ca\u02c= b") - buf.write("\7\u009c\2\2\u02cb\u02cc\7\b\2\2\u02cc\u02ce\7\u00fa\2"= ) - buf.write("\2\u02cd\u02c9\3\2\2\2\u02cd\u02ce\3\2\2\2\u02ce\u02cf"= ) - buf.write("\3\2\2\2\u02cf\u02d0\7 \2\2\u02d0=3D\3\2\2\2\u02d1\u02e= 2") - buf.write("\7\u009d\2\2\u02d2\u02d3\7\u00fb\2\2\u02d3\u02e3\7!\2") - buf.write("\2\u02d4\u02d5\7V\2\2\u02d5\u02e3\7!\2\2\u02d6\u02d7\7"= ) - buf.write("U\2\2\u02d7\u02e3\7!\2\2\u02d8\u02d9\7T\2\2\u02d9\u02e3= ") - buf.write("\7!\2\2\u02da\u02db\7S\2\2\u02db\u02e3\7!\2\2\u02dc\u02= dd") - buf.write("\7X\2\2\u02dd\u02e3\7!\2\2\u02de\u02df\7Y\2\2\u02df\u02= e3") - buf.write("\7!\2\2\u02e0\u02e1\7Z\2\2\u02e1\u02e3\7!\2\2\u02e2\u02= d2") - buf.write("\3\2\2\2\u02e2\u02d4\3\2\2\2\u02e2\u02d6\3\2\2\2\u02e2"= ) - buf.write("\u02d8\3\2\2\2\u02e2\u02da\3\2\2\2\u02e2\u02dc\3\2\2\2"= ) - buf.write("\u02e2\u02de\3\2\2\2\u02e2\u02e0\3\2\2\2\u02e3\u02e8\3"= ) - buf.write("\2\2\2\u02e4\u02e5\7\u008f\2\2\u02e5\u02e6\7\b\2\2\u02e= 6") - buf.write("\u02e7\7\u00fa\2\2\u02e7\u02e9\7!\2\2\u02e8\u02e4\3\2") - buf.write("\2\2\u02e8\u02e9\3\2\2\2\u02e9\u02ea\3\2\2\2\u02ea\u02e= b") - buf.write("\7\u008e\2\2\u02eb\u02ec\7\b\2\2\u02ec\u02ed\7\u00fb\2"= ) - buf.write("\2\u02ed\u02ee\7!\2\2\u02ee\u02ef\7[\2\2\u02ef\u02f0\7"= ) - buf.write("\b\2\2\u02f0\u02f1\5L\'\2\u02f1\u02f2\7 \2\2\u02f2?\3") - buf.write("\2\2\2\u02f3\u0304\7\u009e\2\2\u02f4\u02f5\7\u00fb\2\2"= ) - buf.write("\u02f5\u0305\7!\2\2\u02f6\u02f7\7V\2\2\u02f7\u0305\7!") - buf.write("\2\2\u02f8\u02f9\7U\2\2\u02f9\u0305\7!\2\2\u02fa\u02fb"= ) - buf.write("\7T\2\2\u02fb\u0305\7!\2\2\u02fc\u02fd\7S\2\2\u02fd\u03= 05") - buf.write("\7!\2\2\u02fe\u02ff\7X\2\2\u02ff\u0305\7!\2\2\u0300\u03= 01") - buf.write("\7Y\2\2\u0301\u0305\7!\2\2\u0302\u0303\7Z\2\2\u0303\u03= 05") - buf.write("\7!\2\2\u0304\u02f4\3\2\2\2\u0304\u02f6\3\2\2\2\u0304") - buf.write("\u02f8\3\2\2\2\u0304\u02fa\3\2\2\2\u0304\u02fc\3\2\2\2"= ) - buf.write("\u0304\u02fe\3\2\2\2\u0304\u0300\3\2\2\2\u0304\u0302\3"= ) - buf.write("\2\2\2\u0305\u030a\3\2\2\2\u0306\u0307\7\u008f\2\2\u030= 7") - buf.write("\u0308\7\b\2\2\u0308\u0309\7\u00fa\2\2\u0309\u030b\7!") - buf.write("\2\2\u030a\u0306\3\2\2\2\u030a\u030b\3\2\2\2\u030b\u030= c") - buf.write("\3\2\2\2\u030c\u030d\7\u009c\2\2\u030d\u030e\7\b\2\2\u0= 30e") - buf.write("\u0313\5B\"\2\u030f\u0310\7(\2\2\u0310\u0312\5B\"\2\u03= 11") - buf.write("\u030f\3\2\2\2\u0312\u0315\3\2\2\2\u0313\u0311\3\2\2\2"= ) - buf.write("\u0313\u0314\3\2\2\2\u0314\u0316\3\2\2\2\u0315\u0313\3"= ) - buf.write("\2\2\2\u0316\u0326\7!\2\2\u0317\u0318\7\u008e\2\2\u0318= ") - buf.write("\u0319\7\b\2\2\u0319\u031a\7\u00fb\2\2\u031a\u0327\7!") - buf.write("\2\2\u031b\u031c\7\u008e\2\2\u031c\u031d\7\b\2\2\u031d"= ) - buf.write("\u031e\7\u00ec\2\2\u031e\u031f\7\30\2\2\u031f\u0320\7") - buf.write("\u00fa\2\2\u0320\u0321\7\31\2\2\u0321\u0322\7!\2\2\u032= 2") - buf.write("\u0323\7\u009f\2\2\u0323\u0324\7\b\2\2\u0324\u0325\7\u0= 0fa") - buf.write("\2\2\u0325\u0327\7!\2\2\u0326\u0317\3\2\2\2\u0326\u031b= ") - buf.write("\3\2\2\2\u0327\u0328\3\2\2\2\u0328\u0329\7[\2\2\u0329") - buf.write("\u032a\7\b\2\2\u032a\u032b\5L\'\2\u032b\u032c\7 \2\2\u0= 32c") - buf.write("A\3\2\2\2\u032d\u032e\7\u00fa\2\2\u032eC\3\2\2\2\u032f"= ) - buf.write("\u0330\7\u00a0\2\2\u0330\u0331\7\u00fb\2\2\u0331\u0336"= ) - buf.write("\7!\2\2\u0332\u0333\7\u008f\2\2\u0333\u0334\7\b\2\2\u03= 34") - buf.write("\u0335\7\u00fa\2\2\u0335\u0337\7!\2\2\u0336\u0332\3\2") - buf.write("\2\2\u0336\u0337\3\2\2\2\u0337\u033f\3\2\2\2\u0338\u033= 9") - buf.write("\7\u008e\2\2\u0339\u033a\7\b\2\2\u033a\u033b\7\u00ec\2"= ) - buf.write("\2\u033b\u033c\7\30\2\2\u033c\u033d\7\u00fa\2\2\u033d") - buf.write("\u033e\7\31\2\2\u033e\u0340\7!\2\2\u033f\u0338\3\2\2\2"= ) - buf.write("\u0340\u0341\3\2\2\2\u0341\u033f\3\2\2\2\u0341\u0342\3"= ) - buf.write("\2\2\2\u0342\u0343\3\2\2\2\u0343\u0344\7[\2\2\u0344\u03= 45") - buf.write("\7\b\2\2\u0345\u0346\5L\'\2\u0346\u0347\7 \2\2\u0347E") - buf.write("\3\2\2\2\u0348\u0349\7l\2\2\u0349\u034a\5\u0124\u0093") - buf.write("\2\u034a\u034b\7 \2\2\u034b\u034c\58\35\2\u034c\u034d") - buf.write("\7s\2\2\u034d\u034e\7 \2\2\u034eG\3\2\2\2\u034f\u0350") - buf.write("\7k\2\2\u0350\u0351\5\u0124\u0093\2\u0351\u0352\7 \2\2"= ) - buf.write("\u0352\u0353\58\35\2\u0353\u0354\7s\2\2\u0354\u0355\7") - buf.write(" \2\2\u0355I\3\2\2\2\u0356\u0357\7\u00fa\2\2\u0357\u035= 8") - buf.write("\7!\2\2\u0358\u0359\7\u00fa\2\2\u0359\u035a\7!\2\2\u035= a") - buf.write("\u035b\7\u00fa\2\2\u035b\u035c\7!\2\2\u035c\u035d\7\u00= fa") - buf.write("\2\2\u035d\u035e\7!\2\2\u035e\u035f\7\u00fa\2\2\u035f") - buf.write("\u0360\7!\2\2\u0360\u0361\7\u00fa\2\2\u0361\u0362\7!\2"= ) - buf.write("\2\u0362\u0363\7\u00fa\2\2\u0363\u0364\7!\2\2\u0364\u03= 65") - buf.write("\7\u00fa\2\2\u0365K\3\2\2\2\u0366\u0367\7\26\2\2\u0367"= ) - buf.write("\u0368\7\u00fa\2\2\u0368\u0369\7!\2\2\u0369\u036a\7\u00= fa") - buf.write("\2\2\u036a\u036b\7!\2\2\u036b\u036c\7\u00fa\2\2\u036c") - buf.write("\u0372\7!\2\2\u036d\u036e\7\26\2\2\u036e\u036f\5J&\2\u0= 36f") - buf.write("\u0370\7\27\2\2\u0370\u0373\3\2\2\2\u0371\u0373\5J&\2") - buf.write("\u0372\u036d\3\2\2\2\u0372\u0371\3\2\2\2\u0373\u0374\3"= ) - buf.write("\2\2\2\u0374\u0375\7\27\2\2\u0375M\3\2\2\2\u0376\u0377"= ) - buf.write("\7\u00ec\2\2\u0377\u0378\7\30\2\2\u0378\u0379\7\u00fa") - buf.write("\2\2\u0379\u037a\7\31\2\2\u037aO\3\2\2\2\u037b\u037c\5"= ) - buf.write("R*\2\u037c\u037d\5T+\2\u037dQ\3\2\2\2\u037e\u037f\7\u00= 8e") - buf.write("\2\2\u037f\u0380\7\b\2\2\u0380\u0381\7\u00fb\2\2\u0381"= ) - buf.write("\u0383\7!\2\2\u0382\u037e\3\2\2\2\u0382\u0383\3\2\2\2") - buf.write("\u0383\u0389\3\2\2\2\u0384\u0385\7\u008f\2\2\u0385\u038= 6") - buf.write("\7\b\2\2\u0386\u0387\5X-\2\u0387\u0388\7!\2\2\u0388\u03= 8a") - buf.write("\3\2\2\2\u0389\u0384\3\2\2\2\u0389\u038a\3\2\2\2\u038a"= ) - buf.write("\u038f\3\2\2\2\u038b\u038c\7\u0091\2\2\u038c\u038d\7\b"= ) - buf.write("\2\2\u038d\u038e\7\u00fa\2\2\u038e\u0390\7!\2\2\u038f") - buf.write("\u038b\3\2\2\2\u038f\u0390\3\2\2\2\u0390S\3\2\2\2\u0391= ") - buf.write("\u0392\7\62\2\2\u0392\u0393\7\b\2\2\u0393\u0394\7\u00ec= ") - buf.write("\2\2\u0394\u0395\7\30\2\2\u0395\u0396\7\u00fa\2\2\u0396= ") - buf.write("\u0397\7\31\2\2\u0397\u0398\7!\2\2\u0398\u0399\7=3D\2\2= ") - buf.write("\u0399\u039a\7\b\2\2\u039a\u039b\7\u00ec\2\2\u039b\u039= c") - buf.write("\7\30\2\2\u039c\u039d\7\u00fa\2\2\u039d\u039e\7\31\2\2"= ) - buf.write("\u039eU\3\2\2\2\u039f\u03a8\7~\2\2\u03a0\u03a8\7y\2\2") - buf.write("\u03a1\u03a8\7{\2\2\u03a2\u03a8\7\u0080\2\2\u03a3\u03a8= ") - buf.write("\7|\2\2\u03a4\u03a8\7\177\2\2\u03a5\u03a8\7z\2\2\u03a6"= ) - buf.write("\u03a8\7}\2\2\u03a7\u039f\3\2\2\2\u03a7\u03a0\3\2\2\2") - buf.write("\u03a7\u03a1\3\2\2\2\u03a7\u03a2\3\2\2\2\u03a7\u03a3\3"= ) - buf.write("\2\2\2\u03a7\u03a4\3\2\2\2\u03a7\u03a5\3\2\2\2\u03a7\u0= 3a6") - buf.write("\3\2\2\2\u03a8W\3\2\2\2\u03a9\u03aa\7\u00fb\2\2\u03aa") - buf.write("\u03ab\7\32\2\2\u03ab\u03ac\7\u00fa\2\2\u03ac\u03b6\7") - buf.write("\33\2\2\u03ad\u03b2\7\u00fb\2\2\u03ae\u03af\7\34\2\2\u0= 3af") - buf.write("\u03b1\5\u015c\u00af\2\u03b0\u03ae\3\2\2\2\u03b1\u03b4"= ) - buf.write("\3\2\2\2\u03b2\u03b0\3\2\2\2\u03b2\u03b3\3\2\2\2\u03b3"= ) - buf.write("\u03b6\3\2\2\2\u03b4\u03b2\3\2\2\2\u03b5\u03a9\3\2\2\2"= ) - buf.write("\u03b5\u03ad\3\2\2\2\u03b6Y\3\2\2\2\u03b7\u03b9\7\35\2"= ) - buf.write("\2\u03b8\u03b7\3\2\2\2\u03b8\u03b9\3\2\2\2\u03b9\u03ba"= ) - buf.write("\3\2\2\2\u03ba\u03e4\7\u00fa\2\2\u03bb\u03e4\7\u00d3\2"= ) - buf.write("\2\u03bc\u03e4\7\u00d4\2\2\u03bd\u03e4\7\u00d5\2\2\u03b= e") - buf.write("\u03e4\7\u00d6\2\2\u03bf\u03e4\7\u00d7\2\2\u03c0\u03c1"= ) - buf.write("\7\u00fa\2\2\u03c1\u03c2\7\36\2\2\u03c2\u03c3\7\u00fa") - buf.write("\2\2\u03c3\u03c4\7\36\2\2\u03c4\u03e4\7\u00fa\2\2\u03c5= ") - buf.write("\u03c6\7\u00fa\2\2\u03c6\u03c7\7\37\2\2\u03c7\u03c8\7") - buf.write("\u00fa\2\2\u03c8\u03c9\7\37\2\2\u03c9\u03e4\7\u00fa\2") - buf.write("\2\u03ca\u03cb\7\u00fa\2\2\u03cb\u03cc\7 \2\2\u03cc\u03= cd") - buf.write("\7\u00fa\2\2\u03cd\u03ce\7 \2\2\u03ce\u03cf\5L\'\2\u03c= f") - buf.write("\u03d0\7 \2\2\u03d0\u03d1\7\u00ec\2\2\u03d1\u03d2\7\30"= ) - buf.write("\2\2\u03d2\u03d3\7\u00fa\2\2\u03d3\u03d4\7\31\2\2\u03d4= ") - buf.write("\u03e4\3\2\2\2\u03d5\u03d6\7\u00ec\2\2\u03d6\u03d7\7\30= ") - buf.write("\2\2\u03d7\u03d8\7\u00fa\2\2\u03d8\u03e4\7\31\2\2\u03d9= ") - buf.write("\u03da\7\26\2\2\u03da\u03df\7\u00fa\2\2\u03db\u03dc\7") - buf.write("!\2\2\u03dc\u03de\7\u00fa\2\2\u03dd\u03db\3\2\2\2\u03de= ") - buf.write("\u03e1\3\2\2\2\u03df\u03dd\3\2\2\2\u03df\u03e0\3\2\2\2"= ) - buf.write("\u03e0\u03e2\3\2\2\2\u03e1\u03df\3\2\2\2\u03e2\u03e4\7"= ) - buf.write("\27\2\2\u03e3\u03b8\3\2\2\2\u03e3\u03bb\3\2\2\2\u03e3") - buf.write("\u03bc\3\2\2\2\u03e3\u03bd\3\2\2\2\u03e3\u03be\3\2\2\2"= ) - buf.write("\u03e3\u03bf\3\2\2\2\u03e3\u03c0\3\2\2\2\u03e3\u03c5\3"= ) - buf.write("\2\2\2\u03e3\u03ca\3\2\2\2\u03e3\u03d5\3\2\2\2\u03e3\u0= 3d9") - buf.write("\3\2\2\2\u03e4[\3\2\2\2\u03e5\u03e6\7\u0092\2\2\u03e6") - buf.write("\u03e7\7\b\2\2\u03e7\u03e8\7\t\2\2\u03e8\u03e9\7\30\2") - buf.write("\2\u03e9\u03ea\7\u00fa\2\2\u03ea\u03eb\7\31\2\2\u03eb") - buf.write("]\3\2\2\2\u03ec\u03ed\7\u0093\2\2\u03ed_\3\2\2\2\u03ee"= ) - buf.write("\u03f1\5\\/\2\u03ef\u03f1\5^\60\2\u03f0\u03ee\3\2\2\2") - buf.write("\u03f0\u03ef\3\2\2\2\u03f1a\3\2\2\2\u03f2\u03f7\5`\61") - buf.write("\2\u03f3\u03f4\7!\2\2\u03f4\u03f6\5`\61\2\u03f5\u03f3") - buf.write("\3\2\2\2\u03f6\u03f9\3\2\2\2\u03f7\u03f5\3\2\2\2\u03f7"= ) - buf.write("\u03f8\3\2\2\2\u03f8c\3\2\2\2\u03f9\u03f7\3\2\2\2\u03fa= ") - buf.write("\u03fb\7\67\2\2\u03fb\u03fc\7/\2\2\u03fc\u03fd\7\b\2\2"= ) - buf.write("\u03fd\u03fe\7\u00fa\2\2\u03fe\u03ff\7!\2\2\u03ff\u0400= ") - buf.write("\7.\2\2\u0400\u0401\7\b\2\2\u0401\u0402\7\u00ec\2\2\u04= 02") - buf.write("\u0403\7\30\2\2\u0403\u0404\7\u00fa\2\2\u0404\u0405\7") - buf.write("\31\2\2\u0405\u0409\7 \2\2\u0406\u0408\5f\64\2\u0407\u0= 406") - buf.write("\3\2\2\2\u0408\u040b\3\2\2\2\u0409\u0407\3\2\2\2\u0409"= ) - buf.write("\u040a\3\2\2\2\u040a\u040c\3\2\2\2\u040b\u0409\3\2\2\2"= ) - buf.write("\u040c\u040d\7\66\2\2\u040d\u040e\7 \2\2\u040ee\3\2\2") - buf.write("\2\u040f\u041f\5j\66\2\u0410\u041f\5l\67\2\u0411\u041f"= ) - buf.write("\5n8\2\u0412\u041f\5\u00a4S\2\u0413\u041f\5p9\2\u0414") - buf.write("\u041f\5\u0088E\2\u0415\u041f\5\u00f8}\2\u0416\u041f\5"= ) - buf.write("\u0118\u008d\2\u0417\u041f\5\u011a\u008e\2\u0418\u041f"= ) - buf.write("\5\u0110\u0089\2\u0419\u041f\5\u011c\u008f\2\u041a\u041= f") - buf.write("\5\u0120\u0091\2\u041b\u041c\5\u0096L\2\u041c\u041d\7") - buf.write(" \2\2\u041d\u041f\3\2\2\2\u041e\u040f\3\2\2\2\u041e\u04= 10") - buf.write("\3\2\2\2\u041e\u0411\3\2\2\2\u041e\u0412\3\2\2\2\u041e"= ) - buf.write("\u0413\3\2\2\2\u041e\u0414\3\2\2\2\u041e\u0415\3\2\2\2"= ) - buf.write("\u041e\u0416\3\2\2\2\u041e\u0417\3\2\2\2\u041e\u0418\3"= ) - buf.write("\2\2\2\u041e\u0419\3\2\2\2\u041e\u041a\3\2\2\2\u041e\u0= 41b") - buf.write("\3\2\2\2\u041fg\3\2\2\2\u0420\u0421\78\2\2\u0421\u0422"= ) - buf.write("\7/\2\2\u0422\u0423\7\b\2\2\u0423\u0424\7\u00fa\2\2\u04= 24") - buf.write("\u0433\7!\2\2\u0425\u0426\79\2\2\u0426\u0427\7\b\2\2\u0= 427") - buf.write("\u0428\7\u00ec\2\2\u0428\u0429\7\30\2\2\u0429\u042a\7") - buf.write("\u00fa\2\2\u042a\u042b\7\31\2\2\u042b\u042c\7 \2\2\u042= c") - buf.write("\u042d\7:\2\2\u042d\u042e\7\b\2\2\u042e\u042f\5L\'\2\u0= 42f") - buf.write("\u0430\7 \2\2\u0430\u0432\3\2\2\2\u0431\u0425\3\2\2\2") - buf.write("\u0432\u0435\3\2\2\2\u0433\u0431\3\2\2\2\u0433\u0434\3"= ) - buf.write("\2\2\2\u0434\u0439\3\2\2\2\u0435\u0433\3\2\2\2\u0436\u0= 438") - buf.write("\5f\64\2\u0437\u0436\3\2\2\2\u0438\u043b\3\2\2\2\u0439"= ) - buf.write("\u0437\3\2\2\2\u0439\u043a\3\2\2\2\u043a\u043c\3\2\2\2"= ) - buf.write("\u043b\u0439\3\2\2\2\u043c\u043d\7\66\2\2\u043d\u043e") - buf.write("\7 \2\2\u043ei\3\2\2\2\u043f\u0440\5\\/\2\u0440\u0441") - buf.write("\7 \2\2\u0441k\3\2\2\2\u0442\u0443\5^\60\2\u0443\u0444"= ) - buf.write("\7 \2\2\u0444m\3\2\2\2\u0445\u0446\7\u0094\2\2\u0446\u0= 447") - buf.write("\7\u00fb\2\2\u0447\u0448\7!\2\2\u0448\u0449\5\u0124\u00= 93") - buf.write("\2\u0449\u044a\7\u0095\2\2\u044a\u044b\7 \2\2\u044bo\3"= ) - buf.write("\2\2\2\u044c\u0450\5r:\2\u044d\u0450\5z>\2\u044e\u0450"= ) - buf.write("\5~@\2\u044f\u044c\3\2\2\2\u044f\u044d\3\2\2\2\u044f\u0= 44e") - buf.write("\3\2\2\2\u0450q\3\2\2\2\u0451\u0452\7;\2\2\u0452\u0453"= ) - buf.write("\7>\2\2\u0453\u0454\7\b\2\2\u0454\u0455\7\u00ec\2\2\u04= 55") - buf.write("\u0456\7\30\2\2\u0456\u0457\7\u00fa\2\2\u0457\u045c\7") - buf.write("\31\2\2\u0458\u0459\7!\2\2\u0459\u045a\7@\2\2\u045a\u04= 5b") - buf.write("\7\b\2\2\u045b\u045d\5v<\2\u045c\u0458\3\2\2\2\u045c\u0= 45d") - buf.write("\3\2\2\2\u045d\u0472\3\2\2\2\u045e\u045f\7!\2\2\u045f") - buf.write("\u0461\5b\62\2\u0460\u045e\3\2\2\2\u0460\u0461\3\2\2\2"= ) - buf.write("\u0461\u0462\3\2\2\2\u0462\u0473\7 \2\2\u0463\u0464\7") - buf.write("!\2\2\u0464\u0466\5b\62\2\u0465\u0463\3\2\2\2\u0465\u04= 66") - buf.write("\3\2\2\2\u0466\u046e\3\2\2\2\u0467\u046b\7!\2\2\u0468") - buf.write("\u046a\5t;\2\u0469\u0468\3\2\2\2\u046a\u046d\3\2\2\2\u0= 46b") - buf.write("\u0469\3\2\2\2\u046b\u046c\3\2\2\2\u046c\u046f\3\2\2\2"= ) - buf.write("\u046d\u046b\3\2\2\2\u046e\u0467\3\2\2\2\u046e\u046f\3"= ) - buf.write("\2\2\2\u046f\u0470\3\2\2\2\u0470\u0471\7<\2\2\u0471\u04= 73") - buf.write("\7 \2\2\u0472\u0460\3\2\2\2\u0472\u0465\3\2\2\2\u0473") - buf.write("s\3\2\2\2\u0474\u0477\5p9\2\u0475\u0477\5\u0088E\2\u047= 6") - buf.write("\u0474\3\2\2\2\u0476\u0475\3\2\2\2\u0477u\3\2\2\2\u0478= ") - buf.write("\u047d\5x=3D\2\u0479\u047a\7(\2\2\u047a\u047c\5x=3D\2\u= 047b") - buf.write("\u0479\3\2\2\2\u047c\u047f\3\2\2\2\u047d\u047b\3\2\2\2"= ) - buf.write("\u047d\u047e\3\2\2\2\u047ew\3\2\2\2\u047f\u047d\3\2\2") - buf.write("\2\u0480\u0481\t\5\2\2\u0481y\3\2\2\2\u0482\u0483\7>\2"= ) - buf.write("\2\u0483\u0484\7=3D\2\2\u0484\u0485\7\b\2\2\u0485\u0486= ") - buf.write("\7\u00ec\2\2\u0486\u0487\7\30\2\2\u0487\u0488\7\u00fa") - buf.write("\2\2\u0488\u0489\7\31\2\2\u0489\u048a\7!\2\2\u048a\u048= b") - buf.write("\7>\2\2\u048b\u048c\7\b\2\2\u048c\u048d\7\u00ec\2\2\u04= 8d") - buf.write("\u048e\7\30\2\2\u048e\u048f\7\u00fa\2\2\u048f\u0497\7") - buf.write("\31\2\2\u0490\u0491\7!\2\2\u0491\u0492\7>\2\2\u0492\u04= 93") - buf.write("\7\b\2\2\u0493\u0494\7\u00ec\2\2\u0494\u0495\7\30\2\2") - buf.write("\u0495\u0496\7\u00fa\2\2\u0496\u0498\7\31\2\2\u0497\u04= 90") - buf.write("\3\2\2\2\u0497\u0498\3\2\2\2\u0498\u04a9\3\2\2\2\u0499"= ) - buf.write("\u049a\7!\2\2\u049a\u049b\7@\2\2\u049b\u049c\7\b\2\2\u0= 49c") - buf.write("\u04a1\5|?\2\u049d\u049e\7(\2\2\u049e\u04a0\5|?\2\u049f= ") - buf.write("\u049d\3\2\2\2\u04a0\u04a3\3\2\2\2\u04a1\u049f\3\2\2\2"= ) - buf.write("\u04a1\u04a2\3\2\2\2\u04a2\u04a4\3\2\2\2\u04a3\u04a1\3"= ) - buf.write("\2\2\2\u04a4\u04a5\7!\2\2\u04a5\u04a6\7t\2\2\u04a6\u04a= 7") - buf.write("\7\b\2\2\u04a7\u04a8\7\u00fa\2\2\u04a8\u04aa\3\2\2\2\u0= 4a9") - buf.write("\u0499\3\2\2\2\u04a9\u04aa\3\2\2\2\u04aa\u04ad\3\2\2\2"= ) - buf.write("\u04ab\u04ac\7!\2\2\u04ac\u04ae\5b\62\2\u04ad\u04ab\3") - buf.write("\2\2\2\u04ad\u04ae\3\2\2\2\u04ae\u04af\3\2\2\2\u04af\u0= 4b0") - buf.write("\7 \2\2\u04b0{\3\2\2\2\u04b1\u04b4\7\u00fa\2\2\u04b2\u0= 4b4") - buf.write("\5V,\2\u04b3\u04b1\3\2\2\2\u04b3\u04b2\3\2\2\2\u04b4}") - buf.write("\3\2\2\2\u04b5\u04b8\5\u0080A\2\u04b6\u04b8\5\u0086D\2"= ) - buf.write("\u04b7\u04b5\3\2\2\2\u04b7\u04b6\3\2\2\2\u04b8\177\3\2"= ) - buf.write("\2\2\u04b9\u04e9\7n\2\2\u04ba\u04bb\7*\2\2\u04bb\u04bc"= ) - buf.write("\7\b\2\2\u04bc\u04bd\7\u00ec\2\2\u04bd\u04be\7\30\2\2") - buf.write("\u04be\u04bf\7\u00fa\2\2\u04bf\u04c0\7\31\2\2\u04c0\u04= c1") - buf.write("\7!\2\2\u04c1\u04c2\7o\2\2\u04c2\u04c3\7\b\2\2\u04c3\u0= 4c4") - buf.write("\5L\'\2\u04c4\u04c5\7!\2\2\u04c5\u04c6\7/\2\2\u04c6\u04= c7") - buf.write("\7\b\2\2\u04c7\u04c8\7\u00fa\2\2\u04c8\u04c9\7!\2\2\u04= c9") - buf.write("\u04ca\7\u0090\2\2\u04ca\u04cb\7\b\2\2\u04cb\u04cc\7\u0= 0fa") - buf.write("\2\2\u04cc\u04cd\7!\2\2\u04cd\u04ea\3\2\2\2\u04ce\u04cf= ") - buf.write("\7o\2\2\u04cf\u04d0\7\b\2\2\u04d0\u04d1\5L\'\2\u04d1\u0= 4d2") - buf.write("\7!\2\2\u04d2\u04d3\7/\2\2\u04d3\u04d4\7\b\2\2\u04d4\u0= 4d5") - buf.write("\7\u00fa\2\2\u04d5\u04d6\7!\2\2\u04d6\u04d7\7\u0090\2") - buf.write("\2\u04d7\u04d8\7\b\2\2\u04d8\u04d9\7\u00fa\2\2\u04d9\u0= 4da") - buf.write("\7!\2\2\u04da\u04ea\3\2\2\2\u04db\u04dc\7/\2\2\u04dc\u0= 4dd") - buf.write("\7\b\2\2\u04dd\u04de\7\u00fa\2\2\u04de\u04df\7!\2\2\u04= df") - buf.write("\u04e0\7\u0090\2\2\u04e0\u04e5\7\b\2\2\u04e1\u04e2\7\u0= 0fb") - buf.write("\2\2\u04e2\u04e6\7!\2\2\u04e3\u04e4\7\u00fa\2\2\u04e4") - buf.write("\u04e6\7!\2\2\u04e5\u04e1\3\2\2\2\u04e5\u04e3\3\2\2\2") - buf.write("\u04e6\u04ea\3\2\2\2\u04e7\u04e8\7\u00fa\2\2\u04e8\u04e= a") - buf.write("\7!\2\2\u04e9\u04ba\3\2\2\2\u04e9\u04ce\3\2\2\2\u04e9") - buf.write("\u04db\3\2\2\2\u04e9\u04e7\3\2\2\2\u04e9\u04ea\3\2\2\2"= ) - buf.write("\u04ea\u04eb\3\2\2\2\u04eb\u04f0\5P)\2\u04ec\u04ed\7!") - buf.write("\2\2\u04ed\u04ee\7@\2\2\u04ee\u04ef\7\b\2\2\u04ef\u04f1= ") - buf.write("\5\u0082B\2\u04f0\u04ec\3\2\2\2\u04f0\u04f1\3\2\2\2\u04= f1") - buf.write("\u04f6\3\2\2\2\u04f2\u04f3\7!\2\2\u04f3\u04f4\7t\2\2\u0= 4f4") - buf.write("\u04f5\7\b\2\2\u04f5\u04f7\7\u00fa\2\2\u04f6\u04f2\3\2"= ) - buf.write("\2\2\u04f6\u04f7\3\2\2\2\u04f7\u04fa\3\2\2\2\u04f8\u04f= 9") - buf.write("\7!\2\2\u04f9\u04fb\5\u00b4[\2\u04fa\u04f8\3\2\2\2\u04f= a") - buf.write("\u04fb\3\2\2\2\u04fb\u04fc\3\2\2\2\u04fc\u04fd\7 \2\2") - buf.write("\u04fd\u0081\3\2\2\2\u04fe\u0503\5\u0084C\2\u04ff\u0500= ") - buf.write("\7(\2\2\u0500\u0502\5\u0084C\2\u0501\u04ff\3\2\2\2\u050= 2") - buf.write("\u0505\3\2\2\2\u0503\u0501\3\2\2\2\u0503\u0504\3\2\2\2"= ) - buf.write("\u0504\u0083\3\2\2\2\u0505\u0503\3\2\2\2\u0506\u0509\7"= ) - buf.write("\u00fa\2\2\u0507\u0509\5V,\2\u0508\u0506\3\2\2\2\u0508"= ) - buf.write("\u0507\3\2\2\2\u0509\u0085\3\2\2\2\u050a\u050b\7\u0099"= ) - buf.write("\2\2\u050b\u050c\7\u009b\2\2\u050c\u050d\7\b\2\2\u050d"= ) - buf.write("\u050e\7\u00fb\2\2\u050e\u050f\7!\2\2\u050f\u0510\5T+") - buf.write("\2\u0510\u0514\7!\2\2\u0511\u0512\5b\62\2\u0512\u0513") - buf.write("\7!\2\2\u0513\u0515\3\2\2\2\u0514\u0511\3\2\2\2\u0514") - buf.write("\u0515\3\2\2\2\u0515\u0516\3\2\2\2\u0516\u0517\7\u009a"= ) - buf.write("\2\2\u0517\u0518\7 \2\2\u0518\u0087\3\2\2\2\u0519\u0520= ") - buf.write("\5\u00b8]\2\u051a\u0520\5\u00e8u\2\u051b\u0520\5\u00c6"= ) - buf.write("d\2\u051c\u0520\5\u00d4k\2\u051d\u0520\5\u00e2r\2\u051e= ") - buf.write("\u0520\5\u00f0y\2\u051f\u0519\3\2\2\2\u051f\u051a\3\2") - buf.write("\2\2\u051f\u051b\3\2\2\2\u051f\u051c\3\2\2\2\u051f\u051= d") - buf.write("\3\2\2\2\u051f\u051e\3\2\2\2\u0520\u0089\3\2\2\2\u0521"= ) - buf.write("\u0522\5`\61\2\u0522\u0523\7!\2\2\u0523\u052d\3\2\2\2") - buf.write("\u0524\u052d\5\u008cG\2\u0525\u052d\5\u008eH\2\u0526\u0= 52d") - buf.write("\5\u0090I\2\u0527\u052d\5\u0092J\2\u0528\u052d\5\u0094"= ) - buf.write("K\2\u0529\u052d\5\u011c\u008f\2\u052a\u052d\5\u0096L\2"= ) - buf.write("\u052b\u052d\5\u0098M\2\u052c\u0521\3\2\2\2\u052c\u0524= ") - buf.write("\3\2\2\2\u052c\u0525\3\2\2\2\u052c\u0526\3\2\2\2\u052c"= ) - buf.write("\u0527\3\2\2\2\u052c\u0528\3\2\2\2\u052c\u0529\3\2\2\2"= ) - buf.write("\u052c\u052a\3\2\2\2\u052c\u052b\3\2\2\2\u052d\u008b\3"= ) - buf.write("\2\2\2\u052e\u052f\7p\2\2\u052f\u0530\7\62\2\2\u0530\u0= 531") - buf.write("\7\b\2\2\u0531\u0532\7\u00ec\2\2\u0532\u0533\7\30\2\2") - buf.write("\u0533\u0534\7\u00fa\2\2\u0534\u0535\7\31\2\2\u0535\u05= 42") - buf.write("\7!\2\2\u0536\u0537\7@\2\2\u0537\u0538\7\b\2\2\u0538\u0= 53d") - buf.write("\5\u009eP\2\u0539\u053a\7(\2\2\u053a\u053c\5\u009eP\2") - buf.write("\u053b\u0539\3\2\2\2\u053c\u053f\3\2\2\2\u053d\u053b\3"= ) - buf.write("\2\2\2\u053d\u053e\3\2\2\2\u053e\u0540\3\2\2\2\u053f\u0= 53d") - buf.write("\3\2\2\2\u0540\u0541\7!\2\2\u0541\u0543\3\2\2\2\u0542") - buf.write("\u0536\3\2\2\2\u0542\u0543\3\2\2\2\u0543\u0544\3\2\2\2"= ) - buf.write("\u0544\u0545\5\u0124\u0093\2\u0545\u0547\7s\2\2\u0546") - buf.write("\u0548\7 \2\2\u0547\u0546\3\2\2\2\u0547\u0548\3\2\2\2") - buf.write("\u0548\u008d\3\2\2\2\u0549\u054a\7r\2\2\u054a\u054b\7") - buf.write("\62\2\2\u054b\u054c\7\b\2\2\u054c\u054d\7\u00ec\2\2\u05= 4d") - buf.write("\u054e\7\30\2\2\u054e\u054f\7\u00fa\2\2\u054f\u0550\7") - buf.write("\31\2\2\u0550\u055d\7!\2\2\u0551\u0552\7@\2\2\u0552\u05= 53") - buf.write("\7\b\2\2\u0553\u0558\5\u009eP\2\u0554\u0555\7(\2\2\u055= 5") - buf.write("\u0557\5\u009eP\2\u0556\u0554\3\2\2\2\u0557\u055a\3\2") - buf.write("\2\2\u0558\u0556\3\2\2\2\u0558\u0559\3\2\2\2\u0559\u055= b") - buf.write("\3\2\2\2\u055a\u0558\3\2\2\2\u055b\u055c\7!\2\2\u055c") - buf.write("\u055e\3\2\2\2\u055d\u0551\3\2\2\2\u055d\u055e\3\2\2\2"= ) - buf.write("\u055e\u055f\3\2\2\2\u055f\u0560\5\u0124\u0093\2\u0560"= ) - buf.write("\u0562\7s\2\2\u0561\u0563\7 \2\2\u0562\u0561\3\2\2\2\u0= 562") - buf.write("\u0563\3\2\2\2\u0563\u008f\3\2\2\2\u0564\u0565\7l\2\2") - buf.write("\u0565\u0566\5\u0124\u0093\2\u0566\u0567\7 \2\2\u0567") - buf.write("\u0568\5\u00b4[\2\u0568\u056a\7s\2\2\u0569\u056b\7 \2") - buf.write("\2\u056a\u0569\3\2\2\2\u056a\u056b\3\2\2\2\u056b\u0091"= ) - buf.write("\3\2\2\2\u056c\u056d\7\u00a4\2\2\u056d\u056e\7\u00a5\2"= ) - buf.write("\2\u056e\u056f\7\b\2\2\u056f\u0570\7\u00fa\2\2\u0570\u0= 093") - buf.write("\3\2\2\2\u0571\u0572\7\u00a6\2\2\u0572\u0573\7\b\2\2\u0= 573") - buf.write("\u0574\7\u00ec\2\2\u0574\u0575\7\30\2\2\u0575\u0576\7") - buf.write("\u00fa\2\2\u0576\u0577\7\31\2\2\u0577\u0578\7!\2\2\u057= 8") - buf.write("\u0095\3\2\2\2\u0579\u057a\7\u00eb\2\2\u057a\u057b\7\b"= ) - buf.write("\2\2\u057b\u057c\5L\'\2\u057c\u057d\7!\2\2\u057d\u0097"= ) - buf.write("\3\2\2\2\u057e\u057f\7q\2\2\u057f\u0580\7\62\2\2\u0580"= ) - buf.write("\u0581\7\b\2\2\u0581\u0582\7\u00ec\2\2\u0582\u0583\7\30= ") - buf.write("\2\2\u0583\u0584\7\u00fa\2\2\u0584\u0585\7\31\2\2\u0585= ") - buf.write("\u058a\7!\2\2\u0586\u0587\7M\2\2\u0587\u0588\7\b\2\2\u0= 588") - buf.write("\u0589\7\u00fa\2\2\u0589\u058b\7!\2\2\u058a\u0586\3\2") - buf.write("\2\2\u058a\u058b\3\2\2\2\u058b\u058c\3\2\2\2\u058c\u058= d") - buf.write("\5\u0124\u0093\2\u058d\u058f\7s\2\2\u058e\u0590\7 \2\2"= ) - buf.write("\u058f\u058e\3\2\2\2\u058f\u0590\3\2\2\2\u0590\u0099\3"= ) - buf.write("\2\2\2\u0591\u0593\5\u008aF\2\u0592\u0591\3\2\2\2\u0593= ") - buf.write("\u0596\3\2\2\2\u0594\u0592\3\2\2\2\u0594\u0595\3\2\2\2"= ) - buf.write("\u0595\u009b\3\2\2\2\u0596\u0594\3\2\2\2\u0597\u059f\5"= ) - buf.write("\u00a0Q\2\u0598\u059f\5\u00a2R\2\u0599\u059f\5\u00a6T") - buf.write("\2\u059a\u059f\5\u00a4S\2\u059b\u059f\5\u00a8U\2\u059c"= ) - buf.write("\u059f\5\u00b0Y\2\u059d\u059f\5\u00b2Z\2\u059e\u0597\3"= ) - buf.write("\2\2\2\u059e\u0598\3\2\2\2\u059e\u0599\3\2\2\2\u059e\u0= 59a") - buf.write("\3\2\2\2\u059e\u059b\3\2\2\2\u059e\u059c\3\2\2\2\u059e"= ) - buf.write("\u059d\3\2\2\2\u059f\u009d\3\2\2\2\u05a0\u05a9\7\u00fa"= ) - buf.write("\2\2\u05a1\u05a9\7y\2\2\u05a2\u05a9\7v\2\2\u05a3\u05a9"= ) - buf.write("\7u\2\2\u05a4\u05a9\7{\2\2\u05a5\u05a9\7|\2\2\u05a6\u05= a9") - buf.write("\7z\2\2\u05a7\u05a9\7}\2\2\u05a8\u05a0\3\2\2\2\u05a8\u0= 5a1") - buf.write("\3\2\2\2\u05a8\u05a2\3\2\2\2\u05a8\u05a3\3\2\2\2\u05a8"= ) - buf.write("\u05a4\3\2\2\2\u05a8\u05a5\3\2\2\2\u05a8\u05a6\3\2\2\2"= ) - buf.write("\u05a8\u05a7\3\2\2\2\u05a9\u009f\3\2\2\2\u05aa\u05ab\7"= ) - buf.write("k\2\2\u05ab\u05ac\5\u0124\u0093\2\u05ac\u05b9\7 \2\2\u0= 5ad") - buf.write("\u05ae\7@\2\2\u05ae\u05af\7\b\2\2\u05af\u05b4\5\u009e") - buf.write("P\2\u05b0\u05b1\7(\2\2\u05b1\u05b3\5\u009eP\2\u05b2\u05= b0") - buf.write("\3\2\2\2\u05b3\u05b6\3\2\2\2\u05b4\u05b2\3\2\2\2\u05b4"= ) - buf.write("\u05b5\3\2\2\2\u05b5\u05b7\3\2\2\2\u05b6\u05b4\3\2\2\2"= ) - buf.write("\u05b7\u05b8\7!\2\2\u05b8\u05ba\3\2\2\2\u05b9\u05ad\3") - buf.write("\2\2\2\u05b9\u05ba\3\2\2\2\u05ba\u05bb\3\2\2\2\u05bb\u0= 5bc") - buf.write("\5\u00b4[\2\u05bc\u05be\7s\2\2\u05bd\u05bf\7 \2\2\u05be= ") - buf.write("\u05bd\3\2\2\2\u05be\u05bf\3\2\2\2\u05bf\u00a1\3\2\2\2"= ) - buf.write("\u05c0\u05c1\7K\2\2\u05c1\u05c2\5\u0124\u0093\2\u05c2") - buf.write("\u05cf\7 \2\2\u05c3\u05c4\7@\2\2\u05c4\u05c5\7\b\2\2\u0= 5c5") - buf.write("\u05ca\5\u009eP\2\u05c6\u05c7\7(\2\2\u05c7\u05c9\5\u009= e") - buf.write("P\2\u05c8\u05c6\3\2\2\2\u05c9\u05cc\3\2\2\2\u05ca\u05c8= ") - buf.write("\3\2\2\2\u05ca\u05cb\3\2\2\2\u05cb\u05cd\3\2\2\2\u05cc"= ) - buf.write("\u05ca\3\2\2\2\u05cd\u05ce\7!\2\2\u05ce\u05d0\3\2\2\2") - buf.write("\u05cf\u05c3\3\2\2\2\u05cf\u05d0\3\2\2\2\u05d0\u05d1\3"= ) - buf.write("\2\2\2\u05d1\u05d2\5\u00b4[\2\u05d2\u05d4\7s\2\2\u05d3"= ) - buf.write("\u05d5\7 \2\2\u05d4\u05d3\3\2\2\2\u05d4\u05d5\3\2\2\2") - buf.write("\u05d5\u00a3\3\2\2\2\u05d6\u05de\7c\2\2\u05d7\u05d8\5") - buf.write("\u00a6T\2\u05d8\u05d9\7!\2\2\u05d9\u05df\3\2\2\2\u05da"= ) - buf.write("\u05db\7\b\2\2\u05db\u05dc\5Z.\2\u05dc\u05dd\7!\2\2\u05= dd") - buf.write("\u05df\3\2\2\2\u05de\u05d7\3\2\2\2\u05de\u05da\3\2\2\2"= ) - buf.write("\u05df\u05e4\3\2\2\2\u05e0\u05e1\7\u009b\2\2\u05e1\u05e= 2") - buf.write("\7\b\2\2\u05e2\u05e3\7\u00fb\2\2\u05e3\u05e5\7!\2\2\u05= e4") - buf.write("\u05e0\3\2\2\2\u05e4\u05e5\3\2\2\2\u05e5\u00a5\3\2\2\2"= ) - buf.write("\u05e6\u05e7\7\u0096\2\2\u05e7\u05e8\7\b\2\2\u05e8\u05e= 9") - buf.write("\5\u0124\u0093\2\u05e9\u00a7\3\2\2\2\u05ea\u05eb\5\u00a= a") - buf.write("V\2\u05eb\u00a9\3\2\2\2\u05ec\u05ed\7?\2\2\u05ed\u05ee"= ) - buf.write("\7>\2\2\u05ee\u05ef\7\b\2\2\u05ef\u05f0\7\u00ec\2\2\u05= f0") - buf.write("\u05f1\7\30\2\2\u05f1\u05f2\7\u00fa\2\2\u05f2\u05f3\7") - buf.write("\31\2\2\u05f3\u05f4\7!\2\2\u05f4\u05f5\7\u0096\2\2\u05f= 5") - buf.write("\u05f6\7\b\2\2\u05f6\u05f7\5Z.\2\u05f7\u05f8\7!\2\2\u05= f8") - buf.write("\u05f9\7@\2\2\u05f9\u05fa\7\b\2\2\u05fa\u05ff\5\u00ac") - buf.write("W\2\u05fb\u05fc\7!\2\2\u05fc\u05fd\7t\2\2\u05fd\u05fe") - buf.write("\7\b\2\2\u05fe\u0600\7\u00fa\2\2\u05ff\u05fb\3\2\2\2\u0= 5ff") - buf.write("\u0600\3\2\2\2\u0600\u0605\3\2\2\2\u0601\u0602\7!\2\2") - buf.write("\u0602\u0604\5\\/\2\u0603\u0601\3\2\2\2\u0604\u0607\3") - buf.write("\2\2\2\u0605\u0603\3\2\2\2\u0605\u0606\3\2\2\2\u0606\u0= 608") - buf.write("\3\2\2\2\u0607\u0605\3\2\2\2\u0608\u0609\7 \2\2\u0609") - buf.write("\u00ab\3\2\2\2\u060a\u060f\5\u00aeX\2\u060b\u060c\7(\2"= ) - buf.write("\2\u060c\u060e\5\u00aeX\2\u060d\u060b\3\2\2\2\u060e\u06= 11") - buf.write("\3\2\2\2\u060f\u060d\3\2\2\2\u060f\u0610\3\2\2\2\u0610"= ) - buf.write("\u00ad\3\2\2\2\u0611\u060f\3\2\2\2\u0612\u061e\7\u00fa"= ) - buf.write("\2\2\u0613\u061e\7\u00ed\2\2\u0614\u061e\7\u00ee\2\2\u0= 615") - buf.write("\u061e\7y\2\2\u0616\u061e\7{\2\2\u0617\u061e\7\u0080\2"= ) - buf.write("\2\u0618\u061e\7|\2\2\u0619\u061e\7v\2\2\u061a\u061e\7"= ) - buf.write("u\2\2\u061b\u061e\7z\2\2\u061c\u061e\7}\2\2\u061d\u0612= ") - buf.write("\3\2\2\2\u061d\u0613\3\2\2\2\u061d\u0614\3\2\2\2\u061d"= ) - buf.write("\u0615\3\2\2\2\u061d\u0616\3\2\2\2\u061d\u0617\3\2\2\2"= ) - buf.write("\u061d\u0618\3\2\2\2\u061d\u0619\3\2\2\2\u061d\u061a\3"= ) - buf.write("\2\2\2\u061d\u061b\3\2\2\2\u061d\u061c\3\2\2\2\u061e\u0= 0af") - buf.write("\3\2\2\2\u061f\u0620\7\u0097\2\2\u0620\u0621\5\u0124\u0= 093") - buf.write("\2\u0621\u0622\7 \2\2\u0622\u00b1\3\2\2\2\u0623\u0624") - buf.write("\7\u0098\2\2\u0624\u0625\5\u0124\u0093\2\u0625\u0626\7"= ) - buf.write(" \2\2\u0626\u00b3\3\2\2\2\u0627\u0629\5\u00b6\\\2\u0628= ") - buf.write("\u0627\3\2\2\2\u0629\u062c\3\2\2\2\u062a\u0628\3\2\2\2"= ) - buf.write("\u062a\u062b\3\2\2\2\u062b\u00b5\3\2\2\2\u062c\u062a\3"= ) - buf.write("\2\2\2\u062d\u0630\5\u008aF\2\u062e\u0630\5\u009cO\2\u0= 62f") - buf.write("\u062d\3\2\2\2\u062f\u062e\3\2\2\2\u0630\u00b7\3\2\2\2"= ) - buf.write("\u0631\u0634\5\u00ba^\2\u0632\u0634\5\u00c0a\2\u0633\u0= 631") - buf.write("\3\2\2\2\u0633\u0632\3\2\2\2\u0634\u00b9\3\2\2\2\u0635"= ) - buf.write("\u0636\7\\\2\2\u0636\u0637\5R*\2\u0637\u0638\5T+\2\u063= 8") - buf.write("\u063e\7!\2\2\u0639\u063a\7@\2\2\u063a\u063b\7\b\2\2\u0= 63b") - buf.write("\u063c\5\u00bc_\2\u063c\u063d\7!\2\2\u063d\u063f\3\2\2"= ) - buf.write("\2\u063e\u0639\3\2\2\2\u063e\u063f\3\2\2\2\u063f\u0644"= ) - buf.write("\3\2\2\2\u0640\u0641\7t\2\2\u0641\u0642\7\b\2\2\u0642") - buf.write("\u0643\7\u00fa\2\2\u0643\u0645\7!\2\2\u0644\u0640\3\2") - buf.write("\2\2\u0644\u0645\3\2\2\2\u0645\u0646\3\2\2\2\u0646\u064= 7") - buf.write("\5\u00b4[\2\u0647\u0648\7]\2\2\u0648\u0649\7 \2\2\u0649= ") - buf.write("\u00bb\3\2\2\2\u064a\u064f\5\u00be`\2\u064b\u064c\7(\2"= ) - buf.write("\2\u064c\u064e\5\u00be`\2\u064d\u064b\3\2\2\2\u064e\u06= 51") - buf.write("\3\2\2\2\u064f\u064d\3\2\2\2\u064f\u0650\3\2\2\2\u0650"= ) - buf.write("\u00bd\3\2\2\2\u0651\u064f\3\2\2\2\u0652\u0659\7\u00fa"= ) - buf.write("\2\2\u0653\u0659\7u\2\2\u0654\u0659\7v\2\2\u0655\u0659"= ) - buf.write("\7w\2\2\u0656\u0659\7x\2\2\u0657\u0659\5V,\2\u0658\u065= 2") - buf.write("\3\2\2\2\u0658\u0653\3\2\2\2\u0658\u0654\3\2\2\2\u0658"= ) - buf.write("\u0655\3\2\2\2\u0658\u0656\3\2\2\2\u0658\u0657\3\2\2\2"= ) - buf.write("\u0659\u00bf\3\2\2\2\u065a\u065b\7\u00a1\2\2\u065b\u065= c") - buf.write("\5P)\2\u065c\u0662\7!\2\2\u065d\u065e\7@\2\2\u065e\u065= f") - buf.write("\7\b\2\2\u065f\u0660\5\u00c2b\2\u0660\u0661\7!\2\2\u066= 1") - buf.write("\u0663\3\2\2\2\u0662\u065d\3\2\2\2\u0662\u0663\3\2\2\2"= ) - buf.write("\u0663\u0664\3\2\2\2\u0664\u0665\7\u00a2\2\2\u0665\u066= 6") - buf.write("\7\b\2\2\u0666\u0667\7\u00ec\2\2\u0667\u0668\7\30\2\2") - buf.write("\u0668\u0669\7\u00fa\2\2\u0669\u066a\7\31\2\2\u066a\u06= 6b") - buf.write("\7!\2\2\u066b\u066c\5\u009aN\2\u066c\u066d\7\u00a3\2\2"= ) - buf.write("\u066d\u066e\7 \2\2\u066e\u00c1\3\2\2\2\u066f\u0674\5") - buf.write("\u00c4c\2\u0670\u0671\7(\2\2\u0671\u0673\5\u00c4c\2\u06= 72") - buf.write("\u0670\3\2\2\2\u0673\u0676\3\2\2\2\u0674\u0672\3\2\2\2"= ) - buf.write("\u0674\u0675\3\2\2\2\u0675\u00c3\3\2\2\2\u0676\u0674\3"= ) - buf.write("\2\2\2\u0677\u067a\7\u00fa\2\2\u0678\u067a\5V,\2\u0679"= ) - buf.write("\u0677\3\2\2\2\u0679\u0678\3\2\2\2\u067a\u00c5\3\2\2\2"= ) - buf.write("\u067b\u067e\5\u00c8e\2\u067c\u067e\5\u00d0i\2\u067d\u0= 67b") - buf.write("\3\2\2\2\u067d\u067c\3\2\2\2\u067e\u00c7\3\2\2\2\u067f"= ) - buf.write("\u0680\7^\2\2\u0680\u0681\5R*\2\u0681\u0682\5T+\2\u0682= ") - buf.write("\u0688\7!\2\2\u0683\u0684\7@\2\2\u0684\u0685\7\b\2\2\u0= 685") - buf.write("\u0686\5\u00ccg\2\u0686\u0687\7!\2\2\u0687\u0689\3\2\2"= ) - buf.write("\2\u0688\u0683\3\2\2\2\u0688\u0689\3\2\2\2\u0689\u068e"= ) - buf.write("\3\2\2\2\u068a\u068b\7t\2\2\u068b\u068c\7\b\2\2\u068c") - buf.write("\u068d\7\u00fa\2\2\u068d\u068f\7!\2\2\u068e\u068a\3\2") - buf.write("\2\2\u068e\u068f\3\2\2\2\u068f\u0690\3\2\2\2\u0690\u069= 1") - buf.write("\5\u00caf\2\u0691\u0692\5\u00b4[\2\u0692\u0693\7_\2\2") - buf.write("\u0693\u0694\7 \2\2\u0694\u00c9\3\2\2\2\u0695\u0696\7") - buf.write("`\2\2\u0696\u0698\7\b\2\2\u0697\u0699\7\35\2\2\u0698\u0= 697") - buf.write("\3\2\2\2\u0698\u0699\3\2\2\2\u0699\u069a\3\2\2\2\u069a"= ) - buf.write("\u069b\7\u00fa\2\2\u069b\u069c\7!\2\2\u069c\u069d\7a\2"= ) - buf.write("\2\u069d\u069f\7\b\2\2\u069e\u06a0\7\35\2\2\u069f\u069e= ") - buf.write("\3\2\2\2\u069f\u06a0\3\2\2\2\u06a0\u06a1\3\2\2\2\u06a1"= ) - buf.write("\u06a2\7\u00fa\2\2\u06a2\u06a7\7!\2\2\u06a3\u06a4\7b\2"= ) - buf.write("\2\u06a4\u06a5\7\b\2\2\u06a5\u06a6\7\u00fa\2\2\u06a6\u0= 6a8") - buf.write("\7!\2\2\u06a7\u06a3\3\2\2\2\u06a7\u06a8\3\2\2\2\u06a8") - buf.write("\u00cb\3\2\2\2\u06a9\u06ae\5\u00ceh\2\u06aa\u06ab\7(\2"= ) - buf.write("\2\u06ab\u06ad\5\u00ceh\2\u06ac\u06aa\3\2\2\2\u06ad\u06= b0") - buf.write("\3\2\2\2\u06ae\u06ac\3\2\2\2\u06ae\u06af\3\2\2\2\u06af"= ) - buf.write("\u00cd\3\2\2\2\u06b0\u06ae\3\2\2\2\u06b1\u06bb\7\u00fa"= ) - buf.write("\2\2\u06b2\u06bb\7\u00ef\2\2\u06b3\u06bb\7\u00f0\2\2\u0= 6b4") - buf.write("\u06bb\7\u00f1\2\2\u06b5\u06bb\7\u00f2\2\2\u06b6\u06bb"= ) - buf.write("\7\u00f3\2\2\u06b7\u06bb\7\u00f4\2\2\u06b8\u06bb\7\u00f= 5") - buf.write("\2\2\u06b9\u06bb\5V,\2\u06ba\u06b1\3\2\2\2\u06ba\u06b2"= ) - buf.write("\3\2\2\2\u06ba\u06b3\3\2\2\2\u06ba\u06b4\3\2\2\2\u06ba"= ) - buf.write("\u06b5\3\2\2\2\u06ba\u06b6\3\2\2\2\u06ba\u06b7\3\2\2\2"= ) - buf.write("\u06ba\u06b8\3\2\2\2\u06ba\u06b9\3\2\2\2\u06bb\u00cf\3"= ) - buf.write("\2\2\2\u06bc\u06bd\7\60\2\2\u06bd\u06be\5R*\2\u06be\u06= bf") - buf.write("\5T+\2\u06bf\u06c5\7!\2\2\u06c0\u06c1\7@\2\2\u06c1\u06c= 2") - buf.write("\7\b\2\2\u06c2\u06c3\5\u00d2j\2\u06c3\u06c4\7!\2\2\u06c= 4") - buf.write("\u06c6\3\2\2\2\u06c5\u06c0\3\2\2\2\u06c5\u06c6\3\2\2\2"= ) - buf.write("\u06c6\u06c8\3\2\2\2\u06c7\u06c9\5\u00caf\2\u06c8\u06c7= ") - buf.write("\3\2\2\2\u06c8\u06c9\3\2\2\2\u06c9\u06ca\3\2\2\2\u06ca"= ) - buf.write("\u06cb\5\u00b4[\2\u06cb\u06cc\7\61\2\2\u06cc\u06cd\7 ") - buf.write("\2\2\u06cd\u00d1\3\2\2\2\u06ce\u06d3\5\u00ceh\2\u06cf") - buf.write("\u06d0\7(\2\2\u06d0\u06d2\5\u00ceh\2\u06d1\u06cf\3\2\2"= ) - buf.write("\2\u06d2\u06d5\3\2\2\2\u06d3\u06d1\3\2\2\2\u06d3\u06d4"= ) - buf.write("\3\2\2\2\u06d4\u00d3\3\2\2\2\u06d5\u06d3\3\2\2\2\u06d6"= ) - buf.write("\u06d9\5\u00d6l\2\u06d7\u06d9\5\u00dco\2\u06d8\u06d6\3"= ) - buf.write("\2\2\2\u06d8\u06d7\3\2\2\2\u06d9\u00d5\3\2\2\2\u06da\u0= 6db") - buf.write("\7f\2\2\u06db\u06dc\5P)\2\u06dc\u06e2\7!\2\2\u06dd\u06d= e") - buf.write("\7@\2\2\u06de\u06df\7\b\2\2\u06df\u06e0\5\u00d8m\2\u06e= 0") - buf.write("\u06e1\7!\2\2\u06e1\u06e3\3\2\2\2\u06e2\u06dd\3\2\2\2") - buf.write("\u06e2\u06e3\3\2\2\2\u06e3\u06e8\3\2\2\2\u06e4\u06e5\7"= ) - buf.write("t\2\2\u06e5\u06e6\7\b\2\2\u06e6\u06e7\7\u00fa\2\2\u06e7= ") - buf.write("\u06e9\7!\2\2\u06e8\u06e4\3\2\2\2\u06e8\u06e9\3\2\2\2") - buf.write("\u06e9\u06ea\3\2\2\2\u06ea\u06eb\7h\2\2\u06eb\u06ec\7") - buf.write("\b\2\2\u06ec\u06ed\7\u00fa\2\2\u06ed\u06ee\7!\2\2\u06ee= ") - buf.write("\u06ef\7i\2\2\u06ef\u06f0\7\b\2\2\u06f0\u06f1\7\u00fa") - buf.write("\2\2\u06f1\u06f2\7!\2\2\u06f2\u06f3\5\u00b4[\2\u06f3\u0= 6f4") - buf.write("\7g\2\2\u06f4\u06f5\7 \2\2\u06f5\u00d7\3\2\2\2\u06f6\u0= 6fb") - buf.write("\5\u00dan\2\u06f7\u06f8\7(\2\2\u06f8\u06fa\5\u00dan\2") - buf.write("\u06f9\u06f7\3\2\2\2\u06fa\u06fd\3\2\2\2\u06fb\u06f9\3"= ) - buf.write("\2\2\2\u06fb\u06fc\3\2\2\2\u06fc\u00d9\3\2\2\2\u06fd\u0= 6fb") - buf.write("\3\2\2\2\u06fe\u0702\7\u00fa\2\2\u06ff\u0702\7\13\2\2") - buf.write("\u0700\u0702\5V,\2\u0701\u06fe\3\2\2\2\u0701\u06ff\3\2"= ) - buf.write("\2\2\u0701\u0700\3\2\2\2\u0702\u00db\3\2\2\2\u0703\u070= 4") - buf.write("\7d\2\2\u0704\u0705\5P)\2\u0705\u070b\7!\2\2\u0706\u070= 7") - buf.write("\7@\2\2\u0707\u0708\7\b\2\2\u0708\u0709\5\u00dep\2\u070= 9") - buf.write("\u070a\7!\2\2\u070a\u070c\3\2\2\2\u070b\u0706\3\2\2\2") - buf.write("\u070b\u070c\3\2\2\2\u070c\u0711\3\2\2\2\u070d\u070e\7"= ) - buf.write("t\2\2\u070e\u070f\7\b\2\2\u070f\u0710\7\u00fa\2\2\u0710= ") - buf.write("\u0712\7!\2\2\u0711\u070d\3\2\2\2\u0711\u0712\3\2\2\2") - buf.write("\u0712\u0713\3\2\2\2\u0713\u0714\7h\2\2\u0714\u0715\7") - buf.write("\b\2\2\u0715\u0716\7\u00fa\2\2\u0716\u0717\7!\2\2\u0717= ") - buf.write("\u0718\7i\2\2\u0718\u0719\7\b\2\2\u0719\u071a\7\u00fa") - buf.write("\2\2\u071a\u071f\7!\2\2\u071b\u071c\7j\2\2\u071c\u071d"= ) - buf.write("\7\b\2\2\u071d\u071e\7\u00fa\2\2\u071e\u0720\7!\2\2\u07= 1f") - buf.write("\u071b\3\2\2\2\u071f\u0720\3\2\2\2\u0720\u0721\3\2\2\2"= ) - buf.write("\u0721\u0722\5\u00b4[\2\u0722\u0723\7e\2\2\u0723\u0724"= ) - buf.write("\7 \2\2\u0724\u00dd\3\2\2\2\u0725\u072a\5\u00e0q\2\u072= 6") - buf.write("\u0727\7(\2\2\u0727\u0729\5\u00e0q\2\u0728\u0726\3\2\2"= ) - buf.write("\2\u0729\u072c\3\2\2\2\u072a\u0728\3\2\2\2\u072a\u072b"= ) - buf.write("\3\2\2\2\u072b\u00df\3\2\2\2\u072c\u072a\3\2\2\2\u072d"= ) - buf.write("\u0730\7\u00fa\2\2\u072e\u0730\5V,\2\u072f\u072d\3\2\2"= ) - buf.write("\2\u072f\u072e\3\2\2\2\u0730\u00e1\3\2\2\2\u0731\u0732"= ) - buf.write("\7\63\2\2\u0732\u0733\5P)\2\u0733\u0738\7!\2\2\u0734\u0= 735") - buf.write("\7\64\2\2\u0735\u0736\7\b\2\2\u0736\u0737\7\u00fa\2\2") - buf.write("\u0737\u0739\7!\2\2\u0738\u0734\3\2\2\2\u0738\u0739\3") - buf.write("\2\2\2\u0739\u073f\3\2\2\2\u073a\u073b\7@\2\2\u073b\u07= 3c") - buf.write("\7\b\2\2\u073c\u073d\5\u00e4s\2\u073d\u073e\7!\2\2\u073= e") - buf.write("\u0740\3\2\2\2\u073f\u073a\3\2\2\2\u073f\u0740\3\2\2\2"= ) - buf.write("\u0740\u0741\3\2\2\2\u0741\u0742\5\u00b4[\2\u0742\u0743= ") - buf.write("\7\65\2\2\u0743\u0744\7 \2\2\u0744\u00e3\3\2\2\2\u0745"= ) - buf.write("\u074a\5\u00e6t\2\u0746\u0747\7(\2\2\u0747\u0749\5\u00e= 6") - buf.write("t\2\u0748\u0746\3\2\2\2\u0749\u074c\3\2\2\2\u074a\u0748= ") - buf.write("\3\2\2\2\u074a\u074b\3\2\2\2\u074b\u00e5\3\2\2\2\u074c"= ) - buf.write("\u074a\3\2\2\2\u074d\u0752\7\u00fa\2\2\u074e\u0752\7\u0= 0c0") - buf.write("\2\2\u074f\u0752\7\u00c1\2\2\u0750\u0752\5V,\2\u0751\u0= 74d") - buf.write("\3\2\2\2\u0751\u074e\3\2\2\2\u0751\u074f\3\2\2\2\u0751"= ) - buf.write("\u0750\3\2\2\2\u0752\u00e7\3\2\2\2\u0753\u07ae\7A\2\2") - buf.write("\u0754\u0755\5P)\2\u0755\u075b\7!\2\2\u0756\u0757\7@\2"= ) - buf.write("\2\u0757\u0758\7\b\2\2\u0758\u0759\5\u00ecw\2\u0759\u07= 5a") - buf.write("\7!\2\2\u075a\u075c\3\2\2\2\u075b\u0756\3\2\2\2\u075b") - buf.write("\u075c\3\2\2\2\u075c\u075d\3\2\2\2\u075d\u075e\5\u00b4"= ) - buf.write("[\2\u075e\u07af\3\2\2\2\u075f\u0760\7C\2\2\u0760\u0761"= ) - buf.write("\7\u008f\2\2\u0761\u0762\7\b\2\2\u0762\u0763\7\u00fb\2"= ) - buf.write("\2\u0763\u0764\7\34\2\2\u0764\u0765\7\u00fb\2\2\u0765") - buf.write("\u0766\7!\2\2\u0766\u0767\7\62\2\2\u0767\u0768\7\b\2\2"= ) - buf.write("\u0768\u0769\7\u00ec\2\2\u0769\u076a\7\30\2\2\u076a\u07= 6b") - buf.write("\7\u00fa\2\2\u076b\u076c\7\31\2\2\u076c\u076d\7!\2\2\u0= 76d") - buf.write("\u076e\7=3D\2\2\u076e\u076f\7\b\2\2\u076f\u0770\7\u00ec= ") - buf.write("\2\2\u0770\u0771\7\30\2\2\u0771\u0772\7\u00fa\2\2\u0772= ") - buf.write("\u0773\7\31\2\2\u0773\u0774\7!\2\2\u0774\u0775\5\u00ea"= ) - buf.write("v\2\u0775\u0776\7D\2\2\u0776\u0777\7\u008f\2\2\u0777\u0= 778") - buf.write("\7\b\2\2\u0778\u0779\7\u00fb\2\2\u0779\u077a\7\34\2\2") - buf.write("\u077a\u077b\7\u00fb\2\2\u077b\u077c\7!\2\2\u077c\u077d= ") - buf.write("\7\62\2\2\u077d\u077e\7\b\2\2\u077e\u077f\7\u00ec\2\2") - buf.write("\u077f\u0780\7\30\2\2\u0780\u0781\7\u00fa\2\2\u0781\u07= 82") - buf.write("\7\31\2\2\u0782\u0783\7!\2\2\u0783\u0784\7=3D\2\2\u0784= ") - buf.write("\u0785\7\b\2\2\u0785\u0786\7\u00ec\2\2\u0786\u0787\7\30= ") - buf.write("\2\2\u0787\u0788\7\u00fa\2\2\u0788\u0789\7\31\2\2\u0789= ") - buf.write("\u078a\7!\2\2\u078a\u078b\5\u00eav\2\u078b\u078c\7E\2") - buf.write("\2\u078c\u078d\7\u008f\2\2\u078d\u078e\7\b\2\2\u078e\u0= 78f") - buf.write("\7\u00fb\2\2\u078f\u0790\7\34\2\2\u0790\u0791\7\u00fb") - buf.write("\2\2\u0791\u0792\7!\2\2\u0792\u0793\7\62\2\2\u0793\u079= 4") - buf.write("\7\b\2\2\u0794\u0795\7\u00ec\2\2\u0795\u0796\7\30\2\2") - buf.write("\u0796\u0797\7\u00fa\2\2\u0797\u0798\7\31\2\2\u0798\u07= 99") - buf.write("\7!\2\2\u0799\u079a\7=3D\2\2\u079a\u079b\7\b\2\2\u079b\= u079c") - buf.write("\7\u00ec\2\2\u079c\u079d\7\30\2\2\u079d\u079e\7\u00fa") - buf.write("\2\2\u079e\u079f\7\31\2\2\u079f\u07a0\7!\2\2\u07a0\u07a= 6") - buf.write("\5\u00eav\2\u07a1\u07a2\7@\2\2\u07a2\u07a3\7\b\2\2\u07a= 3") - buf.write("\u07a4\5\u00ecw\2\u07a4\u07a5\7!\2\2\u07a5\u07a7\3\2\2"= ) - buf.write("\2\u07a6\u07a1\3\2\2\2\u07a6\u07a7\3\2\2\2\u07a7\u07ab"= ) - buf.write("\3\2\2\2\u07a8\u07aa\5\u008cG\2\u07a9\u07a8\3\2\2\2\u07= aa") - buf.write("\u07ad\3\2\2\2\u07ab\u07a9\3\2\2\2\u07ab\u07ac\3\2\2\2"= ) - buf.write("\u07ac\u07af\3\2\2\2\u07ad\u07ab\3\2\2\2\u07ae\u0754\3"= ) - buf.write("\2\2\2\u07ae\u075f\3\2\2\2\u07af\u07b0\3\2\2\2\u07b0\u0= 7b1") - buf.write("\7B\2\2\u07b1\u07b2\7 \2\2\u07b2\u00e9\3\2\2\2\u07b3\u0= 7b4") - buf.write("\7`\2\2\u07b4\u07b5\7\b\2\2\u07b5\u07b6\7\u00fa\2\2\u07= b6") - buf.write("\u07b7\7!\2\2\u07b7\u07b8\7a\2\2\u07b8\u07b9\7\b\2\2\u0= 7b9") - buf.write("\u07ba\7\u00fa\2\2\u07ba\u07bf\7!\2\2\u07bb\u07bc\7b\2"= ) - buf.write("\2\u07bc\u07bd\7\b\2\2\u07bd\u07be\7\u00fa\2\2\u07be\u0= 7c0") - buf.write("\7!\2\2\u07bf\u07bb\3\2\2\2\u07bf\u07c0\3\2\2\2\u07c0") - buf.write("\u07c5\3\2\2\2\u07c1\u07c2\7c\2\2\u07c2\u07c3\7\b\2\2") - buf.write("\u07c3\u07c4\7\u00fa\2\2\u07c4\u07c6\7!\2\2\u07c5\u07c1= ") - buf.write("\3\2\2\2\u07c5\u07c6\3\2\2\2\u07c6\u00eb\3\2\2\2\u07c7"= ) - buf.write("\u07cc\5\u00eex\2\u07c8\u07c9\7(\2\2\u07c9\u07cb\5\u00e= e") - buf.write("x\2\u07ca\u07c8\3\2\2\2\u07cb\u07ce\3\2\2\2\u07cc\u07ca= ") - buf.write("\3\2\2\2\u07cc\u07cd\3\2\2\2\u07cd\u00ed\3\2\2\2\u07ce"= ) - buf.write("\u07cc\3\2\2\2\u07cf\u07d0\t\6\2\2\u07d0\u00ef\3\2\2\2"= ) - buf.write("\u07d1\u082c\7F\2\2\u07d2\u07d3\5P)\2\u07d3\u07d9\7!\2"= ) - buf.write("\2\u07d4\u07d5\7@\2\2\u07d5\u07d6\7\b\2\2\u07d6\u07d7") - buf.write("\5\u00f4{\2\u07d7\u07d8\7!\2\2\u07d8\u07da\3\2\2\2\u07d= 9") - buf.write("\u07d4\3\2\2\2\u07d9\u07da\3\2\2\2\u07da\u07db\3\2\2\2"= ) - buf.write("\u07db\u07dc\5\u00b4[\2\u07dc\u082d\3\2\2\2\u07dd\u07de= ") - buf.write("\7H\2\2\u07de\u07df\7\u008f\2\2\u07df\u07e0\7\b\2\2\u07= e0") - buf.write("\u07e1\7\u00fb\2\2\u07e1\u07e2\7\34\2\2\u07e2\u07e3\7") - buf.write("\u00fb\2\2\u07e3\u07e4\7!\2\2\u07e4\u07e5\7\62\2\2\u07e= 5") - buf.write("\u07e6\7\b\2\2\u07e6\u07e7\7\u00ec\2\2\u07e7\u07e8\7\30= ") - buf.write("\2\2\u07e8\u07e9\7\u00fa\2\2\u07e9\u07ea\7\31\2\2\u07ea= ") - buf.write("\u07eb\7!\2\2\u07eb\u07ec\7=3D\2\2\u07ec\u07ed\7\b\2\2\= u07ed") - buf.write("\u07ee\7\u00ec\2\2\u07ee\u07ef\7\30\2\2\u07ef\u07f0\7") - buf.write("\u00fa\2\2\u07f0\u07f1\7\31\2\2\u07f1\u07f2\7!\2\2\u07f= 2") - buf.write("\u07f3\5\u00f2z\2\u07f3\u07f4\7I\2\2\u07f4\u07f5\7\u008= f") - buf.write("\2\2\u07f5\u07f6\7\b\2\2\u07f6\u07f7\7\u00fb\2\2\u07f7"= ) - buf.write("\u07f8\7\34\2\2\u07f8\u07f9\7\u00fb\2\2\u07f9\u07fa\7") - buf.write("!\2\2\u07fa\u07fb\7\62\2\2\u07fb\u07fc\7\b\2\2\u07fc\u0= 7fd") - buf.write("\7\u00ec\2\2\u07fd\u07fe\7\30\2\2\u07fe\u07ff\7\u00fa") - buf.write("\2\2\u07ff\u0800\7\31\2\2\u0800\u0801\7!\2\2\u0801\u080= 2") - buf.write("\7=3D\2\2\u0802\u0803\7\b\2\2\u0803\u0804\7\u00ec\2\2\u= 0804") - buf.write("\u0805\7\30\2\2\u0805\u0806\7\u00fa\2\2\u0806\u0807\7") - buf.write("\31\2\2\u0807\u0808\7!\2\2\u0808\u0809\5\u00f2z\2\u0809= ") - buf.write("\u080a\7J\2\2\u080a\u080b\7\u008f\2\2\u080b\u080c\7\b") - buf.write("\2\2\u080c\u080d\7\u00fb\2\2\u080d\u080e\7\34\2\2\u080e= ") - buf.write("\u080f\7\u00fb\2\2\u080f\u0810\7!\2\2\u0810\u0811\7\62"= ) - buf.write("\2\2\u0811\u0812\7\b\2\2\u0812\u0813\7\u00ec\2\2\u0813"= ) - buf.write("\u0814\7\30\2\2\u0814\u0815\7\u00fa\2\2\u0815\u0816\7") - buf.write("\31\2\2\u0816\u0817\7!\2\2\u0817\u0818\7=3D\2\2\u0818\u= 0819") - buf.write("\7\b\2\2\u0819\u081a\7\u00ec\2\2\u081a\u081b\7\30\2\2") - buf.write("\u081b\u081c\7\u00fa\2\2\u081c\u081d\7\31\2\2\u081d\u08= 1e") - buf.write("\7!\2\2\u081e\u0824\5\u00f2z\2\u081f\u0820\7@\2\2\u0820= ") - buf.write("\u0821\7\b\2\2\u0821\u0822\5\u00f4{\2\u0822\u0823\7!\2"= ) - buf.write("\2\u0823\u0825\3\2\2\2\u0824\u081f\3\2\2\2\u0824\u0825"= ) - buf.write("\3\2\2\2\u0825\u0829\3\2\2\2\u0826\u0828\5\u008cG\2\u08= 27") - buf.write("\u0826\3\2\2\2\u0828\u082b\3\2\2\2\u0829\u0827\3\2\2\2"= ) - buf.write("\u0829\u082a\3\2\2\2\u082a\u082d\3\2\2\2\u082b\u0829\3"= ) - buf.write("\2\2\2\u082c\u07d2\3\2\2\2\u082c\u07dd\3\2\2\2\u082d\u0= 82e") - buf.write("\3\2\2\2\u082e\u082f\7G\2\2\u082f\u0830\7 \2\2\u0830\u0= 0f1") - buf.write("\3\2\2\2\u0831\u0832\7`\2\2\u0832\u0833\7\b\2\2\u0833") - buf.write("\u0834\7\u00fa\2\2\u0834\u0835\7!\2\2\u0835\u0836\7a\2"= ) - buf.write("\2\u0836\u0837\7\b\2\2\u0837\u0838\7\u00fa\2\2\u0838\u0= 83d") - buf.write("\7!\2\2\u0839\u083a\7b\2\2\u083a\u083b\7\b\2\2\u083b\u0= 83c") - buf.write("\7\u00fa\2\2\u083c\u083e\7!\2\2\u083d\u0839\3\2\2\2\u08= 3d") - buf.write("\u083e\3\2\2\2\u083e\u0843\3\2\2\2\u083f\u0840\7c\2\2") - buf.write("\u0840\u0841\7\b\2\2\u0841\u0842\7\u00fa\2\2\u0842\u084= 4") - buf.write("\7!\2\2\u0843\u083f\3\2\2\2\u0843\u0844\3\2\2\2\u0844") - buf.write("\u00f3\3\2\2\2\u0845\u084a\5\u00f6|\2\u0846\u0847\7(\2"= ) - buf.write("\2\u0847\u0849\5\u00f6|\2\u0848\u0846\3\2\2\2\u0849\u08= 4c") - buf.write("\3\2\2\2\u084a\u0848\3\2\2\2\u084a\u084b\3\2\2\2\u084b"= ) - buf.write("\u00f5\3\2\2\2\u084c\u084a\3\2\2\2\u084d\u084e\t\7\2\2"= ) - buf.write("\u084e\u00f7\3\2\2\2\u084f\u0854\5\u0104\u0083\2\u0850"= ) - buf.write("\u0854\5\u00fc\177\2\u0851\u0854\5\u00fe\u0080\2\u0852"= ) - buf.write("\u0854\5\u010e\u0088\2\u0853\u084f\3\2\2\2\u0853\u0850"= ) - buf.write("\3\2\2\2\u0853\u0851\3\2\2\2\u0853\u0852\3\2\2\2\u0854"= ) - buf.write("\u00f9\3\2\2\2\u0855\u0856\5\u0104\u0083\2\u0856\u0857"= ) - buf.write("\5\u010a\u0086\2\u0857\u0858\5\u010c\u0087\2\u0858\u085= 9") - buf.write("\5\u010e\u0088\2\u0859\u00fb\3\2\2\2\u085a\u085b\5\u010= a") - buf.write("\u0086\2\u085b\u00fd\3\2\2\2\u085c\u085d\5\u010c\u0087"= ) - buf.write("\2\u085d\u00ff\3\2\2\2\u085e\u0865\5p9\2\u085f\u0865\5"= ) - buf.write("\u0088E\2\u0860\u0865\5\u00f8}\2\u0861\u0865\5\u0118\u0= 08d") - buf.write("\2\u0862\u0865\5\u011c\u008f\2\u0863\u0865\5\u0110\u008= 9") - buf.write("\2\u0864\u085e\3\2\2\2\u0864\u085f\3\2\2\2\u0864\u0860"= ) - buf.write("\3\2\2\2\u0864\u0861\3\2\2\2\u0864\u0862\3\2\2\2\u0864"= ) - buf.write("\u0863\3\2\2\2\u0865\u0101\3\2\2\2\u0866\u086b\5p9\2\u0= 867") - buf.write("\u086b\5\u0088E\2\u0868\u086b\5\u0118\u008d\2\u0869\u08= 6b") - buf.write("\5\u0110\u0089\2\u086a\u0866\3\2\2\2\u086a\u0867\3\2\2"= ) - buf.write("\2\u086a\u0868\3\2\2\2\u086a\u0869\3\2\2\2\u086b\u0103"= ) - buf.write("\3\2\2\2\u086c\u086d\7l\2\2\u086d\u086e\5\u0124\u0093") - buf.write("\2\u086e\u0872\7 \2\2\u086f\u0871\5\u0100\u0081\2\u0870= ") - buf.write("\u086f\3\2\2\2\u0871\u0874\3\2\2\2\u0872\u0870\3\2\2\2"= ) - buf.write("\u0872\u0873\3\2\2\2\u0873\u0875\3\2\2\2\u0874\u0872\3"= ) - buf.write("\2\2\2\u0875\u0876\7s\2\2\u0876\u0877\7 \2\2\u0877\u010= 5") - buf.write("\3\2\2\2\u0878\u0885\7k\2\2\u0879\u087a\7@\2\2\u087a\u0= 87b") - buf.write("\7\b\2\2\u087b\u0880\5\u009eP\2\u087c\u087d\7(\2\2\u087= d") - buf.write("\u087f\5\u009eP\2\u087e\u087c\3\2\2\2\u087f\u0882\3\2") - buf.write("\2\2\u0880\u087e\3\2\2\2\u0880\u0881\3\2\2\2\u0881\u088= 3") - buf.write("\3\2\2\2\u0882\u0880\3\2\2\2\u0883\u0884\7!\2\2\u0884") - buf.write("\u0886\3\2\2\2\u0885\u0879\3\2\2\2\u0885\u0886\3\2\2\2"= ) - buf.write("\u0886\u0887\3\2\2\2\u0887\u0888\5\u0124\u0093\2\u0888"= ) - buf.write("\u0889\7 \2\2\u0889\u0107\3\2\2\2\u088a\u0897\7K\2\2\u0= 88b") - buf.write("\u088c\7@\2\2\u088c\u088d\7\b\2\2\u088d\u0892\5\u009e") - buf.write("P\2\u088e\u088f\7(\2\2\u088f\u0891\5\u009eP\2\u0890\u08= 8e") - buf.write("\3\2\2\2\u0891\u0894\3\2\2\2\u0892\u0890\3\2\2\2\u0892"= ) - buf.write("\u0893\3\2\2\2\u0893\u0895\3\2\2\2\u0894\u0892\3\2\2\2"= ) - buf.write("\u0895\u0896\7!\2\2\u0896\u0898\3\2\2\2\u0897\u088b\3") - buf.write("\2\2\2\u0897\u0898\3\2\2\2\u0898\u0899\3\2\2\2\u0899\u0= 89a") - buf.write("\5\u0124\u0093\2\u089a\u089b\7 \2\2\u089b\u0109\3\2\2") - buf.write("\2\u089c\u08a9\7k\2\2\u089d\u089e\7@\2\2\u089e\u089f\7"= ) - buf.write("\b\2\2\u089f\u08a4\5\u009eP\2\u08a0\u08a1\7(\2\2\u08a1"= ) - buf.write("\u08a3\5\u009eP\2\u08a2\u08a0\3\2\2\2\u08a3\u08a6\3\2") - buf.write("\2\2\u08a4\u08a2\3\2\2\2\u08a4\u08a5\3\2\2\2\u08a5\u08a= 7") - buf.write("\3\2\2\2\u08a6\u08a4\3\2\2\2\u08a7\u08a8\7!\2\2\u08a8") - buf.write("\u08aa\3\2\2\2\u08a9\u089d\3\2\2\2\u08a9\u08aa\3\2\2\2"= ) - buf.write("\u08aa\u08ab\3\2\2\2\u08ab\u08ac\5\u0124\u0093\2\u08ac"= ) - buf.write("\u08b0\7 \2\2\u08ad\u08af\5\u0100\u0081\2\u08ae\u08ad") - buf.write("\3\2\2\2\u08af\u08b2\3\2\2\2\u08b0\u08ae\3\2\2\2\u08b0"= ) - buf.write("\u08b1\3\2\2\2\u08b1\u08b3\3\2\2\2\u08b2\u08b0\3\2\2\2"= ) - buf.write("\u08b3\u08b4\7s\2\2\u08b4\u08b5\7 \2\2\u08b5\u010b\3\2"= ) - buf.write("\2\2\u08b6\u08c3\7K\2\2\u08b7\u08b8\7@\2\2\u08b8\u08b9"= ) - buf.write("\7\b\2\2\u08b9\u08be\5\u009eP\2\u08ba\u08bb\7(\2\2\u08b= b") - buf.write("\u08bd\5\u009eP\2\u08bc\u08ba\3\2\2\2\u08bd\u08c0\3\2") - buf.write("\2\2\u08be\u08bc\3\2\2\2\u08be\u08bf\3\2\2\2\u08bf\u08c= 1") - buf.write("\3\2\2\2\u08c0\u08be\3\2\2\2\u08c1\u08c2\7!\2\2\u08c2") - buf.write("\u08c4\3\2\2\2\u08c3\u08b7\3\2\2\2\u08c3\u08c4\3\2\2\2"= ) - buf.write("\u08c4\u08c5\3\2\2\2\u08c5\u08c6\5\u0124\u0093\2\u08c6"= ) - buf.write("\u08ca\7 \2\2\u08c7\u08c9\5\u0100\u0081\2\u08c8\u08c7") - buf.write("\3\2\2\2\u08c9\u08cc\3\2\2\2\u08ca\u08c8\3\2\2\2\u08ca"= ) - buf.write("\u08cb\3\2\2\2\u08cb\u08cd\3\2\2\2\u08cc\u08ca\3\2\2\2"= ) - buf.write("\u08cd\u08ce\7s\2\2\u08ce\u08cf\7 \2\2\u08cf\u010d\3\2"= ) - buf.write("\2\2\u08d0\u08d1\7p\2\2\u08d1\u08d2\7\62\2\2\u08d2\u08d= 3") - buf.write("\7\b\2\2\u08d3\u08d4\7\u00ec\2\2\u08d4\u08d5\7\30\2\2") - buf.write("\u08d5\u08d6\7\u00fa\2\2\u08d6\u08d7\7\31\2\2\u08d7\u08= e4") - buf.write("\7!\2\2\u08d8\u08d9\7@\2\2\u08d9\u08da\7\b\2\2\u08da\u0= 8df") - buf.write("\5\u009eP\2\u08db\u08dc\7(\2\2\u08dc\u08de\5\u009eP\2") - buf.write("\u08dd\u08db\3\2\2\2\u08de\u08e1\3\2\2\2\u08df\u08dd\3"= ) - buf.write("\2\2\2\u08df\u08e0\3\2\2\2\u08e0\u08e2\3\2\2\2\u08e1\u0= 8df") - buf.write("\3\2\2\2\u08e2\u08e3\7!\2\2\u08e3\u08e5\3\2\2\2\u08e4") - buf.write("\u08d8\3\2\2\2\u08e4\u08e5\3\2\2\2\u08e5\u08e6\3\2\2\2"= ) - buf.write("\u08e6\u08e7\5\u0124\u0093\2\u08e7\u08e8\7s\2\2\u08e8") - buf.write("\u08e9\7 \2\2\u08e9\u010f\3\2\2\2\u08ea\u08ee\5\u0112") - buf.write("\u008a\2\u08eb\u08ee\5\u0114\u008b\2\u08ec\u08ee\5\u011= 6") - buf.write("\u008c\2\u08ed\u08ea\3\2\2\2\u08ed\u08eb\3\2\2\2\u08ed"= ) - buf.write("\u08ec\3\2\2\2\u08ee\u0111\3\2\2\2\u08ef\u08f0\7m\2\2") - buf.write("\u08f0\u08f1\7\u0096\2\2\u08f1\u08f2\7\b\2\2\u08f2\u08f= 3") - buf.write("\7\u00fa\2\2\u08f3\u08f4\7!\2\2\u08f4\u08f5\7t\2\2\u08f= 5") - buf.write("\u08f6\7\b\2\2\u08f6\u08f7\7\u00fa\2\2\u08f7\u08f8\7 ") - buf.write("\2\2\u08f8\u0113\3\2\2\2\u08f9\u08fa\7N\2\2\u08fa\u08fb= ") - buf.write("\7=3D\2\2\u08fb\u08fc\7\b\2\2\u08fc\u08fd\7\u00ec\2\2\u= 08fd") - buf.write("\u08fe\7\30\2\2\u08fe\u08ff\7\u00fa\2\2\u08ff\u0900\7") - buf.write("\31\2\2\u0900\u0901\7!\2\2\u0901\u0902\7>\2\2\u0902\u09= 03") - buf.write("\7\b\2\2\u0903\u0904\7\u00ec\2\2\u0904\u0905\7\30\2\2") - buf.write("\u0905\u0906\7\u00fa\2\2\u0906\u0907\7\31\2\2\u0907\u09= 0e") - buf.write("\7!\2\2\u0908\u0909\7>\2\2\u0909\u090a\7\b\2\2\u090a\u0= 90b") - buf.write("\7\u00ec\2\2\u090b\u090c\7\30\2\2\u090c\u090d\7\u00fa") - buf.write("\2\2\u090d\u090f\7\31\2\2\u090e\u0908\3\2\2\2\u090e\u09= 0f") - buf.write("\3\2\2\2\u090f\u0910\3\2\2\2\u0910\u0911\7 \2\2\u0911") - buf.write("\u0115\3\2\2\2\u0912\u0913\t\b\2\2\u0913\u0914\7\u0087"= ) - buf.write("\2\2\u0914\u0915\7!\2\2\u0915\u0916\7/\2\2\u0916\u0917"= ) - buf.write("\7\b\2\2\u0917\u0918\7\u00fa\2\2\u0918\u0919\7!\2\2\u09= 19") - buf.write("\u091a\7\62\2\2\u091a\u091b\7\b\2\2\u091b\u091c\7\u00ec= ") - buf.write("\2\2\u091c\u091d\7\30\2\2\u091d\u091e\7\u00fa\2\2\u091e= ") - buf.write("\u091f\7\31\2\2\u091f\u0920\7!\2\2\u0920\u0921\7=3D\2\2= ") - buf.write("\u0921\u0922\7\b\2\2\u0922\u0923\7\u00ec\2\2\u0923\u092= 4") - buf.write("\7\30\2\2\u0924\u0925\7\u00fa\2\2\u0925\u0931\7\31\2\2"= ) - buf.write("\u0926\u0927\7!\2\2\u0927\u0928\7@\2\2\u0928\u0929\7\b"= ) - buf.write("\2\2\u0929\u092e\5\u009eP\2\u092a\u092b\7(\2\2\u092b\u0= 92d") - buf.write("\5\u009eP\2\u092c\u092a\3\2\2\2\u092d\u0930\3\2\2\2\u09= 2e") - buf.write("\u092c\3\2\2\2\u092e\u092f\3\2\2\2\u092f\u0932\3\2\2\2"= ) - buf.write("\u0930\u092e\3\2\2\2\u0931\u0926\3\2\2\2\u0931\u0932\3"= ) - buf.write("\2\2\2\u0932\u0937\3\2\2\2\u0933\u0934\7!\2\2\u0934\u09= 35") - buf.write("\7t\2\2\u0935\u0936\7\b\2\2\u0936\u0938\7\u00fa\2\2\u09= 37") - buf.write("\u0933\3\2\2\2\u0937\u0938\3\2\2\2\u0938\u0939\3\2\2\2"= ) - buf.write("\u0939\u093a\7 \2\2\u093a\u0117\3\2\2\2\u093b\u093c\7") - buf.write("L\2\2\u093c\u093d\7\u00fa\2\2\u093d\u093e\7 \2\2\u093e"= ) - buf.write("\u0119\3\2\2\2\u093f\u0941\7\u0088\2\2\u0940\u0942\7!") - buf.write("\2\2\u0941\u0940\3\2\2\2\u0941\u0942\3\2\2\2\u0942\u094= 3") - buf.write("\3\2\2\2\u0943\u0944\7.\2\2\u0944\u0945\7\b\2\2\u0945") - buf.write("\u0946\7\u00ec\2\2\u0946\u0947\7\30\2\2\u0947\u0948\7") - buf.write("\u00fa\2\2\u0948\u0949\7\31\2\2\u0949\u0954\7!\2\2\u094= a") - buf.write("\u094b\7\u008d\2\2\u094b\u094c\7\u00fa\2\2\u094c\u094d"= ) - buf.write("\7!\2\2\u094d\u094e\7\u0089\2\2\u094e\u094f\t\t\2\2\u09= 4f") - buf.write("\u0955\7 \2\2\u0950\u0951\7M\2\2\u0951\u0952\7\b\2\2\u0= 952") - buf.write("\u0953\7\u00fa\2\2\u0953\u0955\7 \2\2\u0954\u094a\3\2") - buf.write("\2\2\u0954\u0950\3\2\2\2\u0955\u011b\3\2\2\2\u0956\u095= 7") - buf.write("\7\u00a7\2\2\u0957\u0958\7[\2\2\u0958\u0959\7\b\2\2\u09= 59") - buf.write("\u09a1\5L\'\2\u095a\u095b\7!\2\2\u095b\u095c\7\u00a9\2"= ) - buf.write("\2\u095c\u0999\7\b\2\2\u095d\u0961\7S\2\2\u095e\u095f") - buf.write("\7\32\2\2\u095f\u0960\7\u00fa\2\2\u0960\u0962\7\33\2\2"= ) - buf.write("\u0961\u095e\3\2\2\2\u0961\u0962\3\2\2\2\u0962\u099a\3"= ) - buf.write("\2\2\2\u0963\u0967\7T\2\2\u0964\u0965\7\32\2\2\u0965\u0= 966") - buf.write("\7\u00fa\2\2\u0966\u0968\7\33\2\2\u0967\u0964\3\2\2\2") - buf.write("\u0967\u0968\3\2\2\2\u0968\u099a\3\2\2\2\u0969\u096d\7"= ) - buf.write("U\2\2\u096a\u096b\7\32\2\2\u096b\u096c\7\u00fa\2\2\u096= c") - buf.write("\u096e\7\33\2\2\u096d\u096a\3\2\2\2\u096d\u096e\3\2\2") - buf.write("\2\u096e\u099a\3\2\2\2\u096f\u0973\7V\2\2\u0970\u0971") - buf.write("\7\32\2\2\u0971\u0972\7\u00fa\2\2\u0972\u0974\7\33\2\2"= ) - buf.write("\u0973\u0970\3\2\2\2\u0973\u0974\3\2\2\2\u0974\u099a\3"= ) - buf.write("\2\2\2\u0975\u0979\7R\2\2\u0976\u0977\7\32\2\2\u0977\u0= 978") - buf.write("\7\u00fa\2\2\u0978\u097a\7\33\2\2\u0979\u0976\3\2\2\2") - buf.write("\u0979\u097a\3\2\2\2\u097a\u099a\3\2\2\2\u097b\u097f\7"= ) - buf.write("W\2\2\u097c\u097d\7\32\2\2\u097d\u097e\7\u00fa\2\2\u097= e") - buf.write("\u0980\7\33\2\2\u097f\u097c\3\2\2\2\u097f\u0980\3\2\2") - buf.write("\2\u0980\u099a\3\2\2\2\u0981\u0985\7X\2\2\u0982\u0983") - buf.write("\7\32\2\2\u0983\u0984\7\u00fa\2\2\u0984\u0986\7\33\2\2"= ) - buf.write("\u0985\u0982\3\2\2\2\u0985\u0986\3\2\2\2\u0986\u099a\3"= ) - buf.write("\2\2\2\u0987\u098b\7Y\2\2\u0988\u0989\7\32\2\2\u0989\u0= 98a") - buf.write("\7\u00fa\2\2\u098a\u098c\7\33\2\2\u098b\u0988\3\2\2\2") - buf.write("\u098b\u098c\3\2\2\2\u098c\u099a\3\2\2\2\u098d\u0991\7"= ) - buf.write("Z\2\2\u098e\u098f\7\32\2\2\u098f\u0990\7\u00fa\2\2\u099= 0") - buf.write("\u0992\7\33\2\2\u0991\u098e\3\2\2\2\u0991\u0992\3\2\2") - buf.write("\2\u0992\u099a\3\2\2\2\u0993\u0997\7\u00fb\2\2\u0994\u0= 995") - buf.write("\7\32\2\2\u0995\u0996\7\u00fa\2\2\u0996\u0998\7\33\2\2"= ) - buf.write("\u0997\u0994\3\2\2\2\u0997\u0998\3\2\2\2\u0998\u099a\3"= ) - buf.write("\2\2\2\u0999\u095d\3\2\2\2\u0999\u0963\3\2\2\2\u0999\u0= 969") - buf.write("\3\2\2\2\u0999\u096f\3\2\2\2\u0999\u0975\3\2\2\2\u0999"= ) - buf.write("\u097b\3\2\2\2\u0999\u0981\3\2\2\2\u0999\u0987\3\2\2\2"= ) - buf.write("\u0999\u098d\3\2\2\2\u0999\u0993\3\2\2\2\u099a\u099e\3"= ) - buf.write("\2\2\2\u099b\u099d\5\u011e\u0090\2\u099c\u099b\3\2\2\2"= ) - buf.write("\u099d\u09a0\3\2\2\2\u099e\u099c\3\2\2\2\u099e\u099f\3"= ) - buf.write("\2\2\2\u099f\u09a2\3\2\2\2\u09a0\u099e\3\2\2\2\u09a1\u0= 95a") - buf.write("\3\2\2\2\u09a1\u09a2\3\2\2\2\u09a2\u09ab\3\2\2\2\u09a3"= ) - buf.write("\u09a7\7!\2\2\u09a4\u09a6\5\u011c\u008f\2\u09a5\u09a4") - buf.write("\3\2\2\2\u09a6\u09a9\3\2\2\2\u09a7\u09a5\3\2\2\2\u09a7"= ) - buf.write("\u09a8\3\2\2\2\u09a8\u09aa\3\2\2\2\u09a9\u09a7\3\2\2\2"= ) - buf.write("\u09aa\u09ac\7\u00a8\2\2\u09ab\u09a3\3\2\2\2\u09ab\u09a= c") - buf.write("\3\2\2\2\u09ac\u09ad\3\2\2\2\u09ad\u09ae\7 \2\2\u09ae") - buf.write("\u011d\3\2\2\2\u09af\u09b0\7!\2\2\u09b0\u09b4\7\u00aa") - buf.write("\2\2\u09b1\u09b2\7\32\2\2\u09b2\u09b3\7\u00fa\2\2\u09b3= ") - buf.write("\u09b5\7\33\2\2\u09b4\u09b1\3\2\2\2\u09b4\u09b5\3\2\2") - buf.write("\2\u09b5\u09ba\3\2\2\2\u09b6\u09b7\7\34\2\2\u09b7\u09b9= ") - buf.write("\5\u015c\u00af\2\u09b8\u09b6\3\2\2\2\u09b9\u09bc\3\2\2"= ) - buf.write("\2\u09ba\u09b8\3\2\2\2\u09ba\u09bb\3\2\2\2\u09bb\u09bd"= ) - buf.write("\3\2\2\2\u09bc\u09ba\3\2\2\2\u09bd\u09be\7\b\2\2\u09be"= ) - buf.write("\u09bf\7\u00fa\2\2\u09bf\u011f\3\2\2\2\u09c0\u09c1\5\u0= 122") - buf.write("\u0092\2\u09c1\u09c2\7 \2\2\u09c2\u0121\3\2\2\2\u09c3") - buf.write("\u09c4\7\u00ab\2\2\u09c4\u0123\3\2\2\2\u09c5\u09ca\5\u0= 128") - buf.write("\u0095\2\u09c6\u09c7\7\u00dc\2\2\u09c7\u09c9\5\u0128\u0= 095") - buf.write("\2\u09c8\u09c6\3\2\2\2\u09c9\u09cc\3\2\2\2\u09ca\u09c8"= ) - buf.write("\3\2\2\2\u09ca\u09cb\3\2\2\2\u09cb\u0125\3\2\2\2\u09cc"= ) - buf.write("\u09ca\3\2\2\2\u09cd\u09d2\5\u0128\u0095\2\u09ce\u09cf"= ) - buf.write("\7\u00dc\2\2\u09cf\u09d1\5\u0128\u0095\2\u09d0\u09ce\3"= ) - buf.write("\2\2\2\u09d1\u09d4\3\2\2\2\u09d2\u09d0\3\2\2\2\u09d2\u0= 9d3") - buf.write("\3\2\2\2\u09d3\u0127\3\2\2\2\u09d4\u09d2\3\2\2\2\u09d5"= ) - buf.write("\u09da\5\u012a\u0096\2\u09d6\u09d7\7\u00db\2\2\u09d7\u0= 9d9") - buf.write("\5\u012a\u0096\2\u09d8\u09d6\3\2\2\2\u09d9\u09dc\3\2\2"= ) - buf.write("\2\u09da\u09d8\3\2\2\2\u09da\u09db\3\2\2\2\u09db\u0129"= ) - buf.write("\3\2\2\2\u09dc\u09da\3\2\2\2\u09dd\u09e2\5\u012c\u0097"= ) - buf.write("\2\u09de\u09df\7(\2\2\u09df\u09e1\5\u012c\u0097\2\u09e0= ") - buf.write("\u09de\3\2\2\2\u09e1\u09e4\3\2\2\2\u09e2\u09e0\3\2\2\2"= ) - buf.write("\u09e2\u09e3\3\2\2\2\u09e3\u012b\3\2\2\2\u09e4\u09e2\3"= ) - buf.write("\2\2\2\u09e5\u09ea\5\u012e\u0098\2\u09e6\u09e7\7)\2\2") - buf.write("\u09e7\u09e9\5\u012e\u0098\2\u09e8\u09e6\3\2\2\2\u09e9"= ) - buf.write("\u09ec\3\2\2\2\u09ea\u09e8\3\2\2\2\u09ea\u09eb\3\2\2\2"= ) - buf.write("\u09eb\u012d\3\2\2\2\u09ec\u09ea\3\2\2\2\u09ed\u09f1\5"= ) - buf.write("\u0132\u009a\2\u09ee\u09f0\5\u0130\u0099\2\u09ef\u09ee"= ) - buf.write("\3\2\2\2\u09f0\u09f3\3\2\2\2\u09f1\u09ef\3\2\2\2\u09f1"= ) - buf.write("\u09f2\3\2\2\2\u09f2\u012f\3\2\2\2\u09f3\u09f1\3\2\2\2"= ) - buf.write("\u09f4\u09f5\7\"\2\2\u09f5\u09f9\5\u0132\u009a\2\u09f6"= ) - buf.write("\u09f7\7#\2\2\u09f7\u09f9\5\u0132\u009a\2\u09f8\u09f4") - buf.write("\3\2\2\2\u09f8\u09f6\3\2\2\2\u09f9\u0131\3\2\2\2\u09fa"= ) - buf.write("\u09fe\5\u0136\u009c\2\u09fb\u09fd\5\u0134\u009b\2\u09f= c") - buf.write("\u09fb\3\2\2\2\u09fd\u0a00\3\2\2\2\u09fe\u09fc\3\2\2\2"= ) - buf.write("\u09fe\u09ff\3\2\2\2\u09ff\u0133\3\2\2\2\u0a00\u09fe\3"= ) - buf.write("\2\2\2\u0a01\u0a02\7%\2\2\u0a02\u0a0a\5\u0136\u009c\2") - buf.write("\u0a03\u0a04\7$\2\2\u0a04\u0a0a\5\u0136\u009c\2\u0a05") - buf.write("\u0a06\7\'\2\2\u0a06\u0a0a\5\u0136\u009c\2\u0a07\u0a08"= ) - buf.write("\7&\2\2\u0a08\u0a0a\5\u0136\u009c\2\u0a09\u0a01\3\2\2") - buf.write("\2\u0a09\u0a03\3\2\2\2\u0a09\u0a05\3\2\2\2\u0a09\u0a07"= ) - buf.write("\3\2\2\2\u0a0a\u0135\3\2\2\2\u0a0b\u0a0f\5\u013a\u009e"= ) - buf.write("\2\u0a0c\u0a0e\5\u0138\u009d\2\u0a0d\u0a0c\3\2\2\2\u0a0= e") - buf.write("\u0a11\3\2\2\2\u0a0f\u0a0d\3\2\2\2\u0a0f\u0a10\3\2\2\2"= ) - buf.write("\u0a10\u0137\3\2\2\2\u0a11\u0a0f\3\2\2\2\u0a12\u0a13\7"= ) - buf.write("\f\2\2\u0a13\u0a17\5\u013a\u009e\2\u0a14\u0a15\7\r\2\2"= ) - buf.write("\u0a15\u0a17\5\u013a\u009e\2\u0a16\u0a12\3\2\2\2\u0a16"= ) - buf.write("\u0a14\3\2\2\2\u0a17\u0139\3\2\2\2\u0a18\u0a1c\5\u013e"= ) - buf.write("\u00a0\2\u0a19\u0a1b\5\u013c\u009f\2\u0a1a\u0a19\3\2\2"= ) - buf.write("\2\u0a1b\u0a1e\3\2\2\2\u0a1c\u0a1a\3\2\2\2\u0a1c\u0a1d"= ) - buf.write("\3\2\2\2\u0a1d\u013b\3\2\2\2\u0a1e\u0a1c\3\2\2\2\u0a1f"= ) - buf.write("\u0a20\7\16\2\2\u0a20\u0a24\5\u013e\u00a0\2\u0a21\u0a22= ") - buf.write("\7\35\2\2\u0a22\u0a24\5\u013e\u00a0\2\u0a23\u0a1f\3\2") - buf.write("\2\2\u0a23\u0a21\3\2\2\2\u0a24\u013d\3\2\2\2\u0a25\u0a2= 9") - buf.write("\5\u0142\u00a2\2\u0a26\u0a28\5\u0140\u00a1\2\u0a27\u0a2= 6") - buf.write("\3\2\2\2\u0a28\u0a2b\3\2\2\2\u0a29\u0a27\3\2\2\2\u0a29"= ) - buf.write("\u0a2a\3\2\2\2\u0a2a\u013f\3\2\2\2\u0a2b\u0a29\3\2\2\2"= ) - buf.write("\u0a2c\u0a2d\7\17\2\2\u0a2d\u0a33\5\u0142\u00a2\2\u0a2e= ") - buf.write("\u0a2f\7\37\2\2\u0a2f\u0a33\5\u0142\u00a2\2\u0a30\u0a31= ") - buf.write("\7\20\2\2\u0a31\u0a33\5\u0142\u00a2\2\u0a32\u0a2c\3\2") - buf.write("\2\2\u0a32\u0a2e\3\2\2\2\u0a32\u0a30\3\2\2\2\u0a33\u014= 1") - buf.write("\3\2\2\2\u0a34\u0a35\7\30\2\2\u0a35\u0a36\t\n\2\2\u0a36= ") - buf.write("\u0a38\7\31\2\2\u0a37\u0a34\3\2\2\2\u0a38\u0a3b\3\2\2") - buf.write("\2\u0a39\u0a37\3\2\2\2\u0a39\u0a3a\3\2\2\2\u0a3a\u0a3c"= ) - buf.write("\3\2\2\2\u0a3b\u0a39\3\2\2\2\u0a3c\u0a3d\5\u0144\u00a3"= ) - buf.write("\2\u0a3d\u0143\3\2\2\2\u0a3e\u0a4b\5\u0146\u00a4\2\u0a3= f") - buf.write("\u0a4b\5\u0148\u00a5\2\u0a40\u0a4b\5\u014a\u00a6\2\u0a4= 1") - buf.write("\u0a4b\5\u014c\u00a7\2\u0a42\u0a4b\5\u014e\u00a8\2\u0a4= 3") - buf.write("\u0a4b\5\u016c\u00b7\2\u0a44\u0a4b\5\u016e\u00b8\2\u0a4= 5") - buf.write("\u0a4b\5\u0184\u00c3\2\u0a46\u0a4b\5\u0194\u00cb\2\u0a4= 7") - buf.write("\u0a48\7\u00dd\2\2\u0a48\u0a4b\5\u0144\u00a3\2\u0a49\u0= a4b") - buf.write("\5\u014a\u00a6\2\u0a4a\u0a3e\3\2\2\2\u0a4a\u0a3f\3\2\2"= ) - buf.write("\2\u0a4a\u0a40\3\2\2\2\u0a4a\u0a41\3\2\2\2\u0a4a\u0a42"= ) - buf.write("\3\2\2\2\u0a4a\u0a43\3\2\2\2\u0a4a\u0a44\3\2\2\2\u0a4a"= ) - buf.write("\u0a45\3\2\2\2\u0a4a\u0a46\3\2\2\2\u0a4a\u0a47\3\2\2\2"= ) - buf.write("\u0a4a\u0a49\3\2\2\2\u0a4b\u0145\3\2\2\2\u0a4c\u0a4d\7"= ) - buf.write("\u00e7\2\2\u0a4d\u0a4e\7\30\2\2\u0a4e\u0a4f\5\u0126\u00= 94") - buf.write("\2\u0a4f\u0a50\7!\2\2\u0a50\u0a51\5\u0126\u0094\2\u0a51= ") - buf.write("\u0a52\7\31\2\2\u0a52\u0147\3\2\2\2\u0a53\u0a54\7\u00e5= ") - buf.write("\2\2\u0a54\u0a55\7\30\2\2\u0a55\u0a56\5\u0126\u0094\2") - buf.write("\u0a56\u0a57\7!\2\2\u0a57\u0a58\5\u0126\u0094\2\u0a58") - buf.write("\u0a59\7\31\2\2\u0a59\u0149\3\2\2\2\u0a5a\u0a5b\7\u00e6= ") - buf.write("\2\2\u0a5b\u0a5c\7\30\2\2\u0a5c\u0a5d\5\u0126\u0094\2") - buf.write("\u0a5d\u0a5e\7!\2\2\u0a5e\u0a5f\5\u0126\u0094\2\u0a5f") - buf.write("\u0a60\7!\2\2\u0a60\u0a61\5L\'\2\u0a61\u0a62\7\31\2\2") - buf.write("\u0a62\u014b\3\2\2\2\u0a63\u0a64\7\30\2\2\u0a64\u0a65") - buf.write("\5\u0126\u0094\2\u0a65\u0a66\7\31\2\2\u0a66\u014d\3\2") - buf.write("\2\2\u0a67\u0a73\5\u0150\u00a9\2\u0a68\u0a73\5\u0152\u0= 0aa") - buf.write("\2\u0a69\u0a73\5\u0154\u00ab\2\u0a6a\u0a73\5\u0156\u00a= c") - buf.write("\2\u0a6b\u0a73\5\u0158\u00ad\2\u0a6c\u0a73\5\u015e\u00b= 0") - buf.write("\2\u0a6d\u0a73\5\u0160\u00b1\2\u0a6e\u0a73\5\u0162\u00b= 2") - buf.write("\2\u0a6f\u0a73\5\u0164\u00b3\2\u0a70\u0a73\5\u0166\u00b= 4") - buf.write("\2\u0a71\u0a73\5\u016a\u00b6\2\u0a72\u0a67\3\2\2\2\u0a7= 2") - buf.write("\u0a68\3\2\2\2\u0a72\u0a69\3\2\2\2\u0a72\u0a6a\3\2\2\2"= ) - buf.write("\u0a72\u0a6b\3\2\2\2\u0a72\u0a6c\3\2\2\2\u0a72\u0a6d\3"= ) - buf.write("\2\2\2\u0a72\u0a6e\3\2\2\2\u0a72\u0a6f\3\2\2\2\u0a72\u0= a70") - buf.write("\3\2\2\2\u0a72\u0a71\3\2\2\2\u0a73\u014f\3\2\2\2\u0a74"= ) - buf.write("\u0a75\7\u00c7\2\2\u0a75\u0151\3\2\2\2\u0a76\u0a77\7\u0= 0c8") - buf.write("\2\2\u0a77\u0a78\7\u00c9\2\2\u0a78\u0a79\7\30\2\2\u0a79= ") - buf.write("\u0a7a\7\u00fa\2\2\u0a7a\u0a85\7\31\2\2\u0a7b\u0a7c\7") - buf.write("\"\2\2\u0a7c\u0a86\7\u00fa\2\2\u0a7d\u0a7e\7$\2\2\u0a7e= ") - buf.write("\u0a86\7\u00fa\2\2\u0a7f\u0a80\7%\2\2\u0a80\u0a86\7\u00= fa") - buf.write("\2\2\u0a81\u0a82\7&\2\2\u0a82\u0a86\7\u00fa\2\2\u0a83") - buf.write("\u0a84\7\'\2\2\u0a84\u0a86\7\u00fa\2\2\u0a85\u0a7b\3\2"= ) - buf.write("\2\2\u0a85\u0a7d\3\2\2\2\u0a85\u0a7f\3\2\2\2\u0a85\u0a8= 1") - buf.write("\3\2\2\2\u0a85\u0a83\3\2\2\2\u0a86\u0153\3\2\2\2\u0a87"= ) - buf.write("\u0a88\7\u00ca\2\2\u0a88\u0a93\5\u015a\u00ae\2\u0a89\u0= a8a") - buf.write("\7\"\2\2\u0a8a\u0a94\7\u00fa\2\2\u0a8b\u0a8c\7$\2\2\u0a= 8c") - buf.write("\u0a94\7\u00fa\2\2\u0a8d\u0a8e\7%\2\2\u0a8e\u0a94\7\u00= fa") - buf.write("\2\2\u0a8f\u0a90\7&\2\2\u0a90\u0a94\7\u00fa\2\2\u0a91") - buf.write("\u0a92\7\'\2\2\u0a92\u0a94\7\u00fa\2\2\u0a93\u0a89\3\2"= ) - buf.write("\2\2\u0a93\u0a8b\3\2\2\2\u0a93\u0a8d\3\2\2\2\u0a93\u0a8= f") - buf.write("\3\2\2\2\u0a93\u0a91\3\2\2\2\u0a94\u0155\3\2\2\2\u0a95"= ) - buf.write("\u0a96\7\u00cb\2\2\u0a96\u0aa1\5\u015a\u00ae\2\u0a97\u0= a98") - buf.write("\7\"\2\2\u0a98\u0aa2\5\u015a\u00ae\2\u0a99\u0a9a\7$\2") - buf.write("\2\u0a9a\u0aa2\5\u015a\u00ae\2\u0a9b\u0a9c\7%\2\2\u0a9c= ") - buf.write("\u0aa2\5\u015a\u00ae\2\u0a9d\u0a9e\7&\2\2\u0a9e\u0aa2") - buf.write("\5\u015a\u00ae\2\u0a9f\u0aa0\7\'\2\2\u0aa0\u0aa2\5\u015= a") - buf.write("\u00ae\2\u0aa1\u0a97\3\2\2\2\u0aa1\u0a99\3\2\2\2\u0aa1"= ) - buf.write("\u0a9b\3\2\2\2\u0aa1\u0a9d\3\2\2\2\u0aa1\u0a9f\3\2\2\2"= ) - buf.write("\u0aa2\u0157\3\2\2\2\u0aa3\u0aa4\7\u00cc\2\2\u0aa4\u0aa= 5") - buf.write("\5\u015a\u00ae\2\u0aa5\u0aa7\7\"\2\2\u0aa6\u0aa8\7\u00f= a") - buf.write("\2\2\u0aa7\u0aa6\3\2\2\2\u0aa8\u0aa9\3\2\2\2\u0aa9\u0aa= 7") - buf.write("\3\2\2\2\u0aa9\u0aaa\3\2\2\2\u0aaa\u0159\3\2\2\2\u0aab"= ) - buf.write("\u0aac\7\u00fb\2\2\u0aac\u0aad\7\32\2\2\u0aad\u0aae\7") - buf.write("\u00fa\2\2\u0aae\u0ab8\7\33\2\2\u0aaf\u0ab4\7\u00fb\2") - buf.write("\2\u0ab0\u0ab1\7\34\2\2\u0ab1\u0ab3\5\u015c\u00af\2\u0a= b2") - buf.write("\u0ab0\3\2\2\2\u0ab3\u0ab6\3\2\2\2\u0ab4\u0ab2\3\2\2\2"= ) - buf.write("\u0ab4\u0ab5\3\2\2\2\u0ab5\u0ab8\3\2\2\2\u0ab6\u0ab4\3"= ) - buf.write("\2\2\2\u0ab7\u0aab\3\2\2\2\u0ab7\u0aaf\3\2\2\2\u0ab8\u0= 15b") - buf.write("\3\2\2\2\u0ab9\u0abd\7\u00fb\2\2\u0aba\u0abb\7\32\2\2") - buf.write("\u0abb\u0abc\7\u00fa\2\2\u0abc\u0abe\7\33\2\2\u0abd\u0a= ba") - buf.write("\3\2\2\2\u0abd\u0abe\3\2\2\2\u0abe\u015d\3\2\2\2\u0abf"= ) - buf.write("\u0ac0\7\u00cd\2\2\u0ac0\u0ac1\7\30\2\2\u0ac1\u0ac2\t") - buf.write("\13\2\2\u0ac2\u0ac3\7\31\2\2\u0ac3\u015f\3\2\2\2\u0ac4"= ) - buf.write("\u0ac5\7\u00ce\2\2\u0ac5\u0ac6\7\30\2\2\u0ac6\u0ac7\7") - buf.write("\u00fb\2\2\u0ac7\u0ac8\7\31\2\2\u0ac8\u0161\3\2\2\2\u0a= c9") - buf.write("\u0aca\7\u00cf\2\2\u0aca\u0ad0\7\30\2\2\u0acb\u0acc\7") - buf.write("\u00ec\2\2\u0acc\u0acd\7\30\2\2\u0acd\u0ace\7\u00fa\2") - buf.write("\2\u0ace\u0ad1\7\31\2\2\u0acf\u0ad1\7\u00fa\2\2\u0ad0") - buf.write("\u0acb\3\2\2\2\u0ad0\u0acf\3\2\2\2\u0ad1\u0ad2\3\2\2\2"= ) - buf.write("\u0ad2\u0ad3\7\31\2\2\u0ad3\u0163\3\2\2\2\u0ad4\u0ad5") - buf.write("\7\u00d0\2\2\u0ad5\u0165\3\2\2\2\u0ad6\u0ad7\7\u00d1\2"= ) - buf.write("\2\u0ad7\u0ad8\7\30\2\2\u0ad8\u0ad9\5L\'\2\u0ad9\u0ada"= ) - buf.write("\7\31\2\2\u0ada\u0167\3\2\2\2\u0adb\u0adc\t\f\2\2\u0adc= ") - buf.write("\u0169\3\2\2\2\u0add\u0ade\7\u00d2\2\2\u0ade\u0adf\7\30= ") - buf.write("\2\2\u0adf\u0ae4\5X-\2\u0ae0\u0ae1\7(\2\2\u0ae1\u0ae2") - buf.write("\7@\2\2\u0ae2\u0ae3\7\b\2\2\u0ae3\u0ae5\5\u0168\u00b5") - buf.write("\2\u0ae4\u0ae0\3\2\2\2\u0ae4\u0ae5\3\2\2\2\u0ae5\u0ae6"= ) - buf.write("\3\2\2\2\u0ae6\u0ae7\7\31\2\2\u0ae7\u016b\3\2\2\2\u0ae8= ") - buf.write("\u0ae9\t\r\2\2\u0ae9\u016d\3\2\2\2\u0aea\u0af5\5\u0170"= ) - buf.write("\u00b9\2\u0aeb\u0af5\5\u0172\u00ba\2\u0aec\u0af5\5\u017= 4") - buf.write("\u00bb\2\u0aed\u0af5\5\u0176\u00bc\2\u0aee\u0af5\5\u017= 8") - buf.write("\u00bd\2\u0aef\u0af5\5\u017a\u00be\2\u0af0\u0af5\5\u017= c") - buf.write("\u00bf\2\u0af1\u0af5\5\u017e\u00c0\2\u0af2\u0af5\5\u018= 0") - buf.write("\u00c1\2\u0af3\u0af5\5\u0182\u00c2\2\u0af4\u0aea\3\2\2"= ) - buf.write("\2\u0af4\u0aeb\3\2\2\2\u0af4\u0aec\3\2\2\2\u0af4\u0aed"= ) - buf.write("\3\2\2\2\u0af4\u0aee\3\2\2\2\u0af4\u0aef\3\2\2\2\u0af4"= ) - buf.write("\u0af0\3\2\2\2\u0af4\u0af1\3\2\2\2\u0af4\u0af2\3\2\2\2"= ) - buf.write("\u0af4\u0af3\3\2\2\2\u0af5\u016f\3\2\2\2\u0af6\u0af7\7"= ) - buf.write("\u00da\2\2\u0af7\u0af8\7\30\2\2\u0af8\u0af9\5\u0126\u00= 94") - buf.write("\2\u0af9\u0afa\7\31\2\2\u0afa\u0171\3\2\2\2\u0afb\u0afc= ") - buf.write("\7\u00df\2\2\u0afc\u0afd\7\30\2\2\u0afd\u0afe\5\u0126") - buf.write("\u0094\2\u0afe\u0aff\7\31\2\2\u0aff\u0173\3\2\2\2\u0b00= ") - buf.write("\u0b01\7\u00e8\2\2\u0b01\u0b09\7\30\2\2\u0b02\u0b03\7") - buf.write("*\2\2\u0b03\u0b04\7\b\2\2\u0b04\u0b05\7\u00ec\2\2\u0b05= ") - buf.write("\u0b06\7\30\2\2\u0b06\u0b07\7\u00fa\2\2\u0b07\u0b08\7") - buf.write("\31\2\2\u0b08\u0b0a\7!\2\2\u0b09\u0b02\3\2\2\2\u0b09\u0= b0a") - buf.write("\3\2\2\2\u0b0a\u0b10\3\2\2\2\u0b0b\u0b0c\7[\2\2\u0b0c") - buf.write("\u0b0d\7\b\2\2\u0b0d\u0b0e\5L\'\2\u0b0e\u0b0f\7!\2\2\u0= b0f") - buf.write("\u0b11\3\2\2\2\u0b10\u0b0b\3\2\2\2\u0b10\u0b11\3\2\2\2"= ) - buf.write("\u0b11\u0b12\3\2\2\2\u0b12\u0b13\5\u0126\u0094\2\u0b13"= ) - buf.write("\u0b14\7\31\2\2\u0b14\u0175\3\2\2\2\u0b15\u0b16\7\u00e9= ") - buf.write("\2\2\u0b16\u0b17\7\30\2\2\u0b17\u0b18\5\u0126\u0094\2") - buf.write("\u0b18\u0b19\7\31\2\2\u0b19\u0177\3\2\2\2\u0b1a\u0b1b") - buf.write("\7\u00e0\2\2\u0b1b\u0b1c\7\30\2\2\u0b1c\u0b1d\5\u0126") - buf.write("\u0094\2\u0b1d\u0b1e\7\31\2\2\u0b1e\u0179\3\2\2\2\u0b1f= ") - buf.write("\u0b24\7\u00e1\2\2\u0b20\u0b21\7\21\2\2\u0b21\u0b22\7") - buf.write("\b\2\2\u0b22\u0b23\7\u00fa\2\2\u0b23\u0b25\7!\2\2\u0b24= ") - buf.write("\u0b20\3\2\2\2\u0b24\u0b25\3\2\2\2\u0b25\u0b26\3\2\2\2"= ) - buf.write("\u0b26\u0b27\7\30\2\2\u0b27\u0b28\5\u0126\u0094\2\u0b28= ") - buf.write("\u0b29\7\31\2\2\u0b29\u017b\3\2\2\2\u0b2a\u0b2b\7\u00e2= ") - buf.write("\2\2\u0b2b\u0b2c\7\30\2\2\u0b2c\u0b2d\5\u0126\u0094\2") - buf.write("\u0b2d\u0b2e\7\31\2\2\u0b2e\u017d\3\2\2\2\u0b2f\u0b30") - buf.write("\7\u00e3\2\2\u0b30\u0b31\7\30\2\2\u0b31\u0b32\5\u0126") - buf.write("\u0094\2\u0b32\u0b33\7\31\2\2\u0b33\u017f\3\2\2\2\u0b34= ") - buf.write("\u0b35\7\u00e4\2\2\u0b35\u0b36\7\30\2\2\u0b36\u0b37\5") - buf.write("\u0126\u0094\2\u0b37\u0b38\7\31\2\2\u0b38\u0181\3\2\2") - buf.write("\2\u0b39\u0b3a\7\u00de\2\2\u0b3a\u0b3b\7\30\2\2\u0b3b") - buf.write("\u0b40\5X-\2\u0b3c\u0b3d\7(\2\2\u0b3d\u0b3e\7@\2\2\u0b3= e") - buf.write("\u0b3f\7\b\2\2\u0b3f\u0b41\5\u0168\u00b5\2\u0b40\u0b3c"= ) - buf.write("\3\2\2\2\u0b40\u0b41\3\2\2\2\u0b41\u0b42\3\2\2\2\u0b42"= ) - buf.write("\u0b43\7!\2\2\u0b43\u0b44\5\u0126\u0094\2\u0b44\u0b45") - buf.write("\7\31\2\2\u0b45\u0183\3\2\2\2\u0b46\u0b4c\5\u0186\u00c4= ") - buf.write("\2\u0b47\u0b4c\5\u0188\u00c5\2\u0b48\u0b4c\5\u018c\u00c= 7") - buf.write("\2\u0b49\u0b4c\5\u018e\u00c8\2\u0b4a\u0b4c\5\u0190\u00c= 9") - buf.write("\2\u0b4b\u0b46\3\2\2\2\u0b4b\u0b47\3\2\2\2\u0b4b\u0b48"= ) - buf.write("\3\2\2\2\u0b4b\u0b49\3\2\2\2\u0b4b\u0b4a\3\2\2\2\u0b4c"= ) - buf.write("\u0185\3\2\2\2\u0b4d\u0b4e\7\u00c2\2\2\u0b4e\u0b4f\7\30= ") - buf.write("\2\2\u0b4f\u0b50\5\u0126\u0094\2\u0b50\u0b51\7\22\2\2") - buf.write("\u0b51\u0b52\5\u0126\u0094\2\u0b52\u0b53\7\36\2\2\u0b53= ") - buf.write("\u0b54\5\u0126\u0094\2\u0b54\u0b55\7\31\2\2\u0b55\u0187= ") - buf.write("\3\2\2\2\u0b56\u0b57\7\u00c3\2\2\u0b57\u0b58\7\30\2\2") - buf.write("\u0b58\u0b5d\5\u018a\u00c6\2\u0b59\u0b5a\7(\2\2\u0b5a") - buf.write("\u0b5c\5\u018a\u00c6\2\u0b5b\u0b59\3\2\2\2\u0b5c\u0b5f"= ) - buf.write("\3\2\2\2\u0b5d\u0b5b\3\2\2\2\u0b5d\u0b5e\3\2\2\2\u0b5e"= ) - buf.write("\u0b60\3\2\2\2\u0b5f\u0b5d\3\2\2\2\u0b60\u0b61\7!\2\2") - buf.write("\u0b61\u0b62\5\u0126\u0094\2\u0b62\u0b63\7!\2\2\u0b63") - buf.write("\u0b64\5\u0126\u0094\2\u0b64\u0b65\7!\2\2\u0b65\u0b66") - buf.write("\5\u0126\u0094\2\u0b66\u0b67\7\31\2\2\u0b67\u0189\3\2") - buf.write("\2\2\u0b68\u0b69\t\16\2\2\u0b69\u018b\3\2\2\2\u0b6a\u0b= 6b") - buf.write("\7\u00c4\2\2\u0b6b\u0b6c\7\30\2\2\u0b6c\u0b6d\5\u0126") - buf.write("\u0094\2\u0b6d\u0b6e\7!\2\2\u0b6e\u0b6f\5\u0126\u0094") - buf.write("\2\u0b6f\u0b70\7!\2\2\u0b70\u0b71\5\u0126\u0094\2\u0b71= ") - buf.write("\u0b72\7\31\2\2\u0b72\u018d\3\2\2\2\u0b73\u0b74\7\u00c5= ") - buf.write("\2\2\u0b74\u0b75\7\30\2\2\u0b75\u0b76\5\u0126\u0094\2") - buf.write("\u0b76\u0b77\7!\2\2\u0b77\u0b78\5\u0126\u0094\2\u0b78") - buf.write("\u0b79\7!\2\2\u0b79\u0b7a\5\u0126\u0094\2\u0b7a\u0b7b") - buf.write("\7\31\2\2\u0b7b\u018f\3\2\2\2\u0b7c\u0b7d\7\u00c6\2\2") - buf.write("\u0b7d\u0b7e\7\30\2\2\u0b7e\u0b7f\7@\2\2\u0b7f\u0b80\7"= ) - buf.write("\b\2\2\u0b80\u0b85\5\u0192\u00ca\2\u0b81\u0b82\7(\2\2") - buf.write("\u0b82\u0b84\5\u0192\u00ca\2\u0b83\u0b81\3\2\2\2\u0b84"= ) - buf.write("\u0b87\3\2\2\2\u0b85\u0b83\3\2\2\2\u0b85\u0b86\3\2\2\2"= ) - buf.write("\u0b86\u0b88\3\2\2\2\u0b87\u0b85\3\2\2\2\u0b88\u0b89\7"= ) - buf.write("!\2\2\u0b89\u0b8a\5\u0126\u0094\2\u0b8a\u0b8b\7!\2\2\u0= b8b") - buf.write("\u0b8c\5\u0126\u0094\2\u0b8c\u0b8d\7!\2\2\u0b8d\u0b8e") - buf.write("\5\u0126\u0094\2\u0b8e\u0b8f\7\31\2\2\u0b8f\u0191\3\2") - buf.write("\2\2\u0b90\u0b91\t\17\2\2\u0b91\u0193\3\2\2\2\u0b92\u0b= 93") - buf.write("\7\u00ea\2\2\u0b93\u0b94\7\30\2\2\u0b94\u0b95\5\u0126") - buf.write("\u0094\2\u0b95\u0b9d\7\36\2\2\u0b96\u0b97\5\u0124\u0093= ") - buf.write("\2\u0b97\u0b98\7!\2\2\u0b98\u0b99\5\u0124\u0093\2\u0b99= ") - buf.write("\u0b9a\7 \2\2\u0b9a\u0b9c\3\2\2\2\u0b9b\u0b96\3\2\2\2") - buf.write("\u0b9c\u0b9f\3\2\2\2\u0b9d\u0b9b\3\2\2\2\u0b9d\u0b9e\3"= ) - buf.write("\2\2\2\u0b9e\u0ba0\3\2\2\2\u0b9f\u0b9d\3\2\2\2\u0ba0\u0= ba1") - buf.write("\7\31\2\2\u0ba1\u0195\3\2\2\2\u00f0\u0199\u019b\u01a5") - buf.write("\u01a9\u01ac\u01b4\u01b9\u01bd\u01c0\u01c6\u01cb\u01cf"= ) - buf.write("\u01d2\u01d8\u01ea\u01ec\u01f4\u01fd\u0206\u020f\u0218"= ) - buf.write("\u0221\u022a\u0233\u023c\u0245\u024b\u0253\u025b\u0263"= ) - buf.write("\u0281\u0288\u028f\u0298\u029c\u02a0\u02a7\u02b1\u02be"= ) - buf.write("\u02cd\u02e2\u02e8\u0304\u030a\u0313\u0326\u0336\u0341"= ) - buf.write("\u0372\u0382\u0389\u038f\u03a7\u03b2\u03b5\u03b8\u03df"= ) - buf.write("\u03e3\u03f0\u03f7\u0409\u041e\u0433\u0439\u044f\u045c"= ) - buf.write("\u0460\u0465\u046b\u046e\u0472\u0476\u047d\u0497\u04a1"= ) - buf.write("\u04a9\u04ad\u04b3\u04b7\u04e5\u04e9\u04f0\u04f6\u04fa"= ) - buf.write("\u0503\u0508\u0514\u051f\u052c\u053d\u0542\u0547\u0558"= ) - buf.write("\u055d\u0562\u056a\u058a\u058f\u0594\u059e\u05a8\u05b4"= ) - buf.write("\u05b9\u05be\u05ca\u05cf\u05d4\u05de\u05e4\u05ff\u0605"= ) - buf.write("\u060f\u061d\u062a\u062f\u0633\u063e\u0644\u064f\u0658"= ) - buf.write("\u0662\u0674\u0679\u067d\u0688\u068e\u0698\u069f\u06a7"= ) - buf.write("\u06ae\u06ba\u06c5\u06c8\u06d3\u06d8\u06e2\u06e8\u06fb"= ) - buf.write("\u0701\u070b\u0711\u071f\u072a\u072f\u0738\u073f\u074a"= ) - buf.write("\u0751\u075b\u07a6\u07ab\u07ae\u07bf\u07c5\u07cc\u07d9"= ) - buf.write("\u0824\u0829\u082c\u083d\u0843\u084a\u0853\u0864\u086a"= ) - buf.write("\u0872\u0880\u0885\u0892\u0897\u08a4\u08a9\u08b0\u08be"= ) - buf.write("\u08c3\u08ca\u08df\u08e4\u08ed\u090e\u092e\u0931\u0937"= ) - buf.write("\u0941\u0954\u0961\u0967\u096d\u0973\u0979\u097f\u0985"= ) - buf.write("\u098b\u0991\u0997\u0999\u099e\u09a1\u09a7\u09ab\u09b4"= ) - buf.write("\u09ba\u09ca\u09d2\u09da\u09e2\u09ea\u09f1\u09f8\u09fe"= ) - buf.write("\u0a09\u0a0f\u0a16\u0a1c\u0a23\u0a29\u0a32\u0a39\u0a4a"= ) - buf.write("\u0a72\u0a85\u0a93\u0aa1\u0aa9\u0ab4\u0ab7\u0abd\u0ad0"= ) - buf.write("\u0ae4\u0af4\u0b09\u0b10\u0b24\u0b40\u0b4b\u0b5d\u0b85"= ) - buf.write("\u0b9d") + buf.write("\u00f8\u00fa\2\u0c71\2\u019d\3\2\2\2\4\u01a3\3\2\2\2\6"= ) + buf.write("\u01a5\3\2\2\2\b\u01af\3\2\2\2\n\u01b1\3\2\2\2\f\u01bc"= ) + buf.write("\3\2\2\2\16\u01ce\3\2\2\2\20\u01ef\3\2\2\2\22\u01f2\3") + buf.write("\2\2\2\24\u01fb\3\2\2\2\26\u0204\3\2\2\2\30\u020d\3\2") + buf.write("\2\2\32\u0216\3\2\2\2\34\u021f\3\2\2\2\36\u0228\3\2\2") + buf.write("\2 \u0231\3\2\2\2\"\u023a\3\2\2\2$\u0243\3\2\2\2&\u024c= ") + buf.write("\3\2\2\2(\u0254\3\2\2\2*\u025c\3\2\2\2,\u0264\3\2\2\2") + buf.write(".\u026c\3\2\2\2\60\u0298\3\2\2\2\62\u02a5\3\2\2\2\64\u0= 2ad") + buf.write("\3\2\2\2\66\u02af\3\2\2\28\u02b4\3\2\2\2:\u02c1\3\2\2") + buf.write("\2<\u02c3\3\2\2\2>\u02d4\3\2\2\2@\u02f6\3\2\2\2B\u0330"= ) + buf.write("\3\2\2\2D\u0332\3\2\2\2F\u034b\3\2\2\2H\u0352\3\2\2\2") + buf.write("J\u0359\3\2\2\2L\u0369\3\2\2\2N\u0379\3\2\2\2P\u037e\3"= ) + buf.write("\2\2\2R\u0385\3\2\2\2T\u0394\3\2\2\2V\u03aa\3\2\2\2X\u0= 3b8") + buf.write("\3\2\2\2Z\u03e6\3\2\2\2\\\u03e8\3\2\2\2^\u03ef\3\2\2\2"= ) + buf.write("`\u03f3\3\2\2\2b\u03f5\3\2\2\2d\u03fd\3\2\2\2f\u0421\3"= ) + buf.write("\2\2\2h\u0423\3\2\2\2j\u0442\3\2\2\2l\u0445\3\2\2\2n\u0= 448") + buf.write("\3\2\2\2p\u0452\3\2\2\2r\u0454\3\2\2\2t\u0479\3\2\2\2") + buf.write("v\u047b\3\2\2\2x\u0483\3\2\2\2z\u0485\3\2\2\2|\u04b6\3"= ) + buf.write("\2\2\2~\u04ba\3\2\2\2\u0080\u04bc\3\2\2\2\u0082\u0501") + buf.write("\3\2\2\2\u0084\u050b\3\2\2\2\u0086\u050d\3\2\2\2\u0088"= ) + buf.write("\u0522\3\2\2\2\u008a\u052f\3\2\2\2\u008c\u0531\3\2\2\2"= ) + buf.write("\u008e\u054c\3\2\2\2\u0090\u0567\3\2\2\2\u0092\u056f\3"= ) + buf.write("\2\2\2\u0094\u0574\3\2\2\2\u0096\u057c\3\2\2\2\u0098\u0= 581") + buf.write("\3\2\2\2\u009a\u0597\3\2\2\2\u009c\u05a1\3\2\2\2\u009e"= ) + buf.write("\u05ab\3\2\2\2\u00a0\u05ad\3\2\2\2\u00a2\u05c3\3\2\2\2"= ) + buf.write("\u00a4\u05d9\3\2\2\2\u00a6\u05e9\3\2\2\2\u00a8\u05ed\3"= ) + buf.write("\2\2\2\u00aa\u05ef\3\2\2\2\u00ac\u060d\3\2\2\2\u00ae\u0= 620") + buf.write("\3\2\2\2\u00b0\u0622\3\2\2\2\u00b2\u0626\3\2\2\2\u00b4"= ) + buf.write("\u062d\3\2\2\2\u00b6\u0632\3\2\2\2\u00b8\u0636\3\2\2\2"= ) + buf.write("\u00ba\u0638\3\2\2\2\u00bc\u064d\3\2\2\2\u00be\u065b\3"= ) + buf.write("\2\2\2\u00c0\u065d\3\2\2\2\u00c2\u0672\3\2\2\2\u00c4\u0= 67c") + buf.write("\3\2\2\2\u00c6\u0680\3\2\2\2\u00c8\u0682\3\2\2\2\u00ca"= ) + buf.write("\u0698\3\2\2\2\u00cc\u06ac\3\2\2\2\u00ce\u06bd\3\2\2\2"= ) + buf.write("\u00d0\u06bf\3\2\2\2\u00d2\u06d1\3\2\2\2\u00d4\u06db\3"= ) + buf.write("\2\2\2\u00d6\u06dd\3\2\2\2\u00d8\u06f9\3\2\2\2\u00da\u0= 704") + buf.write("\3\2\2\2\u00dc\u0706\3\2\2\2\u00de\u0728\3\2\2\2\u00e0"= ) + buf.write("\u0732\3\2\2\2\u00e2\u0734\3\2\2\2\u00e4\u0748\3\2\2\2"= ) + buf.write("\u00e6\u0754\3\2\2\2\u00e8\u0756\3\2\2\2\u00ea\u07b6\3"= ) + buf.write("\2\2\2\u00ec\u07ca\3\2\2\2\u00ee\u07d2\3\2\2\2\u00f0\u0= 7d4") + buf.write("\3\2\2\2\u00f2\u0834\3\2\2\2\u00f4\u0848\3\2\2\2\u00f6"= ) + buf.write("\u0850\3\2\2\2\u00f8\u0856\3\2\2\2\u00fa\u0858\3\2\2\2"= ) + buf.write("\u00fc\u085d\3\2\2\2\u00fe\u085f\3\2\2\2\u0100\u0867\3"= ) + buf.write("\2\2\2\u0102\u086d\3\2\2\2\u0104\u086f\3\2\2\2\u0106\u0= 87b") + buf.write("\3\2\2\2\u0108\u088d\3\2\2\2\u010a\u089f\3\2\2\2\u010c"= ) + buf.write("\u08b9\3\2\2\2\u010e\u08d3\3\2\2\2\u0110\u08f0\3\2\2\2"= ) + buf.write("\u0112\u08f2\3\2\2\2\u0114\u08fc\3\2\2\2\u0116\u0915\3"= ) + buf.write("\2\2\2\u0118\u093e\3\2\2\2\u011a\u0942\3\2\2\2\u011c\u0= 959") + buf.write("\3\2\2\2\u011e\u09b2\3\2\2\2\u0120\u09c3\3\2\2\2\u0122"= ) + buf.write("\u09c6\3\2\2\2\u0124\u09c8\3\2\2\2\u0126\u09d0\3\2\2\2"= ) + buf.write("\u0128\u09d8\3\2\2\2\u012a\u09e0\3\2\2\2\u012c\u09e8\3"= ) + buf.write("\2\2\2\u012e\u09f0\3\2\2\2\u0130\u09fb\3\2\2\2\u0132\u0= 9fd") + buf.write("\3\2\2\2\u0134\u0a0c\3\2\2\2\u0136\u0a0e\3\2\2\2\u0138"= ) + buf.write("\u0a19\3\2\2\2\u013a\u0a1b\3\2\2\2\u013c\u0a26\3\2\2\2"= ) + buf.write("\u013e\u0a28\3\2\2\2\u0140\u0a35\3\2\2\2\u0142\u0a3a\3"= ) + buf.write("\2\2\2\u0144\u0a3f\3\2\2\2\u0146\u0a4e\3\2\2\2\u0148\u0= a50") + buf.write("\3\2\2\2\u014a\u0a57\3\2\2\2\u014c\u0a5e\3\2\2\2\u014e"= ) + buf.write("\u0a67\3\2\2\2\u0150\u0a76\3\2\2\2\u0152\u0a78\3\2\2\2"= ) + buf.write("\u0154\u0a7a\3\2\2\2\u0156\u0a8b\3\2\2\2\u0158\u0a99\3"= ) + buf.write("\2\2\2\u015a\u0aa7\3\2\2\2\u015c\u0abb\3\2\2\2\u015e\u0= abd") + buf.write("\3\2\2\2\u0160\u0ac3\3\2\2\2\u0162\u0ac8\3\2\2\2\u0164"= ) + buf.write("\u0acd\3\2\2\2\u0166\u0ad8\3\2\2\2\u0168\u0ada\3\2\2\2"= ) + buf.write("\u016a\u0adf\3\2\2\2\u016c\u0ae1\3\2\2\2\u016e\u0aec\3"= ) + buf.write("\2\2\2\u0170\u0af8\3\2\2\2\u0172\u0afa\3\2\2\2\u0174\u0= aff") + buf.write("\3\2\2\2\u0176\u0b04\3\2\2\2\u0178\u0b19\3\2\2\2\u017a"= ) + buf.write("\u0b1e\3\2\2\2\u017c\u0b23\3\2\2\2\u017e\u0b2e\3\2\2\2"= ) + buf.write("\u0180\u0b33\3\2\2\2\u0182\u0b38\3\2\2\2\u0184\u0b3d\3"= ) + buf.write("\2\2\2\u0186\u0b4f\3\2\2\2\u0188\u0b51\3\2\2\2\u018a\u0= b5a") + buf.write("\3\2\2\2\u018c\u0b6c\3\2\2\2\u018e\u0b6e\3\2\2\2\u0190"= ) + buf.write("\u0b77\3\2\2\2\u0192\u0b80\3\2\2\2\u0194\u0b94\3\2\2\2"= ) + buf.write("\u0196\u0b96\3\2\2\2\u0198\u019c\5\n\6\2\u0199\u019c\5"= ) + buf.write("\f\7\2\u019a\u019c\5\16\b\2\u019b\u0198\3\2\2\2\u019b") + buf.write("\u0199\3\2\2\2\u019b\u019a\3\2\2\2\u019c\u019f\3\2\2\2"= ) + buf.write("\u019d\u019b\3\2\2\2\u019d\u019e\3\2\2\2\u019e\u01a1\3"= ) + buf.write("\2\2\2\u019f\u019d\3\2\2\2\u01a0\u01a2\5.\30\2\u01a1\u0= 1a0") + buf.write("\3\2\2\2\u01a1\u01a2\3\2\2\2\u01a2\3\3\2\2\2\u01a3\u01a= 4") + buf.write("\7\3\2\2\u01a4\5\3\2\2\2\u01a5\u01a8\t\2\2\2\u01a6\u01a= 7") + buf.write("\7!\2\2\u01a7\u01a9\7\u00fb\2\2\u01a8\u01a6\3\2\2\2\u01= a8") + buf.write("\u01a9\3\2\2\2\u01a9\u01ac\3\2\2\2\u01aa\u01ab\7!\2\2") + buf.write("\u01ab\u01ad\7\u00fa\2\2\u01ac\u01aa\3\2\2\2\u01ac\u01a= d") + buf.write("\3\2\2\2\u01ad\7\3\2\2\2\u01ae\u01b0\7\u00fa\2\2\u01af"= ) + buf.write("\u01ae\3\2\2\2\u01af\u01b0\3\2\2\2\u01b0\t\3\2\2\2\u01b= 1") + buf.write("\u01b2\7\6\2\2\u01b2\u01b3\7\7\2\2\u01b3\u01b7\7\30\2") + buf.write("\2\u01b4\u01b8\5\4\3\2\u01b5\u01b8\5\6\4\2\u01b6\u01b8"= ) + buf.write("\5\b\5\2\u01b7\u01b4\3\2\2\2\u01b7\u01b5\3\2\2\2\u01b7"= ) + buf.write("\u01b6\3\2\2\2\u01b7\u01b8\3\2\2\2\u01b8\u01b9\3\2\2\2"= ) + buf.write("\u01b9\u01ba\7\31\2\2\u01ba\13\3\2\2\2\u01bb\u01bd\7\u0= 084") + buf.write("\2\2\u01bc\u01bb\3\2\2\2\u01bc\u01bd\3\2\2\2\u01bd\u01b= e") + buf.write("\3\2\2\2\u01be\u01c0\7P\2\2\u01bf\u01c1\7O\2\2\u01c0\u0= 1bf") + buf.write("\3\2\2\2\u01c0\u01c1\3\2\2\2\u01c1\u01c3\3\2\2\2\u01c2"= ) + buf.write("\u01c4\7\u00fb\2\2\u01c3\u01c2\3\2\2\2\u01c3\u01c4\3\2"= ) + buf.write("\2\2\u01c4\u01c5\3\2\2\2\u01c5\u01c6\7\26\2\2\u01c6\u01= c7") + buf.write("\5\20\t\2\u01c7\u01c9\7\27\2\2\u01c8\u01ca\7\u00fb\2\2"= ) + buf.write("\u01c9\u01c8\3\2\2\2\u01c9\u01ca\3\2\2\2\u01ca\u01cb\3"= ) + buf.write("\2\2\2\u01cb\u01cc\7 \2\2\u01cc\r\3\2\2\2\u01cd\u01cf") + buf.write("\7\u0084\2\2\u01ce\u01cd\3\2\2\2\u01ce\u01cf\3\2\2\2\u0= 1cf") + buf.write("\u01d0\3\2\2\2\u01d0\u01d2\7Q\2\2\u01d1\u01d3\7O\2\2\u0= 1d2") + buf.write("\u01d1\3\2\2\2\u01d2\u01d3\3\2\2\2\u01d3\u01d5\3\2\2\2"= ) + buf.write("\u01d4\u01d6\7\u00fb\2\2\u01d5\u01d4\3\2\2\2\u01d5\u01d= 6") + buf.write("\3\2\2\2\u01d6\u01d7\3\2\2\2\u01d7\u01d8\7\26\2\2\u01d8= ") + buf.write("\u01d9\5\20\t\2\u01d9\u01db\7\27\2\2\u01da\u01dc\7\u00f= b") + buf.write("\2\2\u01db\u01da\3\2\2\2\u01db\u01dc\3\2\2\2\u01dc\u01d= d") + buf.write("\3\2\2\2\u01dd\u01de\7 \2\2\u01de\17\3\2\2\2\u01df\u01e= e") + buf.write("\5\22\n\2\u01e0\u01ee\5\24\13\2\u01e1\u01ee\5\26\f\2\u0= 1e2") + buf.write("\u01ee\5\30\r\2\u01e3\u01ee\5\32\16\2\u01e4\u01ee\5\34"= ) + buf.write("\17\2\u01e5\u01ee\5\36\20\2\u01e6\u01ee\5 \21\2\u01e7") + buf.write("\u01ee\5\"\22\2\u01e8\u01ee\5$\23\2\u01e9\u01ee\5&\24") + buf.write("\2\u01ea\u01ee\5(\25\2\u01eb\u01ee\5*\26\2\u01ec\u01ee"= ) + buf.write("\5,\27\2\u01ed\u01df\3\2\2\2\u01ed\u01e0\3\2\2\2\u01ed"= ) + buf.write("\u01e1\3\2\2\2\u01ed\u01e2\3\2\2\2\u01ed\u01e3\3\2\2\2"= ) + buf.write("\u01ed\u01e4\3\2\2\2\u01ed\u01e5\3\2\2\2\u01ed\u01e6\3"= ) + buf.write("\2\2\2\u01ed\u01e7\3\2\2\2\u01ed\u01e8\3\2\2\2\u01ed\u0= 1e9") + buf.write("\3\2\2\2\u01ed\u01ea\3\2\2\2\u01ed\u01eb\3\2\2\2\u01ed"= ) + buf.write("\u01ec\3\2\2\2\u01ee\u01f1\3\2\2\2\u01ef\u01ed\3\2\2\2"= ) + buf.write("\u01ef\u01f0\3\2\2\2\u01f0\21\3\2\2\2\u01f1\u01ef\3\2") + buf.write("\2\2\u01f2\u01f3\7S\2\2\u01f3\u01f7\7\u00fb\2\2\u01f4") + buf.write("\u01f5\7\32\2\2\u01f5\u01f6\7\u00fa\2\2\u01f6\u01f8\7") + buf.write("\33\2\2\u01f7\u01f4\3\2\2\2\u01f7\u01f8\3\2\2\2\u01f8") + buf.write("\u01f9\3\2\2\2\u01f9\u01fa\7 \2\2\u01fa\23\3\2\2\2\u01f= b") + buf.write("\u01fc\7T\2\2\u01fc\u0200\7\u00fb\2\2\u01fd\u01fe\7\32"= ) + buf.write("\2\2\u01fe\u01ff\7\u00fa\2\2\u01ff\u0201\7\33\2\2\u0200= ") + buf.write("\u01fd\3\2\2\2\u0200\u0201\3\2\2\2\u0201\u0202\3\2\2\2"= ) + buf.write("\u0202\u0203\7 \2\2\u0203\25\3\2\2\2\u0204\u0205\7U\2") + buf.write("\2\u0205\u0209\7\u00fb\2\2\u0206\u0207\7\32\2\2\u0207") + buf.write("\u0208\7\u00fa\2\2\u0208\u020a\7\33\2\2\u0209\u0206\3") + buf.write("\2\2\2\u0209\u020a\3\2\2\2\u020a\u020b\3\2\2\2\u020b\u0= 20c") + buf.write("\7 \2\2\u020c\27\3\2\2\2\u020d\u020e\7V\2\2\u020e\u0212= ") + buf.write("\7\u00fb\2\2\u020f\u0210\7\32\2\2\u0210\u0211\7\u00fa") + buf.write("\2\2\u0211\u0213\7\33\2\2\u0212\u020f\3\2\2\2\u0212\u02= 13") + buf.write("\3\2\2\2\u0213\u0214\3\2\2\2\u0214\u0215\7 \2\2\u0215") + buf.write("\31\3\2\2\2\u0216\u0217\7R\2\2\u0217\u021b\7\u00fb\2\2"= ) + buf.write("\u0218\u0219\7\32\2\2\u0219\u021a\7\u00fa\2\2\u021a\u02= 1c") + buf.write("\7\33\2\2\u021b\u0218\3\2\2\2\u021b\u021c\3\2\2\2\u021c= ") + buf.write("\u021d\3\2\2\2\u021d\u021e\7 \2\2\u021e\33\3\2\2\2\u021= f") + buf.write("\u0220\7W\2\2\u0220\u0224\7\u00fb\2\2\u0221\u0222\7\32"= ) + buf.write("\2\2\u0222\u0223\7\u00fa\2\2\u0223\u0225\7\33\2\2\u0224= ") + buf.write("\u0221\3\2\2\2\u0224\u0225\3\2\2\2\u0225\u0226\3\2\2\2"= ) + buf.write("\u0226\u0227\7 \2\2\u0227\35\3\2\2\2\u0228\u0229\7X\2") + buf.write("\2\u0229\u022d\7\u00fb\2\2\u022a\u022b\7\32\2\2\u022b") + buf.write("\u022c\7\u00fa\2\2\u022c\u022e\7\33\2\2\u022d\u022a\3") + buf.write("\2\2\2\u022d\u022e\3\2\2\2\u022e\u022f\3\2\2\2\u022f\u0= 230") + buf.write("\7 \2\2\u0230\37\3\2\2\2\u0231\u0232\7Y\2\2\u0232\u0236= ") + buf.write("\7\u00fb\2\2\u0233\u0234\7\32\2\2\u0234\u0235\7\u00fa") + buf.write("\2\2\u0235\u0237\7\33\2\2\u0236\u0233\3\2\2\2\u0236\u02= 37") + buf.write("\3\2\2\2\u0237\u0238\3\2\2\2\u0238\u0239\7 \2\2\u0239") + buf.write("!\3\2\2\2\u023a\u023b\7Z\2\2\u023b\u023f\7\u00fb\2\2\u0= 23c") + buf.write("\u023d\7\32\2\2\u023d\u023e\7\u00fa\2\2\u023e\u0240\7") + buf.write("\33\2\2\u023f\u023c\3\2\2\2\u023f\u0240\3\2\2\2\u0240") + buf.write("\u0241\3\2\2\2\u0241\u0242\7 \2\2\u0242#\3\2\2\2\u0243"= ) + buf.write("\u0244\7\u00fb\2\2\u0244\u0248\7\u00fb\2\2\u0245\u0246"= ) + buf.write("\7\32\2\2\u0246\u0247\7\u00fa\2\2\u0247\u0249\7\33\2\2"= ) + buf.write("\u0248\u0245\3\2\2\2\u0248\u0249\3\2\2\2\u0249\u024a\3"= ) + buf.write("\2\2\2\u024a\u024b\7 \2\2\u024b%\3\2\2\2\u024c\u024e\7"= ) + buf.write("S\2\2\u024d\u024f\7\u00fb\2\2\u024e\u024d\3\2\2\2\u024e= ") + buf.write("\u024f\3\2\2\2\u024f\u0250\3\2\2\2\u0250\u0251\7\36\2") + buf.write("\2\u0251\u0252\7\u00fa\2\2\u0252\u0253\7 \2\2\u0253\'") + buf.write("\3\2\2\2\u0254\u0256\7T\2\2\u0255\u0257\7\u00fb\2\2\u02= 56") + buf.write("\u0255\3\2\2\2\u0256\u0257\3\2\2\2\u0257\u0258\3\2\2\2"= ) + buf.write("\u0258\u0259\7\36\2\2\u0259\u025a\7\u00fa\2\2\u025a\u02= 5b") + buf.write("\7 \2\2\u025b)\3\2\2\2\u025c\u025e\7U\2\2\u025d\u025f") + buf.write("\7\u00fb\2\2\u025e\u025d\3\2\2\2\u025e\u025f\3\2\2\2\u0= 25f") + buf.write("\u0260\3\2\2\2\u0260\u0261\7\36\2\2\u0261\u0262\7\u00fa= ") + buf.write("\2\2\u0262\u0263\7 \2\2\u0263+\3\2\2\2\u0264\u0266\7V") + buf.write("\2\2\u0265\u0267\7\u00fb\2\2\u0266\u0265\3\2\2\2\u0266"= ) + buf.write("\u0267\3\2\2\2\u0267\u0268\3\2\2\2\u0268\u0269\7\36\2") + buf.write("\2\u0269\u026a\7\u00fa\2\2\u026a\u026b\7 \2\2\u026b-\3"= ) + buf.write("\2\2\2\u026c\u026d\7+\2\2\u026d\u026e\7[\2\2\u026e\u026= f") + buf.write("\7\b\2\2\u026f\u0270\5L\'\2\u0270\u0271\7!\2\2\u0271\u0= 272") + buf.write("\7.\2\2\u0272\u0273\7\b\2\2\u0273\u0274\7\u00ec\2\2\u02= 74") + buf.write("\u0275\7\30\2\2\u0275\u0276\7\u00fa\2\2\u0276\u0277\7") + buf.write("\31\2\2\u0277\u0278\7!\2\2\u0278\u0279\7=3D\2\2\u0279\u= 027a") + buf.write("\7\b\2\2\u027a\u027b\7\u00ec\2\2\u027b\u027c\7\30\2\2") + buf.write("\u027c\u027d\7\u00fa\2\2\u027d\u027e\7\31\2\2\u027e\u02= 84") + buf.write("\7!\2\2\u027f\u0280\7\u0083\2\2\u0280\u0281\7\b\2\2\u02= 81") + buf.write("\u0282\5\60\31\2\u0282\u0283\7!\2\2\u0283\u0285\3\2\2") + buf.write("\2\u0284\u027f\3\2\2\2\u0284\u0285\3\2\2\2\u0285\u028b"= ) + buf.write("\3\2\2\2\u0286\u0287\7\u0081\2\2\u0287\u0288\7\b\2\2\u0= 288") + buf.write("\u0289\5\62\32\2\u0289\u028a\7!\2\2\u028a\u028c\3\2\2") + buf.write("\2\u028b\u0286\3\2\2\2\u028b\u028c\3\2\2\2\u028c\u0292"= ) + buf.write("\3\2\2\2\u028d\u028e\7\u0082\2\2\u028e\u028f\7\b\2\2\u0= 28f") + buf.write("\u0290\5\66\34\2\u0290\u0291\7!\2\2\u0291\u0293\3\2\2") + buf.write("\2\u0292\u028d\3\2\2\2\u0292\u0293\3\2\2\2\u0293\u0294"= ) + buf.write("\3\2\2\2\u0294\u0295\58\35\2\u0295\u0296\7-\2\2\u0296") + buf.write("\u0297\7 \2\2\u0297/\3\2\2\2\u0298\u029b\5L\'\2\u0299") + buf.write("\u029a\7(\2\2\u029a\u029c\5L\'\2\u029b\u0299\3\2\2\2\u0= 29b") + buf.write("\u029c\3\2\2\2\u029c\u029f\3\2\2\2\u029d\u029e\7(\2\2") + buf.write("\u029e\u02a0\5L\'\2\u029f\u029d\3\2\2\2\u029f\u02a0\3") + buf.write("\2\2\2\u02a0\u02a3\3\2\2\2\u02a1\u02a2\7(\2\2\u02a2\u02= a4") + buf.write("\5L\'\2\u02a3\u02a1\3\2\2\2\u02a3\u02a4\3\2\2\2\u02a4") + buf.write("\61\3\2\2\2\u02a5\u02aa\5\64\33\2\u02a6\u02a7\7(\2\2\u0= 2a7") + buf.write("\u02a9\5\64\33\2\u02a8\u02a6\3\2\2\2\u02a9\u02ac\3\2\2"= ) + buf.write("\2\u02aa\u02a8\3\2\2\2\u02aa\u02ab\3\2\2\2\u02ab\63\3") + buf.write("\2\2\2\u02ac\u02aa\3\2\2\2\u02ad\u02ae\t\3\2\2\u02ae\65= ") + buf.write("\3\2\2\2\u02af\u02b0\t\4\2\2\u02b0\67\3\2\2\2\u02b1\u02= b3") + buf.write("\5:\36\2\u02b2\u02b1\3\2\2\2\u02b3\u02b6\3\2\2\2\u02b4"= ) + buf.write("\u02b2\3\2\2\2\u02b4\u02b5\3\2\2\2\u02b59\3\2\2\2\u02b6= ") + buf.write("\u02b4\3\2\2\2\u02b7\u02c2\5d\63\2\u02b8\u02c2\5h\65\2"= ) + buf.write("\u02b9\u02c2\5j\66\2\u02ba\u02c2\5> \2\u02bb\u02c2\5@") + buf.write("!\2\u02bc\u02c2\5D#\2\u02bd\u02c2\5<\37\2\u02be\u02c2") + buf.write("\5F$\2\u02bf\u02c2\5H%\2\u02c0\u02c2\5\u011c\u008f\2\u0= 2c1") + buf.write("\u02b7\3\2\2\2\u02c1\u02b8\3\2\2\2\u02c1\u02b9\3\2\2\2"= ) + buf.write("\u02c1\u02ba\3\2\2\2\u02c1\u02bb\3\2\2\2\u02c1\u02bc\3"= ) + buf.write("\2\2\2\u02c1\u02bd\3\2\2\2\u02c1\u02be\3\2\2\2\u02c1\u0= 2bf") + buf.write("\3\2\2\2\u02c1\u02c0\3\2\2\2\u02c2;\3\2\2\2\u02c3\u02c4= ") + buf.write("\7\u009b\2\2\u02c4\u02c5\7\u00fb\2\2\u02c5\u02c6\7!\2") + buf.write("\2\u02c6\u02c7\7\62\2\2\u02c7\u02c8\7\b\2\2\u02c8\u02c9= ") + buf.write("\7\u00ec\2\2\u02c9\u02ca\7\30\2\2\u02ca\u02cb\7\u00fa") + buf.write("\2\2\u02cb\u02d0\7\31\2\2\u02cc\u02cd\7!\2\2\u02cd\u02c= e") + buf.write("\7\u009c\2\2\u02ce\u02cf\7\b\2\2\u02cf\u02d1\7\u00fa\2"= ) + buf.write("\2\u02d0\u02cc\3\2\2\2\u02d0\u02d1\3\2\2\2\u02d1\u02d2"= ) + buf.write("\3\2\2\2\u02d2\u02d3\7 \2\2\u02d3=3D\3\2\2\2\u02d4\u02e= 5") + buf.write("\7\u009d\2\2\u02d5\u02d6\7\u00fb\2\2\u02d6\u02e6\7!\2") + buf.write("\2\u02d7\u02d8\7V\2\2\u02d8\u02e6\7!\2\2\u02d9\u02da\7"= ) + buf.write("U\2\2\u02da\u02e6\7!\2\2\u02db\u02dc\7T\2\2\u02dc\u02e6= ") + buf.write("\7!\2\2\u02dd\u02de\7S\2\2\u02de\u02e6\7!\2\2\u02df\u02= e0") + buf.write("\7X\2\2\u02e0\u02e6\7!\2\2\u02e1\u02e2\7Y\2\2\u02e2\u02= e6") + buf.write("\7!\2\2\u02e3\u02e4\7Z\2\2\u02e4\u02e6\7!\2\2\u02e5\u02= d5") + buf.write("\3\2\2\2\u02e5\u02d7\3\2\2\2\u02e5\u02d9\3\2\2\2\u02e5"= ) + buf.write("\u02db\3\2\2\2\u02e5\u02dd\3\2\2\2\u02e5\u02df\3\2\2\2"= ) + buf.write("\u02e5\u02e1\3\2\2\2\u02e5\u02e3\3\2\2\2\u02e6\u02eb\3"= ) + buf.write("\2\2\2\u02e7\u02e8\7\u008f\2\2\u02e8\u02e9\7\b\2\2\u02e= 9") + buf.write("\u02ea\7\u00fa\2\2\u02ea\u02ec\7!\2\2\u02eb\u02e7\3\2") + buf.write("\2\2\u02eb\u02ec\3\2\2\2\u02ec\u02ed\3\2\2\2\u02ed\u02e= e") + buf.write("\7\u008e\2\2\u02ee\u02ef\7\b\2\2\u02ef\u02f0\7\u00fb\2"= ) + buf.write("\2\u02f0\u02f1\7!\2\2\u02f1\u02f2\7[\2\2\u02f2\u02f3\7"= ) + buf.write("\b\2\2\u02f3\u02f4\5L\'\2\u02f4\u02f5\7 \2\2\u02f5?\3") + buf.write("\2\2\2\u02f6\u0307\7\u009e\2\2\u02f7\u02f8\7\u00fb\2\2"= ) + buf.write("\u02f8\u0308\7!\2\2\u02f9\u02fa\7V\2\2\u02fa\u0308\7!") + buf.write("\2\2\u02fb\u02fc\7U\2\2\u02fc\u0308\7!\2\2\u02fd\u02fe"= ) + buf.write("\7T\2\2\u02fe\u0308\7!\2\2\u02ff\u0300\7S\2\2\u0300\u03= 08") + buf.write("\7!\2\2\u0301\u0302\7X\2\2\u0302\u0308\7!\2\2\u0303\u03= 04") + buf.write("\7Y\2\2\u0304\u0308\7!\2\2\u0305\u0306\7Z\2\2\u0306\u03= 08") + buf.write("\7!\2\2\u0307\u02f7\3\2\2\2\u0307\u02f9\3\2\2\2\u0307") + buf.write("\u02fb\3\2\2\2\u0307\u02fd\3\2\2\2\u0307\u02ff\3\2\2\2"= ) + buf.write("\u0307\u0301\3\2\2\2\u0307\u0303\3\2\2\2\u0307\u0305\3"= ) + buf.write("\2\2\2\u0308\u030d\3\2\2\2\u0309\u030a\7\u008f\2\2\u030= a") + buf.write("\u030b\7\b\2\2\u030b\u030c\7\u00fa\2\2\u030c\u030e\7!") + buf.write("\2\2\u030d\u0309\3\2\2\2\u030d\u030e\3\2\2\2\u030e\u030= f") + buf.write("\3\2\2\2\u030f\u0310\7\u009c\2\2\u0310\u0311\7\b\2\2\u0= 311") + buf.write("\u0316\5B\"\2\u0312\u0313\7(\2\2\u0313\u0315\5B\"\2\u03= 14") + buf.write("\u0312\3\2\2\2\u0315\u0318\3\2\2\2\u0316\u0314\3\2\2\2"= ) + buf.write("\u0316\u0317\3\2\2\2\u0317\u0319\3\2\2\2\u0318\u0316\3"= ) + buf.write("\2\2\2\u0319\u0329\7!\2\2\u031a\u031b\7\u008e\2\2\u031b= ") + buf.write("\u031c\7\b\2\2\u031c\u031d\7\u00fb\2\2\u031d\u032a\7!") + buf.write("\2\2\u031e\u031f\7\u008e\2\2\u031f\u0320\7\b\2\2\u0320"= ) + buf.write("\u0321\7\u00ec\2\2\u0321\u0322\7\30\2\2\u0322\u0323\7") + buf.write("\u00fa\2\2\u0323\u0324\7\31\2\2\u0324\u0325\7!\2\2\u032= 5") + buf.write("\u0326\7\u009f\2\2\u0326\u0327\7\b\2\2\u0327\u0328\7\u0= 0fa") + buf.write("\2\2\u0328\u032a\7!\2\2\u0329\u031a\3\2\2\2\u0329\u031e= ") + buf.write("\3\2\2\2\u032a\u032b\3\2\2\2\u032b\u032c\7[\2\2\u032c") + buf.write("\u032d\7\b\2\2\u032d\u032e\5L\'\2\u032e\u032f\7 \2\2\u0= 32f") + buf.write("A\3\2\2\2\u0330\u0331\7\u00fa\2\2\u0331C\3\2\2\2\u0332"= ) + buf.write("\u0333\7\u00a0\2\2\u0333\u0334\7\u00fb\2\2\u0334\u0339"= ) + buf.write("\7!\2\2\u0335\u0336\7\u008f\2\2\u0336\u0337\7\b\2\2\u03= 37") + buf.write("\u0338\7\u00fa\2\2\u0338\u033a\7!\2\2\u0339\u0335\3\2") + buf.write("\2\2\u0339\u033a\3\2\2\2\u033a\u0342\3\2\2\2\u033b\u033= c") + buf.write("\7\u008e\2\2\u033c\u033d\7\b\2\2\u033d\u033e\7\u00ec\2"= ) + buf.write("\2\u033e\u033f\7\30\2\2\u033f\u0340\7\u00fa\2\2\u0340") + buf.write("\u0341\7\31\2\2\u0341\u0343\7!\2\2\u0342\u033b\3\2\2\2"= ) + buf.write("\u0343\u0344\3\2\2\2\u0344\u0342\3\2\2\2\u0344\u0345\3"= ) + buf.write("\2\2\2\u0345\u0346\3\2\2\2\u0346\u0347\7[\2\2\u0347\u03= 48") + buf.write("\7\b\2\2\u0348\u0349\5L\'\2\u0349\u034a\7 \2\2\u034aE") + buf.write("\3\2\2\2\u034b\u034c\7l\2\2\u034c\u034d\5\u0124\u0093") + buf.write("\2\u034d\u034e\7 \2\2\u034e\u034f\58\35\2\u034f\u0350") + buf.write("\7s\2\2\u0350\u0351\7 \2\2\u0351G\3\2\2\2\u0352\u0353") + buf.write("\7k\2\2\u0353\u0354\5\u0124\u0093\2\u0354\u0355\7 \2\2"= ) + buf.write("\u0355\u0356\58\35\2\u0356\u0357\7s\2\2\u0357\u0358\7") + buf.write(" \2\2\u0358I\3\2\2\2\u0359\u035a\7\u00fa\2\2\u035a\u035= b") + buf.write("\7!\2\2\u035b\u035c\7\u00fa\2\2\u035c\u035d\7!\2\2\u035= d") + buf.write("\u035e\7\u00fa\2\2\u035e\u035f\7!\2\2\u035f\u0360\7\u00= fa") + buf.write("\2\2\u0360\u0361\7!\2\2\u0361\u0362\7\u00fa\2\2\u0362") + buf.write("\u0363\7!\2\2\u0363\u0364\7\u00fa\2\2\u0364\u0365\7!\2"= ) + buf.write("\2\u0365\u0366\7\u00fa\2\2\u0366\u0367\7!\2\2\u0367\u03= 68") + buf.write("\7\u00fa\2\2\u0368K\3\2\2\2\u0369\u036a\7\26\2\2\u036a"= ) + buf.write("\u036b\7\u00fa\2\2\u036b\u036c\7!\2\2\u036c\u036d\7\u00= fa") + buf.write("\2\2\u036d\u036e\7!\2\2\u036e\u036f\7\u00fa\2\2\u036f") + buf.write("\u0375\7!\2\2\u0370\u0371\7\26\2\2\u0371\u0372\5J&\2\u0= 372") + buf.write("\u0373\7\27\2\2\u0373\u0376\3\2\2\2\u0374\u0376\5J&\2") + buf.write("\u0375\u0370\3\2\2\2\u0375\u0374\3\2\2\2\u0376\u0377\3"= ) + buf.write("\2\2\2\u0377\u0378\7\27\2\2\u0378M\3\2\2\2\u0379\u037a"= ) + buf.write("\7\u00ec\2\2\u037a\u037b\7\30\2\2\u037b\u037c\7\u00fa") + buf.write("\2\2\u037c\u037d\7\31\2\2\u037dO\3\2\2\2\u037e\u037f\5"= ) + buf.write("R*\2\u037f\u0380\5T+\2\u0380Q\3\2\2\2\u0381\u0382\7\u00= 8e") + buf.write("\2\2\u0382\u0383\7\b\2\2\u0383\u0384\7\u00fb\2\2\u0384"= ) + buf.write("\u0386\7!\2\2\u0385\u0381\3\2\2\2\u0385\u0386\3\2\2\2") + buf.write("\u0386\u038c\3\2\2\2\u0387\u0388\7\u008f\2\2\u0388\u038= 9") + buf.write("\7\b\2\2\u0389\u038a\5X-\2\u038a\u038b\7!\2\2\u038b\u03= 8d") + buf.write("\3\2\2\2\u038c\u0387\3\2\2\2\u038c\u038d\3\2\2\2\u038d"= ) + buf.write("\u0392\3\2\2\2\u038e\u038f\7\u0091\2\2\u038f\u0390\7\b"= ) + buf.write("\2\2\u0390\u0391\7\u00fa\2\2\u0391\u0393\7!\2\2\u0392") + buf.write("\u038e\3\2\2\2\u0392\u0393\3\2\2\2\u0393S\3\2\2\2\u0394= ") + buf.write("\u0395\7\62\2\2\u0395\u0396\7\b\2\2\u0396\u0397\7\u00ec= ") + buf.write("\2\2\u0397\u0398\7\30\2\2\u0398\u0399\7\u00fa\2\2\u0399= ") + buf.write("\u039a\7\31\2\2\u039a\u039b\7!\2\2\u039b\u039c\7=3D\2\2= ") + buf.write("\u039c\u039d\7\b\2\2\u039d\u039e\7\u00ec\2\2\u039e\u039= f") + buf.write("\7\30\2\2\u039f\u03a0\7\u00fa\2\2\u03a0\u03a1\7\31\2\2"= ) + buf.write("\u03a1U\3\2\2\2\u03a2\u03ab\7~\2\2\u03a3\u03ab\7y\2\2") + buf.write("\u03a4\u03ab\7{\2\2\u03a5\u03ab\7\u0080\2\2\u03a6\u03ab= ") + buf.write("\7|\2\2\u03a7\u03ab\7\177\2\2\u03a8\u03ab\7z\2\2\u03a9"= ) + buf.write("\u03ab\7}\2\2\u03aa\u03a2\3\2\2\2\u03aa\u03a3\3\2\2\2") + buf.write("\u03aa\u03a4\3\2\2\2\u03aa\u03a5\3\2\2\2\u03aa\u03a6\3"= ) + buf.write("\2\2\2\u03aa\u03a7\3\2\2\2\u03aa\u03a8\3\2\2\2\u03aa\u0= 3a9") + buf.write("\3\2\2\2\u03abW\3\2\2\2\u03ac\u03ad\7\u00fb\2\2\u03ad") + buf.write("\u03ae\7\32\2\2\u03ae\u03af\7\u00fa\2\2\u03af\u03b9\7") + buf.write("\33\2\2\u03b0\u03b5\7\u00fb\2\2\u03b1\u03b2\7\34\2\2\u0= 3b2") + buf.write("\u03b4\5\u015e\u00b0\2\u03b3\u03b1\3\2\2\2\u03b4\u03b7"= ) + buf.write("\3\2\2\2\u03b5\u03b3\3\2\2\2\u03b5\u03b6\3\2\2\2\u03b6"= ) + buf.write("\u03b9\3\2\2\2\u03b7\u03b5\3\2\2\2\u03b8\u03ac\3\2\2\2"= ) + buf.write("\u03b8\u03b0\3\2\2\2\u03b9Y\3\2\2\2\u03ba\u03bc\7\35\2"= ) + buf.write("\2\u03bb\u03ba\3\2\2\2\u03bb\u03bc\3\2\2\2\u03bc\u03bd"= ) + buf.write("\3\2\2\2\u03bd\u03e7\7\u00fa\2\2\u03be\u03e7\7\u00d3\2"= ) + buf.write("\2\u03bf\u03e7\7\u00d4\2\2\u03c0\u03e7\7\u00d5\2\2\u03c= 1") + buf.write("\u03e7\7\u00d6\2\2\u03c2\u03e7\7\u00d7\2\2\u03c3\u03c4"= ) + buf.write("\7\u00fa\2\2\u03c4\u03c5\7\36\2\2\u03c5\u03c6\7\u00fa") + buf.write("\2\2\u03c6\u03c7\7\36\2\2\u03c7\u03e7\7\u00fa\2\2\u03c8= ") + buf.write("\u03c9\7\u00fa\2\2\u03c9\u03ca\7\37\2\2\u03ca\u03cb\7") + buf.write("\u00fa\2\2\u03cb\u03cc\7\37\2\2\u03cc\u03e7\7\u00fa\2") + buf.write("\2\u03cd\u03ce\7\u00fa\2\2\u03ce\u03cf\7 \2\2\u03cf\u03= d0") + buf.write("\7\u00fa\2\2\u03d0\u03d1\7 \2\2\u03d1\u03d2\5L\'\2\u03d= 2") + buf.write("\u03d3\7 \2\2\u03d3\u03d4\7\u00ec\2\2\u03d4\u03d5\7\30"= ) + buf.write("\2\2\u03d5\u03d6\7\u00fa\2\2\u03d6\u03d7\7\31\2\2\u03d7= ") + buf.write("\u03e7\3\2\2\2\u03d8\u03d9\7\u00ec\2\2\u03d9\u03da\7\30= ") + buf.write("\2\2\u03da\u03db\7\u00fa\2\2\u03db\u03e7\7\31\2\2\u03dc= ") + buf.write("\u03dd\7\26\2\2\u03dd\u03e2\7\u00fa\2\2\u03de\u03df\7") + buf.write("!\2\2\u03df\u03e1\7\u00fa\2\2\u03e0\u03de\3\2\2\2\u03e1= ") + buf.write("\u03e4\3\2\2\2\u03e2\u03e0\3\2\2\2\u03e2\u03e3\3\2\2\2"= ) + buf.write("\u03e3\u03e5\3\2\2\2\u03e4\u03e2\3\2\2\2\u03e5\u03e7\7"= ) + buf.write("\27\2\2\u03e6\u03bb\3\2\2\2\u03e6\u03be\3\2\2\2\u03e6") + buf.write("\u03bf\3\2\2\2\u03e6\u03c0\3\2\2\2\u03e6\u03c1\3\2\2\2"= ) + buf.write("\u03e6\u03c2\3\2\2\2\u03e6\u03c3\3\2\2\2\u03e6\u03c8\3"= ) + buf.write("\2\2\2\u03e6\u03cd\3\2\2\2\u03e6\u03d8\3\2\2\2\u03e6\u0= 3dc") + buf.write("\3\2\2\2\u03e7[\3\2\2\2\u03e8\u03e9\7\u0092\2\2\u03e9") + buf.write("\u03ea\7\b\2\2\u03ea\u03eb\7\t\2\2\u03eb\u03ec\7\30\2") + buf.write("\2\u03ec\u03ed\7\u00fa\2\2\u03ed\u03ee\7\31\2\2\u03ee") + buf.write("]\3\2\2\2\u03ef\u03f0\7\u0093\2\2\u03f0_\3\2\2\2\u03f1"= ) + buf.write("\u03f4\5\\/\2\u03f2\u03f4\5^\60\2\u03f3\u03f1\3\2\2\2") + buf.write("\u03f3\u03f2\3\2\2\2\u03f4a\3\2\2\2\u03f5\u03fa\5`\61") + buf.write("\2\u03f6\u03f7\7!\2\2\u03f7\u03f9\5`\61\2\u03f8\u03f6") + buf.write("\3\2\2\2\u03f9\u03fc\3\2\2\2\u03fa\u03f8\3\2\2\2\u03fa"= ) + buf.write("\u03fb\3\2\2\2\u03fbc\3\2\2\2\u03fc\u03fa\3\2\2\2\u03fd= ") + buf.write("\u03fe\7\67\2\2\u03fe\u03ff\7/\2\2\u03ff\u0400\7\b\2\2"= ) + buf.write("\u0400\u0401\7\u00fa\2\2\u0401\u0402\7!\2\2\u0402\u0403= ") + buf.write("\7.\2\2\u0403\u0404\7\b\2\2\u0404\u0405\7\u00ec\2\2\u04= 05") + buf.write("\u0406\7\30\2\2\u0406\u0407\7\u00fa\2\2\u0407\u0408\7") + buf.write("\31\2\2\u0408\u040c\7 \2\2\u0409\u040b\5f\64\2\u040a\u0= 409") + buf.write("\3\2\2\2\u040b\u040e\3\2\2\2\u040c\u040a\3\2\2\2\u040c"= ) + buf.write("\u040d\3\2\2\2\u040d\u040f\3\2\2\2\u040e\u040c\3\2\2\2"= ) + buf.write("\u040f\u0410\7\66\2\2\u0410\u0411\7 \2\2\u0411e\3\2\2") + buf.write("\2\u0412\u0422\5j\66\2\u0413\u0422\5l\67\2\u0414\u0422"= ) + buf.write("\5n8\2\u0415\u0422\5\u00a4S\2\u0416\u0422\5p9\2\u0417") + buf.write("\u0422\5\u0088E\2\u0418\u0422\5\u00f8}\2\u0419\u0422\5"= ) + buf.write("\u0118\u008d\2\u041a\u0422\5\u011a\u008e\2\u041b\u0422"= ) + buf.write("\5\u0110\u0089\2\u041c\u0422\5\u011c\u008f\2\u041d\u042= 2") + buf.write("\5\u0120\u0091\2\u041e\u041f\5\u0096L\2\u041f\u0420\7") + buf.write(" \2\2\u0420\u0422\3\2\2\2\u0421\u0412\3\2\2\2\u0421\u04= 13") + buf.write("\3\2\2\2\u0421\u0414\3\2\2\2\u0421\u0415\3\2\2\2\u0421"= ) + buf.write("\u0416\3\2\2\2\u0421\u0417\3\2\2\2\u0421\u0418\3\2\2\2"= ) + buf.write("\u0421\u0419\3\2\2\2\u0421\u041a\3\2\2\2\u0421\u041b\3"= ) + buf.write("\2\2\2\u0421\u041c\3\2\2\2\u0421\u041d\3\2\2\2\u0421\u0= 41e") + buf.write("\3\2\2\2\u0422g\3\2\2\2\u0423\u0424\78\2\2\u0424\u0425"= ) + buf.write("\7/\2\2\u0425\u0426\7\b\2\2\u0426\u0427\7\u00fa\2\2\u04= 27") + buf.write("\u0436\7!\2\2\u0428\u0429\79\2\2\u0429\u042a\7\b\2\2\u0= 42a") + buf.write("\u042b\7\u00ec\2\2\u042b\u042c\7\30\2\2\u042c\u042d\7") + buf.write("\u00fa\2\2\u042d\u042e\7\31\2\2\u042e\u042f\7 \2\2\u042= f") + buf.write("\u0430\7:\2\2\u0430\u0431\7\b\2\2\u0431\u0432\5L\'\2\u0= 432") + buf.write("\u0433\7 \2\2\u0433\u0435\3\2\2\2\u0434\u0428\3\2\2\2") + buf.write("\u0435\u0438\3\2\2\2\u0436\u0434\3\2\2\2\u0436\u0437\3"= ) + buf.write("\2\2\2\u0437\u043c\3\2\2\2\u0438\u0436\3\2\2\2\u0439\u0= 43b") + buf.write("\5f\64\2\u043a\u0439\3\2\2\2\u043b\u043e\3\2\2\2\u043c"= ) + buf.write("\u043a\3\2\2\2\u043c\u043d\3\2\2\2\u043d\u043f\3\2\2\2"= ) + buf.write("\u043e\u043c\3\2\2\2\u043f\u0440\7\66\2\2\u0440\u0441") + buf.write("\7 \2\2\u0441i\3\2\2\2\u0442\u0443\5\\/\2\u0443\u0444") + buf.write("\7 \2\2\u0444k\3\2\2\2\u0445\u0446\5^\60\2\u0446\u0447"= ) + buf.write("\7 \2\2\u0447m\3\2\2\2\u0448\u0449\7\u0094\2\2\u0449\u0= 44a") + buf.write("\7\u00fb\2\2\u044a\u044b\7!\2\2\u044b\u044c\5\u0124\u00= 93") + buf.write("\2\u044c\u044d\7\u0095\2\2\u044d\u044e\7 \2\2\u044eo\3"= ) + buf.write("\2\2\2\u044f\u0453\5r:\2\u0450\u0453\5z>\2\u0451\u0453"= ) + buf.write("\5~@\2\u0452\u044f\3\2\2\2\u0452\u0450\3\2\2\2\u0452\u0= 451") + buf.write("\3\2\2\2\u0453q\3\2\2\2\u0454\u0455\7;\2\2\u0455\u0456"= ) + buf.write("\7>\2\2\u0456\u0457\7\b\2\2\u0457\u0458\7\u00ec\2\2\u04= 58") + buf.write("\u0459\7\30\2\2\u0459\u045a\7\u00fa\2\2\u045a\u045f\7") + buf.write("\31\2\2\u045b\u045c\7!\2\2\u045c\u045d\7@\2\2\u045d\u04= 5e") + buf.write("\7\b\2\2\u045e\u0460\5v<\2\u045f\u045b\3\2\2\2\u045f\u0= 460") + buf.write("\3\2\2\2\u0460\u0475\3\2\2\2\u0461\u0462\7!\2\2\u0462") + buf.write("\u0464\5b\62\2\u0463\u0461\3\2\2\2\u0463\u0464\3\2\2\2"= ) + buf.write("\u0464\u0465\3\2\2\2\u0465\u0476\7 \2\2\u0466\u0467\7") + buf.write("!\2\2\u0467\u0469\5b\62\2\u0468\u0466\3\2\2\2\u0468\u04= 69") + buf.write("\3\2\2\2\u0469\u0471\3\2\2\2\u046a\u046e\7!\2\2\u046b") + buf.write("\u046d\5t;\2\u046c\u046b\3\2\2\2\u046d\u0470\3\2\2\2\u0= 46e") + buf.write("\u046c\3\2\2\2\u046e\u046f\3\2\2\2\u046f\u0472\3\2\2\2"= ) + buf.write("\u0470\u046e\3\2\2\2\u0471\u046a\3\2\2\2\u0471\u0472\3"= ) + buf.write("\2\2\2\u0472\u0473\3\2\2\2\u0473\u0474\7<\2\2\u0474\u04= 76") + buf.write("\7 \2\2\u0475\u0463\3\2\2\2\u0475\u0468\3\2\2\2\u0476") + buf.write("s\3\2\2\2\u0477\u047a\5p9\2\u0478\u047a\5\u0088E\2\u047= 9") + buf.write("\u0477\3\2\2\2\u0479\u0478\3\2\2\2\u047au\3\2\2\2\u047b= ") + buf.write("\u0480\5x=3D\2\u047c\u047d\7(\2\2\u047d\u047f\5x=3D\2\u= 047e") + buf.write("\u047c\3\2\2\2\u047f\u0482\3\2\2\2\u0480\u047e\3\2\2\2"= ) + buf.write("\u0480\u0481\3\2\2\2\u0481w\3\2\2\2\u0482\u0480\3\2\2") + buf.write("\2\u0483\u0484\t\5\2\2\u0484y\3\2\2\2\u0485\u0486\7>\2"= ) + buf.write("\2\u0486\u0487\7=3D\2\2\u0487\u0488\7\b\2\2\u0488\u0489= ") + buf.write("\7\u00ec\2\2\u0489\u048a\7\30\2\2\u048a\u048b\7\u00fa") + buf.write("\2\2\u048b\u048c\7\31\2\2\u048c\u048d\7!\2\2\u048d\u048= e") + buf.write("\7>\2\2\u048e\u048f\7\b\2\2\u048f\u0490\7\u00ec\2\2\u04= 90") + buf.write("\u0491\7\30\2\2\u0491\u0492\7\u00fa\2\2\u0492\u049a\7") + buf.write("\31\2\2\u0493\u0494\7!\2\2\u0494\u0495\7>\2\2\u0495\u04= 96") + buf.write("\7\b\2\2\u0496\u0497\7\u00ec\2\2\u0497\u0498\7\30\2\2") + buf.write("\u0498\u0499\7\u00fa\2\2\u0499\u049b\7\31\2\2\u049a\u04= 93") + buf.write("\3\2\2\2\u049a\u049b\3\2\2\2\u049b\u04ac\3\2\2\2\u049c"= ) + buf.write("\u049d\7!\2\2\u049d\u049e\7@\2\2\u049e\u049f\7\b\2\2\u0= 49f") + buf.write("\u04a4\5|?\2\u04a0\u04a1\7(\2\2\u04a1\u04a3\5|?\2\u04a2= ") + buf.write("\u04a0\3\2\2\2\u04a3\u04a6\3\2\2\2\u04a4\u04a2\3\2\2\2"= ) + buf.write("\u04a4\u04a5\3\2\2\2\u04a5\u04a7\3\2\2\2\u04a6\u04a4\3"= ) + buf.write("\2\2\2\u04a7\u04a8\7!\2\2\u04a8\u04a9\7t\2\2\u04a9\u04a= a") + buf.write("\7\b\2\2\u04aa\u04ab\7\u00fa\2\2\u04ab\u04ad\3\2\2\2\u0= 4ac") + buf.write("\u049c\3\2\2\2\u04ac\u04ad\3\2\2\2\u04ad\u04b0\3\2\2\2"= ) + buf.write("\u04ae\u04af\7!\2\2\u04af\u04b1\5b\62\2\u04b0\u04ae\3") + buf.write("\2\2\2\u04b0\u04b1\3\2\2\2\u04b1\u04b2\3\2\2\2\u04b2\u0= 4b3") + buf.write("\7 \2\2\u04b3{\3\2\2\2\u04b4\u04b7\7\u00fa\2\2\u04b5\u0= 4b7") + buf.write("\5V,\2\u04b6\u04b4\3\2\2\2\u04b6\u04b5\3\2\2\2\u04b7}") + buf.write("\3\2\2\2\u04b8\u04bb\5\u0080A\2\u04b9\u04bb\5\u0086D\2"= ) + buf.write("\u04ba\u04b8\3\2\2\2\u04ba\u04b9\3\2\2\2\u04bb\177\3\2"= ) + buf.write("\2\2\u04bc\u04ec\7n\2\2\u04bd\u04be\7*\2\2\u04be\u04bf"= ) + buf.write("\7\b\2\2\u04bf\u04c0\7\u00ec\2\2\u04c0\u04c1\7\30\2\2") + buf.write("\u04c1\u04c2\7\u00fa\2\2\u04c2\u04c3\7\31\2\2\u04c3\u04= c4") + buf.write("\7!\2\2\u04c4\u04c5\7o\2\2\u04c5\u04c6\7\b\2\2\u04c6\u0= 4c7") + buf.write("\5L\'\2\u04c7\u04c8\7!\2\2\u04c8\u04c9\7/\2\2\u04c9\u04= ca") + buf.write("\7\b\2\2\u04ca\u04cb\7\u00fa\2\2\u04cb\u04cc\7!\2\2\u04= cc") + buf.write("\u04cd\7\u0090\2\2\u04cd\u04ce\7\b\2\2\u04ce\u04cf\7\u0= 0fa") + buf.write("\2\2\u04cf\u04d0\7!\2\2\u04d0\u04ed\3\2\2\2\u04d1\u04d2= ") + buf.write("\7o\2\2\u04d2\u04d3\7\b\2\2\u04d3\u04d4\5L\'\2\u04d4\u0= 4d5") + buf.write("\7!\2\2\u04d5\u04d6\7/\2\2\u04d6\u04d7\7\b\2\2\u04d7\u0= 4d8") + buf.write("\7\u00fa\2\2\u04d8\u04d9\7!\2\2\u04d9\u04da\7\u0090\2") + buf.write("\2\u04da\u04db\7\b\2\2\u04db\u04dc\7\u00fa\2\2\u04dc\u0= 4dd") + buf.write("\7!\2\2\u04dd\u04ed\3\2\2\2\u04de\u04df\7/\2\2\u04df\u0= 4e0") + buf.write("\7\b\2\2\u04e0\u04e1\7\u00fa\2\2\u04e1\u04e2\7!\2\2\u04= e2") + buf.write("\u04e3\7\u0090\2\2\u04e3\u04e8\7\b\2\2\u04e4\u04e5\7\u0= 0fb") + buf.write("\2\2\u04e5\u04e9\7!\2\2\u04e6\u04e7\7\u00fa\2\2\u04e7") + buf.write("\u04e9\7!\2\2\u04e8\u04e4\3\2\2\2\u04e8\u04e6\3\2\2\2") + buf.write("\u04e9\u04ed\3\2\2\2\u04ea\u04eb\7\u00fa\2\2\u04eb\u04e= d") + buf.write("\7!\2\2\u04ec\u04bd\3\2\2\2\u04ec\u04d1\3\2\2\2\u04ec") + buf.write("\u04de\3\2\2\2\u04ec\u04ea\3\2\2\2\u04ec\u04ed\3\2\2\2"= ) + buf.write("\u04ed\u04ee\3\2\2\2\u04ee\u04f3\5P)\2\u04ef\u04f0\7!") + buf.write("\2\2\u04f0\u04f1\7@\2\2\u04f1\u04f2\7\b\2\2\u04f2\u04f4= ") + buf.write("\5\u0082B\2\u04f3\u04ef\3\2\2\2\u04f3\u04f4\3\2\2\2\u04= f4") + buf.write("\u04f9\3\2\2\2\u04f5\u04f6\7!\2\2\u04f6\u04f7\7t\2\2\u0= 4f7") + buf.write("\u04f8\7\b\2\2\u04f8\u04fa\7\u00fa\2\2\u04f9\u04f5\3\2"= ) + buf.write("\2\2\u04f9\u04fa\3\2\2\2\u04fa\u04fd\3\2\2\2\u04fb\u04f= c") + buf.write("\7!\2\2\u04fc\u04fe\5\u00b4[\2\u04fd\u04fb\3\2\2\2\u04f= d") + buf.write("\u04fe\3\2\2\2\u04fe\u04ff\3\2\2\2\u04ff\u0500\7 \2\2") + buf.write("\u0500\u0081\3\2\2\2\u0501\u0506\5\u0084C\2\u0502\u0503= ") + buf.write("\7(\2\2\u0503\u0505\5\u0084C\2\u0504\u0502\3\2\2\2\u050= 5") + buf.write("\u0508\3\2\2\2\u0506\u0504\3\2\2\2\u0506\u0507\3\2\2\2"= ) + buf.write("\u0507\u0083\3\2\2\2\u0508\u0506\3\2\2\2\u0509\u050c\7"= ) + buf.write("\u00fa\2\2\u050a\u050c\5V,\2\u050b\u0509\3\2\2\2\u050b"= ) + buf.write("\u050a\3\2\2\2\u050c\u0085\3\2\2\2\u050d\u050e\7\u0099"= ) + buf.write("\2\2\u050e\u050f\7\u009b\2\2\u050f\u0510\7\b\2\2\u0510"= ) + buf.write("\u0511\7\u00fb\2\2\u0511\u0512\7!\2\2\u0512\u0513\5T+") + buf.write("\2\u0513\u0517\7!\2\2\u0514\u0515\5b\62\2\u0515\u0516") + buf.write("\7!\2\2\u0516\u0518\3\2\2\2\u0517\u0514\3\2\2\2\u0517") + buf.write("\u0518\3\2\2\2\u0518\u0519\3\2\2\2\u0519\u051a\7\u009a"= ) + buf.write("\2\2\u051a\u051b\7 \2\2\u051b\u0087\3\2\2\2\u051c\u0523= ") + buf.write("\5\u00b8]\2\u051d\u0523\5\u00e8u\2\u051e\u0523\5\u00c6"= ) + buf.write("d\2\u051f\u0523\5\u00d4k\2\u0520\u0523\5\u00e2r\2\u0521= ") + buf.write("\u0523\5\u00f0y\2\u0522\u051c\3\2\2\2\u0522\u051d\3\2") + buf.write("\2\2\u0522\u051e\3\2\2\2\u0522\u051f\3\2\2\2\u0522\u052= 0") + buf.write("\3\2\2\2\u0522\u0521\3\2\2\2\u0523\u0089\3\2\2\2\u0524"= ) + buf.write("\u0525\5`\61\2\u0525\u0526\7!\2\2\u0526\u0530\3\2\2\2") + buf.write("\u0527\u0530\5\u008cG\2\u0528\u0530\5\u008eH\2\u0529\u0= 530") + buf.write("\5\u0090I\2\u052a\u0530\5\u0092J\2\u052b\u0530\5\u0094"= ) + buf.write("K\2\u052c\u0530\5\u011c\u008f\2\u052d\u0530\5\u0096L\2"= ) + buf.write("\u052e\u0530\5\u0098M\2\u052f\u0524\3\2\2\2\u052f\u0527= ") + buf.write("\3\2\2\2\u052f\u0528\3\2\2\2\u052f\u0529\3\2\2\2\u052f"= ) + buf.write("\u052a\3\2\2\2\u052f\u052b\3\2\2\2\u052f\u052c\3\2\2\2"= ) + buf.write("\u052f\u052d\3\2\2\2\u052f\u052e\3\2\2\2\u0530\u008b\3"= ) + buf.write("\2\2\2\u0531\u0532\7p\2\2\u0532\u0533\7\62\2\2\u0533\u0= 534") + buf.write("\7\b\2\2\u0534\u0535\7\u00ec\2\2\u0535\u0536\7\30\2\2") + buf.write("\u0536\u0537\7\u00fa\2\2\u0537\u0538\7\31\2\2\u0538\u05= 45") + buf.write("\7!\2\2\u0539\u053a\7@\2\2\u053a\u053b\7\b\2\2\u053b\u0= 540") + buf.write("\5\u009eP\2\u053c\u053d\7(\2\2\u053d\u053f\5\u009eP\2") + buf.write("\u053e\u053c\3\2\2\2\u053f\u0542\3\2\2\2\u0540\u053e\3"= ) + buf.write("\2\2\2\u0540\u0541\3\2\2\2\u0541\u0543\3\2\2\2\u0542\u0= 540") + buf.write("\3\2\2\2\u0543\u0544\7!\2\2\u0544\u0546\3\2\2\2\u0545") + buf.write("\u0539\3\2\2\2\u0545\u0546\3\2\2\2\u0546\u0547\3\2\2\2"= ) + buf.write("\u0547\u0548\5\u0124\u0093\2\u0548\u054a\7s\2\2\u0549") + buf.write("\u054b\7 \2\2\u054a\u0549\3\2\2\2\u054a\u054b\3\2\2\2") + buf.write("\u054b\u008d\3\2\2\2\u054c\u054d\7r\2\2\u054d\u054e\7") + buf.write("\62\2\2\u054e\u054f\7\b\2\2\u054f\u0550\7\u00ec\2\2\u05= 50") + buf.write("\u0551\7\30\2\2\u0551\u0552\7\u00fa\2\2\u0552\u0553\7") + buf.write("\31\2\2\u0553\u0560\7!\2\2\u0554\u0555\7@\2\2\u0555\u05= 56") + buf.write("\7\b\2\2\u0556\u055b\5\u009eP\2\u0557\u0558\7(\2\2\u055= 8") + buf.write("\u055a\5\u009eP\2\u0559\u0557\3\2\2\2\u055a\u055d\3\2") + buf.write("\2\2\u055b\u0559\3\2\2\2\u055b\u055c\3\2\2\2\u055c\u055= e") + buf.write("\3\2\2\2\u055d\u055b\3\2\2\2\u055e\u055f\7!\2\2\u055f") + buf.write("\u0561\3\2\2\2\u0560\u0554\3\2\2\2\u0560\u0561\3\2\2\2"= ) + buf.write("\u0561\u0562\3\2\2\2\u0562\u0563\5\u0124\u0093\2\u0563"= ) + buf.write("\u0565\7s\2\2\u0564\u0566\7 \2\2\u0565\u0564\3\2\2\2\u0= 565") + buf.write("\u0566\3\2\2\2\u0566\u008f\3\2\2\2\u0567\u0568\7l\2\2") + buf.write("\u0568\u0569\5\u0124\u0093\2\u0569\u056a\7 \2\2\u056a") + buf.write("\u056b\5\u00b4[\2\u056b\u056d\7s\2\2\u056c\u056e\7 \2") + buf.write("\2\u056d\u056c\3\2\2\2\u056d\u056e\3\2\2\2\u056e\u0091"= ) + buf.write("\3\2\2\2\u056f\u0570\7\u00a4\2\2\u0570\u0571\7\u00a5\2"= ) + buf.write("\2\u0571\u0572\7\b\2\2\u0572\u0573\7\u00fa\2\2\u0573\u0= 093") + buf.write("\3\2\2\2\u0574\u0575\7\u00a6\2\2\u0575\u0576\7\b\2\2\u0= 576") + buf.write("\u0577\7\u00ec\2\2\u0577\u0578\7\30\2\2\u0578\u0579\7") + buf.write("\u00fa\2\2\u0579\u057a\7\31\2\2\u057a\u057b\7!\2\2\u057= b") + buf.write("\u0095\3\2\2\2\u057c\u057d\7\u00eb\2\2\u057d\u057e\7\b"= ) + buf.write("\2\2\u057e\u057f\5L\'\2\u057f\u0580\7!\2\2\u0580\u0097"= ) + buf.write("\3\2\2\2\u0581\u0582\7q\2\2\u0582\u0583\7\62\2\2\u0583"= ) + buf.write("\u0584\7\b\2\2\u0584\u0585\7\u00ec\2\2\u0585\u0586\7\30= ") + buf.write("\2\2\u0586\u0587\7\u00fa\2\2\u0587\u0588\7\31\2\2\u0588= ") + buf.write("\u058d\7!\2\2\u0589\u058a\7M\2\2\u058a\u058b\7\b\2\2\u0= 58b") + buf.write("\u058c\7\u00fa\2\2\u058c\u058e\7!\2\2\u058d\u0589\3\2") + buf.write("\2\2\u058d\u058e\3\2\2\2\u058e\u058f\3\2\2\2\u058f\u059= 0") + buf.write("\5\u0124\u0093\2\u0590\u0592\7s\2\2\u0591\u0593\7 \2\2"= ) + buf.write("\u0592\u0591\3\2\2\2\u0592\u0593\3\2\2\2\u0593\u0099\3"= ) + buf.write("\2\2\2\u0594\u0596\5\u008aF\2\u0595\u0594\3\2\2\2\u0596= ") + buf.write("\u0599\3\2\2\2\u0597\u0595\3\2\2\2\u0597\u0598\3\2\2\2"= ) + buf.write("\u0598\u009b\3\2\2\2\u0599\u0597\3\2\2\2\u059a\u05a2\5"= ) + buf.write("\u00a0Q\2\u059b\u05a2\5\u00a2R\2\u059c\u05a2\5\u00a6T") + buf.write("\2\u059d\u05a2\5\u00a4S\2\u059e\u05a2\5\u00a8U\2\u059f"= ) + buf.write("\u05a2\5\u00b0Y\2\u05a0\u05a2\5\u00b2Z\2\u05a1\u059a\3"= ) + buf.write("\2\2\2\u05a1\u059b\3\2\2\2\u05a1\u059c\3\2\2\2\u05a1\u0= 59d") + buf.write("\3\2\2\2\u05a1\u059e\3\2\2\2\u05a1\u059f\3\2\2\2\u05a1"= ) + buf.write("\u05a0\3\2\2\2\u05a2\u009d\3\2\2\2\u05a3\u05ac\7\u00fa"= ) + buf.write("\2\2\u05a4\u05ac\7y\2\2\u05a5\u05ac\7v\2\2\u05a6\u05ac"= ) + buf.write("\7u\2\2\u05a7\u05ac\7{\2\2\u05a8\u05ac\7|\2\2\u05a9\u05= ac") + buf.write("\7z\2\2\u05aa\u05ac\7}\2\2\u05ab\u05a3\3\2\2\2\u05ab\u0= 5a4") + buf.write("\3\2\2\2\u05ab\u05a5\3\2\2\2\u05ab\u05a6\3\2\2\2\u05ab"= ) + buf.write("\u05a7\3\2\2\2\u05ab\u05a8\3\2\2\2\u05ab\u05a9\3\2\2\2"= ) + buf.write("\u05ab\u05aa\3\2\2\2\u05ac\u009f\3\2\2\2\u05ad\u05ae\7"= ) + buf.write("k\2\2\u05ae\u05af\5\u0124\u0093\2\u05af\u05bc\7 \2\2\u0= 5b0") + buf.write("\u05b1\7@\2\2\u05b1\u05b2\7\b\2\2\u05b2\u05b7\5\u009e") + buf.write("P\2\u05b3\u05b4\7(\2\2\u05b4\u05b6\5\u009eP\2\u05b5\u05= b3") + buf.write("\3\2\2\2\u05b6\u05b9\3\2\2\2\u05b7\u05b5\3\2\2\2\u05b7"= ) + buf.write("\u05b8\3\2\2\2\u05b8\u05ba\3\2\2\2\u05b9\u05b7\3\2\2\2"= ) + buf.write("\u05ba\u05bb\7!\2\2\u05bb\u05bd\3\2\2\2\u05bc\u05b0\3") + buf.write("\2\2\2\u05bc\u05bd\3\2\2\2\u05bd\u05be\3\2\2\2\u05be\u0= 5bf") + buf.write("\5\u00b4[\2\u05bf\u05c1\7s\2\2\u05c0\u05c2\7 \2\2\u05c1= ") + buf.write("\u05c0\3\2\2\2\u05c1\u05c2\3\2\2\2\u05c2\u00a1\3\2\2\2"= ) + buf.write("\u05c3\u05c4\7K\2\2\u05c4\u05c5\5\u0124\u0093\2\u05c5") + buf.write("\u05d2\7 \2\2\u05c6\u05c7\7@\2\2\u05c7\u05c8\7\b\2\2\u0= 5c8") + buf.write("\u05cd\5\u009eP\2\u05c9\u05ca\7(\2\2\u05ca\u05cc\5\u009= e") + buf.write("P\2\u05cb\u05c9\3\2\2\2\u05cc\u05cf\3\2\2\2\u05cd\u05cb= ") + buf.write("\3\2\2\2\u05cd\u05ce\3\2\2\2\u05ce\u05d0\3\2\2\2\u05cf"= ) + buf.write("\u05cd\3\2\2\2\u05d0\u05d1\7!\2\2\u05d1\u05d3\3\2\2\2") + buf.write("\u05d2\u05c6\3\2\2\2\u05d2\u05d3\3\2\2\2\u05d3\u05d4\3"= ) + buf.write("\2\2\2\u05d4\u05d5\5\u00b4[\2\u05d5\u05d7\7s\2\2\u05d6"= ) + buf.write("\u05d8\7 \2\2\u05d7\u05d6\3\2\2\2\u05d7\u05d8\3\2\2\2") + buf.write("\u05d8\u00a3\3\2\2\2\u05d9\u05e1\7c\2\2\u05da\u05db\5") + buf.write("\u00a6T\2\u05db\u05dc\7!\2\2\u05dc\u05e2\3\2\2\2\u05dd"= ) + buf.write("\u05de\7\b\2\2\u05de\u05df\5Z.\2\u05df\u05e0\7!\2\2\u05= e0") + buf.write("\u05e2\3\2\2\2\u05e1\u05da\3\2\2\2\u05e1\u05dd\3\2\2\2"= ) + buf.write("\u05e2\u05e7\3\2\2\2\u05e3\u05e4\7\u009b\2\2\u05e4\u05e= 5") + buf.write("\7\b\2\2\u05e5\u05e6\7\u00fb\2\2\u05e6\u05e8\7!\2\2\u05= e7") + buf.write("\u05e3\3\2\2\2\u05e7\u05e8\3\2\2\2\u05e8\u00a5\3\2\2\2"= ) + buf.write("\u05e9\u05ea\7\u0096\2\2\u05ea\u05eb\7\b\2\2\u05eb\u05e= c") + buf.write("\5\u0124\u0093\2\u05ec\u00a7\3\2\2\2\u05ed\u05ee\5\u00a= a") + buf.write("V\2\u05ee\u00a9\3\2\2\2\u05ef\u05f0\7?\2\2\u05f0\u05f1"= ) + buf.write("\7>\2\2\u05f1\u05f2\7\b\2\2\u05f2\u05f3\7\u00ec\2\2\u05= f3") + buf.write("\u05f4\7\30\2\2\u05f4\u05f5\7\u00fa\2\2\u05f5\u05f6\7") + buf.write("\31\2\2\u05f6\u05f7\7!\2\2\u05f7\u05f8\7\u0096\2\2\u05f= 8") + buf.write("\u05f9\7\b\2\2\u05f9\u05fa\5Z.\2\u05fa\u05fb\7!\2\2\u05= fb") + buf.write("\u05fc\7@\2\2\u05fc\u05fd\7\b\2\2\u05fd\u0602\5\u00ac") + buf.write("W\2\u05fe\u05ff\7!\2\2\u05ff\u0600\7t\2\2\u0600\u0601") + buf.write("\7\b\2\2\u0601\u0603\7\u00fa\2\2\u0602\u05fe\3\2\2\2\u0= 602") + buf.write("\u0603\3\2\2\2\u0603\u0608\3\2\2\2\u0604\u0605\7!\2\2") + buf.write("\u0605\u0607\5\\/\2\u0606\u0604\3\2\2\2\u0607\u060a\3") + buf.write("\2\2\2\u0608\u0606\3\2\2\2\u0608\u0609\3\2\2\2\u0609\u0= 60b") + buf.write("\3\2\2\2\u060a\u0608\3\2\2\2\u060b\u060c\7 \2\2\u060c") + buf.write("\u00ab\3\2\2\2\u060d\u0612\5\u00aeX\2\u060e\u060f\7(\2"= ) + buf.write("\2\u060f\u0611\5\u00aeX\2\u0610\u060e\3\2\2\2\u0611\u06= 14") + buf.write("\3\2\2\2\u0612\u0610\3\2\2\2\u0612\u0613\3\2\2\2\u0613"= ) + buf.write("\u00ad\3\2\2\2\u0614\u0612\3\2\2\2\u0615\u0621\7\u00fa"= ) + buf.write("\2\2\u0616\u0621\7\u00ed\2\2\u0617\u0621\7\u00ee\2\2\u0= 618") + buf.write("\u0621\7y\2\2\u0619\u0621\7{\2\2\u061a\u0621\7\u0080\2"= ) + buf.write("\2\u061b\u0621\7|\2\2\u061c\u0621\7v\2\2\u061d\u0621\7"= ) + buf.write("u\2\2\u061e\u0621\7z\2\2\u061f\u0621\7}\2\2\u0620\u0615= ") + buf.write("\3\2\2\2\u0620\u0616\3\2\2\2\u0620\u0617\3\2\2\2\u0620"= ) + buf.write("\u0618\3\2\2\2\u0620\u0619\3\2\2\2\u0620\u061a\3\2\2\2"= ) + buf.write("\u0620\u061b\3\2\2\2\u0620\u061c\3\2\2\2\u0620\u061d\3"= ) + buf.write("\2\2\2\u0620\u061e\3\2\2\2\u0620\u061f\3\2\2\2\u0621\u0= 0af") + buf.write("\3\2\2\2\u0622\u0623\7\u0097\2\2\u0623\u0624\5\u0124\u0= 093") + buf.write("\2\u0624\u0625\7 \2\2\u0625\u00b1\3\2\2\2\u0626\u0627") + buf.write("\7\u0098\2\2\u0627\u0628\5\u0124\u0093\2\u0628\u0629\7"= ) + buf.write(" \2\2\u0629\u00b3\3\2\2\2\u062a\u062c\5\u00b6\\\2\u062b= ") + buf.write("\u062a\3\2\2\2\u062c\u062f\3\2\2\2\u062d\u062b\3\2\2\2"= ) + buf.write("\u062d\u062e\3\2\2\2\u062e\u00b5\3\2\2\2\u062f\u062d\3"= ) + buf.write("\2\2\2\u0630\u0633\5\u008aF\2\u0631\u0633\5\u009cO\2\u0= 632") + buf.write("\u0630\3\2\2\2\u0632\u0631\3\2\2\2\u0633\u00b7\3\2\2\2"= ) + buf.write("\u0634\u0637\5\u00ba^\2\u0635\u0637\5\u00c0a\2\u0636\u0= 634") + buf.write("\3\2\2\2\u0636\u0635\3\2\2\2\u0637\u00b9\3\2\2\2\u0638"= ) + buf.write("\u0639\7\\\2\2\u0639\u063a\5R*\2\u063a\u063b\5T+\2\u063= b") + buf.write("\u0641\7!\2\2\u063c\u063d\7@\2\2\u063d\u063e\7\b\2\2\u0= 63e") + buf.write("\u063f\5\u00bc_\2\u063f\u0640\7!\2\2\u0640\u0642\3\2\2"= ) + buf.write("\2\u0641\u063c\3\2\2\2\u0641\u0642\3\2\2\2\u0642\u0647"= ) + buf.write("\3\2\2\2\u0643\u0644\7t\2\2\u0644\u0645\7\b\2\2\u0645") + buf.write("\u0646\7\u00fa\2\2\u0646\u0648\7!\2\2\u0647\u0643\3\2") + buf.write("\2\2\u0647\u0648\3\2\2\2\u0648\u0649\3\2\2\2\u0649\u064= a") + buf.write("\5\u00b4[\2\u064a\u064b\7]\2\2\u064b\u064c\7 \2\2\u064c= ") + buf.write("\u00bb\3\2\2\2\u064d\u0652\5\u00be`\2\u064e\u064f\7(\2"= ) + buf.write("\2\u064f\u0651\5\u00be`\2\u0650\u064e\3\2\2\2\u0651\u06= 54") + buf.write("\3\2\2\2\u0652\u0650\3\2\2\2\u0652\u0653\3\2\2\2\u0653"= ) + buf.write("\u00bd\3\2\2\2\u0654\u0652\3\2\2\2\u0655\u065c\7\u00fa"= ) + buf.write("\2\2\u0656\u065c\7u\2\2\u0657\u065c\7v\2\2\u0658\u065c"= ) + buf.write("\7w\2\2\u0659\u065c\7x\2\2\u065a\u065c\5V,\2\u065b\u065= 5") + buf.write("\3\2\2\2\u065b\u0656\3\2\2\2\u065b\u0657\3\2\2\2\u065b"= ) + buf.write("\u0658\3\2\2\2\u065b\u0659\3\2\2\2\u065b\u065a\3\2\2\2"= ) + buf.write("\u065c\u00bf\3\2\2\2\u065d\u065e\7\u00a1\2\2\u065e\u065= f") + buf.write("\5P)\2\u065f\u0665\7!\2\2\u0660\u0661\7@\2\2\u0661\u066= 2") + buf.write("\7\b\2\2\u0662\u0663\5\u00c2b\2\u0663\u0664\7!\2\2\u066= 4") + buf.write("\u0666\3\2\2\2\u0665\u0660\3\2\2\2\u0665\u0666\3\2\2\2"= ) + buf.write("\u0666\u0667\3\2\2\2\u0667\u0668\7\u00a2\2\2\u0668\u066= 9") + buf.write("\7\b\2\2\u0669\u066a\7\u00ec\2\2\u066a\u066b\7\30\2\2") + buf.write("\u066b\u066c\7\u00fa\2\2\u066c\u066d\7\31\2\2\u066d\u06= 6e") + buf.write("\7!\2\2\u066e\u066f\5\u009aN\2\u066f\u0670\7\u00a3\2\2"= ) + buf.write("\u0670\u0671\7 \2\2\u0671\u00c1\3\2\2\2\u0672\u0677\5") + buf.write("\u00c4c\2\u0673\u0674\7(\2\2\u0674\u0676\5\u00c4c\2\u06= 75") + buf.write("\u0673\3\2\2\2\u0676\u0679\3\2\2\2\u0677\u0675\3\2\2\2"= ) + buf.write("\u0677\u0678\3\2\2\2\u0678\u00c3\3\2\2\2\u0679\u0677\3"= ) + buf.write("\2\2\2\u067a\u067d\7\u00fa\2\2\u067b\u067d\5V,\2\u067c"= ) + buf.write("\u067a\3\2\2\2\u067c\u067b\3\2\2\2\u067d\u00c5\3\2\2\2"= ) + buf.write("\u067e\u0681\5\u00c8e\2\u067f\u0681\5\u00d0i\2\u0680\u0= 67e") + buf.write("\3\2\2\2\u0680\u067f\3\2\2\2\u0681\u00c7\3\2\2\2\u0682"= ) + buf.write("\u0683\7^\2\2\u0683\u0684\5R*\2\u0684\u0685\5T+\2\u0685= ") + buf.write("\u068b\7!\2\2\u0686\u0687\7@\2\2\u0687\u0688\7\b\2\2\u0= 688") + buf.write("\u0689\5\u00ccg\2\u0689\u068a\7!\2\2\u068a\u068c\3\2\2"= ) + buf.write("\2\u068b\u0686\3\2\2\2\u068b\u068c\3\2\2\2\u068c\u0691"= ) + buf.write("\3\2\2\2\u068d\u068e\7t\2\2\u068e\u068f\7\b\2\2\u068f") + buf.write("\u0690\7\u00fa\2\2\u0690\u0692\7!\2\2\u0691\u068d\3\2") + buf.write("\2\2\u0691\u0692\3\2\2\2\u0692\u0693\3\2\2\2\u0693\u069= 4") + buf.write("\5\u00caf\2\u0694\u0695\5\u00b4[\2\u0695\u0696\7_\2\2") + buf.write("\u0696\u0697\7 \2\2\u0697\u00c9\3\2\2\2\u0698\u0699\7") + buf.write("`\2\2\u0699\u069b\7\b\2\2\u069a\u069c\7\35\2\2\u069b\u0= 69a") + buf.write("\3\2\2\2\u069b\u069c\3\2\2\2\u069c\u069d\3\2\2\2\u069d"= ) + buf.write("\u069e\7\u00fa\2\2\u069e\u069f\7!\2\2\u069f\u06a0\7a\2"= ) + buf.write("\2\u06a0\u06a2\7\b\2\2\u06a1\u06a3\7\35\2\2\u06a2\u06a1= ") + buf.write("\3\2\2\2\u06a2\u06a3\3\2\2\2\u06a3\u06a4\3\2\2\2\u06a4"= ) + buf.write("\u06a5\7\u00fa\2\2\u06a5\u06aa\7!\2\2\u06a6\u06a7\7b\2"= ) + buf.write("\2\u06a7\u06a8\7\b\2\2\u06a8\u06a9\7\u00fa\2\2\u06a9\u0= 6ab") + buf.write("\7!\2\2\u06aa\u06a6\3\2\2\2\u06aa\u06ab\3\2\2\2\u06ab") + buf.write("\u00cb\3\2\2\2\u06ac\u06b1\5\u00ceh\2\u06ad\u06ae\7(\2"= ) + buf.write("\2\u06ae\u06b0\5\u00ceh\2\u06af\u06ad\3\2\2\2\u06b0\u06= b3") + buf.write("\3\2\2\2\u06b1\u06af\3\2\2\2\u06b1\u06b2\3\2\2\2\u06b2"= ) + buf.write("\u00cd\3\2\2\2\u06b3\u06b1\3\2\2\2\u06b4\u06be\7\u00fa"= ) + buf.write("\2\2\u06b5\u06be\7\u00ef\2\2\u06b6\u06be\7\u00f0\2\2\u0= 6b7") + buf.write("\u06be\7\u00f1\2\2\u06b8\u06be\7\u00f2\2\2\u06b9\u06be"= ) + buf.write("\7\u00f3\2\2\u06ba\u06be\7\u00f4\2\2\u06bb\u06be\7\u00f= 5") + buf.write("\2\2\u06bc\u06be\5V,\2\u06bd\u06b4\3\2\2\2\u06bd\u06b5"= ) + buf.write("\3\2\2\2\u06bd\u06b6\3\2\2\2\u06bd\u06b7\3\2\2\2\u06bd"= ) + buf.write("\u06b8\3\2\2\2\u06bd\u06b9\3\2\2\2\u06bd\u06ba\3\2\2\2"= ) + buf.write("\u06bd\u06bb\3\2\2\2\u06bd\u06bc\3\2\2\2\u06be\u00cf\3"= ) + buf.write("\2\2\2\u06bf\u06c0\7\60\2\2\u06c0\u06c1\5R*\2\u06c1\u06= c2") + buf.write("\5T+\2\u06c2\u06c8\7!\2\2\u06c3\u06c4\7@\2\2\u06c4\u06c= 5") + buf.write("\7\b\2\2\u06c5\u06c6\5\u00d2j\2\u06c6\u06c7\7!\2\2\u06c= 7") + buf.write("\u06c9\3\2\2\2\u06c8\u06c3\3\2\2\2\u06c8\u06c9\3\2\2\2"= ) + buf.write("\u06c9\u06cb\3\2\2\2\u06ca\u06cc\5\u00caf\2\u06cb\u06ca= ") + buf.write("\3\2\2\2\u06cb\u06cc\3\2\2\2\u06cc\u06cd\3\2\2\2\u06cd"= ) + buf.write("\u06ce\5\u00b4[\2\u06ce\u06cf\7\61\2\2\u06cf\u06d0\7 ") + buf.write("\2\2\u06d0\u00d1\3\2\2\2\u06d1\u06d6\5\u00ceh\2\u06d2") + buf.write("\u06d3\7(\2\2\u06d3\u06d5\5\u00ceh\2\u06d4\u06d2\3\2\2"= ) + buf.write("\2\u06d5\u06d8\3\2\2\2\u06d6\u06d4\3\2\2\2\u06d6\u06d7"= ) + buf.write("\3\2\2\2\u06d7\u00d3\3\2\2\2\u06d8\u06d6\3\2\2\2\u06d9"= ) + buf.write("\u06dc\5\u00d6l\2\u06da\u06dc\5\u00dco\2\u06db\u06d9\3"= ) + buf.write("\2\2\2\u06db\u06da\3\2\2\2\u06dc\u00d5\3\2\2\2\u06dd\u0= 6de") + buf.write("\7f\2\2\u06de\u06df\5P)\2\u06df\u06e5\7!\2\2\u06e0\u06e= 1") + buf.write("\7@\2\2\u06e1\u06e2\7\b\2\2\u06e2\u06e3\5\u00d8m\2\u06e= 3") + buf.write("\u06e4\7!\2\2\u06e4\u06e6\3\2\2\2\u06e5\u06e0\3\2\2\2") + buf.write("\u06e5\u06e6\3\2\2\2\u06e6\u06eb\3\2\2\2\u06e7\u06e8\7"= ) + buf.write("t\2\2\u06e8\u06e9\7\b\2\2\u06e9\u06ea\7\u00fa\2\2\u06ea= ") + buf.write("\u06ec\7!\2\2\u06eb\u06e7\3\2\2\2\u06eb\u06ec\3\2\2\2") + buf.write("\u06ec\u06ed\3\2\2\2\u06ed\u06ee\7h\2\2\u06ee\u06ef\7") + buf.write("\b\2\2\u06ef\u06f0\7\u00fa\2\2\u06f0\u06f1\7!\2\2\u06f1= ") + buf.write("\u06f2\7i\2\2\u06f2\u06f3\7\b\2\2\u06f3\u06f4\7\u00fa") + buf.write("\2\2\u06f4\u06f5\7!\2\2\u06f5\u06f6\5\u00b4[\2\u06f6\u0= 6f7") + buf.write("\7g\2\2\u06f7\u06f8\7 \2\2\u06f8\u00d7\3\2\2\2\u06f9\u0= 6fe") + buf.write("\5\u00dan\2\u06fa\u06fb\7(\2\2\u06fb\u06fd\5\u00dan\2") + buf.write("\u06fc\u06fa\3\2\2\2\u06fd\u0700\3\2\2\2\u06fe\u06fc\3"= ) + buf.write("\2\2\2\u06fe\u06ff\3\2\2\2\u06ff\u00d9\3\2\2\2\u0700\u0= 6fe") + buf.write("\3\2\2\2\u0701\u0705\7\u00fa\2\2\u0702\u0705\7\13\2\2") + buf.write("\u0703\u0705\5V,\2\u0704\u0701\3\2\2\2\u0704\u0702\3\2"= ) + buf.write("\2\2\u0704\u0703\3\2\2\2\u0705\u00db\3\2\2\2\u0706\u070= 7") + buf.write("\7d\2\2\u0707\u0708\5P)\2\u0708\u070e\7!\2\2\u0709\u070= a") + buf.write("\7@\2\2\u070a\u070b\7\b\2\2\u070b\u070c\5\u00dep\2\u070= c") + buf.write("\u070d\7!\2\2\u070d\u070f\3\2\2\2\u070e\u0709\3\2\2\2") + buf.write("\u070e\u070f\3\2\2\2\u070f\u0714\3\2\2\2\u0710\u0711\7"= ) + buf.write("t\2\2\u0711\u0712\7\b\2\2\u0712\u0713\7\u00fa\2\2\u0713= ") + buf.write("\u0715\7!\2\2\u0714\u0710\3\2\2\2\u0714\u0715\3\2\2\2") + buf.write("\u0715\u0716\3\2\2\2\u0716\u0717\7h\2\2\u0717\u0718\7") + buf.write("\b\2\2\u0718\u0719\7\u00fa\2\2\u0719\u071a\7!\2\2\u071a= ") + buf.write("\u071b\7i\2\2\u071b\u071c\7\b\2\2\u071c\u071d\7\u00fa") + buf.write("\2\2\u071d\u0722\7!\2\2\u071e\u071f\7j\2\2\u071f\u0720"= ) + buf.write("\7\b\2\2\u0720\u0721\7\u00fa\2\2\u0721\u0723\7!\2\2\u07= 22") + buf.write("\u071e\3\2\2\2\u0722\u0723\3\2\2\2\u0723\u0724\3\2\2\2"= ) + buf.write("\u0724\u0725\5\u00b4[\2\u0725\u0726\7e\2\2\u0726\u0727"= ) + buf.write("\7 \2\2\u0727\u00dd\3\2\2\2\u0728\u072d\5\u00e0q\2\u072= 9") + buf.write("\u072a\7(\2\2\u072a\u072c\5\u00e0q\2\u072b\u0729\3\2\2"= ) + buf.write("\2\u072c\u072f\3\2\2\2\u072d\u072b\3\2\2\2\u072d\u072e"= ) + buf.write("\3\2\2\2\u072e\u00df\3\2\2\2\u072f\u072d\3\2\2\2\u0730"= ) + buf.write("\u0733\7\u00fa\2\2\u0731\u0733\5V,\2\u0732\u0730\3\2\2"= ) + buf.write("\2\u0732\u0731\3\2\2\2\u0733\u00e1\3\2\2\2\u0734\u0735"= ) + buf.write("\7\63\2\2\u0735\u0736\5P)\2\u0736\u073b\7!\2\2\u0737\u0= 738") + buf.write("\7\64\2\2\u0738\u0739\7\b\2\2\u0739\u073a\7\u00fa\2\2") + buf.write("\u073a\u073c\7!\2\2\u073b\u0737\3\2\2\2\u073b\u073c\3") + buf.write("\2\2\2\u073c\u0742\3\2\2\2\u073d\u073e\7@\2\2\u073e\u07= 3f") + buf.write("\7\b\2\2\u073f\u0740\5\u00e4s\2\u0740\u0741\7!\2\2\u074= 1") + buf.write("\u0743\3\2\2\2\u0742\u073d\3\2\2\2\u0742\u0743\3\2\2\2"= ) + buf.write("\u0743\u0744\3\2\2\2\u0744\u0745\5\u00b4[\2\u0745\u0746= ") + buf.write("\7\65\2\2\u0746\u0747\7 \2\2\u0747\u00e3\3\2\2\2\u0748"= ) + buf.write("\u074d\5\u00e6t\2\u0749\u074a\7(\2\2\u074a\u074c\5\u00e= 6") + buf.write("t\2\u074b\u0749\3\2\2\2\u074c\u074f\3\2\2\2\u074d\u074b= ") + buf.write("\3\2\2\2\u074d\u074e\3\2\2\2\u074e\u00e5\3\2\2\2\u074f"= ) + buf.write("\u074d\3\2\2\2\u0750\u0755\7\u00fa\2\2\u0751\u0755\7\u0= 0c0") + buf.write("\2\2\u0752\u0755\7\u00c1\2\2\u0753\u0755\5V,\2\u0754\u0= 750") + buf.write("\3\2\2\2\u0754\u0751\3\2\2\2\u0754\u0752\3\2\2\2\u0754"= ) + buf.write("\u0753\3\2\2\2\u0755\u00e7\3\2\2\2\u0756\u07b1\7A\2\2") + buf.write("\u0757\u0758\5P)\2\u0758\u075e\7!\2\2\u0759\u075a\7@\2"= ) + buf.write("\2\u075a\u075b\7\b\2\2\u075b\u075c\5\u00ecw\2\u075c\u07= 5d") + buf.write("\7!\2\2\u075d\u075f\3\2\2\2\u075e\u0759\3\2\2\2\u075e") + buf.write("\u075f\3\2\2\2\u075f\u0760\3\2\2\2\u0760\u0761\5\u00b4"= ) + buf.write("[\2\u0761\u07b2\3\2\2\2\u0762\u0763\7C\2\2\u0763\u0764"= ) + buf.write("\7\u008f\2\2\u0764\u0765\7\b\2\2\u0765\u0766\7\u00fb\2"= ) + buf.write("\2\u0766\u0767\7\34\2\2\u0767\u0768\7\u00fb\2\2\u0768") + buf.write("\u0769\7!\2\2\u0769\u076a\7\62\2\2\u076a\u076b\7\b\2\2"= ) + buf.write("\u076b\u076c\7\u00ec\2\2\u076c\u076d\7\30\2\2\u076d\u07= 6e") + buf.write("\7\u00fa\2\2\u076e\u076f\7\31\2\2\u076f\u0770\7!\2\2\u0= 770") + buf.write("\u0771\7=3D\2\2\u0771\u0772\7\b\2\2\u0772\u0773\7\u00ec= ") + buf.write("\2\2\u0773\u0774\7\30\2\2\u0774\u0775\7\u00fa\2\2\u0775= ") + buf.write("\u0776\7\31\2\2\u0776\u0777\7!\2\2\u0777\u0778\5\u00ea"= ) + buf.write("v\2\u0778\u0779\7D\2\2\u0779\u077a\7\u008f\2\2\u077a\u0= 77b") + buf.write("\7\b\2\2\u077b\u077c\7\u00fb\2\2\u077c\u077d\7\34\2\2") + buf.write("\u077d\u077e\7\u00fb\2\2\u077e\u077f\7!\2\2\u077f\u0780= ") + buf.write("\7\62\2\2\u0780\u0781\7\b\2\2\u0781\u0782\7\u00ec\2\2") + buf.write("\u0782\u0783\7\30\2\2\u0783\u0784\7\u00fa\2\2\u0784\u07= 85") + buf.write("\7\31\2\2\u0785\u0786\7!\2\2\u0786\u0787\7=3D\2\2\u0787= ") + buf.write("\u0788\7\b\2\2\u0788\u0789\7\u00ec\2\2\u0789\u078a\7\30= ") + buf.write("\2\2\u078a\u078b\7\u00fa\2\2\u078b\u078c\7\31\2\2\u078c= ") + buf.write("\u078d\7!\2\2\u078d\u078e\5\u00eav\2\u078e\u078f\7E\2") + buf.write("\2\u078f\u0790\7\u008f\2\2\u0790\u0791\7\b\2\2\u0791\u0= 792") + buf.write("\7\u00fb\2\2\u0792\u0793\7\34\2\2\u0793\u0794\7\u00fb") + buf.write("\2\2\u0794\u0795\7!\2\2\u0795\u0796\7\62\2\2\u0796\u079= 7") + buf.write("\7\b\2\2\u0797\u0798\7\u00ec\2\2\u0798\u0799\7\30\2\2") + buf.write("\u0799\u079a\7\u00fa\2\2\u079a\u079b\7\31\2\2\u079b\u07= 9c") + buf.write("\7!\2\2\u079c\u079d\7=3D\2\2\u079d\u079e\7\b\2\2\u079e\= u079f") + buf.write("\7\u00ec\2\2\u079f\u07a0\7\30\2\2\u07a0\u07a1\7\u00fa") + buf.write("\2\2\u07a1\u07a2\7\31\2\2\u07a2\u07a3\7!\2\2\u07a3\u07a= 9") + buf.write("\5\u00eav\2\u07a4\u07a5\7@\2\2\u07a5\u07a6\7\b\2\2\u07a= 6") + buf.write("\u07a7\5\u00ecw\2\u07a7\u07a8\7!\2\2\u07a8\u07aa\3\2\2"= ) + buf.write("\2\u07a9\u07a4\3\2\2\2\u07a9\u07aa\3\2\2\2\u07aa\u07ae"= ) + buf.write("\3\2\2\2\u07ab\u07ad\5\u008cG\2\u07ac\u07ab\3\2\2\2\u07= ad") + buf.write("\u07b0\3\2\2\2\u07ae\u07ac\3\2\2\2\u07ae\u07af\3\2\2\2"= ) + buf.write("\u07af\u07b2\3\2\2\2\u07b0\u07ae\3\2\2\2\u07b1\u0757\3"= ) + buf.write("\2\2\2\u07b1\u0762\3\2\2\2\u07b2\u07b3\3\2\2\2\u07b3\u0= 7b4") + buf.write("\7B\2\2\u07b4\u07b5\7 \2\2\u07b5\u00e9\3\2\2\2\u07b6\u0= 7b7") + buf.write("\7`\2\2\u07b7\u07b8\7\b\2\2\u07b8\u07b9\7\u00fa\2\2\u07= b9") + buf.write("\u07ba\7!\2\2\u07ba\u07bb\7a\2\2\u07bb\u07bc\7\b\2\2\u0= 7bc") + buf.write("\u07bd\7\u00fa\2\2\u07bd\u07c2\7!\2\2\u07be\u07bf\7b\2"= ) + buf.write("\2\u07bf\u07c0\7\b\2\2\u07c0\u07c1\7\u00fa\2\2\u07c1\u0= 7c3") + buf.write("\7!\2\2\u07c2\u07be\3\2\2\2\u07c2\u07c3\3\2\2\2\u07c3") + buf.write("\u07c8\3\2\2\2\u07c4\u07c5\7c\2\2\u07c5\u07c6\7\b\2\2") + buf.write("\u07c6\u07c7\7\u00fa\2\2\u07c7\u07c9\7!\2\2\u07c8\u07c4= ") + buf.write("\3\2\2\2\u07c8\u07c9\3\2\2\2\u07c9\u00eb\3\2\2\2\u07ca"= ) + buf.write("\u07cf\5\u00eex\2\u07cb\u07cc\7(\2\2\u07cc\u07ce\5\u00e= e") + buf.write("x\2\u07cd\u07cb\3\2\2\2\u07ce\u07d1\3\2\2\2\u07cf\u07cd= ") + buf.write("\3\2\2\2\u07cf\u07d0\3\2\2\2\u07d0\u00ed\3\2\2\2\u07d1"= ) + buf.write("\u07cf\3\2\2\2\u07d2\u07d3\t\6\2\2\u07d3\u00ef\3\2\2\2"= ) + buf.write("\u07d4\u082f\7F\2\2\u07d5\u07d6\5P)\2\u07d6\u07dc\7!\2"= ) + buf.write("\2\u07d7\u07d8\7@\2\2\u07d8\u07d9\7\b\2\2\u07d9\u07da") + buf.write("\5\u00f4{\2\u07da\u07db\7!\2\2\u07db\u07dd\3\2\2\2\u07d= c") + buf.write("\u07d7\3\2\2\2\u07dc\u07dd\3\2\2\2\u07dd\u07de\3\2\2\2"= ) + buf.write("\u07de\u07df\5\u00b4[\2\u07df\u0830\3\2\2\2\u07e0\u07e1= ") + buf.write("\7H\2\2\u07e1\u07e2\7\u008f\2\2\u07e2\u07e3\7\b\2\2\u07= e3") + buf.write("\u07e4\7\u00fb\2\2\u07e4\u07e5\7\34\2\2\u07e5\u07e6\7") + buf.write("\u00fb\2\2\u07e6\u07e7\7!\2\2\u07e7\u07e8\7\62\2\2\u07e= 8") + buf.write("\u07e9\7\b\2\2\u07e9\u07ea\7\u00ec\2\2\u07ea\u07eb\7\30= ") + buf.write("\2\2\u07eb\u07ec\7\u00fa\2\2\u07ec\u07ed\7\31\2\2\u07ed= ") + buf.write("\u07ee\7!\2\2\u07ee\u07ef\7=3D\2\2\u07ef\u07f0\7\b\2\2\= u07f0") + buf.write("\u07f1\7\u00ec\2\2\u07f1\u07f2\7\30\2\2\u07f2\u07f3\7") + buf.write("\u00fa\2\2\u07f3\u07f4\7\31\2\2\u07f4\u07f5\7!\2\2\u07f= 5") + buf.write("\u07f6\5\u00f2z\2\u07f6\u07f7\7I\2\2\u07f7\u07f8\7\u008= f") + buf.write("\2\2\u07f8\u07f9\7\b\2\2\u07f9\u07fa\7\u00fb\2\2\u07fa"= ) + buf.write("\u07fb\7\34\2\2\u07fb\u07fc\7\u00fb\2\2\u07fc\u07fd\7") + buf.write("!\2\2\u07fd\u07fe\7\62\2\2\u07fe\u07ff\7\b\2\2\u07ff\u0= 800") + buf.write("\7\u00ec\2\2\u0800\u0801\7\30\2\2\u0801\u0802\7\u00fa") + buf.write("\2\2\u0802\u0803\7\31\2\2\u0803\u0804\7!\2\2\u0804\u080= 5") + buf.write("\7=3D\2\2\u0805\u0806\7\b\2\2\u0806\u0807\7\u00ec\2\2\u= 0807") + buf.write("\u0808\7\30\2\2\u0808\u0809\7\u00fa\2\2\u0809\u080a\7") + buf.write("\31\2\2\u080a\u080b\7!\2\2\u080b\u080c\5\u00f2z\2\u080c= ") + buf.write("\u080d\7J\2\2\u080d\u080e\7\u008f\2\2\u080e\u080f\7\b") + buf.write("\2\2\u080f\u0810\7\u00fb\2\2\u0810\u0811\7\34\2\2\u0811= ") + buf.write("\u0812\7\u00fb\2\2\u0812\u0813\7!\2\2\u0813\u0814\7\62"= ) + buf.write("\2\2\u0814\u0815\7\b\2\2\u0815\u0816\7\u00ec\2\2\u0816"= ) + buf.write("\u0817\7\30\2\2\u0817\u0818\7\u00fa\2\2\u0818\u0819\7") + buf.write("\31\2\2\u0819\u081a\7!\2\2\u081a\u081b\7=3D\2\2\u081b\u= 081c") + buf.write("\7\b\2\2\u081c\u081d\7\u00ec\2\2\u081d\u081e\7\30\2\2") + buf.write("\u081e\u081f\7\u00fa\2\2\u081f\u0820\7\31\2\2\u0820\u08= 21") + buf.write("\7!\2\2\u0821\u0827\5\u00f2z\2\u0822\u0823\7@\2\2\u0823= ") + buf.write("\u0824\7\b\2\2\u0824\u0825\5\u00f4{\2\u0825\u0826\7!\2"= ) + buf.write("\2\u0826\u0828\3\2\2\2\u0827\u0822\3\2\2\2\u0827\u0828"= ) + buf.write("\3\2\2\2\u0828\u082c\3\2\2\2\u0829\u082b\5\u008cG\2\u08= 2a") + buf.write("\u0829\3\2\2\2\u082b\u082e\3\2\2\2\u082c\u082a\3\2\2\2"= ) + buf.write("\u082c\u082d\3\2\2\2\u082d\u0830\3\2\2\2\u082e\u082c\3"= ) + buf.write("\2\2\2\u082f\u07d5\3\2\2\2\u082f\u07e0\3\2\2\2\u0830\u0= 831") + buf.write("\3\2\2\2\u0831\u0832\7G\2\2\u0832\u0833\7 \2\2\u0833\u0= 0f1") + buf.write("\3\2\2\2\u0834\u0835\7`\2\2\u0835\u0836\7\b\2\2\u0836") + buf.write("\u0837\7\u00fa\2\2\u0837\u0838\7!\2\2\u0838\u0839\7a\2"= ) + buf.write("\2\u0839\u083a\7\b\2\2\u083a\u083b\7\u00fa\2\2\u083b\u0= 840") + buf.write("\7!\2\2\u083c\u083d\7b\2\2\u083d\u083e\7\b\2\2\u083e\u0= 83f") + buf.write("\7\u00fa\2\2\u083f\u0841\7!\2\2\u0840\u083c\3\2\2\2\u08= 40") + buf.write("\u0841\3\2\2\2\u0841\u0846\3\2\2\2\u0842\u0843\7c\2\2") + buf.write("\u0843\u0844\7\b\2\2\u0844\u0845\7\u00fa\2\2\u0845\u084= 7") + buf.write("\7!\2\2\u0846\u0842\3\2\2\2\u0846\u0847\3\2\2\2\u0847") + buf.write("\u00f3\3\2\2\2\u0848\u084d\5\u00f6|\2\u0849\u084a\7(\2"= ) + buf.write("\2\u084a\u084c\5\u00f6|\2\u084b\u0849\3\2\2\2\u084c\u08= 4f") + buf.write("\3\2\2\2\u084d\u084b\3\2\2\2\u084d\u084e\3\2\2\2\u084e"= ) + buf.write("\u00f5\3\2\2\2\u084f\u084d\3\2\2\2\u0850\u0851\t\7\2\2"= ) + buf.write("\u0851\u00f7\3\2\2\2\u0852\u0857\5\u0104\u0083\2\u0853"= ) + buf.write("\u0857\5\u00fc\177\2\u0854\u0857\5\u00fe\u0080\2\u0855"= ) + buf.write("\u0857\5\u010e\u0088\2\u0856\u0852\3\2\2\2\u0856\u0853"= ) + buf.write("\3\2\2\2\u0856\u0854\3\2\2\2\u0856\u0855\3\2\2\2\u0857"= ) + buf.write("\u00f9\3\2\2\2\u0858\u0859\5\u0104\u0083\2\u0859\u085a"= ) + buf.write("\5\u010a\u0086\2\u085a\u085b\5\u010c\u0087\2\u085b\u085= c") + buf.write("\5\u010e\u0088\2\u085c\u00fb\3\2\2\2\u085d\u085e\5\u010= a") + buf.write("\u0086\2\u085e\u00fd\3\2\2\2\u085f\u0860\5\u010c\u0087"= ) + buf.write("\2\u0860\u00ff\3\2\2\2\u0861\u0868\5p9\2\u0862\u0868\5"= ) + buf.write("\u0088E\2\u0863\u0868\5\u00f8}\2\u0864\u0868\5\u0118\u0= 08d") + buf.write("\2\u0865\u0868\5\u011c\u008f\2\u0866\u0868\5\u0110\u008= 9") + buf.write("\2\u0867\u0861\3\2\2\2\u0867\u0862\3\2\2\2\u0867\u0863"= ) + buf.write("\3\2\2\2\u0867\u0864\3\2\2\2\u0867\u0865\3\2\2\2\u0867"= ) + buf.write("\u0866\3\2\2\2\u0868\u0101\3\2\2\2\u0869\u086e\5p9\2\u0= 86a") + buf.write("\u086e\5\u0088E\2\u086b\u086e\5\u0118\u008d\2\u086c\u08= 6e") + buf.write("\5\u0110\u0089\2\u086d\u0869\3\2\2\2\u086d\u086a\3\2\2"= ) + buf.write("\2\u086d\u086b\3\2\2\2\u086d\u086c\3\2\2\2\u086e\u0103"= ) + buf.write("\3\2\2\2\u086f\u0870\7l\2\2\u0870\u0871\5\u0124\u0093") + buf.write("\2\u0871\u0875\7 \2\2\u0872\u0874\5\u0100\u0081\2\u0873= ") + buf.write("\u0872\3\2\2\2\u0874\u0877\3\2\2\2\u0875\u0873\3\2\2\2"= ) + buf.write("\u0875\u0876\3\2\2\2\u0876\u0878\3\2\2\2\u0877\u0875\3"= ) + buf.write("\2\2\2\u0878\u0879\7s\2\2\u0879\u087a\7 \2\2\u087a\u010= 5") + buf.write("\3\2\2\2\u087b\u0888\7k\2\2\u087c\u087d\7@\2\2\u087d\u0= 87e") + buf.write("\7\b\2\2\u087e\u0883\5\u009eP\2\u087f\u0880\7(\2\2\u088= 0") + buf.write("\u0882\5\u009eP\2\u0881\u087f\3\2\2\2\u0882\u0885\3\2") + buf.write("\2\2\u0883\u0881\3\2\2\2\u0883\u0884\3\2\2\2\u0884\u088= 6") + buf.write("\3\2\2\2\u0885\u0883\3\2\2\2\u0886\u0887\7!\2\2\u0887") + buf.write("\u0889\3\2\2\2\u0888\u087c\3\2\2\2\u0888\u0889\3\2\2\2"= ) + buf.write("\u0889\u088a\3\2\2\2\u088a\u088b\5\u0124\u0093\2\u088b"= ) + buf.write("\u088c\7 \2\2\u088c\u0107\3\2\2\2\u088d\u089a\7K\2\2\u0= 88e") + buf.write("\u088f\7@\2\2\u088f\u0890\7\b\2\2\u0890\u0895\5\u009e") + buf.write("P\2\u0891\u0892\7(\2\2\u0892\u0894\5\u009eP\2\u0893\u08= 91") + buf.write("\3\2\2\2\u0894\u0897\3\2\2\2\u0895\u0893\3\2\2\2\u0895"= ) + buf.write("\u0896\3\2\2\2\u0896\u0898\3\2\2\2\u0897\u0895\3\2\2\2"= ) + buf.write("\u0898\u0899\7!\2\2\u0899\u089b\3\2\2\2\u089a\u088e\3") + buf.write("\2\2\2\u089a\u089b\3\2\2\2\u089b\u089c\3\2\2\2\u089c\u0= 89d") + buf.write("\5\u0124\u0093\2\u089d\u089e\7 \2\2\u089e\u0109\3\2\2") + buf.write("\2\u089f\u08ac\7k\2\2\u08a0\u08a1\7@\2\2\u08a1\u08a2\7"= ) + buf.write("\b\2\2\u08a2\u08a7\5\u009eP\2\u08a3\u08a4\7(\2\2\u08a4"= ) + buf.write("\u08a6\5\u009eP\2\u08a5\u08a3\3\2\2\2\u08a6\u08a9\3\2") + buf.write("\2\2\u08a7\u08a5\3\2\2\2\u08a7\u08a8\3\2\2\2\u08a8\u08a= a") + buf.write("\3\2\2\2\u08a9\u08a7\3\2\2\2\u08aa\u08ab\7!\2\2\u08ab") + buf.write("\u08ad\3\2\2\2\u08ac\u08a0\3\2\2\2\u08ac\u08ad\3\2\2\2"= ) + buf.write("\u08ad\u08ae\3\2\2\2\u08ae\u08af\5\u0124\u0093\2\u08af"= ) + buf.write("\u08b3\7 \2\2\u08b0\u08b2\5\u0100\u0081\2\u08b1\u08b0") + buf.write("\3\2\2\2\u08b2\u08b5\3\2\2\2\u08b3\u08b1\3\2\2\2\u08b3"= ) + buf.write("\u08b4\3\2\2\2\u08b4\u08b6\3\2\2\2\u08b5\u08b3\3\2\2\2"= ) + buf.write("\u08b6\u08b7\7s\2\2\u08b7\u08b8\7 \2\2\u08b8\u010b\3\2"= ) + buf.write("\2\2\u08b9\u08c6\7K\2\2\u08ba\u08bb\7@\2\2\u08bb\u08bc"= ) + buf.write("\7\b\2\2\u08bc\u08c1\5\u009eP\2\u08bd\u08be\7(\2\2\u08b= e") + buf.write("\u08c0\5\u009eP\2\u08bf\u08bd\3\2\2\2\u08c0\u08c3\3\2") + buf.write("\2\2\u08c1\u08bf\3\2\2\2\u08c1\u08c2\3\2\2\2\u08c2\u08c= 4") + buf.write("\3\2\2\2\u08c3\u08c1\3\2\2\2\u08c4\u08c5\7!\2\2\u08c5") + buf.write("\u08c7\3\2\2\2\u08c6\u08ba\3\2\2\2\u08c6\u08c7\3\2\2\2"= ) + buf.write("\u08c7\u08c8\3\2\2\2\u08c8\u08c9\5\u0124\u0093\2\u08c9"= ) + buf.write("\u08cd\7 \2\2\u08ca\u08cc\5\u0100\u0081\2\u08cb\u08ca") + buf.write("\3\2\2\2\u08cc\u08cf\3\2\2\2\u08cd\u08cb\3\2\2\2\u08cd"= ) + buf.write("\u08ce\3\2\2\2\u08ce\u08d0\3\2\2\2\u08cf\u08cd\3\2\2\2"= ) + buf.write("\u08d0\u08d1\7s\2\2\u08d1\u08d2\7 \2\2\u08d2\u010d\3\2"= ) + buf.write("\2\2\u08d3\u08d4\7p\2\2\u08d4\u08d5\7\62\2\2\u08d5\u08d= 6") + buf.write("\7\b\2\2\u08d6\u08d7\7\u00ec\2\2\u08d7\u08d8\7\30\2\2") + buf.write("\u08d8\u08d9\7\u00fa\2\2\u08d9\u08da\7\31\2\2\u08da\u08= e7") + buf.write("\7!\2\2\u08db\u08dc\7@\2\2\u08dc\u08dd\7\b\2\2\u08dd\u0= 8e2") + buf.write("\5\u009eP\2\u08de\u08df\7(\2\2\u08df\u08e1\5\u009eP\2") + buf.write("\u08e0\u08de\3\2\2\2\u08e1\u08e4\3\2\2\2\u08e2\u08e0\3"= ) + buf.write("\2\2\2\u08e2\u08e3\3\2\2\2\u08e3\u08e5\3\2\2\2\u08e4\u0= 8e2") + buf.write("\3\2\2\2\u08e5\u08e6\7!\2\2\u08e6\u08e8\3\2\2\2\u08e7") + buf.write("\u08db\3\2\2\2\u08e7\u08e8\3\2\2\2\u08e8\u08e9\3\2\2\2"= ) + buf.write("\u08e9\u08ea\5\u0124\u0093\2\u08ea\u08eb\7s\2\2\u08eb") + buf.write("\u08ec\7 \2\2\u08ec\u010f\3\2\2\2\u08ed\u08f1\5\u0112") + buf.write("\u008a\2\u08ee\u08f1\5\u0114\u008b\2\u08ef\u08f1\5\u011= 6") + buf.write("\u008c\2\u08f0\u08ed\3\2\2\2\u08f0\u08ee\3\2\2\2\u08f0"= ) + buf.write("\u08ef\3\2\2\2\u08f1\u0111\3\2\2\2\u08f2\u08f3\7m\2\2") + buf.write("\u08f3\u08f4\7\u0096\2\2\u08f4\u08f5\7\b\2\2\u08f5\u08f= 6") + buf.write("\7\u00fa\2\2\u08f6\u08f7\7!\2\2\u08f7\u08f8\7t\2\2\u08f= 8") + buf.write("\u08f9\7\b\2\2\u08f9\u08fa\7\u00fa\2\2\u08fa\u08fb\7 ") + buf.write("\2\2\u08fb\u0113\3\2\2\2\u08fc\u08fd\7N\2\2\u08fd\u08fe= ") + buf.write("\7=3D\2\2\u08fe\u08ff\7\b\2\2\u08ff\u0900\7\u00ec\2\2\u= 0900") + buf.write("\u0901\7\30\2\2\u0901\u0902\7\u00fa\2\2\u0902\u0903\7") + buf.write("\31\2\2\u0903\u0904\7!\2\2\u0904\u0905\7>\2\2\u0905\u09= 06") + buf.write("\7\b\2\2\u0906\u0907\7\u00ec\2\2\u0907\u0908\7\30\2\2") + buf.write("\u0908\u0909\7\u00fa\2\2\u0909\u090a\7\31\2\2\u090a\u09= 11") + buf.write("\7!\2\2\u090b\u090c\7>\2\2\u090c\u090d\7\b\2\2\u090d\u0= 90e") + buf.write("\7\u00ec\2\2\u090e\u090f\7\30\2\2\u090f\u0910\7\u00fa") + buf.write("\2\2\u0910\u0912\7\31\2\2\u0911\u090b\3\2\2\2\u0911\u09= 12") + buf.write("\3\2\2\2\u0912\u0913\3\2\2\2\u0913\u0914\7 \2\2\u0914") + buf.write("\u0115\3\2\2\2\u0915\u0916\t\b\2\2\u0916\u0917\7\u0087"= ) + buf.write("\2\2\u0917\u0918\7!\2\2\u0918\u0919\7/\2\2\u0919\u091a"= ) + buf.write("\7\b\2\2\u091a\u091b\7\u00fa\2\2\u091b\u091c\7!\2\2\u09= 1c") + buf.write("\u091d\7\62\2\2\u091d\u091e\7\b\2\2\u091e\u091f\7\u00ec= ") + buf.write("\2\2\u091f\u0920\7\30\2\2\u0920\u0921\7\u00fa\2\2\u0921= ") + buf.write("\u0922\7\31\2\2\u0922\u0923\7!\2\2\u0923\u0924\7=3D\2\2= ") + buf.write("\u0924\u0925\7\b\2\2\u0925\u0926\7\u00ec\2\2\u0926\u092= 7") + buf.write("\7\30\2\2\u0927\u0928\7\u00fa\2\2\u0928\u0934\7\31\2\2"= ) + buf.write("\u0929\u092a\7!\2\2\u092a\u092b\7@\2\2\u092b\u092c\7\b"= ) + buf.write("\2\2\u092c\u0931\5\u009eP\2\u092d\u092e\7(\2\2\u092e\u0= 930") + buf.write("\5\u009eP\2\u092f\u092d\3\2\2\2\u0930\u0933\3\2\2\2\u09= 31") + buf.write("\u092f\3\2\2\2\u0931\u0932\3\2\2\2\u0932\u0935\3\2\2\2"= ) + buf.write("\u0933\u0931\3\2\2\2\u0934\u0929\3\2\2\2\u0934\u0935\3"= ) + buf.write("\2\2\2\u0935\u093a\3\2\2\2\u0936\u0937\7!\2\2\u0937\u09= 38") + buf.write("\7t\2\2\u0938\u0939\7\b\2\2\u0939\u093b\7\u00fa\2\2\u09= 3a") + buf.write("\u0936\3\2\2\2\u093a\u093b\3\2\2\2\u093b\u093c\3\2\2\2"= ) + buf.write("\u093c\u093d\7 \2\2\u093d\u0117\3\2\2\2\u093e\u093f\7") + buf.write("L\2\2\u093f\u0940\7\u00fa\2\2\u0940\u0941\7 \2\2\u0941"= ) + buf.write("\u0119\3\2\2\2\u0942\u0944\7\u0088\2\2\u0943\u0945\7!") + buf.write("\2\2\u0944\u0943\3\2\2\2\u0944\u0945\3\2\2\2\u0945\u094= 6") + buf.write("\3\2\2\2\u0946\u0947\7.\2\2\u0947\u0948\7\b\2\2\u0948") + buf.write("\u0949\7\u00ec\2\2\u0949\u094a\7\30\2\2\u094a\u094b\7") + buf.write("\u00fa\2\2\u094b\u094c\7\31\2\2\u094c\u0957\7!\2\2\u094= d") + buf.write("\u094e\7\u008d\2\2\u094e\u094f\7\u00fa\2\2\u094f\u0950"= ) + buf.write("\7!\2\2\u0950\u0951\7\u0089\2\2\u0951\u0952\t\t\2\2\u09= 52") + buf.write("\u0958\7 \2\2\u0953\u0954\7M\2\2\u0954\u0955\7\b\2\2\u0= 955") + buf.write("\u0956\7\u00fa\2\2\u0956\u0958\7 \2\2\u0957\u094d\3\2") + buf.write("\2\2\u0957\u0953\3\2\2\2\u0958\u011b\3\2\2\2\u0959\u095= a") + buf.write("\7\u00a7\2\2\u095a\u095b\7[\2\2\u095b\u095c\7\b\2\2\u09= 5c") + buf.write("\u09a4\5L\'\2\u095d\u095e\7!\2\2\u095e\u095f\7\u00a9\2"= ) + buf.write("\2\u095f\u099c\7\b\2\2\u0960\u0964\7S\2\2\u0961\u0962") + buf.write("\7\32\2\2\u0962\u0963\7\u00fa\2\2\u0963\u0965\7\33\2\2"= ) + buf.write("\u0964\u0961\3\2\2\2\u0964\u0965\3\2\2\2\u0965\u099d\3"= ) + buf.write("\2\2\2\u0966\u096a\7T\2\2\u0967\u0968\7\32\2\2\u0968\u0= 969") + buf.write("\7\u00fa\2\2\u0969\u096b\7\33\2\2\u096a\u0967\3\2\2\2") + buf.write("\u096a\u096b\3\2\2\2\u096b\u099d\3\2\2\2\u096c\u0970\7"= ) + buf.write("U\2\2\u096d\u096e\7\32\2\2\u096e\u096f\7\u00fa\2\2\u096= f") + buf.write("\u0971\7\33\2\2\u0970\u096d\3\2\2\2\u0970\u0971\3\2\2") + buf.write("\2\u0971\u099d\3\2\2\2\u0972\u0976\7V\2\2\u0973\u0974") + buf.write("\7\32\2\2\u0974\u0975\7\u00fa\2\2\u0975\u0977\7\33\2\2"= ) + buf.write("\u0976\u0973\3\2\2\2\u0976\u0977\3\2\2\2\u0977\u099d\3"= ) + buf.write("\2\2\2\u0978\u097c\7R\2\2\u0979\u097a\7\32\2\2\u097a\u0= 97b") + buf.write("\7\u00fa\2\2\u097b\u097d\7\33\2\2\u097c\u0979\3\2\2\2") + buf.write("\u097c\u097d\3\2\2\2\u097d\u099d\3\2\2\2\u097e\u0982\7"= ) + buf.write("W\2\2\u097f\u0980\7\32\2\2\u0980\u0981\7\u00fa\2\2\u098= 1") + buf.write("\u0983\7\33\2\2\u0982\u097f\3\2\2\2\u0982\u0983\3\2\2") + buf.write("\2\u0983\u099d\3\2\2\2\u0984\u0988\7X\2\2\u0985\u0986") + buf.write("\7\32\2\2\u0986\u0987\7\u00fa\2\2\u0987\u0989\7\33\2\2"= ) + buf.write("\u0988\u0985\3\2\2\2\u0988\u0989\3\2\2\2\u0989\u099d\3"= ) + buf.write("\2\2\2\u098a\u098e\7Y\2\2\u098b\u098c\7\32\2\2\u098c\u0= 98d") + buf.write("\7\u00fa\2\2\u098d\u098f\7\33\2\2\u098e\u098b\3\2\2\2") + buf.write("\u098e\u098f\3\2\2\2\u098f\u099d\3\2\2\2\u0990\u0994\7"= ) + buf.write("Z\2\2\u0991\u0992\7\32\2\2\u0992\u0993\7\u00fa\2\2\u099= 3") + buf.write("\u0995\7\33\2\2\u0994\u0991\3\2\2\2\u0994\u0995\3\2\2") + buf.write("\2\u0995\u099d\3\2\2\2\u0996\u099a\7\u00fb\2\2\u0997\u0= 998") + buf.write("\7\32\2\2\u0998\u0999\7\u00fa\2\2\u0999\u099b\7\33\2\2"= ) + buf.write("\u099a\u0997\3\2\2\2\u099a\u099b\3\2\2\2\u099b\u099d\3"= ) + buf.write("\2\2\2\u099c\u0960\3\2\2\2\u099c\u0966\3\2\2\2\u099c\u0= 96c") + buf.write("\3\2\2\2\u099c\u0972\3\2\2\2\u099c\u0978\3\2\2\2\u099c"= ) + buf.write("\u097e\3\2\2\2\u099c\u0984\3\2\2\2\u099c\u098a\3\2\2\2"= ) + buf.write("\u099c\u0990\3\2\2\2\u099c\u0996\3\2\2\2\u099d\u09a1\3"= ) + buf.write("\2\2\2\u099e\u09a0\5\u011e\u0090\2\u099f\u099e\3\2\2\2"= ) + buf.write("\u09a0\u09a3\3\2\2\2\u09a1\u099f\3\2\2\2\u09a1\u09a2\3"= ) + buf.write("\2\2\2\u09a2\u09a5\3\2\2\2\u09a3\u09a1\3\2\2\2\u09a4\u0= 95d") + buf.write("\3\2\2\2\u09a4\u09a5\3\2\2\2\u09a5\u09ae\3\2\2\2\u09a6"= ) + buf.write("\u09aa\7!\2\2\u09a7\u09a9\5\u011c\u008f\2\u09a8\u09a7") + buf.write("\3\2\2\2\u09a9\u09ac\3\2\2\2\u09aa\u09a8\3\2\2\2\u09aa"= ) + buf.write("\u09ab\3\2\2\2\u09ab\u09ad\3\2\2\2\u09ac\u09aa\3\2\2\2"= ) + buf.write("\u09ad\u09af\7\u00a8\2\2\u09ae\u09a6\3\2\2\2\u09ae\u09a= f") + buf.write("\3\2\2\2\u09af\u09b0\3\2\2\2\u09b0\u09b1\7 \2\2\u09b1") + buf.write("\u011d\3\2\2\2\u09b2\u09b3\7!\2\2\u09b3\u09b7\7\u00aa") + buf.write("\2\2\u09b4\u09b5\7\32\2\2\u09b5\u09b6\7\u00fa\2\2\u09b6= ") + buf.write("\u09b8\7\33\2\2\u09b7\u09b4\3\2\2\2\u09b7\u09b8\3\2\2") + buf.write("\2\u09b8\u09bd\3\2\2\2\u09b9\u09ba\7\34\2\2\u09ba\u09bc= ") + buf.write("\5\u015e\u00b0\2\u09bb\u09b9\3\2\2\2\u09bc\u09bf\3\2\2"= ) + buf.write("\2\u09bd\u09bb\3\2\2\2\u09bd\u09be\3\2\2\2\u09be\u09c0"= ) + buf.write("\3\2\2\2\u09bf\u09bd\3\2\2\2\u09c0\u09c1\7\b\2\2\u09c1"= ) + buf.write("\u09c2\7\u00fa\2\2\u09c2\u011f\3\2\2\2\u09c3\u09c4\5\u0= 122") + buf.write("\u0092\2\u09c4\u09c5\7 \2\2\u09c5\u0121\3\2\2\2\u09c6") + buf.write("\u09c7\7\u00ab\2\2\u09c7\u0123\3\2\2\2\u09c8\u09cd\5\u0= 128") + buf.write("\u0095\2\u09c9\u09ca\7\u00dc\2\2\u09ca\u09cc\5\u0128\u0= 095") + buf.write("\2\u09cb\u09c9\3\2\2\2\u09cc\u09cf\3\2\2\2\u09cd\u09cb"= ) + buf.write("\3\2\2\2\u09cd\u09ce\3\2\2\2\u09ce\u0125\3\2\2\2\u09cf"= ) + buf.write("\u09cd\3\2\2\2\u09d0\u09d5\5\u0128\u0095\2\u09d1\u09d2"= ) + buf.write("\7\u00dc\2\2\u09d2\u09d4\5\u0128\u0095\2\u09d3\u09d1\3"= ) + buf.write("\2\2\2\u09d4\u09d7\3\2\2\2\u09d5\u09d3\3\2\2\2\u09d5\u0= 9d6") + buf.write("\3\2\2\2\u09d6\u0127\3\2\2\2\u09d7\u09d5\3\2\2\2\u09d8"= ) + buf.write("\u09dd\5\u012a\u0096\2\u09d9\u09da\7\u00db\2\2\u09da\u0= 9dc") + buf.write("\5\u012a\u0096\2\u09db\u09d9\3\2\2\2\u09dc\u09df\3\2\2"= ) + buf.write("\2\u09dd\u09db\3\2\2\2\u09dd\u09de\3\2\2\2\u09de\u0129"= ) + buf.write("\3\2\2\2\u09df\u09dd\3\2\2\2\u09e0\u09e5\5\u012c\u0097"= ) + buf.write("\2\u09e1\u09e2\7(\2\2\u09e2\u09e4\5\u012c\u0097\2\u09e3= ") + buf.write("\u09e1\3\2\2\2\u09e4\u09e7\3\2\2\2\u09e5\u09e3\3\2\2\2"= ) + buf.write("\u09e5\u09e6\3\2\2\2\u09e6\u012b\3\2\2\2\u09e7\u09e5\3"= ) + buf.write("\2\2\2\u09e8\u09ed\5\u012e\u0098\2\u09e9\u09ea\7)\2\2") + buf.write("\u09ea\u09ec\5\u012e\u0098\2\u09eb\u09e9\3\2\2\2\u09ec"= ) + buf.write("\u09ef\3\2\2\2\u09ed\u09eb\3\2\2\2\u09ed\u09ee\3\2\2\2"= ) + buf.write("\u09ee\u012d\3\2\2\2\u09ef\u09ed\3\2\2\2\u09f0\u09f4\5"= ) + buf.write("\u0132\u009a\2\u09f1\u09f3\5\u0130\u0099\2\u09f2\u09f1"= ) + buf.write("\3\2\2\2\u09f3\u09f6\3\2\2\2\u09f4\u09f2\3\2\2\2\u09f4"= ) + buf.write("\u09f5\3\2\2\2\u09f5\u012f\3\2\2\2\u09f6\u09f4\3\2\2\2"= ) + buf.write("\u09f7\u09f8\7\"\2\2\u09f8\u09fc\5\u0132\u009a\2\u09f9"= ) + buf.write("\u09fa\7#\2\2\u09fa\u09fc\5\u0132\u009a\2\u09fb\u09f7") + buf.write("\3\2\2\2\u09fb\u09f9\3\2\2\2\u09fc\u0131\3\2\2\2\u09fd"= ) + buf.write("\u0a01\5\u0136\u009c\2\u09fe\u0a00\5\u0134\u009b\2\u09f= f") + buf.write("\u09fe\3\2\2\2\u0a00\u0a03\3\2\2\2\u0a01\u09ff\3\2\2\2"= ) + buf.write("\u0a01\u0a02\3\2\2\2\u0a02\u0133\3\2\2\2\u0a03\u0a01\3"= ) + buf.write("\2\2\2\u0a04\u0a05\7%\2\2\u0a05\u0a0d\5\u0136\u009c\2") + buf.write("\u0a06\u0a07\7$\2\2\u0a07\u0a0d\5\u0136\u009c\2\u0a08") + buf.write("\u0a09\7\'\2\2\u0a09\u0a0d\5\u0136\u009c\2\u0a0a\u0a0b"= ) + buf.write("\7&\2\2\u0a0b\u0a0d\5\u0136\u009c\2\u0a0c\u0a04\3\2\2") + buf.write("\2\u0a0c\u0a06\3\2\2\2\u0a0c\u0a08\3\2\2\2\u0a0c\u0a0a"= ) + buf.write("\3\2\2\2\u0a0d\u0135\3\2\2\2\u0a0e\u0a12\5\u013a\u009e"= ) + buf.write("\2\u0a0f\u0a11\5\u0138\u009d\2\u0a10\u0a0f\3\2\2\2\u0a1= 1") + buf.write("\u0a14\3\2\2\2\u0a12\u0a10\3\2\2\2\u0a12\u0a13\3\2\2\2"= ) + buf.write("\u0a13\u0137\3\2\2\2\u0a14\u0a12\3\2\2\2\u0a15\u0a16\7"= ) + buf.write("\f\2\2\u0a16\u0a1a\5\u013a\u009e\2\u0a17\u0a18\7\r\2\2"= ) + buf.write("\u0a18\u0a1a\5\u013a\u009e\2\u0a19\u0a15\3\2\2\2\u0a19"= ) + buf.write("\u0a17\3\2\2\2\u0a1a\u0139\3\2\2\2\u0a1b\u0a1f\5\u013e"= ) + buf.write("\u00a0\2\u0a1c\u0a1e\5\u013c\u009f\2\u0a1d\u0a1c\3\2\2"= ) + buf.write("\2\u0a1e\u0a21\3\2\2\2\u0a1f\u0a1d\3\2\2\2\u0a1f\u0a20"= ) + buf.write("\3\2\2\2\u0a20\u013b\3\2\2\2\u0a21\u0a1f\3\2\2\2\u0a22"= ) + buf.write("\u0a23\7\16\2\2\u0a23\u0a27\5\u013e\u00a0\2\u0a24\u0a25= ") + buf.write("\7\35\2\2\u0a25\u0a27\5\u013e\u00a0\2\u0a26\u0a22\3\2") + buf.write("\2\2\u0a26\u0a24\3\2\2\2\u0a27\u013d\3\2\2\2\u0a28\u0a2= c") + buf.write("\5\u0142\u00a2\2\u0a29\u0a2b\5\u0140\u00a1\2\u0a2a\u0a2= 9") + buf.write("\3\2\2\2\u0a2b\u0a2e\3\2\2\2\u0a2c\u0a2a\3\2\2\2\u0a2c"= ) + buf.write("\u0a2d\3\2\2\2\u0a2d\u013f\3\2\2\2\u0a2e\u0a2c\3\2\2\2"= ) + buf.write("\u0a2f\u0a30\7\17\2\2\u0a30\u0a36\5\u0142\u00a2\2\u0a31= ") + buf.write("\u0a32\7\37\2\2\u0a32\u0a36\5\u0142\u00a2\2\u0a33\u0a34= ") + buf.write("\7\20\2\2\u0a34\u0a36\5\u0142\u00a2\2\u0a35\u0a2f\3\2") + buf.write("\2\2\u0a35\u0a31\3\2\2\2\u0a35\u0a33\3\2\2\2\u0a36\u014= 1") + buf.write("\3\2\2\2\u0a37\u0a39\5\u0144\u00a3\2\u0a38\u0a37\3\2\2"= ) + buf.write("\2\u0a39\u0a3c\3\2\2\2\u0a3a\u0a38\3\2\2\2\u0a3a\u0a3b"= ) + buf.write("\3\2\2\2\u0a3b\u0a3d\3\2\2\2\u0a3c\u0a3a\3\2\2\2\u0a3d"= ) + buf.write("\u0a3e\5\u0146\u00a4\2\u0a3e\u0143\3\2\2\2\u0a3f\u0a40"= ) + buf.write("\7\30\2\2\u0a40\u0a41\t\n\2\2\u0a41\u0a42\7\31\2\2\u0a4= 2") + buf.write("\u0145\3\2\2\2\u0a43\u0a4f\5\u0148\u00a5\2\u0a44\u0a4f"= ) + buf.write("\5\u014a\u00a6\2\u0a45\u0a4f\5\u014c\u00a7\2\u0a46\u0a4= f") + buf.write("\5\u014e\u00a8\2\u0a47\u0a4f\5\u0150\u00a9\2\u0a48\u0a4= f") + buf.write("\5\u016e\u00b8\2\u0a49\u0a4f\5\u0170\u00b9\2\u0a4a\u0a4= f") + buf.write("\5\u0186\u00c4\2\u0a4b\u0a4f\5\u0196\u00cc\2\u0a4c\u0a4= d") + buf.write("\7\u00dd\2\2\u0a4d\u0a4f\5\u0146\u00a4\2\u0a4e\u0a43\3"= ) + buf.write("\2\2\2\u0a4e\u0a44\3\2\2\2\u0a4e\u0a45\3\2\2\2\u0a4e\u0= a46") + buf.write("\3\2\2\2\u0a4e\u0a47\3\2\2\2\u0a4e\u0a48\3\2\2\2\u0a4e"= ) + buf.write("\u0a49\3\2\2\2\u0a4e\u0a4a\3\2\2\2\u0a4e\u0a4b\3\2\2\2"= ) + buf.write("\u0a4e\u0a4c\3\2\2\2\u0a4f\u0147\3\2\2\2\u0a50\u0a51\7"= ) + buf.write("\u00e7\2\2\u0a51\u0a52\7\30\2\2\u0a52\u0a53\5\u0126\u00= 94") + buf.write("\2\u0a53\u0a54\7!\2\2\u0a54\u0a55\5\u0126\u0094\2\u0a55= ") + buf.write("\u0a56\7\31\2\2\u0a56\u0149\3\2\2\2\u0a57\u0a58\7\u00e5= ") + buf.write("\2\2\u0a58\u0a59\7\30\2\2\u0a59\u0a5a\5\u0126\u0094\2") + buf.write("\u0a5a\u0a5b\7!\2\2\u0a5b\u0a5c\5\u0126\u0094\2\u0a5c") + buf.write("\u0a5d\7\31\2\2\u0a5d\u014b\3\2\2\2\u0a5e\u0a5f\7\u00e6= ") + buf.write("\2\2\u0a5f\u0a60\7\30\2\2\u0a60\u0a61\5\u0126\u0094\2") + buf.write("\u0a61\u0a62\7!\2\2\u0a62\u0a63\5\u0126\u0094\2\u0a63") + buf.write("\u0a64\7!\2\2\u0a64\u0a65\5L\'\2\u0a65\u0a66\7\31\2\2") + buf.write("\u0a66\u014d\3\2\2\2\u0a67\u0a68\7\30\2\2\u0a68\u0a69") + buf.write("\5\u0126\u0094\2\u0a69\u0a6a\7\31\2\2\u0a6a\u014f\3\2") + buf.write("\2\2\u0a6b\u0a77\5\u0152\u00aa\2\u0a6c\u0a77\5\u0154\u0= 0ab") + buf.write("\2\u0a6d\u0a77\5\u0156\u00ac\2\u0a6e\u0a77\5\u0158\u00a= d") + buf.write("\2\u0a6f\u0a77\5\u015a\u00ae\2\u0a70\u0a77\5\u0160\u00b= 1") + buf.write("\2\u0a71\u0a77\5\u0162\u00b2\2\u0a72\u0a77\5\u0164\u00b= 3") + buf.write("\2\u0a73\u0a77\5\u0166\u00b4\2\u0a74\u0a77\5\u0168\u00b= 5") + buf.write("\2\u0a75\u0a77\5\u016c\u00b7\2\u0a76\u0a6b\3\2\2\2\u0a7= 6") + buf.write("\u0a6c\3\2\2\2\u0a76\u0a6d\3\2\2\2\u0a76\u0a6e\3\2\2\2"= ) + buf.write("\u0a76\u0a6f\3\2\2\2\u0a76\u0a70\3\2\2\2\u0a76\u0a71\3"= ) + buf.write("\2\2\2\u0a76\u0a72\3\2\2\2\u0a76\u0a73\3\2\2\2\u0a76\u0= a74") + buf.write("\3\2\2\2\u0a76\u0a75\3\2\2\2\u0a77\u0151\3\2\2\2\u0a78"= ) + buf.write("\u0a79\7\u00c7\2\2\u0a79\u0153\3\2\2\2\u0a7a\u0a7b\7\u0= 0c8") + buf.write("\2\2\u0a7b\u0a7c\7\u00c9\2\2\u0a7c\u0a7d\7\30\2\2\u0a7d= ") + buf.write("\u0a7e\7\u00fa\2\2\u0a7e\u0a89\7\31\2\2\u0a7f\u0a80\7") + buf.write("\"\2\2\u0a80\u0a8a\7\u00fa\2\2\u0a81\u0a82\7$\2\2\u0a82= ") + buf.write("\u0a8a\7\u00fa\2\2\u0a83\u0a84\7%\2\2\u0a84\u0a8a\7\u00= fa") + buf.write("\2\2\u0a85\u0a86\7&\2\2\u0a86\u0a8a\7\u00fa\2\2\u0a87") + buf.write("\u0a88\7\'\2\2\u0a88\u0a8a\7\u00fa\2\2\u0a89\u0a7f\3\2"= ) + buf.write("\2\2\u0a89\u0a81\3\2\2\2\u0a89\u0a83\3\2\2\2\u0a89\u0a8= 5") + buf.write("\3\2\2\2\u0a89\u0a87\3\2\2\2\u0a8a\u0155\3\2\2\2\u0a8b"= ) + buf.write("\u0a8c\7\u00ca\2\2\u0a8c\u0a97\5\u015c\u00af\2\u0a8d\u0= a8e") + buf.write("\7\"\2\2\u0a8e\u0a98\7\u00fa\2\2\u0a8f\u0a90\7$\2\2\u0a= 90") + buf.write("\u0a98\7\u00fa\2\2\u0a91\u0a92\7%\2\2\u0a92\u0a98\7\u00= fa") + buf.write("\2\2\u0a93\u0a94\7&\2\2\u0a94\u0a98\7\u00fa\2\2\u0a95") + buf.write("\u0a96\7\'\2\2\u0a96\u0a98\7\u00fa\2\2\u0a97\u0a8d\3\2"= ) + buf.write("\2\2\u0a97\u0a8f\3\2\2\2\u0a97\u0a91\3\2\2\2\u0a97\u0a9= 3") + buf.write("\3\2\2\2\u0a97\u0a95\3\2\2\2\u0a98\u0157\3\2\2\2\u0a99"= ) + buf.write("\u0a9a\7\u00cb\2\2\u0a9a\u0aa5\5\u015c\u00af\2\u0a9b\u0= a9c") + buf.write("\7\"\2\2\u0a9c\u0aa6\5\u015c\u00af\2\u0a9d\u0a9e\7$\2") + buf.write("\2\u0a9e\u0aa6\5\u015c\u00af\2\u0a9f\u0aa0\7%\2\2\u0aa0= ") + buf.write("\u0aa6\5\u015c\u00af\2\u0aa1\u0aa2\7&\2\2\u0aa2\u0aa6") + buf.write("\5\u015c\u00af\2\u0aa3\u0aa4\7\'\2\2\u0aa4\u0aa6\5\u015= c") + buf.write("\u00af\2\u0aa5\u0a9b\3\2\2\2\u0aa5\u0a9d\3\2\2\2\u0aa5"= ) + buf.write("\u0a9f\3\2\2\2\u0aa5\u0aa1\3\2\2\2\u0aa5\u0aa3\3\2\2\2"= ) + buf.write("\u0aa6\u0159\3\2\2\2\u0aa7\u0aa8\7\u00cc\2\2\u0aa8\u0aa= 9") + buf.write("\5\u015c\u00af\2\u0aa9\u0aab\7\"\2\2\u0aaa\u0aac\7\u00f= a") + buf.write("\2\2\u0aab\u0aaa\3\2\2\2\u0aac\u0aad\3\2\2\2\u0aad\u0aa= b") + buf.write("\3\2\2\2\u0aad\u0aae\3\2\2\2\u0aae\u015b\3\2\2\2\u0aaf"= ) + buf.write("\u0ab0\7\u00fb\2\2\u0ab0\u0ab1\7\32\2\2\u0ab1\u0ab2\7") + buf.write("\u00fa\2\2\u0ab2\u0abc\7\33\2\2\u0ab3\u0ab8\7\u00fb\2") + buf.write("\2\u0ab4\u0ab5\7\34\2\2\u0ab5\u0ab7\5\u015e\u00b0\2\u0a= b6") + buf.write("\u0ab4\3\2\2\2\u0ab7\u0aba\3\2\2\2\u0ab8\u0ab6\3\2\2\2"= ) + buf.write("\u0ab8\u0ab9\3\2\2\2\u0ab9\u0abc\3\2\2\2\u0aba\u0ab8\3"= ) + buf.write("\2\2\2\u0abb\u0aaf\3\2\2\2\u0abb\u0ab3\3\2\2\2\u0abc\u0= 15d") + buf.write("\3\2\2\2\u0abd\u0ac1\7\u00fb\2\2\u0abe\u0abf\7\32\2\2") + buf.write("\u0abf\u0ac0\7\u00fa\2\2\u0ac0\u0ac2\7\33\2\2\u0ac1\u0a= be") + buf.write("\3\2\2\2\u0ac1\u0ac2\3\2\2\2\u0ac2\u015f\3\2\2\2\u0ac3"= ) + buf.write("\u0ac4\7\u00cd\2\2\u0ac4\u0ac5\7\30\2\2\u0ac5\u0ac6\t") + buf.write("\13\2\2\u0ac6\u0ac7\7\31\2\2\u0ac7\u0161\3\2\2\2\u0ac8"= ) + buf.write("\u0ac9\7\u00ce\2\2\u0ac9\u0aca\7\30\2\2\u0aca\u0acb\7") + buf.write("\u00fb\2\2\u0acb\u0acc\7\31\2\2\u0acc\u0163\3\2\2\2\u0a= cd") + buf.write("\u0ace\7\u00cf\2\2\u0ace\u0ad4\7\30\2\2\u0acf\u0ad0\7") + buf.write("\u00ec\2\2\u0ad0\u0ad1\7\30\2\2\u0ad1\u0ad2\7\u00fa\2") + buf.write("\2\u0ad2\u0ad5\7\31\2\2\u0ad3\u0ad5\7\u00fa\2\2\u0ad4") + buf.write("\u0acf\3\2\2\2\u0ad4\u0ad3\3\2\2\2\u0ad5\u0ad6\3\2\2\2"= ) + buf.write("\u0ad6\u0ad7\7\31\2\2\u0ad7\u0165\3\2\2\2\u0ad8\u0ad9") + buf.write("\7\u00d0\2\2\u0ad9\u0167\3\2\2\2\u0ada\u0adb\7\u00d1\2"= ) + buf.write("\2\u0adb\u0adc\7\30\2\2\u0adc\u0add\5L\'\2\u0add\u0ade"= ) + buf.write("\7\31\2\2\u0ade\u0169\3\2\2\2\u0adf\u0ae0\t\f\2\2\u0ae0= ") + buf.write("\u016b\3\2\2\2\u0ae1\u0ae2\7\u00d2\2\2\u0ae2\u0ae3\7\30= ") + buf.write("\2\2\u0ae3\u0ae8\5X-\2\u0ae4\u0ae5\7(\2\2\u0ae5\u0ae6") + buf.write("\7@\2\2\u0ae6\u0ae7\7\b\2\2\u0ae7\u0ae9\5\u016a\u00b6") + buf.write("\2\u0ae8\u0ae4\3\2\2\2\u0ae8\u0ae9\3\2\2\2\u0ae9\u0aea"= ) + buf.write("\3\2\2\2\u0aea\u0aeb\7\31\2\2\u0aeb\u016d\3\2\2\2\u0aec= ") + buf.write("\u0aed\t\r\2\2\u0aed\u016f\3\2\2\2\u0aee\u0af9\5\u0172"= ) + buf.write("\u00ba\2\u0aef\u0af9\5\u0174\u00bb\2\u0af0\u0af9\5\u017= 6") + buf.write("\u00bc\2\u0af1\u0af9\5\u0178\u00bd\2\u0af2\u0af9\5\u017= a") + buf.write("\u00be\2\u0af3\u0af9\5\u017c\u00bf\2\u0af4\u0af9\5\u017= e") + buf.write("\u00c0\2\u0af5\u0af9\5\u0180\u00c1\2\u0af6\u0af9\5\u018= 2") + buf.write("\u00c2\2\u0af7\u0af9\5\u0184\u00c3\2\u0af8\u0aee\3\2\2"= ) + buf.write("\2\u0af8\u0aef\3\2\2\2\u0af8\u0af0\3\2\2\2\u0af8\u0af1"= ) + buf.write("\3\2\2\2\u0af8\u0af2\3\2\2\2\u0af8\u0af3\3\2\2\2\u0af8"= ) + buf.write("\u0af4\3\2\2\2\u0af8\u0af5\3\2\2\2\u0af8\u0af6\3\2\2\2"= ) + buf.write("\u0af8\u0af7\3\2\2\2\u0af9\u0171\3\2\2\2\u0afa\u0afb\7"= ) + buf.write("\u00da\2\2\u0afb\u0afc\7\30\2\2\u0afc\u0afd\5\u0126\u00= 94") + buf.write("\2\u0afd\u0afe\7\31\2\2\u0afe\u0173\3\2\2\2\u0aff\u0b00= ") + buf.write("\7\u00df\2\2\u0b00\u0b01\7\30\2\2\u0b01\u0b02\5\u0126") + buf.write("\u0094\2\u0b02\u0b03\7\31\2\2\u0b03\u0175\3\2\2\2\u0b04= ") + buf.write("\u0b05\7\u00e8\2\2\u0b05\u0b0d\7\30\2\2\u0b06\u0b07\7") + buf.write("*\2\2\u0b07\u0b08\7\b\2\2\u0b08\u0b09\7\u00ec\2\2\u0b09= ") + buf.write("\u0b0a\7\30\2\2\u0b0a\u0b0b\7\u00fa\2\2\u0b0b\u0b0c\7") + buf.write("\31\2\2\u0b0c\u0b0e\7!\2\2\u0b0d\u0b06\3\2\2\2\u0b0d\u0= b0e") + buf.write("\3\2\2\2\u0b0e\u0b14\3\2\2\2\u0b0f\u0b10\7[\2\2\u0b10") + buf.write("\u0b11\7\b\2\2\u0b11\u0b12\5L\'\2\u0b12\u0b13\7!\2\2\u0= b13") + buf.write("\u0b15\3\2\2\2\u0b14\u0b0f\3\2\2\2\u0b14\u0b15\3\2\2\2"= ) + buf.write("\u0b15\u0b16\3\2\2\2\u0b16\u0b17\5\u0126\u0094\2\u0b17"= ) + buf.write("\u0b18\7\31\2\2\u0b18\u0177\3\2\2\2\u0b19\u0b1a\7\u00e9= ") + buf.write("\2\2\u0b1a\u0b1b\7\30\2\2\u0b1b\u0b1c\5\u0126\u0094\2") + buf.write("\u0b1c\u0b1d\7\31\2\2\u0b1d\u0179\3\2\2\2\u0b1e\u0b1f") + buf.write("\7\u00e0\2\2\u0b1f\u0b20\7\30\2\2\u0b20\u0b21\5\u0126") + buf.write("\u0094\2\u0b21\u0b22\7\31\2\2\u0b22\u017b\3\2\2\2\u0b23= ") + buf.write("\u0b28\7\u00e1\2\2\u0b24\u0b25\7\21\2\2\u0b25\u0b26\7") + buf.write("\b\2\2\u0b26\u0b27\7\u00fa\2\2\u0b27\u0b29\7!\2\2\u0b28= ") + buf.write("\u0b24\3\2\2\2\u0b28\u0b29\3\2\2\2\u0b29\u0b2a\3\2\2\2"= ) + buf.write("\u0b2a\u0b2b\7\30\2\2\u0b2b\u0b2c\5\u0126\u0094\2\u0b2c= ") + buf.write("\u0b2d\7\31\2\2\u0b2d\u017d\3\2\2\2\u0b2e\u0b2f\7\u00e2= ") + buf.write("\2\2\u0b2f\u0b30\7\30\2\2\u0b30\u0b31\5\u0126\u0094\2") + buf.write("\u0b31\u0b32\7\31\2\2\u0b32\u017f\3\2\2\2\u0b33\u0b34") + buf.write("\7\u00e3\2\2\u0b34\u0b35\7\30\2\2\u0b35\u0b36\5\u0126") + buf.write("\u0094\2\u0b36\u0b37\7\31\2\2\u0b37\u0181\3\2\2\2\u0b38= ") + buf.write("\u0b39\7\u00e4\2\2\u0b39\u0b3a\7\30\2\2\u0b3a\u0b3b\5") + buf.write("\u0126\u0094\2\u0b3b\u0b3c\7\31\2\2\u0b3c\u0183\3\2\2") + buf.write("\2\u0b3d\u0b3e\7\u00de\2\2\u0b3e\u0b3f\7\30\2\2\u0b3f") + buf.write("\u0b44\5X-\2\u0b40\u0b41\7(\2\2\u0b41\u0b42\7@\2\2\u0b4= 2") + buf.write("\u0b43\7\b\2\2\u0b43\u0b45\5\u016a\u00b6\2\u0b44\u0b40"= ) + buf.write("\3\2\2\2\u0b44\u0b45\3\2\2\2\u0b45\u0b46\3\2\2\2\u0b46"= ) + buf.write("\u0b47\7!\2\2\u0b47\u0b48\5\u0126\u0094\2\u0b48\u0b49") + buf.write("\7\31\2\2\u0b49\u0185\3\2\2\2\u0b4a\u0b50\5\u0188\u00c5= ") + buf.write("\2\u0b4b\u0b50\5\u018a\u00c6\2\u0b4c\u0b50\5\u018e\u00c= 8") + buf.write("\2\u0b4d\u0b50\5\u0190\u00c9\2\u0b4e\u0b50\5\u0192\u00c= a") + buf.write("\2\u0b4f\u0b4a\3\2\2\2\u0b4f\u0b4b\3\2\2\2\u0b4f\u0b4c"= ) + buf.write("\3\2\2\2\u0b4f\u0b4d\3\2\2\2\u0b4f\u0b4e\3\2\2\2\u0b50"= ) + buf.write("\u0187\3\2\2\2\u0b51\u0b52\7\u00c2\2\2\u0b52\u0b53\7\30= ") + buf.write("\2\2\u0b53\u0b54\5\u0126\u0094\2\u0b54\u0b55\7\22\2\2") + buf.write("\u0b55\u0b56\5\u0126\u0094\2\u0b56\u0b57\7\36\2\2\u0b57= ") + buf.write("\u0b58\5\u0126\u0094\2\u0b58\u0b59\7\31\2\2\u0b59\u0189= ") + buf.write("\3\2\2\2\u0b5a\u0b5b\7\u00c3\2\2\u0b5b\u0b5c\7\30\2\2") + buf.write("\u0b5c\u0b61\5\u018c\u00c7\2\u0b5d\u0b5e\7(\2\2\u0b5e") + buf.write("\u0b60\5\u018c\u00c7\2\u0b5f\u0b5d\3\2\2\2\u0b60\u0b63"= ) + buf.write("\3\2\2\2\u0b61\u0b5f\3\2\2\2\u0b61\u0b62\3\2\2\2\u0b62"= ) + buf.write("\u0b64\3\2\2\2\u0b63\u0b61\3\2\2\2\u0b64\u0b65\7!\2\2") + buf.write("\u0b65\u0b66\5\u0126\u0094\2\u0b66\u0b67\7!\2\2\u0b67") + buf.write("\u0b68\5\u0126\u0094\2\u0b68\u0b69\7!\2\2\u0b69\u0b6a") + buf.write("\5\u0126\u0094\2\u0b6a\u0b6b\7\31\2\2\u0b6b\u018b\3\2") + buf.write("\2\2\u0b6c\u0b6d\t\16\2\2\u0b6d\u018d\3\2\2\2\u0b6e\u0b= 6f") + buf.write("\7\u00c4\2\2\u0b6f\u0b70\7\30\2\2\u0b70\u0b71\5\u0126") + buf.write("\u0094\2\u0b71\u0b72\7!\2\2\u0b72\u0b73\5\u0126\u0094") + buf.write("\2\u0b73\u0b74\7!\2\2\u0b74\u0b75\5\u0126\u0094\2\u0b75= ") + buf.write("\u0b76\7\31\2\2\u0b76\u018f\3\2\2\2\u0b77\u0b78\7\u00c5= ") + buf.write("\2\2\u0b78\u0b79\7\30\2\2\u0b79\u0b7a\5\u0126\u0094\2") + buf.write("\u0b7a\u0b7b\7!\2\2\u0b7b\u0b7c\5\u0126\u0094\2\u0b7c") + buf.write("\u0b7d\7!\2\2\u0b7d\u0b7e\5\u0126\u0094\2\u0b7e\u0b7f") + buf.write("\7\31\2\2\u0b7f\u0191\3\2\2\2\u0b80\u0b81\7\u00c6\2\2") + buf.write("\u0b81\u0b82\7\30\2\2\u0b82\u0b83\7@\2\2\u0b83\u0b84\7"= ) + buf.write("\b\2\2\u0b84\u0b89\5\u0194\u00cb\2\u0b85\u0b86\7(\2\2") + buf.write("\u0b86\u0b88\5\u0194\u00cb\2\u0b87\u0b85\3\2\2\2\u0b88"= ) + buf.write("\u0b8b\3\2\2\2\u0b89\u0b87\3\2\2\2\u0b89\u0b8a\3\2\2\2"= ) + buf.write("\u0b8a\u0b8c\3\2\2\2\u0b8b\u0b89\3\2\2\2\u0b8c\u0b8d\7"= ) + buf.write("!\2\2\u0b8d\u0b8e\5\u0126\u0094\2\u0b8e\u0b8f\7!\2\2\u0= b8f") + buf.write("\u0b90\5\u0126\u0094\2\u0b90\u0b91\7!\2\2\u0b91\u0b92") + buf.write("\5\u0126\u0094\2\u0b92\u0b93\7\31\2\2\u0b93\u0193\3\2") + buf.write("\2\2\u0b94\u0b95\t\17\2\2\u0b95\u0195\3\2\2\2\u0b96\u0b= 97") + buf.write("\7\u00ea\2\2\u0b97\u0b98\7\30\2\2\u0b98\u0b99\5\u0126") + buf.write("\u0094\2\u0b99\u0ba1\7\36\2\2\u0b9a\u0b9b\5\u0124\u0093= ") + buf.write("\2\u0b9b\u0b9c\7!\2\2\u0b9c\u0b9d\5\u0124\u0093\2\u0b9d= ") + buf.write("\u0b9e\7 \2\2\u0b9e\u0ba0\3\2\2\2\u0b9f\u0b9a\3\2\2\2") + buf.write("\u0ba0\u0ba3\3\2\2\2\u0ba1\u0b9f\3\2\2\2\u0ba1\u0ba2\3"= ) + buf.write("\2\2\2\u0ba2\u0ba4\3\2\2\2\u0ba3\u0ba1\3\2\2\2\u0ba4\u0= ba5") + buf.write("\7\31\2\2\u0ba5\u0197\3\2\2\2\u00f1\u019b\u019d\u01a1") + buf.write("\u01a8\u01ac\u01af\u01b7\u01bc\u01c0\u01c3\u01c9\u01ce"= ) + buf.write("\u01d2\u01d5\u01db\u01ed\u01ef\u01f7\u0200\u0209\u0212"= ) + buf.write("\u021b\u0224\u022d\u0236\u023f\u0248\u024e\u0256\u025e"= ) + buf.write("\u0266\u0284\u028b\u0292\u029b\u029f\u02a3\u02aa\u02b4"= ) + buf.write("\u02c1\u02d0\u02e5\u02eb\u0307\u030d\u0316\u0329\u0339"= ) + buf.write("\u0344\u0375\u0385\u038c\u0392\u03aa\u03b5\u03b8\u03bb"= ) + buf.write("\u03e2\u03e6\u03f3\u03fa\u040c\u0421\u0436\u043c\u0452"= ) + buf.write("\u045f\u0463\u0468\u046e\u0471\u0475\u0479\u0480\u049a"= ) + buf.write("\u04a4\u04ac\u04b0\u04b6\u04ba\u04e8\u04ec\u04f3\u04f9"= ) + buf.write("\u04fd\u0506\u050b\u0517\u0522\u052f\u0540\u0545\u054a"= ) + buf.write("\u055b\u0560\u0565\u056d\u058d\u0592\u0597\u05a1\u05ab"= ) + buf.write("\u05b7\u05bc\u05c1\u05cd\u05d2\u05d7\u05e1\u05e7\u0602"= ) + buf.write("\u0608\u0612\u0620\u062d\u0632\u0636\u0641\u0647\u0652"= ) + buf.write("\u065b\u0665\u0677\u067c\u0680\u068b\u0691\u069b\u06a2"= ) + buf.write("\u06aa\u06b1\u06bd\u06c8\u06cb\u06d6\u06db\u06e5\u06eb"= ) + buf.write("\u06fe\u0704\u070e\u0714\u0722\u072d\u0732\u073b\u0742"= ) + buf.write("\u074d\u0754\u075e\u07a9\u07ae\u07b1\u07c2\u07c8\u07cf"= ) + buf.write("\u07dc\u0827\u082c\u082f\u0840\u0846\u084d\u0856\u0867"= ) + buf.write("\u086d\u0875\u0883\u0888\u0895\u089a\u08a7\u08ac\u08b3"= ) + buf.write("\u08c1\u08c6\u08cd\u08e2\u08e7\u08f0\u0911\u0931\u0934"= ) + buf.write("\u093a\u0944\u0957\u0964\u096a\u0970\u0976\u097c\u0982"= ) + buf.write("\u0988\u098e\u0994\u099a\u099c\u09a1\u09a4\u09aa\u09ae"= ) + buf.write("\u09b7\u09bd\u09cd\u09d5\u09dd\u09e5\u09ed\u09f4\u09fb"= ) + buf.write("\u0a01\u0a0c\u0a12\u0a19\u0a1f\u0a26\u0a2c\u0a35\u0a3a"= ) + buf.write("\u0a4e\u0a76\u0a89\u0a97\u0aa5\u0aad\u0ab8\u0abb\u0ac1"= ) + buf.write("\u0ad4\u0ae8\u0af8\u0b0d\u0b14\u0b28\u0b44\u0b4f\u0b61"= ) + buf.write("\u0b89\u0ba1") return buf.getvalue() =20 =20 @@ -1871,47 +1874,48 @@ class VfrSyntaxParser ( Parser ): RULE_multdivmodTerm =3D 158 RULE_multdivmodTermSupplementary =3D 159 RULE_castTerm =3D 160 - RULE_atomTerm =3D 161 - RULE_vfrExpressionCatenate =3D 162 - RULE_vfrExpressionMatch =3D 163 - RULE_vfrExpressionMatch2 =3D 164 - RULE_vfrExpressionParen =3D 165 - RULE_vfrExpressionBuildInFunction =3D 166 - RULE_dupExp =3D 167 - RULE_vareqvalExp =3D 168 - RULE_ideqvalExp =3D 169 - RULE_ideqidExp =3D 170 - RULE_ideqvallistExp =3D 171 - RULE_vfrQuestionDataFieldName =3D 172 - RULE_arrayName =3D 173 - RULE_questionref1Exp =3D 174 - RULE_rulerefExp =3D 175 - RULE_stringref1Exp =3D 176 - RULE_pushthisExp =3D 177 - RULE_securityExp =3D 178 - RULE_numericVarStoreType =3D 179 - RULE_getExp =3D 180 - RULE_vfrExpressionConstant =3D 181 - RULE_vfrExpressionUnaryOp =3D 182 - RULE_lengthExp =3D 183 - RULE_bitwisenotExp =3D 184 - RULE_question23refExp =3D 185 - RULE_stringref2Exp =3D 186 - RULE_toboolExp =3D 187 - RULE_tostringExp =3D 188 - RULE_unintExp =3D 189 - RULE_toupperExp =3D 190 - RULE_tolwerExp =3D 191 - RULE_setExp =3D 192 - RULE_vfrExpressionTernaryOp =3D 193 - RULE_conditionalExp =3D 194 - RULE_findExp =3D 195 - RULE_findFormat =3D 196 - RULE_midExp =3D 197 - RULE_tokenExp =3D 198 - RULE_spanExp =3D 199 - RULE_spanFlags =3D 200 - RULE_vfrExpressionMap =3D 201 + RULE_castTermSub =3D 161 + RULE_atomTerm =3D 162 + RULE_vfrExpressionCatenate =3D 163 + RULE_vfrExpressionMatch =3D 164 + RULE_vfrExpressionMatch2 =3D 165 + RULE_vfrExpressionParen =3D 166 + RULE_vfrExpressionBuildInFunction =3D 167 + RULE_dupExp =3D 168 + RULE_vareqvalExp =3D 169 + RULE_ideqvalExp =3D 170 + RULE_ideqidExp =3D 171 + RULE_ideqvallistExp =3D 172 + RULE_vfrQuestionDataFieldName =3D 173 + RULE_arrayName =3D 174 + RULE_questionref1Exp =3D 175 + RULE_rulerefExp =3D 176 + RULE_stringref1Exp =3D 177 + RULE_pushthisExp =3D 178 + RULE_securityExp =3D 179 + RULE_numericVarStoreType =3D 180 + RULE_getExp =3D 181 + RULE_vfrExpressionConstant =3D 182 + RULE_vfrExpressionUnaryOp =3D 183 + RULE_lengthExp =3D 184 + RULE_bitwisenotExp =3D 185 + RULE_question23refExp =3D 186 + RULE_stringref2Exp =3D 187 + RULE_toboolExp =3D 188 + RULE_tostringExp =3D 189 + RULE_unintExp =3D 190 + RULE_toupperExp =3D 191 + RULE_tolwerExp =3D 192 + RULE_setExp =3D 193 + RULE_vfrExpressionTernaryOp =3D 194 + RULE_conditionalExp =3D 195 + RULE_findExp =3D 196 + RULE_findFormat =3D 197 + RULE_midExp =3D 198 + RULE_tokenExp =3D 199 + RULE_spanExp =3D 200 + RULE_spanFlags =3D 201 + RULE_vfrExpressionMap =3D 202 =20 ruleNames =3D [ "vfrProgram", "pragmaPackShowDef", "pragmaPackStackDe= f", "pragmaPackNumber", "vfrPragmaPackDefinition", "vfrData= StructDefinition", @@ -1972,7 +1976,7 @@ class VfrSyntaxParser ( Parser ): "compareTerm", "compareTermSupplementary", "shiftTerm", "shiftTermSupplementary", "addMinusTerm", "addMinusTerm= Supplementary", "multdivmodTerm", "multdivmodTermSupplementary", "castT= erm", - "atomTerm", "vfrExpressionCatenate", "vfrExpressionMatc= h", + "castTermSub", "atomTerm", "vfrExpressionCatenate", "vf= rExpressionMatch", "vfrExpressionMatch2", "vfrExpressionParen", "vfrExpres= sionBuildInFunction", "dupExp", "vareqvalExp", "ideqvalExp", "ideqidExp", "id= eqvallistExp", "vfrQuestionDataFieldName", "arrayName", "questionref1E= xp", @@ -2257,10 +2261,6 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser =20 - def vfrFormSetDefinition(self): - return self.getTypedRuleContext(VfrSyntaxParser.VfrFormSetDefi= nitionContext,0) - - def vfrPragmaPackDefinition(self, i:int=3DNone): if i is None: return self.getTypedRuleContexts(VfrSyntaxParser.VfrPragma= PackDefinitionContext) @@ -2282,6 +2282,10 @@ class VfrSyntaxParser ( Parser ): return self.getTypedRuleContext(VfrSyntaxParser.VfrDataUni= onDefinitionContext,i) =20 =20 + def vfrFormSetDefinition(self): + return self.getTypedRuleContext(VfrSyntaxParser.VfrFormSetDefi= nitionContext,0) + + def getRuleIndex(self): return VfrSyntaxParser.RULE_vfrProgram =20 @@ -2301,35 +2305,41 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 409 + self.state =3D 411 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.T__3 or ((((_la - 78)) & ~0x3f)= =3D=3D 0 and ((1 << (_la - 78)) & ((1 << (VfrSyntaxParser.Struct - 78)) | = (1 << (VfrSyntaxParser.Union - 78)) | (1 << (VfrSyntaxParser.TypeDef - 78))= )) !=3D 0): - self.state =3D 407 + self.state =3D 409 self._errHandler.sync(self) la_ =3D self._interp.adaptivePredict(self._input,0,self._c= tx) if la_ =3D=3D 1: - self.state =3D 404 + self.state =3D 406 self.vfrPragmaPackDefinition() pass =20 elif la_ =3D=3D 2: - self.state =3D 405 + self.state =3D 407 self.vfrDataStructDefinition() pass =20 elif la_ =3D=3D 3: - self.state =3D 406 + self.state =3D 408 self.vfrDataUnionDefinition() pass =20 =20 - self.state =3D 411 + self.state =3D 413 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 412 - self.vfrFormSetDefinition() + self.state =3D 415 + self._errHandler.sync(self) + _la =3D self._input.LA(1) + if _la=3D=3DVfrSyntaxParser.FormSet: + self.state =3D 414 + self.vfrFormSetDefinition() + + except RecognitionException as re: localctx.exception =3D re self._errHandler.reportError(self, re) @@ -2364,7 +2374,7 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 2, self.RULE_pragmaPackShowDef) try: self.enterOuterAlt(localctx, 1) - self.state =3D 414 + self.state =3D 417 self.match(VfrSyntaxParser.T__0) except RecognitionException as re: localctx.exception =3D re @@ -2412,30 +2422,30 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 416 + self.state =3D 419 _la =3D self._input.LA(1) if not(_la=3D=3DVfrSyntaxParser.T__1 or _la=3D=3DVfrSyntaxPars= er.T__2): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state =3D 419 + self.state =3D 422 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,2,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,3,self._ctx) if la_ =3D=3D 1: - self.state =3D 417 + self.state =3D 420 self.match(VfrSyntaxParser.Comma) - self.state =3D 418 + self.state =3D 421 self.match(VfrSyntaxParser.StringIdentifier) =20 =20 - self.state =3D 423 + self.state =3D 426 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 421 + self.state =3D 424 self.match(VfrSyntaxParser.Comma) - self.state =3D 422 + self.state =3D 425 self.match(VfrSyntaxParser.Number) =20 =20 @@ -2476,11 +2486,11 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 426 + self.state =3D 429 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Number: - self.state =3D 425 + self.state =3D 428 self.match(VfrSyntaxParser.Number) =20 =20 @@ -2535,29 +2545,29 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 8, self.RULE_vfrPragmaPackDefinition) try: self.enterOuterAlt(localctx, 1) - self.state =3D 428 + self.state =3D 431 self.match(VfrSyntaxParser.T__3) - self.state =3D 429 + self.state =3D 432 self.match(VfrSyntaxParser.T__4) - self.state =3D 430 + self.state =3D 433 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 434 + self.state =3D 437 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,5,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,6,self._ctx) if la_ =3D=3D 1: - self.state =3D 431 + self.state =3D 434 self.pragmaPackShowDef() =20 elif la_ =3D=3D 2: - self.state =3D 432 + self.state =3D 435 self.pragmaPackStackDef() =20 elif la_ =3D=3D 3: - self.state =3D 433 + self.state =3D 436 self.pragmaPackNumber() =20 =20 - self.state =3D 436 + self.state =3D 439 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -2623,47 +2633,47 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 439 + self.state =3D 442 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.TypeDef: - self.state =3D 438 + self.state =3D 441 self.match(VfrSyntaxParser.TypeDef) =20 =20 - self.state =3D 441 + self.state =3D 444 self.match(VfrSyntaxParser.Struct) - self.state =3D 443 + self.state =3D 446 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.NonNvDataMap: - self.state =3D 442 + self.state =3D 445 self.match(VfrSyntaxParser.NonNvDataMap) =20 =20 - self.state =3D 446 + self.state =3D 449 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.StringIdentifier: - self.state =3D 445 + self.state =3D 448 localctx.N1 =3D self.match(VfrSyntaxParser.StringIdentifie= r) =20 =20 - self.state =3D 448 + self.state =3D 451 self.match(VfrSyntaxParser.OpenBrace) - self.state =3D 449 + self.state =3D 452 self.vfrDataStructFields(False) - self.state =3D 450 + self.state =3D 453 self.match(VfrSyntaxParser.CloseBrace) - self.state =3D 452 + self.state =3D 455 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.StringIdentifier: - self.state =3D 451 + self.state =3D 454 localctx.N2 =3D self.match(VfrSyntaxParser.StringIdentifie= r) =20 =20 - self.state =3D 454 + self.state =3D 457 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -2729,47 +2739,47 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 457 + self.state =3D 460 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.TypeDef: - self.state =3D 456 + self.state =3D 459 self.match(VfrSyntaxParser.TypeDef) =20 =20 - self.state =3D 459 + self.state =3D 462 self.match(VfrSyntaxParser.Union) - self.state =3D 461 + self.state =3D 464 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.NonNvDataMap: - self.state =3D 460 + self.state =3D 463 self.match(VfrSyntaxParser.NonNvDataMap) =20 =20 - self.state =3D 464 + self.state =3D 467 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.StringIdentifier: - self.state =3D 463 + self.state =3D 466 localctx.N1 =3D self.match(VfrSyntaxParser.StringIdentifie= r) =20 =20 - self.state =3D 466 + self.state =3D 469 self.match(VfrSyntaxParser.OpenBrace) - self.state =3D 467 + self.state =3D 470 self.vfrDataStructFields(True) - self.state =3D 468 + self.state =3D 471 self.match(VfrSyntaxParser.CloseBrace) - self.state =3D 470 + self.state =3D 473 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.StringIdentifier: - self.state =3D 469 + self.state =3D 472 localctx.N2 =3D self.match(VfrSyntaxParser.StringIdentifie= r) =20 =20 - self.state =3D 472 + self.state =3D 475 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -2905,85 +2915,85 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 490 + self.state =3D 493 self._errHandler.sync(self) _la =3D self._input.LA(1) while ((((_la - 80)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 80)) = & ((1 << (VfrSyntaxParser.Boolean - 80)) | (1 << (VfrSyntaxParser.Uint64 - = 80)) | (1 << (VfrSyntaxParser.Uint32 - 80)) | (1 << (VfrSyntaxParser.Uint16= - 80)) | (1 << (VfrSyntaxParser.Uint8 - 80)) | (1 << (VfrSyntaxParser.EFI_= STRING_ID - 80)) | (1 << (VfrSyntaxParser.EFI_HII_DATE - 80)) | (1 << (VfrS= yntaxParser.EFI_HII_TIME - 80)) | (1 << (VfrSyntaxParser.EFI_HII_REF - 80))= )) !=3D 0) or _la=3D=3DVfrSyntaxParser.StringIdentifier: - self.state =3D 488 + self.state =3D 491 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,14,self._= ctx) + la_ =3D self._interp.adaptivePredict(self._input,15,self._= ctx) if la_ =3D=3D 1: - self.state =3D 474 + self.state =3D 477 self.dataStructField64(FieldInUnion) pass =20 elif la_ =3D=3D 2: - self.state =3D 475 + self.state =3D 478 self.dataStructField32(FieldInUnion) pass =20 elif la_ =3D=3D 3: - self.state =3D 476 + self.state =3D 479 self.dataStructField16(FieldInUnion) pass =20 elif la_ =3D=3D 4: - self.state =3D 477 + self.state =3D 480 self.dataStructField8(FieldInUnion) pass =20 elif la_ =3D=3D 5: - self.state =3D 478 + self.state =3D 481 self.dataStructFieldBool(FieldInUnion) pass =20 elif la_ =3D=3D 6: - self.state =3D 479 + self.state =3D 482 self.dataStructFieldString(FieldInUnion) pass =20 elif la_ =3D=3D 7: - self.state =3D 480 + self.state =3D 483 self.dataStructFieldDate(FieldInUnion) pass =20 elif la_ =3D=3D 8: - self.state =3D 481 + self.state =3D 484 self.dataStructFieldTime(FieldInUnion) pass =20 elif la_ =3D=3D 9: - self.state =3D 482 + self.state =3D 485 self.dataStructFieldRef(FieldInUnion) pass =20 elif la_ =3D=3D 10: - self.state =3D 483 + self.state =3D 486 self.dataStructFieldUser(FieldInUnion) pass =20 elif la_ =3D=3D 11: - self.state =3D 484 + self.state =3D 487 self.dataStructBitField64(FieldInUnion) pass =20 elif la_ =3D=3D 12: - self.state =3D 485 + self.state =3D 488 self.dataStructBitField32(FieldInUnion) pass =20 elif la_ =3D=3D 13: - self.state =3D 486 + self.state =3D 489 self.dataStructBitField16(FieldInUnion) pass =20 elif la_ =3D=3D 14: - self.state =3D 487 + self.state =3D 490 self.dataStructBitField8(FieldInUnion) pass =20 =20 - self.state =3D 492 + self.state =3D 495 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -3042,23 +3052,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 493 + self.state =3D 496 self.match(VfrSyntaxParser.Uint64) - self.state =3D 494 + self.state =3D 497 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 498 + self.state =3D 501 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 495 + self.state =3D 498 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 496 + self.state =3D 499 self.match(VfrSyntaxParser.Number) - self.state =3D 497 + self.state =3D 500 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 500 + self.state =3D 503 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3115,23 +3125,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 502 + self.state =3D 505 self.match(VfrSyntaxParser.Uint32) - self.state =3D 503 + self.state =3D 506 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 507 + self.state =3D 510 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 504 + self.state =3D 507 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 505 + self.state =3D 508 self.match(VfrSyntaxParser.Number) - self.state =3D 506 + self.state =3D 509 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 509 + self.state =3D 512 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3188,23 +3198,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 511 + self.state =3D 514 self.match(VfrSyntaxParser.Uint16) - self.state =3D 512 + self.state =3D 515 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 516 + self.state =3D 519 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 513 + self.state =3D 516 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 514 + self.state =3D 517 self.match(VfrSyntaxParser.Number) - self.state =3D 515 + self.state =3D 518 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 518 + self.state =3D 521 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3261,23 +3271,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 520 + self.state =3D 523 self.match(VfrSyntaxParser.Uint8) - self.state =3D 521 + self.state =3D 524 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 525 + self.state =3D 528 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 522 + self.state =3D 525 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 523 + self.state =3D 526 self.match(VfrSyntaxParser.Number) - self.state =3D 524 + self.state =3D 527 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 527 + self.state =3D 530 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3334,23 +3344,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 529 + self.state =3D 532 self.match(VfrSyntaxParser.Boolean) - self.state =3D 530 + self.state =3D 533 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 534 + self.state =3D 537 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 531 + self.state =3D 534 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 532 + self.state =3D 535 self.match(VfrSyntaxParser.Number) - self.state =3D 533 + self.state =3D 536 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 536 + self.state =3D 539 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3407,23 +3417,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 538 + self.state =3D 541 self.match(VfrSyntaxParser.EFI_STRING_ID) - self.state =3D 539 + self.state =3D 542 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 543 + self.state =3D 546 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 540 + self.state =3D 543 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 541 + self.state =3D 544 self.match(VfrSyntaxParser.Number) - self.state =3D 542 + self.state =3D 545 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 545 + self.state =3D 548 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3480,23 +3490,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 547 + self.state =3D 550 self.match(VfrSyntaxParser.EFI_HII_DATE) - self.state =3D 548 + self.state =3D 551 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 552 + self.state =3D 555 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 549 + self.state =3D 552 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 550 + self.state =3D 553 self.match(VfrSyntaxParser.Number) - self.state =3D 551 + self.state =3D 554 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 554 + self.state =3D 557 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3553,23 +3563,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 556 + self.state =3D 559 self.match(VfrSyntaxParser.EFI_HII_TIME) - self.state =3D 557 + self.state =3D 560 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 561 + self.state =3D 564 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 558 + self.state =3D 561 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 559 + self.state =3D 562 self.match(VfrSyntaxParser.Number) - self.state =3D 560 + self.state =3D 563 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 563 + self.state =3D 566 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3626,23 +3636,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 565 + self.state =3D 568 self.match(VfrSyntaxParser.EFI_HII_REF) - self.state =3D 566 + self.state =3D 569 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 570 + self.state =3D 573 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 567 + self.state =3D 570 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 568 + self.state =3D 571 self.match(VfrSyntaxParser.Number) - self.state =3D 569 + self.state =3D 572 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 572 + self.state =3D 575 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3700,23 +3710,23 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 574 + self.state =3D 577 localctx.T =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 575 + self.state =3D 578 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 579 + self.state =3D 582 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 576 + self.state =3D 579 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 577 + self.state =3D 580 self.match(VfrSyntaxParser.Number) - self.state =3D 578 + self.state =3D 581 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 581 + self.state =3D 584 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3771,21 +3781,21 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 583 + self.state =3D 586 localctx.D =3D self.match(VfrSyntaxParser.Uint64) - self.state =3D 585 + self.state =3D 588 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.StringIdentifier: - self.state =3D 584 + self.state =3D 587 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier= ) =20 =20 - self.state =3D 587 + self.state =3D 590 self.match(VfrSyntaxParser.Colon) - self.state =3D 588 + self.state =3D 591 self.match(VfrSyntaxParser.Number) - self.state =3D 589 + self.state =3D 592 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3840,21 +3850,21 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 591 + self.state =3D 594 localctx.D =3D self.match(VfrSyntaxParser.Uint32) - self.state =3D 593 + self.state =3D 596 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.StringIdentifier: - self.state =3D 592 + self.state =3D 595 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier= ) =20 =20 - self.state =3D 595 + self.state =3D 598 self.match(VfrSyntaxParser.Colon) - self.state =3D 596 + self.state =3D 599 self.match(VfrSyntaxParser.Number) - self.state =3D 597 + self.state =3D 600 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3909,21 +3919,21 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 599 + self.state =3D 602 localctx.D =3D self.match(VfrSyntaxParser.Uint16) - self.state =3D 601 + self.state =3D 604 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.StringIdentifier: - self.state =3D 600 + self.state =3D 603 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier= ) =20 =20 - self.state =3D 603 + self.state =3D 606 self.match(VfrSyntaxParser.Colon) - self.state =3D 604 + self.state =3D 607 self.match(VfrSyntaxParser.Number) - self.state =3D 605 + self.state =3D 608 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -3978,21 +3988,21 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 607 + self.state =3D 610 localctx.D =3D self.match(VfrSyntaxParser.Uint8) - self.state =3D 609 + self.state =3D 612 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.StringIdentifier: - self.state =3D 608 + self.state =3D 611 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier= ) =20 =20 - self.state =3D 611 + self.state =3D 614 self.match(VfrSyntaxParser.Colon) - self.state =3D 612 + self.state =3D 615 self.match(VfrSyntaxParser.Number) - self.state =3D 613 + self.state =3D 616 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -4008,7 +4018,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_FORM_SET_OP) + self.Node =3D IfrTreeNode(EFI_IFR_FORM_SET_OP) =20 def FormSet(self): return self.getToken(VfrSyntaxParser.FormSet, 0) @@ -4106,91 +4116,91 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 615 + self.state =3D 618 self.match(VfrSyntaxParser.FormSet) - self.state =3D 616 + self.state =3D 619 self.match(VfrSyntaxParser.Uuid) - self.state =3D 617 + self.state =3D 620 self.match(VfrSyntaxParser.T__5) - self.state =3D 618 + self.state =3D 621 self.guidDefinition() - self.state =3D 619 + self.state =3D 622 self.match(VfrSyntaxParser.Comma) - self.state =3D 620 + self.state =3D 623 self.match(VfrSyntaxParser.Title) - self.state =3D 621 + self.state =3D 624 self.match(VfrSyntaxParser.T__5) - self.state =3D 622 + self.state =3D 625 self.match(VfrSyntaxParser.StringToken) - self.state =3D 623 + self.state =3D 626 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 624 + self.state =3D 627 self.match(VfrSyntaxParser.Number) - self.state =3D 625 + self.state =3D 628 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 626 + self.state =3D 629 self.match(VfrSyntaxParser.Comma) - self.state =3D 627 + self.state =3D 630 self.match(VfrSyntaxParser.Help) - self.state =3D 628 + self.state =3D 631 self.match(VfrSyntaxParser.T__5) - self.state =3D 629 + self.state =3D 632 self.match(VfrSyntaxParser.StringToken) - self.state =3D 630 + self.state =3D 633 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 631 + self.state =3D 634 self.match(VfrSyntaxParser.Number) - self.state =3D 632 + self.state =3D 635 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 633 + self.state =3D 636 self.match(VfrSyntaxParser.Comma) - self.state =3D 639 + self.state =3D 642 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.ClassGuid: - self.state =3D 634 + self.state =3D 637 self.match(VfrSyntaxParser.ClassGuid) - self.state =3D 635 + self.state =3D 638 self.match(VfrSyntaxParser.T__5) - self.state =3D 636 + self.state =3D 639 self.classguidDefinition(localctx.Node) - self.state =3D 637 + self.state =3D 640 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 646 + self.state =3D 649 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Class: - self.state =3D 641 + self.state =3D 644 self.match(VfrSyntaxParser.Class) - self.state =3D 642 + self.state =3D 645 self.match(VfrSyntaxParser.T__5) - self.state =3D 643 + self.state =3D 646 self.classDefinition() - self.state =3D 644 + self.state =3D 647 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 653 + self.state =3D 656 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Subclass: - self.state =3D 648 + self.state =3D 651 self.match(VfrSyntaxParser.Subclass) - self.state =3D 649 + self.state =3D 652 self.match(VfrSyntaxParser.T__5) - self.state =3D 650 + self.state =3D 653 self.subclassDefinition() - self.state =3D 651 + self.state =3D 654 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 655 + self.state =3D 658 self.vfrFormSetList(localctx.Node) - self.state =3D 656 + self.state =3D 659 self.match(VfrSyntaxParser.EndFormSet) - self.state =3D 657 + self.state =3D 660 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -4242,35 +4252,35 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 659 - self.guidDefinition() self.state =3D 662 + self.guidDefinition() + self.state =3D 665 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,33,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,34,self._ctx) if la_ =3D=3D 1: - self.state =3D 660 + self.state =3D 663 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 661 + self.state =3D 664 self.guidDefinition() =20 =20 - self.state =3D 666 + self.state =3D 669 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,34,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,35,self._ctx) if la_ =3D=3D 1: - self.state =3D 664 + self.state =3D 667 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 665 + self.state =3D 668 self.guidDefinition() =20 =20 - self.state =3D 670 + self.state =3D 673 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 668 + self.state =3D 671 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 669 + self.state =3D 672 self.guidDefinition() =20 =20 @@ -4288,7 +4298,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_GUID_OP) + self.Node =3D IfrTreeNode(EFI_IFR_GUID_OP) =20 def validClassNames(self, i:int=3DNone): if i is None: @@ -4322,17 +4332,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 672 + self.state =3D 675 self.validClassNames() - self.state =3D 677 + self.state =3D 680 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 673 + self.state =3D 676 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 674 + self.state =3D 677 self.validClassNames() - self.state =3D 679 + self.state =3D 682 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -4395,7 +4405,7 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 680 + self.state =3D 683 _la =3D self._input.LA(1) if not(((((_la - 170)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 170= )) & ((1 << (VfrSyntaxParser.ClassNonDevice - 170)) | (1 << (VfrSyntaxParse= r.ClassDiskDevice - 170)) | (1 << (VfrSyntaxParser.ClassVideoDevice - 170))= | (1 << (VfrSyntaxParser.ClassNetworkDevice - 170)) | (1 << (VfrSyntaxPars= er.ClassInputDevice - 170)) | (1 << (VfrSyntaxParser.ClassOnBoardDevice - 1= 70)) | (1 << (VfrSyntaxParser.ClassOtherDevice - 170)))) !=3D 0) or _la=3D= =3DVfrSyntaxParser.Number): self._errHandler.recoverInline(self) @@ -4416,7 +4426,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_GUID_OP) + self.Node =3D IfrTreeNode(EFI_IFR_GUID_OP) =20 def SubclassSetupApplication(self): return self.getToken(VfrSyntaxParser.SubclassSetupApplication,= 0) @@ -4452,7 +4462,7 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 682 + self.state =3D 685 _la =3D self._input.LA(1) if not(((((_la - 177)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 177= )) & ((1 << (VfrSyntaxParser.SubclassSetupApplication - 177)) | (1 << (VfrS= yntaxParser.SubclassGeneralApplication - 177)) | (1 << (VfrSyntaxParser.Sub= classFrontPage - 177)) | (1 << (VfrSyntaxParser.SubclassSingleUse - 177))))= !=3D 0) or _la=3D=3DVfrSyntaxParser.Number): self._errHandler.recoverInline(self) @@ -4502,13 +4512,13 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 687 + self.state =3D 690 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.Form or _la=3D=3DVfrSyntaxParse= r.FormMap or ((((_la - 105)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 105)) & ((= 1 << (VfrSyntaxParser.SuppressIf - 105)) | (1 << (VfrSyntaxParser.DisableIf= - 105)) | (1 << (VfrSyntaxParser.Image - 105)) | (1 << (VfrSyntaxParser.De= faultStore - 105)) | (1 << (VfrSyntaxParser.Varstore - 105)) | (1 << (VfrSy= ntaxParser.Efivarstore - 105)) | (1 << (VfrSyntaxParser.NameValueVarStore -= 105)) | (1 << (VfrSyntaxParser.GuidOp - 105)))) !=3D 0): - self.state =3D 684 + self.state =3D 687 self.vfrFormSet() - self.state =3D 689 + self.state =3D 692 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -4586,47 +4596,47 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 56, self.RULE_vfrFormSet) try: self.enterOuterAlt(localctx, 1) - self.state =3D 700 + self.state =3D 703 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Form]: - self.state =3D 690 + self.state =3D 693 self.vfrFormDefinition() pass elif token in [VfrSyntaxParser.FormMap]: - self.state =3D 691 + self.state =3D 694 self.vfrFormMapDefinition() pass elif token in [VfrSyntaxParser.Image]: - self.state =3D 692 + self.state =3D 695 self.vfrStatementImage() pass elif token in [VfrSyntaxParser.Varstore]: - self.state =3D 693 + self.state =3D 696 self.vfrStatementVarStoreLinear() pass elif token in [VfrSyntaxParser.Efivarstore]: - self.state =3D 694 + self.state =3D 697 self.vfrStatementVarStoreEfi() pass elif token in [VfrSyntaxParser.NameValueVarStore]: - self.state =3D 695 + self.state =3D 698 self.vfrStatementVarStoreNameValue() pass elif token in [VfrSyntaxParser.DefaultStore]: - self.state =3D 696 + self.state =3D 699 self.vfrStatementDefaultStore() pass elif token in [VfrSyntaxParser.DisableIf]: - self.state =3D 697 + self.state =3D 700 self.vfrStatementDisableIfFormSet() pass elif token in [VfrSyntaxParser.SuppressIf]: - self.state =3D 698 + self.state =3D 701 self.vfrStatementSuppressIfFormSet() pass elif token in [VfrSyntaxParser.GuidOp]: - self.state =3D 699 + self.state =3D 702 self.vfrStatementExtension() pass else: @@ -4646,7 +4656,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_DEFAULTSTORE_OP) + self.Node =3D IfrTreeNode(EFI_IFR_DEFAULTSTORE_OP) self.N =3D None # Token self.S =3D None # Token self.A =3D None # Token @@ -4706,39 +4716,39 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 702 + self.state =3D 705 self.match(VfrSyntaxParser.DefaultStore) - self.state =3D 703 + self.state =3D 706 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 704 + self.state =3D 707 self.match(VfrSyntaxParser.Comma) - self.state =3D 705 + self.state =3D 708 self.match(VfrSyntaxParser.Prompt) - self.state =3D 706 + self.state =3D 709 self.match(VfrSyntaxParser.T__5) - self.state =3D 707 + self.state =3D 710 self.match(VfrSyntaxParser.StringToken) - self.state =3D 708 + self.state =3D 711 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 709 + self.state =3D 712 localctx.S =3D self.match(VfrSyntaxParser.Number) - self.state =3D 710 + self.state =3D 713 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 715 + self.state =3D 718 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 711 + self.state =3D 714 self.match(VfrSyntaxParser.Comma) - self.state =3D 712 + self.state =3D 715 self.match(VfrSyntaxParser.Attribute) - self.state =3D 713 + self.state =3D 716 self.match(VfrSyntaxParser.T__5) - self.state =3D 714 + self.state =3D 717 localctx.A =3D self.match(VfrSyntaxParser.Number) =20 =20 - self.state =3D 717 + self.state =3D 720 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -4754,7 +4764,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_VARSTORE_OP) + self.Node =3D IfrTreeNode(EFI_IFR_VARSTORE_OP) self.TN =3D None # Token self.ID =3D None # Token self.SN =3D None # Token @@ -4833,91 +4843,91 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 719 + self.state =3D 722 self.match(VfrSyntaxParser.Varstore) - self.state =3D 736 + self.state =3D 739 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.StringIdentifier]: - self.state =3D 720 + self.state =3D 723 localctx.TN =3D self.match(VfrSyntaxParser.StringIdentifie= r) - self.state =3D 721 + self.state =3D 724 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Uint8]: - self.state =3D 722 + self.state =3D 725 self.match(VfrSyntaxParser.Uint8) - self.state =3D 723 + self.state =3D 726 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Uint16]: - self.state =3D 724 + self.state =3D 727 self.match(VfrSyntaxParser.Uint16) - self.state =3D 725 + self.state =3D 728 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Uint32]: - self.state =3D 726 + self.state =3D 729 self.match(VfrSyntaxParser.Uint32) - self.state =3D 727 + self.state =3D 730 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Uint64]: - self.state =3D 728 + self.state =3D 731 self.match(VfrSyntaxParser.Uint64) - self.state =3D 729 + self.state =3D 732 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.EFI_HII_DATE]: - self.state =3D 730 + self.state =3D 733 self.match(VfrSyntaxParser.EFI_HII_DATE) - self.state =3D 731 + self.state =3D 734 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.EFI_HII_TIME]: - self.state =3D 732 + self.state =3D 735 self.match(VfrSyntaxParser.EFI_HII_TIME) - self.state =3D 733 + self.state =3D 736 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.EFI_HII_REF]: - self.state =3D 734 + self.state =3D 737 self.match(VfrSyntaxParser.EFI_HII_REF) - self.state =3D 735 + self.state =3D 738 self.match(VfrSyntaxParser.Comma) pass else: raise NoViableAltException(self) =20 - self.state =3D 742 + self.state =3D 745 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.VarId: - self.state =3D 738 + self.state =3D 741 self.match(VfrSyntaxParser.VarId) - self.state =3D 739 + self.state =3D 742 self.match(VfrSyntaxParser.T__5) - self.state =3D 740 + self.state =3D 743 localctx.ID =3D self.match(VfrSyntaxParser.Number) - self.state =3D 741 + self.state =3D 744 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 744 + self.state =3D 747 self.match(VfrSyntaxParser.Name) - self.state =3D 745 + self.state =3D 748 self.match(VfrSyntaxParser.T__5) - self.state =3D 746 + self.state =3D 749 localctx.SN =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 747 + self.state =3D 750 self.match(VfrSyntaxParser.Comma) - self.state =3D 748 + self.state =3D 751 self.match(VfrSyntaxParser.Uuid) - self.state =3D 749 + self.state =3D 752 self.match(VfrSyntaxParser.T__5) - self.state =3D 750 + self.state =3D 753 self.guidDefinition() - self.state =3D 751 + self.state =3D 754 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -4933,7 +4943,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_VARSTORE_EFI_OP) + self.Node =3D IfrTreeNode(EFI_IFR_VARSTORE_EFI_OP) self.TN =3D None # Token self.ID =3D None # Token self.SN =3D None # Token @@ -5045,143 +5055,143 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 753 + self.state =3D 756 self.match(VfrSyntaxParser.Efivarstore) - self.state =3D 770 + self.state =3D 773 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.StringIdentifier]: - self.state =3D 754 + self.state =3D 757 localctx.TN =3D self.match(VfrSyntaxParser.StringIdentifie= r) - self.state =3D 755 + self.state =3D 758 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Uint8]: - self.state =3D 756 + self.state =3D 759 self.match(VfrSyntaxParser.Uint8) - self.state =3D 757 + self.state =3D 760 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Uint16]: - self.state =3D 758 + self.state =3D 761 self.match(VfrSyntaxParser.Uint16) - self.state =3D 759 + self.state =3D 762 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Uint32]: - self.state =3D 760 + self.state =3D 763 self.match(VfrSyntaxParser.Uint32) - self.state =3D 761 + self.state =3D 764 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Uint64]: - self.state =3D 762 + self.state =3D 765 self.match(VfrSyntaxParser.Uint64) - self.state =3D 763 + self.state =3D 766 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.EFI_HII_DATE]: - self.state =3D 764 + self.state =3D 767 self.match(VfrSyntaxParser.EFI_HII_DATE) - self.state =3D 765 + self.state =3D 768 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.EFI_HII_TIME]: - self.state =3D 766 + self.state =3D 769 self.match(VfrSyntaxParser.EFI_HII_TIME) - self.state =3D 767 + self.state =3D 770 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.EFI_HII_REF]: - self.state =3D 768 + self.state =3D 771 self.match(VfrSyntaxParser.EFI_HII_REF) - self.state =3D 769 + self.state =3D 772 self.match(VfrSyntaxParser.Comma) pass else: raise NoViableAltException(self) =20 - self.state =3D 776 + self.state =3D 779 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.VarId: - self.state =3D 772 + self.state =3D 775 self.match(VfrSyntaxParser.VarId) - self.state =3D 773 + self.state =3D 776 self.match(VfrSyntaxParser.T__5) - self.state =3D 774 + self.state =3D 777 localctx.ID =3D self.match(VfrSyntaxParser.Number) - self.state =3D 775 + self.state =3D 778 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 778 + self.state =3D 781 self.match(VfrSyntaxParser.Attribute) - self.state =3D 779 + self.state =3D 782 self.match(VfrSyntaxParser.T__5) - self.state =3D 780 + self.state =3D 783 self.vfrVarStoreEfiAttr() - self.state =3D 785 + self.state =3D 788 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 781 + self.state =3D 784 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 782 + self.state =3D 785 self.vfrVarStoreEfiAttr() - self.state =3D 787 + self.state =3D 790 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 788 + self.state =3D 791 self.match(VfrSyntaxParser.Comma) - self.state =3D 804 + self.state =3D 807 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,45,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,46,self._ctx) if la_ =3D=3D 1: - self.state =3D 789 + self.state =3D 792 self.match(VfrSyntaxParser.Name) - self.state =3D 790 + self.state =3D 793 self.match(VfrSyntaxParser.T__5) - self.state =3D 791 + self.state =3D 794 localctx.SN =3D self.match(VfrSyntaxParser.StringIdentifie= r) - self.state =3D 792 + self.state =3D 795 self.match(VfrSyntaxParser.Comma) pass =20 elif la_ =3D=3D 2: - self.state =3D 793 + self.state =3D 796 self.match(VfrSyntaxParser.Name) - self.state =3D 794 + self.state =3D 797 self.match(VfrSyntaxParser.T__5) - self.state =3D 795 + self.state =3D 798 self.match(VfrSyntaxParser.StringToken) - self.state =3D 796 + self.state =3D 799 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 797 + self.state =3D 800 localctx.VN =3D self.match(VfrSyntaxParser.Number) - self.state =3D 798 + self.state =3D 801 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 799 + self.state =3D 802 self.match(VfrSyntaxParser.Comma) - self.state =3D 800 + self.state =3D 803 self.match(VfrSyntaxParser.VarSize) - self.state =3D 801 + self.state =3D 804 self.match(VfrSyntaxParser.T__5) - self.state =3D 802 + self.state =3D 805 localctx.N =3D self.match(VfrSyntaxParser.Number) - self.state =3D 803 + self.state =3D 806 self.match(VfrSyntaxParser.Comma) pass =20 =20 - self.state =3D 806 + self.state =3D 809 self.match(VfrSyntaxParser.Uuid) - self.state =3D 807 + self.state =3D 810 self.match(VfrSyntaxParser.T__5) - self.state =3D 808 + self.state =3D 811 self.guidDefinition() - self.state =3D 809 + self.state =3D 812 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -5220,7 +5230,7 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 64, self.RULE_vfrVarStoreEfiAttr) try: self.enterOuterAlt(localctx, 1) - self.state =3D 811 + self.state =3D 814 self.match(VfrSyntaxParser.Number) except RecognitionException as re: localctx.exception =3D re @@ -5236,7 +5246,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_VARSTORE_NAME_VALUE_OP) + self.Node =3D IfrTreeNode(EFI_IFR_VARSTORE_NAME_VALUE_OP) self.SN =3D None # Token self.ID =3D None # Token =20 @@ -5314,57 +5324,57 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 813 + self.state =3D 816 self.match(VfrSyntaxParser.NameValueVarStore) - self.state =3D 814 + self.state =3D 817 localctx.SN =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 815 + self.state =3D 818 self.match(VfrSyntaxParser.Comma) - self.state =3D 820 + self.state =3D 823 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.VarId: - self.state =3D 816 + self.state =3D 819 self.match(VfrSyntaxParser.VarId) - self.state =3D 817 + self.state =3D 820 self.match(VfrSyntaxParser.T__5) - self.state =3D 818 + self.state =3D 821 localctx.ID =3D self.match(VfrSyntaxParser.Number) - self.state =3D 819 + self.state =3D 822 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 829 + self.state =3D 832 self._errHandler.sync(self) _la =3D self._input.LA(1) while True: - self.state =3D 822 + self.state =3D 825 self.match(VfrSyntaxParser.Name) - self.state =3D 823 + self.state =3D 826 self.match(VfrSyntaxParser.T__5) - self.state =3D 824 + self.state =3D 827 self.match(VfrSyntaxParser.StringToken) - self.state =3D 825 + self.state =3D 828 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 826 + self.state =3D 829 self.match(VfrSyntaxParser.Number) - self.state =3D 827 + self.state =3D 830 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 828 - self.match(VfrSyntaxParser.Comma) self.state =3D 831 + self.match(VfrSyntaxParser.Comma) + self.state =3D 834 self._errHandler.sync(self) _la =3D self._input.LA(1) if not (_la=3D=3DVfrSyntaxParser.Name): break =20 - self.state =3D 833 + self.state =3D 836 self.match(VfrSyntaxParser.Uuid) - self.state =3D 834 + self.state =3D 837 self.match(VfrSyntaxParser.T__5) - self.state =3D 835 + self.state =3D 838 self.guidDefinition() - self.state =3D 836 + self.state =3D 839 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -5380,7 +5390,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_DISABLE_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_DISABLE_IF_OP) =20 def DisableIf(self): return self.getToken(VfrSyntaxParser.DisableIf, 0) @@ -5420,17 +5430,17 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 68, self.RULE_vfrStatementDisableIfFormSe= t) try: self.enterOuterAlt(localctx, 1) - self.state =3D 838 + self.state =3D 841 self.match(VfrSyntaxParser.DisableIf) - self.state =3D 839 - self.vfrStatementExpression() - self.state =3D 840 + self.state =3D 842 + self.vfrStatementExpression(localctx.Node) + self.state =3D 843 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 841 + self.state =3D 844 self.vfrFormSetList(localctx.Node) - self.state =3D 842 + self.state =3D 845 self.match(VfrSyntaxParser.EndIf) - self.state =3D 843 + self.state =3D 846 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -5446,7 +5456,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_SUPPRESS_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_SUPPRESS_IF_OP) =20 def SuppressIf(self): return self.getToken(VfrSyntaxParser.SuppressIf, 0) @@ -5486,17 +5496,17 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 70, self.RULE_vfrStatementSuppressIfFormS= et) try: self.enterOuterAlt(localctx, 1) - self.state =3D 845 + self.state =3D 848 self.match(VfrSyntaxParser.SuppressIf) - self.state =3D 846 - self.vfrStatementExpression() - self.state =3D 847 + self.state =3D 849 + self.vfrStatementExpression(localctx.Node) + self.state =3D 850 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 848 + self.state =3D 851 self.vfrFormSetList(localctx.Node) - self.state =3D 849 + self.state =3D 852 self.match(VfrSyntaxParser.EndIf) - self.state =3D 850 + self.state =3D 853 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -5545,35 +5555,35 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 72, self.RULE_guidSubDefinition) try: self.enterOuterAlt(localctx, 1) - self.state =3D 852 + self.state =3D 855 self.match(VfrSyntaxParser.Number) - self.state =3D 853 + self.state =3D 856 self.match(VfrSyntaxParser.Comma) - self.state =3D 854 + self.state =3D 857 self.match(VfrSyntaxParser.Number) - self.state =3D 855 + self.state =3D 858 self.match(VfrSyntaxParser.Comma) - self.state =3D 856 + self.state =3D 859 self.match(VfrSyntaxParser.Number) - self.state =3D 857 + self.state =3D 860 self.match(VfrSyntaxParser.Comma) - self.state =3D 858 + self.state =3D 861 self.match(VfrSyntaxParser.Number) - self.state =3D 859 + self.state =3D 862 self.match(VfrSyntaxParser.Comma) - self.state =3D 860 + self.state =3D 863 self.match(VfrSyntaxParser.Number) - self.state =3D 861 + self.state =3D 864 self.match(VfrSyntaxParser.Comma) - self.state =3D 862 + self.state =3D 865 self.match(VfrSyntaxParser.Number) - self.state =3D 863 + self.state =3D 866 self.match(VfrSyntaxParser.Comma) - self.state =3D 864 + self.state =3D 867 self.match(VfrSyntaxParser.Number) - self.state =3D 865 + self.state =3D 868 self.match(VfrSyntaxParser.Comma) - self.state =3D 866 + self.state =3D 869 self.match(VfrSyntaxParser.Number) except RecognitionException as re: localctx.exception =3D re @@ -5589,7 +5599,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode() + self.Node =3D IfrTreeNode() self.Guid =3D EFI_GUID() =20 def OpenBrace(self, i:int=3DNone): @@ -5638,39 +5648,39 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 74, self.RULE_guidDefinition) try: self.enterOuterAlt(localctx, 1) - self.state =3D 868 + self.state =3D 871 self.match(VfrSyntaxParser.OpenBrace) - self.state =3D 869 + self.state =3D 872 self.match(VfrSyntaxParser.Number) - self.state =3D 870 + self.state =3D 873 self.match(VfrSyntaxParser.Comma) - self.state =3D 871 + self.state =3D 874 self.match(VfrSyntaxParser.Number) - self.state =3D 872 + self.state =3D 875 self.match(VfrSyntaxParser.Comma) - self.state =3D 873 + self.state =3D 876 self.match(VfrSyntaxParser.Number) - self.state =3D 874 + self.state =3D 877 self.match(VfrSyntaxParser.Comma) - self.state =3D 880 + self.state =3D 883 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.OpenBrace]: - self.state =3D 875 + self.state =3D 878 self.match(VfrSyntaxParser.OpenBrace) - self.state =3D 876 + self.state =3D 879 self.guidSubDefinition(localctx.Guid) - self.state =3D 877 + self.state =3D 880 self.match(VfrSyntaxParser.CloseBrace) pass elif token in [VfrSyntaxParser.Number]: - self.state =3D 879 + self.state =3D 882 self.guidSubDefinition(localctx.Guid) pass else: raise NoViableAltException(self) =20 - self.state =3D 882 + self.state =3D 885 self.match(VfrSyntaxParser.CloseBrace) except RecognitionException as re: localctx.exception =3D re @@ -5718,13 +5728,13 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 76, self.RULE_getStringId) try: self.enterOuterAlt(localctx, 1) - self.state =3D 884 + self.state =3D 887 self.match(VfrSyntaxParser.StringToken) - self.state =3D 885 + self.state =3D 888 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 886 + self.state =3D 889 self.match(VfrSyntaxParser.Number) - self.state =3D 887 + self.state =3D 890 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -5737,12 +5747,12 @@ class VfrSyntaxParser ( Parser ): =20 class VfrQuestionHeaderContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, OpObj=3DNone, QType=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, Node=3DNone, QType=3DNone): super().__init__(parent, invokingState) self.parser =3D parser - self.OpObj =3D None + self.Node =3D None self.QType =3D None - self.OpObj =3D OpObj + self.Node =3D Node self.QType =3D QType =20 def vfrQuestionBaseInfo(self): @@ -5765,16 +5775,16 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def vfrQuestionHeader(self, OpObj, QType): + def vfrQuestionHeader(self, Node, QType): =20 - localctx =3D VfrSyntaxParser.VfrQuestionHeaderContext(self, self._= ctx, self.state, OpObj, QType) + localctx =3D VfrSyntaxParser.VfrQuestionHeaderContext(self, self._= ctx, self.state, Node, QType) self.enterRule(localctx, 78, self.RULE_vfrQuestionHeader) try: self.enterOuterAlt(localctx, 1) - self.state =3D 889 - self.vfrQuestionBaseInfo(OpObj, QType) - self.state =3D 890 - self.vfrStatementHeader(OpObj) + self.state =3D 892 + self.vfrQuestionBaseInfo(Node, QType) + self.state =3D 893 + self.vfrStatementHeader(Node) except RecognitionException as re: localctx.exception =3D re self._errHandler.reportError(self, re) @@ -5786,17 +5796,19 @@ class VfrSyntaxParser ( Parser ): =20 class VfrQuestionBaseInfoContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, OpObj=3DNone, QType=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, Node=3DNone, QType=3DNone): super().__init__(parent, invokingState) self.parser =3D parser - self.OpObj =3D None + self.Node =3D None self.QType =3D None self.BaseInfo =3D EFI_VARSTORE_INFO() self.QId =3D EFI_QUESTION_ID_INVALID self.CheckFlag =3D True + self.QName =3D None + self.VarIdStr =3D '' self.QN =3D None # Token self.ID =3D None # Token - self.OpObj =3D OpObj + self.Node =3D Node self.QType =3D QType =20 def Name(self): @@ -5836,52 +5848,52 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def vfrQuestionBaseInfo(self, OpObj, QType): + def vfrQuestionBaseInfo(self, Node, QType): =20 - localctx =3D VfrSyntaxParser.VfrQuestionBaseInfoContext(self, self= ._ctx, self.state, OpObj, QType) + localctx =3D VfrSyntaxParser.VfrQuestionBaseInfoContext(self, self= ._ctx, self.state, Node, QType) self.enterRule(localctx, 80, self.RULE_vfrQuestionBaseInfo) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 896 + self.state =3D 899 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Name: - self.state =3D 892 + self.state =3D 895 self.match(VfrSyntaxParser.Name) - self.state =3D 893 + self.state =3D 896 self.match(VfrSyntaxParser.T__5) - self.state =3D 894 + self.state =3D 897 localctx.QN =3D self.match(VfrSyntaxParser.StringIdentifie= r) - self.state =3D 895 + self.state =3D 898 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 903 + self.state =3D 906 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.VarId: - self.state =3D 898 + self.state =3D 901 self.match(VfrSyntaxParser.VarId) - self.state =3D 899 + self.state =3D 902 self.match(VfrSyntaxParser.T__5) - self.state =3D 900 + self.state =3D 903 self.vfrStorageVarId(localctx.BaseInfo, localctx.CheckFlag= ) - self.state =3D 901 + self.state =3D 904 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 909 + self.state =3D 912 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.QuestionId: - self.state =3D 905 + self.state =3D 908 self.match(VfrSyntaxParser.QuestionId) - self.state =3D 906 + self.state =3D 909 self.match(VfrSyntaxParser.T__5) - self.state =3D 907 + self.state =3D 910 localctx.ID =3D self.match(VfrSyntaxParser.Number) - self.state =3D 908 + self.state =3D 911 self.match(VfrSyntaxParser.Comma) =20 =20 @@ -5896,11 +5908,11 @@ class VfrSyntaxParser ( Parser ): =20 class VfrStatementHeaderContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, OpObj=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, Node=3DNone): super().__init__(parent, invokingState) self.parser =3D parser - self.OpObj =3D None - self.OpObj =3D OpObj + self.Node =3D None + self.Node =3D Node =20 def Prompt(self): return self.getToken(VfrSyntaxParser.Prompt, 0) @@ -5947,37 +5959,37 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def vfrStatementHeader(self, OpObj): + def vfrStatementHeader(self, Node): =20 - localctx =3D VfrSyntaxParser.VfrStatementHeaderContext(self, self.= _ctx, self.state, OpObj) + localctx =3D VfrSyntaxParser.VfrStatementHeaderContext(self, self.= _ctx, self.state, Node) self.enterRule(localctx, 82, self.RULE_vfrStatementHeader) try: self.enterOuterAlt(localctx, 1) - self.state =3D 911 + self.state =3D 914 self.match(VfrSyntaxParser.Prompt) - self.state =3D 912 + self.state =3D 915 self.match(VfrSyntaxParser.T__5) - self.state =3D 913 + self.state =3D 916 self.match(VfrSyntaxParser.StringToken) - self.state =3D 914 + self.state =3D 917 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 915 + self.state =3D 918 self.match(VfrSyntaxParser.Number) - self.state =3D 916 + self.state =3D 919 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 917 + self.state =3D 920 self.match(VfrSyntaxParser.Comma) - self.state =3D 918 + self.state =3D 921 self.match(VfrSyntaxParser.Help) - self.state =3D 919 + self.state =3D 922 self.match(VfrSyntaxParser.T__5) - self.state =3D 920 + self.state =3D 923 self.match(VfrSyntaxParser.StringToken) - self.state =3D 921 + self.state =3D 924 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 922 + self.state =3D 925 self.match(VfrSyntaxParser.Number) - self.state =3D 923 + self.state =3D 926 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -6039,47 +6051,47 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.QuestionheaderFlagsFieldContext(self,= self._ctx, self.state) self.enterRule(localctx, 84, self.RULE_questionheaderFlagsField) try: - self.state =3D 933 + self.state =3D 936 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.ReadOnlyFlag]: self.enterOuterAlt(localctx, 1) - self.state =3D 925 + self.state =3D 928 self.match(VfrSyntaxParser.ReadOnlyFlag) pass elif token in [VfrSyntaxParser.InteractiveFlag]: self.enterOuterAlt(localctx, 2) - self.state =3D 926 + self.state =3D 929 self.match(VfrSyntaxParser.InteractiveFlag) pass elif token in [VfrSyntaxParser.ResetRequiredFlag]: self.enterOuterAlt(localctx, 3) - self.state =3D 927 + self.state =3D 930 self.match(VfrSyntaxParser.ResetRequiredFlag) pass elif token in [VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 4) - self.state =3D 928 + self.state =3D 931 self.match(VfrSyntaxParser.RestStyleFlag) pass elif token in [VfrSyntaxParser.ReconnectRequiredFlag]: self.enterOuterAlt(localctx, 5) - self.state =3D 929 + self.state =3D 932 self.match(VfrSyntaxParser.ReconnectRequiredFlag) pass elif token in [VfrSyntaxParser.OptionOnlyFlag]: self.enterOuterAlt(localctx, 6) - self.state =3D 930 + self.state =3D 933 localctx.O =3D self.match(VfrSyntaxParser.OptionOnlyFlag) pass elif token in [VfrSyntaxParser.NVAccessFlag]: self.enterOuterAlt(localctx, 7) - self.state =3D 931 + self.state =3D 934 localctx.N =3D self.match(VfrSyntaxParser.NVAccessFlag) pass elif token in [VfrSyntaxParser.LateCheckFlag]: self.enterOuterAlt(localctx, 8) - self.state =3D 932 + self.state =3D 935 localctx.L =3D self.match(VfrSyntaxParser.LateCheckFlag) pass else: @@ -6177,36 +6189,36 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 86, self.RULE_vfrStorageVarId) self._la =3D 0 # Token type try: - self.state =3D 947 + self.state =3D 950 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,54,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,55,self._ctx) if la_ =3D=3D 1: localctx =3D VfrSyntaxParser.VfrStorageVarIdRule1Context(s= elf, localctx) self.enterOuterAlt(localctx, 1) - self.state =3D 935 + self.state =3D 938 localctx.SN1 =3D self.match(VfrSyntaxParser.StringIdentifi= er) - self.state =3D 936 + self.state =3D 939 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 937 + self.state =3D 940 localctx.I =3D self.match(VfrSyntaxParser.Number) - self.state =3D 938 + self.state =3D 941 self.match(VfrSyntaxParser.CloseBracket) pass =20 elif la_ =3D=3D 2: localctx =3D VfrSyntaxParser.VfrStorageVarIdRule2Context(s= elf, localctx) self.enterOuterAlt(localctx, 2) - self.state =3D 939 + self.state =3D 942 localctx.SN2 =3D self.match(VfrSyntaxParser.StringIdentifi= er) - self.state =3D 944 + self.state =3D 947 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.Dot: - self.state =3D 940 + self.state =3D 943 self.match(VfrSyntaxParser.Dot) - self.state =3D 941 + self.state =3D 944 self.arrayName() - self.state =3D 946 + self.state =3D 949 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -6227,9 +6239,9 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Value =3D EFI_IFR_TYPE_VALUE() self.ValueList =3D [] self.ListType =3D False + self.ValueType =3D None =20 def Number(self, i:int=3DNone): if i is None: @@ -6316,136 +6328,136 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 88, self.RULE_vfrConstantValueField) self._la =3D 0 # Token type try: - self.state =3D 993 + self.state =3D 996 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,57,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,58,self._ctx) if la_ =3D=3D 1: self.enterOuterAlt(localctx, 1) - self.state =3D 950 + self.state =3D 953 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Negative: - self.state =3D 949 + self.state =3D 952 self.match(VfrSyntaxParser.Negative) =20 =20 - self.state =3D 952 + self.state =3D 955 self.match(VfrSyntaxParser.Number) pass =20 elif la_ =3D=3D 2: self.enterOuterAlt(localctx, 2) - self.state =3D 953 + self.state =3D 956 self.match(VfrSyntaxParser.TrueSymbol) pass =20 elif la_ =3D=3D 3: self.enterOuterAlt(localctx, 3) - self.state =3D 954 + self.state =3D 957 self.match(VfrSyntaxParser.FalseSymbol) pass =20 elif la_ =3D=3D 4: self.enterOuterAlt(localctx, 4) - self.state =3D 955 + self.state =3D 958 self.match(VfrSyntaxParser.One) pass =20 elif la_ =3D=3D 5: self.enterOuterAlt(localctx, 5) - self.state =3D 956 + self.state =3D 959 self.match(VfrSyntaxParser.Ones) pass =20 elif la_ =3D=3D 6: self.enterOuterAlt(localctx, 6) - self.state =3D 957 + self.state =3D 960 self.match(VfrSyntaxParser.Zero) pass =20 elif la_ =3D=3D 7: self.enterOuterAlt(localctx, 7) - self.state =3D 958 + self.state =3D 961 self.match(VfrSyntaxParser.Number) - self.state =3D 959 + self.state =3D 962 self.match(VfrSyntaxParser.Colon) - self.state =3D 960 + self.state =3D 963 self.match(VfrSyntaxParser.Number) - self.state =3D 961 + self.state =3D 964 self.match(VfrSyntaxParser.Colon) - self.state =3D 962 + self.state =3D 965 self.match(VfrSyntaxParser.Number) pass =20 elif la_ =3D=3D 8: self.enterOuterAlt(localctx, 8) - self.state =3D 963 + self.state =3D 966 self.match(VfrSyntaxParser.Number) - self.state =3D 964 + self.state =3D 967 self.match(VfrSyntaxParser.Slash) - self.state =3D 965 + self.state =3D 968 self.match(VfrSyntaxParser.Number) - self.state =3D 966 + self.state =3D 969 self.match(VfrSyntaxParser.Slash) - self.state =3D 967 + self.state =3D 970 self.match(VfrSyntaxParser.Number) pass =20 elif la_ =3D=3D 9: self.enterOuterAlt(localctx, 9) - self.state =3D 968 + self.state =3D 971 self.match(VfrSyntaxParser.Number) - self.state =3D 969 + self.state =3D 972 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 970 + self.state =3D 973 self.match(VfrSyntaxParser.Number) - self.state =3D 971 + self.state =3D 974 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 972 + self.state =3D 975 self.guidDefinition() - self.state =3D 973 + self.state =3D 976 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 974 + self.state =3D 977 self.match(VfrSyntaxParser.StringToken) - self.state =3D 975 + self.state =3D 978 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 976 + self.state =3D 979 self.match(VfrSyntaxParser.Number) - self.state =3D 977 + self.state =3D 980 self.match(VfrSyntaxParser.CloseParen) pass =20 elif la_ =3D=3D 10: self.enterOuterAlt(localctx, 10) - self.state =3D 979 + self.state =3D 982 self.match(VfrSyntaxParser.StringToken) - self.state =3D 980 + self.state =3D 983 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 981 + self.state =3D 984 self.match(VfrSyntaxParser.Number) - self.state =3D 982 + self.state =3D 985 self.match(VfrSyntaxParser.CloseParen) pass =20 elif la_ =3D=3D 11: self.enterOuterAlt(localctx, 11) - self.state =3D 983 + self.state =3D 986 self.match(VfrSyntaxParser.OpenBrace) - self.state =3D 984 + self.state =3D 987 self.match(VfrSyntaxParser.Number) - self.state =3D 989 + self.state =3D 992 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 985 + self.state =3D 988 self.match(VfrSyntaxParser.Comma) - self.state =3D 986 + self.state =3D 989 self.match(VfrSyntaxParser.Number) - self.state =3D 991 + self.state =3D 994 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 992 + self.state =3D 995 self.match(VfrSyntaxParser.CloseBrace) pass =20 @@ -6464,7 +6476,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_IMAGE_OP) + self.Node =3D IfrTreeNode(EFI_IFR_IMAGE_OP) =20 def Image(self): return self.getToken(VfrSyntaxParser.Image, 0) @@ -6496,17 +6508,17 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 90, self.RULE_vfrImageTag) try: self.enterOuterAlt(localctx, 1) - self.state =3D 995 + self.state =3D 998 self.match(VfrSyntaxParser.Image) - self.state =3D 996 + self.state =3D 999 self.match(VfrSyntaxParser.T__5) - self.state =3D 997 + self.state =3D 1000 self.match(VfrSyntaxParser.T__6) - self.state =3D 998 + self.state =3D 1001 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 999 + self.state =3D 1002 self.match(VfrSyntaxParser.Number) - self.state =3D 1000 + self.state =3D 1003 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -6522,7 +6534,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_LOCKED_OP) + self.Node =3D IfrTreeNode(EFI_IFR_LOCKED_OP) =20 def Locked(self): return self.getToken(VfrSyntaxParser.Locked, 0) @@ -6545,7 +6557,7 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 92, self.RULE_vfrLockedTag) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1002 + self.state =3D 1005 self.match(VfrSyntaxParser.Locked) except RecognitionException as re: localctx.exception =3D re @@ -6588,17 +6600,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementStatTagContext(self, self= ._ctx, self.state) self.enterRule(localctx, 94, self.RULE_vfrStatementStatTag) try: - self.state =3D 1006 + self.state =3D 1009 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Image]: self.enterOuterAlt(localctx, 1) - self.state =3D 1004 + self.state =3D 1007 self.vfrImageTag() pass elif token in [VfrSyntaxParser.Locked]: self.enterOuterAlt(localctx, 2) - self.state =3D 1005 + self.state =3D 1008 self.vfrLockedTag() pass else: @@ -6652,20 +6664,20 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 96, self.RULE_vfrStatementStatTagList) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1008 + self.state =3D 1011 self.vfrStatementStatTag() - self.state =3D 1013 + self.state =3D 1016 self._errHandler.sync(self) - _alt =3D self._interp.adaptivePredict(self._input,59,self._ctx= ) + _alt =3D self._interp.adaptivePredict(self._input,60,self._ctx= ) while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER: if _alt=3D=3D1: - self.state =3D 1009 + self.state =3D 1012 self.match(VfrSyntaxParser.Comma) - self.state =3D 1010 + self.state =3D 1013 self.vfrStatementStatTag() - self.state =3D 1015 + self.state =3D 1018 self._errHandler.sync(self) - _alt =3D self._interp.adaptivePredict(self._input,59,self.= _ctx) + _alt =3D self._interp.adaptivePredict(self._input,60,self.= _ctx) =20 except RecognitionException as re: localctx.exception =3D re @@ -6681,7 +6693,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_FORM_OP) + self.Node =3D IfrTreeNode(EFI_IFR_FORM_OP) =20 def Form(self): return self.getToken(VfrSyntaxParser.Form, 0) @@ -6745,43 +6757,43 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1016 + self.state =3D 1019 self.match(VfrSyntaxParser.Form) - self.state =3D 1017 + self.state =3D 1020 self.match(VfrSyntaxParser.FormId) - self.state =3D 1018 + self.state =3D 1021 self.match(VfrSyntaxParser.T__5) - self.state =3D 1019 + self.state =3D 1022 self.match(VfrSyntaxParser.Number) - self.state =3D 1020 + self.state =3D 1023 self.match(VfrSyntaxParser.Comma) - self.state =3D 1021 + self.state =3D 1024 self.match(VfrSyntaxParser.Title) - self.state =3D 1022 + self.state =3D 1025 self.match(VfrSyntaxParser.T__5) - self.state =3D 1023 + self.state =3D 1026 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1024 + self.state =3D 1027 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1025 + self.state =3D 1028 self.match(VfrSyntaxParser.Number) - self.state =3D 1026 + self.state =3D 1029 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1027 + self.state =3D 1030 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 1031 + self.state =3D 1034 self._errHandler.sync(self) _la =3D self._input.LA(1) while ((((_la - 46)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 46)) = & ((1 << (VfrSyntaxParser.OneOf - 46)) | (1 << (VfrSyntaxParser.OrderedList= - 46)) | (1 << (VfrSyntaxParser.Subtitle - 46)) | (1 << (VfrSyntaxParser.T= ext - 46)) | (1 << (VfrSyntaxParser.Date - 46)) | (1 << (VfrSyntaxParser.Ti= me - 46)) | (1 << (VfrSyntaxParser.GrayOutIf - 46)) | (1 << (VfrSyntaxParse= r.Label - 46)) | (1 << (VfrSyntaxParser.Inventory - 46)) | (1 << (VfrSyntax= Parser.CheckBox - 46)) | (1 << (VfrSyntaxParser.Numeric - 46)) | (1 << (Vfr= SyntaxParser.Default - 46)) | (1 << (VfrSyntaxParser.Password - 46)) | (1 <= < (VfrSyntaxParser.String - 46)) | (1 << (VfrSyntaxParser.SuppressIf - 46))= | (1 << (VfrSyntaxParser.DisableIf - 46)) | (1 << (VfrSyntaxParser.Hidden = - 46)) | (1 << (VfrSyntaxParser.Goto - 46)))) !=3D 0) or ((((_la - 110)) & = ~0x3f) =3D=3D 0 and ((1 << (_la - 110)) & ((1 << (VfrSyntaxParser.Inconsist= entIf - 110)) | (1 << (VfrSyntaxParser.Restore - 110)) | (1 << (VfrSyntaxPa= rser.Save - 110)) | (1 << (VfrSyntaxParser.Banner - 110)) | (1 << (VfrSynta= xParser.Image - 110)) | (1 << (VfrSyntaxParser.Locked - 110)) | (1 << (VfrS= yntaxParser.Rule - 110)) | (1 << (VfrSyntaxParser.ResetButton - 110)) | (1 = << (VfrSyntaxParser.Action - 110)) | (1 << (VfrSyntaxParser.GuidOp - 110)) = | (1 << (VfrSyntaxParser.Modal - 110)))) !=3D 0) or _la=3D=3DVfrSyntaxParse= r.RefreshGuid: - self.state =3D 1028 + self.state =3D 1031 self.vfrForm() - self.state =3D 1033 + self.state =3D 1036 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 1034 + self.state =3D 1037 self.match(VfrSyntaxParser.EndForm) - self.state =3D 1035 + self.state =3D 1038 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -6872,61 +6884,61 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 100, self.RULE_vfrForm) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1052 + self.state =3D 1055 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Image]: - self.state =3D 1037 + self.state =3D 1040 self.vfrStatementImage() pass elif token in [VfrSyntaxParser.Locked]: - self.state =3D 1038 + self.state =3D 1041 self.vfrStatementLocked() pass elif token in [VfrSyntaxParser.Rule]: - self.state =3D 1039 + self.state =3D 1042 self.vfrStatementRules() pass elif token in [VfrSyntaxParser.Default]: - self.state =3D 1040 + self.state =3D 1043 self.vfrStatementDefault() pass elif token in [VfrSyntaxParser.Subtitle, VfrSyntaxParser.Text,= VfrSyntaxParser.Goto, VfrSyntaxParser.ResetButton]: - self.state =3D 1041 + self.state =3D 1044 self.vfrStatementStat() pass elif token in [VfrSyntaxParser.OneOf, VfrSyntaxParser.OrderedL= ist, VfrSyntaxParser.Date, VfrSyntaxParser.Time, VfrSyntaxParser.CheckBox, = VfrSyntaxParser.Numeric, VfrSyntaxParser.Password, VfrSyntaxParser.String, = VfrSyntaxParser.Action]: - self.state =3D 1042 + self.state =3D 1045 self.vfrStatementQuestions() pass elif token in [VfrSyntaxParser.GrayOutIf, VfrSyntaxParser.Supp= ressIf, VfrSyntaxParser.DisableIf, VfrSyntaxParser.InconsistentIf]: - self.state =3D 1043 + self.state =3D 1046 self.vfrStatementConditional() pass elif token in [VfrSyntaxParser.Label]: - self.state =3D 1044 + self.state =3D 1047 self.vfrStatementLabel() pass elif token in [VfrSyntaxParser.Banner]: - self.state =3D 1045 + self.state =3D 1048 self.vfrStatementBanner() pass elif token in [VfrSyntaxParser.Inventory, VfrSyntaxParser.Hidd= en, VfrSyntaxParser.Restore, VfrSyntaxParser.Save]: - self.state =3D 1046 + self.state =3D 1049 self.vfrStatementInvalid() pass elif token in [VfrSyntaxParser.GuidOp]: - self.state =3D 1047 + self.state =3D 1050 self.vfrStatementExtension() pass elif token in [VfrSyntaxParser.Modal]: - self.state =3D 1048 + self.state =3D 1051 self.vfrStatementModal() pass elif token in [VfrSyntaxParser.RefreshGuid]: - self.state =3D 1049 + self.state =3D 1052 self.vfrStatementRefreshEvent() - self.state =3D 1050 + self.state =3D 1053 self.match(VfrSyntaxParser.Semicolon) pass else: @@ -6946,7 +6958,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_FORM_MAP_OP) + self.Node =3D IfrTreeNode(EFI_IFR_FORM_MAP_OP) self.S1 =3D None # Token =20 def FormMap(self): @@ -7036,59 +7048,59 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1054 + self.state =3D 1057 self.match(VfrSyntaxParser.FormMap) - self.state =3D 1055 + self.state =3D 1058 self.match(VfrSyntaxParser.FormId) - self.state =3D 1056 + self.state =3D 1059 self.match(VfrSyntaxParser.T__5) - self.state =3D 1057 + self.state =3D 1060 localctx.S1 =3D self.match(VfrSyntaxParser.Number) - self.state =3D 1058 + self.state =3D 1061 self.match(VfrSyntaxParser.Comma) - self.state =3D 1073 + self.state =3D 1076 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.MapTitle: - self.state =3D 1059 + self.state =3D 1062 self.match(VfrSyntaxParser.MapTitle) - self.state =3D 1060 + self.state =3D 1063 self.match(VfrSyntaxParser.T__5) - self.state =3D 1061 + self.state =3D 1064 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1062 + self.state =3D 1065 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1063 + self.state =3D 1066 self.match(VfrSyntaxParser.Number) - self.state =3D 1064 + self.state =3D 1067 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1065 + self.state =3D 1068 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 1066 + self.state =3D 1069 self.match(VfrSyntaxParser.MapGuid) - self.state =3D 1067 + self.state =3D 1070 self.match(VfrSyntaxParser.T__5) - self.state =3D 1068 + self.state =3D 1071 self.guidDefinition() - self.state =3D 1069 + self.state =3D 1072 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 1075 + self.state =3D 1078 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 1079 + self.state =3D 1082 self._errHandler.sync(self) _la =3D self._input.LA(1) while ((((_la - 46)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 46)) = & ((1 << (VfrSyntaxParser.OneOf - 46)) | (1 << (VfrSyntaxParser.OrderedList= - 46)) | (1 << (VfrSyntaxParser.Subtitle - 46)) | (1 << (VfrSyntaxParser.T= ext - 46)) | (1 << (VfrSyntaxParser.Date - 46)) | (1 << (VfrSyntaxParser.Ti= me - 46)) | (1 << (VfrSyntaxParser.GrayOutIf - 46)) | (1 << (VfrSyntaxParse= r.Label - 46)) | (1 << (VfrSyntaxParser.Inventory - 46)) | (1 << (VfrSyntax= Parser.CheckBox - 46)) | (1 << (VfrSyntaxParser.Numeric - 46)) | (1 << (Vfr= SyntaxParser.Default - 46)) | (1 << (VfrSyntaxParser.Password - 46)) | (1 <= < (VfrSyntaxParser.String - 46)) | (1 << (VfrSyntaxParser.SuppressIf - 46))= | (1 << (VfrSyntaxParser.DisableIf - 46)) | (1 << (VfrSyntaxParser.Hidden = - 46)) | (1 << (VfrSyntaxParser.Goto - 46)))) !=3D 0) or ((((_la - 110)) & = ~0x3f) =3D=3D 0 and ((1 << (_la - 110)) & ((1 << (VfrSyntaxParser.Inconsist= entIf - 110)) | (1 << (VfrSyntaxParser.Restore - 110)) | (1 << (VfrSyntaxPa= rser.Save - 110)) | (1 << (VfrSyntaxParser.Banner - 110)) | (1 << (VfrSynta= xParser.Image - 110)) | (1 << (VfrSyntaxParser.Locked - 110)) | (1 << (VfrS= yntaxParser.Rule - 110)) | (1 << (VfrSyntaxParser.ResetButton - 110)) | (1 = << (VfrSyntaxParser.Action - 110)) | (1 << (VfrSyntaxParser.GuidOp - 110)) = | (1 << (VfrSyntaxParser.Modal - 110)))) !=3D 0) or _la=3D=3DVfrSyntaxParse= r.RefreshGuid: - self.state =3D 1076 + self.state =3D 1079 self.vfrForm() - self.state =3D 1081 + self.state =3D 1084 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 1082 + self.state =3D 1085 self.match(VfrSyntaxParser.EndForm) - self.state =3D 1083 + self.state =3D 1086 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -7131,9 +7143,9 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 104, self.RULE_vfrStatementImage) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1085 + self.state =3D 1088 self.vfrImageTag() - self.state =3D 1086 + self.state =3D 1089 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -7176,9 +7188,9 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 106, self.RULE_vfrStatementLocked) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1088 + self.state =3D 1091 self.vfrLockedTag() - self.state =3D 1089 + self.state =3D 1092 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -7194,7 +7206,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_RULE_OP) + self.Node =3D IfrTreeNode(EFI_IFR_RULE_OP) =20 def Rule(self): return self.getToken(VfrSyntaxParser.Rule, 0) @@ -7233,17 +7245,17 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 108, self.RULE_vfrStatementRules) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1091 + self.state =3D 1094 self.match(VfrSyntaxParser.Rule) - self.state =3D 1092 + self.state =3D 1095 self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 1093 + self.state =3D 1096 self.match(VfrSyntaxParser.Comma) - self.state =3D 1094 - self.vfrStatementExpression() - self.state =3D 1095 + self.state =3D 1097 + self.vfrStatementExpression(localctx.Node) + self.state =3D 1098 self.match(VfrSyntaxParser.EndRule) - self.state =3D 1096 + self.state =3D 1099 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -7290,22 +7302,22 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementStatContext(self, self._c= tx, self.state) self.enterRule(localctx, 110, self.RULE_vfrStatementStat) try: - self.state =3D 1101 + self.state =3D 1104 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Subtitle]: self.enterOuterAlt(localctx, 1) - self.state =3D 1098 + self.state =3D 1101 self.vfrStatementSubTitle() pass elif token in [VfrSyntaxParser.Text]: self.enterOuterAlt(localctx, 2) - self.state =3D 1099 + self.state =3D 1102 self.vfrStatementStaticText() pass elif token in [VfrSyntaxParser.Goto, VfrSyntaxParser.ResetButt= on]: self.enterOuterAlt(localctx, 3) - self.state =3D 1100 + self.state =3D 1103 self.vfrStatementCrossReference() pass else: @@ -7325,8 +7337,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_SUBTITLE_OP) - self.OpObj =3D CIfrSubtitle() + self.Node =3D IfrTreeNode(EFI_IFR_SUBTITLE_OP) =20 def Subtitle(self): return self.getToken(VfrSyntaxParser.Subtitle, 0) @@ -7395,84 +7406,84 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1103 + self.state =3D 1106 self.match(VfrSyntaxParser.Subtitle) - self.state =3D 1104 + self.state =3D 1107 self.match(VfrSyntaxParser.Text) - self.state =3D 1105 + self.state =3D 1108 self.match(VfrSyntaxParser.T__5) - self.state =3D 1106 + self.state =3D 1109 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1107 + self.state =3D 1110 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1108 + self.state =3D 1111 self.match(VfrSyntaxParser.Number) - self.state =3D 1109 + self.state =3D 1112 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1114 + self.state =3D 1117 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,65,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,66,self._ctx) if la_ =3D=3D 1: - self.state =3D 1110 + self.state =3D 1113 self.match(VfrSyntaxParser.Comma) - self.state =3D 1111 + self.state =3D 1114 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1112 + self.state =3D 1115 self.match(VfrSyntaxParser.T__5) - self.state =3D 1113 + self.state =3D 1116 self.vfrSubtitleFlags() =20 =20 - self.state =3D 1136 + self.state =3D 1139 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,70,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,71,self._ctx) if la_ =3D=3D 1: - self.state =3D 1118 + self.state =3D 1121 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 1116 + self.state =3D 1119 self.match(VfrSyntaxParser.Comma) - self.state =3D 1117 + self.state =3D 1120 self.vfrStatementStatTagList(localctx.Node) =20 =20 - self.state =3D 1120 + self.state =3D 1123 self.match(VfrSyntaxParser.Semicolon) pass =20 elif la_ =3D=3D 2: - self.state =3D 1123 + self.state =3D 1126 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,67,self._= ctx) + la_ =3D self._interp.adaptivePredict(self._input,68,self._= ctx) if la_ =3D=3D 1: - self.state =3D 1121 + self.state =3D 1124 self.match(VfrSyntaxParser.Comma) - self.state =3D 1122 + self.state =3D 1125 self.vfrStatementStatTagList(localctx.Node) =20 =20 - self.state =3D 1132 + self.state =3D 1135 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 1125 + self.state =3D 1128 self.match(VfrSyntaxParser.Comma) - self.state =3D 1129 + self.state =3D 1132 self._errHandler.sync(self) _la =3D self._input.LA(1) while ((((_la - 46)) & ~0x3f) =3D=3D 0 and ((1 << (_la= - 46)) & ((1 << (VfrSyntaxParser.OneOf - 46)) | (1 << (VfrSyntaxParser.Ord= eredList - 46)) | (1 << (VfrSyntaxParser.Subtitle - 46)) | (1 << (VfrSyntax= Parser.Text - 46)) | (1 << (VfrSyntaxParser.Date - 46)) | (1 << (VfrSyntaxP= arser.Time - 46)) | (1 << (VfrSyntaxParser.CheckBox - 46)) | (1 << (VfrSynt= axParser.Numeric - 46)) | (1 << (VfrSyntaxParser.Password - 46)) | (1 << (V= frSyntaxParser.String - 46)) | (1 << (VfrSyntaxParser.Goto - 46)))) !=3D 0)= or _la=3D=3DVfrSyntaxParser.ResetButton or _la=3D=3DVfrSyntaxParser.Action= : - self.state =3D 1126 + self.state =3D 1129 self.vfrStatementSubTitleComponent() - self.state =3D 1131 + self.state =3D 1134 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 =20 =20 - self.state =3D 1134 + self.state =3D 1137 self.match(VfrSyntaxParser.EndSubtitle) - self.state =3D 1135 + self.state =3D 1138 self.match(VfrSyntaxParser.Semicolon) pass =20 @@ -7518,17 +7529,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementSubTitleComponentContext(= self, self._ctx, self.state) self.enterRule(localctx, 114, self.RULE_vfrStatementSubTitleCompon= ent) try: - self.state =3D 1140 + self.state =3D 1143 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Subtitle, VfrSyntaxParser.Text, V= frSyntaxParser.Goto, VfrSyntaxParser.ResetButton]: self.enterOuterAlt(localctx, 1) - self.state =3D 1138 + self.state =3D 1141 self.vfrStatementStat() pass elif token in [VfrSyntaxParser.OneOf, VfrSyntaxParser.OrderedL= ist, VfrSyntaxParser.Date, VfrSyntaxParser.Time, VfrSyntaxParser.CheckBox, = VfrSyntaxParser.Numeric, VfrSyntaxParser.Password, VfrSyntaxParser.String, = VfrSyntaxParser.Action]: self.enterOuterAlt(localctx, 2) - self.state =3D 1139 + self.state =3D 1142 self.vfrStatementQuestions() pass else: @@ -7582,17 +7593,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1142 + self.state =3D 1145 self.subtitleFlagsField() - self.state =3D 1147 + self.state =3D 1150 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1143 + self.state =3D 1146 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1144 + self.state =3D 1147 self.subtitleFlagsField() - self.state =3D 1149 + self.state =3D 1152 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -7634,7 +7645,7 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1150 + self.state =3D 1153 _la =3D self._input.LA(1) if not(_la=3D=3DVfrSyntaxParser.T__7 or _la=3D=3DVfrSyntaxPars= er.Number): self._errHandler.recoverInline(self) @@ -7655,7 +7666,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_TEXT_OP) + self.Node =3D IfrTreeNode(EFI_IFR_TEXT_OP) self.S1 =3D None # Token self.S2 =3D None # Token self.S3 =3D None # Token @@ -7746,99 +7757,99 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1152 + self.state =3D 1155 self.match(VfrSyntaxParser.Text) - self.state =3D 1153 + self.state =3D 1156 self.match(VfrSyntaxParser.Help) - self.state =3D 1154 + self.state =3D 1157 self.match(VfrSyntaxParser.T__5) - self.state =3D 1155 + self.state =3D 1158 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1156 + self.state =3D 1159 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1157 + self.state =3D 1160 localctx.S1 =3D self.match(VfrSyntaxParser.Number) - self.state =3D 1158 + self.state =3D 1161 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1159 + self.state =3D 1162 self.match(VfrSyntaxParser.Comma) - self.state =3D 1160 + self.state =3D 1163 self.match(VfrSyntaxParser.Text) - self.state =3D 1161 + self.state =3D 1164 self.match(VfrSyntaxParser.T__5) - self.state =3D 1162 + self.state =3D 1165 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1163 + self.state =3D 1166 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1164 + self.state =3D 1167 localctx.S2 =3D self.match(VfrSyntaxParser.Number) - self.state =3D 1165 + self.state =3D 1168 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1173 + self.state =3D 1176 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,73,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,74,self._ctx) if la_ =3D=3D 1: - self.state =3D 1166 + self.state =3D 1169 self.match(VfrSyntaxParser.Comma) - self.state =3D 1167 + self.state =3D 1170 self.match(VfrSyntaxParser.Text) - self.state =3D 1168 + self.state =3D 1171 self.match(VfrSyntaxParser.T__5) - self.state =3D 1169 + self.state =3D 1172 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1170 + self.state =3D 1173 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1171 + self.state =3D 1174 localctx.S3 =3D self.match(VfrSyntaxParser.Number) - self.state =3D 1172 + self.state =3D 1175 self.match(VfrSyntaxParser.CloseParen) =20 =20 - self.state =3D 1191 + self.state =3D 1194 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,75,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,76,self._ctx) if la_ =3D=3D 1: - self.state =3D 1175 + self.state =3D 1178 self.match(VfrSyntaxParser.Comma) - self.state =3D 1176 + self.state =3D 1179 localctx.F =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1177 + self.state =3D 1180 self.match(VfrSyntaxParser.T__5) - self.state =3D 1178 + self.state =3D 1181 self.staticTextFlagsField() - self.state =3D 1183 + self.state =3D 1186 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1179 + self.state =3D 1182 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1180 + self.state =3D 1183 self.staticTextFlagsField() - self.state =3D 1185 + self.state =3D 1188 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 1186 + self.state =3D 1189 self.match(VfrSyntaxParser.Comma) - self.state =3D 1187 + self.state =3D 1190 self.match(VfrSyntaxParser.Key) - self.state =3D 1188 + self.state =3D 1191 self.match(VfrSyntaxParser.T__5) - self.state =3D 1189 + self.state =3D 1192 localctx.S4 =3D self.match(VfrSyntaxParser.Number) =20 =20 - self.state =3D 1195 + self.state =3D 1198 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 1193 + self.state =3D 1196 self.match(VfrSyntaxParser.Comma) - self.state =3D 1194 + self.state =3D 1197 self.vfrStatementStatTagList(localctx.Node) =20 =20 - self.state =3D 1197 + self.state =3D 1200 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -7881,17 +7892,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.StaticTextFlagsFieldContext(self, sel= f._ctx, self.state) self.enterRule(localctx, 122, self.RULE_staticTextFlagsField) try: - self.state =3D 1201 + self.state =3D 1204 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1199 + self.state =3D 1202 localctx.N =3D self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.InteractiveFlag, VfrSyntaxParse= r.NVAccessFlag, VfrSyntaxParser.ResetRequiredFlag, VfrSyntaxParser.Reconnec= tRequiredFlag, VfrSyntaxParser.LateCheckFlag, VfrSyntaxParser.ReadOnlyFlag,= VfrSyntaxParser.OptionOnlyFlag, VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 2) - self.state =3D 1200 + self.state =3D 1203 self.questionheaderFlagsField() pass else: @@ -7938,17 +7949,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementCrossReferenceContext(sel= f, self._ctx, self.state) self.enterRule(localctx, 124, self.RULE_vfrStatementCrossReference= ) try: - self.state =3D 1205 + self.state =3D 1208 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Goto]: self.enterOuterAlt(localctx, 1) - self.state =3D 1203 + self.state =3D 1206 self.vfrStatementGoto() pass elif token in [VfrSyntaxParser.ResetButton]: self.enterOuterAlt(localctx, 2) - self.state =3D 1204 + self.state =3D 1207 self.vfrStatementResetButton() pass else: @@ -7968,11 +7979,11 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_REF_OP) - self.OpObj =3D None - self.OHObj =3D None + self.Node =3D IfrTreeNode(EFI_IFR_REF_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_REF self.QN =3D None # Token + self.N =3D None # Token + self.E =3D None # Token =20 def Goto(self): return self.getToken(VfrSyntaxParser.Goto, 0) @@ -8057,103 +8068,103 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1207 + self.state =3D 1210 self.match(VfrSyntaxParser.Goto) - self.state =3D 1255 + self.state =3D 1258 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.DevicePath]: - self.state =3D 1208 + self.state =3D 1211 self.match(VfrSyntaxParser.DevicePath) - self.state =3D 1209 + self.state =3D 1212 self.match(VfrSyntaxParser.T__5) - self.state =3D 1210 + self.state =3D 1213 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1211 + self.state =3D 1214 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1212 + self.state =3D 1215 self.match(VfrSyntaxParser.Number) - self.state =3D 1213 + self.state =3D 1216 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1214 + self.state =3D 1217 self.match(VfrSyntaxParser.Comma) - self.state =3D 1215 + self.state =3D 1218 self.match(VfrSyntaxParser.FormSetGuid) - self.state =3D 1216 + self.state =3D 1219 self.match(VfrSyntaxParser.T__5) - self.state =3D 1217 + self.state =3D 1220 self.guidDefinition() - self.state =3D 1218 + self.state =3D 1221 self.match(VfrSyntaxParser.Comma) - self.state =3D 1219 + self.state =3D 1222 self.match(VfrSyntaxParser.FormId) - self.state =3D 1220 + self.state =3D 1223 self.match(VfrSyntaxParser.T__5) - self.state =3D 1221 + self.state =3D 1224 self.match(VfrSyntaxParser.Number) - self.state =3D 1222 + self.state =3D 1225 self.match(VfrSyntaxParser.Comma) - self.state =3D 1223 + self.state =3D 1226 self.match(VfrSyntaxParser.Question) - self.state =3D 1224 + self.state =3D 1227 self.match(VfrSyntaxParser.T__5) - self.state =3D 1225 + self.state =3D 1228 self.match(VfrSyntaxParser.Number) - self.state =3D 1226 + self.state =3D 1229 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.FormSetGuid]: - self.state =3D 1228 + self.state =3D 1231 self.match(VfrSyntaxParser.FormSetGuid) - self.state =3D 1229 + self.state =3D 1232 self.match(VfrSyntaxParser.T__5) - self.state =3D 1230 + self.state =3D 1233 self.guidDefinition() - self.state =3D 1231 + self.state =3D 1234 self.match(VfrSyntaxParser.Comma) - self.state =3D 1232 + self.state =3D 1235 self.match(VfrSyntaxParser.FormId) - self.state =3D 1233 + self.state =3D 1236 self.match(VfrSyntaxParser.T__5) - self.state =3D 1234 + self.state =3D 1237 self.match(VfrSyntaxParser.Number) - self.state =3D 1235 + self.state =3D 1238 self.match(VfrSyntaxParser.Comma) - self.state =3D 1236 + self.state =3D 1239 self.match(VfrSyntaxParser.Question) - self.state =3D 1237 + self.state =3D 1240 self.match(VfrSyntaxParser.T__5) - self.state =3D 1238 + self.state =3D 1241 self.match(VfrSyntaxParser.Number) - self.state =3D 1239 + self.state =3D 1242 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.FormId]: - self.state =3D 1241 + self.state =3D 1244 self.match(VfrSyntaxParser.FormId) - self.state =3D 1242 + self.state =3D 1245 self.match(VfrSyntaxParser.T__5) - self.state =3D 1243 + self.state =3D 1246 self.match(VfrSyntaxParser.Number) - self.state =3D 1244 + self.state =3D 1247 self.match(VfrSyntaxParser.Comma) - self.state =3D 1245 + self.state =3D 1248 self.match(VfrSyntaxParser.Question) - self.state =3D 1246 + self.state =3D 1249 self.match(VfrSyntaxParser.T__5) - self.state =3D 1251 + self.state =3D 1254 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.StringIdentifier]: - self.state =3D 1247 + self.state =3D 1250 localctx.QN =3D self.match(VfrSyntaxParser.StringIdent= ifier) - self.state =3D 1248 + self.state =3D 1251 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Number]: - self.state =3D 1249 + self.state =3D 1252 self.match(VfrSyntaxParser.Number) - self.state =3D 1250 + self.state =3D 1253 self.match(VfrSyntaxParser.Comma) pass else: @@ -8161,56 +8172,56 @@ class VfrSyntaxParser ( Parser ): =20 pass elif token in [VfrSyntaxParser.Number]: - self.state =3D 1253 - self.match(VfrSyntaxParser.Number) - self.state =3D 1254 + self.state =3D 1256 + localctx.N =3D self.match(VfrSyntaxParser.Number) + self.state =3D 1257 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.Prompt, VfrSyntaxParser.Name, V= frSyntaxParser.VarId, VfrSyntaxParser.QuestionId]: pass else: pass - self.state =3D 1257 - self.vfrQuestionHeader(localctx.OpObj, localctx.QType) - self.state =3D 1262 + self.state =3D 1260 + self.vfrQuestionHeader(localctx.Node, localctx.QType) + self.state =3D 1265 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,81,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,82,self._ctx) if la_ =3D=3D 1: - self.state =3D 1258 + self.state =3D 1261 self.match(VfrSyntaxParser.Comma) - self.state =3D 1259 + self.state =3D 1262 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1260 + self.state =3D 1263 self.match(VfrSyntaxParser.T__5) - self.state =3D 1261 - self.vfrGotoFlags(localctx.OpObj) + self.state =3D 1264 + self.vfrGotoFlags() =20 =20 - self.state =3D 1268 + self.state =3D 1271 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,82,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,83,self._ctx) if la_ =3D=3D 1: - self.state =3D 1264 + self.state =3D 1267 self.match(VfrSyntaxParser.Comma) - self.state =3D 1265 + self.state =3D 1268 self.match(VfrSyntaxParser.Key) - self.state =3D 1266 + self.state =3D 1269 self.match(VfrSyntaxParser.T__5) - self.state =3D 1267 + self.state =3D 1270 self.match(VfrSyntaxParser.Number) =20 =20 - self.state =3D 1272 + self.state =3D 1275 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 1270 - self.match(VfrSyntaxParser.Comma) - self.state =3D 1271 + self.state =3D 1273 + localctx.E =3D self.match(VfrSyntaxParser.Comma) + self.state =3D 1274 self.vfrStatementQuestionOptionList(localctx.Node) =20 =20 - self.state =3D 1274 + self.state =3D 1277 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -8223,12 +8234,10 @@ class VfrSyntaxParser ( Parser ): =20 class VfrGotoFlagsContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, Obj=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Obj =3D None self.GotoFlags =3D 0 - self.Obj =3D Obj =20 def gotoFlagsField(self, i:int=3DNone): if i is None: @@ -8255,24 +8264,24 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def vfrGotoFlags(self, Obj): + def vfrGotoFlags(self): =20 - localctx =3D VfrSyntaxParser.VfrGotoFlagsContext(self, self._ctx, = self.state, Obj) + localctx =3D VfrSyntaxParser.VfrGotoFlagsContext(self, self._ctx, = self.state) self.enterRule(localctx, 128, self.RULE_vfrGotoFlags) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1276 + self.state =3D 1279 self.gotoFlagsField() - self.state =3D 1281 + self.state =3D 1284 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1277 + self.state =3D 1280 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1278 + self.state =3D 1281 self.gotoFlagsField() - self.state =3D 1283 + self.state =3D 1286 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -8317,17 +8326,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.GotoFlagsFieldContext(self, self._ctx= , self.state) self.enterRule(localctx, 130, self.RULE_gotoFlagsField) try: - self.state =3D 1286 + self.state =3D 1289 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1284 + self.state =3D 1287 localctx.N =3D self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.InteractiveFlag, VfrSyntaxParse= r.NVAccessFlag, VfrSyntaxParser.ResetRequiredFlag, VfrSyntaxParser.Reconnec= tRequiredFlag, VfrSyntaxParser.LateCheckFlag, VfrSyntaxParser.ReadOnlyFlag,= VfrSyntaxParser.OptionOnlyFlag, VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 2) - self.state =3D 1285 + self.state =3D 1288 self.questionheaderFlagsField() pass else: @@ -8347,8 +8356,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_RESET_BUTTON_OP) - self.OpObj =3D CIfrResetButton() + self.Node =3D IfrTreeNode(EFI_IFR_RESET_BUTTON_OP) self.N =3D None # Token =20 def ResetButton(self): @@ -8399,33 +8407,33 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1288 + self.state =3D 1291 self.match(VfrSyntaxParser.ResetButton) - self.state =3D 1289 + self.state =3D 1292 self.match(VfrSyntaxParser.DefaultStore) - self.state =3D 1290 + self.state =3D 1293 self.match(VfrSyntaxParser.T__5) - self.state =3D 1291 + self.state =3D 1294 localctx.N =3D self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 1292 + self.state =3D 1295 self.match(VfrSyntaxParser.Comma) - self.state =3D 1293 - self.vfrStatementHeader(localctx.OpObj) - self.state =3D 1294 + self.state =3D 1296 + self.vfrStatementHeader(localctx.Node) + self.state =3D 1297 self.match(VfrSyntaxParser.Comma) - self.state =3D 1298 + self.state =3D 1301 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Image or _la=3D=3DVfrSyntaxParser.= Locked: - self.state =3D 1295 + self.state =3D 1298 self.vfrStatementStatTagList(localctx.Node) - self.state =3D 1296 + self.state =3D 1299 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1300 + self.state =3D 1303 self.match(VfrSyntaxParser.EndResetButton) - self.state =3D 1301 + self.state =3D 1304 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -8484,37 +8492,37 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementQuestionsContext(self, se= lf._ctx, self.state) self.enterRule(localctx, 134, self.RULE_vfrStatementQuestions) try: - self.state =3D 1309 + self.state =3D 1312 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.CheckBox, VfrSyntaxParser.Action]= : self.enterOuterAlt(localctx, 1) - self.state =3D 1303 + self.state =3D 1306 self.vfrStatementBooleanType() pass elif token in [VfrSyntaxParser.Date]: self.enterOuterAlt(localctx, 2) - self.state =3D 1304 + self.state =3D 1307 self.vfrStatementDate() pass elif token in [VfrSyntaxParser.OneOf, VfrSyntaxParser.Numeric]= : self.enterOuterAlt(localctx, 3) - self.state =3D 1305 + self.state =3D 1308 self.vfrStatementNumericType() pass elif token in [VfrSyntaxParser.Password, VfrSyntaxParser.Strin= g]: self.enterOuterAlt(localctx, 4) - self.state =3D 1306 + self.state =3D 1309 self.vfrStatementStringType() pass elif token in [VfrSyntaxParser.OrderedList]: self.enterOuterAlt(localctx, 5) - self.state =3D 1307 + self.state =3D 1310 self.vfrStatementOrderedList() pass elif token in [VfrSyntaxParser.Time]: self.enterOuterAlt(localctx, 6) - self.state =3D 1308 + self.state =3D 1311 self.vfrStatementTime() pass else: @@ -8592,54 +8600,54 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementQuestionTagContext(self, = self._ctx, self.state) self.enterRule(localctx, 136, self.RULE_vfrStatementQuestionTag) try: - self.state =3D 1322 + self.state =3D 1325 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Image, VfrSyntaxParser.Locked]: self.enterOuterAlt(localctx, 1) - self.state =3D 1311 + self.state =3D 1314 self.vfrStatementStatTag() - self.state =3D 1312 + self.state =3D 1315 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.InconsistentIf]: self.enterOuterAlt(localctx, 2) - self.state =3D 1314 + self.state =3D 1317 self.vfrStatementInconsistentIf() pass elif token in [VfrSyntaxParser.NoSubmitIf]: self.enterOuterAlt(localctx, 3) - self.state =3D 1315 + self.state =3D 1318 self.vfrStatementNoSubmitIf() pass elif token in [VfrSyntaxParser.DisableIf]: self.enterOuterAlt(localctx, 4) - self.state =3D 1316 + self.state =3D 1319 self.vfrStatementDisableIfQuest() pass elif token in [VfrSyntaxParser.Refresh]: self.enterOuterAlt(localctx, 5) - self.state =3D 1317 + self.state =3D 1320 self.vfrStatementRefresh() pass elif token in [VfrSyntaxParser.VarstoreDevice]: self.enterOuterAlt(localctx, 6) - self.state =3D 1318 + self.state =3D 1321 self.vfrStatementVarstoreDevice() pass elif token in [VfrSyntaxParser.GuidOp]: self.enterOuterAlt(localctx, 7) - self.state =3D 1319 + self.state =3D 1322 self.vfrStatementExtension() pass elif token in [VfrSyntaxParser.RefreshGuid]: self.enterOuterAlt(localctx, 8) - self.state =3D 1320 + self.state =3D 1323 self.vfrStatementRefreshEvent() pass elif token in [VfrSyntaxParser.WarningIf]: self.enterOuterAlt(localctx, 9) - self.state =3D 1321 + self.state =3D 1324 self.vfrStatementWarningIf() pass else: @@ -8659,7 +8667,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_INCONSISTENT_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_INCONSISTENT_IF_OP) =20 def InconsistentIf(self): return self.getToken(VfrSyntaxParser.InconsistentIf, 0) @@ -8730,57 +8738,57 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1324 + self.state =3D 1327 self.match(VfrSyntaxParser.InconsistentIf) - self.state =3D 1325 + self.state =3D 1328 self.match(VfrSyntaxParser.Prompt) - self.state =3D 1326 + self.state =3D 1329 self.match(VfrSyntaxParser.T__5) - self.state =3D 1327 + self.state =3D 1330 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1328 + self.state =3D 1331 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1329 + self.state =3D 1332 self.match(VfrSyntaxParser.Number) - self.state =3D 1330 + self.state =3D 1333 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1331 + self.state =3D 1334 self.match(VfrSyntaxParser.Comma) - self.state =3D 1344 + self.state =3D 1347 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1332 + self.state =3D 1335 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1333 + self.state =3D 1336 self.match(VfrSyntaxParser.T__5) - self.state =3D 1334 + self.state =3D 1337 self.flagsField() - self.state =3D 1339 + self.state =3D 1342 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1335 + self.state =3D 1338 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1336 + self.state =3D 1339 self.flagsField() - self.state =3D 1341 + self.state =3D 1344 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 1342 + self.state =3D 1345 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1346 - self.vfrStatementExpression() - self.state =3D 1347 - self.match(VfrSyntaxParser.EndIf) self.state =3D 1349 + self.vfrStatementExpression(localctx.Node) + self.state =3D 1350 + self.match(VfrSyntaxParser.EndIf) + self.state =3D 1352 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,91,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,92,self._ctx) if la_ =3D=3D 1: - self.state =3D 1348 + self.state =3D 1351 self.match(VfrSyntaxParser.Semicolon) =20 =20 @@ -8798,7 +8806,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_NO_SUBMIT_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_NO_SUBMIT_IF_OP) =20 def NoSubmitIf(self): return self.getToken(VfrSyntaxParser.NoSubmitIf, 0) @@ -8869,57 +8877,57 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1351 + self.state =3D 1354 self.match(VfrSyntaxParser.NoSubmitIf) - self.state =3D 1352 + self.state =3D 1355 self.match(VfrSyntaxParser.Prompt) - self.state =3D 1353 + self.state =3D 1356 self.match(VfrSyntaxParser.T__5) - self.state =3D 1354 + self.state =3D 1357 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1355 + self.state =3D 1358 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1356 + self.state =3D 1359 self.match(VfrSyntaxParser.Number) - self.state =3D 1357 + self.state =3D 1360 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1358 + self.state =3D 1361 self.match(VfrSyntaxParser.Comma) - self.state =3D 1371 + self.state =3D 1374 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1359 + self.state =3D 1362 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1360 + self.state =3D 1363 self.match(VfrSyntaxParser.T__5) - self.state =3D 1361 + self.state =3D 1364 self.flagsField() - self.state =3D 1366 + self.state =3D 1369 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1362 + self.state =3D 1365 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1363 + self.state =3D 1366 self.flagsField() - self.state =3D 1368 + self.state =3D 1371 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 1369 + self.state =3D 1372 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1373 - self.vfrStatementExpression() - self.state =3D 1374 - self.match(VfrSyntaxParser.EndIf) self.state =3D 1376 + self.vfrStatementExpression(localctx.Node) + self.state =3D 1377 + self.match(VfrSyntaxParser.EndIf) + self.state =3D 1379 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,94,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,95,self._ctx) if la_ =3D=3D 1: - self.state =3D 1375 + self.state =3D 1378 self.match(VfrSyntaxParser.Semicolon) =20 =20 @@ -8937,7 +8945,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_DISABLE_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_DISABLE_IF_OP) =20 def DisableIf(self): return self.getToken(VfrSyntaxParser.DisableIf, 0) @@ -8977,21 +8985,21 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 142, self.RULE_vfrStatementDisableIfQuest= ) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1378 + self.state =3D 1381 self.match(VfrSyntaxParser.DisableIf) - self.state =3D 1379 - self.vfrStatementExpression() - self.state =3D 1380 + self.state =3D 1382 + self.vfrStatementExpression(localctx.Node) + self.state =3D 1383 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 1381 + self.state =3D 1384 self.vfrStatementQuestionOptionList(localctx.Node) - self.state =3D 1382 + self.state =3D 1385 self.match(VfrSyntaxParser.EndIf) - self.state =3D 1384 + self.state =3D 1387 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,95,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,96,self._ctx) if la_ =3D=3D 1: - self.state =3D 1383 + self.state =3D 1386 self.match(VfrSyntaxParser.Semicolon) =20 =20 @@ -9009,7 +9017,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_REFRESH_OP) + self.Node =3D IfrTreeNode(EFI_IFR_REFRESH_OP) =20 def Refresh(self): return self.getToken(VfrSyntaxParser.Refresh, 0) @@ -9038,13 +9046,13 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 144, self.RULE_vfrStatementRefresh) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1386 + self.state =3D 1389 self.match(VfrSyntaxParser.Refresh) - self.state =3D 1387 + self.state =3D 1390 self.match(VfrSyntaxParser.Interval) - self.state =3D 1388 + self.state =3D 1391 self.match(VfrSyntaxParser.T__5) - self.state =3D 1389 + self.state =3D 1392 self.match(VfrSyntaxParser.Number) except RecognitionException as re: localctx.exception =3D re @@ -9060,7 +9068,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_VARSTORE_DEVICE_OP) + self.Node =3D IfrTreeNode(EFI_IFR_VARSTORE_DEVICE_OP) =20 def VarstoreDevice(self): return self.getToken(VfrSyntaxParser.VarstoreDevice, 0) @@ -9098,19 +9106,19 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 146, self.RULE_vfrStatementVarstoreDevice= ) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1391 + self.state =3D 1394 self.match(VfrSyntaxParser.VarstoreDevice) - self.state =3D 1392 + self.state =3D 1395 self.match(VfrSyntaxParser.T__5) - self.state =3D 1393 + self.state =3D 1396 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1394 + self.state =3D 1397 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1395 + self.state =3D 1398 self.match(VfrSyntaxParser.Number) - self.state =3D 1396 + self.state =3D 1399 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1397 + self.state =3D 1400 self.match(VfrSyntaxParser.Comma) except RecognitionException as re: localctx.exception =3D re @@ -9126,7 +9134,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_REFRESH_ID_OP) + self.Node =3D IfrTreeNode(EFI_IFR_REFRESH_ID_OP) =20 def RefreshGuid(self): return self.getToken(VfrSyntaxParser.RefreshGuid, 0) @@ -9156,13 +9164,13 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 148, self.RULE_vfrStatementRefreshEvent) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1399 + self.state =3D 1402 self.match(VfrSyntaxParser.RefreshGuid) - self.state =3D 1400 + self.state =3D 1403 self.match(VfrSyntaxParser.T__5) - self.state =3D 1401 + self.state =3D 1404 self.guidDefinition() - self.state =3D 1402 + self.state =3D 1405 self.match(VfrSyntaxParser.Comma) except RecognitionException as re: localctx.exception =3D re @@ -9178,7 +9186,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_WARNING_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_WARNING_IF_OP) =20 def WarningIf(self): return self.getToken(VfrSyntaxParser.WarningIf, 0) @@ -9239,45 +9247,45 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1404 + self.state =3D 1407 self.match(VfrSyntaxParser.WarningIf) - self.state =3D 1405 + self.state =3D 1408 self.match(VfrSyntaxParser.Prompt) - self.state =3D 1406 + self.state =3D 1409 self.match(VfrSyntaxParser.T__5) - self.state =3D 1407 + self.state =3D 1410 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1408 + self.state =3D 1411 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1409 + self.state =3D 1412 self.match(VfrSyntaxParser.Number) - self.state =3D 1410 + self.state =3D 1413 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1411 + self.state =3D 1414 self.match(VfrSyntaxParser.Comma) - self.state =3D 1416 + self.state =3D 1419 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Timeout: - self.state =3D 1412 + self.state =3D 1415 self.match(VfrSyntaxParser.Timeout) - self.state =3D 1413 + self.state =3D 1416 self.match(VfrSyntaxParser.T__5) - self.state =3D 1414 + self.state =3D 1417 self.match(VfrSyntaxParser.Number) - self.state =3D 1415 + self.state =3D 1418 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1418 - self.vfrStatementExpression() - self.state =3D 1419 - self.match(VfrSyntaxParser.EndIf) self.state =3D 1421 + self.vfrStatementExpression(localctx.Node) + self.state =3D 1422 + self.match(VfrSyntaxParser.EndIf) + self.state =3D 1424 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,97,self._ctx) + la_ =3D self._interp.adaptivePredict(self._input,98,self._ctx) if la_ =3D=3D 1: - self.state =3D 1420 + self.state =3D 1423 self.match(VfrSyntaxParser.Semicolon) =20 =20 @@ -9324,13 +9332,13 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1426 + self.state =3D 1429 self._errHandler.sync(self) _la =3D self._input.LA(1) while ((((_la - 106)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 106)= ) & ((1 << (VfrSyntaxParser.DisableIf - 106)) | (1 << (VfrSyntaxParser.Inco= nsistentIf - 106)) | (1 << (VfrSyntaxParser.WarningIf - 106)) | (1 << (VfrS= yntaxParser.NoSubmitIf - 106)) | (1 << (VfrSyntaxParser.Image - 106)) | (1 = << (VfrSyntaxParser.Locked - 106)) | (1 << (VfrSyntaxParser.Refresh - 106))= | (1 << (VfrSyntaxParser.VarstoreDevice - 106)) | (1 << (VfrSyntaxParser.G= uidOp - 106)))) !=3D 0) or _la=3D=3DVfrSyntaxParser.RefreshGuid: - self.state =3D 1423 + self.state =3D 1426 self.vfrStatementQuestionTag() - self.state =3D 1428 + self.state =3D 1431 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -9395,42 +9403,42 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementQuestionOptionTagContext(= self, self._ctx, self.state) self.enterRule(localctx, 154, self.RULE_vfrStatementQuestionOption= Tag) try: - self.state =3D 1436 + self.state =3D 1439 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.SuppressIf]: self.enterOuterAlt(localctx, 1) - self.state =3D 1429 + self.state =3D 1432 self.vfrStatementSuppressIfQuest() pass elif token in [VfrSyntaxParser.GrayOutIf]: self.enterOuterAlt(localctx, 2) - self.state =3D 1430 + self.state =3D 1433 self.vfrStatementGrayOutIfQuest() pass elif token in [VfrSyntaxParser.Value]: self.enterOuterAlt(localctx, 3) - self.state =3D 1431 + self.state =3D 1434 self.vfrStatementValue() pass elif token in [VfrSyntaxParser.Default]: self.enterOuterAlt(localctx, 4) - self.state =3D 1432 + self.state =3D 1435 self.vfrStatementDefault() pass elif token in [VfrSyntaxParser.Option]: self.enterOuterAlt(localctx, 5) - self.state =3D 1433 + self.state =3D 1436 self.vfrStatementOptions() pass elif token in [VfrSyntaxParser.Read]: self.enterOuterAlt(localctx, 6) - self.state =3D 1434 + self.state =3D 1437 self.vfrStatementRead() pass elif token in [VfrSyntaxParser.Write]: self.enterOuterAlt(localctx, 7) - self.state =3D 1435 + self.state =3D 1438 self.vfrStatementWrite() pass else: @@ -9494,47 +9502,47 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.FlagsFieldContext(self, self._ctx, se= lf.state) self.enterRule(localctx, 156, self.RULE_flagsField) try: - self.state =3D 1446 + self.state =3D 1449 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1438 + self.state =3D 1441 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.InteractiveFlag]: self.enterOuterAlt(localctx, 2) - self.state =3D 1439 + self.state =3D 1442 self.match(VfrSyntaxParser.InteractiveFlag) pass elif token in [VfrSyntaxParser.ManufacturingFlag]: self.enterOuterAlt(localctx, 3) - self.state =3D 1440 + self.state =3D 1443 self.match(VfrSyntaxParser.ManufacturingFlag) pass elif token in [VfrSyntaxParser.DefaultFlag]: self.enterOuterAlt(localctx, 4) - self.state =3D 1441 + self.state =3D 1444 self.match(VfrSyntaxParser.DefaultFlag) pass elif token in [VfrSyntaxParser.ResetRequiredFlag]: self.enterOuterAlt(localctx, 5) - self.state =3D 1442 + self.state =3D 1445 self.match(VfrSyntaxParser.ResetRequiredFlag) pass elif token in [VfrSyntaxParser.ReconnectRequiredFlag]: self.enterOuterAlt(localctx, 6) - self.state =3D 1443 + self.state =3D 1446 self.match(VfrSyntaxParser.ReconnectRequiredFlag) pass elif token in [VfrSyntaxParser.NVAccessFlag]: self.enterOuterAlt(localctx, 7) - self.state =3D 1444 + self.state =3D 1447 localctx.N =3D self.match(VfrSyntaxParser.NVAccessFlag) pass elif token in [VfrSyntaxParser.LateCheckFlag]: self.enterOuterAlt(localctx, 8) - self.state =3D 1445 + self.state =3D 1448 localctx.L =3D self.match(VfrSyntaxParser.LateCheckFlag) pass else: @@ -9554,7 +9562,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_SUPPRESS_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_SUPPRESS_IF_OP) =20 def SuppressIf(self): return self.getToken(VfrSyntaxParser.SuppressIf, 0) @@ -9614,47 +9622,47 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1448 + self.state =3D 1451 self.match(VfrSyntaxParser.SuppressIf) - self.state =3D 1449 - self.vfrStatementExpression() - self.state =3D 1450 + self.state =3D 1452 + self.vfrStatementExpression(localctx.Node) + self.state =3D 1453 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 1463 + self.state =3D 1466 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1451 + self.state =3D 1454 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1452 + self.state =3D 1455 self.match(VfrSyntaxParser.T__5) - self.state =3D 1453 + self.state =3D 1456 self.flagsField() - self.state =3D 1458 + self.state =3D 1461 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1454 + self.state =3D 1457 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1455 + self.state =3D 1458 self.flagsField() - self.state =3D 1460 + self.state =3D 1463 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 1461 + self.state =3D 1464 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1465 + self.state =3D 1468 self.vfrStatementQuestionOptionList(localctx.Node) - self.state =3D 1466 + self.state =3D 1469 self.match(VfrSyntaxParser.EndIf) - self.state =3D 1468 + self.state =3D 1471 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,103,self._ctx= ) + la_ =3D self._interp.adaptivePredict(self._input,104,self._ctx= ) if la_ =3D=3D 1: - self.state =3D 1467 + self.state =3D 1470 self.match(VfrSyntaxParser.Semicolon) =20 =20 @@ -9672,7 +9680,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_SUPPRESS_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_SUPPRESS_IF_OP) =20 def GrayOutIf(self): return self.getToken(VfrSyntaxParser.GrayOutIf, 0) @@ -9732,47 +9740,47 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1470 + self.state =3D 1473 self.match(VfrSyntaxParser.GrayOutIf) - self.state =3D 1471 - self.vfrStatementExpression() - self.state =3D 1472 + self.state =3D 1474 + self.vfrStatementExpression(localctx.Node) + self.state =3D 1475 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 1485 + self.state =3D 1488 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1473 + self.state =3D 1476 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1474 + self.state =3D 1477 self.match(VfrSyntaxParser.T__5) - self.state =3D 1475 + self.state =3D 1478 self.flagsField() - self.state =3D 1480 + self.state =3D 1483 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1476 + self.state =3D 1479 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1477 + self.state =3D 1480 self.flagsField() - self.state =3D 1482 + self.state =3D 1485 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 1483 + self.state =3D 1486 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1487 + self.state =3D 1490 self.vfrStatementQuestionOptionList(localctx.Node) - self.state =3D 1488 + self.state =3D 1491 self.match(VfrSyntaxParser.EndIf) - self.state =3D 1490 + self.state =3D 1493 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,106,self._ctx= ) + la_ =3D self._interp.adaptivePredict(self._input,107,self._ctx= ) if la_ =3D=3D 1: - self.state =3D 1489 + self.state =3D 1492 self.match(VfrSyntaxParser.Semicolon) =20 =20 @@ -9790,17 +9798,14 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_DEFAULT_OP) + self.Node =3D IfrTreeNode(EFI_IFR_DEFAULT_OP) self.D =3D None # Token + self.V =3D None # VfrStatementValueContext self.SN =3D None # Token =20 def Default(self): return self.getToken(VfrSyntaxParser.Default, 0) =20 - def vfrStatementValue(self): - return self.getTypedRuleContext(VfrSyntaxParser.VfrStatementVa= lueContext,0) - - def Comma(self, i:int=3DNone): if i is None: return self.getTokens(VfrSyntaxParser.Comma) @@ -9811,6 +9816,10 @@ class VfrSyntaxParser ( Parser ): return self.getTypedRuleContext(VfrSyntaxParser.VfrConstantVal= ueFieldContext,0) =20 =20 + def vfrStatementValue(self): + return self.getTypedRuleContext(VfrSyntaxParser.VfrStatementVa= lueContext,0) + + def DefaultStore(self): return self.getToken(VfrSyntaxParser.DefaultStore, 0) =20 @@ -9836,40 +9845,40 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1492 + self.state =3D 1495 localctx.D =3D self.match(VfrSyntaxParser.Default) =20 - self.state =3D 1500 + self.state =3D 1503 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Value]: - self.state =3D 1493 - self.vfrStatementValue() - self.state =3D 1494 + self.state =3D 1496 + localctx.V =3D self.vfrStatementValue() + self.state =3D 1497 self.match(VfrSyntaxParser.Comma) pass elif token in [VfrSyntaxParser.T__5]: - self.state =3D 1496 + self.state =3D 1499 self.match(VfrSyntaxParser.T__5) - self.state =3D 1497 + self.state =3D 1500 self.vfrConstantValueField() - self.state =3D 1498 + self.state =3D 1501 self.match(VfrSyntaxParser.Comma) pass else: raise NoViableAltException(self) =20 - self.state =3D 1506 + self.state =3D 1509 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.DefaultStore: - self.state =3D 1502 + self.state =3D 1505 self.match(VfrSyntaxParser.DefaultStore) - self.state =3D 1503 + self.state =3D 1506 self.match(VfrSyntaxParser.T__5) - self.state =3D 1504 + self.state =3D 1507 localctx.SN =3D self.match(VfrSyntaxParser.StringIdentifie= r) - self.state =3D 1505 + self.state =3D 1508 self.match(VfrSyntaxParser.Comma) =20 =20 @@ -9887,7 +9896,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_VALUE_OP) + self.Node =3D IfrTreeNode(EFI_IFR_VALUE_OP) =20 def Value(self): return self.getToken(VfrSyntaxParser.Value, 0) @@ -9914,12 +9923,12 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 164, self.RULE_vfrStatementValue) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1508 + self.state =3D 1511 self.match(VfrSyntaxParser.Value) - self.state =3D 1509 + self.state =3D 1512 self.match(VfrSyntaxParser.T__5) - self.state =3D 1510 - self.vfrStatementExpression() + self.state =3D 1513 + self.vfrStatementExpression(localctx.Node) except RecognitionException as re: localctx.exception =3D re self._errHandler.reportError(self, re) @@ -9958,7 +9967,7 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 166, self.RULE_vfrStatementOptions) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1512 + self.state =3D 1515 self.vfrStatementOneOfOption() except RecognitionException as re: localctx.exception =3D re @@ -9974,9 +9983,10 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_ONE_OF_OPTION_OP) + self.Node =3D IfrTreeNode(EFI_IFR_ONE_OF_OPTION_OP) self.F =3D None # Token self.KN =3D None # Token + self.T =3D None # Token =20 def Option(self): return self.getToken(VfrSyntaxParser.Option, 0) @@ -10051,63 +10061,63 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1514 + self.state =3D 1517 self.match(VfrSyntaxParser.Option) - self.state =3D 1515 + self.state =3D 1518 self.match(VfrSyntaxParser.Text) - self.state =3D 1516 + self.state =3D 1519 self.match(VfrSyntaxParser.T__5) - self.state =3D 1517 + self.state =3D 1520 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1518 + self.state =3D 1521 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1519 + self.state =3D 1522 self.match(VfrSyntaxParser.Number) - self.state =3D 1520 + self.state =3D 1523 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1521 + self.state =3D 1524 self.match(VfrSyntaxParser.Comma) - self.state =3D 1522 + self.state =3D 1525 self.match(VfrSyntaxParser.Value) - self.state =3D 1523 + self.state =3D 1526 self.match(VfrSyntaxParser.T__5) - self.state =3D 1524 + self.state =3D 1527 self.vfrConstantValueField() - self.state =3D 1525 + self.state =3D 1528 self.match(VfrSyntaxParser.Comma) - self.state =3D 1526 + self.state =3D 1529 localctx.F =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1527 + self.state =3D 1530 self.match(VfrSyntaxParser.T__5) - self.state =3D 1528 + self.state =3D 1531 self.vfrOneOfOptionFlags() - self.state =3D 1533 + self.state =3D 1536 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,109,self._ctx= ) + la_ =3D self._interp.adaptivePredict(self._input,110,self._ctx= ) if la_ =3D=3D 1: - self.state =3D 1529 + self.state =3D 1532 self.match(VfrSyntaxParser.Comma) - self.state =3D 1530 + self.state =3D 1533 self.match(VfrSyntaxParser.Key) - self.state =3D 1531 + self.state =3D 1534 self.match(VfrSyntaxParser.T__5) - self.state =3D 1532 + self.state =3D 1535 localctx.KN =3D self.match(VfrSyntaxParser.Number) =20 =20 - self.state =3D 1539 + self.state =3D 1542 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 1535 - self.match(VfrSyntaxParser.Comma) - self.state =3D 1536 + self.state =3D 1538 + localctx.T =3D self.match(VfrSyntaxParser.Comma) + self.state =3D 1539 self.vfrImageTag() - self.state =3D 1541 + self.state =3D 1544 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 1542 + self.state =3D 1545 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -10158,17 +10168,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1544 + self.state =3D 1547 self.oneofoptionFlagsField() - self.state =3D 1549 + self.state =3D 1552 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1545 + self.state =3D 1548 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1546 + self.state =3D 1549 self.oneofoptionFlagsField() - self.state =3D 1551 + self.state =3D 1554 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -10241,62 +10251,62 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.OneofoptionFlagsFieldContext(self, se= lf._ctx, self.state) self.enterRule(localctx, 172, self.RULE_oneofoptionFlagsField) try: - self.state =3D 1563 + self.state =3D 1566 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1552 + self.state =3D 1555 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.OptionDefault]: self.enterOuterAlt(localctx, 2) - self.state =3D 1553 + self.state =3D 1556 self.match(VfrSyntaxParser.OptionDefault) pass elif token in [VfrSyntaxParser.OptionDefaultMfg]: self.enterOuterAlt(localctx, 3) - self.state =3D 1554 + self.state =3D 1557 self.match(VfrSyntaxParser.OptionDefaultMfg) pass elif token in [VfrSyntaxParser.InteractiveFlag]: self.enterOuterAlt(localctx, 4) - self.state =3D 1555 + self.state =3D 1558 self.match(VfrSyntaxParser.InteractiveFlag) pass elif token in [VfrSyntaxParser.ResetRequiredFlag]: self.enterOuterAlt(localctx, 5) - self.state =3D 1556 + self.state =3D 1559 self.match(VfrSyntaxParser.ResetRequiredFlag) pass elif token in [VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 6) - self.state =3D 1557 + self.state =3D 1560 self.match(VfrSyntaxParser.RestStyleFlag) pass elif token in [VfrSyntaxParser.ReconnectRequiredFlag]: self.enterOuterAlt(localctx, 7) - self.state =3D 1558 + self.state =3D 1561 self.match(VfrSyntaxParser.ReconnectRequiredFlag) pass elif token in [VfrSyntaxParser.ManufacturingFlag]: self.enterOuterAlt(localctx, 8) - self.state =3D 1559 + self.state =3D 1562 self.match(VfrSyntaxParser.ManufacturingFlag) pass elif token in [VfrSyntaxParser.DefaultFlag]: self.enterOuterAlt(localctx, 9) - self.state =3D 1560 + self.state =3D 1563 self.match(VfrSyntaxParser.DefaultFlag) pass elif token in [VfrSyntaxParser.NVAccessFlag]: self.enterOuterAlt(localctx, 10) - self.state =3D 1561 + self.state =3D 1564 localctx.A =3D self.match(VfrSyntaxParser.NVAccessFlag) pass elif token in [VfrSyntaxParser.LateCheckFlag]: self.enterOuterAlt(localctx, 11) - self.state =3D 1562 + self.state =3D 1565 localctx.L =3D self.match(VfrSyntaxParser.LateCheckFlag) pass else: @@ -10316,7 +10326,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_READ_OP) + self.Node =3D IfrTreeNode(EFI_IFR_READ_OP) =20 def Read(self): return self.getToken(VfrSyntaxParser.Read, 0) @@ -10346,11 +10356,11 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 174, self.RULE_vfrStatementRead) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1565 + self.state =3D 1568 self.match(VfrSyntaxParser.Read) - self.state =3D 1566 - self.vfrStatementExpression() - self.state =3D 1567 + self.state =3D 1569 + self.vfrStatementExpression(localctx.Node) + self.state =3D 1570 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -10366,7 +10376,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_WRITE_OP) + self.Node =3D IfrTreeNode(EFI_IFR_WRITE_OP) =20 def Write(self): return self.getToken(VfrSyntaxParser.Write, 0) @@ -10396,11 +10406,11 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 176, self.RULE_vfrStatementWrite) try: self.enterOuterAlt(localctx, 1) - self.state =3D 1569 + self.state =3D 1572 self.match(VfrSyntaxParser.Write) - self.state =3D 1570 - self.vfrStatementExpression() - self.state =3D 1571 + self.state =3D 1573 + self.vfrStatementExpression(localctx.Node) + self.state =3D 1574 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -10445,13 +10455,13 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1576 + self.state =3D 1579 self._errHandler.sync(self) _la =3D self._input.LA(1) while ((((_la - 61)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 61)) = & ((1 << (VfrSyntaxParser.Option - 61)) | (1 << (VfrSyntaxParser.GrayOutIf = - 61)) | (1 << (VfrSyntaxParser.Default - 61)) | (1 << (VfrSyntaxParser.Sup= pressIf - 61)) | (1 << (VfrSyntaxParser.DisableIf - 61)) | (1 << (VfrSyntax= Parser.InconsistentIf - 61)) | (1 << (VfrSyntaxParser.WarningIf - 61)) | (1= << (VfrSyntaxParser.NoSubmitIf - 61)))) !=3D 0) or ((((_la - 144)) & ~0x3f= ) =3D=3D 0 and ((1 << (_la - 144)) & ((1 << (VfrSyntaxParser.Image - 144)) = | (1 << (VfrSyntaxParser.Locked - 144)) | (1 << (VfrSyntaxParser.Value - 14= 4)) | (1 << (VfrSyntaxParser.Read - 144)) | (1 << (VfrSyntaxParser.Write - = 144)) | (1 << (VfrSyntaxParser.Refresh - 144)) | (1 << (VfrSyntaxParser.Var= storeDevice - 144)) | (1 << (VfrSyntaxParser.GuidOp - 144)))) !=3D 0) or _l= a=3D=3DVfrSyntaxParser.RefreshGuid: - self.state =3D 1573 + self.state =3D 1576 self.vfrStatementQuestionOption() - self.state =3D 1578 + self.state =3D 1581 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -10496,17 +10506,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementQuestionOptionContext(sel= f, self._ctx, self.state) self.enterRule(localctx, 180, self.RULE_vfrStatementQuestionOption= ) try: - self.state =3D 1581 + self.state =3D 1584 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.DisableIf, VfrSyntaxParser.Incons= istentIf, VfrSyntaxParser.WarningIf, VfrSyntaxParser.NoSubmitIf, VfrSyntaxP= arser.Image, VfrSyntaxParser.Locked, VfrSyntaxParser.Refresh, VfrSyntaxPars= er.VarstoreDevice, VfrSyntaxParser.GuidOp, VfrSyntaxParser.RefreshGuid]: self.enterOuterAlt(localctx, 1) - self.state =3D 1579 + self.state =3D 1582 self.vfrStatementQuestionTag() pass elif token in [VfrSyntaxParser.Option, VfrSyntaxParser.GrayOut= If, VfrSyntaxParser.Default, VfrSyntaxParser.SuppressIf, VfrSyntaxParser.Va= lue, VfrSyntaxParser.Read, VfrSyntaxParser.Write]: self.enterOuterAlt(localctx, 2) - self.state =3D 1580 + self.state =3D 1583 self.vfrStatementQuestionOptionTag() pass else: @@ -10553,17 +10563,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementBooleanTypeContext(self, = self._ctx, self.state) self.enterRule(localctx, 182, self.RULE_vfrStatementBooleanType) try: - self.state =3D 1585 + self.state =3D 1588 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.CheckBox]: self.enterOuterAlt(localctx, 1) - self.state =3D 1583 + self.state =3D 1586 self.vfrStatementCheckBox() pass elif token in [VfrSyntaxParser.Action]: self.enterOuterAlt(localctx, 2) - self.state =3D 1584 + self.state =3D 1587 self.vfrStatementAction() pass else: @@ -10583,8 +10593,8 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_CHECKBOX_OP) - self.OpObj =3D CIfrCheckBox() + self.Node =3D IfrTreeNode(EFI_IFR_CHECKBOX_OP) + self.GuidNode =3D IfrTreeNode(EFI_IFR_GUID_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL self.L =3D None # Token self.F =3D None # Token @@ -10648,47 +10658,47 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1587 - localctx.L =3D self.match(VfrSyntaxParser.CheckBox) - self.state =3D 1588 - self.vfrQuestionBaseInfo(localctx.OpObj, localctx.QType) - self.state =3D 1589 - self.vfrStatementHeader(localctx.OpObj) self.state =3D 1590 + localctx.L =3D self.match(VfrSyntaxParser.CheckBox) + self.state =3D 1591 + self.vfrQuestionBaseInfo(localctx.Node, localctx.QType) + self.state =3D 1592 + self.vfrStatementHeader(localctx.Node) + self.state =3D 1593 self.match(VfrSyntaxParser.Comma) - self.state =3D 1596 + self.state =3D 1599 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1591 + self.state =3D 1594 localctx.F =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1592 + self.state =3D 1595 self.match(VfrSyntaxParser.T__5) - self.state =3D 1593 + self.state =3D 1596 self.vfrCheckBoxFlags() - self.state =3D 1594 + self.state =3D 1597 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1602 + self.state =3D 1605 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Key: - self.state =3D 1598 + self.state =3D 1601 self.match(VfrSyntaxParser.Key) - self.state =3D 1599 + self.state =3D 1602 self.match(VfrSyntaxParser.T__5) - self.state =3D 1600 + self.state =3D 1603 self.match(VfrSyntaxParser.Number) - self.state =3D 1601 + self.state =3D 1604 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1604 + self.state =3D 1607 self.vfrStatementQuestionOptionList(localctx.Node) - self.state =3D 1605 + self.state =3D 1608 self.match(VfrSyntaxParser.EndCheckBox) - self.state =3D 1606 + self.state =3D 1609 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -10739,17 +10749,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1608 + self.state =3D 1611 self.checkboxFlagsField() - self.state =3D 1613 + self.state =3D 1616 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1609 + self.state =3D 1612 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1610 + self.state =3D 1613 self.checkboxFlagsField() - self.state =3D 1615 + self.state =3D 1618 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -10808,37 +10818,37 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.CheckboxFlagsFieldContext(self, self.= _ctx, self.state) self.enterRule(localctx, 188, self.RULE_checkboxFlagsField) try: - self.state =3D 1622 + self.state =3D 1625 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1616 + self.state =3D 1619 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.DefaultFlag]: self.enterOuterAlt(localctx, 2) - self.state =3D 1617 + self.state =3D 1620 localctx.D =3D self.match(VfrSyntaxParser.DefaultFlag) pass elif token in [VfrSyntaxParser.ManufacturingFlag]: self.enterOuterAlt(localctx, 3) - self.state =3D 1618 + self.state =3D 1621 localctx.M =3D self.match(VfrSyntaxParser.ManufacturingFla= g) pass elif token in [VfrSyntaxParser.CheckBoxDefaultFlag]: self.enterOuterAlt(localctx, 4) - self.state =3D 1619 + self.state =3D 1622 self.match(VfrSyntaxParser.CheckBoxDefaultFlag) pass elif token in [VfrSyntaxParser.CheckBoxDefaultMfgFlag]: self.enterOuterAlt(localctx, 5) - self.state =3D 1620 + self.state =3D 1623 self.match(VfrSyntaxParser.CheckBoxDefaultMfgFlag) pass elif token in [VfrSyntaxParser.InteractiveFlag, VfrSyntaxParse= r.NVAccessFlag, VfrSyntaxParser.ResetRequiredFlag, VfrSyntaxParser.Reconnec= tRequiredFlag, VfrSyntaxParser.LateCheckFlag, VfrSyntaxParser.ReadOnlyFlag,= VfrSyntaxParser.OptionOnlyFlag, VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 6) - self.state =3D 1621 + self.state =3D 1624 self.questionheaderFlagsField() pass else: @@ -10858,8 +10868,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_ACTION_OP) - self.OpObj =3D CIfrAction() + self.Node =3D IfrTreeNode(EFI_IFR_ACTION_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL =20 def Action(self): @@ -10926,45 +10935,45 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1624 + self.state =3D 1627 self.match(VfrSyntaxParser.Action) - self.state =3D 1625 - self.vfrQuestionHeader(localctx.OpObj, localctx.QType) - self.state =3D 1626 + self.state =3D 1628 + self.vfrQuestionHeader(localctx.Node, localctx.QType) + self.state =3D 1629 self.match(VfrSyntaxParser.Comma) - self.state =3D 1632 + self.state =3D 1635 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1627 + self.state =3D 1630 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1628 + self.state =3D 1631 self.match(VfrSyntaxParser.T__5) - self.state =3D 1629 + self.state =3D 1632 self.vfrActionFlags() - self.state =3D 1630 + self.state =3D 1633 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1634 + self.state =3D 1637 self.match(VfrSyntaxParser.Config) - self.state =3D 1635 + self.state =3D 1638 self.match(VfrSyntaxParser.T__5) - self.state =3D 1636 + self.state =3D 1639 self.match(VfrSyntaxParser.StringToken) - self.state =3D 1637 + self.state =3D 1640 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 1638 + self.state =3D 1641 self.match(VfrSyntaxParser.Number) - self.state =3D 1639 + self.state =3D 1642 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 1640 + self.state =3D 1643 self.match(VfrSyntaxParser.Comma) - self.state =3D 1641 + self.state =3D 1644 self.vfrStatementQuestionTagList(localctx.Node) - self.state =3D 1642 + self.state =3D 1645 self.match(VfrSyntaxParser.EndAction) - self.state =3D 1643 + self.state =3D 1646 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -11014,17 +11023,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1645 + self.state =3D 1648 self.actionFlagsField() - self.state =3D 1650 + self.state =3D 1653 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1646 + self.state =3D 1649 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1647 + self.state =3D 1650 self.actionFlagsField() - self.state =3D 1652 + self.state =3D 1655 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -11069,17 +11078,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.ActionFlagsFieldContext(self, self._c= tx, self.state) self.enterRule(localctx, 194, self.RULE_actionFlagsField) try: - self.state =3D 1655 + self.state =3D 1658 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1653 + self.state =3D 1656 localctx.N =3D self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.InteractiveFlag, VfrSyntaxParse= r.NVAccessFlag, VfrSyntaxParser.ResetRequiredFlag, VfrSyntaxParser.Reconnec= tRequiredFlag, VfrSyntaxParser.LateCheckFlag, VfrSyntaxParser.ReadOnlyFlag,= VfrSyntaxParser.OptionOnlyFlag, VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 2) - self.state =3D 1654 + self.state =3D 1657 self.questionheaderFlagsField() pass else: @@ -11126,17 +11135,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementNumericTypeContext(self, = self._ctx, self.state) self.enterRule(localctx, 196, self.RULE_vfrStatementNumericType) try: - self.state =3D 1659 + self.state =3D 1662 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Numeric]: self.enterOuterAlt(localctx, 1) - self.state =3D 1657 + self.state =3D 1660 self.vfrStatementNumeric() pass elif token in [VfrSyntaxParser.OneOf]: self.enterOuterAlt(localctx, 2) - self.state =3D 1658 + self.state =3D 1661 self.vfrStatementOneOf() pass else: @@ -11156,8 +11165,8 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_NUMERIC_OP) - self.OpObj =3D CIfrNumeric() + self.Node =3D IfrTreeNode(EFI_IFR_NUMERIC_OP) + self.GuidNode =3D IfrTreeNode(EFI_IFR_GUID_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL self.F =3D None # Token =20 @@ -11224,49 +11233,49 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1661 - self.match(VfrSyntaxParser.Numeric) - self.state =3D 1662 - self.vfrQuestionBaseInfo(localctx.OpObj, localctx.QType) - self.state =3D 1663 - self.vfrStatementHeader(localctx.OpObj) self.state =3D 1664 + self.match(VfrSyntaxParser.Numeric) + self.state =3D 1665 + self.vfrQuestionBaseInfo(localctx.Node, localctx.QType) + self.state =3D 1666 + self.vfrStatementHeader(localctx.Node) + self.state =3D 1667 self.match(VfrSyntaxParser.Comma) - self.state =3D 1670 + self.state =3D 1673 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1665 + self.state =3D 1668 localctx.F =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1666 + self.state =3D 1669 self.match(VfrSyntaxParser.T__5) - self.state =3D 1667 + self.state =3D 1670 self.vfrNumericFlags() - self.state =3D 1668 + self.state =3D 1671 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1676 + self.state =3D 1679 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Key: - self.state =3D 1672 + self.state =3D 1675 self.match(VfrSyntaxParser.Key) - self.state =3D 1673 + self.state =3D 1676 self.match(VfrSyntaxParser.T__5) - self.state =3D 1674 + self.state =3D 1677 self.match(VfrSyntaxParser.Number) - self.state =3D 1675 + self.state =3D 1678 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1678 - self.vfrSetMinMaxStep(localctx.OpObj) - self.state =3D 1679 + self.state =3D 1681 + self.vfrSetMinMaxStep(localctx.Node) + self.state =3D 1682 self.vfrStatementQuestionOptionList(localctx.Node) - self.state =3D 1680 + self.state =3D 1683 self.match(VfrSyntaxParser.EndNumeric) - self.state =3D 1681 + self.state =3D 1684 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -11279,16 +11288,16 @@ class VfrSyntaxParser ( Parser ): =20 class VfrSetMinMaxStepContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, OpObj=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, Node=3DNone): super().__init__(parent, invokingState) self.parser =3D parser - self.OpObj =3D None + self.Node =3D None self.N1 =3D None # Token self.I =3D None # Token self.N2 =3D None # Token self.A =3D None # Token self.S =3D None # Token - self.OpObj =3D OpObj + self.Node =3D Node =20 def Minimum(self): return self.getToken(VfrSyntaxParser.Minimum, 0) @@ -11329,56 +11338,56 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def vfrSetMinMaxStep(self, OpObj): + def vfrSetMinMaxStep(self, Node): =20 - localctx =3D VfrSyntaxParser.VfrSetMinMaxStepContext(self, self._c= tx, self.state, OpObj) + localctx =3D VfrSyntaxParser.VfrSetMinMaxStepContext(self, self._c= tx, self.state, Node) self.enterRule(localctx, 200, self.RULE_vfrSetMinMaxStep) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1683 + self.state =3D 1686 self.match(VfrSyntaxParser.Minimum) - self.state =3D 1684 + self.state =3D 1687 self.match(VfrSyntaxParser.T__5) - self.state =3D 1686 + self.state =3D 1689 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Negative: - self.state =3D 1685 + self.state =3D 1688 localctx.N1 =3D self.match(VfrSyntaxParser.Negative) =20 =20 - self.state =3D 1688 + self.state =3D 1691 localctx.I =3D self.match(VfrSyntaxParser.Number) - self.state =3D 1689 + self.state =3D 1692 self.match(VfrSyntaxParser.Comma) - self.state =3D 1690 + self.state =3D 1693 self.match(VfrSyntaxParser.Maximum) - self.state =3D 1691 + self.state =3D 1694 self.match(VfrSyntaxParser.T__5) - self.state =3D 1693 + self.state =3D 1696 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Negative: - self.state =3D 1692 + self.state =3D 1695 localctx.N2 =3D self.match(VfrSyntaxParser.Negative) =20 =20 - self.state =3D 1695 + self.state =3D 1698 localctx.A =3D self.match(VfrSyntaxParser.Number) - self.state =3D 1696 + self.state =3D 1699 self.match(VfrSyntaxParser.Comma) - self.state =3D 1701 + self.state =3D 1704 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Step: - self.state =3D 1697 + self.state =3D 1700 self.match(VfrSyntaxParser.Step) - self.state =3D 1698 + self.state =3D 1701 self.match(VfrSyntaxParser.T__5) - self.state =3D 1699 + self.state =3D 1702 localctx.S =3D self.match(VfrSyntaxParser.Number) - self.state =3D 1700 + self.state =3D 1703 self.match(VfrSyntaxParser.Comma) =20 =20 @@ -11399,6 +11408,7 @@ class VfrSyntaxParser ( Parser ): self.HFlags =3D 0 self.LFlags =3D 0 self.IsDisplaySpecified =3D False + self.UpdateVarType =3D False =20 def numericFlagsField(self, i:int=3DNone): if i is None: @@ -11432,17 +11442,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1703 + self.state =3D 1706 self.numericFlagsField() - self.state =3D 1708 + self.state =3D 1711 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1704 + self.state =3D 1707 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1705 + self.state =3D 1708 self.numericFlagsField() - self.state =3D 1710 + self.state =3D 1713 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -11510,52 +11520,52 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.NumericFlagsFieldContext(self, self._= ctx, self.state) self.enterRule(localctx, 204, self.RULE_numericFlagsField) try: - self.state =3D 1720 + self.state =3D 1723 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1711 + self.state =3D 1714 localctx.N =3D self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.NumericSizeOne]: self.enterOuterAlt(localctx, 2) - self.state =3D 1712 + self.state =3D 1715 self.match(VfrSyntaxParser.NumericSizeOne) pass elif token in [VfrSyntaxParser.NumericSizeTwo]: self.enterOuterAlt(localctx, 3) - self.state =3D 1713 + self.state =3D 1716 self.match(VfrSyntaxParser.NumericSizeTwo) pass elif token in [VfrSyntaxParser.NumericSizeFour]: self.enterOuterAlt(localctx, 4) - self.state =3D 1714 + self.state =3D 1717 self.match(VfrSyntaxParser.NumericSizeFour) pass elif token in [VfrSyntaxParser.NumericSizeEight]: self.enterOuterAlt(localctx, 5) - self.state =3D 1715 + self.state =3D 1718 self.match(VfrSyntaxParser.NumericSizeEight) pass elif token in [VfrSyntaxParser.DisPlayIntDec]: self.enterOuterAlt(localctx, 6) - self.state =3D 1716 + self.state =3D 1719 self.match(VfrSyntaxParser.DisPlayIntDec) pass elif token in [VfrSyntaxParser.DisPlayUIntDec]: self.enterOuterAlt(localctx, 7) - self.state =3D 1717 + self.state =3D 1720 self.match(VfrSyntaxParser.DisPlayUIntDec) pass elif token in [VfrSyntaxParser.DisPlayUIntHex]: self.enterOuterAlt(localctx, 8) - self.state =3D 1718 + self.state =3D 1721 self.match(VfrSyntaxParser.DisPlayUIntHex) pass elif token in [VfrSyntaxParser.InteractiveFlag, VfrSyntaxParse= r.NVAccessFlag, VfrSyntaxParser.ResetRequiredFlag, VfrSyntaxParser.Reconnec= tRequiredFlag, VfrSyntaxParser.LateCheckFlag, VfrSyntaxParser.ReadOnlyFlag,= VfrSyntaxParser.OptionOnlyFlag, VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 9) - self.state =3D 1719 + self.state =3D 1722 self.questionheaderFlagsField() pass else: @@ -11575,8 +11585,8 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_ONE_OF_OP) - self.OpObj =3D CIfrOneOf() + self.Node =3D IfrTreeNode(EFI_IFR_ONE_OF_OP) + self.GuidNode =3D IfrTreeNode(EFI_IFR_GUID_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL self.F =3D None # Token =20 @@ -11637,41 +11647,41 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1722 - self.match(VfrSyntaxParser.OneOf) - self.state =3D 1723 - self.vfrQuestionBaseInfo(localctx.OpObj, localctx.QType) - self.state =3D 1724 - self.vfrStatementHeader(localctx.OpObj) self.state =3D 1725 + self.match(VfrSyntaxParser.OneOf) + self.state =3D 1726 + self.vfrQuestionBaseInfo(localctx.Node, localctx.QType) + self.state =3D 1727 + self.vfrStatementHeader(localctx.Node) + self.state =3D 1728 self.match(VfrSyntaxParser.Comma) - self.state =3D 1731 + self.state =3D 1734 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1726 + self.state =3D 1729 localctx.F =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1727 + self.state =3D 1730 self.match(VfrSyntaxParser.T__5) - self.state =3D 1728 + self.state =3D 1731 self.vfrOneofFlagsField() - self.state =3D 1729 + self.state =3D 1732 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1734 + self.state =3D 1737 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Minimum: - self.state =3D 1733 - self.vfrSetMinMaxStep(localctx.OpObj) + self.state =3D 1736 + self.vfrSetMinMaxStep(localctx.Node) =20 =20 - self.state =3D 1736 + self.state =3D 1739 self.vfrStatementQuestionOptionList(localctx.Node) - self.state =3D 1737 + self.state =3D 1740 self.match(VfrSyntaxParser.EndOneOf) - self.state =3D 1738 + self.state =3D 1741 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -11689,6 +11699,7 @@ class VfrSyntaxParser ( Parser ): self.parser =3D parser self.HFlags =3D 0 self.LFlags =3D 0 + self.UpdateVarType =3D False =20 def numericFlagsField(self, i:int=3DNone): if i is None: @@ -11722,17 +11733,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1740 + self.state =3D 1743 self.numericFlagsField() - self.state =3D 1745 + self.state =3D 1748 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1741 + self.state =3D 1744 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1742 + self.state =3D 1745 self.numericFlagsField() - self.state =3D 1747 + self.state =3D 1750 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -11777,17 +11788,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementStringTypeContext(self, s= elf._ctx, self.state) self.enterRule(localctx, 210, self.RULE_vfrStatementStringType) try: - self.state =3D 1750 + self.state =3D 1753 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.String]: self.enterOuterAlt(localctx, 1) - self.state =3D 1748 + self.state =3D 1751 self.vfrStatementString() pass elif token in [VfrSyntaxParser.Password]: self.enterOuterAlt(localctx, 2) - self.state =3D 1749 + self.state =3D 1752 self.vfrStatementPassword() pass else: @@ -11807,8 +11818,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_STRING_OP) - self.OpObj =3D CIfrString() + self.Node =3D IfrTreeNode(EFI_IFR_STRING_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL self.F =3D None # Token self.Min =3D None # Token @@ -11878,61 +11888,61 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1752 + self.state =3D 1755 self.match(VfrSyntaxParser.String) - self.state =3D 1753 - self.vfrQuestionHeader(localctx.OpObj, localctx.QType) - self.state =3D 1754 + self.state =3D 1756 + self.vfrQuestionHeader(localctx.Node, localctx.QType) + self.state =3D 1757 self.match(VfrSyntaxParser.Comma) - self.state =3D 1760 + self.state =3D 1763 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1755 + self.state =3D 1758 localctx.F =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1756 + self.state =3D 1759 self.match(VfrSyntaxParser.T__5) - self.state =3D 1757 + self.state =3D 1760 self.vfrStringFlagsField() - self.state =3D 1758 + self.state =3D 1761 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1766 + self.state =3D 1769 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Key: - self.state =3D 1762 + self.state =3D 1765 self.match(VfrSyntaxParser.Key) - self.state =3D 1763 + self.state =3D 1766 self.match(VfrSyntaxParser.T__5) - self.state =3D 1764 + self.state =3D 1767 self.match(VfrSyntaxParser.Number) - self.state =3D 1765 + self.state =3D 1768 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1768 + self.state =3D 1771 localctx.Min =3D self.match(VfrSyntaxParser.MinSize) - self.state =3D 1769 + self.state =3D 1772 self.match(VfrSyntaxParser.T__5) - self.state =3D 1770 + self.state =3D 1773 self.match(VfrSyntaxParser.Number) - self.state =3D 1771 + self.state =3D 1774 self.match(VfrSyntaxParser.Comma) - self.state =3D 1772 + self.state =3D 1775 localctx.Max =3D self.match(VfrSyntaxParser.MaxSize) - self.state =3D 1773 + self.state =3D 1776 self.match(VfrSyntaxParser.T__5) - self.state =3D 1774 + self.state =3D 1777 self.match(VfrSyntaxParser.Number) - self.state =3D 1775 + self.state =3D 1778 self.match(VfrSyntaxParser.Comma) - self.state =3D 1776 + self.state =3D 1779 self.vfrStatementQuestionOptionList(localctx.Node) - self.state =3D 1777 + self.state =3D 1780 self.match(VfrSyntaxParser.EndString) - self.state =3D 1778 + self.state =3D 1781 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -11983,17 +11993,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1780 + self.state =3D 1783 self.stringFlagsField() - self.state =3D 1785 + self.state =3D 1788 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1781 + self.state =3D 1784 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1782 + self.state =3D 1785 self.stringFlagsField() - self.state =3D 1787 + self.state =3D 1790 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -12039,22 +12049,22 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.StringFlagsFieldContext(self, self._c= tx, self.state) self.enterRule(localctx, 216, self.RULE_stringFlagsField) try: - self.state =3D 1791 + self.state =3D 1794 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1788 + self.state =3D 1791 localctx.N =3D self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.T__8]: self.enterOuterAlt(localctx, 2) - self.state =3D 1789 + self.state =3D 1792 self.match(VfrSyntaxParser.T__8) pass elif token in [VfrSyntaxParser.InteractiveFlag, VfrSyntaxParse= r.NVAccessFlag, VfrSyntaxParser.ResetRequiredFlag, VfrSyntaxParser.Reconnec= tRequiredFlag, VfrSyntaxParser.LateCheckFlag, VfrSyntaxParser.ReadOnlyFlag,= VfrSyntaxParser.OptionOnlyFlag, VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 3) - self.state =3D 1790 + self.state =3D 1793 self.questionheaderFlagsField() pass else: @@ -12074,8 +12084,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_PASSWORD_OP) - self.OpObj =3D CIfrPassword() + self.Node =3D IfrTreeNode(EFI_IFR_PASSWORD_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL self.F =3D None # Token self.Min =3D None # Token @@ -12148,75 +12157,75 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1793 + self.state =3D 1796 self.match(VfrSyntaxParser.Password) - self.state =3D 1794 - self.vfrQuestionHeader(localctx.OpObj, localctx.QType) - self.state =3D 1795 + self.state =3D 1797 + self.vfrQuestionHeader(localctx.Node, localctx.QType) + self.state =3D 1798 self.match(VfrSyntaxParser.Comma) - self.state =3D 1801 + self.state =3D 1804 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1796 + self.state =3D 1799 localctx.F =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1797 + self.state =3D 1800 self.match(VfrSyntaxParser.T__5) - self.state =3D 1798 + self.state =3D 1801 self.vfrPasswordFlagsField() - self.state =3D 1799 + self.state =3D 1802 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1807 + self.state =3D 1810 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Key: - self.state =3D 1803 + self.state =3D 1806 self.match(VfrSyntaxParser.Key) - self.state =3D 1804 + self.state =3D 1807 self.match(VfrSyntaxParser.T__5) - self.state =3D 1805 + self.state =3D 1808 self.match(VfrSyntaxParser.Number) - self.state =3D 1806 + self.state =3D 1809 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1809 + self.state =3D 1812 localctx.Min =3D self.match(VfrSyntaxParser.MinSize) - self.state =3D 1810 + self.state =3D 1813 self.match(VfrSyntaxParser.T__5) - self.state =3D 1811 + self.state =3D 1814 self.match(VfrSyntaxParser.Number) - self.state =3D 1812 + self.state =3D 1815 self.match(VfrSyntaxParser.Comma) - self.state =3D 1813 + self.state =3D 1816 localctx.Max =3D self.match(VfrSyntaxParser.MaxSize) - self.state =3D 1814 + self.state =3D 1817 self.match(VfrSyntaxParser.T__5) - self.state =3D 1815 + self.state =3D 1818 self.match(VfrSyntaxParser.Number) - self.state =3D 1816 + self.state =3D 1819 self.match(VfrSyntaxParser.Comma) - self.state =3D 1821 + self.state =3D 1824 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Encoding: - self.state =3D 1817 + self.state =3D 1820 self.match(VfrSyntaxParser.Encoding) - self.state =3D 1818 + self.state =3D 1821 self.match(VfrSyntaxParser.T__5) - self.state =3D 1819 + self.state =3D 1822 self.match(VfrSyntaxParser.Number) - self.state =3D 1820 + self.state =3D 1823 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1823 + self.state =3D 1826 self.vfrStatementQuestionOptionList(localctx.Node) - self.state =3D 1824 + self.state =3D 1827 self.match(VfrSyntaxParser.EndPassword) - self.state =3D 1825 + self.state =3D 1828 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -12266,17 +12275,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1827 + self.state =3D 1830 self.passwordFlagsField() - self.state =3D 1832 + self.state =3D 1835 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1828 + self.state =3D 1831 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1829 + self.state =3D 1832 self.passwordFlagsField() - self.state =3D 1834 + self.state =3D 1837 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -12320,17 +12329,17 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.PasswordFlagsFieldContext(self, self.= _ctx, self.state) self.enterRule(localctx, 222, self.RULE_passwordFlagsField) try: - self.state =3D 1837 + self.state =3D 1840 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1835 + self.state =3D 1838 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.InteractiveFlag, VfrSyntaxParse= r.NVAccessFlag, VfrSyntaxParser.ResetRequiredFlag, VfrSyntaxParser.Reconnec= tRequiredFlag, VfrSyntaxParser.LateCheckFlag, VfrSyntaxParser.ReadOnlyFlag,= VfrSyntaxParser.OptionOnlyFlag, VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 2) - self.state =3D 1836 + self.state =3D 1839 self.questionheaderFlagsField() pass else: @@ -12350,8 +12359,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_ORDERED_LIST_OP) - self.OpObj =3D CIfrOrderedList() + self.Node =3D IfrTreeNode(EFI_IFR_ORDERED_LIST_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL self.M =3D None # Token self.F =3D None # Token @@ -12411,45 +12419,45 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1839 + self.state =3D 1842 self.match(VfrSyntaxParser.OrderedList) - self.state =3D 1840 - self.vfrQuestionHeader(localctx.OpObj, localctx.QType) - self.state =3D 1841 + self.state =3D 1843 + self.vfrQuestionHeader(localctx.Node, localctx.QType) + self.state =3D 1844 self.match(VfrSyntaxParser.Comma) - self.state =3D 1846 + self.state =3D 1849 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.MaxContainers: - self.state =3D 1842 + self.state =3D 1845 localctx.M =3D self.match(VfrSyntaxParser.MaxContainers) - self.state =3D 1843 + self.state =3D 1846 self.match(VfrSyntaxParser.T__5) - self.state =3D 1844 + self.state =3D 1847 self.match(VfrSyntaxParser.Number) - self.state =3D 1845 + self.state =3D 1848 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1853 + self.state =3D 1856 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1848 + self.state =3D 1851 localctx.F =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1849 + self.state =3D 1852 self.match(VfrSyntaxParser.T__5) - self.state =3D 1850 + self.state =3D 1853 self.vfrOrderedListFlags() - self.state =3D 1851 + self.state =3D 1854 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1855 + self.state =3D 1858 self.vfrStatementQuestionOptionList(localctx.Node) - self.state =3D 1856 + self.state =3D 1859 self.match(VfrSyntaxParser.EndList) - self.state =3D 1857 + self.state =3D 1860 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -12500,17 +12508,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1859 + self.state =3D 1862 self.orderedlistFlagsField() - self.state =3D 1864 + self.state =3D 1867 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1860 + self.state =3D 1863 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1861 + self.state =3D 1864 self.orderedlistFlagsField() - self.state =3D 1866 + self.state =3D 1869 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -12561,27 +12569,27 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.OrderedlistFlagsFieldContext(self, se= lf._ctx, self.state) self.enterRule(localctx, 228, self.RULE_orderedlistFlagsField) try: - self.state =3D 1871 + self.state =3D 1874 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Number]: self.enterOuterAlt(localctx, 1) - self.state =3D 1867 + self.state =3D 1870 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.UniQueFlag]: self.enterOuterAlt(localctx, 2) - self.state =3D 1868 + self.state =3D 1871 self.match(VfrSyntaxParser.UniQueFlag) pass elif token in [VfrSyntaxParser.NoEmptyFlag]: self.enterOuterAlt(localctx, 3) - self.state =3D 1869 + self.state =3D 1872 self.match(VfrSyntaxParser.NoEmptyFlag) pass elif token in [VfrSyntaxParser.InteractiveFlag, VfrSyntaxParse= r.NVAccessFlag, VfrSyntaxParser.ResetRequiredFlag, VfrSyntaxParser.Reconnec= tRequiredFlag, VfrSyntaxParser.LateCheckFlag, VfrSyntaxParser.ReadOnlyFlag,= VfrSyntaxParser.OptionOnlyFlag, VfrSyntaxParser.RestStyleFlag]: self.enterOuterAlt(localctx, 4) - self.state =3D 1870 + self.state =3D 1873 self.questionheaderFlagsField() pass else: @@ -12601,10 +12609,9 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_DATE_OP) - self.OpObj =3D CIfrDate() + self.Node =3D IfrTreeNode(EFI_IFR_DATE_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_DATE - self.Val =3D EFI_IFR_TYPE_VALUE() + self.Val =3D EFI_HII_DATE() self.F1 =3D None # Token self.F2 =3D None # Token =20 @@ -12734,187 +12741,187 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1873 + self.state =3D 1876 self.match(VfrSyntaxParser.Date) - self.state =3D 1964 + self.state =3D 1967 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Prompt, VfrSyntaxParser.Name, Vfr= SyntaxParser.VarId, VfrSyntaxParser.QuestionId]: - self.state =3D 1874 - self.vfrQuestionHeader(localctx.OpObj, localctx.QType) - self.state =3D 1875 + self.state =3D 1877 + self.vfrQuestionHeader(localctx.Node, localctx.QType) + self.state =3D 1878 self.match(VfrSyntaxParser.Comma) - self.state =3D 1881 + self.state =3D 1884 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1876 + self.state =3D 1879 localctx.F1 =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1877 + self.state =3D 1880 self.match(VfrSyntaxParser.T__5) - self.state =3D 1878 + self.state =3D 1881 self.vfrDateFlags() - self.state =3D 1879 + self.state =3D 1882 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1883 + self.state =3D 1886 self.vfrStatementQuestionOptionList(localctx.Node) pass elif token in [VfrSyntaxParser.Year]: - self.state =3D 1885 - self.match(VfrSyntaxParser.Year) - self.state =3D 1886 - self.match(VfrSyntaxParser.VarId) - self.state =3D 1887 - self.match(VfrSyntaxParser.T__5) self.state =3D 1888 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.Year) self.state =3D 1889 - self.match(VfrSyntaxParser.Dot) + self.match(VfrSyntaxParser.VarId) self.state =3D 1890 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.T__5) self.state =3D 1891 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 1892 - self.match(VfrSyntaxParser.Prompt) + self.match(VfrSyntaxParser.Dot) self.state =3D 1893 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 1894 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 1895 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Prompt) self.state =3D 1896 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 1897 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 1898 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 1899 - self.match(VfrSyntaxParser.Help) + self.match(VfrSyntaxParser.Number) self.state =3D 1900 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 1901 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 1902 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Help) self.state =3D 1903 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 1904 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 1905 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 1906 - self.minMaxDateStepDefault(localctx.Val.date, 0) + self.match(VfrSyntaxParser.Number) self.state =3D 1907 - self.match(VfrSyntaxParser.Month) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 1908 - self.match(VfrSyntaxParser.VarId) + self.match(VfrSyntaxParser.Comma) self.state =3D 1909 - self.match(VfrSyntaxParser.T__5) + self.minMaxDateStepDefault(localctx.Node, localctx.Val, 0) self.state =3D 1910 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.Month) self.state =3D 1911 - self.match(VfrSyntaxParser.Dot) + self.match(VfrSyntaxParser.VarId) self.state =3D 1912 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.T__5) self.state =3D 1913 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 1914 - self.match(VfrSyntaxParser.Prompt) + self.match(VfrSyntaxParser.Dot) self.state =3D 1915 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 1916 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 1917 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Prompt) self.state =3D 1918 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 1919 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 1920 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 1921 - self.match(VfrSyntaxParser.Help) + self.match(VfrSyntaxParser.Number) self.state =3D 1922 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 1923 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 1924 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Help) self.state =3D 1925 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 1926 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 1927 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 1928 - self.minMaxDateStepDefault(localctx.Val.date, 1) + self.match(VfrSyntaxParser.Number) self.state =3D 1929 - self.match(VfrSyntaxParser.Day) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 1930 - self.match(VfrSyntaxParser.VarId) + self.match(VfrSyntaxParser.Comma) self.state =3D 1931 - self.match(VfrSyntaxParser.T__5) + self.minMaxDateStepDefault(localctx.Node, localctx.Val, 1) self.state =3D 1932 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.Day) self.state =3D 1933 - self.match(VfrSyntaxParser.Dot) + self.match(VfrSyntaxParser.VarId) self.state =3D 1934 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.T__5) self.state =3D 1935 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 1936 - self.match(VfrSyntaxParser.Prompt) + self.match(VfrSyntaxParser.Dot) self.state =3D 1937 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 1938 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 1939 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Prompt) self.state =3D 1940 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 1941 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 1942 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 1943 - self.match(VfrSyntaxParser.Help) + self.match(VfrSyntaxParser.Number) self.state =3D 1944 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 1945 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 1946 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Help) self.state =3D 1947 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 1948 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 1949 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 1950 - self.minMaxDateStepDefault(localctx.Val.date, 2) - self.state =3D 1956 + self.match(VfrSyntaxParser.Number) + self.state =3D 1951 + self.match(VfrSyntaxParser.CloseParen) + self.state =3D 1952 + self.match(VfrSyntaxParser.Comma) + self.state =3D 1953 + self.minMaxDateStepDefault(localctx.Node, localctx.Val, 2) + self.state =3D 1959 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 1951 + self.state =3D 1954 localctx.F2 =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 1952 + self.state =3D 1955 self.match(VfrSyntaxParser.T__5) - self.state =3D 1953 + self.state =3D 1956 self.vfrDateFlags() - self.state =3D 1954 + self.state =3D 1957 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1961 + self.state =3D 1964 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.InconsistentIf: - self.state =3D 1958 + self.state =3D 1961 self.vfrStatementInconsistentIf() - self.state =3D 1963 + self.state =3D 1966 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -12922,9 +12929,9 @@ class VfrSyntaxParser ( Parser ): else: raise NoViableAltException(self) =20 - self.state =3D 1966 + self.state =3D 1969 self.match(VfrSyntaxParser.EndDate) - self.state =3D 1967 + self.state =3D 1970 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -12937,12 +12944,14 @@ class VfrSyntaxParser ( Parser ): =20 class MinMaxDateStepDefaultContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, Date=3DNone, KeyValue=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, Node=3DNone, Date=3DNone, KeyValue=3DNone): super().__init__(parent, invokingState) self.parser =3D parser + self.Node =3D None self.Date =3D None self.KeyValue =3D None self.N =3D None # Token + self.Node =3D Node self.Date =3D Date self.KeyValue =3D KeyValue =20 @@ -12982,54 +12991,54 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def minMaxDateStepDefault(self, Date, KeyValue): + def minMaxDateStepDefault(self, Node, Date, KeyValue): =20 - localctx =3D VfrSyntaxParser.MinMaxDateStepDefaultContext(self, se= lf._ctx, self.state, Date, KeyValue) + localctx =3D VfrSyntaxParser.MinMaxDateStepDefaultContext(self, se= lf._ctx, self.state, Node, Date, KeyValue) self.enterRule(localctx, 232, self.RULE_minMaxDateStepDefault) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1969 + self.state =3D 1972 self.match(VfrSyntaxParser.Minimum) - self.state =3D 1970 + self.state =3D 1973 self.match(VfrSyntaxParser.T__5) - self.state =3D 1971 + self.state =3D 1974 self.match(VfrSyntaxParser.Number) - self.state =3D 1972 + self.state =3D 1975 self.match(VfrSyntaxParser.Comma) - self.state =3D 1973 + self.state =3D 1976 self.match(VfrSyntaxParser.Maximum) - self.state =3D 1974 + self.state =3D 1977 self.match(VfrSyntaxParser.T__5) - self.state =3D 1975 + self.state =3D 1978 self.match(VfrSyntaxParser.Number) - self.state =3D 1976 + self.state =3D 1979 self.match(VfrSyntaxParser.Comma) - self.state =3D 1981 + self.state =3D 1984 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Step: - self.state =3D 1977 + self.state =3D 1980 self.match(VfrSyntaxParser.Step) - self.state =3D 1978 + self.state =3D 1981 self.match(VfrSyntaxParser.T__5) - self.state =3D 1979 + self.state =3D 1982 self.match(VfrSyntaxParser.Number) - self.state =3D 1980 + self.state =3D 1983 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 1987 + self.state =3D 1990 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Default: - self.state =3D 1983 + self.state =3D 1986 self.match(VfrSyntaxParser.Default) - self.state =3D 1984 + self.state =3D 1987 self.match(VfrSyntaxParser.T__5) - self.state =3D 1985 + self.state =3D 1988 localctx.N =3D self.match(VfrSyntaxParser.Number) - self.state =3D 1986 + self.state =3D 1989 self.match(VfrSyntaxParser.Comma) =20 =20 @@ -13081,17 +13090,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1989 + self.state =3D 1992 self.dateFlagsField() - self.state =3D 1994 + self.state =3D 1997 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 1990 + self.state =3D 1993 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 1991 + self.state =3D 1994 self.dateFlagsField() - self.state =3D 1996 + self.state =3D 1999 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -13151,7 +13160,7 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1997 + self.state =3D 2000 _la =3D self._input.LA(1) if not(((((_la - 181)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 181= )) & ((1 << (VfrSyntaxParser.YearSupppressFlag - 181)) | (1 << (VfrSyntaxPa= rser.MonthSuppressFlag - 181)) | (1 << (VfrSyntaxParser.DaySuppressFlag - 1= 81)) | (1 << (VfrSyntaxParser.StorageNormalFlag - 181)) | (1 << (VfrSyntaxP= arser.StorageTimeFlag - 181)) | (1 << (VfrSyntaxParser.StorageWakeUpFlag - = 181)))) !=3D 0) or _la=3D=3DVfrSyntaxParser.Number): self._errHandler.recoverInline(self) @@ -13172,10 +13181,9 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_TIME_OP) - self.OpObj =3D CIfrTime() + self.Node =3D IfrTreeNode(EFI_IFR_TIME_OP) self.QType =3D EFI_QUESION_TYPE.QUESTION_TIME - self.Val =3D EFI_IFR_TYPE_VALUE() + self.Val =3D EFI_HII_TIME() self.F1 =3D None # Token self.F2 =3D None # Token =20 @@ -13305,187 +13313,187 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 1999 + self.state =3D 2002 self.match(VfrSyntaxParser.Time) - self.state =3D 2090 + self.state =3D 2093 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Prompt, VfrSyntaxParser.Name, Vfr= SyntaxParser.VarId, VfrSyntaxParser.QuestionId]: - self.state =3D 2000 - self.vfrQuestionHeader(localctx.OpObj, localctx.QType) - self.state =3D 2001 + self.state =3D 2003 + self.vfrQuestionHeader(localctx.Node, localctx.QType) + self.state =3D 2004 self.match(VfrSyntaxParser.Comma) - self.state =3D 2007 + self.state =3D 2010 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 2002 + self.state =3D 2005 localctx.F1 =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2003 + self.state =3D 2006 self.match(VfrSyntaxParser.T__5) - self.state =3D 2004 + self.state =3D 2007 self.vfrTimeFlags() - self.state =3D 2005 + self.state =3D 2008 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2009 + self.state =3D 2012 self.vfrStatementQuestionOptionList(localctx.Node) pass elif token in [VfrSyntaxParser.Hour]: - self.state =3D 2011 - self.match(VfrSyntaxParser.Hour) - self.state =3D 2012 - self.match(VfrSyntaxParser.VarId) - self.state =3D 2013 - self.match(VfrSyntaxParser.T__5) self.state =3D 2014 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.Hour) self.state =3D 2015 - self.match(VfrSyntaxParser.Dot) + self.match(VfrSyntaxParser.VarId) self.state =3D 2016 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.T__5) self.state =3D 2017 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 2018 - self.match(VfrSyntaxParser.Prompt) + self.match(VfrSyntaxParser.Dot) self.state =3D 2019 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 2020 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 2021 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Prompt) self.state =3D 2022 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 2023 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 2024 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 2025 - self.match(VfrSyntaxParser.Help) + self.match(VfrSyntaxParser.Number) self.state =3D 2026 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 2027 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 2028 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Help) self.state =3D 2029 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 2030 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 2031 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 2032 - self.minMaxTimeStepDefault(localctx.Val.time, 0) + self.match(VfrSyntaxParser.Number) self.state =3D 2033 - self.match(VfrSyntaxParser.Minute) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 2034 - self.match(VfrSyntaxParser.VarId) + self.match(VfrSyntaxParser.Comma) self.state =3D 2035 - self.match(VfrSyntaxParser.T__5) + self.minMaxTimeStepDefault(localctx.Node, localctx.Val, 0) self.state =3D 2036 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.Minute) self.state =3D 2037 - self.match(VfrSyntaxParser.Dot) + self.match(VfrSyntaxParser.VarId) self.state =3D 2038 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.T__5) self.state =3D 2039 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 2040 - self.match(VfrSyntaxParser.Prompt) + self.match(VfrSyntaxParser.Dot) self.state =3D 2041 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 2042 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 2043 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Prompt) self.state =3D 2044 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 2045 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 2046 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 2047 - self.match(VfrSyntaxParser.Help) + self.match(VfrSyntaxParser.Number) self.state =3D 2048 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 2049 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 2050 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Help) self.state =3D 2051 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 2052 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 2053 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 2054 - self.minMaxTimeStepDefault(localctx.Val.time, 1) + self.match(VfrSyntaxParser.Number) self.state =3D 2055 - self.match(VfrSyntaxParser.Second) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 2056 - self.match(VfrSyntaxParser.VarId) + self.match(VfrSyntaxParser.Comma) self.state =3D 2057 - self.match(VfrSyntaxParser.T__5) + self.minMaxTimeStepDefault(localctx.Node, localctx.Val, 1) self.state =3D 2058 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.Second) self.state =3D 2059 - self.match(VfrSyntaxParser.Dot) + self.match(VfrSyntaxParser.VarId) self.state =3D 2060 - self.match(VfrSyntaxParser.StringIdentifier) + self.match(VfrSyntaxParser.T__5) self.state =3D 2061 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 2062 - self.match(VfrSyntaxParser.Prompt) + self.match(VfrSyntaxParser.Dot) self.state =3D 2063 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 2064 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 2065 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Prompt) self.state =3D 2066 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 2067 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 2068 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 2069 - self.match(VfrSyntaxParser.Help) + self.match(VfrSyntaxParser.Number) self.state =3D 2070 - self.match(VfrSyntaxParser.T__5) + self.match(VfrSyntaxParser.CloseParen) self.state =3D 2071 - self.match(VfrSyntaxParser.StringToken) + self.match(VfrSyntaxParser.Comma) self.state =3D 2072 - self.match(VfrSyntaxParser.OpenParen) + self.match(VfrSyntaxParser.Help) self.state =3D 2073 - self.match(VfrSyntaxParser.Number) + self.match(VfrSyntaxParser.T__5) self.state =3D 2074 - self.match(VfrSyntaxParser.CloseParen) + self.match(VfrSyntaxParser.StringToken) self.state =3D 2075 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 2076 - self.minMaxTimeStepDefault(localctx.Val.time, 2) - self.state =3D 2082 + self.match(VfrSyntaxParser.Number) + self.state =3D 2077 + self.match(VfrSyntaxParser.CloseParen) + self.state =3D 2078 + self.match(VfrSyntaxParser.Comma) + self.state =3D 2079 + self.minMaxTimeStepDefault(localctx.Node, localctx.Val, 2) + self.state =3D 2085 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 2077 + self.state =3D 2080 localctx.F2 =3D self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2078 + self.state =3D 2081 self.match(VfrSyntaxParser.T__5) - self.state =3D 2079 + self.state =3D 2082 self.vfrTimeFlags() - self.state =3D 2080 + self.state =3D 2083 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2087 + self.state =3D 2090 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.InconsistentIf: - self.state =3D 2084 + self.state =3D 2087 self.vfrStatementInconsistentIf() - self.state =3D 2089 + self.state =3D 2092 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -13493,9 +13501,9 @@ class VfrSyntaxParser ( Parser ): else: raise NoViableAltException(self) =20 - self.state =3D 2092 + self.state =3D 2095 self.match(VfrSyntaxParser.EndTime) - self.state =3D 2093 + self.state =3D 2096 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -13508,12 +13516,14 @@ class VfrSyntaxParser ( Parser ): =20 class MinMaxTimeStepDefaultContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, Time=3DNone, KeyValue=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, Node=3DNone, Time=3DNone, KeyValue=3DNone): super().__init__(parent, invokingState) self.parser =3D parser + self.Node =3D None self.Time =3D None self.KeyValue =3D None self.N =3D None # Token + self.Node =3D Node self.Time =3D Time self.KeyValue =3D KeyValue =20 @@ -13553,54 +13563,54 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def minMaxTimeStepDefault(self, Time, KeyValue): + def minMaxTimeStepDefault(self, Node, Time, KeyValue): =20 - localctx =3D VfrSyntaxParser.MinMaxTimeStepDefaultContext(self, se= lf._ctx, self.state, Time, KeyValue) + localctx =3D VfrSyntaxParser.MinMaxTimeStepDefaultContext(self, se= lf._ctx, self.state, Node, Time, KeyValue) self.enterRule(localctx, 240, self.RULE_minMaxTimeStepDefault) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2095 + self.state =3D 2098 self.match(VfrSyntaxParser.Minimum) - self.state =3D 2096 + self.state =3D 2099 self.match(VfrSyntaxParser.T__5) - self.state =3D 2097 + self.state =3D 2100 self.match(VfrSyntaxParser.Number) - self.state =3D 2098 + self.state =3D 2101 self.match(VfrSyntaxParser.Comma) - self.state =3D 2099 + self.state =3D 2102 self.match(VfrSyntaxParser.Maximum) - self.state =3D 2100 + self.state =3D 2103 self.match(VfrSyntaxParser.T__5) - self.state =3D 2101 + self.state =3D 2104 self.match(VfrSyntaxParser.Number) - self.state =3D 2102 + self.state =3D 2105 self.match(VfrSyntaxParser.Comma) - self.state =3D 2107 + self.state =3D 2110 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Step: - self.state =3D 2103 + self.state =3D 2106 self.match(VfrSyntaxParser.Step) - self.state =3D 2104 + self.state =3D 2107 self.match(VfrSyntaxParser.T__5) - self.state =3D 2105 + self.state =3D 2108 self.match(VfrSyntaxParser.Number) - self.state =3D 2106 + self.state =3D 2109 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2113 + self.state =3D 2116 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Default: - self.state =3D 2109 + self.state =3D 2112 self.match(VfrSyntaxParser.Default) - self.state =3D 2110 + self.state =3D 2113 self.match(VfrSyntaxParser.T__5) - self.state =3D 2111 + self.state =3D 2114 localctx.N =3D self.match(VfrSyntaxParser.Number) - self.state =3D 2112 + self.state =3D 2115 self.match(VfrSyntaxParser.Comma) =20 =20 @@ -13652,17 +13662,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2115 + self.state =3D 2118 self.timeFlagsField() - self.state =3D 2120 + self.state =3D 2123 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2116 + self.state =3D 2119 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2117 + self.state =3D 2120 self.timeFlagsField() - self.state =3D 2122 + self.state =3D 2125 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -13722,7 +13732,7 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2123 + self.state =3D 2126 _la =3D self._input.LA(1) if not(((((_la - 184)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 184= )) & ((1 << (VfrSyntaxParser.HourSupppressFlag - 184)) | (1 << (VfrSyntaxPa= rser.MinuteSuppressFlag - 184)) | (1 << (VfrSyntaxParser.SecondSuppressFlag= - 184)) | (1 << (VfrSyntaxParser.StorageNormalFlag - 184)) | (1 << (VfrSyn= taxParser.StorageTimeFlag - 184)) | (1 << (VfrSyntaxParser.StorageWakeUpFla= g - 184)))) !=3D 0) or _la=3D=3DVfrSyntaxParser.Number): self._errHandler.recoverInline(self) @@ -13778,27 +13788,27 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementConditionalContext(self, = self._ctx, self.state) self.enterRule(localctx, 246, self.RULE_vfrStatementConditional) try: - self.state =3D 2129 + self.state =3D 2132 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.DisableIf]: self.enterOuterAlt(localctx, 1) - self.state =3D 2125 + self.state =3D 2128 self.vfrStatementDisableIfStat() pass elif token in [VfrSyntaxParser.SuppressIf]: self.enterOuterAlt(localctx, 2) - self.state =3D 2126 + self.state =3D 2129 self.vfrStatementSuppressIfStat() pass elif token in [VfrSyntaxParser.GrayOutIf]: self.enterOuterAlt(localctx, 3) - self.state =3D 2127 + self.state =3D 2130 self.vfrStatementGrayOutIfStat() pass elif token in [VfrSyntaxParser.InconsistentIf]: self.enterOuterAlt(localctx, 4) - self.state =3D 2128 + self.state =3D 2131 self.vfrStatementInconsistentIfStat() pass else: @@ -13854,13 +13864,13 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 248, self.RULE_vfrStatementConditionalNew= ) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2131 + self.state =3D 2134 self.vfrStatementDisableIfStat() - self.state =3D 2132 + self.state =3D 2135 self.vfrStatementSuppressIfStatNew() - self.state =3D 2133 + self.state =3D 2136 self.vfrStatementGrayOutIfStatNew() - self.state =3D 2134 + self.state =3D 2137 self.vfrStatementInconsistentIfStat() except RecognitionException as re: localctx.exception =3D re @@ -13900,7 +13910,7 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 250, self.RULE_vfrStatementSuppressIfStat= ) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2136 + self.state =3D 2139 self.vfrStatementSuppressIfStatNew() except RecognitionException as re: localctx.exception =3D re @@ -13940,7 +13950,7 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 252, self.RULE_vfrStatementGrayOutIfStat) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2138 + self.state =3D 2141 self.vfrStatementGrayOutIfStatNew() except RecognitionException as re: localctx.exception =3D re @@ -13999,37 +14009,37 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementStatListContext(self, sel= f._ctx, self.state) self.enterRule(localctx, 254, self.RULE_vfrStatementStatList) try: - self.state =3D 2146 + self.state =3D 2149 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Subtitle, VfrSyntaxParser.Text, V= frSyntaxParser.Goto, VfrSyntaxParser.ResetButton]: self.enterOuterAlt(localctx, 1) - self.state =3D 2140 + self.state =3D 2143 self.vfrStatementStat() pass elif token in [VfrSyntaxParser.OneOf, VfrSyntaxParser.OrderedL= ist, VfrSyntaxParser.Date, VfrSyntaxParser.Time, VfrSyntaxParser.CheckBox, = VfrSyntaxParser.Numeric, VfrSyntaxParser.Password, VfrSyntaxParser.String, = VfrSyntaxParser.Action]: self.enterOuterAlt(localctx, 2) - self.state =3D 2141 + self.state =3D 2144 self.vfrStatementQuestions() pass elif token in [VfrSyntaxParser.GrayOutIf, VfrSyntaxParser.Supp= ressIf, VfrSyntaxParser.DisableIf, VfrSyntaxParser.InconsistentIf]: self.enterOuterAlt(localctx, 3) - self.state =3D 2142 + self.state =3D 2145 self.vfrStatementConditional() pass elif token in [VfrSyntaxParser.Label]: self.enterOuterAlt(localctx, 4) - self.state =3D 2143 + self.state =3D 2146 self.vfrStatementLabel() pass elif token in [VfrSyntaxParser.GuidOp]: self.enterOuterAlt(localctx, 5) - self.state =3D 2144 + self.state =3D 2147 self.vfrStatementExtension() pass elif token in [VfrSyntaxParser.Inventory, VfrSyntaxParser.Hidd= en, VfrSyntaxParser.Restore, VfrSyntaxParser.Save]: self.enterOuterAlt(localctx, 6) - self.state =3D 2145 + self.state =3D 2148 self.vfrStatementInvalid() pass else: @@ -14083,27 +14093,27 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementStatListOldContext(self, = self._ctx, self.state) self.enterRule(localctx, 256, self.RULE_vfrStatementStatListOld) try: - self.state =3D 2152 + self.state =3D 2155 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Subtitle, VfrSyntaxParser.Text, V= frSyntaxParser.Goto, VfrSyntaxParser.ResetButton]: self.enterOuterAlt(localctx, 1) - self.state =3D 2148 + self.state =3D 2151 self.vfrStatementStat() pass elif token in [VfrSyntaxParser.OneOf, VfrSyntaxParser.OrderedL= ist, VfrSyntaxParser.Date, VfrSyntaxParser.Time, VfrSyntaxParser.CheckBox, = VfrSyntaxParser.Numeric, VfrSyntaxParser.Password, VfrSyntaxParser.String, = VfrSyntaxParser.Action]: self.enterOuterAlt(localctx, 2) - self.state =3D 2149 + self.state =3D 2152 self.vfrStatementQuestions() pass elif token in [VfrSyntaxParser.Label]: self.enterOuterAlt(localctx, 3) - self.state =3D 2150 + self.state =3D 2153 self.vfrStatementLabel() pass elif token in [VfrSyntaxParser.Inventory, VfrSyntaxParser.Hidd= en, VfrSyntaxParser.Restore, VfrSyntaxParser.Save]: self.enterOuterAlt(localctx, 4) - self.state =3D 2151 + self.state =3D 2154 self.vfrStatementInvalid() pass else: @@ -14123,7 +14133,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_DISABLE_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_DISABLE_IF_OP) =20 def DisableIf(self): return self.getToken(VfrSyntaxParser.DisableIf, 0) @@ -14167,25 +14177,25 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2154 + self.state =3D 2157 self.match(VfrSyntaxParser.DisableIf) - self.state =3D 2155 - self.vfrStatementExpression() - self.state =3D 2156 + self.state =3D 2158 + self.vfrStatementExpression(localctx.Node) + self.state =3D 2159 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 2160 + self.state =3D 2163 self._errHandler.sync(self) _la =3D self._input.LA(1) while ((((_la - 46)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 46)) = & ((1 << (VfrSyntaxParser.OneOf - 46)) | (1 << (VfrSyntaxParser.OrderedList= - 46)) | (1 << (VfrSyntaxParser.Subtitle - 46)) | (1 << (VfrSyntaxParser.T= ext - 46)) | (1 << (VfrSyntaxParser.Date - 46)) | (1 << (VfrSyntaxParser.Ti= me - 46)) | (1 << (VfrSyntaxParser.GrayOutIf - 46)) | (1 << (VfrSyntaxParse= r.Label - 46)) | (1 << (VfrSyntaxParser.Inventory - 46)) | (1 << (VfrSyntax= Parser.CheckBox - 46)) | (1 << (VfrSyntaxParser.Numeric - 46)) | (1 << (Vfr= SyntaxParser.Password - 46)) | (1 << (VfrSyntaxParser.String - 46)) | (1 <<= (VfrSyntaxParser.SuppressIf - 46)) | (1 << (VfrSyntaxParser.DisableIf - 46= )) | (1 << (VfrSyntaxParser.Hidden - 46)) | (1 << (VfrSyntaxParser.Goto - 4= 6)))) !=3D 0) or ((((_la - 110)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 110)) = & ((1 << (VfrSyntaxParser.InconsistentIf - 110)) | (1 << (VfrSyntaxParser.R= estore - 110)) | (1 << (VfrSyntaxParser.Save - 110)) | (1 << (VfrSyntaxPars= er.ResetButton - 110)) | (1 << (VfrSyntaxParser.Action - 110)) | (1 << (Vfr= SyntaxParser.GuidOp - 110)))) !=3D 0): - self.state =3D 2157 + self.state =3D 2160 self.vfrStatementStatList() - self.state =3D 2162 + self.state =3D 2165 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2163 + self.state =3D 2166 self.match(VfrSyntaxParser.EndIf) - self.state =3D 2164 + self.state =3D 2167 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -14201,6 +14211,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser + self.Node =3D None =20 def SuppressIf(self): return self.getToken(VfrSyntaxParser.SuppressIf, 0) @@ -14250,37 +14261,37 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2166 + self.state =3D 2169 self.match(VfrSyntaxParser.SuppressIf) - self.state =3D 2179 + self.state =3D 2182 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 2167 + self.state =3D 2170 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2168 + self.state =3D 2171 self.match(VfrSyntaxParser.T__5) - self.state =3D 2169 + self.state =3D 2172 self.flagsField() - self.state =3D 2174 + self.state =3D 2177 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2170 + self.state =3D 2173 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2171 + self.state =3D 2174 self.flagsField() - self.state =3D 2176 + self.state =3D 2179 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2177 + self.state =3D 2180 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2181 - self.vfrStatementExpression() - self.state =3D 2182 + self.state =3D 2184 + self.vfrStatementExpression(localctx.Node) + self.state =3D 2185 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -14296,6 +14307,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser + self.Node =3D None =20 def GrayOutIf(self): return self.getToken(VfrSyntaxParser.GrayOutIf, 0) @@ -14345,37 +14357,37 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2184 + self.state =3D 2187 self.match(VfrSyntaxParser.GrayOutIf) - self.state =3D 2197 + self.state =3D 2200 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 2185 + self.state =3D 2188 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2186 + self.state =3D 2189 self.match(VfrSyntaxParser.T__5) - self.state =3D 2187 + self.state =3D 2190 self.flagsField() - self.state =3D 2192 + self.state =3D 2195 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2188 + self.state =3D 2191 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2189 + self.state =3D 2192 self.flagsField() - self.state =3D 2194 + self.state =3D 2197 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2195 + self.state =3D 2198 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2199 - self.vfrStatementExpression() - self.state =3D 2200 + self.state =3D 2202 + self.vfrStatementExpression(localctx.Node) + self.state =3D 2203 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -14391,7 +14403,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_SUPPRESS_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_SUPPRESS_IF_OP) =20 def SuppressIf(self): return self.getToken(VfrSyntaxParser.SuppressIf, 0) @@ -14454,51 +14466,51 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2202 + self.state =3D 2205 self.match(VfrSyntaxParser.SuppressIf) - self.state =3D 2215 + self.state =3D 2218 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 2203 + self.state =3D 2206 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2204 + self.state =3D 2207 self.match(VfrSyntaxParser.T__5) - self.state =3D 2205 + self.state =3D 2208 self.flagsField() - self.state =3D 2210 + self.state =3D 2213 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2206 + self.state =3D 2209 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2207 + self.state =3D 2210 self.flagsField() - self.state =3D 2212 + self.state =3D 2215 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2213 + self.state =3D 2216 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2217 - self.vfrStatementExpression() - self.state =3D 2218 + self.state =3D 2220 + self.vfrStatementExpression(localctx.Node) + self.state =3D 2221 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 2222 + self.state =3D 2225 self._errHandler.sync(self) _la =3D self._input.LA(1) while ((((_la - 46)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 46)) = & ((1 << (VfrSyntaxParser.OneOf - 46)) | (1 << (VfrSyntaxParser.OrderedList= - 46)) | (1 << (VfrSyntaxParser.Subtitle - 46)) | (1 << (VfrSyntaxParser.T= ext - 46)) | (1 << (VfrSyntaxParser.Date - 46)) | (1 << (VfrSyntaxParser.Ti= me - 46)) | (1 << (VfrSyntaxParser.GrayOutIf - 46)) | (1 << (VfrSyntaxParse= r.Label - 46)) | (1 << (VfrSyntaxParser.Inventory - 46)) | (1 << (VfrSyntax= Parser.CheckBox - 46)) | (1 << (VfrSyntaxParser.Numeric - 46)) | (1 << (Vfr= SyntaxParser.Password - 46)) | (1 << (VfrSyntaxParser.String - 46)) | (1 <<= (VfrSyntaxParser.SuppressIf - 46)) | (1 << (VfrSyntaxParser.DisableIf - 46= )) | (1 << (VfrSyntaxParser.Hidden - 46)) | (1 << (VfrSyntaxParser.Goto - 4= 6)))) !=3D 0) or ((((_la - 110)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 110)) = & ((1 << (VfrSyntaxParser.InconsistentIf - 110)) | (1 << (VfrSyntaxParser.R= estore - 110)) | (1 << (VfrSyntaxParser.Save - 110)) | (1 << (VfrSyntaxPars= er.ResetButton - 110)) | (1 << (VfrSyntaxParser.Action - 110)) | (1 << (Vfr= SyntaxParser.GuidOp - 110)))) !=3D 0): - self.state =3D 2219 + self.state =3D 2222 self.vfrStatementStatList() - self.state =3D 2224 + self.state =3D 2227 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2225 + self.state =3D 2228 self.match(VfrSyntaxParser.EndIf) - self.state =3D 2226 + self.state =3D 2229 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -14514,7 +14526,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_GRAY_OUT_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_GRAY_OUT_IF_OP) =20 def GrayOutIf(self): return self.getToken(VfrSyntaxParser.GrayOutIf, 0) @@ -14577,51 +14589,51 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2228 + self.state =3D 2231 self.match(VfrSyntaxParser.GrayOutIf) - self.state =3D 2241 + self.state =3D 2244 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 2229 + self.state =3D 2232 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2230 + self.state =3D 2233 self.match(VfrSyntaxParser.T__5) - self.state =3D 2231 + self.state =3D 2234 self.flagsField() - self.state =3D 2236 + self.state =3D 2239 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2232 + self.state =3D 2235 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2233 + self.state =3D 2236 self.flagsField() - self.state =3D 2238 + self.state =3D 2241 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2239 + self.state =3D 2242 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2243 - self.vfrStatementExpression() - self.state =3D 2244 + self.state =3D 2246 + self.vfrStatementExpression(localctx.Node) + self.state =3D 2247 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 2248 + self.state =3D 2251 self._errHandler.sync(self) _la =3D self._input.LA(1) while ((((_la - 46)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 46)) = & ((1 << (VfrSyntaxParser.OneOf - 46)) | (1 << (VfrSyntaxParser.OrderedList= - 46)) | (1 << (VfrSyntaxParser.Subtitle - 46)) | (1 << (VfrSyntaxParser.T= ext - 46)) | (1 << (VfrSyntaxParser.Date - 46)) | (1 << (VfrSyntaxParser.Ti= me - 46)) | (1 << (VfrSyntaxParser.GrayOutIf - 46)) | (1 << (VfrSyntaxParse= r.Label - 46)) | (1 << (VfrSyntaxParser.Inventory - 46)) | (1 << (VfrSyntax= Parser.CheckBox - 46)) | (1 << (VfrSyntaxParser.Numeric - 46)) | (1 << (Vfr= SyntaxParser.Password - 46)) | (1 << (VfrSyntaxParser.String - 46)) | (1 <<= (VfrSyntaxParser.SuppressIf - 46)) | (1 << (VfrSyntaxParser.DisableIf - 46= )) | (1 << (VfrSyntaxParser.Hidden - 46)) | (1 << (VfrSyntaxParser.Goto - 4= 6)))) !=3D 0) or ((((_la - 110)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 110)) = & ((1 << (VfrSyntaxParser.InconsistentIf - 110)) | (1 << (VfrSyntaxParser.R= estore - 110)) | (1 << (VfrSyntaxParser.Save - 110)) | (1 << (VfrSyntaxPars= er.ResetButton - 110)) | (1 << (VfrSyntaxParser.Action - 110)) | (1 << (Vfr= SyntaxParser.GuidOp - 110)))) !=3D 0): - self.state =3D 2245 + self.state =3D 2248 self.vfrStatementStatList() - self.state =3D 2250 + self.state =3D 2253 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2251 + self.state =3D 2254 self.match(VfrSyntaxParser.EndIf) - self.state =3D 2252 + self.state =3D 2255 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -14637,7 +14649,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_INCONSISTENT_IF_OP) + self.Node =3D IfrTreeNode(EFI_IFR_INCONSISTENT_IF_OP) =20 def InconsistentIf(self): return self.getToken(VfrSyntaxParser.InconsistentIf, 0) @@ -14708,53 +14720,53 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2254 + self.state =3D 2257 self.match(VfrSyntaxParser.InconsistentIf) - self.state =3D 2255 + self.state =3D 2258 self.match(VfrSyntaxParser.Prompt) - self.state =3D 2256 + self.state =3D 2259 self.match(VfrSyntaxParser.T__5) - self.state =3D 2257 + self.state =3D 2260 self.match(VfrSyntaxParser.StringToken) - self.state =3D 2258 + self.state =3D 2261 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2259 + self.state =3D 2262 self.match(VfrSyntaxParser.Number) - self.state =3D 2260 + self.state =3D 2263 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 2261 + self.state =3D 2264 self.match(VfrSyntaxParser.Comma) - self.state =3D 2274 + self.state =3D 2277 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.FLAGS: - self.state =3D 2262 + self.state =3D 2265 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2263 + self.state =3D 2266 self.match(VfrSyntaxParser.T__5) - self.state =3D 2264 + self.state =3D 2267 self.flagsField() - self.state =3D 2269 + self.state =3D 2272 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2265 + self.state =3D 2268 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2266 + self.state =3D 2269 self.flagsField() - self.state =3D 2271 + self.state =3D 2274 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2272 + self.state =3D 2275 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2276 - self.vfrStatementExpression() - self.state =3D 2277 + self.state =3D 2279 + self.vfrStatementExpression(localctx.Node) + self.state =3D 2280 self.match(VfrSyntaxParser.EndIf) - self.state =3D 2278 + self.state =3D 2281 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -14800,22 +14812,22 @@ class VfrSyntaxParser ( Parser ): localctx =3D VfrSyntaxParser.VfrStatementInvalidContext(self, self= ._ctx, self.state) self.enterRule(localctx, 270, self.RULE_vfrStatementInvalid) try: - self.state =3D 2283 + self.state =3D 2286 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Hidden]: self.enterOuterAlt(localctx, 1) - self.state =3D 2280 + self.state =3D 2283 self.vfrStatementInvalidHidden() pass elif token in [VfrSyntaxParser.Inventory]: self.enterOuterAlt(localctx, 2) - self.state =3D 2281 + self.state =3D 2284 self.vfrStatementInvalidInventory() pass elif token in [VfrSyntaxParser.Restore, VfrSyntaxParser.Save]: self.enterOuterAlt(localctx, 3) - self.state =3D 2282 + self.state =3D 2285 self.vfrStatementInvalidSaveRestoreDefaults() pass else: @@ -14875,23 +14887,23 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 272, self.RULE_vfrStatementInvalidHidden) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2285 + self.state =3D 2288 self.match(VfrSyntaxParser.Hidden) - self.state =3D 2286 + self.state =3D 2289 self.match(VfrSyntaxParser.Value) - self.state =3D 2287 + self.state =3D 2290 self.match(VfrSyntaxParser.T__5) - self.state =3D 2288 + self.state =3D 2291 self.match(VfrSyntaxParser.Number) - self.state =3D 2289 + self.state =3D 2292 self.match(VfrSyntaxParser.Comma) - self.state =3D 2290 + self.state =3D 2293 self.match(VfrSyntaxParser.Key) - self.state =3D 2291 + self.state =3D 2294 self.match(VfrSyntaxParser.T__5) - self.state =3D 2292 + self.state =3D 2295 self.match(VfrSyntaxParser.Number) - self.state =3D 2293 + self.state =3D 2296 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -14972,55 +14984,55 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2295 + self.state =3D 2298 self.match(VfrSyntaxParser.Inventory) - self.state =3D 2296 + self.state =3D 2299 self.match(VfrSyntaxParser.Help) - self.state =3D 2297 + self.state =3D 2300 self.match(VfrSyntaxParser.T__5) - self.state =3D 2298 + self.state =3D 2301 self.match(VfrSyntaxParser.StringToken) - self.state =3D 2299 + self.state =3D 2302 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2300 + self.state =3D 2303 self.match(VfrSyntaxParser.Number) - self.state =3D 2301 + self.state =3D 2304 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 2302 + self.state =3D 2305 self.match(VfrSyntaxParser.Comma) - self.state =3D 2303 + self.state =3D 2306 self.match(VfrSyntaxParser.Text) - self.state =3D 2304 + self.state =3D 2307 self.match(VfrSyntaxParser.T__5) - self.state =3D 2305 + self.state =3D 2308 self.match(VfrSyntaxParser.StringToken) - self.state =3D 2306 + self.state =3D 2309 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2307 + self.state =3D 2310 self.match(VfrSyntaxParser.Number) - self.state =3D 2308 + self.state =3D 2311 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 2309 + self.state =3D 2312 self.match(VfrSyntaxParser.Comma) - self.state =3D 2316 + self.state =3D 2319 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Text: - self.state =3D 2310 + self.state =3D 2313 self.match(VfrSyntaxParser.Text) - self.state =3D 2311 + self.state =3D 2314 self.match(VfrSyntaxParser.T__5) - self.state =3D 2312 + self.state =3D 2315 self.match(VfrSyntaxParser.StringToken) - self.state =3D 2313 + self.state =3D 2316 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2314 + self.state =3D 2317 self.match(VfrSyntaxParser.Number) - self.state =3D 2315 + self.state =3D 2318 self.match(VfrSyntaxParser.CloseParen) =20 =20 - self.state =3D 2318 + self.state =3D 2321 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -15126,92 +15138,92 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2320 + self.state =3D 2323 _la =3D self._input.LA(1) if not(_la=3D=3DVfrSyntaxParser.Restore or _la=3D=3DVfrSyntaxP= arser.Save): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state =3D 2321 + self.state =3D 2324 self.match(VfrSyntaxParser.Defaults) - self.state =3D 2322 + self.state =3D 2325 self.match(VfrSyntaxParser.Comma) - self.state =3D 2323 + self.state =3D 2326 self.match(VfrSyntaxParser.FormId) - self.state =3D 2324 + self.state =3D 2327 self.match(VfrSyntaxParser.T__5) - self.state =3D 2325 + self.state =3D 2328 self.match(VfrSyntaxParser.Number) - self.state =3D 2326 + self.state =3D 2329 self.match(VfrSyntaxParser.Comma) - self.state =3D 2327 + self.state =3D 2330 self.match(VfrSyntaxParser.Prompt) - self.state =3D 2328 + self.state =3D 2331 self.match(VfrSyntaxParser.T__5) - self.state =3D 2329 + self.state =3D 2332 self.match(VfrSyntaxParser.StringToken) - self.state =3D 2330 + self.state =3D 2333 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2331 + self.state =3D 2334 self.match(VfrSyntaxParser.Number) - self.state =3D 2332 + self.state =3D 2335 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 2333 + self.state =3D 2336 self.match(VfrSyntaxParser.Comma) - self.state =3D 2334 + self.state =3D 2337 self.match(VfrSyntaxParser.Help) - self.state =3D 2335 + self.state =3D 2338 self.match(VfrSyntaxParser.T__5) - self.state =3D 2336 + self.state =3D 2339 self.match(VfrSyntaxParser.StringToken) - self.state =3D 2337 + self.state =3D 2340 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2338 + self.state =3D 2341 self.match(VfrSyntaxParser.Number) - self.state =3D 2339 + self.state =3D 2342 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 2351 + self.state =3D 2354 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,181,self._ctx= ) + la_ =3D self._interp.adaptivePredict(self._input,182,self._ctx= ) if la_ =3D=3D 1: - self.state =3D 2340 + self.state =3D 2343 self.match(VfrSyntaxParser.Comma) - self.state =3D 2341 + self.state =3D 2344 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2342 + self.state =3D 2345 self.match(VfrSyntaxParser.T__5) - self.state =3D 2343 + self.state =3D 2346 self.flagsField() - self.state =3D 2348 + self.state =3D 2351 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2344 + self.state =3D 2347 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2345 + self.state =3D 2348 self.flagsField() - self.state =3D 2350 + self.state =3D 2353 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 =20 =20 - self.state =3D 2357 + self.state =3D 2360 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 2353 + self.state =3D 2356 self.match(VfrSyntaxParser.Comma) - self.state =3D 2354 + self.state =3D 2357 self.match(VfrSyntaxParser.Key) - self.state =3D 2355 + self.state =3D 2358 self.match(VfrSyntaxParser.T__5) - self.state =3D 2356 + self.state =3D 2359 self.match(VfrSyntaxParser.Number) =20 =20 - self.state =3D 2359 + self.state =3D 2362 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -15227,7 +15239,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_GUID_OP) + self.Node =3D IfrTreeNode(EFI_IFR_GUID_OP) =20 def Label(self): return self.getToken(VfrSyntaxParser.Label, 0) @@ -15256,11 +15268,11 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 278, self.RULE_vfrStatementLabel) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2361 + self.state =3D 2364 self.match(VfrSyntaxParser.Label) - self.state =3D 2362 + self.state =3D 2365 self.match(VfrSyntaxParser.Number) - self.state =3D 2363 + self.state =3D 2366 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -15276,7 +15288,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_GUID_OP) + self.Node =3D IfrTreeNode(EFI_IFR_GUID_OP) =20 def Banner(self): return self.getToken(VfrSyntaxParser.Banner, 0) @@ -15345,60 +15357,60 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2365 + self.state =3D 2368 self.match(VfrSyntaxParser.Banner) - self.state =3D 2367 + self.state =3D 2370 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 2366 + self.state =3D 2369 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2369 + self.state =3D 2372 self.match(VfrSyntaxParser.Title) - self.state =3D 2370 + self.state =3D 2373 self.match(VfrSyntaxParser.T__5) - self.state =3D 2371 + self.state =3D 2374 self.match(VfrSyntaxParser.StringToken) - self.state =3D 2372 + self.state =3D 2375 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2373 + self.state =3D 2376 self.match(VfrSyntaxParser.Number) - self.state =3D 2374 + self.state =3D 2377 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 2375 + self.state =3D 2378 self.match(VfrSyntaxParser.Comma) - self.state =3D 2386 + self.state =3D 2389 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Line]: - self.state =3D 2376 + self.state =3D 2379 self.match(VfrSyntaxParser.Line) - self.state =3D 2377 + self.state =3D 2380 self.match(VfrSyntaxParser.Number) - self.state =3D 2378 + self.state =3D 2381 self.match(VfrSyntaxParser.Comma) - self.state =3D 2379 + self.state =3D 2382 self.match(VfrSyntaxParser.Align) - self.state =3D 2380 + self.state =3D 2383 _la =3D self._input.LA(1) if not(((((_la - 136)) & ~0x3f) =3D=3D 0 and ((1 << (_la -= 136)) & ((1 << (VfrSyntaxParser.Left - 136)) | (1 << (VfrSyntaxParser.Righ= t - 136)) | (1 << (VfrSyntaxParser.Center - 136)))) !=3D 0)): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state =3D 2381 + self.state =3D 2384 self.match(VfrSyntaxParser.Semicolon) pass elif token in [VfrSyntaxParser.Timeout]: - self.state =3D 2382 + self.state =3D 2385 self.match(VfrSyntaxParser.Timeout) - self.state =3D 2383 + self.state =3D 2386 self.match(VfrSyntaxParser.T__5) - self.state =3D 2384 + self.state =3D 2387 self.match(VfrSyntaxParser.Number) - self.state =3D 2385 + self.state =3D 2388 self.match(VfrSyntaxParser.Semicolon) pass else: @@ -15418,8 +15430,8 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_GUID_OP) - self.DataBuff =3D None + self.Node =3D IfrTreeNode(EFI_IFR_GUID_OP) + self.Buffer =3D None self.Size =3D 0 self.TypeName =3D '' self.TypeSize =3D 0 @@ -15524,183 +15536,183 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2388 + self.state =3D 2391 self.match(VfrSyntaxParser.GuidOp) - self.state =3D 2389 + self.state =3D 2392 self.match(VfrSyntaxParser.Uuid) - self.state =3D 2390 + self.state =3D 2393 self.match(VfrSyntaxParser.T__5) - self.state =3D 2391 + self.state =3D 2394 self.guidDefinition() - self.state =3D 2463 + self.state =3D 2466 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,197,self._ctx= ) + la_ =3D self._interp.adaptivePredict(self._input,198,self._ctx= ) if la_ =3D=3D 1: - self.state =3D 2392 + self.state =3D 2395 self.match(VfrSyntaxParser.Comma) - self.state =3D 2393 + self.state =3D 2396 localctx.D =3D self.match(VfrSyntaxParser.DataType) - self.state =3D 2394 + self.state =3D 2397 self.match(VfrSyntaxParser.T__5) - self.state =3D 2455 + self.state =3D 2458 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Uint64]: - self.state =3D 2395 + self.state =3D 2398 self.match(VfrSyntaxParser.Uint64) - self.state =3D 2399 + self.state =3D 2402 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2396 + self.state =3D 2399 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2397 + self.state =3D 2400 self.match(VfrSyntaxParser.Number) - self.state =3D 2398 + self.state =3D 2401 self.match(VfrSyntaxParser.CloseBracket) =20 =20 pass elif token in [VfrSyntaxParser.Uint32]: - self.state =3D 2401 + self.state =3D 2404 self.match(VfrSyntaxParser.Uint32) - self.state =3D 2405 + self.state =3D 2408 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2402 + self.state =3D 2405 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2403 + self.state =3D 2406 self.match(VfrSyntaxParser.Number) - self.state =3D 2404 + self.state =3D 2407 self.match(VfrSyntaxParser.CloseBracket) =20 =20 pass elif token in [VfrSyntaxParser.Uint16]: - self.state =3D 2407 + self.state =3D 2410 self.match(VfrSyntaxParser.Uint16) - self.state =3D 2411 + self.state =3D 2414 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2408 + self.state =3D 2411 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2409 + self.state =3D 2412 self.match(VfrSyntaxParser.Number) - self.state =3D 2410 + self.state =3D 2413 self.match(VfrSyntaxParser.CloseBracket) =20 =20 pass elif token in [VfrSyntaxParser.Uint8]: - self.state =3D 2413 + self.state =3D 2416 self.match(VfrSyntaxParser.Uint8) - self.state =3D 2417 + self.state =3D 2420 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2414 + self.state =3D 2417 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2415 + self.state =3D 2418 self.match(VfrSyntaxParser.Number) - self.state =3D 2416 + self.state =3D 2419 self.match(VfrSyntaxParser.CloseBracket) =20 =20 pass elif token in [VfrSyntaxParser.Boolean]: - self.state =3D 2419 + self.state =3D 2422 self.match(VfrSyntaxParser.Boolean) - self.state =3D 2423 + self.state =3D 2426 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2420 + self.state =3D 2423 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2421 + self.state =3D 2424 self.match(VfrSyntaxParser.Number) - self.state =3D 2422 + self.state =3D 2425 self.match(VfrSyntaxParser.CloseBracket) =20 =20 pass elif token in [VfrSyntaxParser.EFI_STRING_ID]: - self.state =3D 2425 + self.state =3D 2428 self.match(VfrSyntaxParser.EFI_STRING_ID) - self.state =3D 2429 + self.state =3D 2432 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2426 + self.state =3D 2429 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2427 + self.state =3D 2430 self.match(VfrSyntaxParser.Number) - self.state =3D 2428 + self.state =3D 2431 self.match(VfrSyntaxParser.CloseBracket) =20 =20 pass elif token in [VfrSyntaxParser.EFI_HII_DATE]: - self.state =3D 2431 + self.state =3D 2434 self.match(VfrSyntaxParser.EFI_HII_DATE) - self.state =3D 2435 + self.state =3D 2438 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2432 + self.state =3D 2435 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2433 + self.state =3D 2436 self.match(VfrSyntaxParser.Number) - self.state =3D 2434 + self.state =3D 2437 self.match(VfrSyntaxParser.CloseBracket) =20 =20 pass elif token in [VfrSyntaxParser.EFI_HII_TIME]: - self.state =3D 2437 + self.state =3D 2440 self.match(VfrSyntaxParser.EFI_HII_TIME) - self.state =3D 2441 + self.state =3D 2444 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2438 + self.state =3D 2441 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2439 + self.state =3D 2442 self.match(VfrSyntaxParser.Number) - self.state =3D 2440 + self.state =3D 2443 self.match(VfrSyntaxParser.CloseBracket) =20 =20 pass elif token in [VfrSyntaxParser.EFI_HII_REF]: - self.state =3D 2443 + self.state =3D 2446 self.match(VfrSyntaxParser.EFI_HII_REF) - self.state =3D 2447 + self.state =3D 2450 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2444 + self.state =3D 2447 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2445 + self.state =3D 2448 self.match(VfrSyntaxParser.Number) - self.state =3D 2446 + self.state =3D 2449 self.match(VfrSyntaxParser.CloseBracket) =20 =20 pass elif token in [VfrSyntaxParser.StringIdentifier]: - self.state =3D 2449 + self.state =3D 2452 self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 2453 + self.state =3D 2456 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2450 + self.state =3D 2453 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2451 + self.state =3D 2454 self.match(VfrSyntaxParser.Number) - self.state =3D 2452 + self.state =3D 2455 self.match(VfrSyntaxParser.CloseBracket) =20 =20 @@ -15708,40 +15720,40 @@ class VfrSyntaxParser ( Parser ): else: raise NoViableAltException(self) =20 - self.state =3D 2460 + self.state =3D 2463 self._errHandler.sync(self) - _alt =3D self._interp.adaptivePredict(self._input,196,self= ._ctx) + _alt =3D self._interp.adaptivePredict(self._input,197,self= ._ctx) while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER: if _alt=3D=3D1: - self.state =3D 2457 - self.vfrExtensionData(localctx.DataBuff) - self.state =3D 2462 + self.state =3D 2460 + self.vfrExtensionData() + self.state =3D 2465 self._errHandler.sync(self) - _alt =3D self._interp.adaptivePredict(self._input,196,= self._ctx) + _alt =3D self._interp.adaptivePredict(self._input,197,= self._ctx) =20 =20 =20 - self.state =3D 2473 + self.state =3D 2476 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Comma: - self.state =3D 2465 + self.state =3D 2468 self.match(VfrSyntaxParser.Comma) - self.state =3D 2469 + self.state =3D 2472 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.GuidOp: - self.state =3D 2466 + self.state =3D 2469 self.vfrStatementExtension() - self.state =3D 2471 + self.state =3D 2474 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2472 + self.state =3D 2475 self.match(VfrSyntaxParser.EndGuidOp) =20 =20 - self.state =3D 2475 + self.state =3D 2478 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -15754,13 +15766,14 @@ class VfrSyntaxParser ( Parser ): =20 class VfrExtensionDataContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, DataBuff=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.DataBuff =3D None - self.IsStruct =3D None + self.TFName =3D '' + self.FName =3D '' + self.TFValue =3D None + self.I =3D None # Token self.N =3D None # Token - self.DataBuff =3D DataBuff =20 def Comma(self): return self.getToken(VfrSyntaxParser.Comma, 0) @@ -15805,44 +15818,44 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def vfrExtensionData(self, DataBuff): + def vfrExtensionData(self): =20 - localctx =3D VfrSyntaxParser.VfrExtensionDataContext(self, self._c= tx, self.state, DataBuff) + localctx =3D VfrSyntaxParser.VfrExtensionDataContext(self, self._c= tx, self.state) self.enterRule(localctx, 284, self.RULE_vfrExtensionData) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2477 + self.state =3D 2480 self.match(VfrSyntaxParser.Comma) - self.state =3D 2478 + self.state =3D 2481 self.match(VfrSyntaxParser.Data) - self.state =3D 2482 + self.state =3D 2485 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2479 + self.state =3D 2482 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2480 - self.match(VfrSyntaxParser.Number) - self.state =3D 2481 + self.state =3D 2483 + localctx.I =3D self.match(VfrSyntaxParser.Number) + self.state =3D 2484 self.match(VfrSyntaxParser.CloseBracket) =20 =20 - self.state =3D 2488 + self.state =3D 2491 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.Dot: - self.state =3D 2484 + self.state =3D 2487 self.match(VfrSyntaxParser.Dot) - self.state =3D 2485 + self.state =3D 2488 self.arrayName() - self.state =3D 2490 + self.state =3D 2493 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2491 + self.state =3D 2494 self.match(VfrSyntaxParser.T__5) - self.state =3D 2492 + self.state =3D 2495 localctx.N =3D self.match(VfrSyntaxParser.Number) except RecognitionException as re: localctx.exception =3D re @@ -15885,9 +15898,9 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 286, self.RULE_vfrStatementModal) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2494 + self.state =3D 2497 self.vfrModalTag() - self.state =3D 2495 + self.state =3D 2498 self.match(VfrSyntaxParser.Semicolon) except RecognitionException as re: localctx.exception =3D re @@ -15903,7 +15916,7 @@ class VfrSyntaxParser ( Parser ): def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): super().__init__(parent, invokingState) self.parser =3D parser - self.Node =3D VfrTreeNode(EFI_IFR_MODAL_TAG_OP) + self.Node =3D IfrTreeNode(EFI_IFR_MODAL_TAG_OP) =20 def Modal(self): return self.getToken(VfrSyntaxParser.Modal, 0) @@ -15926,7 +15939,7 @@ class VfrSyntaxParser ( Parser ): self.enterRule(localctx, 288, self.RULE_vfrModalTag) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2497 + self.state =3D 2500 self.match(VfrSyntaxParser.Modal) except RecognitionException as re: localctx.exception =3D re @@ -15939,10 +15952,14 @@ class VfrSyntaxParser ( Parser ): =20 class VfrStatementExpressionContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, ParentNode=3DNone): super().__init__(parent, invokingState) self.parser =3D parser + self.ParentNode =3D None self.ExpInfo =3D ExpressionInfo() + self.Nodes =3D [] + self.L =3D None # Token + self.ParentNode =3D ParentNode =20 def andTerm(self, i:int=3DNone): if i is None: @@ -15969,24 +15986,24 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def vfrStatementExpression(self): + def vfrStatementExpression(self, ParentNode): =20 - localctx =3D VfrSyntaxParser.VfrStatementExpressionContext(self, s= elf._ctx, self.state) + localctx =3D VfrSyntaxParser.VfrStatementExpressionContext(self, s= elf._ctx, self.state, ParentNode) self.enterRule(localctx, 290, self.RULE_vfrStatementExpression) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2499 + self.state =3D 2502 self.andTerm(localctx.ExpInfo) - self.state =3D 2504 + self.state =3D 2507 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.OR: - self.state =3D 2500 - self.match(VfrSyntaxParser.OR) - self.state =3D 2501 + self.state =3D 2503 + localctx.L =3D self.match(VfrSyntaxParser.OR) + self.state =3D 2504 self.andTerm(localctx.ExpInfo) - self.state =3D 2506 + self.state =3D 2509 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -16001,10 +16018,13 @@ class VfrSyntaxParser ( Parser ): =20 class VfrStatementExpressionSubContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, ParentNodes=3DNone): super().__init__(parent, invokingState) self.parser =3D parser + self.ParentNodes =3D None self.ExpInfo =3D ExpressionInfo() + self.Nodes =3D [] + self.ParentNodes =3D ParentNodes =20 def andTerm(self, i:int=3DNone): if i is None: @@ -16031,24 +16051,24 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def vfrStatementExpressionSub(self): + def vfrStatementExpressionSub(self, ParentNodes): =20 - localctx =3D VfrSyntaxParser.VfrStatementExpressionSubContext(self= , self._ctx, self.state) + localctx =3D VfrSyntaxParser.VfrStatementExpressionSubContext(self= , self._ctx, self.state, ParentNodes) self.enterRule(localctx, 292, self.RULE_vfrStatementExpressionSub) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2507 + self.state =3D 2510 self.andTerm(localctx.ExpInfo) - self.state =3D 2512 + self.state =3D 2515 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.OR: - self.state =3D 2508 + self.state =3D 2511 self.match(VfrSyntaxParser.OR) - self.state =3D 2509 + self.state =3D 2512 self.andTerm(localctx.ExpInfo) - self.state =3D 2514 + self.state =3D 2517 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -16067,7 +16087,9 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CIfrAndList =3D [] + self.Nodes =3D [] + self.Line =3D None + self.L =3D None # Token self.ExpInfo =3D ExpInfo =20 def bitwiseorTerm(self, i:int=3DNone): @@ -16102,17 +16124,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2515 + self.state =3D 2518 self.bitwiseorTerm(ExpInfo) - self.state =3D 2520 + self.state =3D 2523 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.AND: - self.state =3D 2516 - self.match(VfrSyntaxParser.AND) - self.state =3D 2517 + self.state =3D 2519 + localctx.L =3D self.match(VfrSyntaxParser.AND) + self.state =3D 2520 self.bitwiseorTerm(ExpInfo) - self.state =3D 2522 + self.state =3D 2525 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -16131,7 +16153,9 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CIfrBitWiseOrList =3D [] + self.Nodes =3D [] + self.Line =3D None + self.L =3D None # Token self.ExpInfo =3D ExpInfo =20 def bitwiseandTerm(self, i:int=3DNone): @@ -16166,17 +16190,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2523 + self.state =3D 2526 self.bitwiseandTerm(ExpInfo) - self.state =3D 2528 + self.state =3D 2531 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2524 - self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2525 + self.state =3D 2527 + localctx.L =3D self.match(VfrSyntaxParser.BitWiseOr) + self.state =3D 2528 self.bitwiseandTerm(ExpInfo) - self.state =3D 2530 + self.state =3D 2533 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -16195,7 +16219,9 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CIfrBitWiseAndList =3D [] + self.Nodes =3D [] + self.Line =3D None + self.L =3D None # Token self.ExpInfo =3D ExpInfo =20 def equalTerm(self, i:int=3DNone): @@ -16230,17 +16256,17 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2531 + self.state =3D 2534 self.equalTerm(ExpInfo) - self.state =3D 2536 + self.state =3D 2539 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseAnd: - self.state =3D 2532 - self.match(VfrSyntaxParser.BitWiseAnd) - self.state =3D 2533 + self.state =3D 2535 + localctx.L =3D self.match(VfrSyntaxParser.BitWiseAnd) + self.state =3D 2536 self.equalTerm(ExpInfo) - self.state =3D 2538 + self.state =3D 2541 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -16259,8 +16285,8 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CIfrEqualList =3D [] - self.CIfrNotEqualList =3D [] + self.Nodes =3D [] + self.Line =3D None self.ExpInfo =3D ExpInfo =20 def compareTerm(self): @@ -16293,15 +16319,15 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2539 - self.compareTerm(localctx.ExpInfo) - self.state =3D 2543 + self.state =3D 2542 + self.compareTerm(ExpInfo) + self.state =3D 2546 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.Equal or _la=3D=3DVfrSyntaxPars= er.NotEqual: - self.state =3D 2540 - self.equalTermSupplementary(localctx.CIfrEqualList, localc= tx.CIfrNotEqualList, ExpInfo) - self.state =3D 2545 + self.state =3D 2543 + self.equalTermSupplementary(ExpInfo) + self.state =3D 2548 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -16316,14 +16342,11 @@ class VfrSyntaxParser ( Parser ): =20 class EqualTermSupplementaryContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, CIfrEqualList=3DNone, CIfrNotEqualList=3DNone, ExpInfo=3D= None): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, ExpInfo=3DNone): super().__init__(parent, invokingState) self.parser =3D parser - self.CIfrEqualList =3D None - self.CIfrNotEqualList =3D None self.ExpInfo =3D None - self.CIfrEqualList =3D CIfrEqualList - self.CIfrNotEqualList =3D CIfrNotEqualList + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 =20 @@ -16333,9 +16356,8 @@ class VfrSyntaxParser ( Parser ): =20 def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) - self.CIfrEqualList =3D ctx.CIfrEqualList - self.CIfrNotEqualList =3D ctx.CIfrNotEqualList self.ExpInfo =3D ctx.ExpInfo + self.Nodes =3D ctx.Nodes =20 =20 =20 @@ -16378,28 +16400,28 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def equalTermSupplementary(self, CIfrEqualList, CIfrNotEqualList, ExpI= nfo): + def equalTermSupplementary(self, ExpInfo): =20 - localctx =3D VfrSyntaxParser.EqualTermSupplementaryContext(self, s= elf._ctx, self.state, CIfrEqualList, CIfrNotEqualList, ExpInfo) + localctx =3D VfrSyntaxParser.EqualTermSupplementaryContext(self, s= elf._ctx, self.state, ExpInfo) self.enterRule(localctx, 302, self.RULE_equalTermSupplementary) try: - self.state =3D 2550 + self.state =3D 2553 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Equal]: localctx =3D VfrSyntaxParser.EqualTermEqualRuleContext(sel= f, localctx) self.enterOuterAlt(localctx, 1) - self.state =3D 2546 + self.state =3D 2549 self.match(VfrSyntaxParser.Equal) - self.state =3D 2547 + self.state =3D 2550 self.compareTerm(ExpInfo) pass elif token in [VfrSyntaxParser.NotEqual]: localctx =3D VfrSyntaxParser.EqualTermNotEqualRuleContext(= self, localctx) self.enterOuterAlt(localctx, 2) - self.state =3D 2548 + self.state =3D 2551 self.match(VfrSyntaxParser.NotEqual) - self.state =3D 2549 + self.state =3D 2552 self.compareTerm(ExpInfo) pass else: @@ -16420,10 +16442,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CIfrLessThanList =3D [] - self.CIfrLessEqualList =3D [] - self.CIfrGreaterThanList =3D [] - self.CIfrGreaterEqualList =3D [] + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def shiftTerm(self): @@ -16456,15 +16475,15 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2552 + self.state =3D 2555 self.shiftTerm(ExpInfo) - self.state =3D 2556 + self.state =3D 2559 self._errHandler.sync(self) _la =3D self._input.LA(1) while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << VfrSy= ntaxParser.LessEqual) | (1 << VfrSyntaxParser.Less) | (1 << VfrSyntaxParser= .GreaterEqual) | (1 << VfrSyntaxParser.Greater))) !=3D 0): - self.state =3D 2553 - self.compareTermSupplementary(localctx.CIfrLessThanList, l= ocalctx.CIfrLessEqualList, localctx.CIfrGreaterThanList, localctx.CIfrGreat= erEqualList, ExpInfo) - self.state =3D 2558 + self.state =3D 2556 + self.compareTermSupplementary(ExpInfo) + self.state =3D 2561 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -16479,18 +16498,11 @@ class VfrSyntaxParser ( Parser ): =20 class CompareTermSupplementaryContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, CIfrLessThanList=3DNone, CIfrLessEqualList=3DNone, CIfrGr= eaterThanList=3DNone, CIfrGreaterEqualList=3DNone, ExpInfo=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, ExpInfo=3DNone): super().__init__(parent, invokingState) self.parser =3D parser - self.CIfrLessThanList =3D None - self.CIfrLessEqualList =3D None - self.CIfrGreaterThanList =3D None - self.CIfrGreaterEqualList =3D None self.ExpInfo =3D None - self.CIfrLessThanList =3D CIfrLessThanList - self.CIfrLessEqualList =3D CIfrLessEqualList - self.CIfrGreaterThanList =3D CIfrGreaterThanList - self.CIfrGreaterEqualList =3D CIfrGreaterEqualList + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 =20 @@ -16500,11 +16512,8 @@ class VfrSyntaxParser ( Parser ): =20 def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) - self.CIfrLessThanList =3D ctx.CIfrLessThanList - self.CIfrLessEqualList =3D ctx.CIfrLessEqualList - self.CIfrGreaterThanList =3D ctx.CIfrGreaterThanList - self.CIfrGreaterEqualList =3D ctx.CIfrGreaterEqualList self.ExpInfo =3D ctx.ExpInfo + self.Nodes =3D ctx.Nodes =20 =20 =20 @@ -16585,44 +16594,44 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def compareTermSupplementary(self, CIfrLessThanList, CIfrLessEqualList= , CIfrGreaterThanList, CIfrGreaterEqualList, ExpInfo): + def compareTermSupplementary(self, ExpInfo): =20 - localctx =3D VfrSyntaxParser.CompareTermSupplementaryContext(self,= self._ctx, self.state, CIfrLessThanList, CIfrLessEqualList, CIfrGreaterTha= nList, CIfrGreaterEqualList, ExpInfo) + localctx =3D VfrSyntaxParser.CompareTermSupplementaryContext(self,= self._ctx, self.state, ExpInfo) self.enterRule(localctx, 306, self.RULE_compareTermSupplementary) try: - self.state =3D 2567 + self.state =3D 2570 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Less]: localctx =3D VfrSyntaxParser.CompareTermLessRuleContext(se= lf, localctx) self.enterOuterAlt(localctx, 1) - self.state =3D 2559 + self.state =3D 2562 self.match(VfrSyntaxParser.Less) - self.state =3D 2560 + self.state =3D 2563 self.shiftTerm(ExpInfo) pass elif token in [VfrSyntaxParser.LessEqual]: localctx =3D VfrSyntaxParser.CompareTermLessEqualRuleConte= xt(self, localctx) self.enterOuterAlt(localctx, 2) - self.state =3D 2561 + self.state =3D 2564 self.match(VfrSyntaxParser.LessEqual) - self.state =3D 2562 + self.state =3D 2565 self.shiftTerm(ExpInfo) pass elif token in [VfrSyntaxParser.Greater]: localctx =3D VfrSyntaxParser.CompareTermGreaterRuleContext= (self, localctx) self.enterOuterAlt(localctx, 3) - self.state =3D 2563 + self.state =3D 2566 self.match(VfrSyntaxParser.Greater) - self.state =3D 2564 + self.state =3D 2567 self.shiftTerm(ExpInfo) pass elif token in [VfrSyntaxParser.GreaterEqual]: localctx =3D VfrSyntaxParser.CompareTermGreaterEqualRuleCo= ntext(self, localctx) self.enterOuterAlt(localctx, 4) - self.state =3D 2565 + self.state =3D 2568 self.match(VfrSyntaxParser.GreaterEqual) - self.state =3D 2566 + self.state =3D 2569 self.shiftTerm(ExpInfo) pass else: @@ -16643,8 +16652,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CIfrShiftLeftList =3D [] - self.CIfrShiftRightList =3D [] + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def addMinusTerm(self): @@ -16677,15 +16685,15 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2569 + self.state =3D 2572 self.addMinusTerm(ExpInfo) - self.state =3D 2573 + self.state =3D 2576 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.T__9 or _la=3D=3DVfrSyntaxParse= r.T__10: - self.state =3D 2570 - self.shiftTermSupplementary(localctx.CIfrShiftLeftList, lo= calctx.CIfrShiftRightList, ExpInfo) - self.state =3D 2575 + self.state =3D 2573 + self.shiftTermSupplementary(ExpInfo) + self.state =3D 2578 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -16700,14 +16708,11 @@ class VfrSyntaxParser ( Parser ): =20 class ShiftTermSupplementaryContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, CIfrShiftLeftList=3DNone, CIfrShiftRightList=3DNone, ExpI= nfo=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, ExpInfo=3DNone): super().__init__(parent, invokingState) self.parser =3D parser - self.CIfrShiftLeftList =3D None - self.CIfrShiftRightList =3D None self.ExpInfo =3D None - self.CIfrShiftLeftList =3D CIfrShiftLeftList - self.CIfrShiftRightList =3D CIfrShiftRightList + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 =20 @@ -16717,9 +16722,8 @@ class VfrSyntaxParser ( Parser ): =20 def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) - self.CIfrShiftLeftList =3D ctx.CIfrShiftLeftList - self.CIfrShiftRightList =3D ctx.CIfrShiftRightList self.ExpInfo =3D ctx.ExpInfo + self.Nodes =3D ctx.Nodes =20 =20 =20 @@ -16758,28 +16762,28 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def shiftTermSupplementary(self, CIfrShiftLeftList, CIfrShiftRightList= , ExpInfo): + def shiftTermSupplementary(self, ExpInfo): =20 - localctx =3D VfrSyntaxParser.ShiftTermSupplementaryContext(self, s= elf._ctx, self.state, CIfrShiftLeftList, CIfrShiftRightList, ExpInfo) + localctx =3D VfrSyntaxParser.ShiftTermSupplementaryContext(self, s= elf._ctx, self.state, ExpInfo) self.enterRule(localctx, 310, self.RULE_shiftTermSupplementary) try: - self.state =3D 2580 + self.state =3D 2583 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.T__9]: localctx =3D VfrSyntaxParser.ShiftTermLeftContext(self, lo= calctx) self.enterOuterAlt(localctx, 1) - self.state =3D 2576 + self.state =3D 2579 self.match(VfrSyntaxParser.T__9) - self.state =3D 2577 + self.state =3D 2580 self.addMinusTerm(ExpInfo) pass elif token in [VfrSyntaxParser.T__10]: localctx =3D VfrSyntaxParser.ShiftTermRightContext(self, l= ocalctx) self.enterOuterAlt(localctx, 2) - self.state =3D 2578 + self.state =3D 2581 self.match(VfrSyntaxParser.T__10) - self.state =3D 2579 + self.state =3D 2582 self.addMinusTerm(ExpInfo) pass else: @@ -16800,8 +16804,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CIfrAddList =3D [] - self.CIfrSubtractList =3D [] + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def multdivmodTerm(self): @@ -16834,15 +16837,15 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2582 + self.state =3D 2585 self.multdivmodTerm(ExpInfo) - self.state =3D 2586 + self.state =3D 2589 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.T__11 or _la=3D=3DVfrSyntaxPars= er.Negative: - self.state =3D 2583 - self.addMinusTermSupplementary(localctx.CIfrAddList, local= ctx.CIfrSubtractList, ExpInfo) - self.state =3D 2588 + self.state =3D 2586 + self.addMinusTermSupplementary(ExpInfo) + self.state =3D 2591 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -16857,14 +16860,11 @@ class VfrSyntaxParser ( Parser ): =20 class AddMinusTermSupplementaryContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, CIfrAddList=3DNone, CIfrSubtractList=3DNone, ExpInfo=3DNo= ne): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, ExpInfo=3DNone): super().__init__(parent, invokingState) self.parser =3D parser - self.CIfrAddList =3D None - self.CIfrSubtractList =3D None self.ExpInfo =3D None - self.CIfrAddList =3D CIfrAddList - self.CIfrSubtractList =3D CIfrSubtractList + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 =20 @@ -16874,9 +16874,8 @@ class VfrSyntaxParser ( Parser ): =20 def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) - self.CIfrAddList =3D ctx.CIfrAddList - self.CIfrSubtractList =3D ctx.CIfrSubtractList self.ExpInfo =3D ctx.ExpInfo + self.Nodes =3D ctx.Nodes =20 =20 =20 @@ -16917,28 +16916,28 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def addMinusTermSupplementary(self, CIfrAddList, CIfrSubtractList, Exp= Info): + def addMinusTermSupplementary(self, ExpInfo): =20 - localctx =3D VfrSyntaxParser.AddMinusTermSupplementaryContext(self= , self._ctx, self.state, CIfrAddList, CIfrSubtractList, ExpInfo) + localctx =3D VfrSyntaxParser.AddMinusTermSupplementaryContext(self= , self._ctx, self.state, ExpInfo) self.enterRule(localctx, 314, self.RULE_addMinusTermSupplementary) try: - self.state =3D 2593 + self.state =3D 2596 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.T__11]: localctx =3D VfrSyntaxParser.AddMinusTermpAddContext(self,= localctx) self.enterOuterAlt(localctx, 1) - self.state =3D 2589 + self.state =3D 2592 self.match(VfrSyntaxParser.T__11) - self.state =3D 2590 + self.state =3D 2593 self.multdivmodTerm(ExpInfo) pass elif token in [VfrSyntaxParser.Negative]: localctx =3D VfrSyntaxParser.AddMinusTermSubtractContext(s= elf, localctx) self.enterOuterAlt(localctx, 2) - self.state =3D 2591 + self.state =3D 2594 self.match(VfrSyntaxParser.Negative) - self.state =3D 2592 + self.state =3D 2595 self.multdivmodTerm(ExpInfo) pass else: @@ -16959,9 +16958,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CIfrMultiplyList =3D [] - self.CIfrDivideList =3D [] - self.CIfrModuloList =3D [] + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def castTerm(self): @@ -16994,15 +16991,15 @@ class VfrSyntaxParser ( Parser ): self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2595 + self.state =3D 2598 self.castTerm(ExpInfo) - self.state =3D 2599 + self.state =3D 2602 self._errHandler.sync(self) _la =3D self._input.LA(1) while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << VfrSy= ntaxParser.T__12) | (1 << VfrSyntaxParser.T__13) | (1 << VfrSyntaxParser.Sl= ash))) !=3D 0): - self.state =3D 2596 - self.multdivmodTermSupplementary(localctx.CIfrMultiplyList= , localctx.CIfrDivideList, localctx.CIfrModuloList, ExpInfo) - self.state =3D 2601 + self.state =3D 2599 + self.multdivmodTermSupplementary(ExpInfo) + self.state =3D 2604 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -17017,16 +17014,11 @@ class VfrSyntaxParser ( Parser ): =20 class MultdivmodTermSupplementaryContext(ParserRuleContext): =20 - def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, CIfrMultiplyList=3DNone, CIfrDivideList=3DNone, CIfrModul= oList=3DNone, ExpInfo=3DNone): + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, ExpInfo=3DNone): super().__init__(parent, invokingState) self.parser =3D parser - self.CIfrMultiplyList =3D None - self.CIfrDivideList =3D None - self.CIfrModuloList =3D None self.ExpInfo =3D None - self.CIfrMultiplyList =3D CIfrMultiplyList - self.CIfrDivideList =3D CIfrDivideList - self.CIfrModuloList =3D CIfrModuloList + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 =20 @@ -17036,10 +17028,8 @@ class VfrSyntaxParser ( Parser ): =20 def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) - self.CIfrMultiplyList =3D ctx.CIfrMultiplyList - self.CIfrDivideList =3D ctx.CIfrDivideList - self.CIfrModuloList =3D ctx.CIfrModuloList self.ExpInfo =3D ctx.ExpInfo + self.Nodes =3D ctx.Nodes =20 =20 =20 @@ -17097,36 +17087,36 @@ class VfrSyntaxParser ( Parser ): =20 =20 =20 - def multdivmodTermSupplementary(self, CIfrMultiplyList, CIfrDivideList= , CIfrModuloList, ExpInfo): + def multdivmodTermSupplementary(self, ExpInfo): =20 - localctx =3D VfrSyntaxParser.MultdivmodTermSupplementaryContext(se= lf, self._ctx, self.state, CIfrMultiplyList, CIfrDivideList, CIfrModuloList= , ExpInfo) + localctx =3D VfrSyntaxParser.MultdivmodTermSupplementaryContext(se= lf, self._ctx, self.state, ExpInfo) self.enterRule(localctx, 318, self.RULE_multdivmodTermSupplementar= y) try: - self.state =3D 2608 + self.state =3D 2611 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.T__12]: localctx =3D VfrSyntaxParser.MultdivmodTermMulContext(self= , localctx) self.enterOuterAlt(localctx, 1) - self.state =3D 2602 + self.state =3D 2605 self.match(VfrSyntaxParser.T__12) - self.state =3D 2603 + self.state =3D 2606 self.castTerm(ExpInfo) pass elif token in [VfrSyntaxParser.Slash]: localctx =3D VfrSyntaxParser.MultdivmodTermDivContext(self= , localctx) self.enterOuterAlt(localctx, 2) - self.state =3D 2604 + self.state =3D 2607 self.match(VfrSyntaxParser.Slash) - self.state =3D 2605 + self.state =3D 2608 self.castTerm(ExpInfo) pass elif token in [VfrSyntaxParser.T__13]: localctx =3D VfrSyntaxParser.MultdivmodTermModuloContext(s= elf, localctx) self.enterOuterAlt(localctx, 3) - self.state =3D 2606 + self.state =3D 2609 self.match(VfrSyntaxParser.T__13) - self.state =3D 2607 + self.state =3D 2610 self.castTerm(ExpInfo) pass else: @@ -17147,55 +17137,19 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.TBObj =3D None - self.TUObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def atomTerm(self): return self.getTypedRuleContext(VfrSyntaxParser.AtomTermContex= t,0) =20 =20 - def OpenParen(self, i:int=3DNone): - if i is None: - return self.getTokens(VfrSyntaxParser.OpenParen) - else: - return self.getToken(VfrSyntaxParser.OpenParen, i) - - def CloseParen(self, i:int=3DNone): - if i is None: - return self.getTokens(VfrSyntaxParser.CloseParen) - else: - return self.getToken(VfrSyntaxParser.CloseParen, i) - - def Boolean(self, i:int=3DNone): - if i is None: - return self.getTokens(VfrSyntaxParser.Boolean) - else: - return self.getToken(VfrSyntaxParser.Boolean, i) - - def Uint64(self, i:int=3DNone): - if i is None: - return self.getTokens(VfrSyntaxParser.Uint64) - else: - return self.getToken(VfrSyntaxParser.Uint64, i) - - def Uint32(self, i:int=3DNone): - if i is None: - return self.getTokens(VfrSyntaxParser.Uint32) - else: - return self.getToken(VfrSyntaxParser.Uint32, i) - - def Uint16(self, i:int=3DNone): + def castTermSub(self, i:int=3DNone): if i is None: - return self.getTokens(VfrSyntaxParser.Uint16) + return self.getTypedRuleContexts(VfrSyntaxParser.CastTermS= ubContext) else: - return self.getToken(VfrSyntaxParser.Uint16, i) + return self.getTypedRuleContext(VfrSyntaxParser.CastTermSu= bContext,i) =20 - def Uint8(self, i:int=3DNone): - if i is None: - return self.getTokens(VfrSyntaxParser.Uint8) - else: - return self.getToken(VfrSyntaxParser.Uint8, i) =20 def getRuleIndex(self): return VfrSyntaxParser.RULE_castTerm @@ -17213,30 +17167,20 @@ class VfrSyntaxParser ( Parser ): =20 localctx =3D VfrSyntaxParser.CastTermContext(self, self._ctx, self= .state, ExpInfo) self.enterRule(localctx, 320, self.RULE_castTerm) - self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2615 + self.state =3D 2616 self._errHandler.sync(self) - _alt =3D self._interp.adaptivePredict(self._input,217,self._ct= x) + _alt =3D self._interp.adaptivePredict(self._input,218,self._ct= x) while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER: if _alt=3D=3D1: - self.state =3D 2610 - self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2611 - _la =3D self._input.LA(1) - if not(((((_la - 80)) & ~0x3f) =3D=3D 0 and ((1 << (_l= a - 80)) & ((1 << (VfrSyntaxParser.Boolean - 80)) | (1 << (VfrSyntaxParser.= Uint64 - 80)) | (1 << (VfrSyntaxParser.Uint32 - 80)) | (1 << (VfrSyntaxPars= er.Uint16 - 80)) | (1 << (VfrSyntaxParser.Uint8 - 80)))) !=3D 0)): - self._errHandler.recoverInline(self) - else: - self._errHandler.reportMatch(self) - self.consume() - self.state =3D 2612 - self.match(VfrSyntaxParser.CloseParen) - self.state =3D 2617 + self.state =3D 2613 + self.castTermSub() + self.state =3D 2618 self._errHandler.sync(self) - _alt =3D self._interp.adaptivePredict(self._input,217,self= ._ctx) + _alt =3D self._interp.adaptivePredict(self._input,218,self= ._ctx) =20 - self.state =3D 2618 + self.state =3D 2619 self.atomTerm(ExpInfo) except RecognitionException as re: localctx.exception =3D re @@ -17247,12 +17191,80 @@ class VfrSyntaxParser ( Parser ): return localctx =20 =20 + class CastTermSubContext(ParserRuleContext): + + def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1): + super().__init__(parent, invokingState) + self.parser =3D parser + self.CastType =3D 0xFF + + def OpenParen(self): + return self.getToken(VfrSyntaxParser.OpenParen, 0) + + def CloseParen(self): + return self.getToken(VfrSyntaxParser.CloseParen, 0) + + def Boolean(self): + return self.getToken(VfrSyntaxParser.Boolean, 0) + + def Uint64(self): + return self.getToken(VfrSyntaxParser.Uint64, 0) + + def Uint32(self): + return self.getToken(VfrSyntaxParser.Uint32, 0) + + def Uint16(self): + return self.getToken(VfrSyntaxParser.Uint16, 0) + + def Uint8(self): + return self.getToken(VfrSyntaxParser.Uint8, 0) + + def getRuleIndex(self): + return VfrSyntaxParser.RULE_castTermSub + + def accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitCastTermSub" ): + return visitor.visitCastTermSub(self) + else: + return visitor.visitChildren(self) + + + + + def castTermSub(self): + + localctx =3D VfrSyntaxParser.CastTermSubContext(self, self._ctx, s= elf.state) + self.enterRule(localctx, 322, self.RULE_castTermSub) + self._la =3D 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state =3D 2621 + self.match(VfrSyntaxParser.OpenParen) + self.state =3D 2622 + _la =3D self._input.LA(1) + if not(((((_la - 80)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 80))= & ((1 << (VfrSyntaxParser.Boolean - 80)) | (1 << (VfrSyntaxParser.Uint64 -= 80)) | (1 << (VfrSyntaxParser.Uint32 - 80)) | (1 << (VfrSyntaxParser.Uint1= 6 - 80)) | (1 << (VfrSyntaxParser.Uint8 - 80)))) !=3D 0)): + self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() + self.state =3D 2623 + self.match(VfrSyntaxParser.CloseParen) + except RecognitionException as re: + localctx.exception =3D re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class AtomTermContext(ParserRuleContext): =20 def __init__(self, parser, parent:ParserRuleContext=3DNone, invoki= ngState:int=3D-1, ExpInfo=3DNone): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def vfrExpressionCatenate(self): @@ -17313,79 +17325,65 @@ class VfrSyntaxParser ( Parser ): def atomTerm(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.AtomTermContext(self, self._ctx, self= .state, ExpInfo) - self.enterRule(localctx, 322, self.RULE_atomTerm) + self.enterRule(localctx, 324, self.RULE_atomTerm) try: - self.state =3D 2632 + self.state =3D 2636 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,218,self._ctx= ) - if la_ =3D=3D 1: + token =3D self._input.LA(1) + if token in [VfrSyntaxParser.Catenate]: self.enterOuterAlt(localctx, 1) - self.state =3D 2620 + self.state =3D 2625 self.vfrExpressionCatenate(ExpInfo) pass - - elif la_ =3D=3D 2: + elif token in [VfrSyntaxParser.Match]: self.enterOuterAlt(localctx, 2) - self.state =3D 2621 + self.state =3D 2626 self.vfrExpressionMatch(ExpInfo) pass - - elif la_ =3D=3D 3: + elif token in [VfrSyntaxParser.Match2]: self.enterOuterAlt(localctx, 3) - self.state =3D 2622 + self.state =3D 2627 self.vfrExpressionMatch2(ExpInfo) pass - - elif la_ =3D=3D 4: + elif token in [VfrSyntaxParser.OpenParen]: self.enterOuterAlt(localctx, 4) - self.state =3D 2623 + self.state =3D 2628 self.vfrExpressionParen(ExpInfo) pass - - elif la_ =3D=3D 5: + elif token in [VfrSyntaxParser.Dup, VfrSyntaxParser.VarEqVal, = VfrSyntaxParser.IdEqVal, VfrSyntaxParser.IdEqId, VfrSyntaxParser.IdEqValLis= t, VfrSyntaxParser.QuestionRef, VfrSyntaxParser.RuleRef, VfrSyntaxParser.St= ringRef, VfrSyntaxParser.PushThis, VfrSyntaxParser.Security, VfrSyntaxParse= r.Get]: self.enterOuterAlt(localctx, 5) - self.state =3D 2624 + self.state =3D 2629 self.vfrExpressionBuildInFunction(ExpInfo) pass - - elif la_ =3D=3D 6: + elif token in [VfrSyntaxParser.TrueSymbol, VfrSyntaxParser.Fal= seSymbol, VfrSyntaxParser.One, VfrSyntaxParser.Ones, VfrSyntaxParser.Zero, = VfrSyntaxParser.Undefined, VfrSyntaxParser.Version, VfrSyntaxParser.Number]= : self.enterOuterAlt(localctx, 6) - self.state =3D 2625 + self.state =3D 2630 self.vfrExpressionConstant(ExpInfo) pass - - elif la_ =3D=3D 7: + elif token in [VfrSyntaxParser.Length, VfrSyntaxParser.Set, Vf= rSyntaxParser.BitWiseNot, VfrSyntaxParser.BoolVal, VfrSyntaxParser.StringVa= l, VfrSyntaxParser.UnIntVal, VfrSyntaxParser.ToUpper, VfrSyntaxParser.ToLow= er, VfrSyntaxParser.QuestionRefVal, VfrSyntaxParser.StringRefVal]: self.enterOuterAlt(localctx, 7) - self.state =3D 2626 + self.state =3D 2631 self.vfrExpressionUnaryOp(ExpInfo) pass - - elif la_ =3D=3D 8: + elif token in [VfrSyntaxParser.Cond, VfrSyntaxParser.Find, Vfr= SyntaxParser.Mid, VfrSyntaxParser.Tok, VfrSyntaxParser.Span]: self.enterOuterAlt(localctx, 8) - self.state =3D 2627 + self.state =3D 2632 self.vfrExpressionTernaryOp(ExpInfo) pass - - elif la_ =3D=3D 9: + elif token in [VfrSyntaxParser.Map]: self.enterOuterAlt(localctx, 9) - self.state =3D 2628 + self.state =3D 2633 self.vfrExpressionMap(ExpInfo) pass - - elif la_ =3D=3D 10: + elif token in [VfrSyntaxParser.NOT]: self.enterOuterAlt(localctx, 10) - self.state =3D 2629 + self.state =3D 2634 self.match(VfrSyntaxParser.NOT) - self.state =3D 2630 + self.state =3D 2635 self.atomTerm(ExpInfo) pass - - elif la_ =3D=3D 11: - self.enterOuterAlt(localctx, 11) - self.state =3D 2631 - self.vfrExpressionMatch2(ExpInfo) - pass - + else: + raise NoViableAltException(self) =20 except RecognitionException as re: localctx.exception =3D re @@ -17402,7 +17400,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Catenate(self): @@ -17439,20 +17437,20 @@ class VfrSyntaxParser ( Parser ): def vfrExpressionCatenate(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VfrExpressionCatenateContext(self, se= lf._ctx, self.state, ExpInfo) - self.enterRule(localctx, 324, self.RULE_vfrExpressionCatenate) + self.enterRule(localctx, 326, self.RULE_vfrExpressionCatenate) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2634 + self.state =3D 2638 self.match(VfrSyntaxParser.Catenate) - self.state =3D 2635 + self.state =3D 2639 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2636 - self.vfrStatementExpressionSub() - self.state =3D 2637 + self.state =3D 2640 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2641 self.match(VfrSyntaxParser.Comma) - self.state =3D 2638 - self.vfrStatementExpressionSub() - self.state =3D 2639 + self.state =3D 2642 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2643 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -17469,7 +17467,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.MObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Match(self): @@ -17506,20 +17504,20 @@ class VfrSyntaxParser ( Parser ): def vfrExpressionMatch(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VfrExpressionMatchContext(self, self.= _ctx, self.state, ExpInfo) - self.enterRule(localctx, 326, self.RULE_vfrExpressionMatch) + self.enterRule(localctx, 328, self.RULE_vfrExpressionMatch) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2641 + self.state =3D 2645 self.match(VfrSyntaxParser.Match) - self.state =3D 2642 + self.state =3D 2646 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2643 - self.vfrStatementExpressionSub() - self.state =3D 2644 + self.state =3D 2647 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2648 self.match(VfrSyntaxParser.Comma) - self.state =3D 2645 - self.vfrStatementExpressionSub() - self.state =3D 2646 + self.state =3D 2649 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2650 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -17536,7 +17534,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.M2Obj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Match2(self): @@ -17580,24 +17578,24 @@ class VfrSyntaxParser ( Parser ): def vfrExpressionMatch2(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VfrExpressionMatch2Context(self, self= ._ctx, self.state, ExpInfo) - self.enterRule(localctx, 328, self.RULE_vfrExpressionMatch2) + self.enterRule(localctx, 330, self.RULE_vfrExpressionMatch2) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2648 + self.state =3D 2652 self.match(VfrSyntaxParser.Match2) - self.state =3D 2649 + self.state =3D 2653 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2650 - self.vfrStatementExpressionSub() - self.state =3D 2651 + self.state =3D 2654 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2655 self.match(VfrSyntaxParser.Comma) - self.state =3D 2652 - self.vfrStatementExpressionSub() - self.state =3D 2653 + self.state =3D 2656 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2657 self.match(VfrSyntaxParser.Comma) - self.state =3D 2654 + self.state =3D 2658 self.guidDefinition() - self.state =3D 2655 + self.state =3D 2659 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -17614,6 +17612,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def OpenParen(self): @@ -17641,14 +17640,14 @@ class VfrSyntaxParser ( Parser ): def vfrExpressionParen(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VfrExpressionParenContext(self, self.= _ctx, self.state, ExpInfo) - self.enterRule(localctx, 330, self.RULE_vfrExpressionParen) + self.enterRule(localctx, 332, self.RULE_vfrExpressionParen) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2657 + self.state =3D 2661 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2658 - self.vfrStatementExpressionSub() - self.state =3D 2659 + self.state =3D 2662 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2663 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -17665,6 +17664,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D None self.ExpInfo =3D ExpInfo =20 def dupExp(self): @@ -17726,64 +17726,64 @@ class VfrSyntaxParser ( Parser ): def vfrExpressionBuildInFunction(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VfrExpressionBuildInFunctionContext(s= elf, self._ctx, self.state, ExpInfo) - self.enterRule(localctx, 332, self.RULE_vfrExpressionBuildInFuncti= on) + self.enterRule(localctx, 334, self.RULE_vfrExpressionBuildInFuncti= on) try: - self.state =3D 2672 + self.state =3D 2676 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Dup]: self.enterOuterAlt(localctx, 1) - self.state =3D 2661 + self.state =3D 2665 self.dupExp(ExpInfo) pass elif token in [VfrSyntaxParser.VarEqVal]: self.enterOuterAlt(localctx, 2) - self.state =3D 2662 + self.state =3D 2666 self.vareqvalExp(ExpInfo) pass elif token in [VfrSyntaxParser.IdEqVal]: self.enterOuterAlt(localctx, 3) - self.state =3D 2663 + self.state =3D 2667 self.ideqvalExp(ExpInfo) pass elif token in [VfrSyntaxParser.IdEqId]: self.enterOuterAlt(localctx, 4) - self.state =3D 2664 + self.state =3D 2668 self.ideqidExp(ExpInfo) pass elif token in [VfrSyntaxParser.IdEqValList]: self.enterOuterAlt(localctx, 5) - self.state =3D 2665 + self.state =3D 2669 self.ideqvallistExp(ExpInfo) pass elif token in [VfrSyntaxParser.QuestionRef]: self.enterOuterAlt(localctx, 6) - self.state =3D 2666 + self.state =3D 2670 self.questionref1Exp(ExpInfo) pass elif token in [VfrSyntaxParser.RuleRef]: self.enterOuterAlt(localctx, 7) - self.state =3D 2667 + self.state =3D 2671 self.rulerefExp(ExpInfo) pass elif token in [VfrSyntaxParser.StringRef]: self.enterOuterAlt(localctx, 8) - self.state =3D 2668 + self.state =3D 2672 self.stringref1Exp(ExpInfo) pass elif token in [VfrSyntaxParser.PushThis]: self.enterOuterAlt(localctx, 9) - self.state =3D 2669 + self.state =3D 2673 self.pushthisExp(ExpInfo) pass elif token in [VfrSyntaxParser.Security]: self.enterOuterAlt(localctx, 10) - self.state =3D 2670 + self.state =3D 2674 self.securityExp(ExpInfo) pass elif token in [VfrSyntaxParser.Get]: self.enterOuterAlt(localctx, 11) - self.state =3D 2671 + self.state =3D 2675 self.getExp(ExpInfo) pass else: @@ -17804,7 +17804,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.DObj =3D None + self.Node =3D IfrTreeNode(EFI_IFR_DUP_OP) self.ExpInfo =3D ExpInfo =20 def Dup(self): @@ -17825,10 +17825,10 @@ class VfrSyntaxParser ( Parser ): def dupExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.DupExpContext(self, self._ctx, self.s= tate, ExpInfo) - self.enterRule(localctx, 334, self.RULE_dupExp) + self.enterRule(localctx, 336, self.RULE_dupExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2674 + self.state =3D 2678 self.match(VfrSyntaxParser.Dup) except RecognitionException as re: localctx.exception =3D re @@ -17845,6 +17845,8 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D None + self.VN =3D None # Token self.ExpInfo =3D ExpInfo =20 def VarEqVal(self): @@ -17856,15 +17858,15 @@ class VfrSyntaxParser ( Parser ): def OpenParen(self): return self.getToken(VfrSyntaxParser.OpenParen, 0) =20 + def CloseParen(self): + return self.getToken(VfrSyntaxParser.CloseParen, 0) + def Number(self, i:int=3DNone): if i is None: return self.getTokens(VfrSyntaxParser.Number) else: return self.getToken(VfrSyntaxParser.Number, i) =20 - def CloseParen(self): - return self.getToken(VfrSyntaxParser.CloseParen, 0) - def Equal(self): return self.getToken(VfrSyntaxParser.Equal, 0) =20 @@ -17895,50 +17897,50 @@ class VfrSyntaxParser ( Parser ): def vareqvalExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VareqvalExpContext(self, self._ctx, s= elf.state, ExpInfo) - self.enterRule(localctx, 336, self.RULE_vareqvalExp) + self.enterRule(localctx, 338, self.RULE_vareqvalExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2676 + self.state =3D 2680 self.match(VfrSyntaxParser.VarEqVal) - self.state =3D 2677 + self.state =3D 2681 self.match(VfrSyntaxParser.Var) - self.state =3D 2678 + self.state =3D 2682 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2679 - self.match(VfrSyntaxParser.Number) - self.state =3D 2680 + self.state =3D 2683 + localctx.VN =3D self.match(VfrSyntaxParser.Number) + self.state =3D 2684 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 2691 + self.state =3D 2695 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Equal]: - self.state =3D 2681 + self.state =3D 2685 self.match(VfrSyntaxParser.Equal) - self.state =3D 2682 + self.state =3D 2686 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.LessEqual]: - self.state =3D 2683 + self.state =3D 2687 self.match(VfrSyntaxParser.LessEqual) - self.state =3D 2684 + self.state =3D 2688 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.Less]: - self.state =3D 2685 + self.state =3D 2689 self.match(VfrSyntaxParser.Less) - self.state =3D 2686 + self.state =3D 2690 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.GreaterEqual]: - self.state =3D 2687 + self.state =3D 2691 self.match(VfrSyntaxParser.GreaterEqual) - self.state =3D 2688 + self.state =3D 2692 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.Greater]: - self.state =3D 2689 + self.state =3D 2693 self.match(VfrSyntaxParser.Greater) - self.state =3D 2690 + self.state =3D 2694 self.match(VfrSyntaxParser.Number) pass else: @@ -17959,6 +17961,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D None self.I =3D None # Token self.ExpInfo =3D ExpInfo =20 @@ -18002,44 +18005,44 @@ class VfrSyntaxParser ( Parser ): def ideqvalExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.IdeqvalExpContext(self, self._ctx, se= lf.state, ExpInfo) - self.enterRule(localctx, 338, self.RULE_ideqvalExp) + self.enterRule(localctx, 340, self.RULE_ideqvalExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2693 + self.state =3D 2697 localctx.I =3D self.match(VfrSyntaxParser.IdEqVal) - self.state =3D 2694 + self.state =3D 2698 self.vfrQuestionDataFieldName() - self.state =3D 2705 + self.state =3D 2709 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Equal]: - self.state =3D 2695 + self.state =3D 2699 self.match(VfrSyntaxParser.Equal) - self.state =3D 2696 + self.state =3D 2700 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.LessEqual]: - self.state =3D 2697 + self.state =3D 2701 self.match(VfrSyntaxParser.LessEqual) - self.state =3D 2698 + self.state =3D 2702 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.Less]: - self.state =3D 2699 + self.state =3D 2703 self.match(VfrSyntaxParser.Less) - self.state =3D 2700 + self.state =3D 2704 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.GreaterEqual]: - self.state =3D 2701 + self.state =3D 2705 self.match(VfrSyntaxParser.GreaterEqual) - self.state =3D 2702 + self.state =3D 2706 self.match(VfrSyntaxParser.Number) pass elif token in [VfrSyntaxParser.Greater]: - self.state =3D 2703 + self.state =3D 2707 self.match(VfrSyntaxParser.Greater) - self.state =3D 2704 + self.state =3D 2708 self.match(VfrSyntaxParser.Number) pass else: @@ -18060,6 +18063,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D None self.I =3D None # Token self.E =3D None # Token self.LE =3D None # Token @@ -18108,44 +18112,44 @@ class VfrSyntaxParser ( Parser ): def ideqidExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.IdeqidExpContext(self, self._ctx, sel= f.state, ExpInfo) - self.enterRule(localctx, 340, self.RULE_ideqidExp) + self.enterRule(localctx, 342, self.RULE_ideqidExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2707 + self.state =3D 2711 localctx.I =3D self.match(VfrSyntaxParser.IdEqId) - self.state =3D 2708 + self.state =3D 2712 self.vfrQuestionDataFieldName() - self.state =3D 2719 + self.state =3D 2723 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Equal]: - self.state =3D 2709 + self.state =3D 2713 localctx.E =3D self.match(VfrSyntaxParser.Equal) - self.state =3D 2710 + self.state =3D 2714 self.vfrQuestionDataFieldName() pass elif token in [VfrSyntaxParser.LessEqual]: - self.state =3D 2711 + self.state =3D 2715 localctx.LE =3D self.match(VfrSyntaxParser.LessEqual) - self.state =3D 2712 + self.state =3D 2716 self.vfrQuestionDataFieldName() pass elif token in [VfrSyntaxParser.Less]: - self.state =3D 2713 + self.state =3D 2717 localctx.L =3D self.match(VfrSyntaxParser.Less) - self.state =3D 2714 + self.state =3D 2718 self.vfrQuestionDataFieldName() pass elif token in [VfrSyntaxParser.GreaterEqual]: - self.state =3D 2715 + self.state =3D 2719 localctx.BE =3D self.match(VfrSyntaxParser.GreaterEqual) - self.state =3D 2716 + self.state =3D 2720 self.vfrQuestionDataFieldName() pass elif token in [VfrSyntaxParser.Greater]: - self.state =3D 2717 + self.state =3D 2721 localctx.B =3D self.match(VfrSyntaxParser.Greater) - self.state =3D 2718 + self.state =3D 2722 self.vfrQuestionDataFieldName() pass else: @@ -18166,6 +18170,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D None self.ExpInfo =3D ExpInfo =20 def IdEqValList(self): @@ -18199,23 +18204,23 @@ class VfrSyntaxParser ( Parser ): def ideqvallistExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.IdeqvallistExpContext(self, self._ctx= , self.state, ExpInfo) - self.enterRule(localctx, 342, self.RULE_ideqvallistExp) + self.enterRule(localctx, 344, self.RULE_ideqvallistExp) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2721 + self.state =3D 2725 self.match(VfrSyntaxParser.IdEqValList) - self.state =3D 2722 + self.state =3D 2726 self.vfrQuestionDataFieldName() - self.state =3D 2723 + self.state =3D 2727 self.match(VfrSyntaxParser.Equal) - self.state =3D 2725 + self.state =3D 2729 self._errHandler.sync(self) _la =3D self._input.LA(1) while True: - self.state =3D 2724 + self.state =3D 2728 self.match(VfrSyntaxParser.Number) - self.state =3D 2727 + self.state =3D 2731 self._errHandler.sync(self) _la =3D self._input.LA(1) if not (_la=3D=3DVfrSyntaxParser.Number): @@ -18310,39 +18315,39 @@ class VfrSyntaxParser ( Parser ): def vfrQuestionDataFieldName(self): =20 localctx =3D VfrSyntaxParser.VfrQuestionDataFieldNameContext(self,= self._ctx, self.state) - self.enterRule(localctx, 344, self.RULE_vfrQuestionDataFieldName) + self.enterRule(localctx, 346, self.RULE_vfrQuestionDataFieldName) self._la =3D 0 # Token type try: - self.state =3D 2741 + self.state =3D 2745 self._errHandler.sync(self) - la_ =3D self._interp.adaptivePredict(self._input,225,self._ctx= ) + la_ =3D self._interp.adaptivePredict(self._input,226,self._ctx= ) if la_ =3D=3D 1: localctx =3D VfrSyntaxParser.VfrQuestionDataFieldNameRule1= Context(self, localctx) self.enterOuterAlt(localctx, 1) - self.state =3D 2729 + self.state =3D 2733 localctx.SN1 =3D self.match(VfrSyntaxParser.StringIdentifi= er) - self.state =3D 2730 + self.state =3D 2734 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2731 + self.state =3D 2735 localctx.I =3D self.match(VfrSyntaxParser.Number) - self.state =3D 2732 + self.state =3D 2736 self.match(VfrSyntaxParser.CloseBracket) pass =20 elif la_ =3D=3D 2: localctx =3D VfrSyntaxParser.VfrQuestionDataFieldNameRule2= Context(self, localctx) self.enterOuterAlt(localctx, 2) - self.state =3D 2733 + self.state =3D 2737 localctx.SN2 =3D self.match(VfrSyntaxParser.StringIdentifi= er) - self.state =3D 2738 + self.state =3D 2742 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.Dot: - self.state =3D 2734 + self.state =3D 2738 self.match(VfrSyntaxParser.Dot) - self.state =3D 2735 + self.state =3D 2739 self.arrayName() - self.state =3D 2740 + self.state =3D 2744 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 @@ -18394,21 +18399,21 @@ class VfrSyntaxParser ( Parser ): def arrayName(self): =20 localctx =3D VfrSyntaxParser.ArrayNameContext(self, self._ctx, sel= f.state) - self.enterRule(localctx, 346, self.RULE_arrayName) + self.enterRule(localctx, 348, self.RULE_arrayName) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2743 - self.match(VfrSyntaxParser.StringIdentifier) self.state =3D 2747 + self.match(VfrSyntaxParser.StringIdentifier) + self.state =3D 2751 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.OpenBracket: - self.state =3D 2744 + self.state =3D 2748 self.match(VfrSyntaxParser.OpenBracket) - self.state =3D 2745 + self.state =3D 2749 localctx.N =3D self.match(VfrSyntaxParser.Number) - self.state =3D 2746 + self.state =3D 2750 self.match(VfrSyntaxParser.CloseBracket) =20 =20 @@ -18427,6 +18432,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D IfrTreeNode(EFI_IFR_QUESTION_REF1_OP) self.ExpInfo =3D ExpInfo =20 def QuestionRef(self): @@ -18459,22 +18465,22 @@ class VfrSyntaxParser ( Parser ): def questionref1Exp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.Questionref1ExpContext(self, self._ct= x, self.state, ExpInfo) - self.enterRule(localctx, 348, self.RULE_questionref1Exp) + self.enterRule(localctx, 350, self.RULE_questionref1Exp) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2749 + self.state =3D 2753 self.match(VfrSyntaxParser.QuestionRef) - self.state =3D 2750 + self.state =3D 2754 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2751 + self.state =3D 2755 _la =3D self._input.LA(1) if not(_la=3D=3DVfrSyntaxParser.Number or _la=3D=3DVfrSyntaxPa= rser.StringIdentifier): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state =3D 2752 + self.state =3D 2756 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -18491,6 +18497,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D IfrTreeNode(EFI_IFR_RULE_REF_OP) self.ExpInfo =3D ExpInfo =20 def RuleRef(self): @@ -18520,16 +18527,16 @@ class VfrSyntaxParser ( Parser ): def rulerefExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.RulerefExpContext(self, self._ctx, se= lf.state, ExpInfo) - self.enterRule(localctx, 350, self.RULE_rulerefExp) + self.enterRule(localctx, 352, self.RULE_rulerefExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2754 + self.state =3D 2758 self.match(VfrSyntaxParser.RuleRef) - self.state =3D 2755 + self.state =3D 2759 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2756 + self.state =3D 2760 self.match(VfrSyntaxParser.StringIdentifier) - self.state =3D 2757 + self.state =3D 2761 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -18546,6 +18553,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D IfrTreeNode(EFI_IFR_STRING_REF1_OP) self.ExpInfo =3D ExpInfo =20 def StringRef(self): @@ -18584,34 +18592,34 @@ class VfrSyntaxParser ( Parser ): def stringref1Exp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.Stringref1ExpContext(self, self._ctx,= self.state, ExpInfo) - self.enterRule(localctx, 352, self.RULE_stringref1Exp) + self.enterRule(localctx, 354, self.RULE_stringref1Exp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2759 + self.state =3D 2763 self.match(VfrSyntaxParser.StringRef) - self.state =3D 2760 + self.state =3D 2764 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2766 + self.state =3D 2770 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.StringToken]: - self.state =3D 2761 + self.state =3D 2765 self.match(VfrSyntaxParser.StringToken) - self.state =3D 2762 + self.state =3D 2766 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2763 + self.state =3D 2767 self.match(VfrSyntaxParser.Number) - self.state =3D 2764 + self.state =3D 2768 self.match(VfrSyntaxParser.CloseParen) pass elif token in [VfrSyntaxParser.Number]: - self.state =3D 2765 + self.state =3D 2769 self.match(VfrSyntaxParser.Number) pass else: raise NoViableAltException(self) =20 - self.state =3D 2768 + self.state =3D 2772 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -18628,6 +18636,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D IfrTreeNode(EFI_IFR_THIS_OP) self.ExpInfo =3D ExpInfo =20 def PushThis(self): @@ -18648,10 +18657,10 @@ class VfrSyntaxParser ( Parser ): def pushthisExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.PushthisExpContext(self, self._ctx, s= elf.state, ExpInfo) - self.enterRule(localctx, 354, self.RULE_pushthisExp) + self.enterRule(localctx, 356, self.RULE_pushthisExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2770 + self.state =3D 2774 self.match(VfrSyntaxParser.PushThis) except RecognitionException as re: localctx.exception =3D re @@ -18668,6 +18677,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D IfrTreeNode(EFI_IFR_SECURITY_OP) self.ExpInfo =3D ExpInfo =20 def Security(self): @@ -18698,16 +18708,16 @@ class VfrSyntaxParser ( Parser ): def securityExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.SecurityExpContext(self, self._ctx, s= elf.state, ExpInfo) - self.enterRule(localctx, 356, self.RULE_securityExp) + self.enterRule(localctx, 358, self.RULE_securityExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2772 + self.state =3D 2776 self.match(VfrSyntaxParser.Security) - self.state =3D 2773 + self.state =3D 2777 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2774 + self.state =3D 2778 self.guidDefinition() - self.state =3D 2775 + self.state =3D 2779 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -18752,11 +18762,11 @@ class VfrSyntaxParser ( Parser ): def numericVarStoreType(self): =20 localctx =3D VfrSyntaxParser.NumericVarStoreTypeContext(self, self= ._ctx, self.state) - self.enterRule(localctx, 358, self.RULE_numericVarStoreType) + self.enterRule(localctx, 360, self.RULE_numericVarStoreType) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2777 + self.state =3D 2781 _la =3D self._input.LA(1) if not(((((_la - 237)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 237= )) & ((1 << (VfrSyntaxParser.NumericSizeOne - 237)) | (1 << (VfrSyntaxParse= r.NumericSizeTwo - 237)) | (1 << (VfrSyntaxParser.NumericSizeFour - 237)) |= (1 << (VfrSyntaxParser.NumericSizeEight - 237)))) !=3D 0)): self._errHandler.recoverInline(self) @@ -18779,7 +18789,7 @@ class VfrSyntaxParser ( Parser ): self.parser =3D parser self.ExpInfo =3D None self.BaseInfo =3D EFI_VARSTORE_INFO() - self.GObj =3D None + self.Node =3D IfrTreeNode(EFI_IFR_GET_OP) self.ExpInfo =3D ExpInfo =20 def Get(self): @@ -18820,31 +18830,31 @@ class VfrSyntaxParser ( Parser ): def getExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.GetExpContext(self, self._ctx, self.s= tate, ExpInfo) - self.enterRule(localctx, 360, self.RULE_getExp) + self.enterRule(localctx, 362, self.RULE_getExp) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2779 + self.state =3D 2783 self.match(VfrSyntaxParser.Get) - self.state =3D 2780 + self.state =3D 2784 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2781 + self.state =3D 2785 self.vfrStorageVarId(localctx.BaseInfo, False) - self.state =3D 2786 + self.state =3D 2790 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2782 + self.state =3D 2786 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2783 + self.state =3D 2787 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2784 + self.state =3D 2788 self.match(VfrSyntaxParser.T__5) - self.state =3D 2785 + self.state =3D 2789 self.numericVarStoreType() =20 =20 - self.state =3D 2788 + self.state =3D 2792 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -18861,6 +18871,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Node =3D None self.ExpInfo =3D ExpInfo =20 def TrueSymbol(self): @@ -18902,11 +18913,11 @@ class VfrSyntaxParser ( Parser ): def vfrExpressionConstant(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VfrExpressionConstantContext(self, se= lf._ctx, self.state, ExpInfo) - self.enterRule(localctx, 362, self.RULE_vfrExpressionConstant) + self.enterRule(localctx, 364, self.RULE_vfrExpressionConstant) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2790 + self.state =3D 2794 _la =3D self._input.LA(1) if not(((((_la - 209)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 209= )) & ((1 << (VfrSyntaxParser.TrueSymbol - 209)) | (1 << (VfrSyntaxParser.Fa= lseSymbol - 209)) | (1 << (VfrSyntaxParser.One - 209)) | (1 << (VfrSyntaxPa= rser.Ones - 209)) | (1 << (VfrSyntaxParser.Zero - 209)) | (1 << (VfrSyntaxP= arser.Undefined - 209)) | (1 << (VfrSyntaxParser.Version - 209)) | (1 << (V= frSyntaxParser.Number - 209)))) !=3D 0)): self._errHandler.recoverInline(self) @@ -18928,6 +18939,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Nodes =3D None self.ExpInfo =3D ExpInfo =20 def lengthExp(self): @@ -18985,59 +18997,59 @@ class VfrSyntaxParser ( Parser ): def vfrExpressionUnaryOp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VfrExpressionUnaryOpContext(self, sel= f._ctx, self.state, ExpInfo) - self.enterRule(localctx, 364, self.RULE_vfrExpressionUnaryOp) + self.enterRule(localctx, 366, self.RULE_vfrExpressionUnaryOp) try: - self.state =3D 2802 + self.state =3D 2806 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Length]: self.enterOuterAlt(localctx, 1) - self.state =3D 2792 + self.state =3D 2796 self.lengthExp(ExpInfo) pass elif token in [VfrSyntaxParser.BitWiseNot]: self.enterOuterAlt(localctx, 2) - self.state =3D 2793 + self.state =3D 2797 self.bitwisenotExp(ExpInfo) pass elif token in [VfrSyntaxParser.QuestionRefVal]: self.enterOuterAlt(localctx, 3) - self.state =3D 2794 + self.state =3D 2798 self.question23refExp(ExpInfo) pass elif token in [VfrSyntaxParser.StringRefVal]: self.enterOuterAlt(localctx, 4) - self.state =3D 2795 + self.state =3D 2799 self.stringref2Exp(ExpInfo) pass elif token in [VfrSyntaxParser.BoolVal]: self.enterOuterAlt(localctx, 5) - self.state =3D 2796 + self.state =3D 2800 self.toboolExp(ExpInfo) pass elif token in [VfrSyntaxParser.StringVal]: self.enterOuterAlt(localctx, 6) - self.state =3D 2797 + self.state =3D 2801 self.tostringExp(ExpInfo) pass elif token in [VfrSyntaxParser.UnIntVal]: self.enterOuterAlt(localctx, 7) - self.state =3D 2798 + self.state =3D 2802 self.unintExp(ExpInfo) pass elif token in [VfrSyntaxParser.ToUpper]: self.enterOuterAlt(localctx, 8) - self.state =3D 2799 + self.state =3D 2803 self.toupperExp(ExpInfo) pass elif token in [VfrSyntaxParser.ToLower]: self.enterOuterAlt(localctx, 9) - self.state =3D 2800 + self.state =3D 2804 self.tolwerExp(ExpInfo) pass elif token in [VfrSyntaxParser.Set]: self.enterOuterAlt(localctx, 10) - self.state =3D 2801 + self.state =3D 2805 self.setExp(ExpInfo) pass else: @@ -19058,7 +19070,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.LObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Length(self): @@ -19089,16 +19101,16 @@ class VfrSyntaxParser ( Parser ): def lengthExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.LengthExpContext(self, self._ctx, sel= f.state, ExpInfo) - self.enterRule(localctx, 366, self.RULE_lengthExp) + self.enterRule(localctx, 368, self.RULE_lengthExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2804 + self.state =3D 2808 self.match(VfrSyntaxParser.Length) - self.state =3D 2805 + self.state =3D 2809 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2806 - self.vfrStatementExpressionSub() - self.state =3D 2807 + self.state =3D 2810 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2811 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19115,7 +19127,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.BWNObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def BitWiseNot(self): @@ -19146,16 +19158,16 @@ class VfrSyntaxParser ( Parser ): def bitwisenotExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.BitwisenotExpContext(self, self._ctx,= self.state, ExpInfo) - self.enterRule(localctx, 368, self.RULE_bitwisenotExp) + self.enterRule(localctx, 370, self.RULE_bitwisenotExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2809 + self.state =3D 2813 self.match(VfrSyntaxParser.BitWiseNot) - self.state =3D 2810 + self.state =3D 2814 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2811 - self.vfrStatementExpressionSub() - self.state =3D 2812 + self.state =3D 2815 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2816 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19172,6 +19184,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def QuestionRefVal(self): @@ -19230,51 +19243,51 @@ class VfrSyntaxParser ( Parser ): def question23refExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.Question23refExpContext(self, self._c= tx, self.state, ExpInfo) - self.enterRule(localctx, 370, self.RULE_question23refExp) + self.enterRule(localctx, 372, self.RULE_question23refExp) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2814 + self.state =3D 2818 self.match(VfrSyntaxParser.QuestionRefVal) - self.state =3D 2815 + self.state =3D 2819 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2823 + self.state =3D 2827 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.DevicePath: - self.state =3D 2816 + self.state =3D 2820 self.match(VfrSyntaxParser.DevicePath) - self.state =3D 2817 + self.state =3D 2821 self.match(VfrSyntaxParser.T__5) - self.state =3D 2818 + self.state =3D 2822 self.match(VfrSyntaxParser.StringToken) - self.state =3D 2819 + self.state =3D 2823 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2820 + self.state =3D 2824 self.match(VfrSyntaxParser.Number) - self.state =3D 2821 + self.state =3D 2825 self.match(VfrSyntaxParser.CloseParen) - self.state =3D 2822 + self.state =3D 2826 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2830 + self.state =3D 2834 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.Uuid: - self.state =3D 2825 + self.state =3D 2829 self.match(VfrSyntaxParser.Uuid) - self.state =3D 2826 + self.state =3D 2830 self.match(VfrSyntaxParser.T__5) - self.state =3D 2827 + self.state =3D 2831 self.guidDefinition() - self.state =3D 2828 + self.state =3D 2832 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2832 - self.vfrStatementExpressionSub() - self.state =3D 2833 + self.state =3D 2836 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2837 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19291,7 +19304,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.SR2Obj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def StringRefVal(self): @@ -19322,16 +19335,16 @@ class VfrSyntaxParser ( Parser ): def stringref2Exp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.Stringref2ExpContext(self, self._ctx,= self.state, ExpInfo) - self.enterRule(localctx, 372, self.RULE_stringref2Exp) + self.enterRule(localctx, 374, self.RULE_stringref2Exp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2835 + self.state =3D 2839 self.match(VfrSyntaxParser.StringRefVal) - self.state =3D 2836 + self.state =3D 2840 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2837 - self.vfrStatementExpressionSub() - self.state =3D 2838 + self.state =3D 2841 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2842 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19348,7 +19361,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.TBObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def BoolVal(self): @@ -19379,16 +19392,16 @@ class VfrSyntaxParser ( Parser ): def toboolExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.ToboolExpContext(self, self._ctx, sel= f.state, ExpInfo) - self.enterRule(localctx, 374, self.RULE_toboolExp) + self.enterRule(localctx, 376, self.RULE_toboolExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2840 + self.state =3D 2844 self.match(VfrSyntaxParser.BoolVal) - self.state =3D 2841 + self.state =3D 2845 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2842 - self.vfrStatementExpressionSub() - self.state =3D 2843 + self.state =3D 2846 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2847 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19405,7 +19418,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.TSObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def StringVal(self): @@ -19442,31 +19455,31 @@ class VfrSyntaxParser ( Parser ): def tostringExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.TostringExpContext(self, self._ctx, s= elf.state, ExpInfo) - self.enterRule(localctx, 376, self.RULE_tostringExp) + self.enterRule(localctx, 378, self.RULE_tostringExp) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2845 + self.state =3D 2849 self.match(VfrSyntaxParser.StringVal) - self.state =3D 2850 + self.state =3D 2854 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.T__14: - self.state =3D 2846 + self.state =3D 2850 self.match(VfrSyntaxParser.T__14) - self.state =3D 2847 + self.state =3D 2851 self.match(VfrSyntaxParser.T__5) - self.state =3D 2848 + self.state =3D 2852 self.match(VfrSyntaxParser.Number) - self.state =3D 2849 + self.state =3D 2853 self.match(VfrSyntaxParser.Comma) =20 =20 - self.state =3D 2852 + self.state =3D 2856 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2853 - self.vfrStatementExpressionSub() - self.state =3D 2854 + self.state =3D 2857 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2858 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19483,7 +19496,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.TUObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def UnIntVal(self): @@ -19514,16 +19527,16 @@ class VfrSyntaxParser ( Parser ): def unintExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.UnintExpContext(self, self._ctx, self= .state, ExpInfo) - self.enterRule(localctx, 378, self.RULE_unintExp) + self.enterRule(localctx, 380, self.RULE_unintExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2856 + self.state =3D 2860 self.match(VfrSyntaxParser.UnIntVal) - self.state =3D 2857 + self.state =3D 2861 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2858 - self.vfrStatementExpressionSub() - self.state =3D 2859 + self.state =3D 2862 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2863 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19540,7 +19553,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.TUObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def ToUpper(self): @@ -19571,16 +19584,16 @@ class VfrSyntaxParser ( Parser ): def toupperExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.ToupperExpContext(self, self._ctx, se= lf.state, ExpInfo) - self.enterRule(localctx, 380, self.RULE_toupperExp) + self.enterRule(localctx, 382, self.RULE_toupperExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2861 + self.state =3D 2865 self.match(VfrSyntaxParser.ToUpper) - self.state =3D 2862 + self.state =3D 2866 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2863 - self.vfrStatementExpressionSub() - self.state =3D 2864 + self.state =3D 2867 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2868 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19597,7 +19610,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.TLObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def ToLower(self): @@ -19628,16 +19641,16 @@ class VfrSyntaxParser ( Parser ): def tolwerExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.TolwerExpContext(self, self._ctx, sel= f.state, ExpInfo) - self.enterRule(localctx, 382, self.RULE_tolwerExp) + self.enterRule(localctx, 384, self.RULE_tolwerExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2866 + self.state =3D 2870 self.match(VfrSyntaxParser.ToLower) - self.state =3D 2867 + self.state =3D 2871 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2868 - self.vfrStatementExpressionSub() - self.state =3D 2869 + self.state =3D 2872 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2873 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19655,7 +19668,7 @@ class VfrSyntaxParser ( Parser ): self.parser =3D parser self.ExpInfo =3D None self.BaseInfo =3D EFI_VARSTORE_INFO() - self.TSObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Set(self): @@ -19703,35 +19716,35 @@ class VfrSyntaxParser ( Parser ): def setExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.SetExpContext(self, self._ctx, self.s= tate, ExpInfo) - self.enterRule(localctx, 384, self.RULE_setExp) + self.enterRule(localctx, 386, self.RULE_setExp) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2871 + self.state =3D 2875 self.match(VfrSyntaxParser.Set) - self.state =3D 2872 + self.state =3D 2876 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2873 + self.state =3D 2877 self.vfrStorageVarId(localctx.BaseInfo, False) - self.state =3D 2878 + self.state =3D 2882 self._errHandler.sync(self) _la =3D self._input.LA(1) if _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2874 + self.state =3D 2878 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2875 + self.state =3D 2879 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2876 + self.state =3D 2880 self.match(VfrSyntaxParser.T__5) - self.state =3D 2877 + self.state =3D 2881 self.numericVarStoreType() =20 =20 - self.state =3D 2880 + self.state =3D 2884 self.match(VfrSyntaxParser.Comma) - self.state =3D 2881 - self.vfrStatementExpressionSub() - self.state =3D 2882 + self.state =3D 2885 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2886 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19748,6 +19761,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None + self.Nodes =3D None self.ExpInfo =3D ExpInfo =20 def conditionalExp(self): @@ -19785,34 +19799,34 @@ class VfrSyntaxParser ( Parser ): def vfrExpressionTernaryOp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VfrExpressionTernaryOpContext(self, s= elf._ctx, self.state, ExpInfo) - self.enterRule(localctx, 386, self.RULE_vfrExpressionTernaryOp) + self.enterRule(localctx, 388, self.RULE_vfrExpressionTernaryOp) try: - self.state =3D 2889 + self.state =3D 2893 self._errHandler.sync(self) token =3D self._input.LA(1) if token in [VfrSyntaxParser.Cond]: self.enterOuterAlt(localctx, 1) - self.state =3D 2884 + self.state =3D 2888 self.conditionalExp(ExpInfo) pass elif token in [VfrSyntaxParser.Find]: self.enterOuterAlt(localctx, 2) - self.state =3D 2885 + self.state =3D 2889 self.findExp(ExpInfo) pass elif token in [VfrSyntaxParser.Mid]: self.enterOuterAlt(localctx, 3) - self.state =3D 2886 + self.state =3D 2890 self.midExp(ExpInfo) pass elif token in [VfrSyntaxParser.Tok]: self.enterOuterAlt(localctx, 4) - self.state =3D 2887 + self.state =3D 2891 self.tokenExp(ExpInfo) pass elif token in [VfrSyntaxParser.Span]: self.enterOuterAlt(localctx, 5) - self.state =3D 2888 + self.state =3D 2892 self.spanExp(ExpInfo) pass else: @@ -19833,7 +19847,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.CObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Cond(self): @@ -19870,24 +19884,24 @@ class VfrSyntaxParser ( Parser ): def conditionalExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.ConditionalExpContext(self, self._ctx= , self.state, ExpInfo) - self.enterRule(localctx, 388, self.RULE_conditionalExp) + self.enterRule(localctx, 390, self.RULE_conditionalExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2891 - self.match(VfrSyntaxParser.Cond) - self.state =3D 2892 - self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2893 - self.vfrStatementExpressionSub() - self.state =3D 2894 - self.match(VfrSyntaxParser.T__15) self.state =3D 2895 - self.vfrStatementExpressionSub() + self.match(VfrSyntaxParser.Cond) self.state =3D 2896 - self.match(VfrSyntaxParser.Colon) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 2897 - self.vfrStatementExpressionSub() + self.vfrStatementExpressionSub(localctx.Nodes) self.state =3D 2898 + self.match(VfrSyntaxParser.T__15) + self.state =3D 2899 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2900 + self.match(VfrSyntaxParser.Colon) + self.state =3D 2901 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2902 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -19904,7 +19918,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.FObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Find(self): @@ -19957,41 +19971,41 @@ class VfrSyntaxParser ( Parser ): def findExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.FindExpContext(self, self._ctx, self.= state, ExpInfo) - self.enterRule(localctx, 390, self.RULE_findExp) + self.enterRule(localctx, 392, self.RULE_findExp) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2900 + self.state =3D 2904 self.match(VfrSyntaxParser.Find) - self.state =3D 2901 + self.state =3D 2905 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2902 + self.state =3D 2906 self.findFormat(ExpInfo) - self.state =3D 2907 + self.state =3D 2911 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2903 + self.state =3D 2907 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2904 + self.state =3D 2908 self.findFormat(ExpInfo) - self.state =3D 2909 + self.state =3D 2913 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2910 - self.match(VfrSyntaxParser.Comma) - self.state =3D 2911 - self.vfrStatementExpressionSub() - self.state =3D 2912 - self.match(VfrSyntaxParser.Comma) - self.state =3D 2913 - self.vfrStatementExpressionSub() self.state =3D 2914 self.match(VfrSyntaxParser.Comma) self.state =3D 2915 - self.vfrStatementExpressionSub() + self.vfrStatementExpressionSub(localctx.Nodes) self.state =3D 2916 + self.match(VfrSyntaxParser.Comma) + self.state =3D 2917 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2918 + self.match(VfrSyntaxParser.Comma) + self.state =3D 2919 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2920 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -20032,11 +20046,11 @@ class VfrSyntaxParser ( Parser ): def findFormat(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.FindFormatContext(self, self._ctx, se= lf.state, ExpInfo) - self.enterRule(localctx, 392, self.RULE_findFormat) + self.enterRule(localctx, 394, self.RULE_findFormat) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2918 + self.state =3D 2922 _la =3D self._input.LA(1) if not(_la=3D=3DVfrSyntaxParser.Insensitive or _la=3D=3DVfrSyn= taxParser.Sensitive): self._errHandler.recoverInline(self) @@ -20058,7 +20072,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.MObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Mid(self): @@ -20098,24 +20112,24 @@ class VfrSyntaxParser ( Parser ): def midExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.MidExpContext(self, self._ctx, self.s= tate, ExpInfo) - self.enterRule(localctx, 394, self.RULE_midExp) + self.enterRule(localctx, 396, self.RULE_midExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2920 - self.match(VfrSyntaxParser.Mid) - self.state =3D 2921 - self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2922 - self.vfrStatementExpressionSub() - self.state =3D 2923 - self.match(VfrSyntaxParser.Comma) self.state =3D 2924 - self.vfrStatementExpressionSub() + self.match(VfrSyntaxParser.Mid) self.state =3D 2925 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 2926 - self.vfrStatementExpressionSub() + self.vfrStatementExpressionSub(localctx.Nodes) self.state =3D 2927 + self.match(VfrSyntaxParser.Comma) + self.state =3D 2928 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2929 + self.match(VfrSyntaxParser.Comma) + self.state =3D 2930 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2931 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -20132,7 +20146,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.TObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Tok(self): @@ -20172,24 +20186,24 @@ class VfrSyntaxParser ( Parser ): def tokenExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.TokenExpContext(self, self._ctx, self= .state, ExpInfo) - self.enterRule(localctx, 396, self.RULE_tokenExp) + self.enterRule(localctx, 398, self.RULE_tokenExp) try: self.enterOuterAlt(localctx, 1) - self.state =3D 2929 - self.match(VfrSyntaxParser.Tok) - self.state =3D 2930 - self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2931 - self.vfrStatementExpressionSub() - self.state =3D 2932 - self.match(VfrSyntaxParser.Comma) self.state =3D 2933 - self.vfrStatementExpressionSub() + self.match(VfrSyntaxParser.Tok) self.state =3D 2934 - self.match(VfrSyntaxParser.Comma) + self.match(VfrSyntaxParser.OpenParen) self.state =3D 2935 - self.vfrStatementExpressionSub() + self.vfrStatementExpressionSub(localctx.Nodes) self.state =3D 2936 + self.match(VfrSyntaxParser.Comma) + self.state =3D 2937 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2938 + self.match(VfrSyntaxParser.Comma) + self.state =3D 2939 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2940 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -20206,7 +20220,7 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.SObj =3D None + self.Nodes =3D [] self.ExpInfo =3D ExpInfo =20 def Span(self): @@ -20262,45 +20276,45 @@ class VfrSyntaxParser ( Parser ): def spanExp(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.SpanExpContext(self, self._ctx, self.= state, ExpInfo) - self.enterRule(localctx, 398, self.RULE_spanExp) + self.enterRule(localctx, 400, self.RULE_spanExp) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2938 + self.state =3D 2942 self.match(VfrSyntaxParser.Span) - self.state =3D 2939 + self.state =3D 2943 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2940 + self.state =3D 2944 self.match(VfrSyntaxParser.FLAGS) - self.state =3D 2941 + self.state =3D 2945 self.match(VfrSyntaxParser.T__5) - self.state =3D 2942 + self.state =3D 2946 self.spanFlags() - self.state =3D 2947 + self.state =3D 2951 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.BitWiseOr: - self.state =3D 2943 + self.state =3D 2947 self.match(VfrSyntaxParser.BitWiseOr) - self.state =3D 2944 + self.state =3D 2948 self.spanFlags() - self.state =3D 2949 + self.state =3D 2953 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2950 - self.match(VfrSyntaxParser.Comma) - self.state =3D 2951 - self.vfrStatementExpressionSub() - self.state =3D 2952 - self.match(VfrSyntaxParser.Comma) - self.state =3D 2953 - self.vfrStatementExpressionSub() self.state =3D 2954 self.match(VfrSyntaxParser.Comma) self.state =3D 2955 - self.vfrStatementExpressionSub() + self.vfrStatementExpressionSub(localctx.Nodes) self.state =3D 2956 + self.match(VfrSyntaxParser.Comma) + self.state =3D 2957 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2958 + self.match(VfrSyntaxParser.Comma) + self.state =3D 2959 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2960 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re @@ -20342,11 +20356,11 @@ class VfrSyntaxParser ( Parser ): def spanFlags(self): =20 localctx =3D VfrSyntaxParser.SpanFlagsContext(self, self._ctx, sel= f.state) - self.enterRule(localctx, 400, self.RULE_spanFlags) + self.enterRule(localctx, 402, self.RULE_spanFlags) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2958 + self.state =3D 2962 _la =3D self._input.LA(1) if not(((((_la - 246)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 246= )) & ((1 << (VfrSyntaxParser.LastNonMatch - 246)) | (1 << (VfrSyntaxParser.= FirstNonMatch - 246)) | (1 << (VfrSyntaxParser.Number - 246)))) !=3D 0)): self._errHandler.recoverInline(self) @@ -20368,7 +20382,8 @@ class VfrSyntaxParser ( Parser ): super().__init__(parent, invokingState) self.parser =3D parser self.ExpInfo =3D None - self.MObj =3D None + self.Nodes =3D [] + self.Node =3D IfrTreeNode() self.ExpInfo =3D ExpInfo =20 def Map(self): @@ -20421,35 +20436,35 @@ class VfrSyntaxParser ( Parser ): def vfrExpressionMap(self, ExpInfo): =20 localctx =3D VfrSyntaxParser.VfrExpressionMapContext(self, self._c= tx, self.state, ExpInfo) - self.enterRule(localctx, 402, self.RULE_vfrExpressionMap) + self.enterRule(localctx, 404, self.RULE_vfrExpressionMap) self._la =3D 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state =3D 2960 + self.state =3D 2964 self.match(VfrSyntaxParser.Map) - self.state =3D 2961 + self.state =3D 2965 self.match(VfrSyntaxParser.OpenParen) - self.state =3D 2962 - self.vfrStatementExpressionSub() - self.state =3D 2963 + self.state =3D 2966 + self.vfrStatementExpressionSub(localctx.Nodes) + self.state =3D 2967 self.match(VfrSyntaxParser.Colon) - self.state =3D 2971 + self.state =3D 2975 self._errHandler.sync(self) _la =3D self._input.LA(1) while _la=3D=3DVfrSyntaxParser.OpenParen or ((((_la - 192)) & = ~0x3f) =3D=3D 0 and ((1 << (_la - 192)) & ((1 << (VfrSyntaxParser.Cond - 19= 2)) | (1 << (VfrSyntaxParser.Find - 192)) | (1 << (VfrSyntaxParser.Mid - 19= 2)) | (1 << (VfrSyntaxParser.Tok - 192)) | (1 << (VfrSyntaxParser.Span - 19= 2)) | (1 << (VfrSyntaxParser.Dup - 192)) | (1 << (VfrSyntaxParser.VarEqVal = - 192)) | (1 << (VfrSyntaxParser.IdEqVal - 192)) | (1 << (VfrSyntaxParser.I= dEqId - 192)) | (1 << (VfrSyntaxParser.IdEqValList - 192)) | (1 << (VfrSynt= axParser.QuestionRef - 192)) | (1 << (VfrSyntaxParser.RuleRef - 192)) | (1 = << (VfrSyntaxParser.StringRef - 192)) | (1 << (VfrSyntaxParser.PushThis - 1= 92)) | (1 << (VfrSyntaxParser.Security - 192)) | (1 << (VfrSyntaxParser.Get= - 192)) | (1 << (VfrSyntaxParser.TrueSymbol - 192)) | (1 << (VfrSyntaxPars= er.FalseSymbol - 192)) | (1 << (VfrSyntaxParser.One - 192)) | (1 << (VfrSyn= taxParser.Ones - 192)) | (1 << (VfrSyntaxParser.Zero - 192)) | (1 << (VfrSy= ntaxParser.Undefined - 192)) | (1 << (VfrSyntaxParser.Version - 192)) | (1 = << (VfrSyntaxParser.Length - 192)) | (1 << (VfrSyntaxParser.NOT - 192)) | (= 1 << (VfrSyntaxParser.Set - 192)) | (1 << (VfrSyntaxParser.BitWiseNot - 192= )) | (1 << (VfrSyntaxParser.BoolVal - 192)) | (1 << (VfrSyntaxParser.String= Val - 192)) | (1 << (VfrSyntaxParser.UnIntVal - 192)) | (1 << (VfrSyntaxPar= ser.ToUpper - 192)) | (1 << (VfrSyntaxParser.ToLower - 192)) | (1 << (VfrSy= ntaxParser.Match - 192)) | (1 << (VfrSyntaxParser.Match2 - 192)) | (1 << (V= frSyntaxParser.Catenate - 192)) | (1 << (VfrSyntaxParser.QuestionRefVal - 1= 92)) | (1 << (VfrSyntaxParser.StringRefVal - 192)) | (1 << (VfrSyntaxParser= .Map - 192)) | (1 << (VfrSyntaxParser.Number - 192)))) !=3D 0): - self.state =3D 2964 - self.vfrStatementExpression() - self.state =3D 2965 + self.state =3D 2968 + self.vfrStatementExpression(localctx.Node) + self.state =3D 2969 self.match(VfrSyntaxParser.Comma) - self.state =3D 2966 - self.vfrStatementExpression() - self.state =3D 2967 + self.state =3D 2970 + self.vfrStatementExpression(localctx.Node) + self.state =3D 2971 self.match(VfrSyntaxParser.Semicolon) - self.state =3D 2973 + self.state =3D 2977 self._errHandler.sync(self) _la =3D self._input.LA(1) =20 - self.state =3D 2974 + self.state =3D 2978 self.match(VfrSyntaxParser.CloseParen) except RecognitionException as re: localctx.exception =3D re diff --git a/BaseTools/Source/Python/VfrCompiler/VfrSyntaxVisitor.py b/Base= Tools/Source/Python/VfrCompiler/VfrSyntaxVisitor.py index 8d0e907a75..7234c0675c 100644 --- a/BaseTools/Source/Python/VfrCompiler/VfrSyntaxVisitor.py +++ b/BaseTools/Source/Python/VfrCompiler/VfrSyntaxVisitor.py @@ -1,79 +1,69 @@ -from cgi import print_environ_usage -from email.errors import NonASCIILocalPartDefect, NonPrintableDefect -from enum import Flag -from fileinput import lineno -from http.client import ResponseNotReady -from itertools import count -from modulefinder import STORE_NAME -from msilib.schema import CreateFolder -from re import T -from sre_parse import FLAGS -from tokenize import Number +## @file +# The file is defined to parse Vfr syntax +# +# Copyright (c) 2022-, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + from antlr4 import * -from VfrCompiler.CommonCtypes import * -from VfrCompiler.VfrFormPkg import * -from VfrCompiler.VfrUtility import * -from VfrCompiler.VfrTree import * -import ctypes -import struct +from VfrCompiler.IfrCtypes import * +from VfrCompiler.IfrFormPkg import * +from VfrCompiler.IfrUtility import * +from VfrCompiler.IfrTree import * +from VfrCompiler.IfrError import * +from VfrCompiler.IfrPreProcess import * =20 if __name__ is not None and "." in __name__: from .VfrSyntaxParser import VfrSyntaxParser else: from VfrSyntaxParser import VfrSyntaxParser =20 -gCVfrVarDataTypeDB =3D CVfrVarDataTypeDB() -gCVfrDefaultStore =3D CVfrDefaultStore() -gCVfrDataStorage =3D CVfrDataStorage() =20 # This class defines a complete generic visitor for a parse tree produced = by VfrSyntaxParser. class VfrSyntaxVisitor(ParseTreeVisitor): - gZeroEfiIfrTypeValue =3D EFI_IFR_TYPE_VALUE() - - def __init__(self): - self.__OverrideClassGuid =3D None - self.__ParserStatus =3D 0 - self.__CIfrOpHdrIndex =3D -1 - self.__ConstantOnlyInExpression =3D False - self.__UsedDefaultArray =3D [] - - self.__CVfrRulesDB =3D CVfrRulesDB() - self.__CIfrOpHdr =3D [] # - self.__CIfrOpHdrLineNo =3D [] - self.__CurrQestVarInfo =3D EFI_VARSTORE_INFO() - - self.__CVfrQuestionDB =3D CVfrQuestionDB() - self.__CurrentQuestion =3D None - self.__CurrentMinMaxData =3D None # - - self.__IsStringOp =3D False - self.__IsOrderedList =3D False - self.__IsCheckBoxOp =3D False - self.__Root =3D VfrTreeNode() - + def __init__( + self, + PreProcessDB: PreProcessDB =3D None, + Root=3DNone, + OverrideClassGuid=3DNone, + QuestionDB: VfrQuestionDB =3D None, + ): + self.Root =3D Root if Root !=3D None else IfrTreeNode() + self.PreProcessDB =3D PreProcessDB + self.OverrideClassGuid =3D OverrideClassGuid + self.VfrQuestionDB =3D QuestionDB if QuestionDB !=3D None else Vfr= QuestionDB() + self.ParserStatus =3D 0 + self.Value =3D None + self.LastFormNode =3D None + self.IfrOpHdrIndex =3D 0 + self.ConstantOnlyInExpression =3D False + self.IfrOpHdr =3D [None] + self.IfrOpHdrLineNo =3D [0] + self.UsedDefaultArray =3D [] + self.VfrRulesDB =3D VfrRulesDB() + self.CurrQestVarInfo =3D EFI_VARSTORE_INFO() + self.CurrentQuestion =3D None + self.CurrentMinMaxData =3D None + self.IsStringOp =3D False + self.IsOrderedList =3D False + self.IsCheckBoxOp =3D False + self.NeedAdjustOpcode =3D False =20 # Visit a parse tree produced by VfrSyntaxParser#vfrProgram. - def visitVfrProgram(self, ctx:VfrSyntaxParser.VfrProgramContext): - - #self.__CVfrQuestionDB.PrintAllQuestion('test\\Questions.txt') - #gCVfrVarDataTypeDB.Dump("test\\DataTypeInfo.txt") - + def visitVfrProgram(self, ctx: VfrSyntaxParser.VfrProgramContext): return self.visitChildren(ctx) =20 # Visit a parse tree produced by VfrSyntaxParser#pragmaPackShowDef. - def visitPragmaPackShowDef(self, ctx:VfrSyntaxParser.PragmaPackShowDef= Context): - + def visitPragmaPackShowDef(self, ctx: VfrSyntaxParser.PragmaPackShowDe= fContext): Line =3D ctx.start.line - gCVfrVarDataTypeDB.Pack(Line, VFR_PACK_SHOW) + gVfrVarDataTypeDB.Pack(Line, VFR_PACK_SHOW) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#pragmaPackStackDef. - def visitPragmaPackStackDef(self, ctx:VfrSyntaxParser.PragmaPackStackD= efContext): + def visitPragmaPackStackDef(self, ctx: VfrSyntaxParser.PragmaPackStack= DefContext): + Identifier =3D self.TransId(ctx.StringIdentifier()) =20 - Identifier =3D self.__TransId(ctx.StringIdentifier()) - - if str(ctx.getChild(0)) =3D=3D 'push': + if str(ctx.getChild(0)) =3D=3D "push": Action =3D VFR_PACK_PUSH else: Action =3D VFR_PACK_POP @@ -81,217 +71,273 @@ class VfrSyntaxVisitor(ParseTreeVisitor): if ctx.Number() !=3D None: Action |=3D VFR_PACK_ASSIGN =20 - PackNumber =3D self.__TransNum(ctx.Number(), DEFAULT_PACK_ALIGN) + PackNumber =3D self.TransNum(ctx.Number(), DEFAULT_PACK_ALIGN) Line =3D ctx.start.line - gCVfrVarDataTypeDB.Pack(Line, Action, Identifier, PackNumber) + gVfrVarDataTypeDB.Pack(Line, Action, Identifier, PackNumber) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#pragmaPackNumber. - def visitPragmaPackNumber(self, ctx:VfrSyntaxParser.PragmaPackNumberCo= ntext): - + def visitPragmaPackNumber(self, ctx: VfrSyntaxParser.PragmaPackNumberC= ontext): Line =3D ctx.start.line - PackNumber =3D self.__TransNum(ctx.Number(), DEFAULT_PACK_ALIGN) + PackNumber =3D self.TransNum(ctx.Number(), DEFAULT_PACK_ALIGN) =20 - gCVfrVarDataTypeDB.Pack(Line, VFR_PACK_ASSIGN, None, PackNumber) + gVfrVarDataTypeDB.Pack(Line, VFR_PACK_ASSIGN, None, PackNumber) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrPragmaPackDefiniti= on. - def visitVfrPragmaPackDefinition( - self, ctx: VfrSyntaxParser.VfrPragmaPackDefinitionContext): + def visitVfrPragmaPackDefinition(self, ctx: VfrSyntaxParser.VfrPragmaP= ackDefinitionContext): return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrDataStructDefiniti= on. def visitVfrDataStructDefinition(self, ctx: VfrSyntaxParser.VfrDataStr= uctDefinitionContext): - - gCVfrVarDataTypeDB.DeclareDataTypeBegin() + gVfrVarDataTypeDB.DeclareDataTypeBegin() =20 if ctx.N1 !=3D None: - ReturnCode =3D gCVfrVarDataTypeDB.SetNewTypeName(ctx.N1.text) - self.__ErrorHandler(ReturnCode, ctx.N1.line, ctx.N1.text) + ReturnCode =3D gVfrVarDataTypeDB.SetNewTypeName(ctx.N1.text) + self.ErrorHandler(ReturnCode, ctx.N1.line, ctx.N1.text) =20 if ctx.N2 !=3D None: - ReturnCode =3D gCVfrVarDataTypeDB.SetNewTypeName(ctx.N2.text) - self.__ErrorHandler(ReturnCode, ctx.N2.line, ctx.N2.text) + ReturnCode =3D gVfrVarDataTypeDB.SetNewTypeName(ctx.N2.text) + self.ErrorHandler(ReturnCode, ctx.N2.line, ctx.N2.text) =20 self.visitChildren(ctx) =20 - gCVfrVarDataTypeDB.DeclareDataTypeEnd() - + gVfrVarDataTypeDB.DeclareDataTypeEnd() return None =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrDataUnionDefinitio= n. - def visitVfrDataUnionDefinition(self, ctx:VfrSyntaxParser.VfrDataUnion= DefinitionContext): - gCVfrVarDataTypeDB.DeclareDataTypeBegin() + def visitVfrDataUnionDefinition(self, ctx: VfrSyntaxParser.VfrDataUnio= nDefinitionContext): + gVfrVarDataTypeDB.DeclareDataTypeBegin() if ctx.N1 !=3D None: - ReturnCode =3D gCVfrVarDataTypeDB.SetNewTypeName(ctx.N1.text) - self.__ErrorHandler(ReturnCode, ctx.N1.line, ctx.N1.text) + ReturnCode =3D gVfrVarDataTypeDB.SetNewTypeName(ctx.N1.text) + self.ErrorHandler(ReturnCode, ctx.N1.line, ctx.N1.text) =20 if ctx.N2 !=3D None: - ReturnCode =3D gCVfrVarDataTypeDB.SetNewTypeName(ctx.N2.text) - self.__ErrorHandler(ReturnCode, ctx.N2.line, ctx.N2.text) + ReturnCode =3D gVfrVarDataTypeDB.SetNewTypeName(ctx.N2.text) + self.ErrorHandler(ReturnCode, ctx.N2.line, ctx.N2.text) =20 self.visitChildren(ctx) =20 - gCVfrVarDataTypeDB.DeclareDataTypeEnd() + gVfrVarDataTypeDB.DeclareDataTypeEnd() return None =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrDataStructFields. - def visitVfrDataStructFields(self, ctx:VfrSyntaxParser.VfrDataStructFi= eldsContext): - + def visitVfrDataStructFields(self, ctx: VfrSyntaxParser.VfrDataStructF= ieldsContext): return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructField64. - def visitDataStructField64(self, ctx:VfrSyntaxParser.DataStructField64= Context): - ArrayNum =3D self.__TransNum(ctx.Number()) - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text, 'UI= NT64', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + def visitDataStructField64(self, ctx: VfrSyntaxParser.DataStructField6= 4Context): + ArrayNum =3D self.TransNum(ctx.Number()) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "UINT64", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructField32. - def visitDataStructField32(self, ctx:VfrSyntaxParser.DataStructField32= Context): - ArrayNum =3D self.__TransNum(ctx.Number()) - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text, 'UI= NT32', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + def visitDataStructField32(self, ctx: VfrSyntaxParser.DataStructField3= 2Context): + ArrayNum =3D self.TransNum(ctx.Number()) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "UINT32", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructField16. - def visitDataStructField16(self, ctx:VfrSyntaxParser.DataStructField16= Context): - ArrayNum =3D self.__TransNum(ctx.Number()) - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text, 'UI= NT16', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + def visitDataStructField16(self, ctx: VfrSyntaxParser.DataStructField1= 6Context): + ArrayNum =3D self.TransNum(ctx.Number()) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "UINT16", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructField8. - def visitDataStructField8(self, ctx:VfrSyntaxParser.DataStructField8Co= ntext): - ArrayNum =3D self.__TransNum(ctx.Number()) - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text, 'UI= NT8', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + def visitDataStructField8(self, ctx: VfrSyntaxParser.DataStructField8C= ontext): + ArrayNum =3D self.TransNum(ctx.Number()) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "UINT8", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructFieldBool. - def visitDataStructFieldBool(self, ctx:VfrSyntaxParser.DataStructField= BoolContext): - ArrayNum =3D self.__TransNum(ctx.Number()) - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text, 'BO= OLEAN', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + def visitDataStructFieldBool(self, ctx: VfrSyntaxParser.DataStructFiel= dBoolContext): + ArrayNum =3D self.TransNum(ctx.Number()) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "BOOLEAN", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructFieldString= . - def visitDataStructFieldString(self, ctx:VfrSyntaxParser.DataStructFie= ldStringContext): - ArrayNum =3D self.__TransNum(ctx.Number()) - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text, 'EF= I_STRING_ID', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + def visitDataStructFieldString(self, ctx: VfrSyntaxParser.DataStructFi= eldStringContext): + ArrayNum =3D self.TransNum(ctx.Number()) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "EFI_STRING_ID", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructFieldDate. - def visitDataStructFieldDate(self, ctx:VfrSyntaxParser.DataStructField= DateContext): - ArrayNum =3D self.__TransNum(ctx.Number()) - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text, 'EF= I_HII_DATE', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + def visitDataStructFieldDate(self, ctx: VfrSyntaxParser.DataStructFiel= dDateContext): + ArrayNum =3D self.TransNum(ctx.Number()) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "EFI_HII_DATE", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructFieldTime. - def visitDataStructFieldTime(self, ctx:VfrSyntaxParser.DataStructField= TimeContext): - ArrayNum =3D self.__TransNum(ctx.Number()) - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text, 'EF= I_HII_TIME', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + def visitDataStructFieldTime(self, ctx: VfrSyntaxParser.DataStructFiel= dTimeContext): + ArrayNum =3D self.TransNum(ctx.Number()) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "EFI_HII_TIME", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructFieldRef. - def visitDataStructFieldRef(self, ctx:VfrSyntaxParser.DataStructFieldR= efContext): - ArrayNum =3D self.__TransNum(ctx.Number()) - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text, 'EF= I_HII_REF', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + def visitDataStructFieldRef(self, ctx: VfrSyntaxParser.DataStructField= RefContext): + ArrayNum =3D self.TransNum(ctx.Number()) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "EFI_HII_REF", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructFieldUser. - def visitDataStructFieldUser(self, ctx:VfrSyntaxParser.DataStructField= UserContext): - ArrayNum =3D self.__TransNum(ctx.Number()) - if ctx.T.text !=3D 'CHAR16': - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text,= ctx.T.text, ArrayNum, ctx.FieldInUnion) + def visitDataStructFieldUser(self, ctx: VfrSyntaxParser.DataStructFiel= dUserContext): + ArrayNum =3D self.TransNum(ctx.Number()) + if ctx.T.text !=3D "CHAR16": + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, ctx.T.text, ArrayNum, ctx.FieldInUnion + ) else: - ReturnCode =3D gCVfrVarDataTypeDB.DataTypeAddField(ctx.N.text,= 'UINT16', ArrayNum, ctx.FieldInUnion) - self.__ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) + ReturnCode =3D gVfrVarDataTypeDB.DataTypeAddField( + ctx.N.text, "UINT16", ArrayNum, ctx.FieldInUnion + ) + self.ErrorHandler(ReturnCode, ctx.N.line, ctx.N.text) return self.visitChildren(ctx) =20 # Visit a parse tree produced by VfrSyntaxParser#dataStructBitField64. - def visitDataStructBitField64(self, ctx:VfrSyntaxParser.DataStructBitF= ield64Context): - Width =3D self.__TransNum(ctx.Number()) + def visitDataStructBitField64(self, ctx: VfrSyntaxParser.DataStructBit= Field64Context): + Width =3D self.TransNum(ctx.Number()) if ctx.N !=3D None: - self.__ErrorHandler(gCVfrVarDataTypeDB.DataTypeAddBitField(ctx= .N.text, 'UINT64', Width, ctx.FieldInUnion), ctx.N.line, ctx.N.text) + self.ErrorHandler( + gVfrVarDataTypeDB.DataTypeAddBitField( + ctx.N.text, "UINT64", Width, ctx.FieldInUnion + ), + ctx.N.line, + ctx.N.text, + ) else: - self.__ErrorHandler(gCVfrVarDataTypeDB.DataTypeAddBitField(Non= e, 'UINT64', Width, ctx.FieldInUnion), ctx.D.line, ctx.D.text) + self.ErrorHandler( + gVfrVarDataTypeDB.DataTypeAddBitField(None, "UINT64", Widt= h, ctx.FieldInUnion), + ctx.D.line, + ctx.D.text, + ) =20 return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructBitField32. - def visitDataStructBitField32(self, ctx:VfrSyntaxParser.DataStructBitF= ield32Context): - Width =3D self.__TransNum(ctx.Number()) + def visitDataStructBitField32(self, ctx: VfrSyntaxParser.DataStructBit= Field32Context): + Width =3D self.TransNum(ctx.Number()) if ctx.N !=3D None: - self.__ErrorHandler(gCVfrVarDataTypeDB.DataTypeAddBitField(ctx= .N.text, 'UINT32', Width, ctx.FieldInUnion), ctx.N.line, ctx.N.text) + self.ErrorHandler( + gVfrVarDataTypeDB.DataTypeAddBitField( + ctx.N.text, "UINT32", Width, ctx.FieldInUnion + ), + ctx.N.line, + ctx.N.text, + ) else: - self.__ErrorHandler(gCVfrVarDataTypeDB.DataTypeAddBitField(Non= e, 'UINT32', Width, ctx.FieldInUnion), ctx.D.line, ctx.D.text) + self.ErrorHandler( + gVfrVarDataTypeDB.DataTypeAddBitField(None, "UINT32", Widt= h, ctx.FieldInUnion), + ctx.D.line, + ctx.D.text, + ) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructBitField16. - def visitDataStructBitField16(self, ctx:VfrSyntaxParser.DataStructBitF= ield16Context): - Width =3D self.__TransNum(ctx.Number()) + def visitDataStructBitField16(self, ctx: VfrSyntaxParser.DataStructBit= Field16Context): + Width =3D self.TransNum(ctx.Number()) if ctx.N !=3D None: - self.__ErrorHandler(gCVfrVarDataTypeDB.DataTypeAddBitField(ctx= .N.text, 'UINT16', Width, ctx.FieldInUnion), ctx.N.line, ctx.N.text) + self.ErrorHandler( + gVfrVarDataTypeDB.DataTypeAddBitField( + ctx.N.text, "UINT16", Width, ctx.FieldInUnion + ), + ctx.N.line, + ctx.N.text, + ) else: - self.__ErrorHandler(gCVfrVarDataTypeDB.DataTypeAddBitField(Non= e, 'UINT16', Width, ctx.FieldInUnion), ctx.D.line, ctx.D.text) + self.ErrorHandler( + gVfrVarDataTypeDB.DataTypeAddBitField(None, "UINT16", Widt= h, ctx.FieldInUnion), + ctx.D.line, + ctx.D.text, + ) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#dataStructBitField8. - def visitDataStructBitField8(self, ctx:VfrSyntaxParser.DataStructBitFi= eld8Context): - Width =3D self.__TransNum(ctx.Number()) + def visitDataStructBitField8(self, ctx: VfrSyntaxParser.DataStructBitF= ield8Context): + Width =3D self.TransNum(ctx.Number()) if ctx.N !=3D None: - self.__ErrorHandler(gCVfrVarDataTypeDB.DataTypeAddBitField(ctx= .N.text, 'UINT8', Width, ctx.FieldInUnion), ctx.N.line, ctx.N.text) + self.ErrorHandler( + gVfrVarDataTypeDB.DataTypeAddBitField(ctx.N.text, "UINT8",= Width, ctx.FieldInUnion), + ctx.N.line, + ctx.N.text, + ) else: - self.__ErrorHandler(gCVfrVarDataTypeDB.DataTypeAddBitField(Non= e, 'UINT8', Width, ctx.FieldInUnion), ctx.D.line, ctx.D.text) + self.ErrorHandler( + gVfrVarDataTypeDB.DataTypeAddBitField(None, "UINT8", Width= , ctx.FieldInUnion), + ctx.D.line, + ctx.D.text, + ) return self.visitChildren(ctx) =20 - def __DeclareStandardDefaultStorage(self, LineNo): - - DSObj =3D CIfrDefaultStore() - gCVfrDefaultStore.RegisterDefaultStore(DSObj.GetDefaultStore(), "S= tandard Defaults", EFI_STRING_ID_INVALID, EFI_HII_DEFAULT_CLASS_STANDARD) - DSObj.SetLineNo (LineNo) - DSObj.SetDefaultName (EFI_STRING_ID_INVALID) - DSObj.SetDefaultId (EFI_HII_DEFAULT_CLASS_STANDARD) - - DSObjMF =3D CIfrDefaultStore() - gCVfrDefaultStore.RegisterDefaultStore(DSObjMF.GetDefaultStore(), = "Standard ManuFacturing", EFI_STRING_ID_INVALID, EFI_HII_DEFAULT_CLASS_MANU= FACTURING) - DSObjMF.SetLineNo (LineNo) - DSObjMF.SetDefaultName (EFI_STRING_ID_INVALID) - DSObjMF.SetDefaultId (EFI_HII_DEFAULT_CLASS_MANUFACTURING) - + def DeclareStandardDefaultStorage(self, LineNo): + DSObj =3D IfrDefaultStore("Standard Defaults") + gVfrDefaultStore.RegisterDefaultStore( + DSObj.DefaultStore, + "Standard Defaults", + EFI_STRING_ID_INVALID, + EFI_HII_DEFAULT_CLASS_STANDARD, + ) + DSObj.SetLineNo(LineNo) + DSObj.SetDefaultName(EFI_STRING_ID_INVALID) + DSObj.SetDefaultId(EFI_HII_DEFAULT_CLASS_STANDARD) + DsNode =3D IfrTreeNode( + EFI_IFR_DEFAULTSTORE_OP, DSObj, gFormPkg.StructToStream(DSObj.= GetInfo()) + ) + + DSObjMF =3D IfrDefaultStore("Standard ManuFacturing") + gVfrDefaultStore.RegisterDefaultStore( + DSObjMF.DefaultStore, + "Standard ManuFacturing", + EFI_STRING_ID_INVALID, + EFI_HII_DEFAULT_CLASS_MANUFACTURING, + ) + DSObjMF.SetLineNo(LineNo) + DSObjMF.SetDefaultName(EFI_STRING_ID_INVALID) + DSObjMF.SetDefaultId(EFI_HII_DEFAULT_CLASS_MANUFACTURING) + DsNodeMF =3D IfrTreeNode( + EFI_IFR_DEFAULTSTORE_OP, DSObjMF, gFormPkg.StructToStream(DSOb= jMF.GetInfo()) + ) + + return DsNode, DsNodeMF =20 # Visit a parse tree produced by VfrSyntaxParser#vfrFormSetDefinition. - def visitVfrFormSetDefinition(self, ctx:VfrSyntaxParser.VfrFormSetDefi= nitionContext): - self.__InsertChild(self.__Root, ctx) - self.__InsertChild(ctx.Node, ctx.classDefinition()) - self.__InsertChild(ctx.Node, ctx.subclassDefinition()) - Line =3D ctx.start.line - self.__DeclareStandardDefaultStorage(Line) + def visitVfrFormSetDefinition(self, ctx: VfrSyntaxParser.VfrFormSetDef= initionContext): + self.InsertChild(self.Root, ctx) + self.InsertChild(ctx.Node, ctx.classDefinition()) + self.InsertChild(ctx.Node, ctx.subclassDefinition()) + + DsNode, DsNodeMF =3D self.DeclareStandardDefaultStorage(ctx.start.= line) + ctx.Node.insertChild(DsNode) + ctx.Node.insertChild(DsNodeMF) =20 self.visitChildren(ctx) + ClassGuidNum =3D 0 GuidList =3D [] if ctx.classguidDefinition() !=3D None: @@ -300,68 +346,101 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 DefaultClassGuid =3D EFI_HII_PLATFORM_SETUP_FORMSET_GUID =20 - if (self.__OverrideClassGuid !=3D None and ClassGuidNum >=3D4): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , Line, None, 'Already has 4 class guids, can not add extra class guid!') + if self.OverrideClassGuid !=3D None and ClassGuidNum >=3D 4: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.start.line, + None, + "Already has 4 class guids, can not add extra class guid!"= , + ) =20 if ClassGuidNum =3D=3D 0: - if self.__OverrideClassGuid !=3D None: - ClassGuidNum =3D 2 + if self.OverrideClassGuid !=3D None: + ClassGuidNum =3D 2 else: - ClassGuidNum =3D 1 - FSObj =3D CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum = * sizeof(EFI_GUID)) + ClassGuidNum =3D 1 + FSObj =3D IfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum *= sizeof(EFI_GUID)) FSObj.SetClassGuid(DefaultClassGuid) - if (self.__OverrideClassGuid !=3D None): - FSObj.SetClassGuid(self.__OverrideClassGuid) + if self.OverrideClassGuid !=3D None: + FSObj.SetClassGuid(self.OverrideClassGuid) =20 elif ClassGuidNum =3D=3D 1: - if self.__OverrideClassGuid !=3D None: - ClassGuidNum +=3D 1 - FSObj =3D CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum = * sizeof(EFI_GUID)) + if self.OverrideClassGuid !=3D None: + ClassGuidNum +=3D 1 + FSObj =3D IfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum *= sizeof(EFI_GUID)) FSObj.SetClassGuid(GuidList[0]) - if (self.__OverrideClassGuid !=3D None): - FSObj.SetClassGuid(self.__OverrideClassGuid) + if self.OverrideClassGuid !=3D None: + FSObj.SetClassGuid(self.OverrideClassGuid) =20 elif ClassGuidNum =3D=3D 2: - if self.__OverrideClassGuid !=3D None: + if self.OverrideClassGuid !=3D None: ClassGuidNum +=3D 1 - FSObj =3D CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum = * sizeof(EFI_GUID)) + FSObj =3D IfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum *= sizeof(EFI_GUID)) FSObj.SetClassGuid(GuidList[0]) FSObj.SetClassGuid(GuidList[1]) - if (self.__OverrideClassGuid !=3D None): - FSObj.SetClassGuid(self.__OverrideClassGuid) + if self.OverrideClassGuid !=3D None: + FSObj.SetClassGuid(self.OverrideClassGuid) =20 elif ClassGuidNum =3D=3D 3: - if self.__OverrideClassGuid !=3D None: - ClassGuidNum +=3D 1 - FSObj =3D CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum = * sizeof(EFI_GUID)) + if self.OverrideClassGuid !=3D None: + ClassGuidNum +=3D 1 + FSObj =3D IfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum *= sizeof(EFI_GUID)) FSObj.SetClassGuid(GuidList[0]) FSObj.SetClassGuid(GuidList[1]) FSObj.SetClassGuid(GuidList[2]) - if (self.__OverrideClassGuid !=3D None): - FSObj.SetClassGuid(self.__OverrideClassGuid) + if self.OverrideClassGuid !=3D None: + FSObj.SetClassGuid(self.OverrideClassGuid) =20 elif ClassGuidNum =3D=3D 4: - if self.__OverrideClassGuid !=3D None: - ClassGuidNum +=3D 1 - FSObj =3D CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum = * sizeof(EFI_GUID)) + if self.OverrideClassGuid !=3D None: + ClassGuidNum +=3D 1 + FSObj =3D IfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum *= sizeof(EFI_GUID)) FSObj.SetClassGuid(GuidList[0]) FSObj.SetClassGuid(GuidList[1]) FSObj.SetClassGuid(GuidList[2]) FSObj.SetClassGuid(GuidList[3]) =20 - FSObj.SetLineNo(Line) + FSObj.SetLineNo(ctx.start.line) FSObj.SetGuid(ctx.guidDefinition().Guid) - FSObj.SetFormSetTitle(self.__TransNum(ctx.Number(0))) - FSObj.SetHelp(self.__TransNum(ctx.Number(1))) + FSObj.SetFormSetTitle(self.TransNum(ctx.Number(0))) + FSObj.SetHelp(self.TransNum(ctx.Number(1))) + FSObj.SetClassGuidNum(len(GuidList)) =20 ctx.Node.Data =3D FSObj - # Declare undefined Question so that they can be used in expressio= n. + ctx.Node.Buffer =3D gFormPkg.StructToStream(FSObj.GetInfo()) + if len(GuidList) =3D=3D 0: + ctx.Node.Buffer +=3D gFormPkg.StructToStream(DefaultClassGuid) + else: + for i in range(0, len(GuidList)): + ctx.Node.Buffer +=3D gFormPkg.StructToStream(GuidList[i]) =20 + # Declare undefined Question so that they can be used in expressio= n. + InsertOpCodeList =3D None + if gFormPkg.HavePendingUnassigned(): + InsertOpCodeList, ReturnCode =3D gFormPkg.DeclarePendingQuesti= on( + gVfrVarDataTypeDB, gVfrDataStorage, self.VfrQuestionDB, ct= x.stop.line + ) + Status =3D 0 if ReturnCode =3D=3D VfrReturnCode.VFR_RETURN_SUC= CESS else 1 + self.ParserStatus +=3D Status + self.NeedAdjustOpcode =3D True + + self.InsertEndNode(ctx.Node, ctx.stop.line) + + if self.NeedAdjustOpcode: + self.LastFormNode.Child.pop() + for InsertOpCode in InsertOpCodeList: + InsertNode =3D IfrTreeNode( + InsertOpCode.OpCode, + InsertOpCode.Data, + gFormPkg.StructToStream(InsertOpCode.Data.GetInfo()), + ) + self.LastFormNode.insertChild(InsertNode) + + gFormPkg.BuildPkg(self.Root) return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#classguidDefinition. - def visitClassguidDefinition(self, ctx:VfrSyntaxParser.ClassguidDefini= tionContext): - + def visitClassguidDefinition(self, ctx: VfrSyntaxParser.ClassguidDefin= itionContext): self.visitChildren(ctx) =20 for GuidCtx in ctx.guidDefinition(): @@ -369,10 +448,9 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#classDefinition. - def visitClassDefinition(self, ctx:VfrSyntaxParser.ClassDefinitionCont= ext): - CObj =3D CIfrClass() + def visitClassDefinition(self, ctx: VfrSyntaxParser.ClassDefinitionCon= text): + CObj =3D IfrClass() self.visitChildren(ctx) Class =3D 0 for ClassNameCtx in ctx.validClassNames(): @@ -380,14 +458,14 @@ class VfrSyntaxVisitor(ParseTreeVisitor): Line =3D ctx.start.line CObj.SetLineNo(Line) CObj.SetClass(Class) + CObj.SetClassStr(self.ExtractOriginalText(ctx)) ctx.Node.Data =3D CObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(CObj.GetInfo()) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#validClassNames. - def visitValidClassNames(self, ctx:VfrSyntaxParser.ValidClassNamesCont= ext): - + def visitValidClassNames(self, ctx: VfrSyntaxParser.ValidClassNamesCon= text): self.visitChildren(ctx) =20 if ctx.ClassNonDevice() !=3D None: @@ -405,14 +483,13 @@ class VfrSyntaxVisitor(ParseTreeVisitor): elif ctx.ClassOtherDevice() !=3D None: ctx.ClassName =3D EFI_OTHER_DEVICE_CLASS else: - ctx.ClassName =3D self.__TransNum(ctx.Number()) + ctx.ClassName =3D self.TransNum(ctx.Number()) =20 return ctx.ClassName =20 - # Visit a parse tree produced by VfrSyntaxParser#subclassDefinition. - def visitSubclassDefinition(self, ctx:VfrSyntaxParser.SubclassDefiniti= onContext): - SubObj =3D CIfrSubClass() + def visitSubclassDefinition(self, ctx: VfrSyntaxParser.SubclassDefinit= ionContext): + SubObj =3D IfrSubClass() =20 self.visitChildren(ctx) =20 @@ -428,24 +505,26 @@ class VfrSyntaxVisitor(ParseTreeVisitor): elif ctx.SubclassSingleUse() !=3D None: SubClass |=3D EFI_SINGLE_USE_SUBCLASS else: - SubClass =3D self.__TransNum(ctx.Number()) + SubClass =3D self.TransNum(ctx.Number()) =20 SubObj.SetSubClass(SubClass) + SubObj.SetSubClassStr(self.ExtractOriginalText(ctx)) + ctx.Node.Data =3D SubObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(SubObj.GetInfo()) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrFormSetList. - def visitVfrFormSetList(self, ctx:VfrSyntaxParser.VfrFormSetListContex= t): + def visitVfrFormSetList(self, ctx: VfrSyntaxParser.VfrFormSetListConte= xt): self.visitChildren(ctx) for Ctx in ctx.vfrFormSet(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrFormSet. - def visitVfrFormSet(self, ctx:VfrSyntaxParser.VfrFormSetContext): + def visitVfrFormSet(self, ctx: VfrSyntaxParser.VfrFormSetContext): self.visitChildren(ctx) =20 if ctx.vfrFormDefinition() !=3D None: @@ -472,75 +551,91 @@ class VfrSyntaxVisitor(ParseTreeVisitor): return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementDefaultSt= ore. - def visitVfrStatementDefaultStore(self, ctx:VfrSyntaxParser.VfrStateme= ntDefaultStoreContext): - DSObj =3D CIfrDefaultStore() + def visitVfrStatementDefaultStore(self, ctx: VfrSyntaxParser.VfrStatem= entDefaultStoreContext): Line =3D ctx.start.line self.visitChildren(ctx) =20 RefName =3D ctx.N.text - DefaultStoreNameId =3D self.__TransNum(ctx.S.text) - - DefaultId =3D EFI_HII_DEFAULT_CLASS_STANDARD if ctx.Attribute()=3D= =3D None else self.__TransNum(ctx.A.text) - - if gCVfrDefaultStore.DefaultIdRegistered(DefaultId) =3D=3D False: - self.__ErrorHandler(gCVfrDefaultStore.RegisterDefaultStore(DSO= bj.GetDefaultStore(), RefName, DefaultStoreNameId, DefaultId) , Line) + DSObj =3D IfrDefaultStore(RefName) + DefaultStoreNameId =3D self.TransNum(ctx.S.text) + DefaultId =3D ( + EFI_HII_DEFAULT_CLASS_STANDARD if ctx.Attribute() =3D=3D None = else self.TransNum(ctx.A.text) + ) + if ctx.Attribute() !=3D None: + DSObj.HasAttr =3D True + + if gVfrDefaultStore.DefaultIdRegistered(DefaultId) =3D=3D False: + self.ErrorHandler( + gVfrDefaultStore.RegisterDefaultStore( + DSObj.DefaultStore, RefName, DefaultStoreNameId, Defau= ltId + ), + Line, + ) DSObj.SetDefaultName(DefaultStoreNameId) - DSObj.SetDefaultId (DefaultId) + DSObj.SetDefaultId(DefaultId) DSObj.SetLineNo(Line) + ctx.Node.Data =3D DSObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(DSObj.GetInfo()) else: - pNode, ReturnCode =3D gCVfrDefaultStore.ReRegisterDefaultStore= ById(DefaultId, RefName, DefaultStoreNameId) - self.__ErrorHandler(ReturnCode, Line) - DSObj.SetDefaultStore =3D pNode.ObjAddr - DSObj.SetLineNo(Line) - - ctx.Node.Data =3D DSObj - + pNode, ReturnCode =3D gVfrDefaultStore.ReRegisterDefaultStoreB= yId( + DefaultId, RefName, DefaultStoreNameId + ) + self.ErrorHandler(ReturnCode, Line) + ctx.Node.OpCode =3D EFI_IFR_SHOWN_DEFAULTSTORE_OP # For displ= ay in YAML + DSObj.SetDefaultId(DefaultId) + DSObj.SetDefaultName(DefaultStoreNameId) + ctx.Node.Data =3D DSObj return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementVarStoreL= inear. - def visitVfrStatementVarStoreLinear(self, ctx:VfrSyntaxParser.VfrState= mentVarStoreLinearContext): - VSObj =3D CIfrVarStore() + def visitVfrStatementVarStoreLinear( + self, ctx: VfrSyntaxParser.VfrStatementVarStoreLinearContext + ): self.visitChildren(ctx) - Line =3D ctx.start.line - VSObj.SetLineNo(Line) =20 TypeName =3D str(ctx.getChild(1)) - if TypeName =3D=3D 'CHAR16': - TypeName =3D 'UINT16' + if TypeName =3D=3D "CHAR16": + TypeName =3D "UINT16" =20 IsBitVarStore =3D False if ctx.TN !=3D None: - IsBitVarStore =3D gCVfrVarDataTypeDB.DataTypeHasBitField(ctx.T= N.text) + IsBitVarStore =3D gVfrVarDataTypeDB.DataTypeHasBitField(ctx.TN= .text) =20 VarStoreId =3D EFI_VARSTORE_ID_INVALID if ctx.VarId() !=3D None: - VarStoreId =3D self.__TransNum(ctx.ID.text) - self.__CompareErrorHandler(VarStoreId!=3D0, True, ctx.ID.line,= ctx.ID.text, 'varid 0 is not allowed.') + VarStoreId =3D self.TransNum(ctx.ID.text) + self.CompareErrorHandler( + VarStoreId !=3D 0, True, ctx.ID.line, ctx.ID.text, "varid = 0 is not allowed." + ) StoreName =3D ctx.SN.text + VSObj =3D IfrVarStore(TypeName, StoreName) + Line =3D ctx.start.line + VSObj.SetLineNo(Line) + VSObj.SetHasVarStoreId(ctx.VarId() !=3D None) Guid =3D ctx.guidDefinition().Guid - self.__ErrorHandler(gCVfrDataStorage.DeclareBufferVarStore(StoreNa= me, Guid, gCVfrVarDataTypeDB, TypeName, VarStoreId, IsBitVarStore), Line) + self.ErrorHandler( + gVfrDataStorage.DeclareBufferVarStore( + StoreName, Guid, gVfrVarDataTypeDB, TypeName, VarStoreId, = IsBitVarStore + ), + Line, + ) VSObj.SetGuid(Guid) - VarStoreId, ReturnCode =3D gCVfrDataStorage.GetVarStoreId(StoreNam= e, Guid) - self.__ErrorHandler(ReturnCode, ctx.SN.line, ctx.SN.text) + VarStoreId, ReturnCode =3D gVfrDataStorage.GetVarStoreId(StoreName= , Guid) + self.ErrorHandler(ReturnCode, ctx.SN.line, ctx.SN.text) VSObj.SetVarStoreId(VarStoreId) - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSizeByTypeName(= TypeName) - self.__ErrorHandler(ReturnCode, Line) + Size, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSizeByTypeName(T= ypeName) + self.ErrorHandler(ReturnCode, Line) VSObj.SetSize(Size) - VSObj.SetName(StoreName) - ctx.Node.Data =3D VSObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(VSObj.GetInfo()) + ctx.Node.Buffer +=3D bytes("\0", encoding=3D"utf-8") =20 return VSObj =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementVarStoreE= fi. - def visitVfrStatementVarStoreEfi(self, ctx:VfrSyntaxParser.VfrStatemen= tVarStoreEfiContext): - - VSEObj =3D CIfrVarStoreEfi() + def visitVfrStatementVarStoreEfi(self, ctx: VfrSyntaxParser.VfrStateme= ntVarStoreEfiContext): self.visitChildren(ctx) Line =3D ctx.start.line - VSEObj.SetLineNo(Line) =20 Guid =3D ctx.guidDefinition().Guid =20 @@ -549,76 +644,128 @@ class VfrSyntaxVisitor(ParseTreeVisitor): VarStoreId =3D EFI_VARSTORE_ID_INVALID IsUEFI23EfiVarstore =3D True ReturnCode =3D None + NameStringId =3D None + VarSize =3D None =20 TypeName =3D str(ctx.getChild(1)) =20 - if TypeName =3D=3D 'CHAR16': - TypeName =3D 'UINT16' + if TypeName =3D=3D "CHAR16": + TypeName =3D "UINT16" =20 elif ctx.TN !=3D None: CustomizedName =3D True - IsBitVarStore =3D gCVfrVarDataTypeDB.DataTypeHasBitField(TypeN= ame) + IsBitVarStore =3D gVfrVarDataTypeDB.DataTypeHasBitField(TypeNa= me) =20 if ctx.VarId() !=3D None: - VarStoreId =3D self.__TransNum(ctx.ID.text) - self.__CompareErrorHandler(VarStoreId!=3D0, True, ctx.ID.line,= ctx.ID.text, 'varid 0 is not allowed.') + VarStoreId =3D self.TransNum(ctx.ID.text) + self.CompareErrorHandler( + VarStoreId !=3D 0, True, ctx.ID.line, ctx.ID.text, "varid = 0 is not allowed." + ) =20 Attributes =3D 0 - for AtrCtx in ctx.vfrVarStoreEfiAttr(): - Attributes |=3D AtrCtx.Attr - VSEObj.SetAttributes(Attributes) + AttributesText =3D "" + for i in range(0, len(ctx.vfrVarStoreEfiAttr())): + Attributes |=3D ctx.vfrVarStoreEfiAttr(i).Attr + + if i !=3D len(ctx.vfrVarStoreEfiAttr()) - 1: + AttributesText +=3D f"{ctx.vfrVarStoreEfiAttr(i).Attr:#010= x} | " + else: + AttributesText +=3D f"{ctx.vfrVarStoreEfiAttr(i).Attr:#010= x}" =20 if ctx.SN !=3D None: StoreName =3D ctx.SN.text else: IsUEFI23EfiVarstore =3D False - NameStringId =3D self.__TransNum(ctx.VN.text) - StoreName =3D gCVfrStringDB.GetVarStoreNameFromStringId(NameSt= ringId) # + NameStringId =3D self.TransNum(ctx.VN.text) + StoreName =3D gVfrStringDB.GetVarStoreNameFromStringId(NameStr= ingId) # if StoreName =3D=3D None: - gCVfrErrorHandle.HandleWarning(VfrReturnCode.VFR_RETURN_UN= SUPPORTED, ctx.VN.line, 'Can\'t get varstore name for this StringId!') - if not(CustomizedName): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line, 'Old style efivarstore must have String Identifier!') - Size =3D self.__TransNum(ctx.N.text) - if Size =3D=3D 1: TypeName =3D 'UINT8' - elif Size =3D=3D 2: TypeName =3D 'UINT16' - elif Size =3D=3D 4: TypeName =3D 'UINT32' - elif Size =3D=3D 8: TypeName =3D 'UINT64' + gVfrErrorHandle.HandleWarning( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + ctx.VN.line, + "Can't get varstore name for this StringId!", + ) + if not (CustomizedName): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + Line, + "Old style efivarstore must have String Identifier!", + ) + Size =3D self.TransNum(ctx.N.text) + if Size =3D=3D 1: + TypeName =3D "UINT8" + elif Size =3D=3D 2: + TypeName =3D "UINT16" + elif Size =3D=3D 4: + TypeName =3D "UINT32" + elif Size =3D=3D 8: + TypeName =3D "UINT64" else: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = ctx.N.line, ctx.N.text) + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ct= x.N.line, ctx.N.text) =20 if IsUEFI23EfiVarstore: - self.__ErrorHandler(gCVfrDataStorage.DeclareBufferVarStore(Sto= reName, Guid, gCVfrVarDataTypeDB, TypeName, VarStoreId, IsBitVarStore, Attr= ibutes), Line) - VarStoreId, ReturnCode =3D gCVfrDataStorage.GetVarStoreId(Stor= eName, Guid) - self.__ErrorHandler(ReturnCode, ctx.SN.line, ctx.SN.text) - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSizeByTypeN= ame(TypeName) - self.__ErrorHandler(ReturnCode, Line) + self.ErrorHandler( + gVfrDataStorage.DeclareBufferVarStore( + StoreName, + Guid, + gVfrVarDataTypeDB, + TypeName, + VarStoreId, + IsBitVarStore, + Attributes, + ), + Line, + ) + VarStoreId, ReturnCode =3D gVfrDataStorage.GetVarStoreId(Store= Name, Guid) + self.ErrorHandler(ReturnCode, ctx.SN.line, ctx.SN.text) + Size, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSizeByTypeNa= me(TypeName) + self.ErrorHandler(ReturnCode, Line) else: - self.__ErrorHandler(gCVfrDataStorage.DeclareBufferVarStore(sel= f.__GetText(ctx.TN), Guid, gCVfrVarDataTypeDB, TypeName, VarStoreId, IsBitV= arStore, Attributes), Line) # - VarStoreId, ReturnCode =3D gCVfrDataStorage.GetVarStoreId(self= .__GetText(ctx.TN), Guid) - self.__ErrorHandler(ReturnCode, ctx.VN.line, ctx.VN.text) - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSizeByTypeN= ame(TypeName) - self.__ErrorHandler(ReturnCode, ctx.N.line) - + self.ErrorHandler( + gVfrDataStorage.DeclareBufferVarStore( + self.GetText(ctx.TN), + Guid, + gVfrVarDataTypeDB, + TypeName, + VarStoreId, + IsBitVarStore, + Attributes, + ), + Line, + ) # + VarStoreId, ReturnCode =3D gVfrDataStorage.GetVarStoreId(self.= GetText(ctx.TN), Guid) + self.ErrorHandler(ReturnCode, ctx.VN.line, ctx.VN.text) + Size, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSizeByTypeNa= me(TypeName) + self.ErrorHandler(ReturnCode, ctx.N.line) + + VSEObj =3D IfrVarStoreEfi(TypeName, StoreName) + VSEObj.SetLineNo(Line) + VSEObj.SetHasVarStoreId(ctx.VarId() !=3D None) VSEObj.SetGuid(Guid) - VSEObj.SetVarStoreId (VarStoreId) + VSEObj.SetVarStoreId(VarStoreId) VSEObj.SetSize(Size) - VSEObj.SetName(StoreName) + VSEObj.SetAttributes(Attributes) + VSEObj.SetAttributesText(AttributesText) + VSEObj.SetNameStringId(NameStringId) + VSEObj.SetVarSize(VarSize) =20 ctx.Node.Data =3D VSEObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(VSEObj.GetInfo()) + ctx.Node.Buffer +=3D bytes("\0", encoding=3D"utf-8") =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrVarStoreEfiAttr. - def visitVfrVarStoreEfiAttr(self, ctx:VfrSyntaxParser.VfrVarStoreEfiAt= trContext): - + def visitVfrVarStoreEfiAttr(self, ctx: VfrSyntaxParser.VfrVarStoreEfiA= ttrContext): self.visitChildren(ctx) - ctx.Attr =3D self.__TransNum(ctx.Number()) + ctx.Attr =3D self.TransNum(ctx.Number()) return ctx.Attr =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementVarStoreN= ameValue. - def visitVfrStatementVarStoreNameValue(self, ctx:VfrSyntaxParser.VfrSt= atementVarStoreNameValueContext): - - VSNVObj =3D CIfrVarStoreNameValue() + def visitVfrStatementVarStoreNameValue( + self, ctx: VfrSyntaxParser.VfrStatementVarStoreNameValueContext + ): + StoreName =3D ctx.SN.text + VSNVObj =3D IfrVarStoreNameValue(StoreName) self.visitChildren(ctx) =20 Guid =3D ctx.guidDefinition().Guid @@ -627,118 +774,118 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 if ctx.VarId() !=3D None: HasVarStoreId =3D True - VarStoreId =3D self.__TransNum(ctx.ID.text) - self.__CompareErrorHandler(VarStoreId !=3D0, True, ctx.ID.line= , ctx.ID.text, 'varid 0 is not allowed') + VarStoreId =3D self.TransNum(ctx.ID.text) + self.CompareErrorHandler( + VarStoreId !=3D 0, True, ctx.ID.line, ctx.ID.text, "varid = 0 is not allowed" + ) =20 - StoreName =3D ctx.SN.text Created =3D False =20 - sIndex =3D 0 if HasVarStoreId =3D=3D False else 1 - eIndex =3D len(ctx.Name()) + sIndex =3D 0 if HasVarStoreId =3D=3D False else 1 + eIndex =3D sIndex + len(ctx.Name()) for i in range(sIndex, eIndex): if Created =3D=3D False: - self.__ErrorHandler(gCVfrDataStorage.DeclareNameVarStoreBe= gin(StoreName, VarStoreId), ctx.SN.line, ctx.SN.text) + self.ErrorHandler( + gVfrDataStorage.DeclareNameVarStoreBegin(StoreName, Va= rStoreId), + ctx.SN.line, + ctx.SN.text, + ) Created =3D True - Item =3D self.__TransNum(ctx.Number(i)) - gCVfrDataStorage.NameTableAddItem(Item) + Item =3D self.TransNum(ctx.Number(i)) + VSNVObj.SetNameItemList(Item) + gVfrDataStorage.NameTableAddItem(Item) =20 - gCVfrDataStorage.DeclareNameVarStoreEnd(Guid) + gVfrDataStorage.DeclareNameVarStoreEnd(Guid) =20 VSNVObj.SetLineNo(ctx.start.line) VSNVObj.SetGuid(Guid) - VarstoreId, ReturnCode =3D gCVfrDataStorage.GetVarStoreId(StoreNam= e, Guid) - self.__ErrorHandler(ReturnCode, ctx.SN.line, ctx.SN.text) + VarstoreId, ReturnCode =3D gVfrDataStorage.GetVarStoreId(StoreName= , Guid) + self.ErrorHandler(ReturnCode, ctx.SN.line, ctx.SN.text) VSNVObj.SetVarStoreId(VarstoreId) + VSNVObj.SetHasVarStoreId(HasVarStoreId) =20 ctx.Node.Data =3D VSNVObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(VSNVObj.GetInfo()) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementDisableIf= FormSet. - def visitVfrStatementDisableIfFormSet(self, ctx:VfrSyntaxParser.VfrSta= tementDisableIfFormSetContext): - - DIObj =3D CIfrDisableIf() + def visitVfrStatementDisableIfFormSet( + self, ctx: VfrSyntaxParser.VfrStatementDisableIfFormSetContext + ): + DIObj =3D IfrDisableIf() DIObj.SetLineNo(ctx.start.line) - self.__ConstantOnlyInExpression =3D True + self.ConstantOnlyInExpression =3D True ctx.Node.Data =3D DIObj - Condition =3D 'disableif' + ' ' + self.__ExtractOriginalText(ctx.v= frStatementExpression()) - ctx.Node.Condition =3D Condition + ctx.Node.Condition =3D ( + "disableif" + " " + self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) self.visitChildren(ctx) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementSuppressI= fFormSet. - def visitVfrStatementSuppressIfFormSet(self, ctx:VfrSyntaxParser.VfrSt= atementSuppressIfFormSetContext): - - SIObj =3D CIfrSuppressIf() + def visitVfrStatementSuppressIfFormSet( + self, ctx: VfrSyntaxParser.VfrStatementSuppressIfFormSetContext + ): + SIObj =3D IfrSuppressIf() SIObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D SIObj - Condition =3D 'suppressif' + ' ' + self.__ExtractOriginalText(ctx= .vfrStatementExpression()) - ctx.Node.Condition =3D Condition + ctx.Node.Condition =3D ( + "suppressif" + " " + self.ExtractOriginalText(ctx.vfrStatement= Expression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) self.visitChildren(ctx) + self.InsertEndNode(ctx.Node, ctx.stop.line) return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#guidSubDefinition. - def visitGuidSubDefinition(self, ctx:VfrSyntaxParser.GuidSubDefinition= Context): - - ctx.Guid.Data4[0] =3D self.__TransNum(ctx.Number(0)) - ctx.Guid.Data4[1] =3D self.__TransNum(ctx.Number(1)) - ctx.Guid.Data4[2] =3D self.__TransNum(ctx.Number(2)) - ctx.Guid.Data4[3] =3D self.__TransNum(ctx.Number(3)) - ctx.Guid.Data4[4] =3D self.__TransNum(ctx.Number(4)) - ctx.Guid.Data4[5] =3D self.__TransNum(ctx.Number(5)) - ctx.Guid.Data4[6] =3D self.__TransNum(ctx.Number(6)) - ctx.Guid.Data4[7] =3D self.__TransNum(ctx.Number(7)) + def visitGuidSubDefinition(self, ctx: VfrSyntaxParser.GuidSubDefinitio= nContext): + ctx.Guid.Data4[0] =3D self.TransNum(ctx.Number(0)) + ctx.Guid.Data4[1] =3D self.TransNum(ctx.Number(1)) + ctx.Guid.Data4[2] =3D self.TransNum(ctx.Number(2)) + ctx.Guid.Data4[3] =3D self.TransNum(ctx.Number(3)) + ctx.Guid.Data4[4] =3D self.TransNum(ctx.Number(4)) + ctx.Guid.Data4[5] =3D self.TransNum(ctx.Number(5)) + ctx.Guid.Data4[6] =3D self.TransNum(ctx.Number(6)) + ctx.Guid.Data4[7] =3D self.TransNum(ctx.Number(7)) =20 return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#guidDefinition. - def visitGuidDefinition(self, ctx:VfrSyntaxParser.GuidDefinitionContex= t): - + def visitGuidDefinition(self, ctx: VfrSyntaxParser.GuidDefinitionConte= xt): self.visitChildren(ctx) =20 - ctx.Guid.Data1 =3D self.__TransNum(ctx.Number(0)) - ctx.Guid.Data2 =3D self.__TransNum(ctx.Number(1)) - ctx.Guid.Data3 =3D self.__TransNum(ctx.Number(2)) + ctx.Guid.Data1 =3D self.TransNum(ctx.Number(0)) + ctx.Guid.Data2 =3D self.TransNum(ctx.Number(1)) + ctx.Guid.Data3 =3D self.TransNum(ctx.Number(2)) =20 return None =20 - # Visit a parse tree produced by VfrSyntaxParser#getStringId. - def visitGetStringId(self, ctx:VfrSyntaxParser.GetStringIdContext): - - ctx.StringId =3D self.__TransNum(ctx.Number()) + def visitGetStringId(self, ctx: VfrSyntaxParser.GetStringIdContext): + ctx.StringId =3D self.TransNum(ctx.Number()) =20 return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementHeader. - def visitVfrStatementHeader(self, ctx:VfrSyntaxParser.VfrStatementHead= erContext): - - ctx.OpObj =3D ctx.parentCtx.OpObj - if ctx.OpObj !=3D None: - Prompt =3D self.__TransNum(ctx.Number(0)) - ctx.OpObj.SetPrompt(Prompt) - Help =3D self.__TransNum(ctx.Number(1)) - ctx.OpObj.SetHelp(Help) + def visitVfrStatementHeader(self, ctx: VfrSyntaxParser.VfrStatementHea= derContext): + if ctx.Node.Data !=3D None: + Prompt =3D self.TransNum(ctx.Number(0)) + ctx.Node.Data.SetPrompt(Prompt) + Help =3D self.TransNum(ctx.Number(1)) + ctx.Node.Data.SetHelp(Help) =20 return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrQuestionHeader. - def visitVfrQuestionHeader(self, ctx:VfrSyntaxParser.VfrQuestionHeader= Context): - - ctx.OpObj =3D ctx.parentCtx.OpObj - - return self.visitChildren(ctx) + def visitVfrQuestionHeader(self, ctx: VfrSyntaxParser.VfrQuestionHeade= rContext): + return self.visitChildren(ctx) =20 # Visit a parse tree produced by VfrSyntaxParser#vfrQuestionBaseInfo. - def visitVfrQuestionBaseInfo(self, ctx:VfrSyntaxParser.VfrQuestionBase= InfoContext): - - ctx.OpObj =3D ctx.parentCtx.OpObj - + def visitVfrQuestionBaseInfo(self, ctx: VfrSyntaxParser.VfrQuestionBas= eInfoContext): ctx.BaseInfo.VarType =3D EFI_IFR_TYPE_OTHER ctx.BaseInfo.VarTotalSize =3D 0 ctx.BaseInfo.Info.VarOffset =3D EFI_VAROFFSET_INVALID @@ -748,59 +895,91 @@ class VfrSyntaxVisitor(ParseTreeVisitor): QName =3D None QId =3D EFI_QUESTION_ID_INVALID ReturnCode =3D None + self.UsedDefaultArray =3D [] =20 self.visitChildren(ctx) + if ctx.Name() !=3D None: QName =3D ctx.QN.text - ReturnCode =3D self.__CVfrQuestionDB.FindQuestionByName(QName) - self.__CompareErrorHandler(ReturnCode, VfrReturnCode.VFR_RETUR= N_UNDEFINED, ctx.QN.line, ctx.QN.text, 'has already been used please used a= nther name') - - VarIdStr =3D '' if ctx.VarId() =3D=3D None else ctx.vfrStorageVar= Id().VarIdStr + ReturnCode =3D self.VfrQuestionDB.FindQuestionByName(QName) + self.CompareErrorHandler( + ReturnCode, + VfrReturnCode.VFR_RETURN_UNDEFINED, + ctx.QN.line, + ctx.QN.text, + "has already been used please used anther name", + ) + + VarIdStr =3D "" if ctx.VarId() =3D=3D None else ctx.vfrStorageVarI= d().VarIdStr if ctx.QuestionId() !=3D None: - QId =3D self.__TransNum(ctx.ID.text) - ReturnCode =3D self.__CVfrQuestionDB.FindQuestionById(QId) - self.__CompareErrorHandler(ReturnCode, VfrReturnCode.VFR_RETUR= N_UNDEFINED, ctx.ID.line, ctx.ID.text, 'has already been used please used a= nther number') + QId =3D self.TransNum(ctx.ID.text) + ReturnCode =3D self.VfrQuestionDB.FindQuestionById(QId) + self.CompareErrorHandler( + ReturnCode, + VfrReturnCode.VFR_RETURN_UNDEFINED, + ctx.ID.line, + ctx.ID.text, + "has already been used please used anther number", + ) =20 if ctx.QType =3D=3D EFI_QUESION_TYPE.QUESTION_NORMAL: - if self.__IsCheckBoxOp: + if self.IsCheckBoxOp: ctx.BaseInfo.VarType =3D EFI_IFR_TYPE_BOOLEAN - QId, ReturnCode =3D self.__CVfrQuestionDB.RegisterQuestion(QNa= me, VarIdStr, QId) - self.__ErrorHandler(ReturnCode, ctx.start.line) + QId, ReturnCode =3D self.VfrQuestionDB.RegisterQuestion(QName,= VarIdStr, QId, gFormPkg) + self.ErrorHandler(ReturnCode, ctx.start.line) =20 elif ctx.QType =3D=3D EFI_QUESION_TYPE.QUESTION_DATE: ctx.BaseInfo.VarType =3D EFI_IFR_TYPE_DATE - QId, ReturnCode =3D self.__CVfrQuestionDB.RegisterNewDateQuest= ion(QName, VarIdStr, QId) - self.__ErrorHandler(ReturnCode, ctx.start.line) + QId, ReturnCode =3D self.VfrQuestionDB.RegisterNewDateQuestion= ( + QName, VarIdStr, QId, gFormPkg + ) + self.ErrorHandler(ReturnCode, ctx.start.line) =20 elif ctx.QType =3D=3D EFI_QUESION_TYPE.QUESTION_TIME: ctx.BaseInfo.VarType =3D EFI_IFR_TYPE_TIME - QId, ReturnCode =3D self.__CVfrQuestionDB.RegisterNewTimeQuest= ion(QName, VarIdStr, QId) - self.__ErrorHandler(ReturnCode, ctx.start.line) + QId, ReturnCode =3D self.VfrQuestionDB.RegisterNewTimeQuestion= ( + QName, VarIdStr, QId, gFormPkg + ) + self.ErrorHandler(ReturnCode, ctx.start.line) =20 elif ctx.QType =3D=3D EFI_QUESION_TYPE.QUESTION_REF: ctx.BaseInfo.VarType =3D EFI_IFR_TYPE_REF - if VarIdStr !=3D '': #stand for question with storage. - QId, ReturnCode =3D self.__CVfrQuestionDB.RegisterRefQuest= ion(QName, VarIdStr, QId) - self.__ErrorHandler(ReturnCode, ctx.start.line) + if VarIdStr !=3D "": # stand for question with storage. + QId, ReturnCode =3D self.VfrQuestionDB.RegisterRefQuestion= ( + QName, VarIdStr, QId, gFormPkg + ) + self.ErrorHandler(ReturnCode, ctx.start.line) else: - QId, ReturnCode =3D self.__CVfrQuestionDB.RegisterQuestion= (QName, None, QId) - self.__ErrorHandler(ReturnCode, ctx.start.line) + QId, ReturnCode =3D self.VfrQuestionDB.RegisterQuestion(QN= ame, None, QId, gFormPkg) + self.ErrorHandler(ReturnCode, ctx.start.line) else: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_FATAL_ERROR, ctx.= start.line) - - self.__CurrQestVarInfo =3D ctx.BaseInfo - - if ctx.OpObj !=3D None: - ctx.OpObj.SetQuestionId(QId) + self.ErrorHandler(VfrReturnCode.VFR_RETURN_FATAL_ERROR, ctx.st= art.line) + + self.CurrQestVarInfo =3D ctx.BaseInfo + + if ctx.Node.OpCode =3D=3D EFI_IFR_ONE_OF_OP: + # need to further update the VarType + ctx.Node.Data =3D IfrOneOf(EFI_IFR_TYPE_NUM_SIZE_64, QName, Va= rIdStr) + self.CurrentQuestion =3D ctx.Node.Data + self.CurrentMinMaxData =3D ctx.Node.Data + + elif ctx.Node.OpCode =3D=3D EFI_IFR_NUMERIC_OP: + ctx.Node.Data =3D IfrNumeric(EFI_IFR_TYPE_NUM_SIZE_64, QName, = VarIdStr) + self.CurrentQuestion =3D ctx.Node.Data + self.CurrentMinMaxData =3D ctx.Node.Data + + if ctx.Node.Data !=3D None: + ctx.Node.Data.SetQName(QName) + ctx.Node.Data.SetVarIdStr(VarIdStr) + ctx.Node.Data.SetQuestionId(QId) + ctx.Node.Data.SetHasQuestionId(ctx.QuestionId() !=3D None) if ctx.BaseInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: - ctx.OpObj.SetVarStoreInfo(ctx.BaseInfo) - - return ctx.OpObj + ctx.Node.Data.SetVarStoreInfo(ctx.BaseInfo) =20 + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#questionheaderFlagsFi= eld. - def visitQuestionheaderFlagsField(self, ctx:VfrSyntaxParser.Questionhe= aderFlagsFieldContext): - + def visitQuestionheaderFlagsField(self, ctx: VfrSyntaxParser.Questionh= eaderFlagsFieldContext): self.visitChildren(ctx) if ctx.ReadOnlyFlag() !=3D None: ctx.QHFlag =3D 0x01 @@ -818,282 +997,333 @@ class VfrSyntaxVisitor(ParseTreeVisitor): ctx.QHFlag =3D 0x40 =20 elif ctx.OptionOnlyFlag() !=3D None: - gCVfrErrorHandle.HandleWarning(EFI_VFR_WARNING_CODE.VFR_WARNIN= G_OBSOLETED_FRAMEWORK_OPCODE, ctx.O.line, ctx.O.text) + gVfrErrorHandle.HandleWarning( + EFI_VFR_WARNING_CODE.VFR_WARNING_OBSOLETED_FRAMEWORK_OPCOD= E, ctx.O.line, ctx.O.text + ) =20 elif ctx.NVAccessFlag() !=3D None: - gCVfrErrorHandle.HandleWarning(EFI_VFR_WARNING_CODE.VFR_WARNIN= G_OBSOLETED_FRAMEWORK_OPCODE, ctx.N.line, ctx.N.text) + gVfrErrorHandle.HandleWarning( + EFI_VFR_WARNING_CODE.VFR_WARNING_OBSOLETED_FRAMEWORK_OPCOD= E, ctx.N.line, ctx.N.text + ) =20 elif ctx.LateCheckFlag() !=3D None: - gCVfrErrorHandle.HandleWarning(EFI_VFR_WARNING_CODE.VFR_WARNIN= G_OBSOLETED_FRAMEWORK_OPCODE, ctx.L.line, ctx.L.text) + gVfrErrorHandle.HandleWarning( + EFI_VFR_WARNING_CODE.VFR_WARNING_OBSOLETED_FRAMEWORK_OPCOD= E, ctx.L.line, ctx.L.text + ) =20 return ctx.QHFlag =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStorageVarIdRule1. - def visitVfrStorageVarIdRule1(self, ctx:VfrSyntaxParser.VfrStorageVarI= dRule1Context): - + def visitVfrStorageVarIdRule1(self, ctx: VfrSyntaxParser.VfrStorageVar= IdRule1Context): self.visitChildren(ctx) =20 SName =3D ctx.SN1.text ctx.VarIdStr +=3D SName =20 - Idx =3D self.__TransNum(ctx.I.text) - ctx.VarIdStr +=3D '[' + Idx =3D self.TransNum(ctx.I.text) + ctx.VarIdStr +=3D "[" ctx.VarIdStr +=3D ctx.I.text - ctx.VarIdStr +=3D ']' + ctx.VarIdStr +=3D "]" =20 - ctx.BaseInfo.VarStoreId, ReturnCode =3D gCVfrDataStorage.GetVarSto= reId(SName) + ctx.BaseInfo.VarStoreId, ReturnCode =3D gVfrDataStorage.GetVarStor= eId(SName) if ctx.CheckFlag or ReturnCode =3D=3D VfrReturnCode.VFR_RETURN_SUC= CESS: - self.__ErrorHandler(ReturnCode, ctx.SN1.line, ctx.SN1.text) - self.__ErrorHandler(gCVfrDataStorage.GetNameVarStoreInfo(ctx.B= aseInfo, Idx), ctx.SN1.line, ctx.SN1.text) + self.ErrorHandler(ReturnCode, ctx.SN1.line, ctx.SN1.text) + self.ErrorHandler( + gVfrDataStorage.GetNameVarStoreInfo(ctx.BaseInfo, Idx), ct= x.SN1.line, ctx.SN1.text + ) =20 return ctx.VarIdStr =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStorageVarIdRule2. - def visitVfrStorageVarIdRule2(self, ctx:VfrSyntaxParser.VfrStorageVarI= dRule2Context): - + def visitVfrStorageVarIdRule2(self, ctx: VfrSyntaxParser.VfrStorageVar= IdRule2Context): self.visitChildren(ctx) =20 - VarStr =3D '' # type.field + VarStr =3D "" # type.field SName =3D ctx.SN2.text ctx.VarIdStr +=3D SName - ctx.BaseInfo.VarStoreId, ReturnCode =3D gCVfrDataStorage.GetVarSto= reId(SName) + ctx.BaseInfo.VarStoreId, ReturnCode =3D gVfrDataStorage.GetVarStor= eId(SName) if ctx.CheckFlag or ReturnCode =3D=3D VfrReturnCode.VFR_RETURN_SUC= CESS: - self.__ErrorHandler(ReturnCode, ctx.SN2.line, ctx.SN2.text) - VarStoreType =3D gCVfrDataStorage.GetVarStoreType(ctx.BaseInfo= .VarStoreId) - if VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_= BUFFER or VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_BUFFER= _BITS: - TName, ReturnCode2 =3D gCVfrDataStorage.GetBufferVarStoreD= ataTypeName(ctx.BaseInfo.VarStoreId) - self.__ErrorHandler(ReturnCode2, ctx.SN2.line, ctx.SN2.tex= t) + self.ErrorHandler(ReturnCode, ctx.SN2.line, ctx.SN2.text) + VarStoreType =3D gVfrDataStorage.GetVarStoreType(ctx.BaseInfo.= VarStoreId) + if ( + VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE= _BUFFER + or VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARST= ORE_BUFFER_BITS + ): + TName, ReturnCode2 =3D gVfrDataStorage.GetBufferVarStoreDa= taTypeName( + ctx.BaseInfo.VarStoreId + ) + self.ErrorHandler(ReturnCode2, ctx.SN2.line, ctx.SN2.text) VarStr +=3D TName =20 Count =3D len(ctx.Dot()) for i in range(0, Count): if ctx.CheckFlag or ReturnCode =3D=3D VfrReturnCode.VFR_RETURN= _SUCCESS: - cond =3D (VarStoreType !=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_= VARSTORE_BUFFER) and (VarStoreType !=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARST= ORE_BUFFER_BITS) - ReturnCode =3D VfrReturnCode.VFR_RETURN_EFIVARSTORE_USE_ER= ROR if cond else VfrReturnCode.VFR_RETURN_SUCCESS - self.__ErrorHandler(ReturnCode, ctx.SN2.line, ctx.SN2.text= ) - - ctx.VarIdStr +=3D '.' - VarStr +=3D '.' + cond =3D (VarStoreType !=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_= VARSTORE_BUFFER) and ( + VarStoreType !=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTO= RE_BUFFER_BITS + ) + ReturnCode =3D ( + VfrReturnCode.VFR_RETURN_EFIVARSTORE_USE_ERROR + if cond + else VfrReturnCode.VFR_RETURN_SUCCESS + ) + self.ErrorHandler(ReturnCode, ctx.SN2.line, ctx.SN2.text) + + ctx.VarIdStr +=3D "." + VarStr +=3D "." ctx.VarIdStr +=3D ctx.arrayName(i).SubStr VarStr +=3D ctx.arrayName(i).SubStrZ =20 if VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_EFI: - self.__ErrorHandler(gCVfrDataStorage.GetEfiVarStoreInfo(ctx.Ba= seInfo), ctx.SN2.line, ctx.SN2.text) - - elif VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_BU= FFER or VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_BUFFER_B= ITS: - ctx.BaseInfo.Info.VarOffset, ctx.BaseInfo.VarType, ctx.BaseInf= o.VarTotalSize, ctx.BaseInfo.IsBitVar, ReturnCode =3D gCVfrVarDataTypeDB.Ge= tDataFieldInfo(VarStr) - self.__ErrorHandler(ReturnCode, ctx.SN2.line, VarStr) - VarGuid =3D gCVfrDataStorage.GetVarStoreGuid(ctx.BaseInfo.VarS= toreId) - self.__ErrorHandler(gCVfrBufferConfig.Register(SName, VarGuid)= , ctx.SN2.line) - Dummy =3D self.gZeroEfiIfrTypeValue - ReturnCode =3D VfrReturnCode(gCVfrBufferConfig.Write( - 'a', - SName, - VarGuid, - None, - ctx.BaseInfo.VarType, + self.ErrorHandler( + gVfrDataStorage.GetEfiVarStoreInfo(ctx.BaseInfo), ctx.SN2.= line, ctx.SN2.text + ) + + elif ( + VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_BUF= FER + or VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_= BUFFER_BITS + ): + ( ctx.BaseInfo.Info.VarOffset, + ctx.BaseInfo.VarType, ctx.BaseInfo.VarTotalSize, - Dummy)) #?the definition of dummy is needed to check - self.__ErrorHandler(ReturnCode, ctx.SN2.line) - self.__ErrorHandler(gCVfrDataStorage.AddBufferVarStoreFieldInf= o(ctx.BaseInfo), ctx.SN2.line) + ctx.BaseInfo.IsBitVar, + ReturnCode, + ) =3D gVfrVarDataTypeDB.GetDataFieldInfo(VarStr) + self.ErrorHandler(ReturnCode, ctx.SN2.line, VarStr) + VarGuid =3D gVfrDataStorage.GetVarStoreGuid(ctx.BaseInfo.VarSt= oreId) + self.ErrorHandler(gVfrBufferConfig.Register(SName, VarGuid), c= tx.SN2.line) + ReturnCode =3D VfrReturnCode( + gVfrBufferConfig.Write( + "a", + SName, + VarGuid, + None, + ctx.BaseInfo.VarType, + ctx.BaseInfo.Info.VarOffset, + ctx.BaseInfo.VarTotalSize, + self.Value, + ) + ) + self.ErrorHandler(ReturnCode, ctx.SN2.line) + self.ErrorHandler( + gVfrDataStorage.AddBufferVarStoreFieldInfo(ctx.BaseInfo), = ctx.SN2.line + ) =20 return ctx.VarIdStr =20 # Visit a parse tree produced by VfrSyntaxParser#vfrConstantValueField= . - def visitVfrConstantValueField(self, ctx:VfrSyntaxParser.VfrConstantVa= lueFieldContext): + def visitVfrConstantValueField(self, ctx: VfrSyntaxParser.VfrConstantV= alueFieldContext): self.visitChildren(ctx) =20 IntDecStyle =3D False - if self.__CurrentMinMaxData !=3D None and self.__CurrentMinMaxData= .IsNumericOpcode(): - NumericQst =3D CIfrNumeric(self.__CurrentQuestion) # - IntDecStyle =3D True if (NumericQst.GetNumericFlags() & EFI_IF= R_DISPLAY) =3D=3D 0 else False # + if self.CurrentMinMaxData !=3D None and self.CurrentMinMaxData.IsN= umericOpcode(): + NumericQst =3D IfrNumeric(self.CurrentQuestion) # + IntDecStyle =3D ( + True if (NumericQst.GetNumericFlags() & EFI_IFR_DISPLAY) = =3D=3D 0 else False + ) # =20 if ctx.TrueSymbol() !=3D None: - ctx.Value.b =3D 1 + ctx.ValueList.append(1) =20 elif ctx.FalseSymbol() !=3D None: - ctx.Value.b =3D 0 + ctx.ValueList.append(0) =20 elif ctx.One() !=3D None: - ctx.Value.u8 =3D int(ctx.getText()) + ctx.ValueList.append(int(ctx.getText())) =20 elif ctx.Ones() !=3D None: - ctx.Value.u64 =3D int(ctx.getText()) + ctx.ValueList.append(int(ctx.getText())) =20 elif ctx.Zero() !=3D None: - ctx.Value.u8 =3D int(ctx.getText()) + ctx.ValueList.append(int(ctx.getText())) =20 elif ctx.Colon() !=3D []: - ctx.Value.time.Hour =3D self.__TransNum(ctx.Number(0)) - ctx.Value.time.Minute =3D self.__TransNum(ctx.Number(1)) - ctx.Value.time.Second =3D self.__TransNum(ctx.Number(2)) + Time =3D EFI_HII_TIME() + Time.Hour =3D self.TransNum(ctx.Number(0)) + Time.Minute =3D self.TransNum(ctx.Number(1)) + Time.Second =3D self.TransNum(ctx.Number(2)) + ctx.ValueList.append(Time) =20 elif ctx.Slash() !=3D []: - ctx.Value.date.Year =3D self.__TransNum(ctx.Number(0)) - ctx.Value.date.Month =3D self.__TransNum(ctx.Number(1)) - ctx.Value.date.Day =3D self.__TransNum(ctx.Number(2)) + Date =3D EFI_HII_DATE() + Date.Year =3D self.TransNum(ctx.Number(0)) + Date.Month =3D self.TransNum(ctx.Number(1)) + Date.Day =3D self.TransNum(ctx.Number(2)) + ctx.ValueList.append(Date) =20 elif ctx.Semicolon() !=3D []: - ctx.Value.ref.QuestionId =3D self.__TransNum(ctx.Number(0)) - ctx.Value.ref.FormId =3D self.__TransNum(ctx.Number(1)) - ctx.Value.ref.DevicePath =3D self.__TransNum(ctx.Number(2)) - ctx.Value.ref.FormSetGuid =3D ctx.guidDefinition().Guid + Ref =3D EFI_HII_REF() + Ref.QuestionId =3D self.TransNum(ctx.Number(0)) + Ref.FormId =3D self.TransNum(ctx.Number(1)) + Ref.DevicePath =3D self.TransNum(ctx.Number(2)) + Ref.FormSetGuid =3D ctx.guidDefinition().Guid + ctx.ValueList.append(Ref) =20 elif ctx.StringToken() !=3D None: - ctx.Value.string =3D self.__TransNum(ctx.Number(0)) + ctx.ValueList.append(self.TransNum(ctx.Number(0))) =20 elif ctx.OpenBrace() !=3D None: ctx.ListType =3D True - Type =3D self.__CurrQestVarInfo.VarType + Type =3D self.CurrQestVarInfo.VarType for i in range(0, len(ctx.Number())): - TempValue =3D EFI_IFR_TYPE_VALUE() - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - TempValue.u8 =3D self.__TransNum(ctx.Number(i)) - ctx.ValueList.append(TempValue) - - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - TempValue.u16 =3D self.__TransNum(ctx.Number(i)) - ctx.ValueList.append(TempValue) - - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - TempValue.u32 =3D self.__TransNum(ctx.Number(i)) - ctx.ValueList.append(TempValue) + ctx.ValueList.append(self.TransNum(ctx.Number(i))) =20 - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - TempValue.u64 =3D self.__TransNum(ctx.Number(i)) - ctx.ValueList.append(TempValue) else: Negative =3D True if ctx.Negative() !=3D None else False # The value stored in bit fields is always set to UINT32 type. - if self.__CurrQestVarInfo.IsBitVar: - ctx.Value.u32 =3D self.__TransNum(ctx.Number(0)) + if self.CurrQestVarInfo.IsBitVar: + ctx.ValueList.append(self.TransNum(ctx.Number(0))) else: - Type =3D self.__CurrQestVarInfo.VarType + Type =3D self.CurrQestVarInfo.VarType if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - ctx.Value.u8 =3D self.__TransNum(ctx.Number(0)) + Value =3D self.TransNum(ctx.Number(0)) if IntDecStyle: if Negative: - if ctx.Value.u8 > 0x80: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.start.line, "INT8 type can't big than 0x7F, small= than -0x80") + if Value > 0x80: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.start.line, + "INT8 type can't big than 0x7F, small = than -0x80", + ) else: - if ctx.Value.u8 > 0x7F: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.start.line, "INT8 type can't big than 0x7F, small= than -0x80") + if Value > 0x7F: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.start.line, + "INT8 type can't big than 0x7F, small = than -0x80", + ) if Negative: - ctx.Value.u8 =3D ~ctx.Value.u8 + 1 + Value =3D ~Value + 1 + ctx.ValueList.append(Value) =20 if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - ctx.Value.u16 =3D self.__TransNum(ctx.Number(0)) + Value =3D self.TransNum(ctx.Number(0)) if IntDecStyle: if Negative: - if ctx.Value.u16 > 0x8000: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.start.line, "INT16 type can't big than 0x7FFF, sm= all than -0x8000") + if Value > 0x8000: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.start.line, + "INT16 type can't big than 0x7FFF, sma= ll than -0x8000", + ) else: - if ctx.Value.u16 > 0x7FFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.start.line, "INT16 type can't big than 0x7FFF, sm= all than -0x8000") + if Value > 0x7FFF: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.start.line, + "INT16 type can't big than 0x7FFF, sma= ll than -0x8000", + ) if Negative: - ctx.Value.u16 =3D ~ctx.Value.u16 + 1 + Value =3D ~Value + 1 + ctx.ValueList.append(Value) =20 if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - ctx.Value.u32 =3D self.__TransNum(ctx.Number(0)) + Value =3D self.TransNum(ctx.Number(0)) if IntDecStyle: if Negative: - if ctx.Value.u32 > 0x80000000: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.start.line, "INT32 type can't big than 0x7FFFFFFF= , small than -0x80000000") + if Value > 0x80000000: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.start.line, + "INT32 type can't big than 0x7FFFFFFF,= small than -0x80000000", + ) else: - if ctx.Value.u32 > 0X7FFFFFFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.start.line, "INT32 type can't big than 0x7FFFFFFF= , small than -0x80000000") + if Value > 0x7FFFFFFF: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.start.line, + "INT32 type can't big than 0x7FFFFFFF,= small than -0x80000000", + ) if Negative: - ctx.Value.u32 =3D ~ctx.Value.u32 + 1 + Value =3D ~Value + 1 + ctx.ValueList.append(Value) =20 if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - ctx.Value.u64 =3D self.__TransNum(ctx.Number(0)) + Value =3D self.TransNum(ctx.Number(0)) if IntDecStyle: if Negative: - if ctx.Value.u64 > 0x8000000000000000: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.start.line, "INT64 type can't big than 0x7FFFFFFF= FFFFFFFF, small than -0x8000000000000000") + if Value > 0x8000000000000000: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.start.line, + "INT64 type can't big than 0x7FFFFFFFF= FFFFFFF, small than -0x8000000000000000", + ) else: - if ctx.Value.u64 > 0x7FFFFFFFFFFFFFFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.start.line, "INT64 type can't big than 0x7FFFFFFF= FFFFFFFF, small than -0x8000000000000000") + if Value > 0x7FFFFFFFFFFFFFFF: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.start.line, + "INT64 type can't big than 0x7FFFFFFFF= FFFFFFF, small than -0x8000000000000000", + ) if Negative: - ctx.Value.u64 =3D ~ctx.Value.u64 + 1 - - if Type =3D=3D EFI_IFR_TYPE_BOOLEAN: - ctx.Value.b =3D self.__TransNum(ctx.Number(0)) - - if Type =3D=3D EFI_IFR_TYPE_BOOLEAN: - ctx.Value.string =3D self.__TransNum(ctx.Number(0)) + Value =3D ~Value + 1 + ctx.ValueList.append(Value) =20 - return ctx.Value, ctx.ValueList + else: + ctx.ValueList.append(self.TransNum(ctx.Number(0))) =20 + return ctx.ValueList =20 # Visit a parse tree produced by VfrSyntaxParser#vfrImageTag. - def visitVfrImageTag(self, ctx:VfrSyntaxParser.VfrImageTagContext): - - IObj =3D CIfrImage() + def visitVfrImageTag(self, ctx: VfrSyntaxParser.VfrImageTagContext): + IObj =3D IfrImage() self.visitChildren(ctx) IObj.SetLineNo(ctx.start.line) - IObj.SetImageId(self.__TransNum(ctx.Number())) + IObj.SetImageId(self.TransNum(ctx.Number())) ctx.Node.Data =3D IObj - + ctx.Node.Buffer =3D gFormPkg.StructToStream(IObj.GetInfo()) return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrLockedTag. - def visitVfrLockedTag(self, ctx:VfrSyntaxParser.VfrLockedTagContext): - - LObj=3DCIfrLocked() + def visitVfrLockedTag(self, ctx: VfrSyntaxParser.VfrLockedTagContext): + LObj =3D IfrLocked() self.visitChildren(ctx) LObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D LObj - + ctx.Node.Buffer =3D gFormPkg.StructToStream(LObj.GetInfo()) return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementStatTag. - def visitVfrStatementStatTag(self, ctx:VfrSyntaxParser.VfrStatementSta= tTagContext): - + def visitVfrStatementStatTag(self, ctx: VfrSyntaxParser.VfrStatementSt= atTagContext): self.visitChildren(ctx) if ctx.vfrImageTag() !=3D None: ctx.Node =3D ctx.vfrImageTag().Node - else: + elif ctx.vfrLockedTag() !=3D None: ctx.Node =3D ctx.vfrLockedTag().Node =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementStatTagLi= st. - def visitVfrStatementStatTagList(self, ctx:VfrSyntaxParser.VfrStatemen= tStatTagListContext): - + def visitVfrStatementStatTagList(self, ctx: VfrSyntaxParser.VfrStateme= ntStatTagListContext): self.visitChildren(ctx) for Ctx in ctx.vfrStatementStatTag(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrFormDefinition. - def visitVfrFormDefinition(self, ctx:VfrSyntaxParser.VfrFormDefinition= Context): - - FObj =3D CIfrForm() + def visitVfrFormDefinition(self, ctx: VfrSyntaxParser.VfrFormDefinitio= nContext): + FObj =3D IfrForm() self.visitChildren(ctx) =20 FObj.SetLineNo(ctx.start.line) - FormId =3D self.__TransNum(ctx.Number(0)) + FormId =3D self.TransNum(ctx.Number(0)) FObj.SetFormId(FormId) - FormTitle =3D self.__TransNum(ctx.Number(1)) + FormTitle =3D self.TransNum(ctx.Number(1)) FObj.SetFormTitle(FormTitle) =20 ctx.Node.Data =3D FObj for Ctx in ctx.vfrForm(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) + ctx.Node.Buffer =3D gFormPkg.StructToStream(FObj.GetInfo()) + + self.InsertEndNode(ctx.Node, ctx.stop.line) + self.LastFormNode =3D ctx.Node =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrForm. - def visitVfrForm(self, ctx:VfrSyntaxParser.VfrFormContext): - + def visitVfrForm(self, ctx: VfrSyntaxParser.VfrFormContext): self.visitChildren(ctx) if ctx.vfrStatementImage() !=3D None: ctx.Node =3D ctx.vfrStatementImage().Node @@ -1124,63 +1354,70 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrFormMapDefinition. - def visitVfrFormMapDefinition(self, ctx:VfrSyntaxParser.VfrFormMapDefi= nitionContext): - - FMapObj =3D CIfrFormMap() + def visitVfrFormMapDefinition(self, ctx: VfrSyntaxParser.VfrFormMapDef= initionContext): + FMapObj =3D IfrFormMap() self.visitChildren(ctx) + FormMapMethodNumber =3D len(ctx.MapTitle()) Line =3D ctx.start.line FMapObj.SetLineNo(Line) - self.__ErrorHandler(FMapObj.SetFormId(self.__TransNum(ctx.S1.text)= ), ctx.S1.line, ctx.S1.line) - FormMapMethodNumber =3D len(ctx.MapTitle()) + self.ErrorHandler(FMapObj.SetFormId(self.TransNum(ctx.S1.text)), c= tx.S1.line, ctx.S1.line) if FormMapMethodNumber =3D=3D 0: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , Line, 'No MapMethod is set for FormMap!') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, Line, "No MapM= ethod is set for FormMap!" + ) else: for i in range(0, FormMapMethodNumber): - FMapObj.SetFormMapMethod(self.__TransNum(ctx.Number(i+1)),= ctx.guidDefinition(i).Guid) + FMapObj.SetFormMapMethod( + self.TransNum(ctx.Number(i + 1)), ctx.guidDefinition(i= ).Guid + ) + FormMap =3D FMapObj.GetInfo() + MethodMapList =3D FMapObj.GetMethodMapList() + for MethodMap in MethodMapList: + # Extend Header Size for MethodMapList + FormMap.Header.Length +=3D sizeof(EFI_IFR_FORM_MAP_METHOD) + ctx.Node.Data =3D FMapObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(FormMap) + for MethodMap in MethodMapList: + ctx.Node.Buffer +=3D gFormPkg.StructToStream(MethodMap) for Ctx in ctx.vfrForm(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementImage. - def visitVfrStatementImage(self, ctx:VfrSyntaxParser.VfrStatementImage= Context): - + def visitVfrStatementImage(self, ctx: VfrSyntaxParser.VfrStatementImag= eContext): self.visitChildren(ctx) ctx.Node =3D ctx.vfrImageTag().Node return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementLocked. - def visitVfrStatementLocked(self, ctx:VfrSyntaxParser.VfrStatementLock= edContext): - + def visitVfrStatementLocked(self, ctx: VfrSyntaxParser.VfrStatementLoc= kedContext): self.visitChildren(ctx) ctx.Node =3D ctx.vfrLockedTag().Node return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementRules. - def visitVfrStatementRules(self, ctx:VfrSyntaxParser.VfrStatementRules= Context): - - RObj =3D CIfrRule() + def visitVfrStatementRules(self, ctx: VfrSyntaxParser.VfrStatementRule= sContext): + RObj =3D IfrRule() self.visitChildren(ctx) =20 RObj.SetLineNo(ctx.start.line) - RuleName =3D self.__TransId(ctx.StringIdentifier()) - self.__CVfrRulesDB.RegisterRule(RuleName) - RObj.SetRuleId(self.__CVfrRulesDB.GetRuleId(RuleName)) + RuleName =3D self.TransId(ctx.StringIdentifier()) + RObj.SetRuleName(RuleName) + self.VfrRulesDB.RegisterRule(RuleName) + RObj.SetRuleId(self.VfrRulesDB.GetRuleId(RuleName)) ctx.Node.Data =3D RObj - ctx.Node.Expression =3D self.__ExtractOriginalText(ctx.vfrStatemen= tExpression()) - # expression - # end rule + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(RObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementStat. - def visitVfrStatementStat(self, ctx:VfrSyntaxParser.VfrStatementStatCo= ntext): - + def visitVfrStatementStat(self, ctx: VfrSyntaxParser.VfrStatementStatC= ontext): self.visitChildren(ctx) if ctx.vfrStatementSubTitle() !=3D None: ctx.Node =3D ctx.vfrStatementSubTitle().Node @@ -1190,35 +1427,35 @@ class VfrSyntaxVisitor(ParseTreeVisitor): ctx.Node =3D ctx.vfrStatementCrossReference().Node return ctx.Node =20 - - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementSubTitle. - def visitVfrStatementSubTitle(self, ctx:VfrSyntaxParser.VfrStatementSu= bTitleContext): - - SObj =3D ctx.OpObj + def visitVfrStatementSubTitle(self, ctx: VfrSyntaxParser.VfrStatementS= ubTitleContext): + SObj =3D IfrSubtitle() =20 Line =3D ctx.start.line SObj.SetLineNo(Line) =20 - Prompt =3D self.__TransNum(ctx.Number()) + Prompt =3D self.TransNum(ctx.Number()) SObj.SetPrompt(Prompt) =20 self.visitChildren(ctx) =20 if ctx.vfrSubtitleFlags() !=3D None: SObj.SetFlags(ctx.vfrSubtitleFlags().SubFlags) + SObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrSubtitleFl= ags())) =20 - ctx.Node.Data =3D SObj - self.__InsertChild(ctx.Node, ctx.vfrStatementStatTagList()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(SObj.GetInfo()) # sequence question for Ctx in ctx.vfrStatementSubTitleComponent(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) + ctx.Node.Data =3D SObj + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementSubTitleC= omponent. - def visitVfrStatementSubTitleComponent(self, ctx:VfrSyntaxParser.VfrSt= atementSubTitleComponentContext): - + def visitVfrStatementSubTitleComponent( + self, ctx: VfrSyntaxParser.VfrStatementSubTitleComponentContext + ): self.visitChildren(ctx) if ctx.vfrStatementQuestions() !=3D None: ctx.Node =3D ctx.vfrStatementQuestions().Node @@ -1226,10 +1463,8 @@ class VfrSyntaxVisitor(ParseTreeVisitor): ctx.Node =3D ctx.vfrStatementStat().Node return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrSubtitleFlags. - def visitVfrSubtitleFlags(self, ctx:VfrSyntaxParser.VfrSubtitleFlagsCo= ntext): - + def visitVfrSubtitleFlags(self, ctx: VfrSyntaxParser.VfrSubtitleFlagsC= ontext): self.visitChildren(ctx) =20 for FlagsFieldCtx in ctx.subtitleFlagsField(): @@ -1237,83 +1472,87 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return None =20 - # Visit a parse tree produced by VfrSyntaxParser#subtitleFlagsField. - def visitSubtitleFlagsField(self, ctx:VfrSyntaxParser.SubtitleFlagsFie= ldContext): - + def visitSubtitleFlagsField(self, ctx: VfrSyntaxParser.SubtitleFlagsFi= eldContext): if ctx.Number() !=3D None: - ctx.Flag =3D self.__TransNum(ctx.Number()) + ctx.Flag =3D self.TransNum(ctx.Number()) else: ctx.Flag =3D 0x01 =20 return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementStaticTex= t. - def visitVfrStatementStaticText(self, ctx:VfrSyntaxParser.VfrStatement= StaticTextContext): - + def visitVfrStatementStaticText(self, ctx: VfrSyntaxParser.VfrStatemen= tStaticTextContext): self.visitChildren(ctx) =20 QId =3D EFI_QUESTION_ID_INVALID - Help =3D self.__TransNum(ctx.S1.text) - Prompt =3D self.__TransNum(ctx.S2.text) + Help =3D self.TransNum(ctx.S1.text) + Prompt =3D self.TransNum(ctx.S2.text) TxtTwo =3D EFI_STRING_ID_INVALID if ctx.S3 !=3D None: - TxtTwo =3D self.__TransNum(ctx.S3.text) + TxtTwo =3D self.TransNum(ctx.S3.text) =20 TextFlags =3D 0 - for FlagsFieldCtx in ctx.staticTextFlagsField(): - TextFlags |=3D FlagsFieldCtx.Flag + FlagsStream =3D "" + for i in range(0, len(ctx.staticTextFlagsField())): + TextFlags |=3D ctx.staticTextFlagsField(i).Flag + FlagsStream +=3D self.ExtractOriginalText(ctx.staticTextFlagsF= ield(i)) + if i !=3D len(ctx.staticTextFlagsField()) - 1: + FlagsStream +=3D " | " =20 if TextFlags & EFI_IFR_FLAG_CALLBACK: if TxtTwo !=3D EFI_STRING_ID_INVALID: - gCVfrErrorHandle.HandleWarning(EFI_VFR_WARNING_CODE.VFR_WA= RNING_ACTION_WITH_TEXT_TWO, ctx.S3.line, ctx.S3.text) + gVfrErrorHandle.HandleWarning( + EFI_VFR_WARNING_CODE.VFR_WARNING_ACTION_WITH_TEXT_TWO,= ctx.S3.line, ctx.S3.text + ) =20 - AObj =3D CIfrAction() - QId, _ =3D self.__CVfrQuestionDB.RegisterQuestion(None, None, = QId) + AObj =3D IfrAction() + QId, _ =3D self.VfrQuestionDB.RegisterQuestion(None, None, QId= , gFormPkg) AObj.SetLineNo(ctx.F.line) AObj.SetQuestionId(QId) AObj.SetHelp(Help) AObj.SetPrompt(Prompt) - self.__ErrorHandler(AObj.SetFlags(TextFlags), ctx.F.line) + AObj.SetFlagsStream(FlagsStream) + self.ErrorHandler(AObj.SetFlags(TextFlags), ctx.F.line) if ctx.Key() !=3D None: - Key =3D self.__TransNum(ctx.S4.text) - self.__AssignQuestionKey(AObj, Key) + AObj.SetHasKey(True) + Key =3D self.TransNum(ctx.S4.text) + self.AssignQuestionKey(AObj, Key) ctx.Node.Data =3D AObj - ctx.Node.OpCode =3D EFI_IFR_ACTION_OP # - + ctx.Node.OpCode =3D EFI_IFR_TEXT_OP # + ctx.Node.Buffer =3D gFormPkg.StructToStream(AObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) else: - TObj =3D CIfrText() + TObj =3D IfrText() Line =3D ctx.start.line TObj.SetLineNo(Line) TObj.SetHelp(Help) TObj.SetPrompt(Prompt) - TObj.SetTextTwo(TxtTwo) + if TxtTwo !=3D EFI_STRING_ID_INVALID: + TObj.SetTextTwo(TxtTwo) + TObj.SetHasTextTwo(True) ctx.Node.Data =3D TObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(TObj.GetInfo()) =20 return ctx.Node =20 - - # Visit a parse tree produced by VfrSyntaxParser#staticTextFlagsField. - def visitStaticTextFlagsField(self, ctx:VfrSyntaxParser.StaticTextFlag= sFieldContext): - + def visitStaticTextFlagsField(self, ctx: VfrSyntaxParser.StaticTextFla= gsFieldContext): self.visitChildren(ctx) =20 if ctx.Number() !=3D None: - ctx.Flag =3D self.__TransNum(ctx.N.text) + ctx.Flag =3D self.TransNum(ctx.N.text) if ctx.Flag !=3D 0: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = ctx.N.line) + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ct= x.N.line) else: - ctx.Flag =3D ctx.questionheaderFlagsField().QHFlag =20 return ctx.Flag =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementCrossRefe= rence. - def visitVfrStatementCrossReference(self, ctx:VfrSyntaxParser.VfrState= mentCrossReferenceContext): - + def visitVfrStatementCrossReference( + self, ctx: VfrSyntaxParser.VfrStatementCrossReferenceContext + ): self.visitChildren(ctx) if ctx.vfrStatementGoto() !=3D None: ctx.Node =3D ctx.vfrStatementGoto().Node @@ -1321,142 +1560,127 @@ class VfrSyntaxVisitor(ParseTreeVisitor): ctx.Node =3D ctx.vfrStatementResetButton().Node return ctx.Node =20 - - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementGoto. - def visitVfrStatementGoto(self, ctx:VfrSyntaxParser.VfrStatementGotoCo= ntext): - + def visitVfrStatementGoto(self, ctx: VfrSyntaxParser.VfrStatementGotoC= ontext): RefType =3D 5 DevPath =3D EFI_STRING_ID_INVALID QId =3D EFI_QUESTION_ID_INVALID BitMask =3D 0 Line =3D ctx.start.line - R5Obj =3D CIfrRef5() + R5Obj =3D IfrRef5() R5Obj.SetLineNo(Line) - ctx.OpObj =3D R5Obj - #ctx.OHObj =3D R5Obj + GObj =3D R5Obj =20 if ctx.DevicePath() !=3D None: RefType =3D 4 - DevPath =3D self.__TransNum(ctx.Number(0)) - FId =3D self.__TransNum(ctx.Number(1)) - QId =3D self.__TransNum(ctx.Number(2)) - R4Obj =3D CIfrRef4() + DevPath =3D self.TransNum(ctx.Number(0)) + FId =3D self.TransNum(ctx.Number(1)) + QId =3D self.TransNum(ctx.Number(2)) + R4Obj =3D IfrRef4() R4Obj.SetLineNo(Line) R4Obj.SetDevicePath(DevPath) R4Obj.SetFormId(FId) - R4Obj.SetQuestionId(QId) - ctx.OpObj =3D R4Obj - #ctx.OHObj =3D R4Obj + R4Obj.SetQId(QId) + GObj =3D R4Obj =20 elif ctx.FormSetGuid() !=3D None: RefType =3D 3 - FId =3D self.__TransNum(ctx.Number(0)) - QId =3D self.__TransNum(ctx.Number(1)) - R3Obj =3D CIfrRef3() + FId =3D self.TransNum(ctx.Number(0)) + QId =3D self.TransNum(ctx.Number(1)) + R3Obj =3D IfrRef3() R3Obj.SetLineNo(Line) R3Obj.SetFormId(FId) - R3Obj.SetQuestionId(QId) - ctx.OpObj =3D R3Obj - #ctx.OHObj =3D R3Obj + R3Obj.SetQId(QId) + GObj =3D R3Obj =20 - elif ctx.FormId() !=3D None: - FId =3D self.__TransNum(ctx.Number(0)) + elif ctx.Question() !=3D None: + FId =3D self.TransNum(ctx.Number(0)) RefType =3D 2 if ctx.QN !=3D None: Name =3D ctx.QN.text - QId, BitMask, _ =3D self.__CVfrQuestionDB.GetQuestionId(Na= me) + QId, BitMask, _ =3D self.VfrQuestionDB.GetQuestionId(Name) if QId =3D=3D EFI_QUESTION_ID_INVALID: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNDEFINED= , ctx.QN.line) + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNDEFINED, = ctx.QN.line) else: - QId =3D self.__TransNum(ctx.Number(1)) - R2Obj =3D CIfrRef2() + QId =3D self.TransNum(ctx.Number(1)) + R2Obj =3D IfrRef2() R2Obj.SetLineNo(Line) R2Obj.SetFormId(FId) - R2Obj.SetQuestionId(QId) - ctx.OpObj =3D R2Obj - # ctx.OHObj =3D R2Obj + R2Obj.SetQId(QId) + GObj =3D R2Obj =20 - - elif str(ctx.getChild(1)) =3D=3D str(ctx.Number(0)): + elif ctx.N !=3D None: RefType =3D 1 - FId =3D self.__TransNum(ctx.Number(0)) - RObj =3D CIfrRef() + FId =3D self.TransNum(ctx.Number(0)) + RObj =3D IfrRef() RObj.SetLineNo(Line) RObj.SetFormId(FId) - ctx.OpObj =3D RObj - # ctx.OHObj =3D RObj + GObj =3D RObj + + ctx.Node.Data =3D GObj =20 self.visitChildren(ctx) =20 - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: - self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_REF + if self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: + self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_REF =20 if RefType =3D=3D 4 or RefType =3D=3D 3: - ctx.OpObj.SetFormSetId(ctx.guidDefinition().Guid) - # ctx.OHObj.SetFormSetId(ctx.guidDefinition().Guid) + GObj.SetFormSetId(ctx.guidDefinition().Guid) =20 if ctx.FLAGS() !=3D None: - ctx.OpObj.SetFlags(ctx.vfrGotoFlags().GotoFlags) - # ctx.OHObj.SetFlags(ctx.vfrGotoFlags().GotoFlags) + GObj.SetFlags(ctx.vfrGotoFlags().GotoFlags) =20 if ctx.Key() !=3D None: index =3D int(len(ctx.Number())) - 1 - Key =3D self.__TransNum(ctx.Number(index)) - self.__AssignQuestionKey(ctx.OpObj, Key) - - # ctx.OHObj.SetScope(1) - ctx.OpObj.SetScope(1) - ctx.Node.Data =3D ctx.OpObj + Key =3D self.TransNum(ctx.Number(index)) + self.AssignQuestionKey(GObj, Key) + GObj.SetHasKey(True) + + if ctx.vfrStatementQuestionOptionList() !=3D None: + GObj.SetScope(1) + self.InsertEndNode(ctx.Node, ctx.E.line) + ctx.Node.Buffer =3D gFormPkg.StructToStream(GObj.GetInfo()) return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrGotoFlags. - def visitVfrGotoFlags(self, ctx:VfrSyntaxParser.VfrGotoFlagsContext): - + def visitVfrGotoFlags(self, ctx: VfrSyntaxParser.VfrGotoFlagsContext): self.visitChildren(ctx) for FlagsFieldCtx in ctx.gotoFlagsField(): ctx.GotoFlags |=3D FlagsFieldCtx.Flag =20 return ctx.GotoFlags =20 - - # Visit a parse tree produced by VfrSyntaxParser#gotoFlagsField. - def visitGotoFlagsField(self, ctx:VfrSyntaxParser.GotoFlagsFieldContex= t): - + def visitGotoFlagsField(self, ctx: VfrSyntaxParser.GotoFlagsFieldConte= xt): self.visitChildren(ctx) =20 if ctx.N !=3D None: - if self.__TransNum(ctx.N.text) !=3D 0: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = ctx.N.line) + if self.TransNum(ctx.N.text) !=3D 0: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ct= x.N.line) else: ctx.Flag =3D ctx.questionheaderFlagsField().QHFlag =20 return ctx.Flag =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementResetButt= on. - def visitVfrStatementResetButton(self, ctx:VfrSyntaxParser.VfrStatemen= tResetButtonContext): - + def visitVfrStatementResetButton(self, ctx: VfrSyntaxParser.VfrStateme= ntResetButtonContext): + Defaultstore =3D ctx.N.text + RBObj =3D IfrResetButton(Defaultstore) + ctx.Node.Data =3D RBObj self.visitChildren(ctx) - - RBObj =3D ctx.OpObj Line =3D ctx.start.line RBObj.SetLineNo(Line) - defaultstore =3D ctx.N.text - DefaultId, ReturnCode =3D gCVfrDefaultStore.GetDefaultId(defaultst= ore) - self.__ErrorHandler(ReturnCode, ctx.N.line) + DefaultId, ReturnCode =3D gVfrDefaultStore.GetDefaultId(Defaultsto= re) + self.ErrorHandler(ReturnCode, ctx.N.line) RBObj.SetDefaultId(DefaultId) =20 - ctx.Node.Data =3D RBObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(RBObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementQuestions= . - def visitVfrStatementQuestions(self, ctx:VfrSyntaxParser.VfrStatementQ= uestionsContext): - + def visitVfrStatementQuestions(self, ctx: VfrSyntaxParser.VfrStatement= QuestionsContext): self.visitChildren(ctx) if ctx.vfrStatementBooleanType() !=3D None: ctx.Node =3D ctx.vfrStatementBooleanType().Node @@ -1473,10 +1697,8 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementQuestionT= ag. - def visitVfrStatementQuestionTag(self, ctx:VfrSyntaxParser.VfrStatemen= tQuestionTagContext): - + def visitVfrStatementQuestionTag(self, ctx: VfrSyntaxParser.VfrStateme= ntQuestionTagContext): self.visitChildren(ctx) if ctx.vfrStatementStatTag() !=3D None: ctx.Node =3D ctx.vfrStatementStatTag().Node @@ -1499,104 +1721,141 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementInconsist= entIf. - def visitVfrStatementInconsistentIf(self, ctx:VfrSyntaxParser.VfrState= mentInconsistentIfContext): - - IIObj =3D CIfrInconsistentIf() + def visitVfrStatementInconsistentIf( + self, ctx: VfrSyntaxParser.VfrStatementInconsistentIfContext + ): + IIObj =3D IfrInconsistentIf2() self.visitChildren(ctx) =20 IIObj.SetLineNo(ctx.start.line) - IIObj.SetError(self.__TransNum(ctx.Number())) + IIObj.SetError(self.TransNum(ctx.Number())) + + if ctx.FLAGS() !=3D None: + Flags =3D "" + for i in range(0, len(ctx.flagsField())): + Flags +=3D self.ExtractOriginalText(ctx.flagsField(i)) + if i !=3D len(ctx.flagsField()) - 1: + Flags +=3D " | " + IIObj.SetFlagsStream(Flags) =20 ctx.Node.Data =3D IIObj - ctx.Node.Expression =3D self.__ExtractOriginalText(ctx.vfrStatemen= tExpression()) - return ctx.Node + ctx.Node.Buffer =3D gFormPkg.StructToStream(IIObj.GetInfo()) + ctx.Node.Condition =3D ( + "inconsistentif" + " " + self.ExtractOriginalText(ctx.vfrState= mentExpression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementNoSubmitI= f. - def visitVfrStatementNoSubmitIf(self, ctx:VfrSyntaxParser.VfrStatement= NoSubmitIfContext): - NSIObj =3D CIfrNoSubmitIf() + def visitVfrStatementNoSubmitIf(self, ctx: VfrSyntaxParser.VfrStatemen= tNoSubmitIfContext): + NSIObj =3D IfrNoSubmitIf() self.visitChildren(ctx) =20 NSIObj.SetLineNo(ctx.start.line) - NSIObj.SetError(self.__TransNum(ctx.Number())) + NSIObj.SetError(self.TransNum(ctx.Number())) + if ctx.FLAGS() !=3D None: + Flags =3D "" + for i in range(0, len(ctx.flagsField())): + Flags +=3D self.ExtractOriginalText(ctx.flagsField(i)) + if i !=3D len(ctx.flagsField()) - 1: + Flags +=3D " | " + NSIObj.SetFlagsStream(Flags) + ctx.Node.Data =3D NSIObj - ctx.Node.Expression =3D self.__ExtractOriginalText(ctx.vfrStatemen= tExpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(NSIObj.GetInfo()) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementDisableIf= Quest. - def visitVfrStatementDisableIfQuest(self, ctx:VfrSyntaxParser.VfrState= mentDisableIfQuestContext): - DIObj =3D CIfrDisableIf() + def visitVfrStatementDisableIfQuest( + self, ctx: VfrSyntaxParser.VfrStatementDisableIfQuestContext + ): + DIObj =3D IfrDisableIf() self.visitChildren(ctx) =20 DIObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D DIObj - ctx.Node.Expression =3D self.__ExtractOriginalText(ctx.vfrStatemen= tExpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(DIObj.GetInfo()) + ctx.Node.Condition =3D ( + "disableif" + " " + self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementRefresh. - def visitVfrStatementRefresh(self, ctx:VfrSyntaxParser.VfrStatementRef= reshContext): - RObj =3D CIfrRefresh() + def visitVfrStatementRefresh(self, ctx: VfrSyntaxParser.VfrStatementRe= freshContext): + RObj =3D IfrRefresh() self.visitChildren(ctx) =20 RObj.SetLineNo(ctx.start.line) - RObj.SetRefreshInterval(self.__TransNum(ctx.Number())) + RObj.SetRefreshInterval(self.TransNum(ctx.Number())) ctx.Node.Data =3D RObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(RObj.GetInfo()) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementVarstoreD= evice. - def visitVfrStatementVarstoreDevice(self, ctx:VfrSyntaxParser.VfrState= mentVarstoreDeviceContext): - VDObj =3D CIfrVarStoreDevice() + def visitVfrStatementVarstoreDevice( + self, ctx: VfrSyntaxParser.VfrStatementVarstoreDeviceContext + ): + VDObj =3D IfrVarStoreDevice() self.visitChildren(ctx) =20 VDObj.SetLineNo(ctx.start.line) - VDObj.SetDevicePath(self.__TransNum(ctx.Number())) + VDObj.SetDevicePath(self.TransNum(ctx.Number())) ctx.Node.Data =3D VDObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(VDObj.GetInfo()) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementRefreshEv= ent. - def visitVfrStatementRefreshEvent(self, ctx:VfrSyntaxParser.VfrStateme= ntRefreshEventContext): - RiObj =3D CIfrRefreshId() + def visitVfrStatementRefreshEvent(self, ctx: VfrSyntaxParser.VfrStatem= entRefreshEventContext): + RiObj =3D IfrRefreshId() self.visitChildren(ctx) =20 RiObj.SetLineNo(ctx.start.line) RiObj.SetRefreshEventGroutId(ctx.guidDefinition().Guid) ctx.Node.Data =3D RiObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(RiObj.GetInfo()) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementWarningIf= . - def visitVfrStatementWarningIf(self, ctx:VfrSyntaxParser.VfrStatementW= arningIfContext): - WIObj =3D CIfrWarningIf() + def visitVfrStatementWarningIf(self, ctx: VfrSyntaxParser.VfrStatement= WarningIfContext): + WIObj =3D IfrWarningIf() self.visitChildren(ctx) =20 WIObj.SetLineNo(ctx.start.line) - WIObj.SetWarning(self.__TransNum(ctx.Number(0))) - WIObj.SetTimeOut(self.__TransNum(ctx.Number(1))) + WIObj.SetWarning(self.TransNum(ctx.Number(0))) + if ctx.Timeout() !=3D None: + WIObj.SetTimeOut(self.TransNum(ctx.Number(1))) + WIObj.SetHasHasTimeOut(True) ctx.Node.Data =3D WIObj - ctx.Node.Expression =3D self.__ExtractOriginalText(ctx.vfrStatemen= tExpression()) - + ctx.Node.Buffer =3D gFormPkg.StructToStream(WIObj.GetInfo()) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + self.InsertEndNode(ctx.Node, ctx.stop.line) return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementQuestionT= agList. - def visitVfrStatementQuestionTagList(self, ctx:VfrSyntaxParser.VfrStat= ementQuestionTagListContext): - + def visitVfrStatementQuestionTagList( + self, ctx: VfrSyntaxParser.VfrStatementQuestionTagListContext + ): self.visitChildren(ctx) for Ctx in ctx.vfrStatementQuestionTag(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementQuestionO= ptionTag. - def visitVfrStatementQuestionOptionTag(self, ctx:VfrSyntaxParser.VfrSt= atementQuestionOptionTagContext): - + def visitVfrStatementQuestionOptionTag( + self, ctx: VfrSyntaxParser.VfrStatementQuestionOptionTagContext + ): self.visitChildren(ctx) if ctx.vfrStatementSuppressIfQuest() !=3D None: ctx.Node =3D ctx.vfrStatementSuppressIfQuest().Node @@ -1621,291 +1880,294 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementSuppressI= fQuest. - def visitVfrStatementSuppressIfQuest(self, ctx:VfrSyntaxParser.VfrStat= ementSuppressIfQuestContext): - - SIObj =3D CIfrSuppressIf() + def visitVfrStatementSuppressIfQuest( + self, ctx: VfrSyntaxParser.VfrStatementSuppressIfQuestContext + ): + SIObj =3D IfrSuppressIf() SIObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D SIObj - ctx.Node.Condition =3D 'suppressif' + ' ' + self.__ExtractOriginal= Text(ctx.vfrStatementExpression()) + ctx.Node.Condition =3D ( + "suppressif" + " " + self.ExtractOriginalText(ctx.vfrStatement= Expression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) self.visitChildren(ctx) + ctx.Node.Buffer =3D gFormPkg.StructToStream(SIObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementGrayOutIf= Quest. - def visitVfrStatementGrayOutIfQuest(self, ctx:VfrSyntaxParser.VfrState= mentGrayOutIfQuestContext): - GOIObj =3D CIfrGrayOutIf() + def visitVfrStatementGrayOutIfQuest( + self, ctx: VfrSyntaxParser.VfrStatementGrayOutIfQuestContext + ): + GOIObj =3D IfrGrayOutIf() GOIObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D GOIObj - ctx.Node.Condition =3D 'grayoutif' + ' ' + self.__ExtractOriginalT= ext(ctx.vfrStatementExpression()) + ctx.Node.Condition =3D ( + "grayoutif" + " " + self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) self.visitChildren(ctx) + ctx.Node.Buffer =3D gFormPkg.StructToStream(GOIObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#flagsField. - def visitFlagsField(self, ctx:VfrSyntaxParser.FlagsFieldContext): - + def visitFlagsField(self, ctx: VfrSyntaxParser.FlagsFieldContext): if ctx.N !=3D None: - CVfrErrorHandle.HandleWarning(EFI_VFR_WARNING_CODE.VFR_WARNING= _OBSOLETED_FRAMEWORK_OPCODE, ctx.N.line, ctx.N.text) + VfrErrorHandle.HandleWarning( + EFI_VFR_WARNING_CODE.VFR_WARNING_OBSOLETED_FRAMEWORK_OPCOD= E, ctx.N.line, ctx.N.text + ) if ctx.L !=3D None: - CVfrErrorHandle.HandleWarning(EFI_VFR_WARNING_CODE.VFR_WARNING= _OBSOLETED_FRAMEWORK_OPCODE, ctx.L.line, ctx.L.text) + VfrErrorHandle.HandleWarning( + EFI_VFR_WARNING_CODE.VFR_WARNING_OBSOLETED_FRAMEWORK_OPCOD= E, ctx.L.line, ctx.L.text + ) =20 return self.visitChildren(ctx) =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementDefault. - def visitVfrStatementDefault(self, ctx:VfrSyntaxParser.VfrStatementDef= aultContext): - + def visitVfrStatementDefault(self, ctx: VfrSyntaxParser.VfrStatementDe= faultContext): self.visitChildren(ctx) IsExp =3D False DefaultId =3D EFI_HII_DEFAULT_CLASS_STANDARD Line =3D ctx.start.line =20 if ctx.vfrConstantValueField() !=3D None: - Value =3D ctx.vfrConstantValueField().Value ValueList =3D ctx.vfrConstantValueField().ValueList - Type =3D self.__CurrQestVarInfo.VarType - Size =3D 0 + Value =3D ValueList[0] + Type =3D self.CurrQestVarInfo.VarType =20 - if self.__CurrentMinMaxData !=3D None and self.__CurrentMinMax= Data.IsNumericOpcode(): + if self.CurrentMinMaxData !=3D None and self.CurrentMinMaxData= .IsNumericOpcode(): # check default value is valid for Numeric Opcode - if ValueList =3D=3D []: - ValueList.append(Value) for i in range(0, len(ValueList)): Value =3D ValueList[i] - NumericQst =3D CIfrNumeric (self.__CurrentQuestion) # - if (NumericQst.GetNumericFlags() & EFI_IFR_DISPLAY) = =3D=3D 0 and self.__CurrQestVarInfo.IsBitVar =3D=3D False: # - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - if Value.u8 < self.__CurrentMinMaxData.GetMinD= ata(Type, False) or Value.u8 > self.__CurrentMinMaxData.GetMaxData(Type, Fa= lse): - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, Line, "Numeric default value must be between MinValue= and MaxValue.") - - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - if Value.u16 < self.__CurrentMinMaxData.GetMin= Data(Type, False) or Value.u16 > self.__CurrentMinMaxData.GetMaxData(Type, = False): - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, Line, "Numeric default value must be between MinValue= and MaxValue.") - - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - if Value.u32 < self.__CurrentMinMaxData.GetMin= Data(Type, False) or Value.u32 > self.__CurrentMinMaxData.GetMaxData(Type, = False): - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, Line, "Numeric default value must be between MinValue= and MaxValue.") - - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - if Value.u64 < self.__CurrentMinMaxData.GetMin= Data(Type, False) or Value.u64 > self.__CurrentMinMaxData.GetMaxData(Type, = False): - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, Line, "Numeric default value must be between MinValue= and MaxValue.") - - else: - # Value for question stored in bit fields is alway= s set to UINT32 type. - if self.__CurrQestVarInfo.IsBitVar: - if Value.u32 < self.__CurrentMinMaxData.GetMin= Data(Type, True) or Value.u32 > self.__CurrentMinMaxData.GetMaxData(Type, = True): - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, Line, "Numeric default value must be between MinValue= and MaxValue.") - else: - if Value.u64 < self.__CurrentMinMaxData.GetMin= Data(Type, False) or Value.u64 > self.__CurrentMinMaxData.GetMaxData(Type,= False): - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, Line, "Numeric default value must be between MinValue= and MaxValue.") + if type(Value) =3D=3D int: + if ( + Value < self.CurrentMinMaxData.GetMinData() + or Value > self.CurrentMinMaxData.GetMaxData() + ): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , + Line, + "Numeric default value must be between Min= Value and MaxValue.", + ) =20 if Type =3D=3D EFI_IFR_TYPE_OTHER: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_FATAL_ERROR, = Line, "Default data type error.") - Size =3D sizeof(EFI_IFR_TYPE_VALUE) - - elif ctx.vfrConstantValueField().ListType: - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - Size =3D sizeof(c_ubyte) * len(ValueList) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - Size =3D sizeof(c_ushort) * len(ValueList) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - Size =3D sizeof(c_ulong) * len(ValueList) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - Size =3D sizeof(c_ulonglong) * len(ValueList) - - else: - if self.__CurrQestVarInfo.IsBitVar: - Size =3D sizeof(c_ulong) - else: - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSiz= eByDataType(Type) - self.__ErrorHandler(ReturnCode, Line) - - Size +=3D EFI_IFR_DEFAULT.Value.offset + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_FATAL_ERROR, Line, "Default d= ata type error." + ) + for i in range(0, len(ValueList)): + if type(ValueList[i]) =3D=3D int: + if Type =3D=3D EFI_IFR_TYPE_TIME: + ValueList[i] =3D EFI_HII_TIME() + + if Type =3D=3D EFI_IFR_TYPE_DATE: + ValueList[i] =3D EFI_HII_DATE() + + if Type =3D=3D EFI_IFR_TYPE_REF: + ValueList[i] =3D EFI_HII_REF() + DObj =3D IfrDefault(Type, ValueList) + DObj.SetLineNo(Line) + DObj.SetValueStream(self.ExtractOriginalText(ctx.vfrConstantVa= lueField())) if not ctx.vfrConstantValueField().ListType: - DObj =3D CIfrDefault(Size) - DObj.SetLineNo(Line) - DObj.SetValue(Value) - - if self.__IsStringOp: + if self.IsStringOp: DObj.SetType(EFI_IFR_TYPE_STRING) else: - if self.__CurrQestVarInfo.IsBitVar: + if self.CurrQestVarInfo.IsBitVar: DObj.SetType(EFI_IFR_TYPE_NUM_SIZE_32) else: - DObj.SetType(self.__CurrQestVarInfo.VarType) + DObj.SetType(self.CurrQestVarInfo.VarType) else: - DObj =3D CIfrDefault3(Size, len(ValueList), Type) - DObj.SetLineNo(Line) - DObj.SetValue(ValueList) DObj.SetType(EFI_IFR_TYPE_BUFFER) =20 else: IsExp =3D True - DObj =3D CIfrDefault2() + DObj =3D IfrDefault2() DObj.SetLineNo(Line) DObj.SetScope(1) + self.InsertChild(ctx.Node, ctx.vfrStatementValue()) + self.InsertEndNode(ctx.Node, Line) =20 if ctx.DefaultStore() !=3D None: - DefaultId, ReturnCode =3D gCVfrDefaultStore.GetDefaultId(ctx.S= N.text) - self.__ErrorHandler(ReturnCode, ctx.SN.line, ctx.SN.text) + DefaultId, ReturnCode =3D gVfrDefaultStore.GetDefaultId(ctx.SN= .text) + self.ErrorHandler(ReturnCode, ctx.SN.line, ctx.SN.text) DObj.SetDefaultId(DefaultId) - - self.__CheckDuplicateDefaultValue(DefaultId, ctx.D.line, ctx.D.tex= t) - if self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: - VarStoreName, ReturnCode =3D gCVfrDataStorage.GetVarStoreName(= self.__CurrQestVarInfo.VarStoreId) - self.__ErrorHandler(ReturnCode, Line) - VarGuid =3D gCVfrDataStorage.GetVarStoreGuid(self.__CurrQestVa= rInfo.VarStoreId) - VarStoreType =3D gCVfrDataStorage.GetVarStoreType(self.__CurrQ= estVarInfo.VarStoreId) + DObj.SetDefaultStore(ctx.SN.text) + + self.CheckDuplicateDefaultValue(DefaultId, ctx.D.line, ctx.D.text) + if self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: + VarStoreName, ReturnCode =3D gVfrDataStorage.GetVarStoreName( + self.CurrQestVarInfo.VarStoreId + ) + self.ErrorHandler(ReturnCode, Line) + VarGuid =3D gVfrDataStorage.GetVarStoreGuid(self.CurrQestVarIn= fo.VarStoreId) + VarStoreType =3D gVfrDataStorage.GetVarStoreType(self.CurrQest= VarInfo.VarStoreId) if (IsExp =3D=3D False) and (VarStoreType =3D=3D EFI_VFR_VARST= ORE_TYPE.EFI_VFR_VARSTORE_BUFFER): - self.__ErrorHandler(gCVfrDefaultStore.BufferVarStoreAltCon= figAdd(DefaultId, self.__CurrQestVarInfo, VarStoreName, VarGuid, self.__Cur= rQestVarInfo.VarType, Value), Line) + self.ErrorHandler( + gVfrDefaultStore.BufferVarStoreAltConfigAdd( + DefaultId, + self.CurrQestVarInfo, + VarStoreName, + VarGuid, + self.CurrQestVarInfo.VarType, + Value, + ), + Line, + ) ctx.Node.Data =3D DObj - self.__InsertChild(ctx.Node, ctx.vfrStatementValue()) - + ctx.Node.Buffer =3D gFormPkg.StructToStream(DObj.GetInfo()) return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementValue. - def visitVfrStatementValue(self, ctx:VfrSyntaxParser.VfrStatementValue= Context): - - VObj =3D CIfrValue() + def visitVfrStatementValue(self, ctx: VfrSyntaxParser.VfrStatementValu= eContext): + VObj =3D IfrValue() self.visitChildren(ctx) =20 VObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D VObj - ctx.Node.Expression =3D self.__ExtractOriginalText(ctx.vfrStatemen= tExpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(VObj.GetInfo()) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementOptions. - def visitVfrStatementOptions(self, ctx:VfrSyntaxParser.VfrStatementOpt= ionsContext): - + def visitVfrStatementOptions(self, ctx: VfrSyntaxParser.VfrStatementOp= tionsContext): self.visitChildren(ctx) ctx.Node =3D ctx.vfrStatementOneOfOption().Node return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementOneOfOpti= on. - def visitVfrStatementOneOfOption(self, ctx:VfrSyntaxParser.VfrStatemen= tOneOfOptionContext): - + def visitVfrStatementOneOfOption(self, ctx: VfrSyntaxParser.VfrStateme= ntOneOfOptionContext): Line =3D ctx.start.line - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_FATAL_ERROR, Line= , "Get data type error.") + if self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_FATAL_ERROR, Line, = "Get data type error.") =20 self.visitChildren(ctx) =20 - Value =3D ctx.vfrConstantValueField().Value ValueList =3D ctx.vfrConstantValueField().ValueList - Type =3D self.__CurrQestVarInfo.VarType - Size =3D 0 - if self.__CurrentMinMaxData !=3D None: - #set min/max value for oneof opcode - Step =3D self.__CurrentMinMaxData.GetStepData(self.__CurrQestV= arInfo.VarType, self.__CurrQestVarInfo.IsBitVar) - if self.__CurrQestVarInfo.IsBitVar: - self.__CurrentMinMaxData.SetMinMaxStepData(Value.u32, Valu= e.u32, Step, EFI_IFR_TYPE_NUM_SIZE_32) - else: - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - self.__CurrentMinMaxData.SetMinMaxStepData(Value.u64, = Value.u64, Step, EFI_IFR_TYPE_NUM_SIZE_64) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - self.__CurrentMinMaxData.SetMinMaxStepData(Value.u32, = Value.u32, Step, EFI_IFR_TYPE_NUM_SIZE_32) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - self.__CurrentMinMaxData.SetMinMaxStepData(Value.u16, = Value.u16, Step, EFI_IFR_TYPE_NUM_SIZE_16) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - self.__CurrentMinMaxData.SetMinMaxStepData(Value.u8, V= alue.u8, Step, EFI_IFR_TYPE_NUM_SIZE_8) - - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: - Size =3D sizeof(EFI_IFR_TYPE_VALUE) - elif ctx.vfrConstantValueField().ListType: - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - Size =3D sizeof(c_ubyte) * len(ValueList) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - Size =3D sizeof(c_ushort) * len(ValueList) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - Size =3D sizeof(c_ulong) * len(ValueList) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - Size =3D sizeof(c_ulonglong) * len(ValueList) - else: - # For the oneof stored in bit fields, set the option type as U= INT32. - if self.__CurrQestVarInfo.IsBitVar: - Size =3D sizeof(c_long) - else: - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSizeByD= ataType(Type) - self.__ErrorHandler(ReturnCode, Line) + Value =3D ValueList[0] + Type =3D self.CurrQestVarInfo.VarType + if self.CurrentMinMaxData !=3D None: + # set min/max value for oneof opcode + Step =3D self.CurrentMinMaxData.GetStepData() + self.CurrentMinMaxData.SetMinMaxStepData(Value, Value, Step) + + if self.CurrQestVarInfo.IsBitVar: + Type =3D EFI_IFR_TYPE_NUM_SIZE_32 + OOOObj =3D IfrOneOfOption(Type, ValueList) =20 - Size +=3D EFI_IFR_ONE_OF_OPTION.Value.offset - OOOObj =3D None if not ctx.vfrConstantValueField().ListType: - OOOObj =3D CIfrOneOfOption(Size) - if self.__CurrQestVarInfo.IsBitVar: - OOOObj.SetType(EFI_IFR_TYPE_NUM_SIZE_32) - else: - OOOObj.SetType(Type) - OOOObj.SetValue(Value) + OOOObj.SetType(Type) else: - OOOObj =3D CIfrOneOfOption2(Size, len(ValueList), Type) OOOObj.SetType(EFI_IFR_TYPE_BUFFER) - OOOObj.SetValue(ValueList) - =20 OOOObj.SetLineNo(Line) - OOOObj.SetOption(self.__TransNum(ctx.Number(0))) - - - self.__ErrorHandler(OOOObj.SetFlags(ctx.vfrOneOfOptionFlags().LFla= gs), ctx.F.line) - self.__ErrorHandler(self.__CurrentQuestion.SetQHeaderFlags(ctx.vfr= OneOfOptionFlags().HFlags), ctx.F.line) + OOOObj.SetOption(self.TransNum(ctx.Number(0))) + OOOObj.SetValueStream(self.ExtractOriginalText(ctx.vfrConstantValu= eField())) + OOOObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrOneOfOptionF= lags())) + self.ErrorHandler(OOOObj.SetFlags(ctx.vfrOneOfOptionFlags().LFlags= ), ctx.F.line) + self.ErrorHandler( + self.CurrentQuestion.SetQHeaderFlags(ctx.vfrOneOfOptionFlags()= .HFlags), ctx.F.line + ) =20 # Array type only for default type OneOfOption. - if (OOOObj.GetFlags() & (EFI_IFR_OPTION_DEFAULT | EFI_IFR_OPTION_D= EFAULT_MFG)) =3D=3D 0 and (ctx.vfrConstantValueField().ListType): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_FATAL_ERROR, Line= , "Default keyword should with array value type!") + if (OOOObj.GetFlags() & (EFI_IFR_OPTION_DEFAULT | EFI_IFR_OPTION_D= EFAULT_MFG)) =3D=3D 0 and ( + ctx.vfrConstantValueField().ListType + ): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_FATAL_ERROR, + Line, + "Default keyword should with array value type!", + ) =20 # Clear the default flag if the option not use array value but has= default flag. - if (OOOObj.GetFlags() & (EFI_IFR_OPTION_DEFAULT | EFI_IFR_OPTION_D= EFAULT_MFG)) !=3D 0 and (ctx.vfrConstantValueField().ListType =3D=3D False)= and (self.__IsOrderedList): - OOOObj.SetFlags(OOOObj.GetFlags() & ~(EFI_IFR_OPTION_DEFAULT |= EFI_IFR_OPTION_DEFAULT_MFG)) - - if self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: - VarStoreName, ReturnCode =3D gCVfrDataStorage.GetVarStoreName(= self.__CurrQestVarInfo.VarStoreId) - self.__ErrorHandler(ReturnCode, Line) - VarStoreGuid =3D gCVfrDataStorage.GetVarStoreGuid(self.__CurrQ= estVarInfo.VarStoreId) + if ( + (OOOObj.GetFlags() & (EFI_IFR_OPTION_DEFAULT | EFI_IFR_OPTION_= DEFAULT_MFG)) !=3D 0 + and (ctx.vfrConstantValueField().ListType =3D=3D False) + and (self.IsOrderedList) + ): + OOOObj.SetFlags( + OOOObj.GetFlags() & ~(EFI_IFR_OPTION_DEFAULT | EFI_IFR_OPT= ION_DEFAULT_MFG) + ) + + if self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: + VarStoreName, ReturnCode =3D gVfrDataStorage.GetVarStoreName( + self.CurrQestVarInfo.VarStoreId + ) + self.ErrorHandler(ReturnCode, Line) + VarStoreGuid =3D gVfrDataStorage.GetVarStoreGuid(self.CurrQest= VarInfo.VarStoreId) if OOOObj.GetFlags() & EFI_IFR_OPTION_DEFAULT: - self.__CheckDuplicateDefaultValue(EFI_HII_DEFAULT_CLASS_ST= ANDARD, ctx.F.line, ctx.F.text) - self.__ErrorHandler(gCVfrDefaultStore.BufferVarStoreAltCon= figAdd(EFI_HII_DEFAULT_CLASS_STANDARD, self.__CurrQestVarInfo, VarStoreName= , VarStoreGuid, self.__CurrQestVarInfo.VarType, Value), Line) + self.CheckDuplicateDefaultValue( + EFI_HII_DEFAULT_CLASS_STANDARD, ctx.F.line, ctx.F.text + ) + self.ErrorHandler( + gVfrDefaultStore.BufferVarStoreAltConfigAdd( + EFI_HII_DEFAULT_CLASS_STANDARD, + self.CurrQestVarInfo, + VarStoreName, + VarStoreGuid, + self.CurrQestVarInfo.VarType, + Value, + ), + Line, + ) if OOOObj.GetFlags() & EFI_IFR_OPTION_DEFAULT_MFG: - self.__CheckDuplicateDefaultValue(EFI_HII_DEFAULT_CLASS_MA= NUFACTURING, ctx.F.line, ctx.F.text) - self.__ErrorHandler(gCVfrDefaultStore.BufferVarStoreAltCon= figAdd(EFI_HII_DEFAULT_CLASS_MANUFACTURING, self.__CurrQestVarInfo, VarStor= eName, VarStoreGuid, self.__CurrQestVarInfo.VarType, Value), Line) + self.CheckDuplicateDefaultValue( + EFI_HII_DEFAULT_CLASS_MANUFACTURING, ctx.F.line, ctx.F= .text + ) + self.ErrorHandler( + gVfrDefaultStore.BufferVarStoreAltConfigAdd( + EFI_HII_DEFAULT_CLASS_MANUFACTURING, + self.CurrQestVarInfo, + VarStoreName, + VarStoreGuid, + self.CurrQestVarInfo.VarType, + Value, + ), + Line, + ) =20 if ctx.Key() !=3D None: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ctx.= KN.line, ctx.KN.text) - #?Guid Option Key - IfrOptionKey =3D CIfrOptionKey(self.__CurrentQuestion.GetQuest= ionId(), Value, self.__TransNum(ctx.KN.text)) - IfrOptionKey.SetLineNo() - if ctx.vfrImageTag() !=3D None: - OOOObj.SetScope(1) # - ctx.Node.Data =3D OOOObj + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ctx.KN= .line, ctx.KN.text) + # =E3=80=80Guid Option Key + OOOObj.SetIfrOptionKey(self.TransNum(ctx.KN.text)) + gIfrOptionKey =3D IfrOptionKey( + self.CurrentQuestion.GetQuestionId(), Type, Value, self.Tr= ansNum(ctx.KN.text) + ) + Node =3D IfrTreeNode( + EFI_IFR_GUID_OP, gIfrOptionKey, gFormPkg.StructToStream(gI= frOptionKey.GetInfo()) + ) + gIfrOptionKey.SetLineNo() + ctx.Node.insertChild(Node) + for Ctx in ctx.vfrImageTag(): - self.__InsertChild(ctx.Node, Ctx) + OOOObj.SetScope(1) + self.InsertChild(ctx.Node, Ctx) + self.InsertEndNode(ctx.Node, ctx.T.line) =20 - return ctx.Node + ctx.Node.Data =3D OOOObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(OOOObj.GetInfo()) =20 + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrOneOfOptionFlags. - def visitVfrOneOfOptionFlags(self, ctx:VfrSyntaxParser.VfrOneOfOptionF= lagsContext): - + def visitVfrOneOfOptionFlags(self, ctx: VfrSyntaxParser.VfrOneOfOption= FlagsContext): self.visitChildren(ctx) =20 - ctx.LFlags =3D self.__CurrQestVarInfo.VarType + ctx.LFlags =3D self.CurrQestVarInfo.VarType for FlagsFieldCtx in ctx.oneofoptionFlagsField(): ctx.HFlags |=3D FlagsFieldCtx.HFlag ctx.LFlags |=3D FlagsFieldCtx.LFlag =20 return ctx.HFlags, ctx.LFlags =20 - # Visit a parse tree produced by VfrSyntaxParser#oneofoptionFlagsField= . - def visitOneofoptionFlagsField(self, ctx:VfrSyntaxParser.OneofoptionFl= agsFieldContext): - + def visitOneofoptionFlagsField(self, ctx: VfrSyntaxParser.OneofoptionF= lagsFieldContext): self.visitChildren(ctx) =20 if ctx.Number() !=3D None: - ctx.LFlag =3D self.__TransNum(ctx.Number()) + ctx.LFlag =3D self.TransNum(ctx.Number()) if ctx.OptionDefault() !=3D None: ctx.LFlag =3D 0x10 if ctx.OptionDefaultMfg() !=3D None: @@ -1923,49 +2185,54 @@ class VfrSyntaxVisitor(ParseTreeVisitor): if ctx.DefaultFlag() !=3D None: ctx.LFlag =3D 0x10 if ctx.NVAccessFlag() !=3D None: - gCVfrErrorHandle.HandleWarning (EFI_VFR_WARNING_CODE.VFR_WARNI= NG_OBSOLETED_FRAMEWORK_OPCODE, ctx.A.line, ctx.A.text) + gVfrErrorHandle.HandleWarning( + EFI_VFR_WARNING_CODE.VFR_WARNING_OBSOLETED_FRAMEWORK_OPCOD= E, ctx.A.line, ctx.A.text + ) if ctx.LateCheckFlag() !=3D None: - gCVfrErrorHandle.HandleWarning (EFI_VFR_WARNING_CODE.VFR_WARNI= NG_OBSOLETED_FRAMEWORK_OPCODE, ctx.L.line, ctx.L.text) + gVfrErrorHandle.HandleWarning( + EFI_VFR_WARNING_CODE.VFR_WARNING_OBSOLETED_FRAMEWORK_OPCOD= E, ctx.L.line, ctx.L.text + ) =20 return ctx.HFlag, ctx.LFlag =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementRead. - def visitVfrStatementRead(self, ctx:VfrSyntaxParser.VfrStatementReadCo= ntext): - - RObj =3D CIfrRead() + def visitVfrStatementRead(self, ctx: VfrSyntaxParser.VfrStatementReadC= ontext): + RObj =3D IfrRead() self.visitChildren(ctx) =20 RObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D RObj - ctx.Node.Expression =3D self.__ExtractOriginalText(ctx.vfrStatemen= tExpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(RObj.GetInfo()) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementWrite. - def visitVfrStatementWrite(self, ctx:VfrSyntaxParser.VfrStatementWrite= Context): - - WObj =3D CIfrWrite() + def visitVfrStatementWrite(self, ctx: VfrSyntaxParser.VfrStatementWrit= eContext): + WObj =3D IfrWrite() self.visitChildren(ctx) =20 WObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D WObj - ctx.Node.Expression =3D self.__ExtractOriginalText(ctx.vfrStatemen= tExpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(WObj.GetInfo()) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementQuestionO= ptionList. - def visitVfrStatementQuestionOptionList(self, ctx:VfrSyntaxParser.VfrS= tatementQuestionOptionListContext): - + def visitVfrStatementQuestionOptionList( + self, ctx: VfrSyntaxParser.VfrStatementQuestionOptionListContext + ): self.visitChildren(ctx) for Ctx in ctx.vfrStatementQuestionOption(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementQuestionO= ption. - def visitVfrStatementQuestionOption(self, ctx:VfrSyntaxParser.VfrState= mentQuestionOptionContext): - + def visitVfrStatementQuestionOption( + self, ctx: VfrSyntaxParser.VfrStatementQuestionOptionContext + ): self.visitChildren(ctx) if ctx.vfrStatementQuestionTag() !=3D None: ctx.Node =3D ctx.vfrStatementQuestionTag().Node @@ -1974,85 +2241,150 @@ class VfrSyntaxVisitor(ParseTreeVisitor): ctx.Node =3D ctx.vfrStatementQuestionOptionTag().Node return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementBooleanTy= pe. - def visitVfrStatementBooleanType(self, ctx:VfrSyntaxParser.VfrStatemen= tBooleanTypeContext): - + def visitVfrStatementBooleanType(self, ctx: VfrSyntaxParser.VfrStateme= ntBooleanTypeContext): self.visitChildren(ctx) if ctx.vfrStatementCheckBox() !=3D None: - ctx.Node =3D ctx.vfrStatementCheckBox().Node + if self.CurrQestVarInfo.IsBitVar: + ctx.Node =3D ctx.vfrStatementCheckBox().GuidNode + else: + ctx.Node =3D ctx.vfrStatementCheckBox().Node else: ctx.Node =3D ctx.vfrStatementAction().Node =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementCheckBox. - def visitVfrStatementCheckBox(self, ctx:VfrSyntaxParser.VfrStatementCh= eckBoxContext): - - CBObj =3D ctx.OpObj - Line =3D ctx.start.line + def visitVfrStatementCheckBox(self, ctx: VfrSyntaxParser.VfrStatementC= heckBoxContext): + CBObj =3D IfrCheckBox() + ctx.Node.Data =3D CBObj + Line =3D ctx.start.line CBObj.SetLineNo(Line) - self.__CurrentQuestion =3D CBObj.GetQuestion() - self.__IsCheckBoxOp =3D True - + self.CurrentQuestion =3D CBObj + self.IsCheckBoxOp =3D True self.visitChildren(ctx) =20 # Create a GUID opcode to wrap the checkbox opcode, if it refer to= bit varstore. - if self.__CurrQestVarInfo.IsBitVar: - GuidObj =3D CIfrGuid(0) + if self.CurrQestVarInfo.IsBitVar: + GuidObj =3D IfrGuid(0) GuidObj.SetGuid(EDKII_IFR_BIT_VARSTORE_GUID) GuidObj.SetLineNo(Line) - GuidObj.SetScope(1) # + GuidObj.SetScope(1) + ctx.GuidNode.Data =3D GuidObj + ctx.GuidNode.Buffer =3D gFormPkg.StructToStream(GuidObj.GetInf= o()) + ctx.GuidNode.insertChild(ctx.Node) + self.InsertEndNode(ctx.GuidNode, ctx.stop.line) =20 # check dataType - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: - self.__CurrQestVarInfo.VarType =3D EFI_IFR_TYPE_BOOLEAN + if self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: + self.CurrQestVarInfo.VarType =3D EFI_IFR_TYPE_BOOLEAN =20 - if self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: + if self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: # Check whether the question refers to a bit field, if yes. cr= eate a Guid to indicate the question refers to a bit field. - if self.__CurrQestVarInfo.IsBitVar: - _, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSizeByData= Type(self.__CurrQestVarInfo.VarType) - self.__ErrorHandler(ReturnCode, Line, "CheckBox varid is n= ot the valid data type") - if gCVfrDataStorage.GetVarStoreType(self.__CurrQestVarInfo= .VarStoreId) =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_BUFFER_BITS and = self.__CurrQestVarInfo.VarTotalSize !=3D 1: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_P= ARAMETER, Line, "CheckBox varid only occupy 1 bit in Bit Varstore") + if self.CurrQestVarInfo.IsBitVar: + _, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSizeByDataT= ype( + self.CurrQestVarInfo.VarType + ) + self.ErrorHandler(ReturnCode, Line, "CheckBox varid is not= the valid data type") + if ( + gVfrDataStorage.GetVarStoreType(self.CurrQestVarInfo.V= arStoreId) + =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_BUFFER_B= ITS + and self.CurrQestVarInfo.VarTotalSize !=3D 1 + ): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "CheckBox varid only occupy 1 bit in Bit Varstore"= , + ) else: - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSiz= eByDataType(self.__CurrQestVarInfo.VarType) - self.__ErrorHandler(ReturnCode, Line, "CheckBox varid = is not the valid data type") - if Size !=3D 0 and Size !=3D self.__CurrQestVarInfo.Va= rTotalSize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVAL= ID_PARAMETER, Line, "CheckBox varid doesn't support array") - elif gCVfrDataStorage.GetVarStoreType(self.__CurrQestV= arInfo.VarStoreId) =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_BUFFER and= self.__CurrQestVarInfo.VarTotalSize !=3D sizeof(ctypes.c_bool): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVAL= ID_PARAMETER, Line, "CheckBox varid only support BOOLEAN data type") + Size, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSize= ByDataType( + self.CurrQestVarInfo.VarType + ) + self.ErrorHandler(ReturnCode, Line, "CheckBox varid is= not the valid data type") + if Size !=3D 0 and Size !=3D self.CurrQestVarInfo.VarT= otalSize: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "CheckBox varid doesn't support array", + ) + elif gVfrDataStorage.GetVarStoreType( + self.CurrQestVarInfo.VarStoreId + ) =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_BUFFER= and self.CurrQestVarInfo.VarTotalSize !=3D sizeof( + c_bool + ): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "CheckBox varid only support BOOLEAN data type= ", + ) =20 if ctx.FLAGS() !=3D None: + CBObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrCheckBoxF= lags())) CBObj.SetFlags(ctx.vfrCheckBoxFlags().HFlags, ctx.vfrCheckBoxF= lags().LFlags) - if self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVA= LID: - VarStoreName, ReturnCode =3D gCVfrDataStorage.GetVarStoreN= ame(self.__CurrQestVarInfo.VarStoreId) - self.__CompareErrorHandler(ReturnCode, VfrReturnCode.VFR_R= ETURN_SUCCESS, Line, ctx.L.text, "Failed to retrieve varstore name") - - VarStoreGuid =3D gCVfrDataStorage.GetVarStoreGuid(self.__C= urrQestVarInfo.VarStoreId) - self.gZeroEfiIfrTypeValue.b =3D True + if self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALI= D: + VarStoreName, ReturnCode =3D gVfrDataStorage.GetVarStoreNa= me( + self.CurrQestVarInfo.VarStoreId + ) + self.CompareErrorHandler( + ReturnCode, + VfrReturnCode.VFR_RETURN_SUCCESS, + Line, + ctx.L.text, + "Failed to retrieve varstore name", + ) + + VarStoreGuid =3D gVfrDataStorage.GetVarStoreGuid(self.Curr= QestVarInfo.VarStoreId) + self.Value =3D True if CBObj.GetFlags() & 0x01: - self.__CheckDuplicateDefaultValue(EFI_HII_DEFAULT_CLAS= S_STANDARD, ctx.F.line, ctx.F.text) - ReturnCode =3D gCVfrDefaultStore.BufferVarStoreAltConf= igAdd(EFI_HII_DEFAULT_CLASS_STANDARD,self.__CurrQestVarInfo, VarStoreName, = VarStoreGuid, self.__CurrQestVarInfo.VarType, self.gZeroEfiIfrTypeValue) - self.__CompareErrorHandler(ReturnCode, VfrReturnCode.V= FR_RETURN_SUCCESS, Line, ctx.L.text, "No standard default storage found") + self.CheckDuplicateDefaultValue( + EFI_HII_DEFAULT_CLASS_STANDARD, ctx.F.line, ctx.F.= text + ) + ReturnCode =3D gVfrDefaultStore.BufferVarStoreAltConfi= gAdd( + EFI_HII_DEFAULT_CLASS_STANDARD, + self.CurrQestVarInfo, + VarStoreName, + VarStoreGuid, + self.CurrQestVarInfo.VarType, + self.Value, + ) + self.CompareErrorHandler( + ReturnCode, + VfrReturnCode.VFR_RETURN_SUCCESS, + Line, + ctx.L.text, + "No standard default storage found", + ) if CBObj.GetFlags() & 0x02: - self.__CheckDuplicateDefaultValue(EFI_HII_DEFAULT_CLAS= S_MANUFACTURING, ctx.F.line, ctx.F.text) - ReturnCode =3D gCVfrDefaultStore.BufferVarStoreAltCon= figAdd(EFI_HII_DEFAULT_CLASS_MANUFACTURING, self.__CurrQestVarInfo, VarStor= eName, VarStoreGuid, self.__CurrQestVarInfo.VarType, self.gZeroEfiIfrTypeVa= lue) - self.__CompareErrorHandler(ReturnCode, VfrReturnCode.V= FR_RETURN_SUCCESS, Line, ctx.L.text, "No manufacturing default storage foun= d") - if ctx.Key() !=3D None: - Key =3D self.__TransNum(ctx.Number()) - self.__AssignQuestionKey(CBObj, Key) + self.CheckDuplicateDefaultValue( + EFI_HII_DEFAULT_CLASS_MANUFACTURING, ctx.F.line, c= tx.F.text + ) + ReturnCode =3D gVfrDefaultStore.BufferVarStoreAltConfi= gAdd( + EFI_HII_DEFAULT_CLASS_MANUFACTURING, + self.CurrQestVarInfo, + VarStoreName, + VarStoreGuid, + self.CurrQestVarInfo.VarType, + self.Value, + ) + self.CompareErrorHandler( + ReturnCode, + VfrReturnCode.VFR_RETURN_SUCCESS, + Line, + ctx.L.text, + "No manufacturing default storage found", + ) =20 - ctx.Node.Data =3D CBObj - self.__IsCheckBoxOp =3D False + if ctx.Key() !=3D None: + Key =3D self.TransNum(ctx.Number()) + self.AssignQuestionKey(CBObj, Key) + ctx.Node.Buffer =3D gFormPkg.StructToStream(CBObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) + self.IsCheckBoxOp =3D False =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrCheckBoxFlags. - def visitVfrCheckBoxFlags(self, ctx:VfrSyntaxParser.VfrCheckBoxFlagsCo= ntext): - + def visitVfrCheckBoxFlags(self, ctx: VfrSyntaxParser.VfrCheckBoxFlagsC= ontext): self.visitChildren(ctx) for FlagsFieldCtx in ctx.checkboxFlagsField(): ctx.LFlags |=3D FlagsFieldCtx.LFlag @@ -2060,19 +2392,17 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.HFlags, ctx.LFlags =20 - # Visit a parse tree produced by VfrSyntaxParser#checkboxFlagsField. - def visitCheckboxFlagsField(self, ctx:VfrSyntaxParser.CheckboxFlagsFie= ldContext): - + def visitCheckboxFlagsField(self, ctx: VfrSyntaxParser.CheckboxFlagsFi= eldContext): self.visitChildren(ctx) =20 if ctx.Number() !=3D None: - if self.__TransNum(ctx.Number()) !=3D 0: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = ctx.start.line) + if self.TransNum(ctx.Number()) !=3D 0: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ct= x.start.line) elif ctx.DefaultFlag() !=3D None: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ctx.= D.line, ctx.D.text) + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ctx.D.= line, ctx.D.text) elif ctx.ManufacturingFlag() !=3D None: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ctx.= M.line, ctx.M.text) + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ctx.M.= line, ctx.M.text) elif ctx.CheckBoxDefaultFlag() !=3D None: ctx.LFlag =3D 0x01 elif ctx.CheckBoxDefaultMfgFlag() !=3D None: @@ -2083,151 +2413,216 @@ class VfrSyntaxVisitor(ParseTreeVisitor): return ctx.HFlag, ctx.LFlag =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementAction. - def visitVfrStatementAction(self, ctx:VfrSyntaxParser.VfrStatementActi= onContext): - + def visitVfrStatementAction(self, ctx: VfrSyntaxParser.VfrStatementAct= ionContext): + AObj =3D IfrAction() + ctx.Node.Data =3D AObj self.visitChildren(ctx) - AObj =3D ctx.OpObj AObj.SetLineNo(ctx.start.line) - AObj.SetQuestionConfig(self.__TransNum(ctx.Number())) - ctx.Node.Data =3D AObj + AObj.SetQuestionConfig(self.TransNum(ctx.Number())) + if ctx.FLAGS() !=3D None: + AObj.SetFlags(ctx.vfrActionFlags().HFlags) + ctx.Node.Buffer =3D gFormPkg.StructToStream(AObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrActionFlags. - def visitVfrActionFlags(self, ctx:VfrSyntaxParser.VfrActionFlagsContex= t): - + def visitVfrActionFlags(self, ctx: VfrSyntaxParser.VfrActionFlagsConte= xt): self.visitChildren(ctx) for FlagsFieldCtx in ctx.actionFlagsField(): ctx.HFlags |=3D FlagsFieldCtx.HFlag =20 return ctx.HFlags =20 - # Visit a parse tree produced by VfrSyntaxParser#actionFlagsField. - def visitActionFlagsField(self, ctx:VfrSyntaxParser.ActionFlagsFieldCo= ntext): - + def visitActionFlagsField(self, ctx: VfrSyntaxParser.ActionFlagsFieldC= ontext): self.visitChildren(ctx) =20 if ctx.Number() !=3D None: - if self.__TransNum(ctx.Number()) !=3D 0: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = ctx.N.line) + if self.TransNum(ctx.Number()) !=3D 0: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ct= x.N.line) else: ctx.HFlag =3D ctx.questionheaderFlagsField().QHFlag return ctx.HFlag =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementNumericTy= pe. - def visitVfrStatementNumericType(self, ctx:VfrSyntaxParser.VfrStatemen= tNumericTypeContext): - + def visitVfrStatementNumericType(self, ctx: VfrSyntaxParser.VfrStateme= ntNumericTypeContext): self.visitChildren(ctx) if ctx.vfrStatementNumeric() !=3D None: - ctx.Node =3D ctx.vfrStatementNumeric().Node + if self.CurrQestVarInfo.IsBitVar: + ctx.Node =3D ctx.vfrStatementNumeric().GuidNode + else: + ctx.Node =3D ctx.vfrStatementNumeric().Node elif ctx.vfrStatementOneOf() !=3D None: - ctx.Node =3D ctx.vfrStatementOneOf().Node + if self.CurrQestVarInfo.IsBitVar: + ctx.Node =3D ctx.vfrStatementOneOf().GuidNode + else: + ctx.Node =3D ctx.vfrStatementOneOf().Node =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxP-arser#vfrStatementNumeric. - def visitVfrStatementNumeric(self, ctx:VfrSyntaxParser.VfrStatementNum= ericContext): - + def visitVfrStatementNumeric(self, ctx: VfrSyntaxParser.VfrStatementNu= mericContext): self.visitChildren(ctx) - NObj =3D ctx.OpObj + NObj =3D ctx.Node.Data + NObj.SetLineNo(ctx.start.line) - self.__CurrentQuestion =3D NObj.GetQuestion() Line =3D ctx.start.line + UpdateVarType =3D False =20 - if self.__CurrQestVarInfo.IsBitVar: - GuidObj =3D CIfrGuid(0) + # Create a GUID opcode to wrap the numeric opcode, if it refer to = bit varstore. + if self.CurrQestVarInfo.IsBitVar: + GuidObj =3D IfrGuid(0) GuidObj.SetGuid(EDKII_IFR_BIT_VARSTORE_GUID) GuidObj.SetLineNo(Line) - GuidObj.SetScope(1) # pos + GuidObj.SetScope(1) # pos + ctx.GuidNode.Data =3D GuidObj + ctx.GuidNode.Buffer =3D gFormPkg.StructToStream(GuidObj.GetInf= o()) + ctx.GuidNode.insertChild(ctx.Node) + self.InsertEndNode(ctx.GuidNode, ctx.stop.line) =20 # check data type - if self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: - if self.__CurrQestVarInfo.IsBitVar: - LFlags =3D EDKII_IFR_NUMERIC_SIZE_BIT & self.__CurrQestVar= Info.VarTotalSize - self.__ErrorHandler(NObj.SetFlagsForBitField(NObj.GetFlags= (),LFlags), Line) + if self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: + if self.CurrQestVarInfo.IsBitVar: + LFlags =3D EDKII_IFR_NUMERIC_SIZE_BIT & self.CurrQestVarIn= fo.VarTotalSize + self.ErrorHandler(NObj.SetFlagsForBitField(NObj.GetQFlags(= ), LFlags), Line) else: - DataTypeSize, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTyp= eSizeByDataType(self.__CurrQestVarInfo.VarType) - self.__ErrorHandler(ReturnCode, Line, 'Numeric varid is no= t the valid data type') - if DataTypeSize !=3D 0 and DataTypeSize !=3D self.__CurrQe= stVarInfo.VarTotalSize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_P= ARAMETER, Line, 'Numeric varid doesn\'t support array') - self.__ErrorHandler(NObj.SetFlags(NObj.GetFlags(), self.__= CurrQestVarInfo.VarType), Line) - + DataTypeSize, ReturnCode =3D gVfrVarDataTypeDB.GetDataType= SizeByDataType( + self.CurrQestVarInfo.VarType + ) + self.ErrorHandler(ReturnCode, Line, "Numeric varid is not = the valid data type") + if DataTypeSize !=3D 0 and DataTypeSize !=3D self.CurrQest= VarInfo.VarTotalSize: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "Numeric varid doesn't support array", + ) + self.ErrorHandler( + NObj.SetFlags(NObj.GetQFlags(), self.CurrQestVarInfo.V= arType), Line + ) =20 if ctx.FLAGS() !=3D None: - if self.__CurrQestVarInfo.IsBitVar: - self.__ErrorHandler(NObj.SetFlagsForBitField(ctx.vfrNumeri= cFlags().HFlags,ctx.vfrNumericFlags().LFlags, ctx.vfrNumericFlags().IsDispl= aySpecified), ctx.F.line) + UpdateVarType =3D ctx.vfrNumericFlags().UpdateVarType + if self.CurrQestVarInfo.IsBitVar: + self.ErrorHandler( + NObj.SetFlagsForBitField( + ctx.vfrNumericFlags().HFlags, + ctx.vfrNumericFlags().LFlags, + ctx.vfrNumericFlags().IsDisplaySpecified, + ), + ctx.F.line, + ) else: - self.__ErrorHandler(NObj.SetFlags(ctx.vfrNumericFlags().HF= lags,ctx.vfrNumericFlags().LFlags, ctx.vfrNumericFlags().IsDisplaySpecified= ), ctx.F.line) + self.ErrorHandler( + NObj.SetFlags( + ctx.vfrNumericFlags().HFlags, + ctx.vfrNumericFlags().LFlags, + ctx.vfrNumericFlags().IsDisplaySpecified, + ), + ctx.F.line, + ) + NObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrNumericFla= gs())) =20 if ctx.Key() !=3D None: - Key =3D self.__TransNum(ctx.Number()) - self.__AssignQuestionKey(NObj,Key) - - ShrinkSize =3D 0 - IsSupported =3D True - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - Type =3D self.__CurrQestVarInfo.VarType - # Base on the type to know the actual used size, shrink the bu= ffer size allocate before. - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - ShrinkSize =3D 21 - elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - ShrinkSize =3D 18 - elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - ShrinkSize =3D 12 - elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - ShrinkSize =3D 0 + Key =3D self.TransNum(ctx.Number()) + self.AssignQuestionKey(NObj, Key) + NObj.SetHasKey(True) + + NObj.SetHasStep(ctx.vfrSetMinMaxStep().Step() !=3D None) + + if (self.CurrQestVarInfo.IsBitVar =3D=3D False) and ( + self.CurrQestVarInfo.VarType not in BasicTypes + ): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "Numeric question only support UINT8, UINT16, UINT32 and U= INT64 data type.", + ) + + # modify the data for namevalue + if self.CurrQestVarInfo.VarType !=3D EFI_IFR_TYPE_NUM_SIZE_64: + if self.CurrQestVarInfo.IsBitVar: + UpdatedNObj =3D IfrNumeric(EFI_IFR_TYPE_NUM_SIZE_32) else: - IsSupported =3D False - else: - #?Question stored in bit fields saved as UINT32 type, so the S= hrinkSize same as EFI_IFR_TYPE_NUM_SIZE_32. - ShrinkSize =3D 12 - - #######?NObj->ShrinkBinSize (ShrinkSize); - if IsSupported =3D=3D False: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , Line, 'Numeric question only support UINT8, UINT16, UINT32 and UINT64 dat= a type.') + UpdatedNObj =3D IfrNumeric(self.CurrQestVarInfo.VarType) + UpdatedNObj.QName =3D NObj.QName + UpdatedNObj.VarIdStr =3D NObj.VarIdStr + UpdatedNObj.HasQuestionId =3D NObj.HasQuestionId + UpdatedNObj.FlagsStream =3D NObj.FlagsStream + UpdatedNObj.HasKey =3D NObj.HasKey + UpdatedNObj.HasStep =3D NObj.HasStep + UpdatedNObj.LineNo =3D NObj.LineNo + UpdatedNObj.GetInfo().Question =3D NObj.GetInfo().Question + UpdatedNObj.GetInfo().Flags =3D NObj.GetInfo().Flags + UpdatedNObj.GetInfo().Data.MinValue =3D NObj.GetInfo().Data.Mi= nValue + UpdatedNObj.GetInfo().Data.MaxValue =3D NObj.GetInfo().Data.Ma= xValue + UpdatedNObj.GetInfo().Data.Step =3D NObj.GetInfo().Data.Step + NObj =3D UpdatedNObj =20 ctx.Node.Data =3D NObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(NObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) + self.CurrentMinMaxData =3D None =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrSetMinMaxStep. - def visitVfrSetMinMaxStep(self, ctx:VfrSyntaxParser.VfrSetMinMaxStepCo= ntext): + def visitVfrSetMinMaxStep(self, ctx: VfrSyntaxParser.VfrSetMinMaxStepC= ontext): IntDecStyle =3D False - if ((self.__CurrQestVarInfo.IsBitVar) and (ctx.OpObj.GetOpCode() = =3D=3D EFI_IFR_NUMERIC_OP) and ((ctx.OpObj.GetNumericFlags() & EDKII_IFR_DI= SPLAY_BIT) =3D=3D 0)) or \ - ((self.__CurrQestVarInfo.IsBitVar =3D=3D False) and (ctx.OpObj= .GetOpCode() =3D=3D EFI_IFR_NUMERIC_OP) and ((ctx.OpObj.GetNumericFlags() &= EFI_IFR_DISPLAY) =3D=3D 0)): + OpObj =3D ctx.Node.Data + if ( + (self.CurrQestVarInfo.IsBitVar) + and (OpObj.GetOpCode() =3D=3D EFI_IFR_NUMERIC_OP) + and ((OpObj.GetNumericFlags() & EDKII_IFR_DISPLAY_BIT) =3D=3D = 0) + ) or ( + (self.CurrQestVarInfo.IsBitVar =3D=3D False) + and (OpObj.GetOpCode() =3D=3D EFI_IFR_NUMERIC_OP) + and ((OpObj.GetNumericFlags() & EFI_IFR_DISPLAY) =3D=3D 0) + ): IntDecStyle =3D True MinNegative =3D False MaxNegative =3D False =20 self.visitChildren(ctx) =20 - Min =3D self.__TransNum(ctx.I.text) - Max =3D self.__TransNum(ctx.A.text) - Step =3D self.__TransNum(ctx.S.text) if ctx.Step() !=3D None else = 0 + Min =3D self.TransNum(ctx.I.text) + Max =3D self.TransNum(ctx.A.text) + Step =3D self.TransNum(ctx.S.text) if ctx.Step() !=3D None else 0 =20 - if ctx.N1 !=3DNone: + if ctx.N1 !=3D None: MinNegative =3D True =20 if IntDecStyle =3D=3D False and MinNegative =3D=3D True: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.I.line, '\'-\' can\'t be used when not in int decimal type.') - if self.__CurrQestVarInfo.IsBitVar: - if (IntDecStyle =3D=3D False) and (Min > (1 << self.__CurrQest= VarInfo.VarTotalSize) - 1): # - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, ctx.I.line, 'BIT type minimum can\'t small than 0, bigger than 2^BitW= idth -1') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.I.line, + "'-' can't be used when not in int decimal type.", + ) + if self.CurrQestVarInfo.IsBitVar: + if (IntDecStyle =3D=3D False) and (Min > (1 << self.CurrQestVa= rInfo.VarTotalSize) - 1): # + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.I.line, + "BIT type minimum can't small than 0, bigger than 2^Bi= tWidth -1", + ) else: - Type =3D self.__CurrQestVarInfo.VarType + Type =3D self.CurrQestVarInfo.VarType if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: if IntDecStyle: if MinNegative: if Min > 0x8000000000000000: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.I.line, 'INT64 type minimum can\'t small than -0x= 8000000000000000, big than 0x7FFFFFFFFFFFFFFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.I.line, + "INT64 type minimum can't small than -= 0x8000000000000000, big than 0x7FFFFFFFFFFFFFFF", + ) else: if Min > 0x7FFFFFFFFFFFFFFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.I.line, 'INT64 type minimum can\'t small than -0x= 8000000000000000, big than 0x7FFFFFFFFFFFFFFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.I.line, + "INT64 type minimum can't small than -= 0x8000000000000000, big than 0x7FFFFFFFFFFFFFFF", + ) if MinNegative: Min =3D ~Min + 1 =20 @@ -2235,10 +2630,18 @@ class VfrSyntaxVisitor(ParseTreeVisitor): if IntDecStyle: if MinNegative: if Min > 0x80000000: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.I.line, 'INT32 type minimum can\'t small than -0x= 80000000, big than 0x7FFFFFFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.I.line, + "INT32 type minimum can't small than -= 0x80000000, big than 0x7FFFFFFF", + ) else: if Min > 0x7FFFFFFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.I.line, 'INT32 type minimum can\'t small than -0x= 80000000, big than 0x7FFFFFFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.I.line, + "INT32 type minimum can't small than -= 0x80000000, big than 0x7FFFFFFF", + ) if MinNegative: Min =3D ~Min + 1 =20 @@ -2246,10 +2649,18 @@ class VfrSyntaxVisitor(ParseTreeVisitor): if IntDecStyle: if MinNegative: if Min > 0x8000: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.I.line, 'INT16 type minimum can\'t small than -0x= 8000, big than 0x7FFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.I.line, + "INT16 type minimum can't small than -= 0x8000, big than 0x7FFF", + ) else: if Min > 0x7FFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.I.line, 'INT16 type minimum can\'t small than -0x= 8000, big than 0x7FFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.I.line, + "INT16 type minimum can't small than -= 0x8000, big than 0x7FFF", + ) if MinNegative: Min =3D ~Min + 1 =20 @@ -2257,201 +2668,286 @@ class VfrSyntaxVisitor(ParseTreeVisitor): if IntDecStyle: if MinNegative: if Min > 0x80: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.I.line, 'INT8 type minimum can\'t small than -0x8= 0, big than 0x7F') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.I.line, + "INT8 type minimum can't small than -0= x80, big than 0x7F", + ) else: if Min > 0x7F: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.I.line, 'INT8 type minimum can\'t small than -0x8= 0, big than 0x7F') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.I.line, + "INT8 type minimum can't small than -0= x80, big than 0x7F", + ) if MinNegative: Min =3D ~Min + 1 =20 if ctx.N2 !=3D None: MaxNegative =3D True if IntDecStyle =3D=3D False and MaxNegative =3D=3D True: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.A.line, ' \'-\' can\'t be used when not in int decimal type.') - if self.__CurrQestVarInfo.IsBitVar: - if (IntDecStyle =3D=3D False) and (Max > (1 << self.__CurrQest= VarInfo.VarTotalSize) - 1): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, ctx.A.line, 'BIT type maximum can\'t be bigger than 2^BitWidth -1') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.A.line, + " '-' can't be used when not in int decimal type.", + ) + if self.CurrQestVarInfo.IsBitVar: + if (IntDecStyle =3D=3D False) and (Max > (1 << self.CurrQestVa= rInfo.VarTotalSize) - 1): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.A.line, + "BIT type maximum can't be bigger than 2^BitWidth -1", + ) else: - Type =3D self.__CurrQestVarInfo.VarType + Type =3D self.CurrQestVarInfo.VarType if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: if IntDecStyle: if MaxNegative: if Max > 0x8000000000000000: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.A.line, 'INT64 type minimum can\'t small than -0x= 8000000000000000, big than 0x7FFFFFFFFFFFFFFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.A.line, + "INT64 type minimum can't small than -= 0x8000000000000000, big than 0x7FFFFFFFFFFFFFFF", + ) else: if Max > 0x7FFFFFFFFFFFFFFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.A.line, 'INT64 type minimum can\'t small than -0x= 8000000000000000, big than 0x7FFFFFFFFFFFFFFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.A.line, + "INT64 type minimum can't small than -= 0x8000000000000000, big than 0x7FFFFFFFFFFFFFFF", + ) if MaxNegative: Max =3D ~Max + 1 =20 - if Max < Min: # - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVAL= ID_PARAMETER, ctx.A.line, 'Maximum can\'t be less than Minimum') - + if Max < Min: # + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.A.line, + "Maximum can't be less than Minimum", + ) =20 if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: if IntDecStyle: if MaxNegative: if Max > 0x80000000: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.A.line, 'INT32 type minimum can\'t small than -0x= 80000000, big than 0x7FFFFFFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.A.line, + "INT32 type minimum can't small than -= 0x80000000, big than 0x7FFFFFFF", + ) else: if Max > 0x7FFFFFFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.A.line, 'INT32 type minimum can\'t small than -0x= 80000000, big than 0x7FFFFFFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.A.line, + "INT32 type minimum can't small than -= 0x80000000, big than 0x7FFFFFFF", + ) if MaxNegative: Max =3D ~Max + 1 =20 - if Max < Min: # - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVAL= ID_PARAMETER, ctx.A.line, 'Maximum can\'t be less than Minimum') - + if Max < Min: # + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.A.line, + "Maximum can't be less than Minimum", + ) =20 if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: if IntDecStyle: if MaxNegative: if Max > 0x8000: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.A.line, 'INT16 type minimum can\'t small than -0x= 8000, big than 0x7FFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.A.line, + "INT16 type minimum can't small than -= 0x8000, big than 0x7FFF", + ) else: if Max > 0x7FFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.A.line, 'INT16 type minimum can\'t small than -0x= 8000, big than 0x7FFF') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.A.line, + "INT16 type minimum can't small than -= 0x8000, big than 0x7FFF", + ) if MaxNegative: Max =3D ~Max + 1 =20 - if Max < Min: # - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVAL= ID_PARAMETER, ctx.A.line, 'Maximum can\'t be less than Minimum') + if Max < Min: # + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.A.line, + "Maximum can't be less than Minimum", + ) =20 if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: if IntDecStyle: if MaxNegative: if Max > 0x80: - self.__ErrorHandler(VfrReturnCode.VFR_RETUR= N_INVALID_PARAMETER, ctx.A.line, 'INT8 type minimum can\'t small than -0x80= , big than 0x7F') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.A.line, + "INT8 type minimum can't small than -0= x80, big than 0x7F", + ) else: if Max > 0x7F: - self.__ErrorHandler(VfrReturnCode.VFR_RETU= RN_INVALID_PARAMETER, ctx.A.line, 'INT8 type minimum can\'t small than -0x8= 0, big than 0x7F') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, + ctx.A.line, + "INT8 type minimum can't small than -0= x80, big than 0x7F", + ) if MaxNegative: Max =3D ~Max + 1 =20 - if Max < Min: # - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVAL= ID_PARAMETER, ctx.A.line, 'Maximum can\'t be less than Minimum') - - if self.__CurrQestVarInfo.IsBitVar: - ctx.OpObj.SetMinMaxStepData(Min, Max, Step, EFI_IFR_TYPE_NUM_S= IZE_32) - else: - Type =3D self.__CurrQestVarInfo.VarType - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - ctx.OpObj.SetMinMaxStepData(Min, Max, Step, EFI_IFR_TYPE_N= UM_SIZE_64) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - ctx.OpObj.SetMinMaxStepData(Min, Max, Step, EFI_IFR_TYPE_N= UM_SIZE_32) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - ctx.OpObj.SetMinMaxStepData(Min, Max, Step, EFI_IFR_TYPE_N= UM_SIZE_16) - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - ctx.OpObj.SetMinMaxStepData(Min, Max, Step, EFI_IFR_TYPE_N= UM_SIZE_8) - - return ctx.OpObj + if Max < Min: # + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.A.line, + "Maximum can't be less than Minimum", + ) =20 + OpObj.SetMinMaxStepData(Min, Max, Step) + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrNumericFlags. - def visitVfrNumericFlags(self, ctx:VfrSyntaxParser.VfrNumericFlagsCont= ext): - - ctx.LFlags =3D self.__CurrQestVarInfo.VarType & EFI_IFR_NUMERIC_SI= ZE - VarStoreType =3D gCVfrDataStorage.GetVarStoreType(self.__CurrQestV= arInfo.VarStoreId) + def visitVfrNumericFlags(self, ctx: VfrSyntaxParser.VfrNumericFlagsCon= text): + # check data type flag + ctx.LFlags =3D self.CurrQestVarInfo.VarType & EFI_IFR_NUMERIC_SIZE + VarStoreType =3D gVfrDataStorage.GetVarStoreType(self.CurrQestVarI= nfo.VarStoreId) Line =3D ctx.start.line IsSetType =3D False self.visitChildren(ctx) =20 for FlagsFieldCtx in ctx.numericFlagsField(): ctx.HFlags |=3D FlagsFieldCtx.HFlag - ctx.IsDisplaySpecified =3D FlagsFieldCtx.IsDisplaySpecified - IsSetType |=3D FlagsFieldCtx.IsSetType + ctx.IsDisplaySpecified |=3D FlagsFieldCtx.IsDisplaySpecified + IsSetType |=3D FlagsFieldCtx.IsSetType if FlagsFieldCtx.NumericSizeOne() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) |= EFI_IFR_NUMERIC_SIZE_1 + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) | = EFI_IFR_NUMERIC_SIZE_1 =20 if FlagsFieldCtx.NumericSizeTwo() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) |= EFI_IFR_NUMERIC_SIZE_2 + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) | = EFI_IFR_NUMERIC_SIZE_2 =20 if FlagsFieldCtx.NumericSizeFour() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) |= EFI_IFR_NUMERIC_SIZE_4 + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) | = EFI_IFR_NUMERIC_SIZE_4 =20 if FlagsFieldCtx.NumericSizeEight() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) |= EFI_IFR_NUMERIC_SIZE_8 + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) | = EFI_IFR_NUMERIC_SIZE_8 =20 if FlagsFieldCtx.DisPlayIntDec() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_= IFR_DISPLAY_INT_DEC + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_I= FR_DISPLAY_INT_DEC else: - ctx.LFlags =3D (ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT) = | EDKII_IFR_DISPLAY_INT_DEC_BIT + ctx.LFlags =3D ( + ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT + ) | EDKII_IFR_DISPLAY_INT_DEC_BIT =20 - if FlagsFieldCtx.DisPlayUIntHex() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_= IFR_DISPLAY_UINT_DEC + if FlagsFieldCtx.DisPlayUIntDec() !=3D None: + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_I= FR_DISPLAY_UINT_DEC else: - ctx.LFlags =3D (ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT) = | EDKII_IFR_DISPLAY_UINT_DEC_BIT + ctx.LFlags =3D ( + ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT + ) | EDKII_IFR_DISPLAY_UINT_DEC_BIT =20 if FlagsFieldCtx.DisPlayUIntHex() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_= IFR_DISPLAY_UINT_HEX + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_I= FR_DISPLAY_UINT_HEX else: - ctx.LFlags =3D (ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT) = | EDKII_IFR_DISPLAY_UINT_HEX_BIT - - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - if self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVA= LID: - if VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARST= ORE_BUFFER or VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_EF= I: - if self.__CurrQestVarInfo.VarType !=3D (ctx.LFlags & E= FI_IFR_NUMERIC_SIZE): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVAL= ID_PARAMETER, Line, 'Numeric Flag is not same to Numeric VarData type') + ctx.LFlags =3D ( + ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT + ) | EDKII_IFR_DISPLAY_UINT_HEX_BIT + + VarType =3D self.CurrQestVarInfo.VarType + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + if self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALI= D: + if ( + VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARS= TORE_BUFFER + or VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_V= ARSTORE_EFI + ): + if self.CurrQestVarInfo.VarType !=3D (ctx.LFlags & EFI= _IFR_NUMERIC_SIZE): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "Numeric Flag is not same to Numeric VarData t= ype", + ) else: # update data type for name/value store - self.__CurrQestVarInfo.VarType =3D ctx.LFlags & EFI_IF= R_NUMERIC_SIZE - Size, _ =3D gCVfrVarDataTypeDB.GetDataTypeSizeByDataTy= pe(self.__CurrQestVarInfo.VarType) - self.__CurrQestVarInfo.VarTotalSize =3D Size + self.CurrQestVarInfo.VarType =3D ctx.LFlags & EFI_IFR_= NUMERIC_SIZE + Size, _ =3D gVfrVarDataTypeDB.GetDataTypeSizeByDataTyp= e( + self.CurrQestVarInfo.VarType + ) + self.CurrQestVarInfo.VarTotalSize =3D Size elif IsSetType: - self.__CurrQestVarInfo.VarType =3D ctx.LFlags & EFI_IFR_NU= MERIC_SIZE + self.CurrQestVarInfo.VarType =3D ctx.LFlags & EFI_IFR_NUME= RIC_SIZE =20 - elif self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALI= D and self.__CurrQestVarInfo.IsBitVar: + elif ( + self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID + and self.CurrQestVarInfo.IsBitVar + ): ctx.LFlags &=3D EDKII_IFR_DISPLAY_BIT - ctx.LFlags |=3D EDKII_IFR_NUMERIC_SIZE_BIT & self.__CurrQestVa= rInfo.VarTotalSize + ctx.LFlags |=3D EDKII_IFR_NUMERIC_SIZE_BIT & self.CurrQestVarI= nfo.VarTotalSize =20 - return ctx.HFlags, ctx.LFlags + if VarType !=3D self.CurrQestVarInfo.VarType: + ctx.UpdateVarType =3D True =20 + return ctx.HFlags, ctx.LFlags =20 # Visit a parse tree produced by VfrSyntaxParser#numericFlagsField. - def visitNumericFlagsField(self, ctx:VfrSyntaxParser.NumericFlagsField= Context): - + def visitNumericFlagsField(self, ctx: VfrSyntaxParser.NumericFlagsFiel= dContext): self.visitChildren(ctx) =20 Line =3D ctx.start.line if ctx.Number() !=3D None: - if self.__TransNum(ctx.N.text) !=3D 0: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line) + if self.TransNum(ctx.N.text) !=3D 0: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, Li= ne) =20 if ctx.NumericSizeOne() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: + if self.CurrQestVarInfo.IsBitVar =3D=3D False: ctx.IsSetType =3D True else: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, Line, 'Can not specify the size of the numeric value for BIT field') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "Can not specify the size of the numeric value for BIT= field", + ) =20 if ctx.NumericSizeTwo() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: + if self.CurrQestVarInfo.IsBitVar =3D=3D False: ctx.IsSetType =3D True else: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, Line, 'Can not specify the size of the numeric value for BIT field') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "Can not specify the size of the numeric value for BIT= field", + ) =20 if ctx.NumericSizeFour() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: + if self.CurrQestVarInfo.IsBitVar =3D=3D False: ctx.IsSetType =3D True else: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, Line, 'Can not specify the size of the numeric value for BIT field') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "Can not specify the size of the numeric value for BIT= field", + ) =20 if ctx.NumericSizeEight() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: + if self.CurrQestVarInfo.IsBitVar =3D=3D False: ctx.IsSetType =3D True else: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, Line, 'Can not specify the size of the numeric value for BIT field') + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "Can not specify the size of the numeric value for BIT= field", + ) =20 if ctx.DisPlayIntDec() !=3D None: ctx.IsDisplaySpecified =3D True =20 - if ctx.DisPlayUIntHex() !=3D None: + if ctx.DisPlayUIntDec() !=3D None: ctx.IsDisplaySpecified =3D True =20 if ctx.DisPlayUIntHex() !=3D None: @@ -2462,137 +2958,182 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.HFlag =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementOneOf. - def visitVfrStatementOneOf(self, ctx:VfrSyntaxParser.VfrStatementOneOf= Context): - - OObj =3D ctx.OpObj - Line =3D ctx.start.line - OObj.SetLineNo(Line) - self.__CurrentQuestion =3D OObj.GetQuestion() + def visitVfrStatementOneOf(self, ctx: VfrSyntaxParser.VfrStatementOneO= fContext): self.visitChildren(ctx) - if self.__CurrQestVarInfo.IsBitVar: - GuidObj =3D CIfrGuid(0) + UpdateVarType =3D False + OObj =3D ctx.Node.Data + Line =3D ctx.start.line + if self.CurrQestVarInfo.IsBitVar: + GuidObj =3D IfrGuid(0) GuidObj.SetGuid(EDKII_IFR_BIT_VARSTORE_GUID) GuidObj.SetLineNo(ctx.start.line) - GuidObj.SetScope(1) # pos + GuidObj.SetScope(1) # pos + ctx.GuidNode.Data =3D GuidObj + ctx.GuidNode.Buffer =3D gFormPkg.StructToStream(GuidObj.GetInf= o()) + ctx.GuidNode.insertChild(ctx.Node) + self.InsertEndNode(ctx.GuidNode, ctx.stop.line) =20 # check data type - if self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: - if self.__CurrQestVarInfo.IsBitVar: - LFlags =3D EDKII_IFR_NUMERIC_SIZE_BIT & self.__CurrQestVar= Info.VarTotalSize - self.__ErrorHandler(OObj.SetFlagsForBitField(OObj.GetFlags= (),LFlags), Line) + if self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: + if self.CurrQestVarInfo.IsBitVar: + LFlags =3D EDKII_IFR_NUMERIC_SIZE_BIT & self.CurrQestVarIn= fo.VarTotalSize + self.ErrorHandler(OObj.SetFlagsForBitField(OObj.GetQFlags(= ), LFlags), Line) else: - DataTypeSize, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTyp= eSizeByDataType(self.__CurrQestVarInfo.VarType) - self.__ErrorHandler(ReturnCode, Line, 'OneOf varid is not = the valid data type') - if DataTypeSize !=3D 0 and DataTypeSize !=3D self.__CurrQe= stVarInfo.VarTotalSize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_P= ARAMETER, Line, 'OneOf varid doesn\'t support array') - self.__ErrorHandler(OObj.SetFlags(OObj.GetFlags(), self.__= CurrQestVarInfo.VarType), Line) - + DataTypeSize, ReturnCode =3D gVfrVarDataTypeDB.GetDataType= SizeByDataType( + self.CurrQestVarInfo.VarType + ) + self.ErrorHandler(ReturnCode, Line, "OneOf varid is not th= e valid data type") + if DataTypeSize !=3D 0 and DataTypeSize !=3D self.CurrQest= VarInfo.VarTotalSize: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "OneOf varid doesn't support array", + ) + self.ErrorHandler( + OObj.SetFlags(OObj.GetQFlags(), self.CurrQestVarInfo.V= arType), Line + ) if ctx.FLAGS() !=3D None: - if self.__CurrQestVarInfo.IsBitVar: - self.__ErrorHandler(OObj.SetFlagsForBitField(ctx.vfrOneofF= lagsField().HFlags,ctx.vfrOneofFlagsField().LFlags), ctx.F.line) + UpdateVarType =3D ctx.vfrOneofFlagsField().UpdateVarType + if self.CurrQestVarInfo.IsBitVar: + self.ErrorHandler( + OObj.SetFlagsForBitField( + ctx.vfrOneofFlagsField().HFlags, ctx.vfrOneofFlags= Field().LFlags + ), + ctx.F.line, + ) else: - self.__ErrorHandler(OObj.SetFlags(ctx.vfrOneofFlagsField()= .HFlags, ctx.vfrOneofFlagsField().LFlags), ctx.F.line) - - ShrinkSize =3D 0 - IsSupported =3D True - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - Type =3D self.__CurrQestVarInfo.VarType - # Base on the type to know the actual used size, shrink the bu= ffer size allocate before. - if Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - ShrinkSize =3D 21 - elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - ShrinkSize =3D 18 - elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - ShrinkSize =3D 12 - elif Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - ShrinkSize =3D 0 # + self.ErrorHandler( + OObj.SetFlags(ctx.vfrOneofFlagsField().HFlags, ctx.vfr= OneofFlagsField().LFlags), + ctx.F.line, + ) + + if (self.CurrQestVarInfo.IsBitVar =3D=3D False) and ( + self.CurrQestVarInfo.VarType not in BasicTypes + ): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "OneOf question only support UINT8, UINT16, UINT32 and UIN= T64 data type.", + ) + + # modify the data Vartype for NameValue + if self.CurrQestVarInfo.VarType !=3D EFI_IFR_TYPE_NUM_SIZE_64: + if self.CurrQestVarInfo.IsBitVar: + UpdatedOObj =3D IfrOneOf(EFI_IFR_TYPE_NUM_SIZE_32) else: - IsSupported =3D False - else: - #?Question stored in bit fields saved as UINT32 type, so the S= hrinkSize same as EFI_IFR_TYPE_NUM_SIZE_32. - ShrinkSize =3D 12 + UpdatedOObj =3D IfrOneOf(self.CurrQestVarInfo.VarType) + UpdatedOObj.QName =3D OObj.QName + UpdatedOObj.VarIdStr =3D OObj.VarIdStr + UpdatedOObj.HasQuestionId =3D OObj.HasQuestionId + UpdatedOObj.GetInfo().Question =3D OObj.GetInfo().Question + UpdatedOObj.GetInfo().Flags =3D OObj.GetInfo().Flags + UpdatedOObj.GetInfo().Data.MinValue =3D OObj.GetInfo().Data.Mi= nValue + UpdatedOObj.GetInfo().Data.MaxValue =3D OObj.GetInfo().Data.Ma= xValue + UpdatedOObj.GetInfo().Data.Step =3D OObj.GetInfo().Data.Step + OObj =3D UpdatedOObj + + OObj.SetLineNo(ctx.start.line) + if ctx.FLAGS() !=3D None: + OObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrOneofFlags= Field())) =20 - # OObj.ShrinkBinSize(ShrinkSize) - if IsSupported =3D=3D False: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , Line, 'OneOf question only support UINT8, UINT16, UINT32 and UINT64 data = type.') + if ctx.vfrSetMinMaxStep() !=3D None: + OObj.SetHasMinMax(True) + if ctx.vfrSetMinMaxStep().Step() !=3D None: + OObj.SetHasStep(True) =20 ctx.Node.Data =3D OObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(OObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) + self.CurrentMinMaxData =3D None =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrOneofFlagsField. - def visitVfrOneofFlagsField(self, ctx:VfrSyntaxParser.VfrOneofFlagsFie= ldContext): - - ctx.LFlags =3D self.__CurrQestVarInfo.VarType & EFI_IFR_NUMERIC_SI= ZE - VarStoreType =3D gCVfrDataStorage.GetVarStoreType(self.__CurrQestV= arInfo.VarStoreId) + def visitVfrOneofFlagsField(self, ctx: VfrSyntaxParser.VfrOneofFlagsFi= eldContext): + ctx.LFlags =3D self.CurrQestVarInfo.VarType & EFI_IFR_NUMERIC_SIZE + VarStoreType =3D gVfrDataStorage.GetVarStoreType(self.CurrQestVarI= nfo.VarStoreId) Line =3D ctx.start.line IsSetType =3D False self.visitChildren(ctx) =20 for FlagsFieldCtx in ctx.numericFlagsField(): ctx.HFlags |=3D FlagsFieldCtx.HFlag - ctx.IsDisplaySpecified =3D FlagsFieldCtx.IsDisplaySpecified IsSetType |=3D FlagsFieldCtx.IsSetType if FlagsFieldCtx.NumericSizeOne() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) |= EFI_IFR_NUMERIC_SIZE_1 + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) | = EFI_IFR_NUMERIC_SIZE_1 =20 if FlagsFieldCtx.NumericSizeTwo() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) |= EFI_IFR_NUMERIC_SIZE_2 + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) | = EFI_IFR_NUMERIC_SIZE_2 =20 if FlagsFieldCtx.NumericSizeFour() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) |= EFI_IFR_NUMERIC_SIZE_4 + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) | = EFI_IFR_NUMERIC_SIZE_4 =20 if FlagsFieldCtx.NumericSizeEight() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) |= EFI_IFR_NUMERIC_SIZE_8 + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_NUMERIC_SIZE) | = EFI_IFR_NUMERIC_SIZE_8 =20 if FlagsFieldCtx.DisPlayIntDec() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_= IFR_DISPLAY_INT_DEC + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_I= FR_DISPLAY_INT_DEC else: - ctx.LFlags =3D (ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT) = | EDKII_IFR_DISPLAY_INT_DEC_BIT + ctx.LFlags =3D ( + ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT + ) | EDKII_IFR_DISPLAY_INT_DEC_BIT =20 - if FlagsFieldCtx.DisPlayUIntHex() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_= IFR_DISPLAY_UINT_DEC + if FlagsFieldCtx.DisPlayUIntDec() !=3D None: + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_I= FR_DISPLAY_UINT_DEC else: - ctx.LFlags =3D (ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT) = | EDKII_IFR_DISPLAY_UINT_DEC_BIT + ctx.LFlags =3D ( + ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT + ) | EDKII_IFR_DISPLAY_UINT_DEC_BIT =20 if FlagsFieldCtx.DisPlayUIntHex() !=3D None: - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_= IFR_DISPLAY_UINT_HEX + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + ctx.LFlags =3D (ctx.LFlags & ~EFI_IFR_DISPLAY) | EFI_I= FR_DISPLAY_UINT_HEX else: - ctx.LFlags =3D (ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT) = | EDKII_IFR_DISPLAY_UINT_HEX_BIT - - if self.__CurrQestVarInfo.IsBitVar =3D=3D False: - if self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVA= LID: - if VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARST= ORE_BUFFER or VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_EF= I: - if self.__CurrQestVarInfo.VarType !=3D (ctx.LFlags & E= FI_IFR_NUMERIC_SIZE): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVAL= ID_PARAMETER, Line, 'Numeric Flag is not same to Numeric VarData type') + ctx.LFlags =3D ( + ctx.LFlags & ~EDKII_IFR_DISPLAY_BIT + ) | EDKII_IFR_DISPLAY_UINT_HEX_BIT + + VarType =3D self.CurrQestVarInfo.VarType + if self.CurrQestVarInfo.IsBitVar =3D=3D False: + if self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALI= D: + if ( + VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARS= TORE_BUFFER + or VarStoreType =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_V= ARSTORE_EFI + ): + if self.CurrQestVarInfo.VarType !=3D (ctx.LFlags & EFI= _IFR_NUMERIC_SIZE): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + Line, + "Numeric Flag is not same to Numeric VarData t= ype", + ) else: # update data type for name/value store - self.__CurrQestVarInfo.VarType =3D ctx.LFlags & EFI_IF= R_NUMERIC_SIZE - Size, _ =3D gCVfrVarDataTypeDB.GetDataTypeSizeByDataTy= pe(self.__CurrQestVarInfo.VarType) - self.__CurrQestVarInfo.VarTotalSize =3D Size + self.CurrQestVarInfo.VarType =3D ctx.LFlags & EFI_IFR_= NUMERIC_SIZE + Size, _ =3D gVfrVarDataTypeDB.GetDataTypeSizeByDataTyp= e( + self.CurrQestVarInfo.VarType + ) + self.CurrQestVarInfo.VarTotalSize =3D Size elif IsSetType: - self.__CurrQestVarInfo.VarType =3D ctx.LFlags & EFI_IFR_NU= MERIC_SIZE + self.CurrQestVarInfo.VarType =3D ctx.LFlags & EFI_IFR_NUME= RIC_SIZE =20 - elif self.__CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALI= D: + elif self.CurrQestVarInfo.VarStoreId !=3D EFI_VARSTORE_ID_INVALID: ctx.LFlags &=3D EDKII_IFR_DISPLAY_BIT - ctx.LFlags |=3D EDKII_IFR_NUMERIC_SIZE_BIT & self.__CurrQestVa= rInfo.VarTotalSize + ctx.LFlags |=3D EDKII_IFR_NUMERIC_SIZE_BIT & self.CurrQestVarI= nfo.VarTotalSize =20 - return ctx.HFlags, ctx.LFlags + if VarType !=3D self.CurrQestVarInfo.VarType: + ctx.UpdateVarType =3D True =20 + return ctx.HFlags, ctx.LFlags =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementStringTyp= e. - def visitVfrStatementStringType(self, ctx:VfrSyntaxParser.VfrStatement= StringTypeContext): - + def visitVfrStatementStringType(self, ctx: VfrSyntaxParser.VfrStatemen= tStringTypeContext): self.visitChildren(ctx) if ctx.vfrStatementPassword() !=3D None: ctx.Node =3D ctx.vfrStatementPassword().Node @@ -2600,70 +3141,76 @@ class VfrSyntaxVisitor(ParseTreeVisitor): ctx.Node =3D ctx.vfrStatementString().Node return ctx.Node =20 - def _GET_CURRQEST_ARRAY_SIZE(self): - - Size =3D 1 - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - Size =3D 1 - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - Size =3D 2 - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - Size =3D 4 - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - Size =3D 8 - - return int(self.__CurrQestVarInfo.VarTotalSize / Size) - - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementString. - def visitVfrStatementString(self, ctx:VfrSyntaxParser.VfrStatementStri= ngContext): - - self.__IsStringOp =3D True - SObj =3D ctx.OpObj + def visitVfrStatementString(self, ctx: VfrSyntaxParser.VfrStatementStr= ingContext): + self.IsStringOp =3D True + SObj =3D IfrString() + ctx.Node.Data =3D SObj SObj.SetLineNo(ctx.start.line) - self.__CurrentQuestion =3D SObj.GetQuestion() + self.CurrentQuestion =3D SObj =20 self.visitChildren(ctx) =20 if ctx.FLAGS() !=3D None: HFlags =3D ctx.vfrStringFlagsField().HFlags LFlags =3D ctx.vfrStringFlagsField().LFlags - self.__ErrorHandler(SObj.SetFlags(HFlags, LFlags), ctx.F.line) + self.ErrorHandler(SObj.SetFlags(HFlags, LFlags), ctx.F.line) + SObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrStringFlag= sField())) =20 if ctx.Key() !=3D None: - Key =3D self.__TransNum(ctx.Number(0)) - self.__AssignQuestionKey(SObj, Key) - StringMinSize =3D self.__TransNum(ctx.Number(1)) - StringMaxSize =3D self.__TransNum(ctx.Number(2)) + Key =3D self.TransNum(ctx.Number(0)) + self.AssignQuestionKey(SObj, Key) + SObj.SetHasKey(True) + StringMinSize =3D self.TransNum(ctx.Number(1)) + StringMaxSize =3D self.TransNum(ctx.Number(2)) else: - StringMinSize =3D self.__TransNum(ctx.Number(0)) - StringMaxSize =3D self.__TransNum(ctx.Number(1)) + StringMinSize =3D self.TransNum(ctx.Number(0)) + StringMaxSize =3D self.TransNum(ctx.Number(1)) =20 - VarArraySize =3D self._GET_CURRQEST_ARRAY_SIZE() + VarArraySize =3D self.GetCurArraySize() if StringMinSize > 0xFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Min.line, "String MinSize takes only one byte, which can't be larger = than 0xFF.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Min.line, + "String MinSize takes only one byte, which can't be larger= than 0xFF.", + ) if VarArraySize !=3D 0 and StringMinSize > VarArraySize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Min.line, "String MinSize can't be larger than the max number of elem= ents in string array.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Min.line, + "String MinSize can't be larger than the max number of ele= ments in string array.", + ) SObj.SetMinSize(StringMinSize) =20 if StringMaxSize > 0xFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Max.line, "String MaxSize takes only one byte, which can't be larger = than 0xFF.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Max.line, + "String MaxSize takes only one byte, which can't be larger= than 0xFF.", + ) elif VarArraySize !=3D 0 and StringMaxSize > VarArraySize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Max.line, "String MaxSize can't be larger than the max number of elem= ents in string array.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Max.line, + "String MaxSize can't be larger than the max number of ele= ments in string array.", + ) elif StringMaxSize < StringMinSize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Max.line, "String MaxSize can't be less than String MinSize.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Max.line, + "String MaxSize can't be less than String MinSize.", + ) SObj.SetMaxSize(StringMaxSize) =20 - ctx.Node.Data =3D SObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(SObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 - self.__IsStringOp =3D False + self.IsStringOp =3D False =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStringFlagsField. - def visitVfrStringFlagsField(self, ctx:VfrSyntaxParser.VfrStringFlagsF= ieldContext): - + def visitVfrStringFlagsField(self, ctx: VfrSyntaxParser.VfrStringFlags= FieldContext): self.visitChildren(ctx) for FlagsFieldCtx in ctx.stringFlagsField(): ctx.HFlags |=3D FlagsFieldCtx.HFlag @@ -2671,129 +3218,151 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.HFlags, ctx.LFlags =20 - # Visit a parse tree produced by VfrSyntaxParser#stringFlagsField. - def visitStringFlagsField(self, ctx:VfrSyntaxParser.StringFlagsFieldCo= ntext): - + def visitStringFlagsField(self, ctx: VfrSyntaxParser.StringFlagsFieldC= ontext): self.visitChildren(ctx) =20 if ctx.Number() !=3D None: - if self.__TransNum(ctx.Number()) !=3D 0: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = ctx.start.line) + if self.TransNum(ctx.Number()) !=3D 0: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ct= x.start.line) elif ctx.questionheaderFlagsField() !=3D None: - ctx.HFlag =3D ctx.questionheaderFlagsField().QHFlag else: ctx.LFlag =3D 0x01 =20 - return ctx.HFlag, ctx.LFlag - + return ctx.HFlag, ctx.LFlag =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementPassword. - def visitVfrStatementPassword(self, ctx:VfrSyntaxParser.VfrStatementPa= sswordContext): - - PObj =3D ctx.OpObj + def visitVfrStatementPassword(self, ctx: VfrSyntaxParser.VfrStatementP= asswordContext): + PObj =3D IfrPassword() + ctx.Node.Data =3D PObj PObj.SetLineNo(ctx.start.line) - self.__CurrentQuestion =3D PObj.GetQuestion() + self.CurrentQuestion =3D PObj =20 self.visitChildren(ctx) =20 if ctx.Key() !=3D None: - Key =3D self.__TransNum(ctx.Number(0)) - self.__AssignQuestionKey(PObj, Key) - PassWordMinSize =3D self.__TransNum(ctx.Number(1)) - PasswordMaxSize =3D self.__TransNum(ctx.Number(2)) + Key =3D self.TransNum(ctx.Number(0)) + self.AssignQuestionKey(PObj, Key) + PassWordMinSize =3D self.TransNum(ctx.Number(1)) + PasswordMaxSize =3D self.TransNum(ctx.Number(2)) + PObj.SetHasKey(True) else: - PassWordMinSize =3D self.__TransNum(ctx.Number(0)) - PasswordMaxSize =3D self.__TransNum(ctx.Number(1)) + PassWordMinSize =3D self.TransNum(ctx.Number(0)) + PasswordMaxSize =3D self.TransNum(ctx.Number(1)) =20 if ctx.FLAGS() !=3D None: HFlags =3D ctx.vfrPasswordFlagsField().HFlags - self.__ErrorHandler(PObj.SetFlags(HFlags), ctx.F.line) + self.ErrorHandler(PObj.SetFlags(HFlags), ctx.F.line) + PObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrPasswordFl= agsField())) =20 - VarArraySize =3D self._GET_CURRQEST_ARRAY_SIZE() + VarArraySize =3D self.GetCurArraySize() if PassWordMinSize > 0xFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Min.line, "String MinSize takes only one byte, which can't be larger = than 0xFF.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Min.line, + "String MinSize takes only one byte, which can't be larger= than 0xFF.", + ) if VarArraySize !=3D 0 and PassWordMinSize > VarArraySize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Min.line, "String MinSize can't be larger than the max number of elem= ents in string array.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Min.line, + "String MinSize can't be larger than the max number of ele= ments in string array.", + ) PObj.SetMinSize(PassWordMinSize) =20 if PasswordMaxSize > 0xFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Max.line, "String MaxSize takes only one byte, which can't be larger = than 0xFF.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Max.line, + "String MaxSize takes only one byte, which can't be larger= than 0xFF.", + ) elif VarArraySize !=3D 0 and PasswordMaxSize > VarArraySize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Max.line, "String MaxSize can't be larger than the max number of elem= ents in string array.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Max.line, + "String MaxSize can't be larger than the max number of ele= ments in string array.", + ) elif PasswordMaxSize < PassWordMinSize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAMETER= , ctx.Max.line, "String MaxSize can't be less than String MinSize.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.Max.line, + "String MaxSize can't be less than String MinSize.", + ) PObj.SetMaxSize(PasswordMaxSize) =20 - ctx.Node.Data =3D PObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(PObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrPasswordFlagsField= . - def visitVfrPasswordFlagsField(self, ctx:VfrSyntaxParser.VfrPasswordFl= agsFieldContext): - + def visitVfrPasswordFlagsField(self, ctx: VfrSyntaxParser.VfrPasswordF= lagsFieldContext): self.visitChildren(ctx) for FlagsFieldCtx in ctx.passwordFlagsField(): ctx.HFlags |=3D FlagsFieldCtx.HFlag =20 return ctx.HFlags =20 - # Visit a parse tree produced by VfrSyntaxParser#passwordFlagsField. - def visitPasswordFlagsField(self, ctx:VfrSyntaxParser.PasswordFlagsFie= ldContext): - + def visitPasswordFlagsField(self, ctx: VfrSyntaxParser.PasswordFlagsFi= eldContext): self.visitChildren(ctx) =20 if ctx.Number() !=3D None: - if self.__TransNum(ctx.Number()) !=3D 0: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = ctx.start.line) + if self.TransNum(ctx.Number()) !=3D 0: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ct= x.start.line) else: ctx.HFlag =3D ctx.questionheaderFlagsField().QHFlag =20 return ctx.HFlag =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementOrderedLi= st. - def visitVfrStatementOrderedList(self, ctx:VfrSyntaxParser.VfrStatemen= tOrderedListContext): - - OLObj =3D ctx.OpObj + def visitVfrStatementOrderedList(self, ctx: VfrSyntaxParser.VfrStateme= ntOrderedListContext): + OLObj =3D IfrOrderedList() + ctx.Node.Data =3D OLObj OLObj.SetLineNo(ctx.start.line) - self.__CurrentQuestion =3D OLObj.GetQuestion() - self.__IsOrderedList =3D True + self.CurrentQuestion =3D OLObj + self.IsOrderedList =3D True =20 self.visitChildren(ctx) =20 - VarArraySize =3D self._GET_CURRQEST_ARRAY_SIZE() + VarArraySize =3D self.GetCurArraySize() if VarArraySize > 0xFF: OLObj.SetMaxContainers(0xFF) else: OLObj.SetMaxContainers(VarArraySize) =20 if ctx.MaxContainers() !=3D None: - MaxContainers =3D self.__TransNum(ctx.Number()) + MaxContainers =3D self.TransNum(ctx.Number()) if MaxContainers > 0xFF: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, ctx.M.line, "OrderedList MaxContainers takes only one byte, which can= 't be larger than 0xFF.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.M.line, + "OrderedList MaxContainers takes only one byte, which = can't be larger than 0xFF.", + ) elif VarArraySize !=3D 0 and MaxContainers > VarArraySize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, ctx.M.line,"OrderedList MaxContainers can't be larger than the max nu= mber of elements in array.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.M.line, + "OrderedList MaxContainers can't be larger than the ma= x number of elements in array.", + ) OLObj.SetMaxContainers(MaxContainers) + OLObj.SetHasMaxContainers(True) =20 if ctx.FLAGS() !=3D None: HFlags =3D ctx.vfrOrderedListFlags().HFlags LFlags =3D ctx.vfrOrderedListFlags().LFlags - self.__ErrorHandler(OLObj.SetFlags(HFlags, LFlags), ctx.F.line= ) + self.ErrorHandler(OLObj.SetFlags(HFlags, LFlags), ctx.F.line) + OLObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrOrderedLi= stFlags())) =20 - ctx.Node.Data =3D OLObj - - self.__IsOrderedList =3D False + ctx.Node.Buffer =3D gFormPkg.StructToStream(OLObj.GetInfo()) + self.InsertEndNode(ctx.Node, ctx.stop.line) + self.IsOrderedList =3D False =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrOrderedListFlags. - def visitVfrOrderedListFlags(self, ctx:VfrSyntaxParser.VfrOrderedListF= lagsContext): - + def visitVfrOrderedListFlags(self, ctx: VfrSyntaxParser.VfrOrderedList= FlagsContext): self.visitChildren(ctx) =20 for FlagsFieldCtx in ctx.orderedlistFlagsField(): @@ -2802,15 +3371,13 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.HFlags, ctx.LFlags =20 - # Visit a parse tree produced by VfrSyntaxParser#orderedlistFlagsField= . - def visitOrderedlistFlagsField(self, ctx:VfrSyntaxParser.OrderedlistFl= agsFieldContext): - + def visitOrderedlistFlagsField(self, ctx: VfrSyntaxParser.OrderedlistF= lagsFieldContext): self.visitChildren(ctx) =20 if ctx.Number() !=3D None: - if self.__TransNum(ctx.Number()) !=3D 0: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = ctx.start.line) + if self.TransNum(ctx.Number()) !=3D 0: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ct= x.start.line) elif ctx.questionheaderFlagsField() !=3D None: ctx.HFlag =3D ctx.questionheaderFlagsField().QHFlag elif ctx.UniQueFlag() !=3D None: @@ -2818,82 +3385,118 @@ class VfrSyntaxVisitor(ParseTreeVisitor): elif ctx.NoEmptyFlag() !=3D None: ctx.LFlag =3D 0x02 =20 - return ctx.HFlag, ctx.LFlag + return ctx.HFlag, ctx.LFlag =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementDate. - def visitVfrStatementDate(self, ctx:VfrSyntaxParser.VfrStatementDateCo= ntext): - - DObj =3D ctx.OpObj + def visitVfrStatementDate(self, ctx: VfrSyntaxParser.VfrStatementDateC= ontext): + DObj =3D IfrDate() + ctx.Node.Data =3D DObj Line =3D ctx.start.line DObj.SetLineNo(Line) - + self.Value =3D ctx.Val self.visitChildren(ctx) =20 if ctx.vfrQuestionHeader() !=3D None: - - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: - self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_DATE + if self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: + self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_DATE =20 if ctx.FLAGS() !=3D None: - self.__ErrorHandler(DObj.SetFlags(EFI_IFR_QUESTION_FLAG_DE= FAULT, ctx.vfrDateFlags().LFlags), ctx.F1.line) + DObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrDateFl= ags())) + self.ErrorHandler( + DObj.SetFlags(EFI_IFR_QUESTION_FLAG_DEFAULT, ctx.vfrDa= teFlags().LFlags), + ctx.F1.line, + ) =20 else: + Year =3D self.TransId(ctx.StringIdentifier(0)) + Year +=3D "." + Year +=3D self.TransId(ctx.StringIdentifier(1)) =20 - Year =3D self.__TransId(ctx.StringIdentifier(0)) - Year +=3D '.' - Year +=3D self.__TransId(ctx.StringIdentifier(1)) + DObj.Year =3D Year =20 - Month =3D self.__TransId(ctx.StringIdentifier(2)) - Month +=3D '.' - Month +=3D self.__TransId(ctx.StringIdentifier(3)) + Month =3D self.TransId(ctx.StringIdentifier(2)) + Month +=3D "." + Month +=3D self.TransId(ctx.StringIdentifier(3)) =20 - Day =3D self.__TransId(ctx.StringIdentifier(4)) - Day +=3D '.' - Day +=3D self.__TransId(ctx.StringIdentifier(5)) + DObj.Month =3D Month =20 - if ctx.FLAGS() !=3D None: - self.__ErrorHandler(DObj.SetFlags(EFI_IFR_QUESTION_FLAG_DE= FAULT, ctx.vfrDateFlags().LFlags), ctx.F2.line) + Day =3D self.TransId(ctx.StringIdentifier(4)) + Day +=3D "." + Day +=3D self.TransId(ctx.StringIdentifier(5)) =20 - QId, _ =3D self.__CVfrQuestionDB.RegisterOldDateQuestion(Year,= Month, Day, EFI_QUESTION_ID_INVALID) + DObj.Day =3D Day + + if ctx.FLAGS() !=3D None: + DObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrDateFl= ags())) + self.ErrorHandler( + DObj.SetFlags(EFI_IFR_QUESTION_FLAG_DEFAULT, ctx.vfrDa= teFlags().LFlags), + ctx.F2.line, + ) + + QId, _ =3D self.VfrQuestionDB.RegisterOldDateQuestion( + Year, Month, Day, EFI_QUESTION_ID_INVALID, gFormPkg + ) DObj.SetQuestionId(QId) DObj.SetFlags(EFI_IFR_QUESTION_FLAG_DEFAULT, QF_DATE_STORAGE_T= IME) - DObj.SetPrompt(self.__TransNum(ctx.Number(0))) - DObj.SetHelp(self.__TransNum(ctx.Number(1))) + DObj.SetPrompt(self.TransNum(ctx.Number(0))) + DObj.SetHelp(self.TransNum(ctx.Number(1))) =20 - Size =3D EFI_IFR_DEFAULT.Value.offset + sizeof (EFI_HII_DATE) - DefaultObj =3D CIfrDefault(Size, EFI_HII_DEFAULT_CLASS_STANDAR= D, EFI_IFR_TYPE_DATE, ctx.Val) + DefaultObj =3D IfrDefault( + EFI_IFR_TYPE_DATE, [ctx.Val], EFI_HII_DEFAULT_CLASS_STANDA= RD, EFI_IFR_TYPE_DATE + ) DefaultObj.SetLineNo(Line) + DefaultNode =3D IfrTreeNode( + EFI_IFR_DEFAULT_OP, DefaultObj, gFormPkg.StructToStream(De= faultObj.GetInfo()) + ) + ctx.Node.insertChild(DefaultNode) =20 - ctx.Node.Data =3D DObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(DObj.GetInfo()) for Ctx in ctx.vfrStatementInconsistentIf(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#minMaxDateStepDefault= . - def visitMinMaxDateStepDefault(self, ctx:VfrSyntaxParser.MinMaxDateSte= pDefaultContext): - + def visitMinMaxDateStepDefault(self, ctx: VfrSyntaxParser.MinMaxDateSt= epDefaultContext): + Minimum =3D self.TransNum(ctx.Number(0)) + ctx.Node.Data.Min =3D Minimum + Maximum =3D self.TransNum(ctx.Number(1)) + ctx.Node.Data.Max =3D Maximum + if ctx.Step() !=3D None: + ctx.Node.Data.Step =3D self.TransNum(ctx.Number(2)) if ctx.Default() !=3D None: - Minimum =3D self.__TransNum(ctx.Number(0)) - Maximum =3D self.__TransNum(ctx.Number(1)) if ctx.KeyValue =3D=3D 0: - ctx.Date.Year =3D self.__TransNum(ctx.N.text) + ctx.Date.Year =3D self.TransNum(ctx.N.text) + ctx.Node.Data.D_Year =3D ctx.Date.Year if ctx.Date.Year < Minimum or ctx.Date.Year > Maximum: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_P= ARAMETER, ctx.N.line, "Year default value must be between Min year and Max = year.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.N.line, + "Year default value must be between Min year and M= ax year.", + ) if ctx.KeyValue =3D=3D 1: - ctx.Date.Month =3D self.__TransNum(ctx.N.text) + ctx.Date.Month =3D self.TransNum(ctx.N.text) + ctx.Node.Data.D_Month =3D ctx.Date.Month if ctx.Date.Month < 1 or ctx.Date.Month > 12: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_P= ARAMETER, ctx.D.line, "Month default value must be between Min 1 and Max 12= .") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.D.line, + "Month default value must be between Min 1 and Max= 12.", + ) if ctx.KeyValue =3D=3D 2: - ctx.Date.Day =3D self.__TransNum(ctx.N.text) + ctx.Date.Day =3D self.TransNum(ctx.N.text) + ctx.Node.Data.D_Day =3D ctx.Date.Day if ctx.Date.Day < 1 or ctx.Date.Day > 31: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_P= ARAMETER, ctx.D.line, "Day default value must be between Min 1 and Max 31."= ) + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.D.line, + "Day default value must be between Min 1 and Max 3= 1.", + ) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrDateFlags. - def visitVfrDateFlags(self, ctx:VfrSyntaxParser.VfrDateFlagsContext): - + def visitVfrDateFlags(self, ctx: VfrSyntaxParser.VfrDateFlagsContext): self.visitChildren(ctx) =20 for FlagsFieldCtx in ctx.dateFlagsField(): @@ -2901,14 +3504,12 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.LFlags =20 - # Visit a parse tree produced by VfrSyntaxParser#dateFlagsField. - def visitDateFlagsField(self, ctx:VfrSyntaxParser.DateFlagsFieldContex= t): - + def visitDateFlagsField(self, ctx: VfrSyntaxParser.DateFlagsFieldConte= xt): self.visitChildren(ctx) =20 if ctx.Number() !=3D None: - ctx.LFlag =3D self.__TransNum(ctx.Number()) + ctx.LFlag =3D self.TransNum(ctx.Number()) if ctx.YearSupppressFlag() !=3D None: ctx.LFlag =3D 0x01 if ctx.MonthSuppressFlag() !=3D None: @@ -2924,80 +3525,112 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.LFlag =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementTime. - def visitVfrStatementTime(self, ctx:VfrSyntaxParser.VfrStatementTimeCo= ntext): - - TObj =3D ctx.OpObj + def visitVfrStatementTime(self, ctx: VfrSyntaxParser.VfrStatementTimeC= ontext): + TObj =3D IfrTime() + ctx.Node.Data =3D TObj Line =3D ctx.start.line TObj.SetLineNo(Line) - + self.Value =3D ctx.Val self.visitChildren(ctx) =20 if ctx.vfrQuestionHeader() !=3D None: - - if self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: - self.__CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_TIME + if self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_OTHER: + self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_TIME =20 if ctx.FLAGS() !=3D None: - self.__ErrorHandler(TObj.SetFlags(EFI_IFR_QUESTION_FLAG_DE= FAULT, ctx.vfrTimeFlags().LFlags), ctx.F1.line) + TObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrTimeFl= ags())) + self.ErrorHandler( + TObj.SetFlags(EFI_IFR_QUESTION_FLAG_DEFAULT, ctx.vfrTi= meFlags().LFlags), + ctx.F1.line, + ) else: + Hour =3D self.TransId(ctx.StringIdentifier(0)) + Hour +=3D "." + Hour +=3D self.TransId(ctx.StringIdentifier(1)) =20 - Hour =3D self.__TransId(ctx.StringIdentifier(0)) - Hour +=3D '.' - Hour +=3D self.__TransId(ctx.StringIdentifier(1)) + TObj.SetHour(Hour) =20 - Minute =3D self.__TransId(ctx.StringIdentifier(2)) - Minute +=3D '.' - Minute +=3D self.__TransId(ctx.StringIdentifier(3)) + Minute =3D self.TransId(ctx.StringIdentifier(2)) + Minute +=3D "." + Minute +=3D self.TransId(ctx.StringIdentifier(3)) =20 - Second =3D self.__TransId(ctx.StringIdentifier(4)) - Second +=3D '.' - Second +=3D self.__TransId(ctx.StringIdentifier(5)) + TObj.SetMinute(Minute) =20 - if ctx.FLAGS() !=3D None: - self.__ErrorHandler(TObj.SetFlags(EFI_IFR_QUESTION_FLAG_DE= FAULT, ctx.vfrTimeFlags().LFlags), ctx.F2.line) + Second =3D self.TransId(ctx.StringIdentifier(4)) + Second +=3D "." + Second +=3D self.TransId(ctx.StringIdentifier(5)) =20 - QId, _ =3D self.__CVfrQuestionDB.RegisterOldTimeQuestion(Hour,= Minute, Second, EFI_QUESTION_ID_INVALID) + TObj.SetSecond(Second) + + if ctx.FLAGS() !=3D None: + TObj.SetFlagsStream(self.ExtractOriginalText(ctx.vfrTimeFl= ags())) + self.ErrorHandler( + TObj.SetFlags(EFI_IFR_QUESTION_FLAG_DEFAULT, ctx.vfrTi= meFlags().LFlags), + ctx.F2.line, + ) + + QId, _ =3D self.VfrQuestionDB.RegisterOldTimeQuestion( + Hour, Minute, Second, EFI_QUESTION_ID_INVALID, gFormPkg + ) TObj.SetQuestionId(QId) TObj.SetFlags(EFI_IFR_QUESTION_FLAG_DEFAULT, QF_TIME_STORAGE_T= IME) - TObj.SetPrompt(self.__TransNum(ctx.Number(0))) - TObj.SetHelp(self.__TransNum(ctx.Number(1))) + TObj.SetPrompt(self.TransNum(ctx.Number(0))) + TObj.SetHelp(self.TransNum(ctx.Number(1))) =20 - Size =3D EFI_IFR_DEFAULT.Value.offset + sizeof (EFI_HII_TIME) - DefaultObj =3D CIfrDefault(Size, EFI_HII_DEFAULT_CLASS_STANDAR= D, EFI_IFR_TYPE_TIME, ctx.Val) + DefaultObj =3D IfrDefault( + EFI_IFR_TYPE_TIME, [ctx.Val], EFI_HII_DEFAULT_CLASS_STANDA= RD, EFI_IFR_TYPE_TIME + ) DefaultObj.SetLineNo(Line) + DefaultNode =3D IfrTreeNode( + EFI_IFR_DEFAULT_OP, DefaultObj, gFormPkg.StructToStream(De= faultObj.GetInfo()) + ) + ctx.Node.insertChild(DefaultNode) =20 - ctx.Node.Data =3D TObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(TObj.GetInfo()) for Ctx in ctx.vfrStatementInconsistentIf(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) + self.InsertEndNode(ctx.Node, ctx.stop.line) return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#minMaxTimeStepDefault= . - def visitMinMaxTimeStepDefault(self, ctx:VfrSyntaxParser.MinMaxTimeSte= pDefaultContext): - + def visitMinMaxTimeStepDefault(self, ctx: VfrSyntaxParser.MinMaxTimeSt= epDefaultContext): + ctx.Node.Data.Min =3D self.TransNum(ctx.Number(0)) + ctx.Node.Data.Max =3D self.TransNum(ctx.Number(1)) + if ctx.Step() !=3D None: + ctx.Node.Data.Step =3D self.TransNum(ctx.Number(2)) if ctx.Default() !=3D None: - Minimum =3D self.__TransNum(ctx.Number(0)) - Maximum =3D self.__TransNum(ctx.Number(1)) if ctx.KeyValue =3D=3D 0: - ctx.Time.Hour =3D self.__TransNum(ctx.Number(len(ctx.Numbe= r())-1)) + ctx.Time.Hour =3D self.TransNum(ctx.Number(len(ctx.Number(= )) - 1)) + ctx.Node.Data.D_Hour =3D ctx.Time.Hour if ctx.Time.Hour > 23: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_P= ARAMETER, ctx.N.line, "Hour default value must be between 0 and 23.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.N.line, + "Hour default value must be between 0 and 23.", + ) if ctx.KeyValue =3D=3D 1: - ctx.Time.Minute =3D self.__TransNum(ctx.Number(len(ctx.Num= ber())-1)) + ctx.Time.Minute =3D self.TransNum(ctx.Number(len(ctx.Numbe= r()) - 1)) + ctx.Node.Data.D_Minute =3D ctx.Time.Minute if ctx.Time.Minute > 59: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_P= ARAMETER, ctx.N.line, "Minute default value must be between 0 and 59.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.N.line, + "Minute default value must be between 0 and 59.", + ) if ctx.KeyValue =3D=3D 2: - ctx.Time.Second =3D self.__TransNum(ctx.Number(len(ctx.Num= ber())-1)) + ctx.Time.Second =3D self.TransNum(ctx.Number(len(ctx.Numbe= r()) - 1)) + ctx.Node.Data.D_Second =3D ctx.Time.Second if ctx.Time.Second > 59: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_P= ARAMETER, ctx.N.line, "Second default value must be between 0 and 59.") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.N.line, + "Second default value must be between 0 and 59.", + ) return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrTimeFlags. - def visitVfrTimeFlags(self, ctx:VfrSyntaxParser.VfrTimeFlagsContext): - + def visitVfrTimeFlags(self, ctx: VfrSyntaxParser.VfrTimeFlagsContext): self.visitChildren(ctx) =20 for FlagsFieldCtx in ctx.timeFlagsField(): @@ -3006,12 +3639,11 @@ class VfrSyntaxVisitor(ParseTreeVisitor): return ctx.LFlags =20 # Visit a parse tree produced by VfrSyntaxParser#timeFlagsField. - def visitTimeFlagsField(self, ctx:VfrSyntaxParser.TimeFlagsFieldContex= t): - + def visitTimeFlagsField(self, ctx: VfrSyntaxParser.TimeFlagsFieldConte= xt): self.visitChildren(ctx) =20 if ctx.Number() !=3D None: - ctx.LFlag =3D self.__TransNum(ctx.Number()) + ctx.LFlag =3D self.TransNum(ctx.Number()) if ctx.HourSupppressFlag() !=3D None: ctx.LFlag =3D 0x01 if ctx.MinuteSuppressFlag() !=3D None: @@ -3028,45 +3660,41 @@ class VfrSyntaxVisitor(ParseTreeVisitor): return ctx.LFlag =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementCondition= al. - def visitVfrStatementConditional(self, ctx:VfrSyntaxParser.VfrStatemen= tConditionalContext): - + def visitVfrStatementConditional(self, ctx: VfrSyntaxParser.VfrStateme= ntConditionalContext): self.visitChildren(ctx) - if ctx.vfrStatementDisableIfStat()!=3D None: + if ctx.vfrStatementDisableIfStat() !=3D None: ctx.Node =3D ctx.vfrStatementDisableIfStat().Node - if ctx.vfrStatementSuppressIfStat()!=3D None: + if ctx.vfrStatementSuppressIfStat() !=3D None: ctx.Node =3D ctx.vfrStatementSuppressIfStat().Node - if ctx.vfrStatementGrayOutIfStat()!=3D None: + if ctx.vfrStatementGrayOutIfStat() !=3D None: ctx.Node =3D ctx.vfrStatementGrayOutIfStat().Node - if ctx.vfrStatementInconsistentIfStat()!=3D None: + if ctx.vfrStatementInconsistentIfStat() !=3D None: ctx.Node =3D ctx.vfrStatementInconsistentIfStat().Node =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementCondition= alNew. - def visitVfrStatementConditionalNew(self, ctx:VfrSyntaxParser.VfrState= mentConditionalNewContext): + def visitVfrStatementConditionalNew( + self, ctx: VfrSyntaxParser.VfrStatementConditionalNewContext + ): return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementSuppressI= fStat. - def visitVfrStatementSuppressIfStat(self, ctx:VfrSyntaxParser.VfrState= mentSuppressIfStatContext): - + def visitVfrStatementSuppressIfStat( + self, ctx: VfrSyntaxParser.VfrStatementSuppressIfStatContext + ): self.visitChildren(ctx) ctx.Node =3D ctx.vfrStatementSuppressIfStatNew().Node return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementGrayOutIf= Stat. - def visitVfrStatementGrayOutIfStat(self, ctx:VfrSyntaxParser.VfrStatem= entGrayOutIfStatContext): - + def visitVfrStatementGrayOutIfStat(self, ctx: VfrSyntaxParser.VfrState= mentGrayOutIfStatContext): self.visitChildren(ctx) ctx.Node =3D ctx.vfrStatementGrayOutIfStatNew().Node return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementStatList. - def visitVfrStatementStatList(self, ctx:VfrSyntaxParser.VfrStatementSt= atListContext): - + def visitVfrStatementStatList(self, ctx: VfrSyntaxParser.VfrStatementS= tatListContext): self.visitChildren(ctx) if ctx.vfrStatementStat() !=3D None: ctx.Node =3D ctx.vfrStatementStat().Node @@ -3082,775 +3710,961 @@ class VfrSyntaxVisitor(ParseTreeVisitor): ctx.Node =3D ctx.vfrStatementInvalid().Node return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementStatListO= ld. - def visitVfrStatementStatListOld(self, ctx:VfrSyntaxParser.VfrStatemen= tStatListOldContext): + def visitVfrStatementStatListOld(self, ctx: VfrSyntaxParser.VfrStateme= ntStatListOldContext): return self.visitChildren(ctx) =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementDisableIf= Stat. - def visitVfrStatementDisableIfStat(self, ctx:VfrSyntaxParser.VfrStatem= entDisableIfStatContext): - - DIObj =3D CIfrDisableIf() + def visitVfrStatementDisableIfStat(self, ctx: VfrSyntaxParser.VfrState= mentDisableIfStatContext): + DIObj =3D IfrDisableIf() DIObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D DIObj - ctx.Node.Condition =3D 'disableif' + ' ' + self.__ExtractOriginalT= ext(ctx.vfrStatementExpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(DIObj.GetInfo()) + ctx.Node.Condition =3D ( + "disableif" + " " + self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) self.visitChildren(ctx) for Ctx in ctx.vfrStatementStatList(): - self.__InsertChild(ctx.Node, Ctx) - return ctx.Node + self.InsertChild(ctx.Node, Ctx) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementSuppressI= fStatNew. - def visitVfrStatementSuppressIfStatNew(self, ctx:VfrSyntaxParser.VfrSt= atementSuppressIfStatNewContext): - - SIObj =3D CIfrSuppressIf() + def visitVfrStatementSuppressIfStatNew( + self, ctx: VfrSyntaxParser.VfrStatementSuppressIfStatNewContext + ): + SIObj =3D IfrSuppressIf() SIObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D SIObj - ctx.Node.Condition =3D 'suppressif' + ' ' + self.__ExtractOriginal= Text(ctx.vfrStatementExpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(SIObj.GetInfo()) + ctx.Node.Condition =3D ( + "suppressif" + " " + self.ExtractOriginalText(ctx.vfrStatement= Expression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) self.visitChildren(ctx) for Ctx in ctx.vfrStatementStatList(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementGrayOutIf= StatNew. - def visitVfrStatementGrayOutIfStatNew(self, ctx:VfrSyntaxParser.VfrSta= tementGrayOutIfStatNewContext): - - GOIObj =3D CIfrGrayOutIf() + def visitVfrStatementGrayOutIfStatNew( + self, ctx: VfrSyntaxParser.VfrStatementGrayOutIfStatNewContext + ): + GOIObj =3D IfrGrayOutIf() GOIObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D GOIObj - ctx.Node.Condition =3D 'grayoutif' + ' ' + self.__ExtractOriginalT= ext(ctx.vfrStatementExpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(GOIObj.GetInfo()) + ctx.Node.Condition =3D ( + "grayoutif" + " " + self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) self.visitChildren(ctx) for Ctx in ctx.vfrStatementStatList(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 - - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementInconsist= entIfStat. - def visitVfrStatementInconsistentIfStat(self, ctx:VfrSyntaxParser.VfrS= tatementInconsistentIfStatContext): - - IIObj =3D CIfrInconsistentIf() - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ctx.star= t.line) + def visitVfrStatementInconsistentIfStat( + self, ctx: VfrSyntaxParser.VfrStatementInconsistentIfStatContext + ): + IIObj =3D IfrInconsistentIf() + self.ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, ctx.start.= line) IIObj.SetLineNo(ctx.start.line) self.visitChildren(ctx) - IIObj.SetError(self.__TransNum(ctx.Number())) + IIObj.SetError(self.TransNum(ctx.Number())) ctx.Node.Data =3D IIObj - ctx.Node.Condition =3D 'inconsistentif' + ' ' + self.__ExtractOrig= inalText(ctx.vfrStatementExpression()) + ctx.Node.Buffer =3D gFormPkg.StructToStream(IIObj.GetInfo()) + ctx.Node.Condition =3D ( + "inconsistentif" + " " + self.ExtractOriginalText(ctx.vfrState= mentExpression()) + ) + ctx.Node.Expression =3D self.ExtractOriginalText(ctx.vfrStatementE= xpression()) + self.InsertEndNode(ctx.Node, ctx.stop.line) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementInvalid. - def visitVfrStatementInvalid(self, ctx:VfrSyntaxParser.VfrStatementInv= alidContext): + def visitVfrStatementInvalid(self, ctx: VfrSyntaxParser.VfrStatementIn= validContext): return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementInvalidHi= dden. - def visitVfrStatementInvalidHidden(self, ctx:VfrSyntaxParser.VfrStatem= entInvalidHiddenContext): + def visitVfrStatementInvalidHidden(self, ctx: VfrSyntaxParser.VfrState= mentInvalidHiddenContext): return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementInvalidIn= ventory. - def visitVfrStatementInvalidInventory(self, ctx:VfrSyntaxParser.VfrSta= tementInvalidInventoryContext): + def visitVfrStatementInvalidInventory( + self, ctx: VfrSyntaxParser.VfrStatementInvalidInventoryContext + ): return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementInvalidSa= veRestoreDefaults. - def visitVfrStatementInvalidSaveRestoreDefaults(self, ctx:VfrSyntaxPar= ser.VfrStatementInvalidSaveRestoreDefaultsContext): + def visitVfrStatementInvalidSaveRestoreDefaults( + self, ctx: VfrSyntaxParser.VfrStatementInvalidSaveRestoreDefaultsC= ontext + ): return self.visitChildren(ctx) =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementLabel. - def visitVfrStatementLabel(self, ctx:VfrSyntaxParser.VfrStatementLabel= Context): - - LObj =3D CIfrLabel() + def visitVfrStatementLabel(self, ctx: VfrSyntaxParser.VfrStatementLabe= lContext): + LObj =3D IfrLabel() self.visitChildren(ctx) LObj.SetLineNo(ctx.start.line) - LObj.SetNumber(self.__TransNum(ctx.Number())) + LObj.SetNumber(self.TransNum(ctx.Number())) ctx.Node.Data =3D LObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(LObj.GetInfo()) return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatemex.BObjntBan= ner. - def visitVfrStatementBanner(self, ctx:VfrSyntaxParser.VfrStatementBann= erContext): - + def visitVfrStatementBanner(self, ctx: VfrSyntaxParser.VfrStatementBan= nerContext): self.visitChildren(ctx) + BObj =3D IfrBanner() + BObj.SetLineNo(ctx.start.line) + BObj.SetTitle(self.TransNum(ctx.Number(0))) =20 if ctx.Line() !=3D None: - BObj =3D CIfrBanner() - BObj.SetLineNo(ctx.start.line) - BObj.SetTitle(self.__TransNum(ctx.Number(0))) - BObj.SetLine(self.__TransNum(ctx.Number(1))) - if ctx.Left() !=3D None: BObj.SetAlign(0) - if ctx.Center() !=3D None: BObj.SetAlign(1) - if ctx.Right() !=3D None: BObj.SetAlign(2) - ctx.Node.Data =3D BObj - elif ctx.Timeout() !=3D None: - TObj =3D CIfrTimeout() + BObj.SetLine(self.TransNum(ctx.Number(1))) + if ctx.Left() !=3D None: + ctx.Node.Dict["align"] =3D KV("left", 0) + BObj.SetAlign(0) + if ctx.Center() !=3D None: + ctx.Node.Dict["align"] =3D KV("center", 1) + BObj.SetAlign(1) + if ctx.Right() !=3D None: + ctx.Node.Dict["align"] =3D KV("right", 2) + BObj.SetAlign(2) + + ctx.Node.Data =3D BObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(BObj.GetInfo()) + + if ctx.Timeout() !=3D None: + TObj =3D IfrTimeout() TObj.SetLineNo(ctx.start.line) - TObj.SetTimeout(self.__TransNum(ctx.Number(2))) - ctx.Node.Data =3D TObj + TObj.SetTimeout(self.TransNum(ctx.Number(2))) + Node =3D IfrTreeNode(EFI_IFR_GUID_OP, TObj, gFormPkg.StructToS= tream(TObj.GetInfo())) + ctx.Node.insertChild(Node) + BObj.SetHasTimeOut(True) + BObj.SetTimeOut(self.TransNum(ctx.Number(2))) =20 return ctx.Node =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrStatementExtension= . - def visitVfrStatementExtension(self, ctx:VfrSyntaxParser.VfrStatementE= xtensionContext): - + def visitVfrStatementExtension(self, ctx: VfrSyntaxParser.VfrStatement= ExtensionContext): ctx.IsStruct =3D False if ctx.DataType() !=3D None: if ctx.Uint64() !=3D None: - ctx.TypeName =3D 'UINT64' + ctx.TypeName =3D "UINT64" elif ctx.Uint32() !=3D None: - ctx.TypeName =3D 'UINT32' + ctx.TypeName =3D "UINT32" elif ctx.Uint16() !=3D None: - ctx.TypeName =3D 'UINT16' + ctx.TypeName =3D "UINT16" elif ctx.Uint8() !=3D None: - ctx.TypeName =3D 'UINT8' + ctx.TypeName =3D "UINT8" elif ctx.Boolean() !=3D None: - ctx.TypeName =3D 'BOOLEAN' + ctx.TypeName =3D "BOOLEAN" elif ctx.EFI_STRING_ID() !=3D None: - ctx.TypeName =3D 'EFI_STRING_ID' + ctx.TypeName =3D "EFI_STRING_ID" elif ctx.EFI_HII_DATE() !=3D None: - ctx.TypeName =3D 'EFI_HII_DATE' + ctx.TypeName =3D "EFI_HII_DATE" ctx.IsStruct =3D True elif ctx.EFI_HII_TIME() !=3D None: - ctx.TypeName =3D 'EFI_HII_TIME' + ctx.TypeName =3D "EFI_HII_TIME" ctx.IsStruct =3D True elif ctx.EFI_HII_REF() !=3D None: - ctx.TypeName =3D 'EFI_HII_REF' + ctx.TypeName =3D "EFI_HII_REF" ctx.IsStruct =3D True else: - ctx.TypeName =3D self.__TransId(ctx.StringIdentifier()) + ctx.TypeName =3D self.TransId(ctx.StringIdentifier()) ctx.IsStruct =3D True - ctx.ArrayNum =3D self.__TransNum(ctx.Number()) - ctx.TypeSize, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSiz= eByTypeName(ctx.TypeName) - self.__ErrorHandler(ReturnCode, ctx.D.line) + ctx.ArrayNum =3D self.TransNum(ctx.Number()) + ctx.TypeSize, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSize= ByTypeName(ctx.TypeName) + self.ErrorHandler(ReturnCode, ctx.D.line) ctx.Size =3D ctx.TypeSize * ctx.ArrayNum if ctx.ArrayNum > 0 e= lse ctx.TypeSize - ArrayType =3D ctypes.c_ubyte * ctx.Size - ctx.DataBuff =3D ArrayType() - for i in range(0, ctx.Size): - ctx.DataBuff[i] =3D 0 - self.visitChildren(ctx) + ctx.Buffer =3D bytearray(ctx.Size) =20 + self.visitChildren(ctx) Line =3D ctx.start.line - GuidObj =3D CIfrGuid(ctx.Size) + GuidObj =3D IfrExtensionGuid(ctx.Size, ctx.TypeName, ctx.ArrayNum) + for Ctx in ctx.vfrExtensionData(): + GuidObj.SetFieldList(Ctx.FName, Ctx.TFValue) + GuidObj.SetLineNo(Line) GuidObj.SetGuid(ctx.guidDefinition().Guid) - if ctx.TypeName !=3D None: - GuidObj.SetData(ctx.DataBuff) - # vfrStatementExtension + if ctx.TypeName !=3D "": + GuidObj.SetData(ctx.Buffer) GuidObj.SetScope(1) ctx.Node.Data =3D GuidObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(GuidObj.GetInfo()) + if ctx.DataType() !=3D None: + Buffer =3D bytearray(ctx.Size) + for i in range(0, len(Buffer)): + Buffer[i] =3D ctx.Buffer[i] + ctx.Node.Buffer +=3D Buffer + for Ctx in ctx.vfrStatementExtension(): - self.__InsertChild(ctx.Node, Ctx) + self.InsertChild(ctx.Node, Ctx) + + self.InsertEndNode(ctx.Node, ctx.stop.line) return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrExtensionData. - def visitVfrExtensionData(self, ctx:VfrSyntaxParser.VfrExtensionDataCo= ntext): - ''' - TFName =3D '' - IsArray =3D False if ctx.OpenBracket() =3D=3D None else True - ArrayIdx =3D 0 - ctx.IsStruct =3D ctx.parentCtx.IsStruct - ctx.DataBuff =3D ctx.parentCtx.DataBuff - - self.visitChildren(ctx) - - Data =3D self.__TransNum(ctx.N.text) - if IsArray =3D=3D True: - ArrayIdx =3D self.__TransNum(self.__TransNum(ctx.Number(0))) - ByteOffset =3D ArrayIdx * ctx.parentCtx.TypeSize - if ctx.IsStruct =3D=3D True: - TFName +=3D ctx.parentCtx.TypeName + def visitVfrExtensionData(self, ctx: VfrSyntaxParser.VfrExtensionDataC= ontext): + IsArray =3D False if ctx.I =3D=3D None else True + if IsArray: + Index =3D self.TransNum(ctx.I.text) + else: + Index =3D 0 + IsStruct =3D ctx.parentCtx.IsStruct + self.visitChildren(ctx) + ctx.TFValue =3D self.TransNum(ctx.N.text) + Data =3D self.TransNum(ctx.N.text) + if IsArray: + ctx.FName +=3D "data" + "[" + ctx.I.text + "]" + else: + ctx.FName +=3D "data" + ctx.TFName =3D ctx.parentCtx.TypeName + if IsStruct: + ctx.TFName +=3D ctx.parentCtx.TypeName for i in range(0, len(ctx.arrayName())): - TFName +=3D '.' - TFName +=3D ctx.arrayName(i).SubStrZ - FieldOffset, FieldType, FieldSize, BitField, _ =3D gCVfrVarDat= aTypeDB.GetDataFieldInfo(TFName) - if BitField: - Mask =3D (1 << FieldSize) - 1 - Offset =3D int(FieldOffset / 8) - PreBits =3D FieldOffset % 8 - Mask <<=3D PreBits - Begin =3D 0 - End =3D 0 - if FieldType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - Data =3D ctypes.c_ubyte(Data) - if BitField: - # Set the value to the bit fileds. - Data <<=3D PreBits - Value =3D (Value & (~Mask)) | Data - Begin =3D ByteOffset + Offset - End =3D ByteOffset + Offset + sizeof (ctypes.c_uby= te) - ctx.DataBuff[Begin: End] =3D Value - else: - Begin =3D ByteOffset + FieldOffset - End =3D ByteOffset + FieldOffset + FieldSize - ctx.DataBuff[Begin: End] =3D Data - - - if FieldType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - Data =3D ctypes.c_ushort(Data) - if BitField: - # Set the value to the bit fileds. - Data <<=3D PreBits - Value =3D (Value & (~Mask)) | Data - Begin =3D ByteOffset + Offset - End =3D ByteOffset + Offset + sizeof (ctypes.c_ush= ort) - ctx.DataBuff[Begin: End] =3D Value - else: - Begin =3D ByteOffset + FieldOffset - End =3D ByteOffset + FieldOffset + FieldSize - ctx.DataBuff[Begin: End] =3D Data - - - if FieldType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - Data =3D ctypes.c_ulong(Data) - if BitField: - # Set the value to the bit fileds. - Data <<=3D PreBits - Value =3D (Value & (~Mask)) | Data - Begin =3D ByteOffset + Offset - End =3D ByteOffset + Offset + sizeof (ctypes.c_ulo= ng) - ctx.DataBuff[Begin: End] =3D Value - else: - Begin =3D ByteOffset + FieldOffset - End =3D ByteOffset + FieldOffset + FieldSize - ctx.DataBuff[Begin: End] =3D Data - - if FieldType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - Data =3D ctypes.c_ulonglong(Data) - if BitField: - # Set the value to the bit fileds. - Data <<=3D PreBits - Value =3D (Value & (~Mask)) | Data - Begin =3D ByteOffset + Offset - End =3D ByteOffset + Offset + sizeof (ctypes.c_ulo= nglong) - ctx.DataBuff[Begin: End] =3D Value - else: - Begin =3D ByteOffset + FieldOffset - End =3D ByteOffset + FieldOffset + FieldSize - ctx.DataBuff[Begin: End] =3D Data - + ctx.TFName +=3D "." + ctx.TFName +=3D ctx.arrayName(i).SubStrZ + ctx.FName +=3D "." + ctx.FName +=3D ctx.arrayName(i).SubStrZ + + Buffer =3D ctx.parentCtx.Buffer + FieldOffset, FieldType, FieldSize, BitField, _ =3D gVfrVarDataType= DB.GetDataFieldInfo( + ctx.TFName + ) + ByteOffset =3D ctx.parentCtx.TypeSize * Index + if not BitField: + Offset =3D ByteOffset + FieldOffset + Buffer[Offset : Offset + FieldSize] =3D ctx.TFValue.to_bytes(F= ieldSize, "little") else: - ctx.DataBuff[ByteOffset, ByteOffset + ctx.parentCtx.TypeSize] = =3D Data - ''' - return self.visitChildren(ctx) + Mask =3D (1 << FieldSize) - 1 + Offset =3D FieldOffset // 8 + PreBits =3D FieldOffset % 8 + Mask <<=3D PreBits + Value =3D int.from_bytes( + Buffer[ByteOffset + Offset : ByteOffset + Offset + FieldSi= ze], "little" + ) + Data <<=3D PreBits + Value =3D (Value & (~Mask)) | Data + Buffer[ByteOffset + Offset : ByteOffset + Offset + FieldSize] = =3D Value.to_bytes( + FieldSize, "little" + ) + + return Buffer =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementModal. - def visitVfrStatementModal(self, ctx:VfrSyntaxParser.VfrStatementModal= Context): - + def visitVfrStatementModal(self, ctx: VfrSyntaxParser.VfrStatementModa= lContext): self.visitChildren(ctx) ctx.Node =3D ctx.vfrModalTag().Node return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrModalTag. - def visitVfrModalTag(self, ctx:VfrSyntaxParser.VfrModalTagContext): - - MObj =3D CIfrModal() + def visitVfrModalTag(self, ctx: VfrSyntaxParser.VfrModalTagContext): + MObj =3D IfrModal() self.visitChildren(ctx) MObj.SetLineNo(ctx.start.line) ctx.Node.Data =3D MObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(MObj.GetInfo()) =20 return ctx.Node =20 - def __SaveOpHdrCond(self, OpHdr, Cond, LineNo=3D0): + def SaveOpHdrCond(self, OpHdr, Cond, LineNo=3D0): if Cond =3D=3D True: - if self.__CIfrOpHdr[self.__CIfrOpHdrIndex] !=3D None: + if self.IfrOpHdr[self.IfrOpHdrIndex] !=3D None: return - self.__CIfrOpHdr[self.__CIfrOpHdrIndex] =3D CIfrOpHeader(OpHdr= ) # - self.__CIfrOpHdrLineNo[self.__CIfrOpHdrIndex] =3D LineNo + self.IfrOpHdr[self.IfrOpHdrIndex] =3D OpHdr + self.IfrOpHdrLineNo[self.IfrOpHdrIndex] =3D LineNo =20 + def InitOpHdrCond(self): + self.IfrOpHdr.append(None) + self.IfrOpHdrLineNo.append(0) =20 - def __InitOpHdrCond(self): - self.__CIfrOpHdr.append(None) - self.__CIfrOpHdrLineNo.append(0) - - def __SetSavedOpHdrScope(self): - if self.__CIfrOpHdr[self.__CIfrOpHdrIndex] !=3D None: - self.__CIfrOpHdr[self.__CIfrOpHdrIndex].SetScope(1) + def SetSavedOpHdrScope(self): + if self.IfrOpHdr[self.IfrOpHdrIndex] !=3D None: + self.IfrOpHdr[self.IfrOpHdrIndex].Scope =3D 1 return True return False =20 - def __ClearSavedOPHdr(self): - self.__CIfrOpHdr[self.__CIfrOpHdrIndex] =3D None + def ClearSavedOPHdr(self): + self.IfrOpHdr[self.IfrOpHdrIndex] =3D None =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementExpressio= n. - def visitVfrStatementExpression(self, ctx:VfrSyntaxParser.VfrStatement= ExpressionContext): - - # Root expression extension function called by other function. ## + def visitVfrStatementExpression(self, ctx: VfrSyntaxParser.VfrStatemen= tExpressionContext): + # Root expression extension function called by other function. if ctx.ExpInfo.RootLevel =3D=3D 0: - self.__CIfrOpHdrIndex +=3D 1 - if self.__CIfrOpHdrIndex >=3D MAX_IFR_EXPRESSION_DEPTH: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_INVALID_PARAM= ETER, ctx.start.line, 'The depth of expression exceeds the max supported le= vel 8!') - self.__InitOpHdrCond() + self.IfrOpHdrIndex +=3D 1 + if self.IfrOpHdrIndex >=3D MAX_IFR_EXPRESSION_DEPTH: + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_INVALID_PARAMETER, + ctx.start.line, + "The depth of expression exceeds the max supported lev= el 8!", + ) + self.InitOpHdrCond() =20 self.visitChildren(ctx) - Line =3D ctx.start.line - for i in range(0, len(ctx.OR())): - ctx.ExpInfo.ExpOpCount +=3D 1 - OObj =3D CIfrOr(Line) + + for i in range(0, len(ctx.andTerm())): + ctx.Nodes.extend(ctx.andTerm(i).Nodes) + if i !=3D 0: + ctx.ExpInfo.ExpOpCount +=3D 1 + OObj =3D IfrOr(ctx.andTerm(i).Line) + Node =3D IfrTreeNode(EFI_IFR_OR_OP, OObj, gFormPkg.StructT= oStream(OObj.GetInfo())) + ctx.Nodes.append(Node) =20 # Extend OpCode Scope only for the root expression. if ctx.ExpInfo.ExpOpCount > 1 and ctx.ExpInfo.RootLevel =3D=3D 0: - if self.__SetSavedOpHdrScope(): - EObj =3D CIfrEnd() - if self.__CIfrOpHdrLineNo[self.__CIfrOpHdrIndex] !=3D 0: - EObj.SetLineNo(self.__CIfrOpHdrLineNo[self.__CIfrOpHdr= Index]) + if self.SetSavedOpHdrScope(): + EObj =3D IfrEnd() + if self.IfrOpHdrLineNo[self.IfrOpHdrIndex] !=3D 0: + EObj.SetLineNo(self.IfrOpHdrLineNo[self.IfrOpHdrIndex]= ) + else: + EObj.SetLineNo(ctx.stop.line) + Node =3D IfrTreeNode(EFI_IFR_END_OP, EObj, gFormPkg.Struct= ToStream(EObj.GetInfo())) + ctx.Nodes.append(Node) =20 if ctx.ExpInfo.RootLevel =3D=3D 0: - self.__ClearSavedOPHdr() - self.__CIfrOpHdrIndex =3D self.__CIfrOpHdrIndex - 1 + self.ClearSavedOPHdr() + self.IfrOpHdrIndex =3D self.IfrOpHdrIndex - 1 =20 - self.__ConstantOnlyInExpression =3D False + for Node in ctx.Nodes: + if ctx.ParentNode !=3D None: + ctx.ParentNode.insertChild(Node) =20 - return ctx.ExpInfo + self.ConstantOnlyInExpression =3D False =20 + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#vfrStatementExpressio= nSub. - def visitVfrStatementExpressionSub(self, ctx:VfrSyntaxParser.VfrStatem= entExpressionSubContext): - + def visitVfrStatementExpressionSub(self, ctx: VfrSyntaxParser.VfrState= mentExpressionSubContext): ctx.ExpInfo.RootLevel =3D ctx.parentCtx.ExpInfo.RootLevel + 1 ctx.ExpInfo.ExpOpCount =3D ctx.parentCtx.ExpInfo.ExpOpCount =20 self.visitChildren(ctx) =20 + for i in range(0, len(ctx.andTerm())): + ctx.Nodes.extend(ctx.andTerm(i).Nodes) + if i !=3D 0: + ctx.ExpInfo.ExpOpCount +=3D 1 + OObj =3D IfrOr(ctx.andTerm(i).Line) + Node =3D IfrTreeNode(EFI_IFR_OR_OP, OObj, gFormPkg.StructT= oStream(OObj.GetInfo())) + ctx.Nodes.append(Node) + + ctx.ParentNodes.extend(ctx.Nodes) + ctx.parentCtx.ExpInfo.ExpOpCount =3D ctx.ExpInfo.ExpOpCount =20 - return ctx.ExpInfo + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#andTerm. - def visitAndTerm(self, ctx:VfrSyntaxParser.AndTermContext): + def visitAndTerm(self, ctx: VfrSyntaxParser.AndTermContext): + ctx.Line =3D ctx.start.line self.visitChildren(ctx) - Line =3D ctx.start.line - for i in range(0, len(ctx.AND())): - ctx.ExpInfo.ExpOpCount +=3D 1 - AObj =3D CIfrAnd(Line) - ctx.CIfrAndList.append(AObj) - - return ctx.ExpInfo, ctx.CIfrAndList - + for i in range(0, len(ctx.bitwiseorTerm())): + ctx.Nodes.extend(ctx.bitwiseorTerm(i).Nodes) + if i !=3D 0: + ctx.ExpInfo.ExpOpCount +=3D 1 + AObj =3D IfrAnd(ctx.bitwiseorTerm(i).Line) + Node =3D IfrTreeNode(EFI_IFR_AND_OP, AObj, gFormPkg.Struct= ToStream(AObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#bitwiseorTerm. - def visitBitwiseorTerm(self, ctx:VfrSyntaxParser.BitwiseorTermContext)= : + def visitBitwiseorTerm(self, ctx: VfrSyntaxParser.BitwiseorTermContext= ): + ctx.Line =3D ctx.start.line self.visitChildren(ctx) - Line =3D ctx.start.line - for i in range(0, len(ctx.BitWiseOr())): - ctx.ExpInfo.ExpOpCount +=3D 1 - BWOObj =3D CIfrBitWiseOr(Line) - ctx.CIfrBitWiseOrList.append(BWOObj) - - return ctx.ExpInfo, ctx.CIfrBitWiseOrList + for i in range(0, len(ctx.bitwiseandTerm())): + ctx.Nodes.extend(ctx.bitwiseandTerm(i).Nodes) + if i !=3D 0: + ctx.ExpInfo.ExpOpCount +=3D 1 + BWOObj =3D IfrBitWiseOr(ctx.bitwiseandTerm(i).Line) + Node =3D IfrTreeNode( + EFI_IFR_BITWISE_OR_OP, BWOObj, gFormPkg.StructToStream= (BWOObj.GetInfo()) + ) + ctx.Nodes.append(Node) =20 + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#bitwiseandTerm. - def visitBitwiseandTerm(self, ctx:VfrSyntaxParser.BitwiseandTermContex= t): + def visitBitwiseandTerm(self, ctx: VfrSyntaxParser.BitwiseandTermConte= xt): + ctx.Line =3D ctx.start.line self.visitChildren(ctx) - Line =3D ctx.start.line - for i in range(0, len(ctx.BitWiseAnd())): - ctx.ExpInfo.ExpOpCount +=3D 1 - BWAObj =3D CIfrBitWiseAnd(Line) - ctx.CIfrBitWiseAndList.append(BWAObj) - - return ctx.ExpInfo, ctx.CIfrBitWiseAndList + for i in range(0, len(ctx.equalTerm())): + ctx.Nodes.extend(ctx.equalTerm(i).Nodes) + if i !=3D 0: + ctx.ExpInfo.ExpOpCount +=3D 1 + BWAObj =3D IfrBitWiseAnd(ctx.equalTerm(i).Line) + Node =3D IfrTreeNode( + EFI_IFR_BITWISE_AND_OP, BWAObj, gFormPkg.StructToStrea= m(BWAObj.GetInfo()) + ) + ctx.Nodes.append(Node) =20 + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#equalTerm. - def visitEqualTerm(self, ctx:VfrSyntaxParser.EqualTermContext): + def visitEqualTerm(self, ctx: VfrSyntaxParser.EqualTermContext): + ctx.Line =3D ctx.start.line self.visitChildren(ctx) - for i in range(0, len(ctx.equalTermSupplementary())): - ctx.ExpInfo.ExpOpCount +=3D 1 + ctx.Nodes.extend(ctx.compareTerm().Nodes) =20 - return ctx.ExpInfo, ctx.CIfrEqualList, ctx.CIfrNotEqualList + for ChildCtx in ctx.equalTermSupplementary(): + ctx.ExpInfo.ExpOpCount +=3D 1 + ctx.Nodes.extend(ChildCtx.Nodes) =20 + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#equalTermEqualRule. - def visitEqualTermEqualRule(self, ctx:VfrSyntaxParser.EqualTermEqualRu= leContext): + def visitEqualTermEqualRule(self, ctx: VfrSyntaxParser.EqualTermEqualR= uleContext): self.visitChildren(ctx) - EObj =3D CIfrEqual(ctx.start.line) - ctx.CIfrEqualList.append(EObj) - - return EObj - + ctx.Nodes.extend(ctx.compareTerm().Nodes) + EObj =3D IfrEqual(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_EQUAL_OP, EObj, gFormPkg.StructToStre= am(EObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#equalTermNotEqualRule= . - def visitEqualTermNotEqualRule(self, ctx:VfrSyntaxParser.EqualTermNotE= qualRuleContext): + def visitEqualTermNotEqualRule(self, ctx: VfrSyntaxParser.EqualTermNot= EqualRuleContext): self.visitChildren(ctx) - NEObj =3D CIfrNotEqual(ctx.start.line) - ctx.CIfrNotEqualList.append(NEObj) - return NEObj - + ctx.Nodes.extend(ctx.compareTerm().Nodes) + NEObj =3D IfrNotEqual(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_NOT_EQUAL_OP, NEObj, gFormPkg.StructT= oStream(NEObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#compareTerm. - def visitCompareTerm(self, ctx:VfrSyntaxParser.CompareTermContext): + def visitCompareTerm(self, ctx: VfrSyntaxParser.CompareTermContext): self.visitChildren(ctx) - for i in range(0, len(ctx.compareTermSupplementary())): + ctx.Nodes.extend(ctx.shiftTerm().Nodes) + + for ChildCtx in ctx.compareTermSupplementary(): ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.ExpInfo, ctx.CIfrLessThanList, ctx.CIfrLessEqualList, c= tx.CIfrGreaterThanList, ctx.CIfrGreaterEqualList + ctx.Nodes.extend(ChildCtx.Nodes) =20 + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#compareTermLessRule. - def visitCompareTermLessRule(self, ctx:VfrSyntaxParser.CompareTermLess= RuleContext): + def visitCompareTermLessRule(self, ctx: VfrSyntaxParser.CompareTermLes= sRuleContext): self.visitChildren(ctx) - LTObj =3D CIfrLessThan(ctx.start.line) - ctx.CIfrLessThanList.append(LTObj) - return LTObj - + ctx.Nodes.extend(ctx.shiftTerm().Nodes) + LTObj =3D IfrLessThan(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_LESS_THAN_OP, LTObj, gFormPkg.StructT= oStream(LTObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#compareTermLessEqualR= ule. - def visitCompareTermLessEqualRule(self, ctx:VfrSyntaxParser.CompareTer= mLessEqualRuleContext): + def visitCompareTermLessEqualRule(self, ctx: VfrSyntaxParser.CompareTe= rmLessEqualRuleContext): self.visitChildren(ctx) - LEObj =3D CIfrLessEqual(ctx.start.line) - ctx.CIfrLessEqualList.append(LEObj) - return LEObj - + ctx.Nodes.extend(ctx.shiftTerm().Nodes) + LEObj =3D IfrLessEqual(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_LESS_EQUAL_OP, LEObj, gFormPkg.Struct= ToStream(LEObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#compareTermGreaterRul= e. - def visitCompareTermGreaterRule(self, ctx:VfrSyntaxParser.CompareTermG= reaterRuleContext): + def visitCompareTermGreaterRule(self, ctx: VfrSyntaxParser.CompareTerm= GreaterRuleContext): self.visitChildren(ctx) - GTObj =3D CIfrGreaterThan(ctx.start.line) - ctx.CIfrGreaterThanList.append(GTObj) - return GTObj - + ctx.Nodes.extend(ctx.shiftTerm().Nodes) + GTObj =3D IfrGreaterThan(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_GREATER_THAN_OP, GTObj, gFormPkg.Stru= ctToStream(GTObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#compareTermGreaterEqu= alRule. - def visitCompareTermGreaterEqualRule(self, ctx:VfrSyntaxParser.Compare= TermGreaterEqualRuleContext): - self.visitChildren(ctx) - GEObj =3D CIfrGreaterEqual(ctx.start.line) - ctx.CIfrGreaterEqualList.append(GEObj) - return GEObj + def visitCompareTermGreaterEqualRule( + self, ctx: VfrSyntaxParser.CompareTermGreaterEqualRuleContext + ): + self.visitChildren(ctx) + ctx.Nodes.extend(ctx.shiftTerm().Nodes) + GEObj =3D IfrGreaterEqual(ctx.start.line) + Node =3D IfrTreeNode( + EFI_IFR_GREATER_EQUAL_OP, GEObj, gFormPkg.StructToStream(GEObj= .GetInfo()) + ) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#shiftTerm. - def visitShiftTerm(self, ctx:VfrSyntaxParser.ShiftTermContext): + def visitShiftTerm(self, ctx: VfrSyntaxParser.ShiftTermContext): self.visitChildren(ctx) - for i in range(0, len(ctx.shiftTermSupplementary())): + ctx.Nodes.extend(ctx.addMinusTerm().Nodes) + + for ChildCtx in ctx.shiftTermSupplementary(): ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.ExpInfo, ctx.CIfrShiftLeftList, ctx.CIfrShiftRightList + ctx.Nodes.extend(ChildCtx.Nodes) + + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#shiftTermLeft. - def visitShiftTermLeft(self, ctx:VfrSyntaxParser.ShiftTermLeftContext)= : + def visitShiftTermLeft(self, ctx: VfrSyntaxParser.ShiftTermLeftContext= ): self.visitChildren(ctx) - SLObj =3D CIfrShiftLeft(ctx.start.line) - ctx.CIfrShiftLeftList.append(SLObj) - return SLObj - + ctx.Nodes.extend(ctx.addMinusTerm().Nodes) + SLObj =3D IfrShiftLeft(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_SHIFT_LEFT_OP, SLObj, gFormPkg.Struct= ToStream(SLObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#shiftTermRight. - def visitShiftTermRight(self, ctx:VfrSyntaxParser.ShiftTermRightContex= t): + def visitShiftTermRight(self, ctx: VfrSyntaxParser.ShiftTermRightConte= xt): self.visitChildren(ctx) - SRObj =3D CIfrShiftRight(ctx.start.line) - ctx.CIfrShiftRightList.append(SRObj) - return SRObj - + ctx.Nodes.extend(ctx.addMinusTerm().Nodes) + SRObj =3D IfrShiftRight(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_SHIFT_RIGHT_OP, SRObj, gFormPkg.Struc= tToStream(SRObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#addMinusTerm. - def visitAddMinusTerm(self, ctx:VfrSyntaxParser.AddMinusTermContext): + def visitAddMinusTerm(self, ctx: VfrSyntaxParser.AddMinusTermContext): self.visitChildren(ctx) - for i in range(0, len(ctx.addMinusTermSupplementary())): + ctx.Nodes.extend(ctx.multdivmodTerm().Nodes) + + for ChildCtx in ctx.addMinusTermSupplementary(): ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.ExpInfo, ctx.CIfrAddList, ctx.CIfrSubtractList + ctx.Nodes.extend(ChildCtx.Nodes) =20 + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#addMinusTermpAdd. - def visitAddMinusTermpAdd(self, ctx:VfrSyntaxParser.AddMinusTermpAddCo= ntext): + def visitAddMinusTermpAdd(self, ctx: VfrSyntaxParser.AddMinusTermpAddC= ontext): self.visitChildren(ctx) - AObj =3D CIfrAdd(ctx.start.line) - ctx.CIfrAddList.append(AObj) - return AObj - + ctx.Nodes.extend(ctx.multdivmodTerm().Nodes) + AObj =3D IfrAdd(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_ADD_OP, AObj, gFormPkg.StructToStream= (AObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#addMinusTermSubtract. - def visitAddMinusTermSubtract(self, ctx:VfrSyntaxParser.AddMinusTermSu= btractContext): + def visitAddMinusTermSubtract(self, ctx: VfrSyntaxParser.AddMinusTermS= ubtractContext): self.visitChildren(ctx) - SObj =3D CIfrSubtract(ctx.start.line) - ctx.CIfrSubtractList.append(SObj) - return SObj - + ctx.Nodes.extend(ctx.multdivmodTerm().Nodes) + SObj =3D IfrSubtract(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_SUBTRACT_OP, SObj, gFormPkg.StructToS= tream(SObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#multdivmodTerm. - def visitMultdivmodTerm(self, ctx:VfrSyntaxParser.MultdivmodTermContex= t): + def visitMultdivmodTerm(self, ctx: VfrSyntaxParser.MultdivmodTermConte= xt): self.visitChildren(ctx) - for i in range(0, len(ctx.multdivmodTermSupplementary())): + ctx.Nodes.extend(ctx.castTerm().Nodes) + for ChildCtx in ctx.multdivmodTermSupplementary(): ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.ExpInfo, ctx.CIfrMultiplyList, ctx.CIfrDivideList, ctx= .CIfrModuloList + ctx.Nodes.extend(ChildCtx.Nodes) =20 + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#multdivmodTermMul. - def visitMultdivmodTermMul(self, ctx:VfrSyntaxParser.MultdivmodTermMul= Context): + def visitMultdivmodTermMul(self, ctx: VfrSyntaxParser.MultdivmodTermMu= lContext): self.visitChildren(ctx) - MObj =3D CIfrMultiply(ctx.start.line) - ctx.CIfrMultiplyList.append(MObj) - return MObj - + ctx.Nodes.extend(ctx.castTerm().Nodes) + MObj =3D IfrMultiply(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_MULTIPLY_OP, MObj, gFormPkg.StructToS= tream(MObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#multdivmodTermDiv. - def visitMultdivmodTermDiv(self, ctx:VfrSyntaxParser.MultdivmodTermDiv= Context): + def visitMultdivmodTermDiv(self, ctx: VfrSyntaxParser.MultdivmodTermDi= vContext): self.visitChildren(ctx) - DObj =3D CIfrDivide(ctx.start.line) - ctx.CIfrDivideList.append(DObj) - return DObj - + ctx.Nodes.extend(ctx.castTerm().Nodes) + DObj =3D IfrDivide(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_DIVIDE_OP, DObj, gFormPkg.StructToStr= eam(DObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#multdivmodTermRound. - def visitMultdivmodTermModulo(self, ctx:VfrSyntaxParser.MultdivmodTerm= ModuloContext): + def visitMultdivmodTermModulo(self, ctx: VfrSyntaxParser.MultdivmodTer= mModuloContext): self.visitChildren(ctx) - ctx.Line =3D ctx.start.line - MObj =3D CIfrModulo(ctx.Line) - ctx.CIfrModuloList.append(MObj) - return MObj - + ctx.Nodes.extend(ctx.castTerm().Nodes) + MObj =3D IfrModulo(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_MODULO_OP, MObj, gFormPkg.StructToStr= eam(MObj.GetInfo())) + ctx.Nodes.append(Node) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#castTerm. - def visitCastTerm(self, ctx:VfrSyntaxParser.CastTermContext): - self.visitChildren(ctx) ## + def visitCastTerm(self, ctx: VfrSyntaxParser.CastTermContext): + self.visitChildren(ctx) CastType =3D 0xFF - if ctx.Boolean() !=3D []: - CastType =3D 0 - elif ctx.Uint64() !=3D []: - CastType =3D 1 - elif ctx.Uint32() !=3D []: - CastType =3D 1 - elif ctx.Uint16() !=3D []: - CastType =3D 1 - elif ctx.Uint8() !=3D []: - CastType =3D 1 + for ChildCtx in ctx.castTermSub(): + CastType =3D ChildCtx.CastType =20 - Line =3D ctx.start.line + ctx.Nodes.extend(ctx.atomTerm().Nodes) if CastType =3D=3D 0: - ctx.TBObj =3D CIfrToBoolean(Line) - elif CastType =3D=3D 1: - ctx.TUObj =3D CIfrToUint(Line) - - ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.TBObj, ctx.TUObj + TBObj =3D IfrToBoolean(ctx.start.line) + Node =3D IfrTreeNode( + EFI_IFR_TO_BOOLEAN_OP, TBObj, gFormPkg.StructToStream(TBOb= j.GetInfo()) + ) + ctx.Nodes.append(Node) + ctx.ExpInfo.ExpOpCount +=3D 1 =20 + elif CastType =3D=3D 1: + TUObj =3D IfrToUint(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_TO_UINT_OP, TUObj, gFormPkg.Struc= tToStream(TUObj.GetInfo())) + ctx.Nodes.append(Node) + ctx.ExpInfo.ExpOpCount +=3D 1 + return ctx.Nodes =20 - # Visit a parse tree produced by VfrSyntaxParser#atomTerm. - def visitAtomTerm(self, ctx:VfrSyntaxParser.AtomTermContext): + # Visit a parse tree produced by VfrSyntaxParser#castTermSub. + def visitCastTermSub(self, ctx: VfrSyntaxParser.CastTermSubContext): self.visitChildren(ctx) - if ctx.NOT() !=3D None: - Line =3D ctx.start.line - NObj =3D CIfrNot(Line) + if ctx.Boolean() !=3D None: + ctx.CastType =3D 0 + elif ctx.Uint32() !=3D None: + ctx.CastType =3D 1 + elif ctx.Uint16() !=3D None: + ctx.CastType =3D 1 + elif ctx.Uint8() !=3D None: + ctx.CastType =3D 1 + return ctx.CastType =20 + # Visit a parse tree produced by VfrSyntaxParser#atomTerm. + def visitAtomTerm(self, ctx: VfrSyntaxParser.AtomTermContext): + self.visitChildren(ctx) + if ctx.vfrExpressionCatenate() !=3D None: + ctx.Nodes =3D ctx.vfrExpressionCatenate().Nodes + if ctx.vfrExpressionMatch() !=3D None: + ctx.Nodes =3D ctx.vfrExpressionMatch().Nodes + if ctx.vfrExpressionMatch2() !=3D None: + ctx.Nodes =3D ctx.vfrExpressionMatch2().Nodes + if ctx.vfrExpressionParen() !=3D None: + ctx.Nodes =3D ctx.vfrExpressionParen().Nodes + if ctx.vfrExpressionBuildInFunction() !=3D None: + ctx.Nodes.append(ctx.vfrExpressionBuildInFunction().Node) + if ctx.vfrExpressionConstant() !=3D None: + ctx.Nodes.append(ctx.vfrExpressionConstant().Node) + if ctx.vfrExpressionUnaryOp() !=3D None: + ctx.Nodes =3D ctx.vfrExpressionUnaryOp().Nodes + if ctx.vfrExpressionTernaryOp() !=3D None: + ctx.Nodes =3D ctx.vfrExpressionTernaryOp().Nodes + if ctx.vfrExpressionMap() !=3D None: + ctx.Nodes =3D ctx.vfrExpressionMap().Nodes + if ctx.atomTerm() !=3D None: + ctx.Nodes =3D ctx.atomTerm().Nodes + NObj =3D IfrNot(ctx.start.line) + Node =3D IfrTreeNode(EFI_IFR_NOT_OP, NObj, gFormPkg.StructToSt= ream(NObj.GetInfo())) + ctx.Nodes.append(Node) + ctx.ExpInfo.ExpOpCount +=3D 1 + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#vfrExpressionCatenate= . - def visitVfrExpressionCatenate(self, ctx:VfrSyntaxParser.VfrExpression= CatenateContext): + def visitVfrExpressionCatenate(self, ctx: VfrSyntaxParser.VfrExpressio= nCatenateContext): ctx.ExpInfo.RootLevel +=3D 1 self.visitChildren(ctx) =20 Line =3D ctx.start.line - ctx.CObj =3D CIfrCatenate(Line) + CObj =3D IfrCatenate(Line) + Node =3D IfrTreeNode(EFI_IFR_CATENATE_OP, CObj, gFormPkg.StructToS= tream(CObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.CObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#vfrExpressionMatch. - def visitVfrExpressionMatch(self, ctx:VfrSyntaxParser.VfrExpressionMat= chContext): + def visitVfrExpressionMatch(self, ctx: VfrSyntaxParser.VfrExpressionMa= tchContext): ctx.ExpInfo.RootLevel +=3D 1 self.visitChildren(ctx) =20 Line =3D ctx.start.line - ctx.MObj =3D CIfrMatch(Line) + MObj =3D IfrMatch(Line) + Node =3D IfrTreeNode(EFI_IFR_MATCH_OP, MObj, gFormPkg.StructToStre= am(MObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.MObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#vfrExpressionMatch2. - def visitVfrExpressionMatch2(self, ctx:VfrSyntaxParser.VfrExpressionMa= tch2Context): + def visitVfrExpressionMatch2(self, ctx: VfrSyntaxParser.VfrExpressionM= atch2Context): self.visitChildren(ctx) =20 Line =3D ctx.start.line Guid =3D ctx.guidDefinition().Guid - ctx.M2Obj =3D CIfrMatch2(Line, Guid) + M2Obj =3D IfrMatch2(Line, Guid) + Node =3D IfrTreeNode(EFI_IFR_MATCH2_OP, M2Obj, gFormPkg.StructToSt= ream(M2Obj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.M2Obj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#vfrExpressionParen. - def visitVfrExpressionParen(self, ctx:VfrSyntaxParser.VfrExpressionPar= enContext): - return self.visitChildren(ctx) - + def visitVfrExpressionParen(self, ctx: VfrSyntaxParser.VfrExpressionPa= renContext): + self.visitChildren(ctx) + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#vfrExpressionBuildInF= unction. - def visitVfrExpressionBuildInFunction(self, ctx:VfrSyntaxParser.VfrExp= ressionBuildInFunctionContext): - return self.visitChildren(ctx) - + def visitVfrExpressionBuildInFunction( + self, ctx: VfrSyntaxParser.VfrExpressionBuildInFunctionContext + ): + self.visitChildren(ctx) + if ctx.dupExp() !=3D None: + ctx.Node =3D ctx.dupExp().Node + if ctx.vareqvalExp() !=3D None: + ctx.Node =3D ctx.vareqvalExp().Node + if ctx.ideqvalExp() !=3D None: + ctx.Node =3D ctx.ideqvalExp().Node + if ctx.ideqidExp() !=3D None: + ctx.Node =3D ctx.ideqidExp().Node + if ctx.ideqvallistExp() !=3D None: + ctx.Node =3D ctx.ideqvallistExp().Node + if ctx.questionref1Exp() !=3D None: + ctx.Node =3D ctx.questionref1Exp().Node + if ctx.rulerefExp() !=3D None: + ctx.Node =3D ctx.rulerefExp().Node + if ctx.stringref1Exp() !=3D None: + ctx.Node =3D ctx.stringref1Exp().Node + if ctx.pushthisExp() !=3D None: + ctx.Node =3D ctx.pushthisExp().Node + if ctx.securityExp() !=3D None: + ctx.Node =3D ctx.securityExp().Node + if ctx.getExp() !=3D None: + ctx.Node =3D ctx.getExp().Node + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#dupExp. - def visitDupExp(self, ctx:VfrSyntaxParser.DupExpContext): - + def visitDupExp(self, ctx: VfrSyntaxParser.DupExpContext): self.visitChildren(ctx) Line =3D ctx.start.line - DObj =3D CIfrDup(Line) - self.__SaveOpHdrCond(DObj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) # + DObj =3D IfrDup(Line) + ctx.Node.Data =3D DObj + ctx.Node.Buffer =3D gFormPkg.StructToStream(DObj.GetInfo()) + self.SaveOpHdrCond(DObj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) # ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.ExpInfo - + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vareqvalExp. - def visitVareqvalExp(self, ctx:VfrSyntaxParser.VareqvalExpContext): - + def visitVareqvalExp(self, ctx: VfrSyntaxParser.VareqvalExpContext): Line =3D ctx.start.line self.visitChildren(ctx) =20 ReturnCode =3D VfrReturnCode.VFR_RETURN_UNSUPPORTED - VarIdStr =3D 'var' - VarIdStr +=3D str(ctx.Number(0)) - VarStoreId, ReturnCode =3D gCVfrDataStorage.GetVarStoreId(VarIdStr= ) + VarIdStr =3D "var" + VarIdStr +=3D ctx.VN.text + VarStoreId, ReturnCode =3D gVfrDataStorage.GetVarStoreId(VarIdStr) if ReturnCode =3D=3D VfrReturnCode.VFR_RETURN_UNDEFINED: pass else: - pass - QId, Mask, _ =3D self.__CVfrQuestionDB.GetQuestionId(None, VarIdSt= r) - ConstVal =3D self.__TransNum(ctx.Number(1)) + self.ErrorHandler(ReturnCode, ctx.VN.line) + QId, Mask, _ =3D self.VfrQuestionDB.GetQuestionId(None, VarIdStr) + ConstVal =3D self.TransNum(ctx.Number(1)) if ctx.Equal() !=3D None: if Mask =3D=3D 0: - EIVObj =3D CIfrEqIdVal(Line) - self.__SaveOpHdrCond(EIVObj.GetHeader(), (ctx.ExpInfo.ExpO= pCount =3D=3D 0), Line) - EIVObj.SetQuestionId(QId, VarIdStr, Line) + EIVObj =3D IfrEqIdVal(Line) + self.SaveOpHdrCond(EIVObj.GetHeader(), (ctx.ExpInfo.ExpOpC= ount =3D=3D 0), Line) + EIVObj.SetQuestionId(QId, VarIdStr, ctx.VN.line) EIVObj.SetValue(ConstVal) + ctx.Node =3D IfrTreeNode(EFI_IFR_EQ_ID_VAL_OP, EIVObj) ctx.ExpInfo.ExpOpCount +=3D 1 else: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Ma= sk, ConstVal, EFI_COMPARE_TYPE.EQUAL) + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_= COMPARE_TYPE.EQUAL + ) elif ctx.LessEqual() !=3D None: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Mask, = ConstVal, EFI_COMPARE_TYPE.LESS_EQUAL) + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_COMP= ARE_TYPE.LESS_EQUAL + ) =20 elif ctx.Less() !=3D None: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Mask, = ConstVal, EFI_COMPARE_TYPE.LESS_THAN) + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_COMP= ARE_TYPE.LESS_THAN + ) =20 elif ctx.GreaterEqual() !=3D None: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Mask, = ConstVal, EFI_COMPARE_TYPE.GREATER_EQUAL) + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_COMP= ARE_TYPE.GREATER_EQUAL + ) =20 elif ctx.Greater() !=3D None: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Mask, = ConstVal, EFI_COMPARE_TYPE.GREATER_THAN) - - - return ctx.ExpInfo + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_COMP= ARE_TYPE.GREATER_THAN + ) =20 + return ctx.Node =20 def ConvertIdExpr(self, ExpInfo, LineNo, QId, VarIdStr, BitMask): - - QR1Obj =3D CIfrQuestionRef1(LineNo) + QR1Obj =3D IfrQuestionRef1(LineNo) QR1Obj.SetQuestionId(QId, VarIdStr, LineNo) - self.__SaveOpHdrCond(QR1Obj.GetHeader(), (ExpInfo.ExpOpCount =3D= =3D 0)) + Node =3D IfrTreeNode(EFI_IFR_QUESTION_REF1_OP, QR1Obj) + self.SaveOpHdrCond(QR1Obj.GetHeader(), (ExpInfo.ExpOpCount =3D=3D = 0)) if BitMask !=3D 0: - U32Obj =3D CIfrUint32(LineNo) + U32Obj =3D IfrUint32(LineNo) U32Obj.SetValue(BitMask) - - BWAObj =3D CIfrBitWiseAnd(LineNo) - - U8Obj =3D CIfrUint8(LineNo) + Node.insertChild( + IfrTreeNode(EFI_IFR_UINT32_OP, U32Obj, gFormPkg.StructToSt= ream(U32Obj.GetInfo())) + ) + + BWAObj =3D IfrBitWiseAnd(LineNo) + Node.insertChild( + IfrTreeNode( + EFI_IFR_BITWISE_AND_OP, BWAObj, gFormPkg.StructToStrea= m(BWAObj.GetInfo()) + ) + ) + + U8Obj =3D IfrUint8(LineNo) if BitMask =3D=3D DATE_YEAR_BITMASK: - U8Obj.SetValue (0) + U8Obj.SetValue(0) elif BitMask =3D=3D TIME_SECOND_BITMASK: - U8Obj.SetValue (0x10) + U8Obj.SetValue(0x10) elif BitMask =3D=3D DATE_DAY_BITMASK: - U8Obj.SetValue (0x18) + U8Obj.SetValue(0x18) elif BitMask =3D=3D TIME_HOUR_BITMASK: - U8Obj.SetValue (0) + U8Obj.SetValue(0) elif BitMask =3D=3D TIME_MINUTE_BITMASK: - U8Obj.SetValue (0x8) + U8Obj.SetValue(0x8) + Node.insertChild( + IfrTreeNode(EFI_IFR_UINT8_OP, U8Obj, gFormPkg.StructToStre= am(U8Obj.GetInfo())) + ) =20 - SRObj =3D CIfrShiftRight(LineNo) + SRObj =3D IfrShiftRight(LineNo) + Node.insertChild( + IfrTreeNode(EFI_IFR_SHIFT_RIGHT_OP, SRObj, gFormPkg.Struct= ToStream(SRObj.GetInfo())) + ) =20 ExpInfo.ExpOpCount +=3D 4 - + return Node =20 def IdEqValDoSpecial(self, ExpInfo, LineNo, QId, VarIdStr, BitMask, Co= nstVal, CompareType): - - self.ConvertIdExpr(ExpInfo, LineNo, QId, VarIdStr, BitMask) + Node =3D self.ConvertIdExpr(ExpInfo, LineNo, QId, VarIdStr, BitMas= k) if ConstVal > 0xFF: - U16Obj =3D CIfrUint16(LineNo) + U16Obj =3D IfrUint16(LineNo) U16Obj.SetValue(ConstVal) + Node.insertChild( + IfrTreeNode(EFI_IFR_UINT16_OP, U16Obj, gFormPkg.StructToSt= ream(U16Obj.GetInfo())) + ) else: - U8Obj =3D CIfrUint8(LineNo) + U8Obj =3D IfrUint8(LineNo) U8Obj.SetValue(ConstVal) - + Node.insertChild( + IfrTreeNode(EFI_IFR_UINT8_OP, U8Obj, gFormPkg.StructToStre= am(U8Obj.GetInfo())) + ) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.EQUAL: - EObj =3D CIfrEqual(LineNo) + EObj =3D IfrEqual(LineNo) + Node.insertChild( + IfrTreeNode(EFI_IFR_EQUAL_OP, EObj, gFormPkg.StructToStrea= m(EObj.GetInfo())) + ) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.LESS_EQUAL: - LEObj =3D CIfrLessEqual(LineNo) + LEObj =3D IfrLessEqual(LineNo) + Node.insertChild( + IfrTreeNode(EFI_IFR_LESS_EQUAL_OP, LEObj, gFormPkg.StructT= oStream(LEObj.GetInfo())) + ) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.LESS_THAN: - LTObj =3D CIfrLessThan(LineNo) + LTObj =3D IfrLessThan(LineNo) + Node.insertChild( + IfrTreeNode(EFI_IFR_LESS_THAN_OP, LTObj, gFormPkg.StructTo= Stream(LTObj.GetInfo())) + ) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.GREATER_EQUAL: - GEObj =3D CIfrGreaterEqual(LineNo) + GEObj =3D IfrGreaterEqual(LineNo) + Node.insertChild( + IfrTreeNode( + EFI_IFR_GREATER_EQUAL_OP, GEObj, gFormPkg.StructToStre= am(GEObj.GetInfo()) + ) + ) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.GREATER_THAN: - GTObj =3D CIfrGreaterThan(LineNo) + GTObj =3D IfrGreaterThan(LineNo) + Node.insertChild( + IfrTreeNode( + EFI_IFR_GREATER_THAN_OP, GTObj, gFormPkg.StructToStrea= m(GTObj.GetInfo()) + ) + ) =20 ExpInfo.ExpOpCount +=3D 2 - + return Node =20 # Visit a parse tree produced by VfrSyntaxParser#ideqvalExp. - def visitIdeqvalExp(self, ctx:VfrSyntaxParser.IdeqvalExpContext): + def visitIdeqvalExp(self, ctx: VfrSyntaxParser.IdeqvalExpContext): Line =3D ctx.start.line self.visitChildren(ctx) Mask =3D ctx.vfrQuestionDataFieldName().Mask QId =3D ctx.vfrQuestionDataFieldName().QId VarIdStr =3D ctx.vfrQuestionDataFieldName().VarIdStr LineNo =3D ctx.vfrQuestionDataFieldName().Line - ConstVal =3D self.__TransNum(ctx.Number()) + ConstVal =3D self.TransNum(ctx.Number()) if ctx.Equal() !=3D None: if Mask =3D=3D 0: - EIVObj =3D CIfrEqIdVal(Line) - self.__SaveOpHdrCond(EIVObj.GetHeader(), (ctx.ExpInfo.ExpO= pCount =3D=3D 0), Line) + EIVObj =3D IfrEqIdVal(Line) + self.SaveOpHdrCond(EIVObj.GetHeader(), (ctx.ExpInfo.ExpOpC= ount =3D=3D 0), Line) EIVObj.SetQuestionId(QId, VarIdStr, LineNo) EIVObj.SetValue(ConstVal) + ctx.Node =3D IfrTreeNode(EFI_IFR_EQ_ID_VAL_OP, EIVObj) ctx.ExpInfo.ExpOpCount +=3D 1 else: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Ma= sk, ConstVal, EFI_COMPARE_TYPE.EQUAL) + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_= COMPARE_TYPE.EQUAL + ) =20 elif ctx.LessEqual() !=3D None: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Mask, = ConstVal, EFI_COMPARE_TYPE.LESS_EQUAL) + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_COMP= ARE_TYPE.LESS_EQUAL + ) =20 elif ctx.Less() !=3D None: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Mask, = ConstVal, EFI_COMPARE_TYPE.LESS_THAN) + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_COMP= ARE_TYPE.LESS_THAN + ) =20 elif ctx.GreaterEqual() !=3D None: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Mask, = ConstVal, EFI_COMPARE_TYPE.GREATER_EQUAL) + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_COMP= ARE_TYPE.GREATER_EQUAL + ) =20 elif ctx.Greater() !=3D None: - self.IdEqValDoSpecial(ctx.ExpInfo, Line, QId, VarIdStr, Mask, = ConstVal, EFI_COMPARE_TYPE.GREATER_THAN) + ctx.Node =3D self.IdEqValDoSpecial( + ctx.ExpInfo, Line, QId, VarIdStr, Mask, ConstVal, EFI_COMP= ARE_TYPE.GREATER_THAN + ) =20 - return ctx.ExpInfo - - - def IdEqIdDoSpecial(self, ExpInfo, LineNo, QId1, VarIdStr1, Mask1, QId= 2, VarIdStr2, Mask2, CompareType): + return ctx.Node =20 - self.ConvertIdExpr(ExpInfo, LineNo, QId1, VarIdStr1, Mask1) - self.ConvertIdExpr(ExpInfo, LineNo, QId2, VarIdStr2, Mask2) + def IdEqIdDoSpecial( + self, ExpInfo, LineNo, QId1, VarIdStr1, Mask1, QId2, VarIdStr2, Ma= sk2, CompareType + ): + Node1 =3D self.ConvertIdExpr(ExpInfo, LineNo, QId1, VarIdStr1, Mas= k1) + Node2 =3D self.ConvertIdExpr(ExpInfo, LineNo, QId2, VarIdStr2, Mas= k2) + Node1.insertChild(Node2) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.EQUAL: - EObj =3D CIfrEqual(LineNo) + EObj =3D IfrEqual(LineNo) + Node1.insertChild( + IfrTreeNode(EFI_IFR_EQUAL_OP, EObj, gFormPkg.StructToStrea= m(EObj.GetInfo())) + ) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.LESS_EQUAL: - LEObj =3D CIfrLessEqual(LineNo) + LEObj =3D IfrLessEqual(LineNo) + Node1.insertChild( + IfrTreeNode(EFI_IFR_LESS_EQUAL_OP, LEObj, gFormPkg.StructT= oStream(LEObj.GetInfo())) + ) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.LESS_THAN: - LTObj =3D CIfrLessThan(LineNo) + LTObj =3D IfrLessThan(LineNo) + Node1.insertChild( + IfrTreeNode(EFI_IFR_LESS_THAN_OP, LTObj, gFormPkg.StructTo= Stream(LTObj.GetInfo())) + ) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.GREATER_EQUAL: - GEObj =3D CIfrGreaterEqual(LineNo) + GEObj =3D IfrGreaterEqual(LineNo) + Node1.insertChild( + IfrTreeNode( + EFI_IFR_GREATER_EQUAL_OP, GEObj, gFormPkg.StructToStre= am(GEObj.GetInfo()) + ) + ) =20 if CompareType =3D=3D EFI_COMPARE_TYPE.GREATER_THAN: - GTObj =3D CIfrGreaterThan(LineNo) + GTObj =3D IfrGreaterThan(LineNo) + Node1.insertChild( + IfrTreeNode( + EFI_IFR_GREATER_THAN_OP, GTObj, gFormPkg.StructToStrea= m(GTObj.GetInfo()) + ) + ) =20 ExpInfo.ExpOpCount +=3D 1 - + return Node1 =20 # Visit a parse tree produced by VfrSyntaxParser#ideqidExp. - def visitIdeqidExp(self, ctx:VfrSyntaxParser.IdeqidExpContext): + def visitIdeqidExp(self, ctx: VfrSyntaxParser.IdeqidExpContext): self.visitChildren(ctx) Line =3D ctx.start.line Mask1 =3D ctx.vfrQuestionDataFieldName(0).Mask @@ -3865,41 +4679,101 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 if ctx.Equal() !=3D None: if Mask1 & Mask2: - self.IdEqIdDoSpecial(ctx.ExpInfo, Line, QId1, VarIdStr1, M= ask1, QId2, VarIdStr2, Mask2, EFI_COMPARE_TYPE.EQUAL) + ctx.Node =3D self.IdEqIdDoSpecial( + ctx.ExpInfo, + Line, + QId1, + VarIdStr1, + Mask1, + QId2, + VarIdStr2, + Mask2, + EFI_COMPARE_TYPE.EQUAL, + ) else: - EIIObj =3D CIfrEqIdId(Line) - self.__SaveOpHdrCond(EIIObj.GetHeader(), (ctx.ExpInfo.ExpO= pCount =3D=3D 0), Line) + EIIObj =3D IfrEqIdId(Line) + self.SaveOpHdrCond(EIIObj.GetHeader(), (ctx.ExpInfo.ExpOpC= ount =3D=3D 0), Line) EIIObj.SetQuestionId1(QId1, VarIdStr1, LineNo1) - EIIObj.SetQuestionId1(QId2, VarIdStr2, LineNo2) + EIIObj.SetQuestionId2(QId2, VarIdStr2, LineNo2) + ctx.Node =3D IfrTreeNode(EFI_IFR_EQ_ID_ID_OP, EIIObj) ctx.ExpInfo.ExpOpCount +=3D 1 =20 elif ctx.LessEqual() !=3D None: - self.IdEqIdDoSpecial(ctx.ExpInfo, Line, QId1, VarIdStr1, Mask1= , QId2, VarIdStr2, Mask2, EFI_COMPARE_TYPE.LESS_EQUAL) + ctx.Node =3D self.IdEqIdDoSpecial( + ctx.ExpInfo, + Line, + QId1, + VarIdStr1, + Mask1, + QId2, + VarIdStr2, + Mask2, + EFI_COMPARE_TYPE.LESS_EQUAL, + ) =20 elif ctx.Less() !=3D None: - self.IdEqIdDoSpecial(ctx.ExpInfo, Line, QId1, VarIdStr1, Mask1= , QId2, VarIdStr2, Mask2, EFI_COMPARE_TYPE.LESS_THAN) + ctx.Node =3D self.IdEqIdDoSpecial( + ctx.ExpInfo, + Line, + QId1, + VarIdStr1, + Mask1, + QId2, + VarIdStr2, + Mask2, + EFI_COMPARE_TYPE.LESS_THAN, + ) =20 elif ctx.GreaterEqual() !=3D None: - self.IdEqIdDoSpecial(ctx.ExpInfo, Line, QId1, VarIdStr1, Mask1= , QId2, VarIdStr2, Mask2, EFI_COMPARE_TYPE.GREATER_EQUAL) + ctx.Node =3D self.IdEqIdDoSpecial( + ctx.ExpInfo, + Line, + QId1, + VarIdStr1, + Mask1, + QId2, + VarIdStr2, + Mask2, + EFI_COMPARE_TYPE.GREATER_EQUAL, + ) =20 elif ctx.Greater() !=3D None: - self.IdEqIdDoSpecial(ctx.ExpInfo, Line, QId1, VarIdStr1, Mask1= , QId2, VarIdStr2, Mask2, EFI_COMPARE_TYPE.GREATER_THAN) - return ctx.ExpInfo - + ctx.Node =3D self.IdEqIdDoSpecial( + ctx.ExpInfo, + Line, + QId1, + VarIdStr1, + Mask1, + QId2, + VarIdStr2, + Mask2, + EFI_COMPARE_TYPE.GREATER_THAN, + ) + return ctx.Node =20 def IdEqListDoSpecial(self, ExpInfo, LineNo, QId, VarIdStr, Mask, List= Len, ValueList): if ListLen =3D=3D 0: - return + return None =20 - self.IdEqValDoSpecial(ExpInfo, LineNo, QId, VarIdStr, Mask, ValueL= ist[0], EFI_COMPARE_TYPE.EQUAL) + Node =3D self.IdEqValDoSpecial( + ExpInfo, LineNo, QId, VarIdStr, Mask, ValueList[0], EFI_COMPAR= E_TYPE.EQUAL + ) for i in range(1, ListLen): - self.IdEqValDoSpecial(ExpInfo, LineNo, QId, VarIdStr, Mask, Va= lueList[i], EFI_COMPARE_TYPE.EQUAL) - OObj =3D CIfrOr(LineNo) + Node.insertChild( + self.IdEqValDoSpecial( + ExpInfo, LineNo, QId, VarIdStr, Mask, ValueList[i], EF= I_COMPARE_TYPE.EQUAL + ) + ) + OObj =3D IfrOr(LineNo) + Node.insertChild( + IfrTreeNode(EFI_IFR_OR_OP, OObj, gFormPkg.StructToStream(O= Obj.GetInfo())) + ) ExpInfo.ExpOpCount +=3D 1 =20 + return Node =20 # Visit a parse tree produced by VfrSyntaxParser#ideqvallistExp. - def visitIdeqvallistExp(self, ctx:VfrSyntaxParser.IdeqvallistExpContex= t): + def visitIdeqvallistExp(self, ctx: VfrSyntaxParser.IdeqvallistExpConte= xt): self.visitChildren(ctx) Line =3D ctx.start.line Mask =3D ctx.vfrQuestionDataFieldName().Mask @@ -3908,143 +4782,150 @@ class VfrSyntaxVisitor(ParseTreeVisitor): LineNo =3D ctx.vfrQuestionDataFieldName().Line ValueList =3D [] for i in range(0, len(ctx.Number())): - ValueList.append(self.__TransNum(ctx.Number(i))) + ValueList.append(self.TransNum(ctx.Number(i))) =20 ListLen =3D len(ValueList) =20 if Mask !=3D 0: - self.IdEqListDoSpecial(ctx.ExpInfo, LineNo, QId, VarIdStr, Mas= k, ListLen, ValueList) + ctx.Node =3D self.IdEqListDoSpecial( + ctx.ExpInfo, LineNo, QId, VarIdStr, Mask, ListLen, ValueLi= st + ) else: - EILObj =3D CIfrEqIdList(Line, ListLen) + EILObj =3D IfrEqIdList(Line, ListLen) if QId !=3D EFI_QUESTION_ID_INVALID: EILObj.SetQuestionId(QId, VarIdStr, LineNo) EILObj.SetListLength(ListLen) EILObj.SetValueList(ValueList) - self.__SaveOpHdrCond(EILObj.GetHeader(), (ctx.ExpInfo.ExpOpCou= nt =3D=3D 0), Line) + self.SaveOpHdrCond(EILObj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) if QId =3D=3D EFI_QUESTION_ID_INVALID: EILObj.SetQuestionId(QId, VarIdStr, LineNo) + + ctx.Node =3D IfrTreeNode(EFI_IFR_EQ_ID_VAL_LIST_OP, EILObj) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.ExpInfo + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrQuestionDataFieldN= ameRule1. - def visitVfrQuestionDataFieldNameRule1(self, ctx:VfrSyntaxParser.VfrQu= estionDataFieldNameRule1Context): + def visitVfrQuestionDataFieldNameRule1( + self, ctx: VfrSyntaxParser.VfrQuestionDataFieldNameRule1Context + ): ctx.Line =3D ctx.start.line self.visitChildren(ctx) ctx.VarIdStr +=3D ctx.SN1.text - ctx.VarIdStr +=3D '[' + ctx.VarIdStr +=3D "[" ctx.VarIdStr +=3D ctx.I.text - ctx.VarIdStr +=3D ']' - ctx.QId, ctx.Mask, _ =3D self.__CVfrQuestionDB.GetQuestionId(None,= ctx.VarIdStr) - if self.__ConstantOnlyInExpression: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_CONSTANT_ONLY, ct= x.SN1.line) + ctx.VarIdStr +=3D "]" + ctx.QId, ctx.Mask, _ =3D self.VfrQuestionDB.GetQuestionId(None, ct= x.VarIdStr) + if self.ConstantOnlyInExpression: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_CONSTANT_ONLY, ctx.= SN1.line) return ctx.QId, ctx.Mask, ctx.VarIdStr =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrQuestionDataFieldN= ameRule2. - def visitVfrQuestionDataFieldNameRule2(self, ctx:VfrSyntaxParser.VfrQu= estionDataFieldNameRule2Context): + def visitVfrQuestionDataFieldNameRule2( + self, ctx: VfrSyntaxParser.VfrQuestionDataFieldNameRule2Context + ): ctx.Line =3D ctx.start.line self.visitChildren(ctx) ctx.VarIdStr +=3D ctx.SN2.text for i in range(0, len(ctx.arrayName())): - ctx.VarIdStr +=3D '.' - if self.__ConstantOnlyInExpression: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_CONSTANT_ONLY= , ctx.SN2.line) + ctx.VarIdStr +=3D "." + if self.ConstantOnlyInExpression: + self.ErrorHandler(VfrReturnCode.VFR_RETURN_CONSTANT_ONLY, = ctx.SN2.line) ctx.VarIdStr +=3D ctx.arrayName(i).SubStrZ =20 - ctx.QId, ctx.Mask, _ =3D self.__CVfrQuestionDB.GetQuestionId(None,= ctx.VarIdStr) + ctx.QId, ctx.Mask, _ =3D self.VfrQuestionDB.GetQuestionId(None, ct= x.VarIdStr) return ctx.QId, ctx.Mask, ctx.VarIdStr =20 - # Visit a parse tree produced by VfrSyntaxParser#arrayName. - def visitArrayName(self, ctx:VfrSyntaxParser.ArrayNameContext): - + def visitArrayName(self, ctx: VfrSyntaxParser.ArrayNameContext): self.visitChildren(ctx) - ctx.SubStr +=3D self.__TransId(ctx.StringIdentifier()) - ctx.SubStrZ +=3D self.__TransId(ctx.StringIdentifier()) + ctx.SubStr +=3D self.TransId(ctx.StringIdentifier()) + ctx.SubStrZ +=3D self.TransId(ctx.StringIdentifier()) if ctx.N !=3D None: - Idx =3D self.__TransNum(ctx.N.text) + Idx =3D self.TransNum(ctx.N.text) if Idx > 0: - ctx.SubStr +=3D '[' + ctx.SubStr +=3D "[" ctx.SubStr +=3D str(Idx) - ctx.SubStr +=3D ']' + ctx.SubStr +=3D "]" =20 - ctx.SubStrZ +=3D '[' + ctx.SubStrZ +=3D "[" ctx.SubStrZ +=3D str(Idx) - ctx.SubStrZ +=3D ']' + ctx.SubStrZ +=3D "]" =20 return ctx.SubStr, ctx.SubStrZ =20 - # Visit a parse tree produced by VfrSyntaxParser#questionref1Exp. - def visitQuestionref1Exp(self, ctx:VfrSyntaxParser.Questionref1ExpCont= ext): - Line =3D ctx.start.line # - QName =3D None # + def visitQuestionref1Exp(self, ctx: VfrSyntaxParser.Questionref1ExpCon= text): + Line =3D ctx.start.line # + QName =3D None # QId =3D EFI_QUESTION_ID_INVALID self.visitChildren(ctx) if ctx.StringIdentifier() !=3D None: - QName =3D self.__TransId(ctx.StringIdentifier()) - QId, _ , _ =3D self.__CVfrQuestionDB.GetQuestionId(QName) + QName =3D self.TransId(ctx.StringIdentifier()) + QId, _, _ =3D self.VfrQuestionDB.GetQuestionId(QName) =20 elif ctx.Number() !=3D None: - QId =3D self.__TransNum(ctx.Number()) + QId =3D self.TransNum(ctx.Number()) + + QR1Obj =3D IfrQuestionRef1(Line) + self.SaveOpHdrCond(QR1Obj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) =20 - QR1Obj =3D CIfrQuestionRef1(Line) - self.__SaveOpHdrCond(QR1Obj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) QR1Obj.SetQuestionId(QId, QName, Line) + ctx.Node.Data =3D QR1Obj ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.ExpInfo - + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#rulerefExp. - def visitRulerefExp(self, ctx:VfrSyntaxParser.RulerefExpContext): + def visitRulerefExp(self, ctx: VfrSyntaxParser.RulerefExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - RRObj =3D CIfrRuleRef(Line) - self.__SaveOpHdrCond(RRObj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) - RuleId =3D self.__CVfrRulesDB.GetRuleId(self.__TransId(ctx.StringI= dentifier())) + RRObj =3D IfrRuleRef(Line) + self.SaveOpHdrCond(RRObj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) + RuleId =3D self.VfrRulesDB.GetRuleId(self.TransId(ctx.StringIdenti= fier())) RRObj.SetRuleId(RuleId) + ctx.Node.Data =3D RRObj ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.ExpInfo - + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#stringref1Exp. - def visitStringref1Exp(self, ctx:VfrSyntaxParser.Stringref1ExpContext)= : + def visitStringref1Exp(self, ctx: VfrSyntaxParser.Stringref1ExpContext= ): Line =3D ctx.start.line self.visitChildren(ctx) - RefStringId =3D self.__TransNum(ctx.Number()) - SR1Obj =3D CIfrStringRef1(Line) - self.__SaveOpHdrCond(SR1Obj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) + RefStringId =3D self.TransNum(ctx.Number()) + SR1Obj =3D IfrStringRef1(Line) + self.SaveOpHdrCond(SR1Obj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) SR1Obj.SetStringId(RefStringId) + ctx.Node.Data =3D SR1Obj ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.ExpInfo - + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#pushthisExp. - def visitPushthisExp(self, ctx:VfrSyntaxParser.PushthisExpContext): + def visitPushthisExp(self, ctx: VfrSyntaxParser.PushthisExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - TObj =3D CIfrThis(Line) - self.__SaveOpHdrCond(TObj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) + TObj =3D IfrThis(Line) + self.SaveOpHdrCond(TObj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) + ctx.Node.Data =3D TObj ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.ExpInfo + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#securityExp. - def visitSecurityExp(self, ctx:VfrSyntaxParser.SecurityExpContext): + def visitSecurityExp(self, ctx: VfrSyntaxParser.SecurityExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - SObj =3D CIfrSecurity(Line) - self.__SaveOpHdrCond(SObj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) + SObj =3D IfrSecurity(Line) + self.SaveOpHdrCond(SObj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) SObj.SetPermissions(ctx.guidDefinition().Guid) + ctx.Node.Data =3D SObj ctx.ExpInfo.ExpOpCount +=3D 1 =20 return ctx.ExpInfo =20 # Visit a parse tree produced by VfrSyntaxParser#numericVarStoreType. - def visitNumericVarStoreType(self, ctx:VfrSyntaxParser.NumericVarStore= TypeContext): + def visitNumericVarStoreType(self, ctx: VfrSyntaxParser.NumericVarStor= eTypeContext): self.visitChildren(ctx) if ctx.NumericSizeOne() !=3D None: ctx.VarType =3D EFI_IFR_NUMERIC_SIZE_1 @@ -4057,17 +4938,26 @@ class VfrSyntaxVisitor(ParseTreeVisitor): =20 return ctx.VarType =20 - # Visit a parse tree produced by VfrSyntaxParser#getExp. - def visitGetExp(self, ctx:VfrSyntaxParser.GetExpContext): + def visitGetExp(self, ctx: VfrSyntaxParser.GetExpContext): Line =3D ctx.start.line self.visitChildren(ctx) if ctx.BaseInfo.VarStoreId =3D=3D 0: # support Date/Time question VarIdStr =3D ctx.vfrStorageVarId().VarIdStr - QId, Mask, QType =3D self.__CVfrQuestionDB.GetQuestionId(None,= VarIdStr, EFI_QUESION_TYPE.QUESTION_NORMAL) - if (QId =3D=3D EFI_QUESTION_ID_INVALID) or (Mask =3D=3D 0) or = (QType =3D=3D EFI_QUESION_TYPE.QUESTION_NORMAL): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line, "Get/Set opcode can't get the enough varstore information") + QId, Mask, QType =3D self.VfrQuestionDB.GetQuestionId( + None, VarIdStr, EFI_QUESION_TYPE.QUESTION_NORMAL + ) + if ( + (QId =3D=3D EFI_QUESTION_ID_INVALID) + or (Mask =3D=3D 0) + or (QType =3D=3D EFI_QUESION_TYPE.QUESTION_NORMAL) + ): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + Line, + "Get/Set opcode can't get the enough varstore informat= ion", + ) if QType =3D=3D EFI_QUESION_TYPE.QUESTION_DATE: ctx.BaseInfo.VarType =3D EFI_IFR_TYPE_DATE elif QType =3D=3D EFI_QUESION_TYPE.QUESTION_TIME: @@ -4084,205 +4974,275 @@ class VfrSyntaxVisitor(ParseTreeVisitor): elif Mask =3D=3D TIME_SECOND_BITMASK: ctx.BaseInfo.VarOffset =3D 2 else: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line, "Get/Set opcode can't get the enough varstore information") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + Line, + "Get/Set opcode can't get the enough varstore informat= ion", + ) =20 else: VarType =3D EFI_IFR_TYPE_UNDEFINED if ctx.FLAGS() !=3D None: VarType =3D ctx.numericVarStoreType().VarType =20 - if (gCVfrDataStorage.GetVarStoreType(ctx.BaseInfo.VarStoreId) = =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_NAME) and (VarType =3D=3D EFI= _IFR_TYPE_UNDEFINED): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line, "Get/Set opcode don't support name string") + if ( + gVfrDataStorage.GetVarStoreType(ctx.BaseInfo.VarStoreId) + =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_NAME + ) and (VarType =3D=3D EFI_IFR_TYPE_UNDEFINED): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + Line, + "Get/Set opcode don't support name string", + ) =20 if VarType !=3D EFI_IFR_TYPE_UNDEFINED: ctx.BaseInfo.VarType =3D VarType - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSizeByD= ataType(ctx.BaseInfo.VarType) - self.__ErrorHandler(ReturnCode, Line, "Get/Set opcode can'= t get var type size") + Size, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSizeByDa= taType(ctx.BaseInfo.VarType) + self.ErrorHandler(ReturnCode, Line, "Get/Set opcode can't = get var type size") ctx.BaseInfo.VarTotalSize =3D Size =20 - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSizeByDataT= ype(ctx.BaseInfo.VarType) - self.__ErrorHandler(ReturnCode, Line, "Get/Set opcode can't ge= t var type size") + Size, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSizeByDataTy= pe(ctx.BaseInfo.VarType) + self.ErrorHandler(ReturnCode, Line, "Get/Set opcode can't get = var type size") =20 if Size !=3D ctx.BaseInfo.VarTotalSize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line, "Get/Set opcode don't support data array") - - ctx.GObj =3D CIfrGet(Line) - self.__SaveOpHdrCond(ctx.GObj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) - ctx.GObj.SetVarInfo(ctx.BaseInfo) + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + Line, + "Get/Set opcode don't support data array", + ) + + GObj =3D IfrGet(Line) + self.SaveOpHdrCond(GObj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) + GObj.SetVarInfo(ctx.BaseInfo) + ctx.Node.Data =3D GObj ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.GObj - + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrExpressionConstant= . - def visitVfrExpressionConstant(self, ctx:VfrSyntaxParser.VfrExpression= ConstantContext): + def visitVfrExpressionConstant(self, ctx: VfrSyntaxParser.VfrExpressio= nConstantContext): Line =3D ctx.start.line self.visitChildren(ctx) if ctx.TrueSymbol() !=3D None: - TObj =3D CIfrTrue(Line) - self.__SaveOpHdrCond(TObj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) + TObj =3D IfrTrue(Line) + self.SaveOpHdrCond(TObj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) + ctx.Node =3D IfrTreeNode(EFI_IFR_TRUE_OP, TObj) ctx.ExpInfo.ExpOpCount +=3D 1 =20 if ctx.FalseSymbol() !=3D None: - FObj =3D CIfrFalse(Line) - self.__SaveOpHdrCond(FObj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) + FObj =3D IfrFalse(Line) + self.SaveOpHdrCond(FObj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) + ctx.Node =3D IfrTreeNode(EFI_IFR_FALSE_OP, FObj) ctx.ExpInfo.ExpOpCount +=3D 1 =20 if ctx.One() !=3D None: - OObj =3D CIfrOne(Line) - self.__SaveOpHdrCond(OObj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) + OObj =3D IfrOne(Line) + self.SaveOpHdrCond(OObj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) + ctx.Node =3D IfrTreeNode(EFI_IFR_ONE_OP, OObj) ctx.ExpInfo.ExpOpCount +=3D 1 =20 if ctx.Ones() !=3D None: - OObj =3D CIfrOnes(Line) - self.__SaveOpHdrCond(OObj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) + OObj =3D IfrOnes(Line) + self.SaveOpHdrCond(OObj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) + ctx.Node =3D IfrTreeNode(EFI_IFR_ONES_OP, OObj) ctx.ExpInfo.ExpOpCount +=3D 1 =20 if ctx.Zero() !=3D None: - ZObj =3D CIfrZero(Line) - self.__SaveOpHdrCond(ZObj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) + ZObj =3D IfrZero(Line) + self.SaveOpHdrCond(ZObj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) + ctx.Node =3D IfrTreeNode(EFI_IFR_ZERO_OP, ZObj) ctx.ExpInfo.ExpOpCount +=3D 1 =20 if ctx.Undefined() !=3D None: - UObj =3D CIfrUndefined(Line) - self.__SaveOpHdrCond(UObj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) + UObj =3D IfrUndefined(Line) + self.SaveOpHdrCond(UObj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) + ctx.Node =3D IfrTreeNode(EFI_IFR_UNDEFINED_OP, UObj) ctx.ExpInfo.ExpOpCount +=3D 1 =20 if ctx.Version() !=3D None: - VObj =3D CIfrVersion(Line) - self.__SaveOpHdrCond(VObj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) + VObj =3D IfrVersion(Line) + self.SaveOpHdrCond(VObj.GetHeader(), (ctx.ExpInfo.ExpOpCount = =3D=3D 0), Line) + ctx.Node =3D IfrTreeNode(EFI_IFR_VERSION_OP, VObj) ctx.ExpInfo.ExpOpCount +=3D 1 =20 if ctx.Number() !=3D None: - U64Obj =3D CIfrUint64(Line) - U64Obj.SetValue(self.__TransNum(ctx.Number())) - self.__SaveOpHdrCond(U64Obj.GetHeader(), (ctx.ExpInfo.ExpOpCou= nt =3D=3D 0), Line) + U64Obj =3D IfrUint64(Line) + U64Obj.SetValue(self.TransNum(ctx.Number())) + self.SaveOpHdrCond(U64Obj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) + ctx.Node =3D IfrTreeNode(EFI_IFR_UINT64_OP, U64Obj) ctx.ExpInfo.ExpOpCount +=3D 1 =20 - return ctx.ExpInfo - + return ctx.Node =20 # Visit a parse tree produced by VfrSyntaxParser#vfrExpressionUnaryOp. - def visitVfrExpressionUnaryOp(self, ctx:VfrSyntaxParser.VfrExpressionU= naryOpContext): - return self.visitChildren(ctx) - + def visitVfrExpressionUnaryOp(self, ctx: VfrSyntaxParser.VfrExpression= UnaryOpContext): + self.visitChildren(ctx) + if ctx.lengthExp() !=3D None: + ctx.Nodes =3D ctx.lengthExp().Nodes + if ctx.bitwisenotExp() !=3D None: + ctx.Nodes =3D ctx.bitwisenotExp().Nodes + if ctx.question23refExp() !=3D None: + ctx.Nodes =3D ctx.question23refExp().Nodes + if ctx.stringref2Exp() !=3D None: + ctx.Nodes =3D ctx.stringref2Exp().Nodes + if ctx.toboolExp() !=3D None: + ctx.Nodes =3D ctx.toboolExp().Nodes + if ctx.tostringExp() !=3D None: + ctx.Nodes =3D ctx.tostringExp().Nodes + if ctx.unintExp() !=3D None: + ctx.Nodes =3D ctx.unintExp().Nodes + if ctx.toupperExp() !=3D None: + ctx.Nodes =3D ctx.toupperExp().Nodes + if ctx.tolwerExp() !=3D None: + ctx.Nodes =3D ctx.tolwerExp().Nodes + if ctx.setExp() !=3D None: + ctx.Nodes =3D ctx.setExp().Nodes + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#lengthExp. - def visitLengthExp(self, ctx:VfrSyntaxParser.LengthExpContext): + def visitLengthExp(self, ctx: VfrSyntaxParser.LengthExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.LObj =3D CIfrLength(Line) + LObj =3D IfrLength(Line) + Node =3D IfrTreeNode(EFI_IFR_LENGTH_OP, LObj, gFormPkg.StructToStr= eam(LObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.LObj + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#bitwisenotExp. - def visitBitwisenotExp(self, ctx:VfrSyntaxParser.BitwisenotExpContext)= : + def visitBitwisenotExp(self, ctx: VfrSyntaxParser.BitwisenotExpContext= ): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.BWNObj =3D CIfrBitWiseNot(Line) + BWNObj =3D IfrBitWiseNot(Line) + Node =3D IfrTreeNode( + EFI_IFR_BITWISE_NOT_OP, BWNObj, gFormPkg.StructToStream(BWNObj= .GetInfo()) + ) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.BWNObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#question23refExp. - def visitQuestion23refExp(self, ctx:VfrSyntaxParser.Question23refExpCo= ntext): + def visitQuestion23refExp(self, ctx: VfrSyntaxParser.Question23refExpC= ontext): Line =3D ctx.start.line Type =3D 0x1 DevicePath =3D EFI_STRING_ID_INVALID self.visitChildren(ctx) if ctx.DevicePath() !=3D None: Type =3D 0x2 - DevicePath =3D self.__TransNum(ctx.Number()) + DevicePath =3D self.TransNum(ctx.Number()) =20 if ctx.Uuid() !=3D None: Type =3D 0x3 =20 if Type =3D=3D 0x1: - QR2Obj =3D CIfrQuestionRef2(Line) - self.__SaveOpHdrCond(QR2Obj.GetHeader(), (ctx.ExpInfo.ExpOpCou= nt =3D=3D 0), Line) + QR2Obj =3D IfrQuestionRef2(Line) + self.SaveOpHdrCond(QR2Obj.GetHeader(), (ctx.ExpInfo.ExpOpCount= =3D=3D 0), Line) + Node =3D IfrTreeNode(EFI_IFR_QUESTION_REF2_OP, QR2Obj) + ctx.Nodes.append(Node) =20 if Type =3D=3D 0x2: - QR3_2Obj =3D CIfrQuestionRef3_2(Line) - self.__SaveOpHdrCond(QR3_2Obj.GetHeader(), (ctx.ExpInfo.ExpOpC= ount =3D=3D 0), Line) + QR3_2Obj =3D IfrQuestionRef3_2(Line) + self.SaveOpHdrCond(QR3_2Obj.GetHeader(), (ctx.ExpInfo.ExpOpCou= nt =3D=3D 0), Line) QR3_2Obj.SetDevicePath(DevicePath) + Node =3D IfrTreeNode(EFI_IFR_QUESTION_REF3_OP, QR3_2Obj) + ctx.Nodes.append(Node) =20 if Type =3D=3D 0x3: - QR3_3Obj =3D CIfrQuestionRef3_3(Line) - self.__SaveOpHdrCond(QR3_3Obj.GetHeader(), (ctx.ExpInfo.ExpOpC= ount =3D=3D 0), Line) + QR3_3Obj =3D IfrQuestionRef3_3(Line) + self.SaveOpHdrCond(QR3_3Obj.GetHeader(), (ctx.ExpInfo.ExpOpCou= nt =3D=3D 0), Line) QR3_3Obj.SetDevicePath(DevicePath) QR3_3Obj.SetGuid(ctx.guidDefinition().Guid) + Node =3D IfrTreeNode(EFI_IFR_QUESTION_REF3_OP, QR3_3Obj) + ctx.Nodes.append(Node) =20 ctx.ExpInfo.ExpOpCount +=3D 1 =20 - - return ctx.ExpInfo - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#stringref2Exp. - def visitStringref2Exp(self, ctx:VfrSyntaxParser.Stringref2ExpContext)= : + def visitStringref2Exp(self, ctx: VfrSyntaxParser.Stringref2ExpContext= ): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.SR2Obj =3D CIfrStringRef2(Line) + SR2Obj =3D IfrStringRef2(Line) + Node =3D IfrTreeNode( + EFI_IFR_STRING_REF2_OP, SR2Obj, gFormPkg.StructToStream(SR2Obj= .GetInfo()) + ) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.SR2Obj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#toboolExp. - def visitToboolExp(self, ctx:VfrSyntaxParser.ToboolExpContext): + def visitToboolExp(self, ctx: VfrSyntaxParser.ToboolExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.TBObj =3D CIfrToBoolean(Line) + TBObj =3D IfrToBoolean(Line) + Node =3D IfrTreeNode(EFI_IFR_TO_BOOLEAN_OP, TBObj, gFormPkg.Struct= ToStream(TBObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.TBObj + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#tostringExp. - def visitTostringExp(self, ctx:VfrSyntaxParser.TostringExpContext): + def visitTostringExp(self, ctx: VfrSyntaxParser.TostringExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.TSObj =3D CIfrToString(Line) - Fmt =3D self.__TransNum(ctx.Number()) - ctx.TSObj.SetFormat(Fmt) + TSObj =3D IfrToString(Line) + Fmt =3D self.TransNum(ctx.Number()) + TSObj.SetFormat(Fmt) + Node =3D IfrTreeNode(EFI_IFR_TO_STRING_OP, TSObj, gFormPkg.StructT= oStream(TSObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.TSObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#unintExp. - def visitUnintExp(self, ctx:VfrSyntaxParser.UnintExpContext): + def visitUnintExp(self, ctx: VfrSyntaxParser.UnintExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.TUObj =3D CIfrToUint(Line) + TUObj =3D IfrToUint(Line) + Node =3D IfrTreeNode(EFI_IFR_TO_UINT_OP, TUObj, gFormPkg.StructToS= tream(TUObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.TUObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#toupperExp. - def visitToupperExp(self, ctx:VfrSyntaxParser.ToupperExpContext): + def visitToupperExp(self, ctx: VfrSyntaxParser.ToupperExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.TUObj =3D CIfrToUpper(Line) + TUObj =3D IfrToUpper(Line) + Node =3D IfrTreeNode(EFI_IFR_TO_UPPER_OP, TUObj, gFormPkg.StructTo= Stream(TUObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.TUObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#tolwerExp. - def visitTolwerExp(self, ctx:VfrSyntaxParser.TolwerExpContext): + def visitTolwerExp(self, ctx: VfrSyntaxParser.TolwerExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.TLObj =3D CIfrToLower(Line) + TLObj =3D IfrToLower(Line) + Node =3D IfrTreeNode(EFI_IFR_TO_LOWER_OP, TLObj, gFormPkg.StructTo= Stream(TLObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.TLObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#setExp. - def visitSetExp(self, ctx:VfrSyntaxParser.SetExpContext): + def visitSetExp(self, ctx: VfrSyntaxParser.SetExpContext): Line =3D ctx.start.line self.visitChildren(ctx) if ctx.BaseInfo.VarStoreId =3D=3D 0: # support Date/Time question VarIdStr =3D ctx.vfrStorageVarId().VarIdStr - QId, Mask, QType =3D self.__CVfrQuestionDB.GetQuestionId(None,= VarIdStr, EFI_QUESION_TYPE.QUESTION_NORMAL) - if (QId =3D=3D EFI_QUESTION_ID_INVALID) or (Mask =3D=3D 0) or = (QType =3D=3D EFI_QUESION_TYPE.QUESTION_NORMAL): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line, "Get/Set opcode can't get the enough varstore information") + QId, Mask, QType =3D self.VfrQuestionDB.GetQuestionId( + None, VarIdStr, EFI_QUESION_TYPE.QUESTION_NORMAL + ) + if ( + (QId =3D=3D EFI_QUESTION_ID_INVALID) + or (Mask =3D=3D 0) + or (QType =3D=3D EFI_QUESION_TYPE.QUESTION_NORMAL) + ): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + Line, + "Get/Set opcode can't get the enough varstore informat= ion", + ) if QType =3D=3D EFI_QUESION_TYPE.QUESTION_DATE: ctx.BaseInfo.VarType =3D EFI_IFR_TYPE_DATE elif QType =3D=3D EFI_QUESION_TYPE.QUESTION_TIME: @@ -4299,66 +5259,91 @@ class VfrSyntaxVisitor(ParseTreeVisitor): elif Mask =3D=3D TIME_SECOND_BITMASK: ctx.BaseInfo.VarOffset =3D 2 else: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line, "Get/Set opcode can't get the enough varstore information") + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + Line, + "Get/Set opcode can't get the enough varstore informat= ion", + ) =20 else: VarType =3D EFI_IFR_TYPE_UNDEFINED if ctx.FLAGS() !=3D None: VarType =3D ctx.numericVarStoreType().VarType =20 - if (gCVfrDataStorage.GetVarStoreType(ctx.BaseInfo.VarStoreId) = =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_NAME) and (VarType =3D=3D EFI= _IFR_TYPE_UNDEFINED): - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line, "Get/Set opcode don't support name string") + if ( + gVfrDataStorage.GetVarStoreType(ctx.BaseInfo.VarStoreId) + =3D=3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_NAME + ) and (VarType =3D=3D EFI_IFR_TYPE_UNDEFINED): + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + Line, + "Get/Set opcode don't support name string", + ) =20 if VarType !=3D EFI_IFR_TYPE_UNDEFINED: ctx.BaseInfo.VarType =3D VarType - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSizeByD= ataType(ctx.BaseInfo.VarType) - self.__ErrorHandler(ReturnCode, Line, "Get/Set opcode can'= t get var type size") + Size, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSizeByDa= taType(ctx.BaseInfo.VarType) + self.ErrorHandler(ReturnCode, Line, "Get/Set opcode can't = get var type size") ctx.BaseInfo.VarTotalSize =3D Size =20 - Size, ReturnCode =3D gCVfrVarDataTypeDB.GetDataTypeSizeByDataT= ype(ctx.BaseInfo.VarType) - self.__ErrorHandler(ReturnCode, Line, "Get/Set opcode can't ge= t var type size") + Size, ReturnCode =3D gVfrVarDataTypeDB.GetDataTypeSizeByDataTy= pe(ctx.BaseInfo.VarType) + self.ErrorHandler(ReturnCode, Line, "Get/Set opcode can't get = var type size") =20 if Size !=3D ctx.BaseInfo.VarTotalSize: - self.__ErrorHandler(VfrReturnCode.VFR_RETURN_UNSUPPORTED, = Line, "Get/Set opcode don't support data array") - - ctx.TSObj =3D CIfrSet(Line) - self.__SaveOpHdrCond(ctx.TSObj.GetHeader(), (ctx.ExpInfo.ExpOpCoun= t =3D=3D 0), Line) - ctx.TSObj.SetVarInfo(ctx.BaseInfo) + self.ErrorHandler( + VfrReturnCode.VFR_RETURN_UNSUPPORTED, + Line, + "Get/Set opcode don't support data array", + ) + + TSObj =3D IfrSet(Line) + self.SaveOpHdrCond(TSObj.GetHeader(), (ctx.ExpInfo.ExpOpCount =3D= =3D 0), Line) + TSObj.SetVarInfo(ctx.BaseInfo) + Node =3D IfrTreeNode(EFI_IFR_SET_OP, TSObj) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - - return ctx.TSObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#vfrExpressionTernaryO= p. - def visitVfrExpressionTernaryOp(self, ctx:VfrSyntaxParser.VfrExpressio= nTernaryOpContext): - return self.visitChildren(ctx) - + def visitVfrExpressionTernaryOp(self, ctx: VfrSyntaxParser.VfrExpressi= onTernaryOpContext): + self.visitChildren(ctx) + if ctx.conditionalExp() !=3D None: + ctx.Nodes =3D ctx.conditionalExp().Nodes + if ctx.findExp() !=3D None: + ctx.Nodes =3D ctx.findExp().Nodes + if ctx.midExp() !=3D None: + ctx.Nodes =3D ctx.midExp().Nodes + if ctx.tokenExp() !=3D None: + ctx.Nodes =3D ctx.tokenExp().Nodes + if ctx.spanExp() !=3D None: + ctx.Nodes =3D ctx.spanExp().Nodes + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#conditionalExp. - def visitConditionalExp(self, ctx:VfrSyntaxParser.ConditionalExpContex= t): + def visitConditionalExp(self, ctx: VfrSyntaxParser.ConditionalExpConte= xt): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.CObj =3D CIfrConditional(Line) + CObj =3D IfrConditional(Line) + Node =3D IfrTreeNode(EFI_IFR_CONDITIONAL_OP, CObj, gFormPkg.Struct= ToStream(CObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.CObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#findExp. - def visitFindExp(self, ctx:VfrSyntaxParser.FindExpContext): + def visitFindExp(self, ctx: VfrSyntaxParser.FindExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - FObj =3D CIfrFind(Line) - Format =3D 0 + FObj =3D IfrFind(Line) for i in range(0, len(ctx.findFormat())): Format =3D ctx.findFormat(i).Format - - FObj.SetFormat(Format) + FObj.SetFormat(Format) + Node =3D IfrTreeNode(EFI_IFR_FIND_OP, FObj, gFormPkg.StructToStrea= m(FObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return FObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#findFormat. - def visitFindFormat(self, ctx:VfrSyntaxParser.FindFormatContext): + def visitFindFormat(self, ctx: VfrSyntaxParser.FindFormatContext): self.visitChildren(ctx) if ctx.Sensitive() !=3D None: ctx.Format =3D 0x00 @@ -4366,741 +5351,154 @@ class VfrSyntaxVisitor(ParseTreeVisitor): ctx.Format =3D 0x01 return ctx.Format =20 - # Visit a parse tree produced by VfrSyntaxParser#midExp. - def visitMidExp(self, ctx:VfrSyntaxParser.MidExpContext): + def visitMidExp(self, ctx: VfrSyntaxParser.MidExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.MObj =3D CIfrMid(Line) + MObj =3D IfrMid(Line) + Node =3D IfrTreeNode(EFI_IFR_MID_OP, MObj, gFormPkg.StructToStream= (MObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.MObj + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#tokenExp. - def visitTokenExp(self, ctx:VfrSyntaxParser.TokenExpContext): + def visitTokenExp(self, ctx: VfrSyntaxParser.TokenExpContext): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.TObj =3D CIfrToken(Line) + TObj =3D IfrToken(Line) + Node =3D IfrTreeNode(EFI_IFR_TOKEN_OP, TObj, gFormPkg.StructToStre= am(TObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.TObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#spanExp. - def visitSpanExp(self, ctx:VfrSyntaxParser.SpanExpContext): + def visitSpanExp(self, ctx: VfrSyntaxParser.SpanExpContext): Line =3D ctx.start.line Flags =3D 0 self.visitChildren(ctx) for FlagsCtx in ctx.spanFlags(): Flags |=3D FlagsCtx.Flag - ctx.SObj =3D CIfrSpan(Line) - ctx.SObj.SetFlags(Flags) + SObj =3D IfrSpan(Line) + SObj.SetFlags(Flags) + Node =3D IfrTreeNode(EFI_IFR_SPAN_OP, SObj, gFormPkg.StructToStrea= m(SObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.SObj - + return ctx.Nodes =20 # Visit a parse tree produced by VfrSyntaxParser#spanFlags. - def visitSpanFlags(self, ctx:VfrSyntaxParser.SpanFlagsContext): + def visitSpanFlags(self, ctx: VfrSyntaxParser.SpanFlagsContext): self.visitChildren(ctx) if ctx.Number() !=3D None: - ctx.Flag =3D self.__TransNum(ctx.Number()) + ctx.Flag =3D self.TransNum(ctx.Number()) elif ctx.LastNonMatch() !=3D None: ctx.Flag =3D 0x00 elif ctx.FirstNonMatch() !=3D None: ctx.Flag =3D 0x01 return ctx.Flag =20 - # Visit a parse tree produced by VfrSyntaxParser#vfrExpressionMap. - def visitVfrExpressionMap(self, ctx:VfrSyntaxParser.VfrExpressionMapCo= ntext): + def visitVfrExpressionMap(self, ctx: VfrSyntaxParser.VfrExpressionMapC= ontext): Line =3D ctx.start.line self.visitChildren(ctx) - ctx.MObj =3D CIfrMap(Line) - EObj =3D CIfrEnd() - Line =3D (None if ctx.stop is None else ctx.stop).line - EObj.SetLineNo(Line) + MObj =3D IfrMap(Line) + Node =3D IfrTreeNode(EFI_IFR_MAP_OP, MObj, gFormPkg.StructToStream= (MObj.GetInfo())) + ctx.Nodes.append(Node) + for Node in ctx.Node.Child: + ctx.Nodes.append(Node) + EObj =3D IfrEnd() + EObj.SetLineNo(ctx.stop.line) + Node =3D IfrTreeNode(EFI_IFR_END_OP, EObj, gFormPkg.StructToStream= (EObj.GetInfo())) + ctx.Nodes.append(Node) ctx.ExpInfo.ExpOpCount +=3D 1 - return ctx.MObj + return ctx.Nodes =20 - def __GetText(self, ctx): + def GetText(self, ctx): if ctx =3D=3D None: return None else: return ctx.text =20 - def __TransId(self, StringIdentifierToken, DefaultValue=3DNone): + def TransId(self, StringIdentifierToken, DefaultValue=3DNone): if StringIdentifierToken =3D=3D None: return DefaultValue else: return str(StringIdentifierToken) =20 - def __TransNum(self, NumberToken, DefaultValue=3D0): + def TransNum(self, NumberToken, DefaultValue=3D0): if NumberToken =3D=3D None: return DefaultValue else: StrToken =3D str(NumberToken) - if '0x' in StrToken: - NumberToken =3D int(StrToken, 0) + if StrToken.startswith("0x") or StrToken.startswith("0X"): + NumberToken =3D int(StrToken, 16) else: NumberToken =3D int(StrToken) - # error handle , value is too large to store return NumberToken =20 - def __AssignQuestionKey(self, OpObj, Key): - + def AssignQuestionKey(self, OpObj, Key): if Key =3D=3D None: return - if OpObj.GetFlags() & EFI_IFR_FLAG_CALLBACK: + + if OpObj.GetQFlags() & EFI_IFR_FLAG_CALLBACK: # if the question is not CALLBACK ignore the key. - self.__CVfrQuestionDB.UpdateQuestionId(OpObj.GetQuestionId(), = Key) + self.VfrQuestionDB.UpdateQuestionId(OpObj.GetQuestionId(), Key= , gFormPkg) OpObj.SetQuestionId(Key) return =20 - def __ExtractOriginalText(self, ctx): + def ExtractOriginalText(self, ctx): Source =3D ctx.start.getTokenSource() InputStream =3D Source.inputStream - start, stop =3D ctx.start.start, ctx.stop.stop + start, stop =3D ctx.start.start, ctx.stop.stop Text =3D InputStream.getText(start, stop) - return Text.replace('\n', '') + return Text.replace("\r", "").replace("\n", "").replace(" ", " ") =20 - def __CheckDuplicateDefaultValue(self, DefaultId, Line, TokenValue): - for i in range(0, len(self.__UsedDefaultArray)): - if self.__UsedDefaultArray[i] =3D=3D DefaultId: - gCVfrErrorHandle.HandleWarning(EFI_VFR_WARNING_CODE.VFR_WA= RNING_DEFAULT_VALUE_REDEFINED, Line, TokenValue) + def CheckDuplicateDefaultValue(self, DefaultId, Line, TokenValue): + for i in range(0, len(self.UsedDefaultArray)): + if self.UsedDefaultArray[i] =3D=3D DefaultId: + gVfrErrorHandle.HandleWarning( + EFI_VFR_WARNING_CODE.VFR_WARNING_DEFAULT_VALUE_REDEFIN= ED, Line, TokenValue + ) =20 - if len(self.__UsedDefaultArray) >=3D EFI_IFR_MAX_DEFAULT_TYPE - 1: - gCVfrErrorHandle.HandleError(VfrReturnCode.VFR_RETURN_FATAL_ER= ROR, Line, TokenValue) + if len(self.UsedDefaultArray) >=3D EFI_IFR_MAX_DEFAULT_TYPE - 1: + gVfrErrorHandle.HandleError(VfrReturnCode.VFR_RETURN_FATAL_ERR= OR, Line, TokenValue) =20 - self.__UsedDefaultArray.append(DefaultId) + self.UsedDefaultArray.append(DefaultId) =20 - def __ErrorHandler(self, ReturnCode, LineNum, TokenValue=3DNone): - self.__ParserStatus +=3D gCVfrErrorHandle.HandleError(ReturnCode, = LineNum, TokenValue) + def ErrorHandler(self, ReturnCode, LineNum, TokenValue=3DNone): + self.ParserStatus +=3D gVfrErrorHandle.HandleError(ReturnCode, Lin= eNum, TokenValue) =20 - def __CompareErrorHandler(self, ReturnCode, ExpectedCode, LineNum, Tok= enValue=3DNone, ErrorMsg=3DNone): + def CompareErrorHandler( + self, ReturnCode, ExpectedCode, LineNum, TokenValue=3DNone, ErrorM= sg=3DNone + ): if ReturnCode !=3D ExpectedCode: - self.__ParserStatus +=3D 1 - gCVfrErrorHandle.PrintMsg(LineNum, 'Error', ErrorMsg, TokenVal= ue) + self.ParserStatus +=3D 1 + gVfrErrorHandle.PrintMsg(LineNum, "Error", ErrorMsg, TokenValu= e) =20 - def __InsertChild(self, ParentNode: VfrTreeNode, ChildCtx): + def InsertChild(self, ParentNode: IfrTreeNode, ChildCtx): if ChildCtx !=3D None and ChildCtx.Node !=3D None: ParentNode.insertChild(ChildCtx.Node) =20 - def GetRoot(self): - return self.__Root + def InsertEndNode(self, ParentNode, Line): + EObj =3D IfrEnd() + EObj.SetLineNo(Line) + ENode =3D IfrTreeNode(EFI_IFR_END_OP, EObj, gFormPkg.StructToStrea= m(EObj.GetInfo())) + ParentNode.insertChild(ENode) =20 - def GetQuestionDB(self): - return self.__CVfrQuestionDB - - def DumpJson(self, FileName): - try: - with open(FileName, 'w') as f: - f.write('{\n') - f.write(' \"DataStruct\" : {\n') - pNode =3D gCVfrVarDataTypeDB.GetDataTypeList() - while pNode !=3D None: - f.write(' \"{}\" : [\n'.format(str(pNode.TypeName))= ) - FNode =3D pNode.Members - while FNode !=3D None: - f.write(' {\n') - f.write(' \"Name\": \"{}\",\n'.format(str(F= Node.FieldName))) - if FNode.ArrayNum > 0: - f.write(' \"Type\": \"{}[{}]\",\n'.form= at(str(FNode.FieldType.TypeName),str(FNode.ArrayNum))) - else: - f.write(' \"Type\": \"{}\",\n'.format(s= tr(FNode.FieldType.TypeName))) - f.write(' \"Offset\": {}\n'.format(str(FNod= e.Offset))) - if FNode.Next =3D=3D None: - f.write(' }\n') - else: - f.write(' }, \n') - FNode =3D FNode.Next - if pNode.Next =3D=3D None: - f.write(' ]\n') - else: - f.write(' ],\n') - pNode =3D pNode.Next - f.write(' },\n') - f.write(' \"DataStructAttribute\": {\n') - pNode =3D gCVfrVarDataTypeDB.GetDataTypeList() - while pNode !=3D None: - f.write(' \"{}\"'.format(str(pNode.TypeName)) + ': = {\n') - f.write(' \"Alignment\": {},\n'.format(str(pNod= e.Align))) - f.write(' \"TotalSize\": {}\n'.format(str(pNode= .TotalSize))) - if pNode.Next =3D=3D None: - f.write(' }\n') - else: - f.write(' },\n') - pNode =3D pNode.Next - f.write(' },\n') - f.write(' \"VarDefine\" : {\n') - pVsNode =3D gCVfrDataStorage.GetBufferVarStoreList() - while pVsNode !=3D None: - f.write(' \"{}\"'.format(str(pVsNode.VarStoreName))= + ': {\n') - f.write(' \"Type\": \"{}\",\n'.format(str(pVsNo= de.DataType.TypeName))) - f.write(' \"Attributes\": {},\n'.format(str(pVs= Node.Attributes))) - f.write(' \"VarStoreId\": {},\n'.format(str(pVs= Node.VarStoreId))) - f.write(' \"VendorGuid\": ' + '\"{}, {}, {},'.f= ormat('0x%x'%(pVsNode.Guid.Data1),'0x%x'%(pVsNode.Guid.Data2), '0x%x'%(pVsN= ode.Guid.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(pVsNode.Guid.Data4[0]), '0x%x'%(pVsNode.Guid.Data4[1]), '0x%x'%(pVsNod= e.Guid.Data4[2]), '0x%x'%(pVsNode.Guid.Data4[3]), \ - '0x%x'%(pVsNode.Guid.Data4[4]), '0x%x'%(pVsNode.Guid.D= ata4[5]), '0x%x'%(pVsNode.Guid.Data4[6]), '0x%x'%(pVsNode.Guid.Data4[7])) += ' }}\"\n') - if pVsNode.Next =3D=3D None: - f.write(' }\n') - else: - f.write(' },\n') - - pVsNode =3D pVsNode.Next - f.write(' },\n') - f.write(' \"Data\" : [\n') - pVsNode =3D gCVfrBufferConfig.GetVarItemList() - while pVsNode !=3D None: - if pVsNode.Id =3D=3D None: - pVsNode =3D pVsNode.Next - continue - pInfoNode =3D pVsNode.InfoStrList - while pInfoNode !=3D None: - f.write(' {\n') - f.write(' \"VendorGuid\": ' + '\"{}, {}, {}= ,'.format('0x%x'%(pVsNode.Guid.Data1),'0x%x'%(pVsNode.Guid.Data2), '0x%x'%(= pVsNode.Guid.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format= ('0x%x'%(pVsNode.Guid.Data4[0]), '0x%x'%(pVsNode.Guid.Data4[1]), '0x%x'%(pV= sNode.Guid.Data4[2]), '0x%x'%(pVsNode.Guid.Data4[3]), \ - '0x%x'%(pVsNode.Guid.Data4[4]), '0x%x'%(pVsNode.Gu= id.Data4[5]), '0x%x'%(pVsNode.Guid.Data4[6]), '0x%x'%(pVsNode.Guid.Data4[7]= )) + ' }}\",\n') - f.write(' \"VarName\": \"{}\",\n'.format(st= r(pVsNode.Name))) - f.write(' \"DefaultStore\": \"{}\",\n'.form= at(str(pVsNode.Id))) - f.write(' \"Size\": {},\n'.format(str(pInfo= Node.Width))) - f.write(' \"Offset\": {},\n'.format(str(pIn= foNode.Offset))) - #f.write(' \"Value\": \"{}\"\n'.format(str(= pInfoNode.Value))) - if pInfoNode.Type =3D=3D EFI_IFR_TYPE_DATE: - f.write(' \"Value\": \"{}/{}/{}\"\n'.fo= rmat(pInfoNode.Value.date.Year, pInfoNode.Value.date.Month, pInfoNode.Value= .date.Day)) - if pInfoNode.Type =3D=3D EFI_IFR_TYPE_TIME: - f.write(' \"Value\": \"{}:{}:{}\"\n'.fo= rmat(pInfoNode.Value.time.Hour, pInfoNode.Value.time.Minute, pInfoNode.Valu= e.time.Second)) - if pInfoNode.Type =3D=3D EFI_IFR_TYPE_REF: - f.write(' \"Value\": \"{};{};'.format(p= InfoNode.Value.ref.QuestionId, pInfoNode.Value.ref.FormId) + '{' + '{}, {}= , {},'.format('0x%x'%(pInfoNode.Value.ref.FormSetGuid.Data1),'0x%x'%(pInfoN= ode.Value.ref.FormSetGuid.Data2), '0x%x'%(pInfoNode.Value.ref.FormSetGuid.D= ata3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.fo= rmat('0x%x'%(pInfoNode.Value.ref.FormSetGuid.Data4[0]), '0x%x'%(pInfoNode.V= alue.ref.FormSetGuid.Data4[1]), '0x%x'%(pInfoNode.Value.ref.FormSetGuid.Dat= a4[2]), '0x%x'%(pInfoNode.Value.ref.FormSetGuid.Data4[3]), \ - '0x%x'%(pInfoNode.Value.ref.FormSetGuid.Data4[= 4]), '0x%x'%(pInfoNode.Value.ref.FormSetGuid.Data4[5]), '0x%x'%(pInfoNode.V= alue.ref.FormSetGuid.Data4[6]), '0x%x'%(pInfoNode.Value.ref.FormSetGuid.Dat= a4[7])) + ' }}' + ';{}\n'.format(pInfoNode.Value.ref.DevicePath)) - if pInfoNode.Type =3D=3D EFI_IFR_TYPE_STRING: - f.write(' \"Value\": \"{}\"\n'.format(p= InfoNode.Value.string)) - if pInfoNode.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - f.write(' \"Value\": \"{}\"\n'.format(h= ex(pInfoNode.Value.u8))) - if pInfoNode.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - f.write(' \"Value\": \"{}\"\n'.format(h= ex(pInfoNode.Value.u16))) - if pInfoNode.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - f.write(' \"Value\": \"{}\"\n'.format(h= ex(pInfoNode.Value.u32))) - if pInfoNode.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - f.write(' \"Value\": \"{}\"\n'.format(h= ex(pInfoNode.Value.u64))) - if pInfoNode.Type =3D=3D EFI_IFR_TYPE_BOOLEAN: - f.write(' \"Value\": \"{}\"\n'.format(h= ex(pInfoNode.Value.b))) - - f.write(' },\n') - pInfoNode =3D pInfoNode.Next - pVsNode =3D pVsNode.Next - f.write(' {\n') - f.write(' \"VendorGuid\": \"NA\",\n') - f.write(' \"VarName\": \"NA\",\n') - f.write(' \"DefaultStore\": \"NA\",\n') - f.write(' \"Size\": 0,\n') - f.write(' \"Offset\": 0,\n') - f.write(' \"Value\": \"0x00\"\n') - f.write(' }\n') - f.write(' ]\n') - f.write('}\n') - - f.close() - except: - EdkLogger.error("VfrCompiler", FILE_OPEN_FAILURE, "File open f= ailed for %s" % FileName, None) - - def DumpYaml(self, Root, FileName): - try: - with open(FileName, 'w') as f: - f.write('## DO NOT REMOVE -- VFR Mode\n') - self.DumpYamlDfs(Root, f) - f.close() - except: - EdkLogger.error("VfrCompiler", FILE_OPEN_FAILURE, "File open f= ailed for %s" % FileName, None) - - def DumpYamlDfs(self, Root, f): - - if Root.OpCode !=3D None: - - if Root.OpCode =3D=3D EFI_IFR_FORM_SET_OP: - Info =3D Root.Data.GetInfo() - f.write('Formset:\n') - f.write(' Guid: {' + '{}, {}, {},'.format('0x%x'%(Info.G= uid.Data1),'0x%x'%(Info.Guid.Data2), '0x%x'%(Info.Guid.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(Info.Guid.Data4[0]), '0x%x'%(Info.Guid.Data4[1]), '0x%x'%(Info.Guid.Da= ta4[2]), '0x%x'%(Info.Guid.Data4[3]), \ - '0x%x'%(Info.Guid.Data4[4]), '0x%x'%(Info.Guid.Data4[5= ]), '0x%x'%(Info.Guid.Data4[6]), '0x%x'%(Info.Guid.Data4[7])) + ' }}\n') - f.write(' Title: {} # Title STRING_ID\n'.format(Info.Fo= rmSetTitle)) - f.write(' Help: {} # Help STRING_ID\n'.format(Info.Help= )) - for Guid in Root.Data.GetClassGuid(): - f.write(' ClassGuid: {' + '{}, {}, {},'.format('0x%x= '%(Guid.Data1),'0x%x'%(Guid.Data2), '0x%x'%(Guid.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(Guid.Data4[0]), '0x%x'%(Guid.Data4[1]), '0x%x'%(Guid.Data4[2]), '0x%x'= %(Guid.Data4[3]), \ - '0x%x'%(Guid.Data4[4]), '0x%x'%(Guid.Data4[5]), '0x%x'= %(Guid.Data4[6]), '0x%x'%(Guid.Data4[7])) + ' }}\n') - - if Root.OpCode =3D=3D EFI_IFR_VARSTORE_OP: - Info =3D Root.Data.GetInfo() - f.write(' - varstore:\n') - f.write(' varid: {}\n'.format(Info.VarStoreId)) - f.write(' name: {}\n'.format(Info.Name)) - f.write(' size: {}\n'.format(Info.Size)) - f.write(' guid: {' + '{}, {}, {},'.format('0x%x'%(In= fo.Guid.Data1),'0x%x'%(Info.Guid.Data2), '0x%x'%(Info.Guid.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(Info.Guid.Data4[0]), '0x%x'%(Info.Guid.Data4[1]), '0x%x'%(Info.Guid.Da= ta4[2]), '0x%x'%(Info.Guid.Data4[3]), \ - '0x%x'%(Info.Guid.Data4[4]), '0x%x'%(Info.Guid.Data4[5= ]), '0x%x'%(Info.Guid.Data4[6]), '0x%x'%(Info.Guid.Data4[7])) + ' }}\n') - - if Root.OpCode =3D=3D EFI_IFR_VARSTORE_EFI_OP: - Info =3D Root.Data.GetInfo() - f.write(' - efivarstore:\n') - f.write(' varid: {}\n'.format(Info.VarStoreId)) - f.write(' name: {}\n'.format(Info.Name)) - f.write(' size: {}\n'.format(Info.Size)) - f.write(' guid: {' + '{}, {}, {},'.format('0x%x'%(In= fo.Guid.Data1),'0x%x'%(Info.Guid.Data2), '0x%x'%(Info.Guid.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(Info.Guid.Data4[0]), '0x%x'%(Info.Guid.Data4[1]), '0x%x'%(Info.Guid.Da= ta4[2]), '0x%x'%(Info.Guid.Data4[3]), \ - '0x%x'%(Info.Guid.Data4[4]), '0x%x'%(Info.Guid.Data4[5= ]), '0x%x'%(Info.Guid.Data4[6]), '0x%x'%(Info.Guid.Data4[7])) + ' }}\n') - f.write(' attribute: {}\n'.format(Info.Attributes)) - - if Root.OpCode =3D=3D EFI_IFR_VARSTORE_NAME_VALUE_OP: - Info =3D Root.Data.GetInfo() - f.write(' - namevaluevarstore:\n') - f.write(' varid: {}\n'.format(Info.VarStoreId)) - # f.write(' name: {}\n'.format(Info.Name)) - f.write(' guid: {' + '{}, {}, {},'.format('0x%x'%(In= fo.Guid.Data1),'0x%x'%(Info.Guid.Data2), '0x%x'%(Info.Guid.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(Info.Guid.Data4[0]), '0x%x'%(Info.Guid.Data4[1]), '0x%x'%(Info.Guid.Da= ta4[2]), '0x%x'%(Info.Guid.Data4[3]), \ - '0x%x'%(Info.Guid.Data4[4]), '0x%x'%(Info.Guid.Data4[5= ]), '0x%x'%(Info.Guid.Data4[6]), '0x%x'%(Info.Guid.Data4[7])) + ' }}\n') - - if Root.OpCode =3D=3D EFI_IFR_FORM_OP: - Info =3D Root.Data.GetInfo() - f.write(' - form:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condition= )) - f.write(' FormId: {} # FormId STRING_ID\n'.format(I= nfo.FormId)) - f.write(' FormTitle: {} # FormTitle STRING_ID\n'.fo= rmat(Info.FormTitle)) - - if Root.OpCode =3D=3D EFI_IFR_FORM_MAP_OP: - Info, MethodMapList =3D Root.Data.GetInfo() - f.write(' - formmap:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condition= )) - f.write(' FormId: {} # FormId STRING_ID\n'.format(I= nfo.FormId)) - for MethodMap in MethodMapList: - f.write(' maptitle: {}\n'.format(MethodMap.Metho= dTitle)) - f.write(' mapguid: {' + '{}, {}, {},'.format('0x= %x'%(MethodMap.MethodIdentifier.Data1),'0x%x'%(MethodMap.MethodIdentifier.D= ata2), '0x%x'%(MethodMap.MethodIdentifier.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(MethodMap.MethodIdentifier.Data4[0]), '0x%x'%(MethodMap.MethodIdentifi= er.Data4[1]), '0x%x'%(MethodMap.MethodIdentifier.Data4[2]), '0x%x'%(MethodM= ap.MethodIdentifier.Data4[3]), \ - '0x%x'%(MethodMap.MethodIdentifier.Data4[4]), '0x%x'%(= MethodMap.MethodIdentifier.Data4[5]), '0x%x'%(MethodMap.MethodIdentifier.Da= ta4[6]), '0x%x'%(MethodMap.MethodIdentifier.Data4[7])) + ' }}\n') - - if Root.OpCode =3D=3D EFI_IFR_IMAGE_OP: - Info =3D Root.Data.GetInfo() - f.write(' - image:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' Id: {} # ImageId\n'.format(Info.Id)) - - if Root.OpCode =3D=3D EFI_IFR_RULE_OP: - Info =3D Root.Data.GetInfo() - f.write(' - rule:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' RuleId: {} # RuleId\n'.format(Info.Rul= eId)) - - if Root.OpCode =3D=3D EFI_IFR_SUBTITLE_OP: - Info =3D Root.Data.GetInfo() - f.write(' - subtitle:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Statement.Prompt)) - - if Root.OpCode =3D=3D EFI_IFR_TEXT_OP: - Info =3D Root.Data.GetInfo() - f.write(' - text:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Statement.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Statement.Help)) - f.write(' text: {} # Statement Help STRING_ID\n= '.format(Info.TextTwo)) - - if Root.OpCode =3D=3D EFI_IFR_ACTION_OP: - Info =3D Root.Data.GetInfo() - f.write(' - action:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Question.Header.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Question.Header.Help)) - f.write(' questionid: {} # Question QuestionId\= n'.format(Info.Question.QuestionId)) - f.write(' varstoreid: {} # Question VarStoreId\= n'.format(Info.Question.VarStoreId)) - f.write(' flags: {} # Question Flags\n'.format(= Info.Question.Flags)) - f.write(' questionconfig: {} # QuestionConfig\n= '.format(Info.QuestionConfig)) - - if Root.OpCode =3D=3D EFI_IFR_ONE_OF_OP: - Info =3D Root.Data.GetInfo() - f.write(' - oneof:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Question.Header.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Question.Header.Help)) - f.write(' questionid: {} # Question QuestionId\= n'.format(Info.Question.QuestionId)) - f.write(' varstoreid: {} # Question VarStoreId\= n'.format(Info.Question.VarStoreId)) - f.write(' varname: {} # Question VarName STRING= _ID\n'.format(Info.Question.VarStoreInfo.VarName)) - f.write(' varoffset: {} # Question VarOffset\n'= .format(Info.Question.VarStoreInfo.VarOffset)) - f.write(' flags: {} # Question Flags\n'.format(= Info.Question.Flags)) - - if Root.OpCode =3D=3D EFI_IFR_ONE_OF_OPTION_OP: - Info =3D Root.Data.GetInfo() - f.write(' - option: {}\n'.format(Info.Option)) - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - - f.write(' option flag: {}\n'.format(Info.Fla= gs)) - f.write(' option type: {}\n'.format(Info.Typ= e)) - - if type(Root.Data) =3D=3D CIfrOneOfOption: - if Info.Type =3D=3D EFI_IFR_TYPE_DATE: - f.write(' option value: {}/{}/{}\n'.= format(Info.Value.date.Year, Info.Value.date.Month, Info.Value.date.Day)) - if Info.Type =3D=3D EFI_IFR_TYPE_TIME: - f.write(' option value: {}:{}:{}\n'.= format(Info.Value.time.Hour, Info.Value.time.Minute, Info.Value.time.Second= )) - if Info.Type =3D=3D EFI_IFR_TYPE_REF: - f.write(' option value: {};{};'.form= at(Info.Value.ref.QuestionId, Info.Value.ref.FormId) + '{' + '{}, {}, {},'= .format('0x%x'%(Info.Value.ref.FormSetGuid.Data1),'0x%x'%(Info.Value.ref.Fo= rmSetGuid.Data2), '0x%x'%(Info.Value.ref.FormSetGuid.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format= ('0x%x'%(Info.Value.ref.FormSetGuid.Data4[0]), '0x%x'%(Info.Value.ref.FormS= etGuid.Data4[1]), '0x%x'%(Info.Value.ref.FormSetGuid.Data4[2]), '0x%x'%(Inf= o.Value.ref.FormSetGuid.Data4[3]), \ - '0x%x'%(Info.Value.ref.FormSetGuid.Data4[4]), '0x%= x'%(Info.Value.ref.FormSetGuid.Data4[5]), '0x%x'%(Info.Value.ref.FormSetGui= d.Data4[6]), '0x%x'%(Info.Value.ref.FormSetGuid.Data4[7])) + ' }}' + ';{}\n= '.format(Info.Value.ref.DevicePath)) - if Info.Type =3D=3D EFI_IFR_TYPE_STRING: - f.write(' option value: {}\n'.format= (Info.Value.string)) - if Info.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - f.write(' option value: {}\n'.format= (Info.Value.u8)) - if Info.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - f.write(' option value: {}\n'.format= (Info.Value.u16)) - if Info.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - f.write(' option value: {}\n'.format= (Info.Value.u32)) - if Info.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - f.write(' option value: {}\n'.format= (Info.Value.u64)) - if Info.Type =3D=3D EFI_IFR_TYPE_BOOLEAN: - f.write(' option value: {}\n'.format= (Info.Value.b)) - - if type(Root.Data) =3D=3D CIfrOneOfOption2: - f.write(' value: {') - ValueType =3D Root.Data.GetValueType() - if ValueType =3D=3D EFI_IFR_TYPE_STRING: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].string)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= string) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].u8)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= u8) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].u16)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= u16) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].u32)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= u32) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].u64)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= u64) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_BOOLEAN: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].b)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= b) + '}\n') - - - if Root.OpCode =3D=3D EFI_IFR_DEFAULT_OP: - Info =3D Root.Data.GetInfo() - f.write(' - default:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - f.write(' type: {}\n'.format(Info.Type)) - f.write(' defaultId: {}\n'.format(Info.Defau= ltId)) - if type(Root.Data) =3D=3D CIfrDefault: - if Info.Type =3D=3D EFI_IFR_TYPE_DATE: - f.write(' value: {}/{}/{}\n'.format(= Info.Value.date.Year, Info.Value.date.Month, Info.Value.date.Day)) - if Info.Type =3D=3D EFI_IFR_TYPE_TIME: - f.write(' value: {}:{}:{}\n'.format(= Info.Value.time.Hour, Info.Value.time.Minute, Info.Value.time.Second)) - if Info.Type =3D=3D EFI_IFR_TYPE_REF: - f.write(' option value: {};{};'.form= at(Info.Value.ref.QuestionId, Info.Value.ref.FormId) + '{' + '{}, {}, {},'= .format('0x%x'%(Info.Value.ref.FormSetGuid.Data1),'0x%x'%(Info.Value.ref.Fo= rmSetGuid.Data2), '0x%x'%(Info.Value.ref.FormSetGuid.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format= ('0x%x'%(Info.Value.ref.FormSetGuid.Data4[0]), '0x%x'%(Info.Value.ref.FormS= etGuid.Data4[1]), '0x%x'%(Info.Value.ref.FormSetGuid.Data4[2]), '0x%x'%(Inf= o.Value.ref.FormSetGuid.Data4[3]), \ - '0x%x'%(Info.Value.ref.FormSetGuid.Data4[4]), '0x%= x'%(Info.Value.ref.FormSetGuid.Data4[5]), '0x%x'%(Info.Value.ref.FormSetGui= d.Data4[6]), '0x%x'%(Info.Value.ref.FormSetGuid.Data4[7])) + ' }}' + ';{}\n= '.format(Info.Value.ref.DevicePath)) - if Info.Type =3D=3D EFI_IFR_TYPE_STRING: - f.write(' value: {}\n'.format(Info.V= alue.string)) - if Info.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - f.write(' value: {}\n'.format(Info.V= alue.u8)) - if Info.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - f.write(' value: {}\n'.format(Info.V= alue.u16)) - if Info.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - f.write(' value: {}\n'.format(Info.V= alue.u32)) - if Info.Type =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - f.write(' value: {}\n'.format(Info.V= alue.u64)) - if Info.Type =3D=3D EFI_IFR_TYPE_BOOLEAN: - f.write(' value: {}\n'.format(Info.V= alue.b)) - - if type(Root.Data) =3D=3D CIfrDefault3: - f.write(' value: {') - ValueType =3D Root.Data.GetValueType() - if ValueType =3D=3D EFI_IFR_TYPE_STRING: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].string)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= string) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].u8)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= u8) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].u16)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= u16) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].u32)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= u32) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].u64)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= u64) + '}\n') - - if ValueType =3D=3D EFI_IFR_TYPE_BOOLEAN: - for i in range(0, len(Info.Value)-1): - f.write('{},'.format(Info.Value[i].b)) - f.write('{}'.format(Info.Value[len(Info.Value)-1].= b) + '}\n') - - if Root.OpCode =3D=3D EFI_IFR_ORDERED_LIST_OP: - Info =3D Root.Data.GetInfo() - f.write(' - orderedlist:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Question.Header.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Question.Header.Help)) - f.write(' questionid: {} # Question QuestionId\= n'.format(Info.Question.QuestionId)) - f.write(' varstoreid: {} # Question VarStoreId\= n'.format(Info.Question.VarStoreId)) - f.write(' maxContainers: {}\n'.format(Info.MaxCo= ntainers)) - f.write(' flags: {}\n'.format(Info.Question.Flag= s)) - - if Root.OpCode =3D=3D EFI_IFR_NUMERIC_OP: - Info =3D Root.Data.GetInfo() - f.write(' - numeric:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Question.Header.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Question.Header.Help)) - f.write(' questionid: {} # Question QuestionId\= n'.format(Info.Question.QuestionId)) - f.write(' varstoreid: {} # Question VarStoreId\= n'.format(Info.Question.VarStoreId)) - f.write(' varname: {} # Question VarName STRING= _ID\n'.format(Info.Question.VarStoreInfo.VarName)) - f.write(' varoffset: {} # Question VarOffset\n'= .format(Info.Question.VarStoreInfo.VarOffset)) - f.write(' flags: {} # Question Flags\n'.format(= Info.Question.Flags)) - - if Root.Data.GetVarType() =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: - f.write(' maxvalue: {}\n'.format(Info.Data.u= 64.MaxValue)) - f.write(' minvalue: {}\n'.format(Info.Data.u= 64.MinValue)) - f.write(' step: {}\n'.format(Info.Data.u64.S= tep)) - - if Root.Data.GetVarType() =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: - f.write(' maxvalue: {}\n'.format(Info.Data.u= 32.MaxValue)) - f.write(' minvalue: {}\n'.format(Info.Data.u= 32.MinValue)) - f.write(' step: {}\n'.format(Info.Data.u32.S= tep)) - - if Root.Data.GetVarType() =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: - f.write(' maxvalue: {}\n'.format(Info.Data.u= 16.MaxValue)) - f.write(' minvalue: {}\n'.format(Info.Data.u= 16.MinValue)) - f.write(' step: {}\n'.format(Info.Data.u16.S= tep)) - - if Root.Data.GetVarType() =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: - f.write(' maxvalue: {}\n'.format(Info.Data.u= 8.MaxValue)) - f.write(' minvalue: {}\n'.format(Info.Data.u= 8.MinValue)) - f.write(' step: {}\n'.format(Info.Data.u8.St= ep)) - - if Root.OpCode =3D=3D EFI_IFR_CHECKBOX_OP: - Info =3D Root.Data.GetInfo() - f.write(' - checkbox:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Question.Header.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Question.Header.Help)) - f.write(' questionid: {} # Question QuestionId\= n'.format(Info.Question.QuestionId)) - f.write(' varstoreid: {} # Question VarStoreId\= n'.format(Info.Question.VarStoreId)) - f.write(' varname: {} # Question VarName STRING= _ID\n'.format(Info.Question.VarStoreInfo.VarName)) - f.write(' varoffset: {} # Question VarOffset\n'= .format(Info.Question.VarStoreInfo.VarOffset)) - f.write(' flags: {} # Flags\n'.format(Info.Flag= s)) - - if Root.OpCode =3D=3D EFI_IFR_TIME_OP: - Info =3D Root.Data.GetInfo() - f.write(' - time:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' questionid: {} # Statement Prompt STR= ING_ID\n'.format(Info.Question.QuestionId)) - f.write(' varstoreid: {} # Question VarStoreId\= n'.format(Info.Question.VarStoreId)) - f.write(' varname: {}\n'.format(Info.Question.Va= rStoreInfo.VarName)) - f.write(' varoffset: {}\n'.format(Info.Question.= VarStoreInfo.VarOffset)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Question.Header.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Question.Header.Help)) - f.write(' flags: {}\n'.format(Info.Flags)) - - if Root.OpCode =3D=3D EFI_IFR_DATE_OP: - Info =3D Root.Data.GetInfo() - f.write(' - date:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' questionid: {} # Statement Prompt STR= ING_ID\n'.format(Info.Question.QuestionId)) - f.write(' varstoreid: {} # Question VarStoreId\= n'.format(Info.Question.VarStoreId)) - f.write(' varname: {}\n'.format(Info.Question.Va= rStoreInfo.VarName)) - f.write(' varoffset: {}\n'.format(Info.Question.= VarStoreInfo.VarOffset)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Question.Header.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Question.Header.Help)) - f.write(' flags: {}\n'.format(Info.Flags)) - - - if Root.OpCode =3D=3D EFI_IFR_STRING_OP: - Info =3D Root.Data.GetInfo() - f.write(' - string:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Question.Header.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Question.Header.Help)) - f.write(' questionid: {} # Question QuestionId\= n'.format(Info.Question.QuestionId)) - f.write(' varstoreid: {} # Question VarStoreId\= n'.format(Info.Question.VarStoreId)) - f.write(' varname: {} # Question VarName STRING= _ID\n'.format(Info.Question.VarStoreInfo.VarName)) - f.write(' varoffset: {} # Question VarOffset\n'= .format(Info.Question.VarStoreInfo.VarOffset)) - f.write(' flags: {} # Question Flags\n'.format(= Info.Question.Flags)) - f.write(' stringflags: {}\n'.format(Info.Flags)) - f.write(' stringminsize: {}\n'.format(Info.MinSi= ze)) - f.write(' stringmaxsize: {}\n'.format(Info.MaxSi= ze)) - - if Root.OpCode =3D=3D EFI_IFR_PASSWORD_OP: - Info =3D Root.Data.GetInfo() - f.write(' - password:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Question.Header.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Question.Header.Help)) - f.write(' questionid: {} # Question QuestionId\= n'.format(Info.Question.QuestionId)) - f.write(' varstoreid: {} # Question VarStoreId\= n'.format(Info.Question.VarStoreId)) - f.write(' varname: {} # Question VarName STRING= _ID\n'.format(Info.Question.VarStoreInfo.VarName)) - f.write(' varoffset: {} # Question VarOffset\n'= .format(Info.Question.VarStoreInfo.VarOffset)) - f.write(' flags: {} # Question Flags\n'.format(= Info.Question.Flags)) - f.write(' minsize: {}\n'.format(Info.MinSize)) - f.write(' maxsize: {}\n'.format(Info.MaxSize)) - - - if Root.OpCode =3D=3D EFI_IFR_RESET_BUTTON_OP: - Info =3D Root.Data.GetInfo() - f.write(' - resetbutton:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - f.write(' prompt: {} # Statement Prompt STRING_= ID\n'.format(Info.Statement.Prompt)) - f.write(' help: {} # Statement Help STRING_ID\n= '.format(Info.Statement.Help)) - f.write(' defaultid: {}\n'.format(Info.DefaultId= )) - - if Root.OpCode =3D=3D EFI_IFR_REF_OP: - Info =3D Root.Data.GetInfo() - f.write(' - goto:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.Condi= tion)) - - if type(Root.Data) =3D=3D CIfrRef4: - f.write(' formid: {}\n'.format(Info.FormId)) - f.write(' formsetid: {' + '{}, {}, {},'.form= at('0x%x'%(Info.FormSetId.Data1),'0x%x'%(Info.FormSetId.Data2), '0x%x'%(Inf= o.FormSetId.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(Info.FormSetId.Data4[0]), '0x%x'%(Info.FormSetId.Data4[1]), '0x%x'%(In= fo.FormSetId.Data4[2]), '0x%x'%(Info.FormSetId.Data4[3]), \ - '0x%x'%(Info.FormSetId.Data4[4]), '0x%x'%(Info.FormSet= Id.Data4[5]), '0x%x'%(Info.FormSetId.Data4[6]), '0x%x'%(Info.FormSetId.Data= 4[7])) + ' }}\n') - f.write(' questionid: {}\n'.format(Info.Ques= tionId)) - f.write(' devicepath: {}\n'.format(Info.Devi= cePath)) - - if type(Root.Data) =3D=3D CIfrRef3: - f.write(' formid: {}\n'.format(Info.FormId)) - f.write(' formsetid: {' + '{}, {}, {},'.form= at('0x%x'%(Info.FormSetId.Data1),'0x%x'%(Info.FormSetId.Data2), '0x%x'%(Inf= o.FormSetId.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(Info.FormSetId.Data4[0]), '0x%x'%(Info.FormSetId.Data4[1]), '0x%x'%(In= fo.FormSetId.Data4[2]), '0x%x'%(Info.FormSetId.Data4[3]), \ - '0x%x'%(Info.FormSetId.Data4[4]), '0x%x'%(Info.FormSet= Id.Data4[5]), '0x%x'%(Info.FormSetId.Data4[6]), '0x%x'%(Info.FormSetId.Data= 4[7])) + ' }}\n') - f.write(' questionid: {}\n'.format(Info.Ques= tionId)) - - if type(Root.Data) =3D=3D CIfrRef2: - f.write(' formid: {}\n'.format(Info.FormId)) - f.write(' questionid: {}\n'.format(Info.Ques= tionId)) - - if type(Root.Data) =3D=3D CIfrRef: - f.write(' formid: {}\n'.format(Info.FormId)) - f.write(' questionid: {}\n'.format(Info.Ques= tion.QuestionId)) - - f.write(' prompt: {}\n'.format(Info.Question.Hea= der.Prompt)) - f.write(' help: {}\n'.format(Info.Question.Heade= r.Help)) - - if Root.OpCode =3D=3D EFI_IFR_REFRESH_OP: - Info =3D Root.Data.GetInfo() - f.write(' - refresh:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - f.write(' interval: {} # RefreshInterval\n'= .format(Info.RefreshInterval)) - - if Root.OpCode =3D=3D EFI_IFR_VARSTORE_DEVICE_OP: - Info =3D Root.Data.GetInfo() - f.write(' - varstoredevice:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - f.write(' devicepath: {} # DevicePath\n'.fo= rmat(Info.DevicePath)) - - if Root.OpCode =3D=3D EFI_IFR_REFRESH_ID_OP: - Info =3D Root.Data.GetInfo() - f.write(' - refreshguid:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - f.write(' eventgroupid: {' + '{}, {}, {},'.f= ormat('0x%x'%(Info.RefreshEventGroupId.Data1),'0x%x'%(Info.RefreshEventGrou= pId.Data2), '0x%x'%(Info.RefreshEventGroupId.Data3)) \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(Info.RefreshEventGroupId.Data4[0]), '0x%x'%(Info.RefreshEventGroupId.D= ata4[1]), '0x%x'%(Info.RefreshEventGroupId.Data4[2]), '0x%x'%(Info.RefreshE= ventGroupId.Data4[3]), \ - '0x%x'%(Info.RefreshEventGroupId.Data4[4]), '0x%x'%(In= fo.RefreshEventGroupId.Data4[5]), '0x%x'%(Info.RefreshEventGroupId.Data4[6]= ), '0x%x'%(Info.RefreshEventGroupId.Data4[7])) + ' }}\n') - - if Root.OpCode =3D=3D EFI_IFR_WARNING_IF_OP: - Info =3D Root.Data.GetInfo() - f.write(' - warningif:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - f.write(' warning: {}\n'.format(Info.Warning= )) - f.write(' timeOut: {}\n'.format(Info.TimeOut= )) - - if Root.OpCode =3D=3D EFI_IFR_GUID_OP: - Info =3D Root.Data.GetInfo() - if type(Root.Data) =3D=3D CIfrLabel: # type(Info) =3D=3D E= FI_IFR_GUID_LABEL - f.write(' - label:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - - f.write(' labelnumber: {} # LabelNumber\n'.= format(Info.Number)) - - if type(Root.Data) =3D=3D CIfrBanner: - f.write(' - banner:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - - f.write(' title: {}\n'.format(Info.Title)) - f.write(' linenumber: {}\n'.format(Info.Line= Number)) - f.write(' align: {}\n'.format(Info.Alignment= )) - - if type(Root.Data) =3D=3D CIfrTimeout: - f.write(' - banner:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - - f.write(' timeout: {}\n'.format(Info.TimeOut= )) - - if type(Root.Data) =3D=3D CIfrClass: - f.write(' Class: {}\n'.format(Info.Class)) - - if type(Root.Data) =3D=3D CIfrSubClass: - f.write(' SubClass: {}\n'.format(Info.SubClass)) - - if type(Root.Data) =3D=3D CIfrGuid: - f.write(' - guidop:\n') - if Root.Condition !=3D None: - f.write(' condition: {}\n'.format(Root.C= ondition)) - f.write(' guid: {' + '{}, {}, {},'.format('0= x%x'%(Info.Guid.Data1),'0x%x'%(Info.Guid.Data2), '0x%x'%(Info.Guid.Data3)) = \ - + ' { ' + '{}, {}, {}, {}, {}, {}, {}, {}'.format('0x= %x'%(Info.Guid.Data4[0]), '0x%x'%(Info.Guid.Data4[1]), '0x%x'%(Info.Guid.Da= ta4[2]), '0x%x'%(Info.Guid.Data4[3]), \ - '0x%x'%(Info.Guid.Data4[4]), '0x%x'%(Info.Guid.Data4[5= ]), '0x%x'%(Info.Guid.Data4[6]), '0x%x'%(Info.Guid.Data4[7])) + ' }}\n') - - - if Root.Child !=3D []: - for ChildNode in Root.Child: - if Root.OpCode in ConditionOps: - if ChildNode.OpCode in ConditionOps: - ChildNode.Condition =3D Root.Condition + ' | ' + C= hildNode.Condition - else: - ChildNode.Condition =3D Root.Condition + def GetCurArraySize(self): + Size =3D 1 + if self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_8: + Size =3D 1 + if self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_16: + Size =3D 2 + if self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_32: + Size =3D 4 + if self.CurrQestVarInfo.VarType =3D=3D EFI_IFR_TYPE_NUM_SIZE_64: + Size =3D 8 =20 - self.DumpYamlDfs(ChildNode, f) + return int(self.CurrQestVarInfo.VarTotalSize / Size) + + def GetQuestionDB(self): + return self.VfrQuestionDB =20 - return =20 -del VfrSyntaxParser \ No newline at end of file +del VfrSyntaxParser diff --git a/BaseTools/Source/Python/VfrCompiler/VfrTree.py b/BaseTools/Sou= rce/Python/VfrCompiler/VfrTree.py deleted file mode 100644 index c78d2dd846..0000000000 --- a/BaseTools/Source/Python/VfrCompiler/VfrTree.py +++ /dev/null @@ -1,88 +0,0 @@ -from VfrCompiler.CommonCtypes import * -from VfrCompiler.VfrFormPkg import * - -# Ifr related Info -> ctypes obj -#?conditional Info -# Structure Info - - -class VfrTreeNode(): - def __init__(self, Opcode: int=3DNone) -> None: - - self.OpCode =3D Opcode - self.Data =3D None # save class or bytes - self.Condition =3D None - self.Expression =3D None - self.Parent =3D None - self.Child =3D [] - - - def hasCondition(self) ->bool: - if self.Condition =3D=3D None: - return False - else: - return True - - # Get data from ctypes to bytes. - def struct2stream(self, s) -> bytes: - length =3D sizeof(s) - p =3D cast(pointer(s), POINTER(c_char * length)) - return p.contents.raw - - def hasChild(self) -> bool: - if self.Child =3D=3D []: - return False - else: - return True - - def isFinalChild(self) -> bool: - ParTree =3D self.Parent - if ParTree: - if ParTree.Child[-1] =3D=3D self: - return True - return False - - - def insertChild(self, NewNode, pos: int=3DNone) -> None: - if len(self.Child) =3D=3D 0: - self.Child.append(NewNode) - else: - if not pos: - LastTree =3D self.Child[-1] - self.Child.append(NewNode) - else: - self.Child.insert(pos, NewNode) - - NewNode.Parent =3D self - - - # lastNode.insertRel(newNode) - def insertRel(self, newNode) -> None: - if self.Parent: - parentTree =3D self.Parent - new_index =3D parentTree.Child.index(self) + 1 - parentTree.Child.insert(new_index, newNode) - self.NextRel =3D newNode - newNode.LastRel =3D self - - - def deleteNode(self, deletekey: str) -> None: - FindStatus, DeleteTree =3D self.FindNode(deletekey) - if FindStatus: - parentTree =3D DeleteTree.Parent - lastTree =3D DeleteTree.LastRel - nextTree =3D DeleteTree.NextRel - if parentTree: - index =3D parentTree.Child.index(DeleteTree) - del parentTree.Child[index] - if lastTree and nextTree: - lastTree.NextRel =3D nextTree - nextTree.LastRel =3D lastTree - elif lastTree: - lastTree.NextRel =3D None - elif nextTree: - nextTree.LastRel =3D None - return DeleteTree - else: - print('Could not find the target tree') - return None diff --git a/BaseTools/Source/Python/VfrCompiler/VfrUtility.py b/BaseTools/= Source/Python/VfrCompiler/VfrUtility.py deleted file mode 100644 index b753dd1e1d..0000000000 --- a/BaseTools/Source/Python/VfrCompiler/VfrUtility.py +++ /dev/null @@ -1,1991 +0,0 @@ -from ast import Pass, Return -from asyncio.windows_events import NULL -from ctypes.wintypes import SIZEL -from msilib.schema import Error -from tkinter import N -from turtle import goto -from typing import List -from unittest.mock import NonCallableMagicMock -from xmlrpc.client import boolean -from VfrCompiler.VfrError import * -from VfrCompiler.CommonCtypes import * -from abc import ABCMeta, abstractmethod -import ctypes - -import sys - -VFR_PACK_SHOW =3D 0x02 -VFR_PACK_ASSIGN =3D 0x01 -VFR_PACK_PUSH =3D 0x04 -VFR_PACK_POP =3D 0x08 -DEFAULT_PACK_ALIGN =3D 0x8 -DEFAULT_ALIGN =3D 1 -MAX_NAME_LEN =3D 64 -MAX_BIT_WIDTH =3D 32 -EFI_VARSTORE_ID_MAX =3D 0xFFFF -EFI_BITS_SHIFT_PER_UINT32 =3D 0x5 -EFI_BITS_PER_UINT32 =3D (1 << EFI_BITS_SHIFT_PER_UINT32) -EFI_FREE_VARSTORE_ID_BITMAP_SIZE =3D int( - (EFI_VARSTORE_ID_MAX + 1) / EFI_BITS_PER_UINT32) - - -class SVfrPackStackNode(object): - - def __init__(self, Identifier, Number): - self.Identifier =3D Identifier - self.Number =3D Number - self.Next =3D None - - def Match(self, Identifier): - if Identifier =3D=3D None: - return True - elif self.Identifier =3D=3D None: - return False - elif self.Identifier =3D=3D Identifier: - return True - else: - return False - - -class SVfrDataType(object): - - def __init__(self, TypeName=3D''): - self.TypeName =3D TypeName - self.Type =3D 0 - self.Align =3D 1 - self.TotalSize =3D 0 - self.HasBitField =3D False - self.Members =3D None - self.Next =3D None - - -class SVfrDataField(object): - - def __init__(self, FieldName=3DNone): - self.FieldName =3D FieldName - self.FieldType =3D None - self.Offset =3D 0 - self.ArrayNum =3D 0 - self.IsBitField =3D False - self.BitWidth =3D 0 - self.BitOffset =3D 0 - self.Next =3D None - -class InternalTypes(): - def __init__(self, TypeName, Type, Size, Align): - self.TypeName =3D TypeName - self.Type =3D Type - self.Size =3D Size - self.Align =3D Align - -gInternalTypesTable =3D [ - InternalTypes("UINT64", EFI_IFR_TYPE_NUM_SIZE_64, - sizeof(ctypes.c_ulonglong), sizeof(ctypes.c_ulonglong)), - InternalTypes("UINT32", EFI_IFR_TYPE_NUM_SIZE_32, sizeof(ctypes.c_ulon= g), - sizeof(ctypes.c_ulong)), - InternalTypes("UINT16", EFI_IFR_TYPE_NUM_SIZE_16, sizeof(ctypes.c_usho= rt), - sizeof(ctypes.c_ushort)), - InternalTypes("UINT8", EFI_IFR_TYPE_NUM_SIZE_8, sizeof(ctypes.c_ubyte)= , - sizeof(ctypes.c_ubyte)), - InternalTypes("BOOLEAN", EFI_IFR_TYPE_BOOLEAN, sizeof(ctypes.c_ubyte), - sizeof(ctypes.c_ubyte)), - InternalTypes("EFI_GUID", EFI_IFR_TYPE_OTHER, sizeof(EFI_GUID), - sizeof(c_ubyte * 8)), - InternalTypes("EFI_HII_DATE", EFI_IFR_TYPE_DATE, sizeof(EFI_HII_DATE), - sizeof(ctypes.c_ushort)), - InternalTypes("EFI_STRING_ID", EFI_IFR_TYPE_STRING, - sizeof(ctypes.c_ushort), sizeof(ctypes.c_ushort)), - InternalTypes("EFI_HII_TIME", EFI_IFR_TYPE_TIME, sizeof(EFI_HII_TIME), - sizeof(ctypes.c_ubyte)), - InternalTypes("EFI_HII_REF", EFI_IFR_TYPE_REF, sizeof(EFI_HII_REF), - sizeof(EFI_GUID)), -] - -class CVfrVarDataTypeDB(object): - - def __init__(self): - self.__PackAlign =3D DEFAULT_PACK_ALIGN - self.__PackStack =3D None - self.__DataTypeList =3D None - self.__NewDataType =3D None - self.__CurrDataType =3D None - self.__CurrDataField =3D None - self.__FirstNewDataTypeName =3D None - self.InternalTypesListInit() - - - def InternalTypesListInit(self): - for i in range(0, len(gInternalTypesTable)): - pNewType =3D SVfrDataType() - pNewType.TypeName =3D gInternalTypesTable[i].TypeName - pNewType.Type =3D gInternalTypesTable[i].Type - pNewType.Align =3D gInternalTypesTable[i].Align - pNewType.TotalSize =3D gInternalTypesTable[i].Size - - if gInternalTypesTable[i].TypeName =3D=3D 'EFI_HII_DATE': - pYearField =3D SVfrDataField() - pMonthField =3D SVfrDataField() - pDayField =3D SVfrDataField() - - pYearField.FieldName =3D 'Year' - pYearField.FieldType, _ =3D self.GetDataType('UINT16') - pYearField.Offset =3D 0 - pYearField.Next =3D pMonthField - pYearField.ArrayNum =3D 0 - pYearField.IsBitField =3D False - - pMonthField.FieldName =3D 'Month' - pMonthField.FieldType, _ =3D self.GetDataType('UINT8') - pMonthField.Offset =3D 2 - pMonthField.Next =3D pDayField - pMonthField.ArrayNum =3D 0 - pMonthField.IsBitField =3D False - - pDayField.FieldName =3D 'Day' - pDayField.FieldType, _ =3D self.GetDataType('UINT8') - pDayField.Offset =3D 3 - pDayField.Next =3D None - pDayField.ArrayNum =3D 0 - pDayField.IsBitField =3D False - - pNewType.Members =3D pYearField - - elif gInternalTypesTable[i].TypeName =3D=3D 'EFI_HII_TIME': - pHoursField =3D SVfrDataField() - pMinutesField =3D SVfrDataField() - pSecondsField =3D SVfrDataField() - - pHoursField.FieldName =3D 'Hours' - pHoursField.FieldType, _ =3D self.GetDataType('UINT8') - pHoursField.Offset =3D 0 - pHoursField.Next =3D pMinutesField - pHoursField.ArrayNum =3D 0 - pHoursField.IsBitField =3D False - - pMinutesField.FieldName =3D 'Minutes' - pMinutesField.FieldType, _ =3D self.GetDataType('UINT8') - pMinutesField.Offset =3D 1 - pMinutesField.Next =3D pSecondsField - pMinutesField.ArrayNum =3D 0 - pMinutesField.IsBitField =3D False - - pSecondsField.FieldName =3D 'Seconds' - pSecondsField.FieldType, _ =3D self.GetDataType('UINT8') - pSecondsField.Offset =3D 2 - pSecondsField.Next =3D None - pSecondsField.ArrayNum =3D 0 - pSecondsField.IsBitField =3D False - - pNewType.Members =3D pHoursField - - elif gInternalTypesTable[i].TypeName =3D=3D 'EFI_HII_REF': - pQuestionIdField =3D SVfrDataField() - pFormIdField =3D SVfrDataField() - pFormSetGuidField =3D SVfrDataField() - pDevicePathField =3D SVfrDataField() - - pQuestionIdField.FieldName =3D 'QuestionId' - pQuestionIdField.FieldType, _ =3D self.GetDataType('UINT16= ') - pQuestionIdField.Offset =3D 0 - pQuestionIdField.Next =3D pFormIdField - pQuestionIdField.ArrayNum =3D 0 - pQuestionIdField.IsBitField =3D False - - pFormIdField.FieldName =3D 'FormId' - pFormIdField.FieldType, _ =3D self.GetDataType('UINT16') - pFormIdField.Offset =3D 2 - pFormIdField.Next =3D pFormSetGuidField - pFormIdField.ArrayNum =3D 0 - pFormIdField.IsBitField =3D False - - pFormSetGuidField.FieldName =3D 'FormSetGuid' - pFormSetGuidField.FieldType, _ =3D self.GetDataType('EFI_G= UID') - pFormSetGuidField.Offset =3D 4 - pFormSetGuidField.Next =3D pDevicePathField - pFormSetGuidField.ArrayNum =3D 0 - pFormSetGuidField.IsBitField =3D False - - pDevicePathField.FieldName =3D 'DevicePath' - pDevicePathField.FieldType, _ =3D self.GetDataType('EFI_ST= RING_ID') - pDevicePathField.Offset =3D 20 - pDevicePathField.Next =3D None - pDevicePathField.ArrayNum =3D 0 - pDevicePathField.IsBitField =3D False - - pNewType.Members =3D pQuestionIdField - - pNewType.Next =3D None - self.__RegisterNewType(pNewType) - pNewType =3D None - - def GetDataTypeList(self): - return self.__DataTypeList - - def Pack(self, - LineNum, - Action, - Identifier=3DNone, - Number=3DDEFAULT_PACK_ALIGN): - - if Action & VFR_PACK_SHOW: - Msg =3D str.format('value of pragma pack(show) =3D=3D %d' % - (self.__PackAlign)) - gCVfrErrorHandle.PrintMsg(LineNum, 'Warning', Msg) - - if Action & VFR_PACK_PUSH: - pNew =3D SVfrPackStackNode(Identifier, self.__PackAlign) - if pNew =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - pNew.Next =3D self.__PackStack - self.__PackStack =3D pNew - - if Action & VFR_PACK_POP: - pNode =3D None - if self.__PackStack =3D=3D None: - gCVfrErrorHandle.PrintMsg(LineNum, 'Error', '#pragma pack(= pop...) : more pops than pushes') - - pNode =3D self.__PackStack - while pNode !=3D None: - if pNode.Match(Identifier) =3D=3D True: - self.__PackAlign =3D pNode.Number - self.__PackStack =3D pNode.Next - pNode =3D pNode.Next - - if Action & VFR_PACK_ASSIGN: - PackAlign =3D (Number + Number % 2) if (Number > 1) else Numbe= r - if PackAlign =3D=3D 0 or PackAlign > 16: - gCVfrErrorHandle.PrintMsg(LineNum, 'Error', "expected prag= ma parameter to be '1', '2', '4', '8', or '16'") - else: - self.__PackAlign =3D PackAlign - - return VfrReturnCode.VFR_RETURN_SUCCESS - - def DeclareDataTypeBegin(self): - pNewType =3D SVfrDataType() - - pNewType.TypeName =3D '' - pNewType.Type =3D EFI_IFR_TYPE_OTHER - pNewType.Align =3D DEFAULT_ALIGN - pNewType.TotalSize =3D 0 - pNewType.HasBitField =3D False - pNewType.Members =3D None - pNewType.Next =3D None - self.__NewDataType =3D pNewType - - def SetNewTypeType(self, Type): - if self.__NewDataType =3D=3D None: - return VfrReturnCode.VFR_RETURN_ERROR_SKIPED - - if Type =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - self.__NewDataType.Type =3D Type # need to limit the value of the= type - - return VfrReturnCode.VFR_RETURN_SUCCESS - - def SetNewTypeTotalSize(self, Size): - self.__NewDataType.TotalSize =3D Size - - def SetNewTypeAlign(self, Align): - self.__NewDataType.Align =3D Align - - def SetNewTypeName(self, TypeName): - if self.__NewDataType =3D=3D None: - return VfrReturnCode.VFR_RETURN_ERROR_SKIPED - - if TypeName =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - if len(TypeName) >=3D MAX_NAME_LEN: - return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER - - pType =3D self.__DataTypeList - while pType !=3D None: - if pType.TypeName =3D=3D TypeName: - return VfrReturnCode.VFR_RETURN_REDEFINED - pType =3D pType.Next - - self.__NewDataType.TypeName =3D TypeName - return VfrReturnCode.VFR_RETURN_SUCCESS - - def __AlignStuff(self, Size, Align): - return Align - (Size) % (Align) - - def DeclareDataTypeEnd(self): - if self.__NewDataType.TypeName =3D=3D '': - return - - if self.__NewDataType.TotalSize % self.__NewDataType.Align !=3D 0: - self.__NewDataType.TotalSize +=3D self.__AlignStuff( - self.__NewDataType.TotalSize, self.__NewDataType.Align) - - self.__RegisterNewType(self.__NewDataType) - if self.__FirstNewDataTypeName =3D=3D None: - self.__FirstNewDataTypeName =3D self.__NewDataType.TypeName - - self.__NewDataType =3D None - - # two definitions - def GetDataTypeSizeByTypeName(self, TypeName): - Size =3D 0 - pDataType =3D self.__DataTypeList - while pDataType !=3D None: - if pDataType.TypeName =3D=3D TypeName: - Size =3D pDataType.TotalSize - return Size, VfrReturnCode.VFR_RETURN_SUCCESS - pDataType =3D pDataType.Next - - return Size, VfrReturnCode.VFR_RETURN_UNDEFINED - - def GetDataTypeSizeByDataType(self, DataType): - Size =3D 0 - DataType =3D DataType & 0x0F - # For user defined data type, the size can't be got by this functi= on. - if DataType =3D=3D EFI_IFR_TYPE_OTHER: - return Size, VfrReturnCode.VFR_RETURN_SUCCESS - pDataType =3D self.__DataTypeList - while pDataType !=3D None: - if DataType =3D=3D pDataType.Type: - Size =3D pDataType.TotalSize - return Size, VfrReturnCode.VFR_RETURN_SUCCESS - pDataType =3D pDataType.Next - - return Size, VfrReturnCode.VFR_RETURN_UNDEFINED - - def __ExtractStructTypeName(self, VarStr): - try: - index =3D VarStr.index('.') - except ValueError: - return VarStr, len(VarStr) - else: - return VarStr[0:index], index + 1 - - def __ExtractFieldNameAndArrary(self, VarStr, s): - - ArrayIdx =3D INVALID_ARRAY_INDEX - s_copy =3D s - while (s < len(VarStr) and VarStr[s] !=3D '.' and VarStr[s] !=3D '= [' - and VarStr[s] !=3D ']'): - s +=3D 1 - - FName =3D VarStr[s_copy:s] - - if s =3D=3D len(VarStr): - return ArrayIdx, s, FName, VfrReturnCode.VFR_RETURN_SUCCESS - - elif VarStr[s] =3D=3D '.': - s +=3D 1 - return ArrayIdx, s, FName, VfrReturnCode.VFR_RETURN_SUCCESS - - elif VarStr[s] =3D=3D '[': - s +=3D 1 - try: - e =3D s + VarStr[s:].index(']') - - except ValueError: - return None, None, None, VfrReturnCode.VFR_RETURN_DATA_STR= ING_ERROR - else: - ArrayStr =3D VarStr[s:e] - ArrayIdx =3D int(ArrayStr) - if VarStr[e] =3D=3D ']': - e +=3D 1 - if e < len(VarStr) and (VarStr[e] =3D=3D '.'): - e +=3D 1 - return ArrayIdx, e, FName, VfrReturnCode.VFR_RETURN_SUCCES= S - - elif VarStr[s] =3D=3D ']': - return None, None, None, VfrReturnCode.VFR_RETURN_DATA_STRING_= ERROR - - return ArrayIdx, s, FName, VfrReturnCode.VFR_RETURN_SUCCESS - - def GetTypeField(self, FName, Type): - if FName =3D=3D None or Type =3D=3D None: - return None, VfrReturnCode.VFR_RETURN_FATAL_ERROR - - pField =3D Type.Members - while (pField !=3D None): - - if Type.Type =3D=3D EFI_IFR_TYPE_TIME: - if FName =3D=3D 'Hour': - FName =3D 'Hours' - elif FName =3D=3D 'Minute': - FName =3D=3D 'Minutes' - elif FName =3D=3D 'Second': - FName =3D 'Seconds' - if pField.FieldName =3D=3D FName: - Field =3D pField - return Field, VfrReturnCode.VFR_RETURN_SUCCESS - - pField =3D pField.Next - - return None, VfrReturnCode.VFR_RETURN_UNDEFINED - - def IsThisBitField(self, VarStrName): - - TName, i =3D self.__ExtractStructTypeName(VarStrName) - pType, ReturnCode =3D self.GetDataType(TName) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return None, ReturnCode - pField =3D None - while (i < len(VarStrName)): - # i start from field - _, i, FName, ReturnCode =3D self.__ExtractFieldNameAndArrary( - VarStrName, i) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return None, ReturnCode - pField, ReturnCode =3D self.GetTypeField(FName, pType) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return None, ReturnCode - pType =3D pField.FieldType - - if pField !=3D None and pField.IsBitField: - return True, ReturnCode - else: - return False, ReturnCode - - def GetFieldOffset(self, Field, ArrayIdx, IsBitField): - - if Field =3D=3D None: - return None, VfrReturnCode.VFR_RETURN_FATAL_ERROR - - if (ArrayIdx !=3D INVALID_ARRAY_INDEX) and (Field.ArrayNum =3D=3D = 0 or - Field.ArrayNum <=3D Arra= yIdx): - return None, VfrReturnCode.VFR_RETURN_ERROR_ARRARY_NUM - - Idx =3D 0 if ArrayIdx =3D=3D INVALID_ARRAY_INDEX else ArrayIdx - if IsBitField: - Offset =3D Field.BitOffset + Field.FieldType.TotalSize * Idx *= 8 - else: - Offset =3D Field.Offset + Field.FieldType.TotalSize * Idx - - return Offset, VfrReturnCode.VFR_RETURN_SUCCESS - - def __GetFieldWidth(self, Field): - if Field =3D=3D None: - return 0 - return Field.FieldType.Type - - def __GetFieldSize(self, Field, ArrayIdx, BitField): - if Field =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - if (ArrayIdx =3D=3D INVALID_ARRAY_INDEX) and (Field.ArrayNum !=3D = 0): - return Field.FieldType.TotalSize * Field.ArrayNum - else: - - if BitField: - return Field.BitWidth - else: - return Field.FieldType.TotalSize - - def GetDataFieldInfo(self, VarStr): - - # VarStr -> Type.Field - Offset =3D 0 - Type =3D EFI_IFR_TYPE_OTHER - Size =3D 0 - BitField =3D False - - TName, i =3D self.__ExtractStructTypeName(VarStr) - - pType, ReturnCode =3D self.GetDataType(TName) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return Offset, Type, Size, BitField, ReturnCode - - BitField, ReturnCode =3D self.IsThisBitField(VarStr) - - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return Offset, Type, Size, BitField, ReturnCode - - #?if it is not struct data type - Type =3D pType.Type - Size =3D pType.TotalSize - - while (i < len(VarStr)): - ArrayIdx, i, FName, ReturnCode =3D self.__ExtractFieldNameAndA= rrary( - VarStr, i) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return Offset, Type, Size, BitField, ReturnCode - pField, ReturnCode =3D self.GetTypeField(FName, pType) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return Offset, Type, Size, BitField, ReturnCode - pType =3D pField.FieldType - Tmp, ReturnCode =3D self.GetFieldOffset(pField, ArrayIdx, - pField.IsBitField) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return Offset, Type, Size, BitField, ReturnCode - - if BitField and pField.IsBitField =3D=3D False: - Offset =3D int(Offset + Tmp * 8) - else: - Offset =3D int(Offset + Tmp) - - Type =3D self.__GetFieldWidth(pField) - Size =3D self.__GetFieldSize(pField, ArrayIdx, BitField) - - return Offset, Type, Size, BitField, VfrReturnCode.VFR_RETURN_SUCC= ESS - - def __RegisterNewType(self, New): - New.Next =3D self.__DataTypeList - self.__DataTypeList =3D New - return - - def DataTypeAddField(self, FieldName, TypeName, ArrayNum, FieldInUnion= ): - - pFieldType, ReturnCode =3D self.GetDataType(TypeName) - - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - - MaxDataTypeSize =3D self.__NewDataType.TotalSize - - - if len(FieldName) >=3D MAX_NAME_LEN: - return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER - - pTmp =3D self.__NewDataType.Members - while pTmp !=3D None: - if pTmp.FieldName =3D=3D FieldName: - return VfrReturnCode.VFR_RETURN_REDEFINED - pTmp =3D pTmp.Next - - Align =3D min(self.__PackAlign, pFieldType.Align) - pNewField =3D SVfrDataField() - if pNewField =3D=3D None: - return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - pNewField.FieldName =3D FieldName - pNewField.FieldType =3D pFieldType - pNewField.ArrayNum =3D ArrayNum - pNewField.IsBitField =3D False - - if self.__NewDataType.TotalSize % Align =3D=3D 0: - pNewField.Offset =3D self.__NewDataType.TotalSize - else: - pNewField.Offset =3D self.__NewDataType.TotalSize + self.__Ali= gnStuff( - self.__NewDataType.TotalSize, Align) - - if self.__NewDataType.Members =3D=3D None: - self.__NewDataType.Members =3D pNewField - pNewField.Next =3D None - else: - pTmp =3D self.__NewDataType.Members - while pTmp.Next !=3D None: - pTmp =3D pTmp.Next - pTmp.Next =3D pNewField - pNewField.Next =3D None - - self.__NewDataType.Align =3D min( - self.__PackAlign, max(pFieldType.Align, self.__NewDataType.Ali= gn)) - - if FieldInUnion: - if MaxDataTypeSize < pNewField.FieldType.TotalSize: - self.__NewDataType.TotalSize =3D pNewField.FieldType.Total= Size - pNewField.Offset =3D 0 - else: - Num =3D ArrayNum if ArrayNum !=3D 0 else 1 - self.__NewDataType.TotalSize =3D pNewField.Offset + ( - pNewField.FieldType.TotalSize) * Num - - return VfrReturnCode.VFR_RETURN_SUCCESS - - def DataTypeAddBitField(self, FieldName, TypeName, Width, FieldInUnion= ): - - pFieldType, ReturnCode =3D self.GetDataType(TypeName) - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - - if Width > MAX_BIT_WIDTH: - return VfrReturnCode.VFR_RETURN_BIT_WIDTH_ERROR - - if Width > (pFieldType.TotalSize) * 8: - return VfrReturnCode.VFR_RETURN_BIT_WIDTH_ERROR - - if (FieldName !=3D None) and (len(FieldName) >=3D MAX_NAME_LEN): - return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER - - if Width =3D=3D 0 and FieldName !=3D None: - return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER - - pTmp =3D self.__NewDataType.Members - while pTmp !=3D None: - if FieldName !=3D None and pTmp.FieldName =3D=3D FieldName: - return VfrReturnCode.VFR_RETURN_REDEFINED - pTmp =3D pTmp.Next - - Align =3D min(self.__PackAlign, pFieldType.Align) - UpdateTotalSize =3D False - - pNewField =3D SVfrDataField() - if pNewField =3D=3D None: - return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - MaxDataTypeSize =3D self.__NewDataType.TotalSize - - pNewField.FieldName =3D FieldName - pNewField.FieldType =3D pFieldType - pNewField.IsBitField =3D True - pNewField.BitWidth =3D Width - pNewField.ArrayNum =3D 0 - pNewField.BitOffset =3D 0 - pNewField.Offset =3D 0 - - if self.__NewDataType.Members =3D=3D None: - self.__NewDataType.Members =3D pNewField - pNewField.Next =3D None - else: - pTmp =3D self.__NewDataType.Members - while pTmp.Next !=3D None: - pTmp =3D pTmp.Next - pTmp.Next =3D pNewField - pNewField.Next =3D None - - if FieldInUnion: - pNewField.Offset =3D 0 - if MaxDataTypeSize < pNewField.FieldType.TotalSize: - self.__NewDataType.TotalSize =3D pNewField.FieldType.Total= Size - else: - # Check whether the bit fields can be contained within one Fie= ldType. - cond1 =3D (pTmp !=3D None) and (pTmp.IsBitField) and ( - pTmp.FieldType.TypeName =3D=3D pNewField.FieldType.TypeNam= e) - cond2 =3D (pTmp !=3D None) and (pTmp.BitOffset - pTmp.Offset *= 8 + - pTmp.BitWidth + pNewField.BitWidth= <=3D - pNewField.FieldType.TotalSize * 8) - if cond1 and cond2: - pNewField.BitOffset =3D pTmp.BitOffset + pTmp.BitWidth - pNewField.Offset =3D pTmp.Offset - - if pNewField.BitWidth =3D=3D 0: - pNewField.BitWidth =3D pNewField.FieldType.TotalSize *= 8 - ( - pNewField.BitOffset - pTmp.Offset * 8) - else: - pNewField.BitOffset =3D self.__NewDataType.TotalSize * 8 - UpdateTotalSize =3D True - - if UpdateTotalSize: - if self.__NewDataType.TotalSize % Align =3D=3D 0: - pNewField.Offset =3D self.__NewDataType.TotalSize - else: - pNewField.Offset =3D self.__NewDataType.TotalSize + self._= _AlignStuff( - self.__NewDataType.TotalSize, Align) - self.__NewDataType.TotalSize =3D pNewField.Offset + pNewField.= FieldType.TotalSize - - self.__NewDataType.Align =3D min( - self.__PackAlign, max(pFieldType.Align, self.__NewDataType.Ali= gn)) - self.__NewDataType.HasBitField =3D True - return VfrReturnCode.VFR_RETURN_SUCCESS - - def GetDataType(self, TypeName): - if TypeName =3D=3D None: - return None, VfrReturnCode.VFR_RETURN_ERROR_SKIPED - - DataType =3D self.__DataTypeList - while DataType !=3D None: - if DataType.TypeName =3D=3D TypeName: - return DataType, VfrReturnCode.VFR_RETURN_SUCCESS - DataType =3D DataType.Next - return None, VfrReturnCode.VFR_RETURN_UNDEFINED - - def DataTypeHasBitField(self, TypeName): - if TypeName =3D=3D None: - return False - - pType =3D self.__DataTypeList - while pType !=3D None: - if pType.TypeName =3D=3D TypeName: - break - pType =3D pType.Next - - if pType =3D=3D None: - return False - - pTmp =3D pType.Members - while pTmp !=3D None: - if pTmp.IsBitField: - return True - pTmp =3D pTmp.Next - return False - - def Dump(self, FileName): - try: - with open(FileName, 'w') as f: - f.write("PackAlign =3D " + str(self.__PackAlign) + '\n') - pNode =3D self.__DataTypeList - while pNode !=3D None: - f.write('struct {} : Align : {} TotalSize : '.format(= str(pNode.TypeName), str(pNode.Align))) - f.write('%#x\n'%(pNode.TotalSize)) - # f.write(" struct " + str(pNode.TypeName) + " : " + "= Align " + str(pNode.Align)) + " TotalSize " + str('%#x'%pNode.TotalSize)) - f.write('struct {} \n'.format(str(pNode.TypeName))) - FNode =3D pNode.Members - while(FNode !=3D None): - if FNode.ArrayNum > 0: - f.write('FieldName : {} , Offset : {}, ArrayNu= m : {} , FieldTypeName : {} , IsBitField : {} \n '.format(str(FNode.FieldNa= me), str(FNode.Offset), str(FNode.ArrayNum), str(FNode.FieldType.TypeName),= str(FNode.IsBitField))) - else: - f.write('FieldName : {} , Offset : {}, FieldTy= peName : {} , IsBitField : {} \n '.format(str(FNode.FieldName), str(FNode.= Offset), str(FNode.FieldType.TypeName), str(FNode.IsBitField))) - FNode =3D FNode.Next - f.write('\n') - pNode =3D pNode.Next - f.close() - except IOError as e: - print("error") - pass - -class SVfrDefaultStoreNode(object): - - def __init__(self, - ObjAddr=3DNone, - RefName=3D'', - DefaultStoreNameId=3D0, - DefaultId=3D0): - self.ObjAddr =3D ObjAddr - self.RefName =3D RefName - self.DefaultStoreNameId =3D DefaultStoreNameId - self.DefaultId =3D DefaultId - self.Next =3D None - - -class CVfrDefaultStore(object): - - def __init__(self): - self.__DefaultStoreList =3D None - - def RegisterDefaultStore(self, ObjAddr: EFI_IFR_DEFAULTSTORE, RefName,= DefaultStoreNameId, DefaultId): - if RefName =3D=3D '' or RefName =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - pNode =3D self.__DefaultStoreList - while pNode !=3D None: - if pNode.RefName =3D=3D RefName: - return VfrReturnCode.VFR_RETURN_REDEFINED - pNode =3D pNode.Next - - pNode =3D SVfrDefaultStoreNode(ObjAddr, RefName, DefaultStoreNameI= d, DefaultId) - - if pNode =3D=3D None: - return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - pNode.Next =3D self.__DefaultStoreList - self.__DefaultStoreList =3D pNode - - return VfrReturnCode.VFR_RETURN_SUCCESS - - def DefaultIdRegistered(self, DefaultId): - pNode =3D self.__DefaultStoreList - while pNode !=3D None: - if pNode.DefaultId =3D=3D DefaultId: - return True - pNode =3D pNode.Next - - return False - - def ReRegisterDefaultStoreById(self, DefaultId, RefName, DefaultStoreN= ameId): - - pNode =3D self.__DefaultStoreList - while pNode !=3D None: - if pNode.DefaultId =3D=3D DefaultId: - break - pNode =3D pNode.Next - - if pNode =3D=3D None: - return None, VfrReturnCode.VFR_RETURN_UNDEFINED - else: - if pNode.DefaultStoreNameId =3D=3D EFI_STRING_ID_INVALID: - pNode.DefaultStoreNameId =3D=3D DefaultStoreNameId - pNode.RefName =3D RefName - if pNode.ObjAddr !=3D None: - pNode.ObjAddr.DefaultName =3D DefaultStoreNameId - else: - return None, VfrReturnCode.VFR_RETURN_REDEFINED - - return pNode, VfrReturnCode.VFR_RETURN_SUCCESS - - def GetDefaultId(self, RefName): - pTmp =3D self.__DefaultStoreList - while(pTmp !=3D None): - if pTmp.RefName =3D=3D RefName: - DefaultId =3D pTmp.DefaultId - return DefaultId, VfrReturnCode.VFR_RETURN_SUCCESS - pTmp =3D pTmp.Next - return None, VfrReturnCode.VFR_RETURN_UNDEFINED - - def BufferVarStoreAltConfigAdd(self, DefaultId, BaseInfo, VarStoreName= , - VarStoreGuid, Type, Value): - if VarStoreName =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - pNode =3D self.__DefaultStoreList - while pNode !=3D None: - if pNode.DefaultId =3D=3D DefaultId: - break - pNode =3D pNode.Next - if pNode =3D=3D None: - return VfrReturnCode.VFR_RETURN_UNDEFINED - # pNode.DefaultId sprintf (NewAltCfg, "%04x", pNode->mDefaultId) - gCVfrBufferConfig.Open() - if gCVfrBufferConfig.Select(VarStoreName, VarStoreGuid) =3D=3D 0: - Returnvalue =3D gCVfrBufferConfig.Write('a', VarStoreName, - VarStoreGuid, - pNode.DefaultId, Type, - BaseInfo.Info.VarOffset, - BaseInfo.VarTotalSize, V= alue) - if Returnvalue !=3D 0: - gCVfrBufferConfig.Close() - return VfrReturnCode(Returnvalue) - gCVfrBufferConfig.Close() - return VfrReturnCode.VFR_RETURN_SUCCESS - - - -class EFI_VFR_VARSTORE_TYPE(Enum): - EFI_VFR_VARSTORE_INVALID =3D 0 - EFI_VFR_VARSTORE_BUFFER =3D 1 - EFI_VFR_VARSTORE_EFI =3D 2 - EFI_VFR_VARSTORE_NAME =3D 3 - EFI_VFR_VARSTORE_BUFFER_BITS =3D 4 - - -class EfiVar(): - - def __init__(self, VarName=3D0, VarSize=3D0): - self.EfiVarName =3D VarName - self.EfiVarSize =3D VarSize - - -DEFAULT_NAME_TABLE_ITEMS =3D 1024 - - -class SVfrVarStorageNode(): - - def __init__(self, - VarStoreName=3D'', - VarStoreId=3D0, - Guid=3DNone, - Attributes=3D0, - Flag=3DTrue, - EfiValue=3DNone, - DataType=3DNone, - BitsVarstore=3DFalse): - - self.Guid =3D Guid - self.VarStoreName =3D VarStoreName - self.VarStoreId =3D VarStoreId - self.AssignedFlag =3D Flag - self.Attributes =3D Attributes - self.Next =3D None - self.EfiVar =3D EfiValue - self.DataType =3D DataType - self.NameSpace =3D [] - - if EfiValue !=3D None: - self.VarstoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_E= FI - elif DataType !=3D None: - if BitsVarstore: - self.VarstoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTO= RE_BUFFER_BITS - else: - self.VarstoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTO= RE_BUFFER - else: - self.VarstoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_N= AME - -class SConfigItem(): - - def __init__(self, - Name=3DNone, - Guid=3DNone, - Id=3DNone, - Type=3DNone, - Offset=3DNone, - Width=3DNone, - Value=3DNone): - self.Name =3D Name # varstore name - self.Guid =3D Guid # varstore guid, varstore name + guid deside o= ne varstore - self.Id =3D Id # default ID - if Type !=3D None: - # list of Offset/Value in the varstore - self.InfoStrList =3D SConfigInfo(Type, Offset, Width, Value) - else: - self.InfoStrList =3D None - self.Next =3D None - - -class SConfigInfo(): - - def __init__(self, Type, Offset, Width, Value: EFI_IFR_TYPE_VALUE): - self.Type =3D Type - self.Offset =3D Offset - self.Width =3D Width - self.Next =3D None - self.Value =3D Value - -class CVfrBufferConfig(object): - __metaclass__ =3D ABCMeta - - def __init__(self): - self.__ItemListHead =3D None # SConfigItem - self.__ItemListTail =3D None - self.__ItemListPos =3D None - - def GetVarItemList(self): - return self.__ItemListHead - - @abstractmethod - def Open(self): - self.__ItemListPos =3D self.__ItemListHead - - @abstractmethod - def Close(self): - self.__ItemListPos =3D None - - @abstractmethod - def Select(self, Name, Guid, Id=3DNone): - if Name =3D=3D None or Guid =3D=3D None: - self.__ItemListPos =3D self.__ItemListHead - return 0 - else: - p =3D self.__ItemListHead - while p !=3D None: - if p.Name !=3D Name or p.Guid.__cmp__(Guid) =3D=3D False: - p =3D p.Next - continue - if Id !=3D None: - if p.Id =3D=3D None or p.Id !=3D Id: - p =3D p.Next - continue - elif p.Id !=3D None: - p =3D p.Next - continue - self.__ItemListPos =3D p - return 0 - return 1 - - @abstractmethod - def Register(self, Name, Guid, Id=3DNone): - if self.Select(Name, Guid) =3D=3D 0: - return 1 - pNew =3D SConfigItem(Name, Guid, Id) - if pNew =3D=3D None: - return 2 - if self.__ItemListHead =3D=3D None: - self.__ItemListHead =3D pNew - self.__ItemListTail =3D pNew - else: - self.__ItemListTail.Next =3D pNew - self.__ItemListTail =3D pNew - self.__ItemListPos =3D pNew - return 0 - - @abstractmethod - def Write(self, Mode, Name, Guid, Id, Type, Offset, Width, - Value: EFI_IFR_TYPE_VALUE): - Ret =3D self.Select(Name, Guid) - if Ret !=3D 0: - return Ret - - if Mode =3D=3D 'a': # add - if self.Select(Name, Guid, Id) !=3D 0: - pItem =3D SConfigItem(Name, Guid, Id, Type, Offset, Width,= Value) - if pItem =3D=3D None: - return 2 - - if self.__ItemListHead =3D=3D None: - self.__ItemListHead =3D pItem - self.__ItemListTail =3D pItem - else: - self.__ItemListTail.Next =3D pItem - self.__ItemListTail =3D pItem - - self.__ItemListPos =3D pItem - - else: - # tranverse the list to find out if there's already the va= lue for the same offset - pInfo =3D self.__ItemListPos.InfoStrList - while pInfo !=3D None: - if pInfo.Offset =3D=3D Offset: - return 0 - pInfo =3D pInfo.Next - - pInfo =3D SConfigInfo(Type, Offset, Width, Value) - if pInfo =3D=3D None: - return 2 - - pInfo.Next =3D self.__ItemListPos.InfoStrList - self.__ItemListPos.InfoStrList =3D pInfo - - elif Mode =3D=3D 'd': # delete - if self.__ItemListHead =3D=3D self.__ItemListPos: - self.__ItemListHead =3D self.__ItemListPos.Next - - pItem =3D self.__ItemListHead - while pItem.Next !=3D self.__ItemListPos: - pItem =3D pItem.Next - pItem.Next =3D self.__ItemListPos.Next - - if self.__ItemListTail =3D=3D self.__ItemListPos: - self.__ItemListTail =3D pItem - - self.__ItemListPos =3D pItem.Next - - elif Mode =3D=3D 'i': # set info - if Id !=3D None: - self.__ItemListPos.Id =3D Id - else: - return 1 - return 0 - -gCVfrBufferConfig =3D CVfrBufferConfig() - -class EFI_VARSTORE_INFO(Structure): - _pack_ =3D 1 - _fields_ =3D [ - ('VarStoreId', c_uint16), - ('Info', VarStoreInfoNode), - ('VarType', c_uint8), - ('VarTotalSize', c_uint32), - ('IsBitVar', c_bool), - ] - - def __init__(self, - VarStoreId=3DEFI_VARSTORE_ID_INVALID, - VarName=3DEFI_STRING_ID_INVALID, - VarOffset=3DEFI_VAROFFSET_INVALID, - VarType=3DEFI_IFR_TYPE_OTHER, - VarTotalSize=3D0, - IsBitVar=3DFalse): - - self.VarStoreId =3D VarStoreId - self.Info.VarName =3D VarName - self.Info.VarOffset =3D VarOffset - self.VarTotalSize =3D VarTotalSize - self.IsBitVar =3D IsBitVar - self.VarType =3D VarType - - -class BufferVarStoreFieldInfoNode(): - - def __init__(self, BaseInfo: EFI_VARSTORE_INFO): - - self.VarStoreInfo =3D EFI_VARSTORE_INFO() - self.VarStoreInfo.VarType =3D BaseInfo.VarType - self.VarStoreInfo.VarTotalSize =3D BaseInfo.VarTotalSize - self.VarStoreInfo.Info.VarOffset =3D BaseInfo.Info.VarOffset - self.VarStoreInfo.VarStoreId =3D BaseInfo.VarStoreId - self.Next =3D None - - -class CVfrDataStorage(object): - - def __init__(self): - self.__BufferVarStoreList =3D None # SVfrVarStorageNode - self.__EfiVarStoreList =3D None - self.__NameVarStoreList =3D None - self.__CurrVarStorageNode =3D None - self.__NewVarStorageNode =3D None - self.__BufferFieldInfoListHead =3D None - self.__mBufferFieldInfoListTail =3D None - self.__FreeVarStoreIdBitMap =3D [] - for i in range(0, EFI_FREE_VARSTORE_ID_BITMAP_SIZE): - self.__FreeVarStoreIdBitMap.append(0) - #Question ID0 is reserved - self.__FreeVarStoreIdBitMap[0] =3D 0x80000000 - - def GetBufferVarStoreList(self): - return self.__BufferVarStoreList - - def __CheckGuidField(self, pNode, StoreGuid, HasFoundOne, ReturnCode): - if StoreGuid !=3D None: - #?If has guid info, compare the guid filed. - if pNode.Guid.__cmp__(StoreGuid): - self.__CurrVarStorageNode =3D pNode - ReturnCode =3D VfrReturnCode.VFR_RETURN_SUCCESS - return True, ReturnCode, HasFoundOne - else: - #?not has Guid field, check whether this name is the only one. - if HasFoundOne: - # The name has conflict, return name redefined. - ReturnCode =3D VfrReturnCode.VFR_RETURN_VARSTORE_NAME_REDE= FINED_ERROR - return True, ReturnCode, HasFoundOne - - self.__CurrVarStorageNode =3D pNode - HasFoundOne =3D True - return False, ReturnCode, HasFoundOne - - def __GetVarStoreByDataType(self, DataTypeName, VarGuid): - MatchNode =3D None - pNode =3D self.__BufferVarStoreList - while pNode !=3D None: - if pNode.DataType.TypeName !=3D DataTypeName: - pNode =3D pNode.Next - continue - if VarGuid !=3D None: - if pNode.Guid.__cmp__(VarGuid): - return pNode, VfrReturnCode.VFR_RETURN_SUCCESS - else: - if MatchNode =3D=3D None: - MatchNode =3D pNode - else: - # More than one varstores referred the same data struc= tures - return None, VfrReturnCode.VFR_RETURN_VARSTORE_DATATYP= E_REDEFINED_ERROR - pNode =3D pNode.Next - - if MatchNode =3D=3D None: - return MatchNode, VfrReturnCode.VFR_RETURN_UNDEFINED - - return MatchNode, VfrReturnCode.VFR_RETURN_SUCCESS - - """ - Base on the input store name and guid to find the varstore id. - If both name and guid are inputed, base on the name and guid to - found the varstore. If only name inputed, base on the name to - found the varstore and go on to check whether more than one varstor= e - has the same name. If only has found one varstore, return this - varstore; if more than one varstore has same name, return varstore - name redefined error. If no varstore found by varstore name, call - function GetVarStoreByDataType and use inputed varstore name as - data type name to search. - """ - - def GetVarStoreId(self, StoreName, StoreGuid=3DNone): - - ReturnCode =3D None - HasFoundOne =3D False - self.__CurrVarStorageNode =3D None - - pNode =3D self.__BufferVarStoreList - while pNode !=3D None: - if pNode.VarStoreName =3D=3D StoreName: - Result, ReturnCode, HasFoundOne =3D self.__CheckGuidField( - pNode, StoreGuid, HasFoundOne, ReturnCode) - if Result: - VarStoreId =3D self.__CurrVarStorageNode.VarStoreId - return VarStoreId, ReturnCode - pNode =3D pNode.Next - - pNode =3D self.__EfiVarStoreList - while pNode !=3D None: - if pNode.VarStoreName =3D=3D StoreName: - Result, ReturnCode, HasFoundOne =3D self.__CheckGuidField( - pNode, StoreGuid, HasFoundOne, ReturnCode) - if Result: - VarStoreId =3D self.__CurrVarStorageNode.VarStoreId - return VarStoreId, ReturnCode - pNode =3D pNode.Next - - pNode =3D self.__NameVarStoreList - while pNode !=3D None: - if pNode.VarStoreName =3D=3D StoreName: - Result, ReturnCode, HasFoundOne =3D self.__CheckGuidField( - pNode, StoreGuid, HasFoundOne, ReturnCode) - if Result: - VarStoreId =3D self.__CurrVarStorageNode.VarStoreId - return VarStoreId, ReturnCode - pNode =3D pNode.Next - - if HasFoundOne: - VarStoreId =3D self.__CurrVarStorageNode.VarStoreId - return VarStoreId, VfrReturnCode.VFR_RETURN_SUCCESS - - VarStoreId =3D EFI_VARSTORE_ID_INVALID - pNode, ReturnCode =3D self.__GetVarStoreByDataType(StoreName, - StoreGuid) # - if pNode !=3D None: - self.__CurrVarStorageNode =3D pNode - VarStoreId =3D pNode.VarStoreId - - return VarStoreId, ReturnCode - - def __GetFreeVarStoreId(self, VarType): - - Index =3D 0 - for i in range(0, EFI_FREE_VARSTORE_ID_BITMAP_SIZE): - if self.__FreeVarStoreIdBitMap[i] !=3D 0xFFFFFFFF: - Index =3D i - break - if Index =3D=3D EFI_FREE_VARSTORE_ID_BITMAP_SIZE: - return EFI_VARSTORE_ID_INVALID - - Offset =3D 0 - Mask =3D 0x80000000 - while Mask !=3D 0: - if (self.__FreeVarStoreIdBitMap[Index] & Mask) =3D=3D 0: - self.__FreeVarStoreIdBitMap[Index] |=3D Mask - return (Index << EFI_BITS_SHIFT_PER_UINT32) + Offset - Mask >>=3D 1 - Offset +=3D 1 - return EFI_VARSTORE_ID_INVALID - - def __CheckVarStoreIdFree(self, VarStoreId): - - Index =3D int(VarStoreId / EFI_BITS_PER_UINT32) - Offset =3D VarStoreId % EFI_BITS_PER_UINT32 - return (self.__FreeVarStoreIdBitMap[Index] & - (0x80000000 >> Offset)) =3D=3D 0 - - def __MarkVarStoreIdUsed(self, VarStoreId): - - Index =3D int(VarStoreId / EFI_BITS_PER_UINT32) - Offset =3D VarStoreId % EFI_BITS_PER_UINT32 - self.__FreeVarStoreIdBitMap[Index] |=3D (0x80000000 >> Offset) - - def DeclareBufferVarStore(self, - StoreName, - Guid, - DataTypeDB, - TypeName, - VarStoreId, - IsBitVarStore, - Attr=3D0, - Flag=3DTrue): - - if StoreName =3D=3D None or Guid =3D=3D None or DataTypeDB =3D=3D = None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - _, ReturnCode =3D self.GetVarStoreId(StoreName, Guid) - - if ReturnCode =3D=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return VfrReturnCode.VFR_RETURN_REDEFINED - - DataType, ReturnCode =3D DataTypeDB.GetDataType(TypeName) - - if ReturnCode !=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return ReturnCode - - if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: - VarStoreId =3D self.__GetFreeVarStoreId( - EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_BUFFER) - else: - if self.__CheckVarStoreIdFree(VarStoreId) =3D=3D False: - return VfrReturnCode.VFR_RETURN_VARSTOREID_REDEFINED - self.__MarkVarStoreIdUsed(VarStoreId) - pNew =3D SVfrVarStorageNode(StoreName, VarStoreId, Guid, Attr, Fla= g, None, - DataType, IsBitVarStore) - - if pNew =3D=3D None: - return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - pNew.Next =3D self.__BufferVarStoreList - self.__BufferVarStoreList =3D pNew - - if gCVfrBufferConfig.Register(StoreName, Guid) !=3D 0: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - return VfrReturnCode.VFR_RETURN_SUCCESS - - def DeclareNameVarStoreBegin(self, StoreName, VarStoreId): - if StoreName =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - _, ReturnCode =3D self.GetVarStoreId(StoreName) - if ReturnCode =3D=3D VfrReturnCode.VFR_RETURN_SUCCESS: - return VfrReturnCode.VFR_RETURN_REDEFINED - - if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: - VarStoreId =3D self.__GetFreeVarStoreId( - EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_NAME) - else: - if self.__CheckVarStoreIdFree(VarStoreId) =3D=3D False: - return VfrReturnCode.VFR_RETURN_VARSTOREID_REDEFINED - self.__MarkVarStoreIdUsed(VarStoreId) - - pNode =3D SVfrVarStorageNode(StoreName, VarStoreId) - - if pNode =3D=3D None: - return VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - self.__NewVarStorageNode =3D pNode - return VfrReturnCode.VFR_RETURN_SUCCESS - - def DeclareNameVarStoreEnd(self, Guid): - self.__NewVarStorageNode.Guid =3D Guid - self.__NewVarStorageNode.Next =3D self.__NameVarStoreList - self.__NameVarStoreList =3D self.__NewVarStorageNode - self.__NewVarStorageNode =3D None - - def NameTableAddItem(self, Item): - self.__NewVarStorageNode.NameSpace.append(Item) - return VfrReturnCode.VFR_RETURN_SUCCESS - - def GetNameVarStoreInfo(self, BaseInfo, Index): - if BaseInfo =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - if self.__CurrVarStorageNode =3D=3D None: - return VfrReturnCode.VFR_RETURN_GET_NVVARSTORE_ERROR - - BaseInfo.Info.VarName =3D self.__CurrVarStorageNode.NameSpace[Inde= x] - - return VfrReturnCode.VFR_RETURN_SUCCESS - - def GetVarStoreType(self, VarStoreId): - - VarStoreType =3D EFI_VFR_VARSTORE_TYPE.EFI_VFR_VARSTORE_INVALID - - if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: - return VarStoreType - - pNode =3D self.__BufferVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - VarStoreType =3D pNode.VarstoreType - return VarStoreType - pNode =3D pNode.Next - - pNode =3D self.__EfiVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - VarStoreType =3D pNode.VarstoreType - return VarStoreType - pNode =3D pNode.Next - - pNode =3D self.__NameVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - VarStoreType =3D pNode.VarstoreType - return VarStoreType - pNode =3D pNode.Next - - return VarStoreType - - def GetVarStoreName(self, VarStoreId): - - pNode =3D self.__BufferVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - return pNode.VarStoreName, VfrReturnCode.VFR_RETURN_SUCCES= S - pNode =3D pNode.Next - - pNode =3D self.__EfiVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - return pNode.VarStoreName, VfrReturnCode.VFR_RETURN_SUCCES= S - pNode =3D pNode.Next - - pNode =3D self.__NameVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - return pNode.VarStoreName, VfrReturnCode.VFR_RETURN_SUCCES= S - pNode =3D pNode.Next - - return None, VfrReturnCode.VFR_RETURN_UNDEFINED - - - def GetBufferVarStoreDataTypeName(self, VarStoreId): - - DataTypeName =3D None - if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: - return DataTypeName, VfrReturnCode.VFR_RETURN_FATAL_ERROR - - pNode =3D self.__BufferVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - DataTypeName =3D pNode.DataType.TypeName - return DataTypeName, VfrReturnCode.VFR_RETURN_SUCCESS - pNode =3D pNode.Next - - return DataTypeName, VfrReturnCode.VFR_RETURN_UNDEFINED - - def GetEfiVarStoreInfo(self, BaseInfo: EFI_VARSTORE_INFO): - - if BaseInfo =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - if self.__CurrVarStorageNode =3D=3D None: - return VfrReturnCode.VFR_RETURN_GET_EFIVARSTORE_ERROR - - BaseInfo.Info.VarName =3D self.__CurrVarStorageNode.EfiVar.EfiVarN= ame - BaseInfo.VarTotalSize =3D self.__CurrVarStorageNode.EfiVar.EfiVarS= ize - - if BaseInfo.VarTotalSize =3D=3D 1: - BaseInfo.VarType =3D EFI_IFR_TYPE_NUM_SIZE_8 - elif BaseInfo.VarTotalSize =3D=3D 2: - BaseInfo.VarType =3D EFI_IFR_TYPE_NUM_SIZE_16 - elif BaseInfo.VarTotalSize =3D=3D 4: - BaseInfo.VarType =3D EFI_IFR_TYPE_NUM_SIZE_32 - elif BaseInfo.VarTotalSize =3D=3D 8: - BaseInfo.VarType =3D EFI_IFR_TYPE_NUM_SIZE_64 - else: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - return VfrReturnCode.VFR_RETURN_SUCCESS - - def GetVarStoreGuid(self, VarStoreId): - - VarGuid =3D None - if VarStoreId =3D=3D EFI_VARSTORE_ID_INVALID: - return VarGuid - - pNode =3D self.__BufferVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - VarGuid =3D pNode.Guid - return VarGuid - pNode =3D pNode.Next - - pNode =3D self.__EfiVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - VarGuid =3D pNode.Guid - return VarGuid - pNode =3D pNode.Next - - pNode =3D self.__NameVarStoreList - while pNode !=3D None: - if pNode.VarStoreId =3D=3D VarStoreId: - VarGuid =3D pNode.Guid - return VarGuid - pNode =3D pNode.Next - - return VarGuid - - def AddBufferVarStoreFieldInfo(self, BaseInfo: EFI_VARSTORE_INFO): - - pNew =3D BufferVarStoreFieldInfoNode(BaseInfo) - if pNew =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - if self.__BufferFieldInfoListHead =3D=3D None: - self.__BufferFieldInfoListHead =3D pNew - self.__mBufferFieldInfoListTail =3D pNew - else: - self.__mBufferFieldInfoListTail.Next =3D pNew - self.__mBufferFieldInfoListTail =3D pNew - - return VfrReturnCode.VFR_RETURN_SUCCESS - - -class CVfrStringDB(object): - - def __init__(self): - self.__StringFileName =3D '' - - def GetVarStoreNameFromStringId(self, StringId): - if self.__StringFileName =3D=3D '': - return None - try: - f =3D open(self.__StringFileName) - StringPtr =3D f.read() - f.close() - except IOError: - print('Error') - -gCVfrStringDB =3D CVfrStringDB() - -EFI_RULE_ID_START =3D 0x01 -EFI_RULE_ID_INVALID =3D 0x00 - - -class SVfrRuleNode(): - - def __init__(self, RuleName=3DNone, RuleId=3D0): - self.RuleId =3D RuleId - self.RuleName =3D RuleName - self.Next =3D None - - -class CVfrRulesDB(object): - - def __init__(self): - self.__RuleList =3D None - self.__FreeRuleId =3D EFI_VARSTORE_ID_START - - def RegisterRule(self, RuleName): - if RuleName =3D=3D None: - return - - pNew =3D SVfrRuleNode(RuleName, self.__FreeRuleId) - if pNew =3D=3D None: return - self.__FreeRuleId +=3D 1 - pNew.Next =3D self.__RuleList - self.__RuleList =3D pNew - - def GetRuleId(self, RuleName): - if RuleName =3D=3D None: - return - - pNode =3D self.__RuleList - while pNode !=3D None: - if pNode.RuleName =3D=3D RuleName: - return pNode.RuleId - pNode =3D pNode.Next - - return EFI_RULE_ID_INVALID - - -EFI_QUESTION_ID_MAX =3D 0xFFFF -EFI_FREE_QUESTION_ID_BITMAP_SIZE =3D int( - (EFI_QUESTION_ID_MAX + 1) / EFI_BITS_PER_UINT32) -EFI_QUESTION_ID_INVALID =3D 0x0 - - -class EFI_QUESION_TYPE(Enum): - QUESTION_NORMAL =3D 0 - QUESTION_DATE =3D 1 - QUESTION_TIME =3D 2 - QUESTION_REF =3D 3 - - -class SVfrQuestionNode(): - - def __init__(self, Name=3DNone, VarIdStr=3DNone, BitMask=3D0): # - self.Name =3D Name - self.VarIdStr =3D VarIdStr - self.QuestionId =3D EFI_QUESTION_ID_INVALID - self.BitMask =3D BitMask - self.Next =3D None - self.QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL - - -DATE_YEAR_BITMASK =3D 0x0000FFFF -DATE_MONTH_BITMASK =3D 0x00FF0000 -DATE_DAY_BITMASK =3D 0xFF000000 -TIME_HOUR_BITMASK =3D 0x000000FF -TIME_MINUTE_BITMASK =3D 0x0000FF00 -TIME_SECOND_BITMASK =3D 0x00FF0000 - - -class CVfrQuestionDB(object): - - def __init__(self): - self.__FreeQIdBitMap =3D [] - for i in range(0, EFI_FREE_QUESTION_ID_BITMAP_SIZE): - self.__FreeQIdBitMap.append(0) - - # Question ID 0 is reserved. - self.__FreeQIdBitMap[0] =3D 0x80000000 - - self.__QuestionList =3D None - - def FindQuestionByName(self, Name): - if Name =3D=3D None: - return VfrReturnCode.VFR_RETURN_FATAL_ERROR - - pNode =3D self.__QuestionList - while pNode !=3D None: - if pNode.Name =3D=3D Name: - return VfrReturnCode.VFR_RETURN_SUCCESS - pNode =3D pNode.Next - - return VfrReturnCode.VFR_RETURN_UNDEFINED - - def FindQuestionById(self, QuestionId): - if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: - return VfrReturnCode.VFR_RETURN_INVALID_PARAMETER - - pNode =3D self.__QuestionList - while pNode !=3D None: - if pNode.QuestionId =3D=3D QuestionId: - return VfrReturnCode.VFR_RETURN_SUCCESS - pNode =3D pNode.Next - - return VfrReturnCode.VFR_RETURN_UNDEFINED - - def __GetFreeQuestionId(self): - - Index =3D 0 - for i in range(0, EFI_FREE_QUESTION_ID_BITMAP_SIZE): - if self.__FreeQIdBitMap[i] !=3D 0xFFFFFFFF: - Index =3D i - break - if Index =3D=3D EFI_FREE_QUESTION_ID_BITMAP_SIZE: - return EFI_QUESTION_ID_INVALID - - Offset =3D 0 - Mask =3D 0x80000000 - while Mask !=3D 0: - if (self.__FreeQIdBitMap[Index] & Mask) =3D=3D 0: - self.__FreeQIdBitMap[Index] |=3D Mask - return (Index << EFI_BITS_SHIFT_PER_UINT32) + Offset - Mask >>=3D 1 - Offset +=3D 1 - - return EFI_QUESTION_ID_INVALID - - def __CheckQuestionIdFree(self, QId): - Index =3D int(QId / EFI_BITS_PER_UINT32) - Offset =3D QId % EFI_BITS_PER_UINT32 - return (self.__FreeQIdBitMap[Index] & (0x80000000 >> Offset)) =3D= =3D 0 - - def __MarkQuestionIdUsed(self, QId): - - Index =3D int(QId / EFI_BITS_PER_UINT32) - Offset =3D QId % EFI_BITS_PER_UINT32 - self.__FreeQIdBitMap[Index] |=3D (0x80000000 >> Offset) - - def __MarkQuestionIdUnused(self, QId): - Index =3D int(QId / EFI_BITS_PER_UINT32) - Offset =3D QId % EFI_BITS_PER_UINT32 - self.__FreeQIdBitMap[Index] &=3D ~(0x80000000 >> Offset) - - def RegisterQuestion(self, Name, VarIdStr, QuestionId): - - if (Name !=3D None) and (self.FindQuestionByName(Name) =3D=3D VfrR= eturnCode.VFR_RETURN_SUCCESS): - return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED - - pNode =3D SVfrQuestionNode(Name, VarIdStr) - if pNode =3D=3D None: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: - QuestionId =3D self.__GetFreeQuestionId() - else: - if self.__CheckQuestionIdFree(QuestionId) =3D=3D False: - return QuestionId, VfrReturnCode.VFR_RETURN_QUESTIONID_RED= EFINED - self.__MarkQuestionIdUsed(QuestionId) - - pNode.QuestionId =3D QuestionId - pNode.Next =3D self.__QuestionList - self.__QuestionList =3D pNode - - # gCFormPkg.DoPendingAssign - - return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS - - def UpdateQuestionId(self, QId, NewQId): - - if QId =3D=3D NewQId: - # don't update - return VfrReturnCode.VFR_RETURN_SUCCESS - - if self.__CheckQuestionIdFree(NewQId) =3D=3D False: - return VfrReturnCode.VFR_RETURN_REDEFINED - - pNode =3D self.__QuestionList - TempList =3D [] - while pNode !=3D None: - if pNode.QuestionId =3D=3D QId: - TempList.append(pNode) - pNode =3D pNode.Next - - if len(TempList) =3D=3D 0: - return VfrReturnCode.VFR_RETURN_UNDEFINED - - self.__MarkQuestionIdUnused(QId) - - for pNode in TempList: - pNode.QuestionId =3D NewQId - - self.__MarkQuestionIdUsed(NewQId) - - # gCFormPkg.DoPendingAssign - return VfrReturnCode.VFR_RETURN_SUCCESS - - def GetQuestionId(self, Name, VarIdStr=3DNone, QType=3DNone): - - QuestionId =3D EFI_QUESTION_ID_INVALID - BitMask =3D 0x00000000 - if QType !=3D None: - QType =3D EFI_QUESION_TYPE.QUESTION_NORMAL - - if Name =3D=3D None and VarIdStr =3D=3D None: - return QuestionId, BitMask, QType - - pNode =3D self.__QuestionList - while pNode !=3D None: - - if Name !=3D None: - if pNode.Name !=3D Name: - pNode =3D pNode.Next - continue - - if VarIdStr !=3D None: - if pNode.VarIdStr !=3D VarIdStr: - pNode =3D pNode.Next - continue - - QuestionId =3D pNode.QuestionId - BitMask =3D pNode.BitMask - if QType !=3D None: - QType =3D pNode.QType - break - - return QuestionId, BitMask, QType - - def RegisterNewDateQuestion(self, Name, BaseVarId, QuestionId): - - if BaseVarId =3D=3D '' and Name =3D=3D None: - if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: - QuestionId =3D self.__GetFreeQuestionId() - else: - if self.__CheckQuestionIdFree(QuestionId) =3D=3D False: - return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED - self.__MarkQuestionIdUsed(QuestionId) - return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS - - VarIdStrList =3D [] - if BaseVarId !=3D '': - VarIdStrList.append(BaseVarId + '.Year') - VarIdStrList.append(BaseVarId + '.Month') - VarIdStrList.append(BaseVarId + '.Day') - - else: - VarIdStrList.append(Name + '.Year') - VarIdStrList.append(Name + '.Month') - VarIdStrList.append(Name + '.Day') - - pNodeList =3D [] - pNode =3D SVfrQuestionNode(Name, VarIdStrList[0], DATE_YEAR_BITMAS= K) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - pNode =3D SVfrQuestionNode(Name, VarIdStrList[1], DATE_MONTH_BITMA= SK) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - pNode =3D SVfrQuestionNode(Name, VarIdStrList[2], DATE_DAY_BITMASK= ) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: - QuestionId =3D self.__GetFreeQuestionId() - else: - if self.__CheckQuestionIdFree(QuestionId) =3D=3D False: - return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED - self.__MarkQuestionIdUsed(QuestionId) - - pNodeList[0].QuestionId =3D QuestionId - pNodeList[1].QuestionId =3D QuestionId - pNodeList[2].QuestionId =3D QuestionId - pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_DATE - pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_DATE - pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_DATE - pNodeList[0].Next =3D pNodeList[1] - pNodeList[1].Next =3D pNodeList[2] - pNodeList[2].Next =3D self.__QuestionList - self.__QuestionList =3D pNodeList[0] - - # DoPendingAssign - return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS - - def RegisterNewTimeQuestion(self, Name, BaseVarId, QuestionId): - if BaseVarId =3D=3D '' and Name =3D=3D None: - if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: - QuestionId =3D self.__GetFreeQuestionId() - else: - if self.__CheckQuestionIdFree(QuestionId) =3D=3D False: - return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED - self.__MarkQuestionIdUsed(QuestionId) - return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS - - VarIdStrList =3D [] - if BaseVarId !=3D '': - VarIdStrList.append(BaseVarId + '.Hour') - VarIdStrList.append(BaseVarId + '.Minute') - VarIdStrList.append(BaseVarId + '.Second') - - else: - VarIdStrList.append(Name + '.Hour') - VarIdStrList.append(Name + '.Minute') - VarIdStrList.append(Name + '.Second') - - pNodeList =3D [] - pNode =3D SVfrQuestionNode(Name, VarIdStrList[0], TIME_HOUR_BITMAS= K) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - pNode =3D SVfrQuestionNode(Name, VarIdStrList[1], TIME_MINUTE_BITM= ASK) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - pNode =3D SVfrQuestionNode(Name, VarIdStrList[2], TIME_SECOND_BITM= ASK) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: - QuestionId =3D self.__GetFreeQuestionId() - else: - if self.__CheckQuestionIdFree(QuestionId) =3D=3D False: - return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED - self.__MarkQuestionIdUsed(QuestionId) - - pNodeList[0].QuestionId =3D QuestionId - pNodeList[1].QuestionId =3D QuestionId - pNodeList[2].QuestionId =3D QuestionId - pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_TIME - pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_TIME - pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_TIME - pNodeList[0].Next =3D pNodeList[1] - pNodeList[1].Next =3D pNodeList[2] - pNodeList[2].Next =3D self.__QuestionList - self.__QuestionList =3D pNodeList[0] - - # DoPendingAssign - return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS - - def RegisterRefQuestion(self, Name, BaseVarId, QuestionId): - - if BaseVarId =3D=3D '' and Name =3D=3D None: - return QuestionId, VfrReturnCode.VFR_RETURN_FATAL_ERROR - - VarIdStrList =3D [] - if BaseVarId !=3D '': - VarIdStrList.append(BaseVarId + '.QuestionId') - VarIdStrList.append(BaseVarId + '.FormId') - VarIdStrList.append(BaseVarId + '.FormSetGuid') - VarIdStrList.append(BaseVarId + '.DevicePath') - - else: - VarIdStrList.append(BaseVarId + '.QuestionId') - VarIdStrList.append(BaseVarId + '.FormId') - VarIdStrList.append(BaseVarId + '.FormSetGuid') - VarIdStrList.append(BaseVarId + '.DevicePath') - - pNodeList =3D [] - pNode =3D SVfrQuestionNode(Name, VarIdStrList[0]) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - pNode =3D SVfrQuestionNode(Name, VarIdStrList[1]) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - pNode =3D SVfrQuestionNode(Name, VarIdStrList[2]) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - pNode =3D SVfrQuestionNode(Name, VarIdStrList[3]) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return QuestionId, VfrReturnCode.VFR_RETURN_OUT_FOR_RESOURCES - - if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: - QuestionId =3D self.__GetFreeQuestionId() - else: - if self.__CheckQuestionIdFree(QuestionId) =3D=3D False: - return QuestionId, VfrReturnCode.VFR_RETURN_REDEFINED - self.__MarkQuestionIdUsed(QuestionId) - - pNodeList[0].QuestionId =3D QuestionId - pNodeList[1].QuestionId =3D QuestionId - pNodeList[2].QuestionId =3D QuestionId - pNodeList[3].QuestionId =3D QuestionId - - pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_REF - pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_REF - pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_REF - pNodeList[3].QType =3D EFI_QUESION_TYPE.QUESTION_REF - - pNodeList[0].Next =3D pNodeList[1] - pNodeList[1].Next =3D pNodeList[2] - pNodeList[2].Next =3D pNodeList[3] - pNodeList[3].Next =3D self.__QuestionList - self.__QuestionList =3D pNodeList[0] - x =3D self.__QuestionList - - # DoPendingAssign - - return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS - - def RegisterOldDateQuestion(self, YearVarId, MonthVarId, DayVarId, Que= stionId): - pNodeList =3D [] - if YearVarId =3D=3D '' or MonthVarId =3D=3D '' or DayVarId =3D=3D = '' or YearVarId =3D=3D None or MonthVarId =3D=3D None or DayVarId =3D=3D No= ne: - return QuestionId, VfrReturnCode.VFR_RETURN_ERROR_SKIPED - - pNode =3D SVfrQuestionNode(None, YearVarId, DATE_YEAR_BITMASK) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES - - pNode =3D SVfrQuestionNode(None, MonthVarId, DATE_MONTH_BITMASK) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES - - pNode =3D SVfrQuestionNode(None, DayVarId, DATE_DAY_BITMASK) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES - - if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: - QuestionId =3D self.__GetFreeQuestionId() - else: - if self.__CheckQuestionIdFree(QuestionId) =3D=3D False: - return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_R= EDEFINED - self.__MarkQuestionIdUsed(QuestionId) - - pNodeList[0].QuestionId =3D QuestionId - pNodeList[1].QuestionId =3D QuestionId - pNodeList[2].QuestionId =3D QuestionId - pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_DATE - pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_DATE - pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_DATE - pNodeList[0].Next =3D pNodeList[1] - pNodeList[1].Next =3D pNodeList[2] - pNodeList[2].Next =3D self.__QuestionList - self.__QuestionList =3D pNodeList[0] - - # DoPendingAssign - return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS - - def RegisterOldTimeQuestion(self, HourVarId, MinuteVarId, SecondVarId,= QuestionId): - pNodeList =3D [] - if HourVarId =3D=3D '' or MinuteVarId =3D=3D '' or SecondVarId =3D= =3D '' or HourVarId =3D=3D None or MinuteVarId =3D=3D None or SecondVarId = =3D=3D None: - return QuestionId, VfrReturnCode.VFR_RETURN_ERROR_SKIPED - - pNode =3D SVfrQuestionNode(None, HourVarId, TIME_HOUR_BITMASK) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES - - pNode =3D SVfrQuestionNode(None, MinuteVarId, TIME_MINUTE_BITMASK) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES - - pNode =3D SVfrQuestionNode(None, SecondVarId, TIME_SECOND_BITMASK) - if pNode !=3D None: - pNodeList.append(pNode) - else: - return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_OUT_F= OR_RESOURCES - - if QuestionId =3D=3D EFI_QUESTION_ID_INVALID: - QuestionId =3D self.__GetFreeQuestionId() - else: - if self.__CheckQuestionIdFree(QuestionId) =3D=3D False: - return EFI_QUESTION_ID_INVALID, VfrReturnCode.VFR_RETURN_R= EDEFINED - self.__MarkQuestionIdUsed(QuestionId) - - pNodeList[0].QuestionId =3D QuestionId - pNodeList[1].QuestionId =3D QuestionId - pNodeList[2].QuestionId =3D QuestionId - pNodeList[0].QType =3D EFI_QUESION_TYPE.QUESTION_TIME - pNodeList[1].QType =3D EFI_QUESION_TYPE.QUESTION_TIME - pNodeList[2].QType =3D EFI_QUESION_TYPE.QUESTION_TIME - pNodeList[0].Next =3D pNodeList[1] - pNodeList[1].Next =3D pNodeList[2] - pNodeList[2].Next =3D self.__QuestionList - self.__QuestionList =3D pNodeList[0] - - # DoPendingAssign - return QuestionId, VfrReturnCode.VFR_RETURN_SUCCESS - - def PrintAllQuestion(self, FileName): - - with open(FileName, 'w') as f: - pNode =3D self.__QuestionList - while(pNode !=3D None): - - f.write('Question VarId is {} and QuestionId is '.format(p= Node.VarIdStr)) - f.write('%d\n'%(pNode.QuestionId)) - # f.write('%#x\n'%(pNode.QuestionId)) - pNode =3D pNode.Next - - f.close() \ No newline at end of file diff --git a/BaseTools/Source/Python/VfrCompiler/__init__.py b/BaseTools/So= urce/Python/VfrCompiler/__init__.py new file mode 100644 index 0000000000..72d3a47bb7 --- /dev/null +++ b/BaseTools/Source/Python/VfrCompiler/__init__.py @@ -0,0 +1 @@ +__all__ =3D ["VfrCompiler"] diff --git a/BaseTools/Source/Python/VfrCompiler/main.py b/BaseTools/Source= /Python/VfrCompiler/main.py deleted file mode 100644 index 624cfe3aa8..0000000000 --- a/BaseTools/Source/Python/VfrCompiler/main.py +++ /dev/null @@ -1,27 +0,0 @@ -from distutils.filelist import FileList -from pickletools import uint8 -import sys -from tkinter.ttk import Treeview -from antlr4 import* -from VfrCompiler.VfrSyntaxLexer import VfrSyntaxLexer -from VfrCompiler.VfrSyntaxParser import VfrSyntaxParser -from VfrCompiler.VfrSyntaxVisitor import VfrSyntaxVisitor -from VfrCompiler.VfrError import * - -def VfrParse(Infile, YamlOutFile, JsonOutFile): - gCVfrErrorHandle.SetInputFile (Infile) - InputStream =3D FileStream(Infile) - Lexer =3D VfrSyntaxLexer(InputStream) - Stream =3D CommonTokenStream(Lexer) - Parser =3D VfrSyntaxParser(Stream) - Tree =3D Parser.vfrProgram() - Visitor =3D VfrSyntaxVisitor() - Visitor.visit(Tree) - Visitor.DumpYaml(Visitor.GetRoot(), YamlOutFile) - Visitor.DumpJson(JsonOutFile) - -if __name__ =3D=3D '__main__': - Infile =3D 'VfrCompiler/test.i' - YamlOutFile =3D 'VfrCompiler/test.yaml' - JsonOutFile =3D 'VfrCompiler/test.json' - VfrParse(Infile, YamlOutFile, JsonOutFile) --=20 2.27.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112266): https://edk2.groups.io/g/devel/message/112266 Mute This Topic: https://groups.io/mt/103100170/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-