Technical Capabilities
Having trouble finding what you need?
Get in touch with us, so we can answer your specific questions directly.
Get In Touch

VX/DECFORMS – DECforms IFDL Compiler and FORMS$

Overview

VX/DECFORMS is Sector7's Linux and Windows reimplementation of OpenVMS DECforms, the DEC CODASYL/FIMS forms manager. It has two halves: the IFDL compiler (vxforms), which parses Interactive Forms Definition Language source and lowers it to a C++ subroutine, and the FORMS$ Form Driver runtime (libvxdf), which links against that generated code, drives the terminal, and exposes the original DECforms callable interface.

The migration contract is source-level compatibility: an application keeps its FORMS$ calls unchanged, each form is recompiled with vxforms, and the Form Driver reproduces the original VT screen behaviour by emitting the same ANSI escape sequences DECforms used. The result is a functional emulation in which users cannot tell a migrated screen from the original. VX/DECFORMS supports nearly all DECforms syntax and can also present forms in modern HTML5 browsers, broadening access to legacy applications.

Architecture and components

VX/DECFORMS is a compiler plus a linked runtime library, not a long-running daemon. The compiler, vxforms, is a flex and bison front end that parses IFDL and emits a C++ translation unit. The runtime, libvxdf, is the Form Driver: it links directly into the migrated application, loads the generated form logic, drives the terminal, displays panels, validates input, and exposes the DECforms FORMS$ callable interface. The table maps each OpenVMS DECforms concept to its VX/DECFORMS counterpart.

VX/DECFORMS IFDL-to-C++ compilation flow
OpenVMS DECforms conceptVX/DECFORMS counterpartRoleStatus
DECforms IFDL compilerbinary vxforms (compiler/)Parses IFDL source, emits the generated C++ translation unit.live
Lexerdecforms.flexTokenises IFDL with case-insensitive keywords.live
Grammardecforms.bisonMaps IFDL syntax to the code-generator semantic actions.live
Code generatorCFromIFDL.cEmits forms_* builder calls and the Form__NAME() entry point.live
CDD/CDO dictionary forms--cvt-cdolst-ifdl conversion pathConverts a CDD/CDO listing into IFDL source for compilation.live
DECforms shareable imagelibvxdf Form Driver runtime (rtl/)Loads generated form logic, drives the terminal, executes the callable interface.live
Screen managementvxdf_screen_smg.cppVT terminal driver that emits ANSI/VT sequences directly.live
User escape / external routine dispatchvxdf_forms_callpeu.cpp, vxdf_peudispatch.cInvokes user-supplied PUE/UAR routines linked into the compiled form.live
Picture / edit fields, fixed-decimal mathvxdf_picturefield.cpp, vxdf_stringmath.cppPicture-string validation and DECforms numeric semantics.live
No curses, termcap, or terminfo. The screen driver emits VT and ANSI sequences directly, with no dependency on external terminal databases or configuration files. This is what makes the Form Driver portable across Linux and Windows.

Compilation pipeline

The build flow runs offline, once per form, and produces C++ that is compiled and linked into the application alongside the Form Driver:

Inputs converging on IFDL
IFDL sourceform.ifdl enters the compiler directly.
CDD/CDO listingConvertCDOLSTtoIFDL, also exposed as --cvt-cdolst-ifdl, converts .LST input to form.ifdl.
01Parse IFDLvxforms runs decforms.flex and decforms.bison to produce semantic actions.
02Generate C++CFromIFDL.c turns the semantic actions into form.cpp.
03 – OutputBuild the applicationCompile with c++ -std=c++11 and link libvxdf to produce the application plus Form Driver.

The generated .cpp defines one extern "C" void Form__<NAME>() entry point that preserves the original IFDL identifiers in the generated symbol names, so the form keeps its name and structure across the migration.

The IFDL compiler (vxforms)

vxforms translates IFDL source descriptions into C++ subroutines. The generated code calls a library of forms_* runtime functions plus a variadic forms_Dispatch(__VERB, ...) dispatcher keyed on implementor-key constants, rather than emitting one class per verb. Each IFDL declaration is buffered into a per-kind list (function responses, validation responses, panels, and so on) and flushed in a fixed order, and the generated symbol names preserve the original IFDL identifiers.

Command-line flags

