Name
VfrCompile.exe – Compile the framework VFR and UEFI VFR file to UEFI IFR opcode table and binary.
Synopsis
VfrCompile [-o <OutputDir>] [-b] [-l] [-n] [-c] <VfrFile>
VfrCompile.exe –h

Description
VfrCompile parses the preprocessed UEFI and Framework VFR file to generate UEFI IFR opcode table, Binary Data and IFR listing file. This tool was based on the ANTLR*(Another Tool for Language Recognition) parser to implement VFR syntax parser. The generated UEFI IFR opcode table is stored in autogen VfrFileNameBin.c.  The global data variable, named VfrFileNameBin, contains the IFR opcode table. The generated file will be placed into the output directory specified by -o option. If output directory is not specified, the generate file will be placed in current directory. The driver source code always uses this global data to register HII form packages and shows this page. The generated UEFI IFR opcode binary file is VfrFileName.hpk, which can also be registered into HII Form package. The generated IFR listing file is VfrFileName.lst, which lists the IFR opcode for each VFR statement for debug purpose. 
This is not a standalone. It is used together with the compiler preprocessor, and EDKII trim too. The VFR file is first preprocessed by the c Compiler and the output file is then trimmed to remove the unused definitions before being compiled by the VfrCompile tool to generate the UEFI IFR opcode. So the C style preprocessor directives are supported in VFR file, such as #define, #ifdef.
Options
VfrFile
The input file is a UEFI or Framework VFR file, which has been preprocessed by a Compiler and the Trim tool. The generated output file is VfrFileName.c.
-o DIR, --output-directory DIR
All generated files are placed into output directory. If this option is not specified, the default output directory is current directory.
-b, --create-ifr-package
Creates an UEFI IFR Binary HII pack file. The generated file name is VfrFileName.hpk.
-l  create an output IFR listing file
Creates an output IFR listing file (VfrFileName.lst) to list each IFR opcode for each VFR statement.
-n, --no-pre-processing
Do not preprocess the input vfr file. The input VFR file has been processed. If this option is not specified, the default behavior is same to set this option. 
Selecting this option disables preprocessing of VFR files. 
-c, --compatible-framework
Recognizes the input VFR file is the framework VFR syntax. If this option is not specified, the UEFI syntax is default the VFR syntax.
-h, --help
Print version and usage of this program and exit.
-s, --string-db
Input uni string package file.
-g, --guid
Override class guid input, format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

Status codes returned
0	The action was completed as requested.	
Nonzero	The action failed.	
Example
1. Parse the preprocessed UEFI VFR file (Vfr_Uefi.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Uefi.c).  
VfrCompile -n Vfr_Uefi.iii
2. Parse the preprocessed UEFI VFR file (Vfr_Uefi.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Uefi.c) and UEFI IFR Binary File (Vfr_Uefi.hpk)
VfrCompile -n -b Vfr_Uefi.iii
3. Parse the preprocessed UEFI VFR file (Vfr_Uefi.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Uefi.c) and UEFI IFR Binary File (Vfr_Uefi.hpk) and IFR listing file (Vfr_Uefi.lst)
VfrCompile -n -b -l Vfr_Uefi.iii
4. Parse the preprocessed Framework VFR file (Vfr_Framework.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Framework.c).  
VfrCompile -n -c Vfr_Framework.iii
5. Parse the preprocessed UEFI VFR file (Vfr_Uefi.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Uefi.c), also base on the string token number to get efi varstore name from the string binary file (Vfr_Uefi.hpk).
VfrCompile -n –s Vfr_Uefi.hpk Vfr_Uefi.iii
6. Parse the preprocessed UEFI VFR file (Vfr_Uefi.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Uefi.c), also override class guid with the input one.   
VfrCompile -n –g C153B68D-EBFC-488E-B110-662867745B87 Vfr_Uefi.iii
Bugs
No known issues.
Report bugs to edk2-devel@lists.01.org
Files
None
See also
None
License
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available 
under the terms and conditions of the BSD License which accompanies this 
distribution.  The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.