XTRAN Examples
The following examples show how you can use XTRAN, our software development meta-tool, to automate virtually any software, data, or text task.
XTRAN examples by
computer language
XTRAN examples
by activity:
- Analyze computer
languages

- Re-engineer computer
languages

- Translate computer
languages

- Generate computer
languages

- Analyze and manipulate
data

- Analyze and manipulate
text

- Query data
interactively

- Combine these capabilities
XTRAN examples
by area of application:
- Code quality monitoring and
remediation

- Reverse engineering architecture from
code

- Modernizing
code

- Migrating code
- Forensic
analysis

- Code visualization
- Code
utilities

- Web
utilities

- Data
utilities

- Text
utilities

- General
utilities

- Year 2000 (Y2K) Impact Analysis (preserved as an XTRAN illustration)
XTRAN examples by computer language
Click on your language below for examples using XTRAN to automate manipulation of that language:
- Assembler — HP (Digital, Compaq) MACRO-11
- Assembler — HP (Digital, Compaq) VAX MACRO
- Assembler — Encore (SEL, Gould)
- C

- C++

- C#

- COBOL

- EDL (IBM)
- Fortran
- HTML

- Java

- Natural (Software AG)
- Pascal
- PL/I
- PL/ix
(IBM)

- PL/M (Intel)
- RPG
- XML
Examples listed by computer language (indexed above):
- Assembler — HP (Digital, Compaq) MACRO-11
- Assembler — HP (Digital, Compaq) VAX MACRO
- Analyze
- Analyze problem operands
- Translate to C
- Translate user function entry macro
- Translate labeled structures
- Translate problem operands
- Assembler — Encore (SEL, Gould)
- C
- Analyze structure/union member offsets and sizes
- Analyze cyclomatic complexity
- Create module/function cross-reference
- Analyze year 2000 (Y2K) impact
- Restructure to
eliminate
gotos - Add I/O documentation
- Impose preprocessor macro on existing code
- Match & replace expressions
- Combine expression statements
- Eliminate dead code
- Protect included files from multiple inclusion
- Link parent statements with ending child
statements, using HTML tags

- Analyze straight-line code length by
nesting depth

- Forensic analysis of function
signatures

- Vertically align DSV data
items

- TemplaGen
— template-driven artifact generation from repository
data

- C++
- Markov analysis of statement type transitions
- Analyze year 2000 (Y2K) impact
- Restructure to
eliminate
gotos - Match & replace expressions
- Combine expression statements
- Impose preprocessor macro on existing code
- Protect included files from multiple inclusion
- Link parent statements with ending child
statements, using HTML
tags

- Vertically align DSV data
items

- C#
- Analyze year 2000 (Y2K) impact
- Combine expression statements
- Match & replace expressions
- Restructure to
eliminate
gotos - Link parent statements with ending child
statements, using HTML
tags

- COBOL
- Analyze symbol usage
- Create abstract of
code

- Mine code for Business Rule
conditions

- Restructure to eliminate
GO TOs
- Combine arithmetic
statements

- Replace arithmetic statements with
COMPUTEs

- EDL (IBM Series/1)
- Fortran
- HTML
- Generate HTML table rows from DSV
data

- Analyze tag & attribute usage
- Analyze embedded substitution usage
- Cross-link and index documents
- Generate image table
- Error check links & generate site
map

- Mine Web pages for
keywords

- Insert anchors into
HTML

- TemplaGen
— template-driven artifact generation from repository
data

- Java
- Colorize code by nesting depth, display
as HTML

- Highlight expressions, display as
HTML

- Analyze year 2000 (Y2K) impact
- Match & replace expressions
- Combine expression statements
- Link parent statements with ending child
statements, using HTML
tags

- Natural (Software AG)
- Pascal
- Create module/function cross-reference
- Translate to C
- Translate array subscripts
- Automatically "unnest" PROCEDUREs & FUNCTIONs
- Translate string operations
- PL/I
- Analyze computer language features
used

- Analyze constant/expression PROCEDURE arguments
- Analyze knots (GOTO crossings)
- Highlight file I/O & display I/O code, display as HTML
- Create module/function cross-reference
- Query module/function analysis results
interactively