FlagEffect
--mainAlso emit Form__Main() aliasing the first form.
--output=<file>Set the output file name.
--include=<dir>Add an IFDL include directory.
--option-file=<file>Read options from a file (for large builds).
--compile / --compile="<line>"Compile each generated .cpp via vxforms.sh or a given command line.
--cvt-cdolst-ifdl=<CDO.LST>,<out_dir>Convert a CDD/CDO listing into IFDL.
--singlelineCollapse generated output onto a single line.
--forceForce output even on error.
--no-warnings / --quietSuppress warnings / run quietly.
--trace=<items> / --yydebugCompiler-internal and grammar-rule tracing.

Generated C++

The generator emits an include of vxFormsDef.hpp, forward declarations for every response, group, icon, and field, and a single Form__<NAME>() entry that initialises the library and calls the forms_* builders:

#include "vxFormsDef.hpp"

static void FunctionResponse__KEY_F10__8();
static void Group__ACCOUNT_LIST__1();
...
    forms_Dispatch(__FIELD_DEFAULT, __PROTECTED, ...);
    forms_GroupDisplayAttributes(__VERTICAL_SPEC, __DISPLAYS, 5, __SCROLL_BY_PAGE, ...);
    forms_DeclareFunctionResponse(...);
    forms_PictureFieldDeclaration("BALANCE", ...);
    forms_Literal(__TEXT, ...);
    forms_EndGroup();

extern "C" void Form__ACCOUNT_INQUIRY()
{
    forms_LibraryInitializer((void **)&FDp, sizeof (*FDp), main_map_table);
    ...
}
Reviewable output. Because the compiler emits ordinary C++ rather than opaque binary form files, the generated form logic can be compiled with a standard c++ -std=c++11 toolchain and linked into the application like any other object.

IFDL language reference

IFDL (Interactive Forms Definition Language) is a declarative, keyword-oriented language used to describe forms: their data, layout, panels, key bindings, display attributes, and the response logic that runs at each phase of a session. VX/DECFORMS supports nearly all DECforms IFDL syntax. Keywords are matched case-insensitively by the lexer.

Top-level declarations

DeclarationPurpose
Form <name> ... EndTop-level form.
Form Data ... End DataWorking-storage record the responses read and write.
Form Record <name> ... End RecordSend / receive record layout(s).
Layout <name> ... EndA device-specific rendering of the form.
Device ... Terminal Type %VT100 ... End DeviceTarget device and terminal type.
Size <n> Lines by <m> ColumnsScreen geometry.
Viewport <name> ... End ViewportA named screen region.
Panel <name> ...A displayable panel of fields and literals.
Function <name> Is %KEY ... End FunctionBind terminal keys to a logical function.
Attribute <name> Is ... End AttributeA named video-attribute set.
<kind> Response ... End ResponseResponse blocks (send, receive, transceive, internal, function, entry, exit, validation).

Response steps

IFDL stepMeaning
Let <field> = <expr>Assign a form-data field.
Display <panel> On <viewport>Render a panel.
Message <text>Write to the message viewport.
Signal %BellEmit a terminal signal.
If <cond> Then ... Else ... End IfConditional.
Reset / Refresh / RemoveField and screen management.
Activate / DeactivateField and panel focus control.
Send / Receive / Transceive / ReturnData and flow to the application.
Call <routine>Invoke a user escape routine (external response / PUE).

IFDL example

A teller sign-on form for a banking application: a Form Data block, a Form Record, a Layout with a viewport, a key-bound function, a named attribute, and a Transceive Response. Keywords are case-insensitive, and %VT100, %CARRIAGE_RETURN, and %Bell are implementor keys.

Form TELLER_SIGNON

    Form Data
        PROGRAM_TITLE     Character(40)
        PROGRAM_DATE      Character(14)
        TELLER_ID         Character(12) Value " "
        BRANCH_MSG_FLAG   Character(1)  Value " "
        BRANCH_MSG_LINE   Character(80) Value " "
        SIGNON_ATTEMPTS   Signed longword
    End Data

    Form Record TELLER_SIGNON_REC
        SIGNON_ACTION_FLAG Character(5)
        TELLER_ID          Character(12)
        SIGNON_ATTEMPTS    Signed longword
    End Record

    Layout TELLER_SIGNON
        Device Terminal Type %VT100 End Device
        Size 24 Lines by 80 Columns

        Viewport Message_Viewport
            Lines 24 Through 24
            Columns 1 Through 80
        End Viewport

        Function Select_Item
            Is %CARRIAGE_RETURN %KP_ENTER %SELECT
        End Function

        Attribute Prompt_Attr
            Is NoBlinking NoBold Reverse NoUnderlined
        End Attribute

        Transceive Response TELLER_SIGNON_REC TELLER_SIGNON_REC
            Let PROGRAM_TITLE = "        Teller Sign-On"
            Let PROGRAM_DATE  = SCREEN_DATE
            Display Heading_Panel On Heading_Viewport
            Display Signon_Panel  On Main_Viewport
            If BRANCH_MSG_FLAG <> " "
                Then Message BRANCH_MSG_LINE
                     Signal %Bell
                     Let BRANCH_MSG_FLAG = " "
                Else Message " "
            End If
        End Response

