| 658 | extern UINT8 VfrParserStart (IN FILE *, IN INPUT_INFO_TO_SYNTAX *); |
| 659 | |
| 660 | VOID |
| 661 | CVfrCompiler::Compile ( |
| 662 | VOID |
| 663 | ) |
| 664 | { |
| 665 | FILE *pInFile = NULL; |
| 666 | CHAR8 *InFileName = NULL; |
| 667 | INPUT_INFO_TO_SYNTAX InputInfo; |
| 668 | |
| 669 | if (!IS_RUN_STATUS(STATUS_PREPROCESSED)) { |
| 670 | goto Fail; |
| 671 | } |
| 672 | |
| 673 | InFileName = (mOptions.SkipCPreprocessor == TRUE) ? mOptions.VfrFileName : mOptions.PreprocessorOutputFileName; |
| 674 | |
| 675 | gCVfrErrorHandle.SetInputFile (InFileName); |
| 676 | gCVfrErrorHandle.SetWarningAsError(mOptions.WarningAsError); |
| 677 | |
| 678 | if ((pInFile = fopen (LongFilePath (InFileName), "r")) == NULL) { |
| 679 | DebugError (NULL, 0, 0001, "Error opening the input file", "%s", InFileName); |
| 680 | goto Fail; |
| 681 | } |
| 682 | |
| 683 | if (mOptions.HasOverrideClassGuid) { |
| 684 | InputInfo.OverrideClassGuid = &mOptions.OverrideClassGuid; |
| 685 | } else { |
| 686 | InputInfo.OverrideClassGuid = NULL; |
| 687 | } |
| 688 | |
| 689 | if (VfrParserStart (pInFile, &InputInfo) != 0) { |
| 690 | goto Fail; |
| 691 | } |
| 692 | |
| 693 | fclose (pInFile); |
| 694 | pInFile = NULL; |
| 695 | |
| 696 | if (gCFormPkg.HavePendingUnassigned () == TRUE) { |
| 697 | gCFormPkg.PendingAssignPrintAll (); |
| 698 | goto Fail; |
| 699 | } |
| 700 | |
| 701 | SET_RUN_STATUS (STATUS_COMPILEED); |
| 702 | return; |
| 703 | |
| 704 | Fail: |
| 705 | if (!IS_RUN_STATUS(STATUS_DEAD)) { |
| 706 | DebugError (NULL, 0, 0003, "Error parsing", "compile error in file %s", InFileName); |
| 707 | SET_RUN_STATUS (STATUS_FAILED); |
| 708 | } |
| 709 | if (pInFile != NULL) { |
| 710 | fclose (pInFile); |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | VOID |
| 715 | CVfrCompiler::AdjustBin ( |
no test coverage detected