XTRAN — menu

What is XTRAN?

XTRAN is a software meta-tool we have developed that marries compiler and expert system technologies to provide the rule-driven automation of software tasks involving a wide variety of computer languages.  Through manipulation of XTRAN's Internal Representation (XIR) of these languages, specified via its powerful rules language, XTRAN allows you to automate:

By meta-tool, we mean a system for rapidly creating software development automation toolsXTRAN's powerful rules language, which we call meta-code, provides an extremely productive environment in which to develop such tools.  In this tool development environment, minor software tasks can be automated in minutes or hours, significant tasks in days, and major tasks in weeks.

XTRAN's rules language is not a "black art"; it can be learned and used by any competent senior software developer, and multiplies the developer's skills and talents, to accomplish much more for the effort expended.

We have already used XTRAN to create many such tools for analyzing, re-engineering, translating, and generating computer languages, analyzing data, and processing text, and many of them are provided with an XTRAN license, so you can start using XTRAN right out of the box.  And your senior software developers can, after training, quickly create additional automation tools using XTRAN's rules language.

Computer languages XTRAN can manipulate include:

XTRAN was invented, designed, implemented, and documented by our President and founder, Stephen F. Heffner.  His résumé is , his Curriculum Vitæ is , and his profile is .

What Can You Do with XTRAN?

XTRAN is capable of automating any software task that can be described in its powerful rules language.  We divide such tasks into several broad categories:

Code Assessment / Analysis

For code assessment / analysis, we configure XTRAN with one or more input language parsers but no output language renderers.  XTRAN's rules language provides sophisticated analysis of any language supported by an XTRAN parser.  This powerful analysis capability can also produce documentation and program descriptive information suitable for input into CASE and modeling systems.  In fact, XTRAN's analysis capability, specified through its rules language, allows you to extract any information that is present in the code, at any level of detail or abstraction, and in any form that's required.

XTRAN is usually run on a single module at a time.  However, its ability to persist information across runs allows the collection and reporting of system-wide information.  This approach is frequently used to perform global analysis of a software system using XTRAN.  We often write XTRAN analysis rules that append information from each module to a file, then digest and report the accumulated information.

Code analysis with XTRAN can be either production analysis, as part of the normal Software Development Life Cycle , or ad hoc analysis needed to address specific issues.

XTRAN-automated code analysis is especially useful in assessing a body of code in terms of:

Such an assessment is an important prerequisite to any software migration or modernization project.

In addition, continuous assessment of code provides to programming management the information it needs to keep software development on the right track.

— using XTRAN to automate code analysis

— using XTRAN to provide interactive query of code analysis results

Code Generation

For code generation, we configure XTRAN with zero or more input language parsers and renderers, depending on the code generation method used.  XTRAN rules can either generate code as XIR and render it, or generate it from a template .

Code Transformation / Re-Engineering

For code transformation / re-engineering and standardization, we configure XTRAN with a parser and a renderer for the same language.  You can then use XTRAN's powerful rules language to apply, across a body of code, any set of systematic changes that can be specified using rules.  A few examples include:

Since XTRAN makes the changes to the code's XIR, which it then renders on output, the changed code is automatically restyled in terms of indentation, curly braces, line breaking, comment tabbing, etc.  Since styling parameters are under user control, you can use XTRAN to restyle code as desired.

— using XTRAN to automate re-engineering

Code Translation