Field data types

Character(n)
Integer
Signed longword
Unsigned longword
Signed word
Signed byte
Signed quadword
Packed
Float
DFloat
Picture (edit mask)
Picture For Date

Selected IFDL keywords

ACCEPT
ACTIVATE
ATTRIBUTE
AUTOSKIP
BLINKING
BOLD
CONCEALED
DATA
DEVICE
DISPLAY
ENABLE
ENTRY
EXIT
FIELD
FORM
FUNCTION
GROUP
HELP
ICON
IF
LAYOUT
LET
LITERAL
MESSAGE
PANEL
PICTURE
PROTECTED
RECEIVE
RECORD
REFRESH
REQUIRE
RESET
RESPONSE
REVERSE
SEND
SIGNAL
TRANSCEIVE
UNDERLINED
VALIDATION
VIEWPORT

The lexer recognises 286 single-word keywords in total, plus multi-word and implementor-key tokens.

The FORMS$ Form Driver runtime

VX/DECFORMS is a library of FORMS$ APIs that mirror the original DECforms Form Driver call interface, so a migrated application links and runs its existing FORMS$ calls without modification. Each callable service is defined once internally and exported under three names: the OpenVMS uppercase form (FORMS$ENABLE), a lowercase-linkage form (forms$enable), and the internal implementation name, so existing object references resolve unchanged.

Callable services

ServicePurposeStatus
FORMS$ENABLELoad a form and start a session on a device.live
FORMS$DISABLEEnd a session.live
FORMS$SENDOutput a record to the form.live
FORMS$RECEIVERead input from the form into a record.live
FORMS$TRANSCEIVECombined send and receive in one call.live
FORMS$CANCELCancel an outstanding request.live

Arguments are passed as VMS-style string descriptors, which the runtime adapts and converts to C strings internally. Because the signatures and descriptor conventions match the OpenVMS DECforms Form Driver, the application code that calls them does not change.

FORMS$ENABLE option keys

FORMS$K_ASTADR
FORMS$K_ASTPRM
FORMS$K_EFN
FORMS$K_END
FORMS$K_ERROR_ITEMS_NOT_SAVED
FORMS$K_ERROR_PARAMETER
FORMS$K_ERROR_ROUTINE
FORMS$K_IMAGE
FORMS$K_LANGUAGE
FORMS$K_NO_TERM_IO
FORMS$K_PRINTFILE
FORMS$K_RSB
FORMS$K_SELECTION_LABEL
FORMS$K_STACK_SIZE
FORMS$K_TRACE
FORMS$K_TRACEFILE

The forms_ builder library

The generated C++ targets a runtime library of builder and dispatch functions declared in vxFormsDef.hpp. Representative entry points:

S32  forms_DeclareForm ( __CallBack, const char *szFormName );
S32  forms_DeclareField( __CallBack, const char *szFieldName );
S32  forms_Dispatch    ( U32 Parameter, ... );   // variadic, keyed on __VERB
S32  forms_Display     ( U32 Parameter, ... );

Attribute and option keywords become implementor-key constants (for example __FIELD_DEFAULT, __PROTECTED, __DISPLAYS, __SCROLL_BY_PAGE) passed to forms_Dispatch and forms_GroupDisplayAttributes.

User escapes (PUEs and UARs)

User Escapes, also called PUEs, are custom routines written in any DEC-supported programming language and linked directly into the compiled form. The Form Driver calls them automatically in several scenarios: after field processing, before and after help requests, when function keys are pressed, and during screen refresh. In VX/DECFORMS these behave identically to those in the original OpenVMS DECforms, with the added flexibility that the IFDL compiler produces maintainable C++ into which external routines link directly, through forms_CallPEU().

DECforms features preserved

