Previous Topic Next topic Print topic


MFG command

Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

Describes the execution of the Micro Focus Generator from the command line.

Important: When you generate a program, AppMaster Builder automatically invokes the MFG, constructing a control file and executing the MFG command. However, you can optionally invoke the MFG using the MFG command at a command prompt. Do this only when you:
  • Run the generator outside of AMB.
  • Modify the AMB file tailoring skeleton to change how AMB invokes the generator.

The MFG command:

  • Executes the Micro Focus Source Code Generator rule source
  • Compiles rule source in a .DLL
  • Runs an MFG Rule Compilation Report

Syntax:

 MFG <inputfile> [<outputfile>]
 ... /RunRule=EXEC|COMPile
[... /CARDin=drive:\path\filename]
[... /CHARacterS,[(LINE|Rule|VARiable|VariableTERM|
 ...     LeftEVAL|RightEVAL|EVALs)]]
[... /[NO]CompilationDATA]
[... /[NO]CompilationRePorT]
[... /DataDefinition,[(Name=name)]
 ...     [(DynamicLinkLibrary=drive:\path\DLLfilename)]
 ...     [(eXtension=value)]
 ...     [(File)[(FileBufferSize=MIN|MAX|<value>)]
 ...     [(FileBufferType=Full|Line|None)]
 ...     [(LANGuage=CoBol|CoBoL2|CoBoLII|SCoBol|TeXT)]]
 ...     [(Path=drive:\path\filename)
 ...     [(FileBufferSize=MIN|MAX|<value>)]
 ...     [(FileBufferType=Full|Line|None)]
 ...     [(LANGuage=CoBol|CoBoL2|CoBoLII|SCoBol|TeXT)]]
 ...     [(SearchMode)[(FirstFound|Latest)]]] 
[... /[NO]ERRorOPTion,[suboption]] 
[... /Help|? [(optionname)]]
[... /LANGuage,(CoBoL|CoBoL2|CoBoLII|SCoBol|TeXT)]
[... /LeftMARgin=colmunnumber]
[... /RightMARgin=colmunnumber]
[... /LOGfile=drive:\path\logfilename]
[... /macro=drive:\path\MACROfilename]
[... /mainIN=drive:\path\MAININfilename]
[... /MCS=screengenerationname]
[... /MDB=databasetarget]
[... /MDB=datacommunicationtarget]
[... /[NO]NewBuiltinWarning]
[... /PARMin=drive:\path\controlfilename]
[... /postsOUT=drive:\path\outputfilename]
[... /PREServe,[(ALL|CoMmeNTs|LINEnumbers|LinePrefix|
 ...    LineSuffix]
[... /ProjectGroup=drive:\project\group]
[... /PSB=PSBname]
[... /RePorT=drive:\path\reportfilename]
[... /RunMode,[(EXECute|COMPile|UNParse)]]
[... /SearchMode,[(FirstFound|Latest)]
[... /TarGeTCOMPiler,[(ASseMbly|BASic|CoBoL|CoBoL2|FORTran|
 ...     JCL|PAScal|PLI|SCoBol|TeXT)]]
[... /[NO]TRACE,[(ALL|[NO]AST|[NO]EVALMESSages|[NO]LASTstmts|
 ...     [NO]UNParse|[NO]VARiableS)]]
[... /[NO]VERbose,[(ALL|HeLP|[NO]INCL[udemessages]|
 ...     [NO]ProGraMDLLmessages)]]

Syntax Rules:

  1. Enclose any option value with an embedded blank, hyphen, or slash in quotes.
  2. Prefix options with a forward slash (/) or a hyphen (-).
  3. Option syntax is flexible. You can omit parentheses and equal signs if the meaning is clear. For example, for options with sub-options, the following are all equivalent:
    • /TRACE=(AST,VARS)
    • /TRACE=(AST) /TRACE=(VARS)
    • /TRACE=AST /TRACE=VARS
    • /TRACEAST /TRACEVARS
    You can form and use shortened keywords. To form a shorter keyword, use either the capitalized letters, the first several capital letters, or the first several letters (caps or not) that uniquely identify the option. For example, for /RunMode=COMPile/n, you could use any of the following:
    • /RunMode=COMPile /RunMode=COMP
    • /RM=COMPile /RM=COMP
    • /RMCOMP /RunMo=COMP
    • /RUNM=COMP /RUNM=COM

    You could not use /RUN=COMP, because there are other RunMode options that start with /RUN.

Parameters:

Inputfile
For generating a file containing rule source that is the main input to the generator (MAININ).

For compiling a file containing rule source to be compiled.

Outputfile
For generating a file to receive the generator output (POSTSOUT). Default file is POSTSOUT in the current directory.

For compiling a DLL file to receive the compiled input file.

/RunRule=EXEC|COMPILE
For generating. the default is EXEC.

For compiling, the default is COMPILE.

Comments:

  • You can establish MFG command options using two environment variables.
    • IG_DEFAULTS, which is processed before the command line, thus establishing default values
    • IG_OVERRIDES, which is processed after the options on the command line, thus overriding any previous values
  • To establish these variables, use the operating system SET command. For example, SET IG_DEFAULTS /MDB=DB2.
  • Alternatively, you can establish options in a control file:
    • Place the options in a control file and identify the control file by prefixing it with the "at" sign ( @ ). For example: Alternatively, you can establish options in a control file. Place the options in a control file and identify the control file by prefixing it with the "at" sign ( @ ). For example:
      MFG @mygen.ctl
      MFG infile outfile.out @mygen.ctl
      MFG infile @mygen.ctl /RM=COMPILE @moreopts.ctl
    • When the same logical file (DD) or option is specified more than once, the last specification is used, regardless of whether it came from environment variables, the command line, or an option file.
    • When the same logical file (DD) or option is specified more than once, the last specification is used, regardless of whether it came from environment variables, the command line, or an option file.

Examples:

Read a file called MAININ and write a file named POSTSOUT, both in the current directory.

MFG

Read myrule.fmp and send the generated output to a file named POSTSOUT.

MFG myrule.fmp

Read myrule and send the generated output to gened.out.

MFG myrule gened.out

Read myrule.fmp and send the compiled output to myrule.dll. The RunRule option is appropriately set to COMP.

MFG myrule.fmp myrule.dll /RM=COMP

There are other ways to specify the MAININ and POSTSOUT input and output files. See the Examples section of /mainIN and /postsOUT for more information.

Previous Topic Next topic Print topic