![]() |
![]() |
|
|
eGen COBOL Code Generator Reference
This section contains reference pages for the BEA WebLogic Java Adapter for Mainframe eGen COBOL Code Generator (eGen utility). This information includes the rules for writing the script file that controls the code generator.
eGen COBOL
The eGen utility maps a COBOL copybook into a Java class.
Synopsis
Invoke the utility with the following command:
java com.bea.jam.egen.EgenCobol scriptfile
where:
If the JAM installation bin directory has been added to your path, then the eGen utility may also be invoked with the command:
egencobol scriptfile
Listing 2-1 Example of scriptfile.egen
### example script
#
view demo.CustomDataView from emprec.cpy
service demoService accepts CustomDataView returns CustomDataView
page demoPage "Demo Page"
{
view demo.CustomDataView
buttons
{
"Try It" service(demoService) shows demoPage
}
}
servlet demo.DemoServlet shows demoPage
Script Syntax Reserved Words
The reserved words shown in Table 2-1 must be used as specified in the Grammar section.
Note: A reserved word can be used as an identifier if it is enclosed in either single or double quotation marks (refer to General Rules).
accepts |
buttons |
class |
client |
codepage |
ejb |
from |
generate |
group |
is |
method |
page |
reset |
returns |
server |
service |
servlet |
shows |
support |
view |
xml |
|
|
|
General Rules
Grammar
The eGen COBOL script grammar uses a modified Backus-Naur Form (BNF) syntax, which is used in many industry-standard software reference guides. BNF syntax specifies a context-free grammar. Reserved words are shown in bold. Comments are in italics preceded by a dash (. ).
Results of Running the eGen COBOL Code Generator
The specified COBOL copybook is parsed for each DataView definition (described in the JAM Programming Reference section of this guide) and a Java source file for the specified DataView class is generated in the current directory.
If XML support was requested, then the following files are also produced:
viewname.dtd - DTD file
viewname.xsd - XML Schema file
For each client class definition, a Java source file is generated in the current directory for the specified class. For each EJB definition, three Java source files and a deployment descriptor text file are generated in the current directory. The names of the generated files are listed in Table 2-2.
Copyright © 2001 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.