EXTRA Syntax Checker
EXTRA is a general purpose EXpression TRAnslator that allows you to transform the contents of files by modifying fields and creating new ones based on the values of existing fields.
There is a particular structure expected by EXTRA statements. The interactive
diagram below can be used to work out if syntax is acceptable for the
EXTRA parser, in addition to feedback from within the EXTRA dialog.
Reading Railroad Graphs
Railroad graphs are used to represent context-free grammar. Each railroad diagram begins with a double right arrow and ends with a right and left arrow pair. Lines that begin with a single right arrow are continuation lines. You read a railroad diagram from left to right and from top to bottom, following the direction of the arrows.
This example shows that you must specify values A, B, and C. Required values are shown on the main line of a railroad diagram:
This shows that you can specify value A. Optional values are shown below the main line of a railroad diagram:
The next example specifies that values A, B, and C are options, one of which you must specify:
Values A, B, and C are options in this example, one of which you can specify:
The next example shows that you can specify one or more of the values A, B, and C. Any required separator for multiple or repeated values (in this example, the comma (,)) is shown on the arrow:
In this example, you can specify value A multiple times. The separator in this example is optional:
Values A, B, and C are alternatives in the next example, one of which you can specify. If you specify none of the values shown, the default A (the value shown above the main line) is used:
The last example shows the use of a syntax fragment Name, which is shown separately from the main railroad diagram. This technique is used to simplify the diagram, or help fit it into the page of text. The fragment can be used multiple times in the railroad diagram:
Name
In the diagram below, named elements can be clicked to automatically
navigate to the railroad diagram for that element.
Extra Syntax Checks - transform
EXTRA responds to a transform. The diagram below shows that a transform can either be
- nothing (go straight to 'go')
- one statement, then 'go'
- any number of statements then 'go'
referenced by:
Extra Syntax Checks - statement
An EXTRA statement can be any of the following:
- if ...
- FIELD = expr
- delete()
- erase...
- saveonly...
referenced by:
Extra Syntax Checks - expr
An expression (expr) can be constructed using a wide range of elements,
including multiple elements:
referenced by:
Related Topics | |
|
extraExpression Translator Dialog |
|
Railroad
explanation excerpt taken from "How to read railroad diagrams",
© Copyright IBM Corporation 2015, 2021
https://www.ibm.com/docs/en/integration-bus/10.0?topic=diagrams-how-read-railroad