VX/DECFORMS retains the full original OpenVMS DECforms feature set. The goal is a functional emulation that preserves complex attributes and behaviour rather than altering or enhancing the core features, so migrated screens behave exactly as before.

FeatureDescription
Scrolled areasSupports scrolling form sections within DECforms layouts.
Named dataRetains structured field naming and referencing.
Overlapping formsAllows multiple forms to be layered on top of each other.
132-character modeSupports wide terminal displays.
Help formsIntegrates with VX/DCL to display user help panels.
User escape routines (PUEs)Supports user-defined event handlers linked into the compiled form.
VX/DECFORMS terminal form rendering with VT display attributes

Terminal support

The Form Driver is compatible with all VT terminals from VT100 upward, including DECterm under DECwindows, and can be extended for non-VTxxx terminals as needed. Its built-in C-based terminal drivers provide portability across Linux and Windows without relying on curses, termcap, or external terminal configuration files.

Display attributes

VX/DECFORMS reproduces the display capabilities of the DEC VT family:

  • Character attributes: reverse video, bold, blinking, and underlined text.
  • Line attributes: double-width and double-height characters, and scrolled lines.
  • Screen-width attributes: both 80-column and 132-column modes, plus reverse video.
  • Alternative character sets: full support for VT100 special graphics and line-drawing characters.

Form Driver capabilities

The Form Driver is the runtime component responsible for terminal input and output, displaying forms, managing screen manipulation, and performing basic input validation. It supports both field-based and full-form input and output, allowing values to be specified one field at a time or across the whole form, and eliminates the need for external terminal configuration files.

One current limitation. VX/DECFORMS supports nearly all DECforms syntax but does not currently support right-to-left text formatting. Everything else in the original feature set is preserved.

Migration workflow and compatibility

Originally designed for VMS, DECforms was difficult to migrate because of its complexity, VMS-specific dependencies, and platform-specific programming constructs. VX/DECFORMS removes those barriers with a set of language interface utilities that carry DECforms forms to Linux and Windows. These system-independent routines adapt VMS descriptors and enable smooth linking into modern environments.

No application code changes

The migration process does not require changes to application programs. Once the form descriptions are recompiled, the application automatically uses the new forms through the runtime system. The existing FORMS$ calls link and run unchanged, and the Form Driver reproduces the original screen behaviour, so users cannot distinguish a migrated screen from the original OpenVMS DECforms.

Supported application languages

The VX/DECFORMS utilities support applications written in multiple programming languages and provide the procedures needed to adapt VMS descriptors for each. Callable from:

LanguageSector7 migration path
COBOLVX/COBOL
FORTRANVX/FORTRAN
CVX/C
BASICVX/BASIC

Integration with VX/RT

For applications that require full integration with VMS semantics, VX/DECFORMS works together with VX/RT, Sector7's runtime support libraries for Linux, which supply the VMS descriptor handling and system-service compatibility the Form Driver builds on. Migrated forms can also be presented in modern HTML5 browsers alongside VT-terminal output, broadening access to the legacy applications.

Compatibility status

CapabilityStatus
IFDL lexer and grammarlive
IFDL to C++ code generationlive
CDD/CDO listing to IFDL conversionlive
FORMS$ callable runtime (Form Driver)live
VT100+ terminal driver (no curses or termcap)live
User escape / external routines (PUEs)live
Picture fields and fixed-decimal mathlive
Right-to-left text formattingnot currently supported

Quick reference

Compile a form

vxforms --output=form.cpp form.ifdl          # IFDL to C++
vxforms --main --compile form.ifdl           # emit Form__Main, compile via vxforms.sh
vxforms --cvt-cdolst-ifdl=CDO.LST,out_dir     # CDD/CDO listing to IFDL
c++ -std=c++11 -c form.cpp # then link with libvxdf

Runtime call skeleton

FORMS$ENABLE(&FormPtr, &Device, &Session, &FormFile, &FormName, ..., &Options);
FORMS$TRANSCEIVE(&Session, &SendRec, &SendCnt, &RecvRec, &RecvCnt, ...);
FORMS$DISABLE(&Session, &RcvCtl, ...);

IFDL skeleton

Form <NAME>
    Form Data ... End Data
    Form Record <REC> ... End Record
    Layout <NAME>
        Device Terminal Type %VT100 End Device
        Size 24 Lines by 80 Columns
        Viewport ... End Viewport
        Function ... Is %KEY End Function
        Attribute ... Is NoBlinking Bold ... End Attribute
        <kind> Response ... End Response