For code translation, we configure XTRAN with one or more input language parsers and one or more output language renderers.  (You can also use XTRAN's powerful code generation and re-engineering capabilities with any translation version of of XTRAN; see below for examples.)

Translation combinations we have implemented with XTRAN include:

We have in development, or are planning, additional translation combinations of assemblers, 3GLs (including C, C++, COBOL, BASIC, Fortran, RPG, Pascal, PL/I, PL/M, Ada, and Java), 4GLs, markup languages (including HTML), and meta-data languages (including XML).  Please for more information.

With each XTRAN translation license, we deliver a standard set of translation rules for the appropriate language combination.  After appropriate training, you can enhance or override those rules as needed to address issues specific to the code being translated.

— using XTRAN to automate translation

Note:  We have developed the IBM Series/1 EDL and Series/1 assembly code to C versions of XTRAN in cooperation with Migration Solutions Incorporated (MSI) of Scottsdale, Arizona.  MSI have developed EFL (EDL Function Library), a run-time library that supports the C code produced by XTRAN translation from EDL.  MSI are also experts in the use of XTRAN to translate EDL and Series/1 assembly code.  In addition to supporting translation of EDL and assembly code applications, MSI also offer an EDX emulator that can provide a quick and relatively painless way to move such applications off the Series/1 hardware.

Data and Text Analysis and Manipulation

For data and text analysis and manipulation, we configure XTRAN with only a meta-code parser, and no language renderers.  You can then use XTRAN's powerful data and text manipulation capabilities.  The rules language allows you to read and write text files as desired.

XTRAN's regular expression, delimited list manipulation, and content-addressable data base capabilities, along with the other capabilities of its rules language, make it an extremely powerful data and text analysis and manipulation engine.

— using XTRAN to automate data analysis and manipulation

— using XTRAN to automate text analysis and manipulation

— using XTRAN to provide interactive query of data and text analysis results

Combining XTRAN's Capabilities

Automating a complex software task often requires a combination of XTRAN's analysis, re-engineering, translation, code generation, and data manipulation capabilities.

— combining XTRAN's capabilities

Code Quality Monitoring & Remediation

A critical part of running a successful software development operation is to maintain a high level of code quality, and adherence to the shop's coding standards and conventions.  Of course, the definition of code quality varies from shop to shop, as do coding standards and conventions.

So an important property of any mechanism used to monitor code quality and remediate quality issues is flexibility — the ability to tailor the code quality analysis and remediation to the shop's definition of that quality, and to the shop's coding standards and conventions.

Monitoring code demographics and quality

A license for any code analysis version of XTRAN comes with a wide variety of rules for measuring code "demographics" and quality:

You can use all of these rules that come with XTRAN "as is", or you can adapt them to your shop's definition of code quality and to your coding standards and conventions.  And, after training, you can create XTRAN rules to add your own code demographics and quality analysis automation, working exactly the way you want it to.

We recommend that you inject such code quality and standards adherence analysis into the Software Development Life Cycle as early as possible — at the point where the developer has a clean compile of new or changed code and is ready to submit it to a build for testing.   If it gets a passing grade, on it goes; if not, back it goes to the developer while it's still fresh in his/her mind.

The code quality analysis should cover 3 main issues:

We know that the earlier a code defect is caught, the less it costs to fix and the less damage it does; this approach detects as many defects as possible, as early as possible.

The quality analysis process can send any negative results back to the developer while the code is fresh in his/her mind, and can also notify the development manager of the developer's performance on such tests so the manager can monitor the developers and catch problem trends early.

XTRAN provides the combination of code analysis power and flexibility to automate the code quality program described above. 

— using XTRAN to provide interactive query of code quality analysis results

Automating code quality remediation

Of course, if you monitor code quality continuously using XTRAN, as shown above, remediating it is never necessary.  But there are situations where it is.  For instance:

A license for any re-engineering or translation version of XTRAN comes with a wide variety of rules for automating the remediation of code quality issues:

You can use all of these rules that come with XTRAN "as is", or you can adapt them to your shop's definition of code quality and to your coding standards and conventions.  And, after training, you can create XTRAN rules to add your own code quality remediation automation, working exactly the way you want it to. 

Legacy Modernization & Migration

Many existing legacy software systems represent major investments that must be modernized and/or migrated in order to provide the agility required to remain competitive:

The best modernization and/or migration strategy will likely involve one or more of the following alternatives:

When it comes time to modernize and/or migrate your legacy applications, XTRAN can play a vital role in automating virtually every aspect of the process.  Achieving a high level of software development automation is critical to the success of the project, to reduce the number of bugs introduced, and ultimately, to reduce the risk of failure.

Code modernization

Code migration

Forensic Code, Data, and Text Analysis

In civil and criminal legal proceedings involving computer code, computerized data, or text, it is sometimes necessary to analyze them to determine their implications for the legal case.  XTRAN's powerful code analysis, data analysis, and text manipulation capabilities are ideal for this, and can be "tuned" to specific requirements using XTRAN's rules language.

Similarly, Information Security ("InfoSec") activities often require such analysis, to look for vulnerabilities in code such as "back doors" and the notorious "buffer overflow" code defect.

One problem commonly encountered with such analysis is the sheer bulk of code, data, or text that must be analyzed, often within a limited amount of time (sometimes dictated by a court).  XTRAN provides the automation needed to reduce this problem to manageable proportions, making it possible to meet deadlines, as well as increasing accuracy and saving both time and money.

Forensic code analysis may involve:

Forensic analysis of computerized data may involve:

Forensic analysis of text may involve:

Stephen F.  Heffner, XTRAN's author, is himself an Expert Witness, with report, deposition, and trial testimony experience.  He has used XTRAN's forensic analysis capabilities in support of his Expert Witness activities.

— using XTRAN to provide interactive query of forensic analysis results

Additional XTRAN Applications

XTRAN's capabilities are applicable to a wide variety of additional problems, including Euro, code dialect translations, CASE tool interfaces, verification and enforcement of coding standards and styles, programming training and tutoring, and other rule-driven manipulation of computer languages, data, and text.

Ultimately, the only limit to the ways you can use XTRAN is your imagination.

How can your organization benefit from XTRAN?

The following XTRAN capabilities are available to all organizations with responsibility for a significant amount of code.  Note that all of these capabilities are realized using XTRAN's rules languageXTRAN rule sets already exist for many of these examples, and are delivered with XTRAN.  They can be enhanced and adapted by your senior systems programmers (after training), and they can create new rules as needed.

Computer manufacturer:

Independent software vendor (ISV):

Software services / outsource vendor:

Enterprise architecture / IT consultant:

Expert Witness / forensic analyst / law enforcement:

IT department:

What Computer Languages Does XTRAN Handle?

XTRAN currently accommodates a wide variety of computer languages, including:

XTRAN's modular and language-independent architecture, and its automated language parsing and rendering technologies, make it easy to add new languages.   We have additional languages in development; if you don't see your language, please .

XTRAN's Architecture

XTRAN consists of:

Here's a graphical look at XTRAN's code and data architecture:

XTRAN Code and Data

The left side represents XTRAN's code, and reflects the sequence of phases XTRAN executes when it runs.  The right side represents the data that XTRAN keeps in memory as it runs.  The arrows indicate the production and consumption of XIR by XTRAN's various execution phases.

The purple parts of XTRAN's code (language parsers and renderers) are language-specific; the remainder of the code, as well as XTRAN's own rules language, is language-independent.

This unique architecture means that a new language (or language combination) requires only the development of a parser and/or a renderer, plus existing or new rules, in order to apply the power of XTRAN to a new language manipulation problem.

XTRAN organizes all of its XIR in code treesXTRAN has many built-in code trees; you can also create your own.  For instance, you can write a rule that creates an empty code tree, parses a code source file to it, manipulates the code as XIR, renders the result to an updated code file, and deletes the code tree — all in one rule!

Internally, XTRAN is highly object-oriented.  "Computer language" is a data class, as are "parser" and "renderer".  XTRAN can be configured with multiple parsers and/or renderers as needed, to handle a mixture of input and/or output languages.  (XTRAN is always configured with at least a parser for its own rules language.)

XTRAN's Rules Language (meta-code)

XTRAN's powerful rules language (which we call meta-language or meta-code) is an evaluated, interpretive language.  Its syntax is like C, but its semantics are more like Lisp.  In terms of style, it's a mostly functional language, with some procedural elements.  It includes meta-statements, meta-expressions, meta-variables, meta-functions, and meta-comments.

Interpretive evaluation of meta-code is so fast that it allows processing of very large amounts of code in reasonable time.  For example, we performed substantial analysis and re-engineering, involving intensive XTRAN rules evaluation, on 600,000+ code lines of PL/I in just over four hours on a laptop computer.

The many capabilities offered by XTRAN through its rules language include:

We have created many XTRAN rule sets that automate a wide variety of analysis, re-engineering, and translation tasks.  We provide these rules, as appropriate, with each XTRAN license, so you can be productive with XTRAN right out of the box.  And, after appropriate training, you can create additional rules to automate both production and ad hoc software tasks.

Note that XTRAN's rules language is proprietary to XTRAN, LLC; access to it requires an XTRAN license or a Nondisclosure Agreement.  Please for more information.

XTRAN's Pattern Matching and Replacement Facilities

XTRAN provides, via its rules language, an extremely powerful suite of pattern matching and replacement facilities you can apply to code content (in the form of XIR), at both the statement and expression levels:

that use XTRAN's pattern matching and replacement facilities to automate restructuring of code and elimination of "goto"s:

XTRAN Data Bases (associative arrays)

An XTRAN in-memory data base is an n-space (with unlimited n) in which each cell is addressed using zero or more subscripts.  Effectively, each data base is a multi-dimensional associative array.  Each subscript can be either

Each data base cell can contain zero or more values, with each value being a legal XTRAN meta-expression:

Because an XTRAN data base is implemented as a sparse matrix, it can accommodate large quantities of data and still provide quick retrieval response.

XTRAN's data base facility is extremely useful for organizing code fragments and information, both when analyzing code, data, and text, and when transforming them.

and that demonstrate the use of XTRAN data bases

XTRAN's Language Parsing and Rendering Automation; XBNF

An XTRAN language parser performs the task of reading a computer language's text source code and creating the XTRAN Internal Representation (XIR) that represents that code.  XTRAN's parsing engine allows construction of a parser in XTRAN's rules language (meta-code) by describing the grammar to be parsed, using a user-friendly form of Extended Backus-Naur Form (EBNF) that we call XTRAN BNF (XBNF)XBNF, as used for parsing, references a small number of hard-coded parsing primitives, and allows recursive productions.  You can construct additional parsing primitives in meta-code using XBNFXTRAN provides a parsing XBNF trace facility that shows, in XTRAN's run log, each XBNF entity tried, against what text it was tried, and whether it succeeded or failed.

Similarly, an XTRAN language renderer performs the task of rendering a computer language's XIR as source code text and putting it out, including all of the code styling issues that implies.  XTRAN's language rendering engine allows construction of a renderer in meta-code by describing the grammar to be output, using a rendering version of XBNFXBNF, as used for rendering, references a small number of hard-coded rendering primitives, and allows recursive productions.  You can construct additional rendering primitives in meta-code using XBNF.

XBNF includes facilities for parsing and rendering:

XTRAN's parsing and rendering engines provide fully integrated dialect control, allowing a parser's or renderer's XBNF to be conditioned on the language dialect being parsed or rendered.  This dialect control is dynamic, allowing you to switch dialects during parsing or rendering if needed.

Unlike "compiler compilers" such as LEX/FLEX+YACC/Bison and ANTLR, which generate code for parsers as their output, XTRAN executes XBNF dynamically at language parsing or rendering time, including a "fastback" parsing feature.  This also means that XTRAN parsing and rendering are fully incremental.  For instance, you can write a single XTRAN rule that renders an XIR entity as text, manipulates that text, and parses the result back into XIR.

XBNF is integrated with meta-code, so a language parser or renderer can be written to be "tuned" with additional rules, dynamically if appropriate.

For historical reasons, some of XTRAN's older language parsers and renderers are hard-coded.  However, they can be enhanced and/or overridden using parsing or rendering XBNF.

XTRAN's Built-In Meta-functions — Functionality

XTRAN's rules language comes with over 450 built-in meta-functions that provide ready-to-go functionality, in the following functional areas:

You can also create your own user meta-functions, written in meta-code, that are specific to your needs.

@DBG — XTRAN's Meta-Debugger

XTRAN includes a powerful, full-featured, interactive meta-debugger, called @DBG, which allows you to control XTRAN's execution and debug your meta-code@DBG's many features include:

Many of these features are also accessible via XTRAN's command line flags or built-in meta-functions.

XTRAN Documentation

When we license and deliver XTRAN, we provide with it a variant of the XTRAN User's Manual appropriate to the licensed activity and computer languages.  The XTRAN User's Manual comprises about 50,000 lines of HTML, organized into more than 60 chapters.  It provides a thorough reference to XTRAN, with many usage examples.

Since HTML is one of the computer languages XTRAN can analyze, re-engineer, translate, and generate, we use XTRAN to cross link (Wikipedia-style) and index its own XTRAN User's Manual, and to produce variants that match licensed XTRAN activities.  and description of that process

We also use TemplaGen, a template-driven artifact generator implemented in XTRAN's rules language, to automate the generation of substantial parts of the XTRAN User's Manual, as well as significant parts of XTRAN's own code.

So XTRAN is automating itself!

We also provide, with XTRAN, a large number of stand-alone examples appropriate to licensed XTRAN activities, including actual XTRAN rules, input, and output.

Note that the XTRAN User's Manual and XTRAN examples are proprietary to XTRAN, LLC; access to them requires an XTRAN license or a Nondisclosure Agreement.  Please for more information.

Where did XTRAN Come From?

In 1983, we needed to port one of our products, XFORM, from the Digital VAX computer to the PC.  XFORM was originally written in Digital PDP-11 assembly code, but we had previously translated it to VAX assembly code, creating our CONPAX translation tool to automate that process.  (CONPAX was so successful in-house that we took it to market, and it helped over forty licensees translate millions of lines of assembly code.)  So the requirement was to translate the VAX assembly code into C.

Our Founder and President, Stephen F. Heffner, hand-translated XFORM's VAX assembly code to C.  He observed that this process was very tedious and mechanical.  However, at the same time, it required significant judgment and the application of sophisticated rules.  Since we had already created one tool for automatic translation, he began to think about how this more demanding type of translation could be automated.

In 1984, one of our large multinational clients had a problem — a large body of Digital PDP-11 assembly code needed to be ported to a more modern computer.  However, the code had been worked on by many programmers over a long period of time, and was not very well documented, either internally or externally.

They decided that, before they could port the code, they needed to fully understand what it did; in other words, they needed to create an accurate functional specification for it.  The problem was that they had very few PDP-11 assembly programmers left by then, and the few they had were heavily committed.  So they thought that, if they could somehow get the PDP-11 assembly code into C with equivalent functionality, they could put some of their C programmers to work figuring out and documenting the code.

Since they were using our XFORM product, and had previously used our CONPAX translation tool to port some of their other PDP-11 assembly code to VAX assembly code, they thought of us, and came to us with a question:  Did we think it would be possible to automate the translation of PDP-11 assembly code to C?  Because of our experience with CONPAX, and our recent experience in translating assembly code to C by hand, our answer was yes — we thought that was feasible.

Our client then issued an RFP for a feasibility study to us and four other firms, primarily compiler vendors.  We and two other vendors responded with bids, and our client funded all three of us.

Our two competitors submitted papers discussing how they would approach the problem.  Instead of a paper, we submitted a prototype of XTRAN, as a proof of concept, and successfully demonstrated the automation of assembly code translation to C using a rules-based approach.

Our client then funded us to create a full production version of XTRAN.  They got an unlimited license to it, but we kept full ownership of the product.  With help from us, they used XTRAN to translate their PDP-11 assembly code to C.  Although their original intention was to use XTRAN only as a reverse engineering tool, the resulting C code was good enough that they actually used it for the port.

Since that time, XTRAN has grown tremendously in both language coverage and overall capabilities.  It now comprises more than one-half million code lines of extremely high quality, extremely sophisticated, thoroughly documented, and highly portable C code.  However, as a testament to the robustness of XTRAN's original design and XTRAN Internal Representation (XIR), they both survive to this day, essentially in their original form.