- Restructure to
eliminate
GOTOs - Eliminate dead code
- Translate to C
- Translate PROCEDURE arguments
- Translate parameters/arguments as "by value"
- PL/ix (IBM)
- PL/M (Intel)
- Create module/function cross-reference
- Analyze year 2000 (Y2K) Impact
- Translate to C
- $INCLUDE implies typedef'd data type
- Translate CALL statement
- Translate BASED() attribute, using cast pointers
- Translate $IF/$ELSEIF/$ELSE Statements
- RPG
- XML
Using XTRAN to Analyze Computer Languages
Assemblers
C
C++
COBOL
HTML
Java
Natural (Software AG)
PL/I
RPG
XML
Module/Function Cross-References
These examples illustrate the language-independent nature of XTRAN's rules language. They were all produced using exactly the same set of rules.
Interactive query of code mining
results ![]()
Using XTRAN
for Year 2000 (Y2K) Impact
Analysis
Using XTRAN to Re-Engineer Computer Languages
C
Restructure to
eliminate gotos
Combine C, C++, Java, or C#
expression statements
C++
Restructure to
eliminate gotos
Combine C, C++, Java, or C#
expression statements
Impose preprocessor macro on existing
code
C#
COBOL
HTML
Java
PL/I
XML
Using XTRAN to Translate Computer Languages
Translate assemblers to C
HP (Digital, Compaq) MACRO-11
assembler
HP (Digital, Compaq) VAX MACRO
assembler
User function entry macro in HP
(Digital, Compaq) VAX MACRO
Labeled structures in HP (Digital,
Compaq) VAX MACRO
Translate Fortran to C
Translate IBM Series/1 EDL to C
Translate Pascal to C
Translate PL/I to C
Translate PL/ix to C++
Translate PL/M to C
Using XTRAN to Generate Computer Languages
Error check HTML links &
generate site map ![]()
Create script to renumber
files ![]()
Cross Link and Index HTML
Documents
TemplaGen —
template-driven artifact generation from repository data
Using XTRAN to Analyze and Manipulate Data
Generate HTML table rows from DSV
data ![]()
Load DSV data into
XTRAN data base (associative array)
![]()
Normalize vocabulary in DSV
data ![]()
Tally DSV values by field
name ![]()
Normalize tags and vocabulary in
XML ![]()
Create script to renumber
files ![]()
Recursive vs. iterative factorial
computation ![]()
Interactive query of data mining
results ![]()
Vertically align DSV data
items ![]()
TemplaGen
— template-driven artifact generation from repository
data
Using XTRAN to Analyze and Manipulate Text
Format text items into
columns ![]()
Interactive query of text mining
results ![]()
Command-driven text processing
utility (ProcText)
![]()
Vertically align DSV data
items ![]()
Compute Fog Index for prose
text ![]()
TemplaGen
— Template-driven artifact generation from repository
data
Combining Multiple XTRAN Capabilities
The following example combines XTRAN's code analysis, re-engineering, generation, data analysis, and text manipulation capabilities.
Using XTRAN to monitor and remediate code quality
Analyze cyclomatic complexity of C, C++,
Java, or C#
Analyze knots (GOTO crossings) in
PL/I
Analyze Straight-line Code Length
by Nesting Depth ![]()
Restructure C, C++, or C# to
eliminate gotos
Restructure COBOL to eliminate GO
TOs ![]()
Restructure PL/I to
eliminate GOTOs
Impose C/C++ preprocessor macro on
existing code
Combine C, C++, Java, or C# expression
statements
Combine COBOL arithmetic
statements ![]()
Colorize code by nesting depth, display
as HTML ![]()
Using XTRAN to reverse engineer architecture from code
Create module/function cross-reference
(language-independent rules):
Analyze computer language features
used ![]()
Mine code for Business Rule
conditions
Analyze structure/union member offsets and
sizes in C, C++, Java, or C#
Analyze HP (Digital, Compaq) MACRO-11
assembler
Analyze HP (Digital, Compaq) VAX MACRO
assembler
Highlight file I/O & display I/O
code in PL/I, display as HTML
Link parent statements with ending child
statements, using HTML
tags ![]()
Analyze tag and attribute usage in
HTML
Analyze embedded substitution usage in
HTML
Analyze tag and attribute usage in
XML
Analyze entity reference usage in
XML
Markov analysis of statement type
transitions in C++
Using XTRAN to modernize code
Add I/O documentation to C, C++, Java, or
C#
Mine code for Business Rule
conditions
Impose C/C++ preprocessor macro on
existing code
Protect C or C++ included files from
multiple inclusion
Impose file "includes" on
existing PL/ix code
Replace COBOL arithmetic statements with
COMPUTEs ![]()
Using XTRAN to migrate code
Translate PL/I PROCEDURE arguments to C
Analyze PL/I constant/expression
PROCEDURE arguments
Translate PL/I PROCEDURE
parameters/arguments to C as "by value"
Translate Pascal array subscripts to
C
Automatically "unnest" Pascal
PROCEDUREs & FUNCTIONs when translating to C
Translate Pascal string operations to
C
Translate Fortran COMMONs and EQUIVALENCEs
to C
Translate PL/M CALL Statement to
C
$INCLUDE implies typedef'd data type when
translating PL/M to C
Translate PL/M BASED() attribute to C
using cast pointers
Translate PL/M $IF/$ELSEIF/$ELSE
Statements to C
Translate HP (Digital, Compaq) MACRO-11
assembler to C
Translate HP (Digital, Compaq) VAX MACRO
assembler to C
Translate labeled structures in HP
(Digital, Compaq) VAX MACRO to C
Analyze HP (Digital, Compaq) VAX MACRO
problem operands
Translate problem operands in HP (Digital,
Compaq) VAX MACRO to C
Translate user function entry macro in HP
(Digital, Compaq) VAX MACRO to C
Translate IBM Series/1 EDL to
C
Translate Encore (SEL, Gould) assembler to
C
Translate in-line function arguments in
Encore (SEL, Gould) assembler to C
Translate HP (Digital, Compaq) Runoff to
HTML
Translate HP (Digital, Compaq) Runoff to
Rich Text Format (RTF)
Using XTRAN for forensic analysis
Using XTRAN for code visualization
Colorize C, C++, Java, or C# code by
nesting depth, display as HTML
Highlight file I/O & display I/O
code in PL/I, display as HTML
Using XTRAN to create code utilities
Analyze computer language features
used ![]()
Mine code for Business Rule
conditions
Analyze structure/union member offsets and
sizes in C, C++, Java, or C#
Analyze XML tag & attribute
usage
Analyze XML entity reference
usage
Match & replace expressions in C,
C++, Java, or C#
Impose file "includes" on
existing PL/ix code
Protect C or C++ included files from
multiple inclusion
Link parent statements with ending child
statements, using HTML
tags ![]()
Normalize tags and vocabulary in
XML ![]()
Interactive query of code mining
results ![]()
Vertically align DSV data
items ![]()
TemplaGen
— template-driven artifact generation from repository
data
Using XTRAN to create Web utilities
Generate HTML table rows from DSV
data ![]()
Cross Link and Index HTML
Documents
Error check HTML links &
generate site map ![]()
Analyze embedded substitution usage in
HTML
Analyze tag and attribute usage in
HTML
Interactive query of HTML mining
results ![]()
TemplaGen
— template-driven artifact generation from repository
data
Using XTRAN to create data utilities
Load DSV data into
XTRAN data base (associative array)
![]()
Generate HTML table rows from DSV
data ![]()
Normalize vocabulary in DSV
data ![]()
Tally DSV values by field
name ![]()
Normalize tags and vocabulary in
XML ![]()
Interactive query of data mining
results ![]()
Vertically align DSV data
items ![]()
TemplaGen
— template-driven artifact generation from repository
data
Using XTRAN to create text utilities
Format text items into
columns ![]()
Interactive query of text mining
results ![]()
Command-driven text processing
utility (ProcText)
![]()
Vertically align DSV data
items ![]()
Compute Fog Index for prose
text ![]()
TemplaGen
— template-driven artifact generation from repository
data