FORMS$ services

FORMS$ENABLE
FORMS$DISABLE
FORMS$SEND
FORMS$RECEIVE
FORMS$TRANSCEIVE
FORMS$CANCEL

Response types

Send
Receive
Transceive
Internal
Function
Entry
Exit
Validation

Frequently Asked Questions

Curious about how Sector7 can facilitate your application migration? Explore our FAQs for expert insights.

What is VX/DECFORMS and how does it help with DECforms migration?

VX/DECFORMS provides an implementation of DEC's OpenVMS DECforms that preserves form management and functionality across platforms. The solution compiles IFDL (Interactive Forms Definition Language) into C++ logic subroutines that mirror the original IFDL flow, giving a functional emulation in which users cannot tell migrated screens from the original OpenVMS DECforms. It supports nearly all DECforms syntax.

To explore how VX/DECFORMS can transform your migration project, contact our experts.

What terminal types does VX/DECFORMS support?

VX/DECFORMS is compatible with all VT terminals (VT100 and higher), including DECterm in DECwindows, ensuring broad device support across different environments.

What is the migration workflow for DECforms applications?

The migration process requires no changes to application programs – once form descriptions are updated, applications automatically utilize the new forms through the runtime system.

Does VX/DECFORMS support customization with programming languages?

VX/DECFORMS utilities support multiple programming languages including Fortran, C, COBOL, and VX/BASIC, providing the necessary procedures to adapt VMS descriptors for modern platform integration.

What are User Escapes (PUEs) and how do they work in VX/DECFORMS?

User Escapes (PUEs) are custom routines written in any DEC-supported programming language that are tied to forms and fields during creation. The Form Driver automatically triggers these procedures in several scenarios: after field processing, before and after help requests, when function keys are pressed, and during screen refresh operations.

In VX/DECFORMS the IFDL compiler converts the IFDL into C++ code, and PUEs are linked directly into the compiled form, so the Form Driver calls them at the same points as in OpenVMS DECforms.

What is VX/DECFORMS and how does it help migrate DECforms?

VX/DECFORMS is Sector7's reimplementation of OpenVMS DECforms for Linux and Windows. It compiles your existing IFDL form definitions to C++ and provides the FORMS$ Form Driver runtime, so DECforms applications keep running with the same screens and behaviour after migrating off OpenVMS.

Does VX/DECFORMS require rewriting our application code?

No. The migration process does not require changes to application programs. Existing FORMS$ calls link and run unchanged, and once the form descriptions are recompiled the application automatically uses the new forms through the runtime system.

What is FORMS$ and does VX/DECFORMS keep that API?

FORMS$ is the DECforms Form Driver callable interface. VX/DECFORMS provides a library of FORMS$ APIs that mirror the original DECforms API, including ENABLE, DISABLE, SEND, RECEIVE, TRANSCEIVE, and CANCEL, so it stays compatible with the way OpenVMS applications call DECforms.

How does the IFDL compiler work in VX/DECFORMS?

The vxforms compiler parses IFDL source and lowers it to C++ subroutines that call the forms_ runtime library. The generated code preserves the original IFDL identifiers, is compiled with a standard C++ toolchain, and links into the application alongside the Form Driver.

Which DECforms features does VX/DECFORMS preserve?

It retains nearly the full original feature set, including scrolled areas, named data, overlapping forms, 132-character mode, help forms, and user-defined routines, plus character, line, and screen-width display attributes and VT100 special graphics. The aim is a functional emulation rather than an altered feature set; the one current limitation is right-to-left text formatting.

Which terminals does VX/DECFORMS support?

It supports all VT terminals from VT100 upward, including DECterm under DECwindows, and can be extended for non-VTxxx terminals. Its built-in C-based terminal drivers work across Linux and Windows without curses, termcap, or external terminal configuration files.

Are there any DECforms features VX/DECFORMS does not support?

It supports nearly all DECforms syntax. The one current limitation is right-to-left text formatting, which is not supported at this time. Everything else in the original feature set is preserved.

Can migrated DECforms be shown in a web browser?

Yes. Alongside VT-terminal output, VX/DECFORMS can present forms in modern HTML5 browsers, broadening access to legacy applications without changing the underlying form logic.

Transform Your Legacy Software Today!

Get In Touch
Unlock the potential of your legacy software with our expert migration services.