FPAL is a descriptive language with a syntax similar to C.
Contents
- 1 Comments
- 2 Strings
- 3 Language keywords
- 4 Operators
- 4.1 At sign (@)
- 4.2 Colon (:)
- 4.3 Comma (,)
- 4.4 Dot (.)
- 4.5 Assignment (=)
- 4.6 Minus (-)
- 4.7 Left square bracket ([)
- 4.8 Right square bracket (])
- 4.9 Left curly bracket ({)
- 4.10 Right curly bracket (})
- 4.11 Left parenthesis ( ( )
- 4.12 Right parenthesis ( ) )
- 4.13 Pound sign (#)
- 4.14 Question mark (?)
- 4.15 Semicolon (;)
- 4.16 Plus (+)
- 4.17 Logical not (!)
- 4.18 Binary not (~)
- 4.19 Binary and (&)
- 4.20 Binary or (|)
- 4.21 Binary exclusive or (^)
- 4.22 Asterisk (*)
- 4.23 Equal (==)
- 4.24 Not equal (!=)
- 5 Variables
Comments
Three types of comments are supported:
- Single line comments starting with # (pound)
- Single line comments starting with // (double slash)
- Multi line comments starting with /* and ending with */
Here is an example showing all three types of comments:
# this is a comment /* * this comment spans multiple lines */ // another single line comment
Comments are ignored by the parser.
Strings
Strings are enclosed in double quotes (“). Note that identifiers such as airport names or navaid names are not strings. Strings can contain the wildcard characters asterisk (*) to match any set of characters and question mark (?) to match a single character.
Language keywords
rule
Marks an FPAL rule. Rules are found at the top level of the file. The syntax is
rule <uuid v4> { }
Addressing statements
A rule generates output in case it matches. The following types of output are recognized:
info
The string following the statement is written as an informational message.
warning
The string following the statement is written as a warning.
error
The string following the statement is written as an error.
aftn
The list of AFTN addresses separated by spaces is added to the flight plan addresses.
sita
The list of SITA addresses separated by spaces is added to the flight plan addresses.
The list of email addresses separated by spaces is added to the flight plan addresses.
fax
The list of fax numbers separated by spaces is added to the flight plan addresses.
Conditions
Conditions determine whether a rule matches. They can appear within a rule but also independently with an identifier which can then be referenced in a rule. This allows convenient sharing of conditions.
cond "MY_CONDITION" { }
The following conditions are supported.
and
The list of expressions contained inside the block have to evaluate to true for the condition to match.
or
One expression contained inside the black has to evaluate to true for the condition to match.
gand
Global and. Iterates over all waypoints in the global context.
gor
Global or. Iterates over all waypoints in the global context. To illustrate the concept, let’s look at a rule that would trigger on a flight plan that has a flight rule change:
cond { and { gor { vfr; airspace EFIN/fir F000-F999; } gor { ifr; airspace EFIN/fir F000-F999; } } }
This rule triggers when both elements inside the and match. As the outer condition would iterate over all waypoints and thus the inner conditions only “see” one waypoint, we have to use gor to go over all waypoints. If at least one waypoint is VFR and in the Helsinki FIR, the gor condition will match. The same for the second gor and as they both match, the surrounding and will match and thus the rule.
seq
Matches when the conditions inside the element are met for subsequent waypoints.
seq { airport EDDS; navaid DKB; }
Would match if the next waypoint after the airport EDDS is the navaid DKB.
not
None of the conditions in the expression may evaluate to true for the condition to match. not can be combined with other operators such as not and, not or or not dep.
dep / departure
Matches if the current waypoint is the first waypoint (departure aerodrome).
dest / destination
Matches if the current waypoint is the last waypoint (destination aerodrome).
gdep
Returns the first waypoint (departure aerodrome).
gdest
Returns the last waypoint (destination aerodrome).
false
Never matches.
true
Always matches. Can be used in statements like the following to test whether the waypoint is not the departure aerodrome:
not dep true;
airspace
Matches if the waypoint is inside the airspace specified by the statement. Airspaces are identified by the name in ADR. Optionally an altitude band can be specified. Without altitude information, the vertical extension of the airspace is used.
airspace EDGG/fir F050-F100;
Would match between flight level 50 and flight level 100 in the Langen FIR in Germany.
ident
Matches if the waypoint is in the given list of identifiers. This means the type of waypoint does not have to be specified.
airport
Matches if the waypoint is one of the specified airports.
airport EDDS; airport "ED*"; airport EDDS EDDM;
The first example matches the airport EDDS, the second all airports in Germany (starting with “ED”), the latter the airports EDDS and EDDM.
intersection
Matches the waypoint if it is one of the specified IFR waypoints.
intersection ABTAL; intersection ABTAL VATER UNSER;
navaid
Matches the waypoint if it is one of the given navaids.
vor
Matches the waypoint if it is one of the given VORs.
dme
Matches the waypoint if it is one of the given DMEs.
tacan
Matches the waypoint if it is one of the given TACANs.
ndb
Matches the waypoint if it is one of the given NDBs.
regex
Matches the waypoint if the given regular expression matches.
ifr
Matches the waypoint if the flight rules at the waypoint are IFR.
ifrgat
Matches the waypoint if the flight rules are IFR GAT (as opposed to IFR OAT for military IFR and other flight rules).
vfr
Matches the waypoint if the flight rules at the waypoint are VFR.
vfrday
Matches the waypoint if the flight rules at the waypoint are VFR at daytime.
vfrnight
Matches the waypoint if the flight rules at the waypoint are VFR night time.
mtom
Matches if the aircraft’s MTOM. Value is in kilograms and can be a range.
mtom 0 ... 1999
timetable
A timetable expresses a date/time span and evaluates to true when the current time is within the span.
timetable { applicability 2014-05-01T00:00:00Z; { sat sun; } };
A timetable has an applicability group and then a group with day and time of day statements.
otherinfo
Returns true when the other information part of the flight plan (item 18) matches the following criteria.
not otherinfo RMK/"ASL\\d{10}";
This condition matches when the flight plan does not contain a RMK/ASL with a 10 digit number.
flighttype
Matches the flight type against the expression. The following example tests for military and state flights:
flighttype MX;
radius
Matches a given radius in nautical miles (NM) around a given point within a given altitude range. Example:
radius 25 airport LGIO MSL-F050;
polygon
alternate
Matches if either the first or second alternate is in the list of alternates given.
alternate1
Matches if the first alternate is in the list of alternates given.
alternate2
Matches if the second alternate is in the list of alternates given.
aircraftid
Matches if the aircraft ID is in the list given.
daylightsaving
Matches when daylight time saving in the specified timezone is active.
daylingsaving CET
would evaluate to true from the last Sunday in March until the last Sunday in October.
GND
Ground level for the altitude range instruction.
MSL
Sea level for the altitude range instruction.
UNL
Unlimited ceiling for the altitude range instructions.
Altitude range
Operators
The language knows the following operators.
At sign (@)
Colon (:)
Comma (,)
Dot (.)
Assignment (=)
Minus (-)
Left square bracket ([)
Right square bracket (])
Left curly bracket ({)
Opens a new block. Must be closed by the right curly bracket (}).
Right curly bracket (})
Closes a block which must have been opened before with the left curly bracket ({).
Left parenthesis ( ( )
Right parenthesis ( ) )
Pound sign (#)
Question mark (?)
Semicolon (;)
The semicolon operator terminates a statement. It is used the same way as in C.
Plus (+)
Logical not (!)
Binary not (~)
Binary and (&)
Binary or (|)
Binary exclusive or (^)
Asterisk (*)
Equal (==)
Not equal (!=)
Variables
<DEP>
The departure aerodrome ICAO identifier.
<DEST>
The destination aerodrome ICAO identifier.