{"id":169,"date":"2014-05-04T17:18:36","date_gmt":"2014-05-04T17:18:36","guid":{"rendered":"http:\/\/www.autorouter.eu\/wiki\/?page_id=169"},"modified":"2017-07-25T11:21:34","modified_gmt":"2017-07-25T11:21:34","slug":"fpal-reference","status":"publish","type":"page","link":"https:\/\/www.autorouter.aero\/wiki\/flight-plan-addressing\/fpal-reference\/","title":{"rendered":"FPAL Reference"},"content":{"rendered":"<p>FPAL is a descriptive language with a syntax similar to C.<\/p>\n<h1>Comments<\/h1>\n<p>Three types of comments are supported:<\/p>\n<ol>\n<li>Single line comments starting with # (pound)<\/li>\n<li>Single line comments starting with \/\/ (double slash)<\/li>\n<li>Multi line comments starting with \/* and ending with *\/<\/li>\n<\/ol>\n<p>Here is an example showing all three types of comments:<\/p>\n<pre># this is a comment\r\n\/*\r\n * this comment spans multiple lines\r\n *\/\r\n\/\/ another single line comment<\/pre>\n<p>Comments are ignored by the parser.<\/p>\n<h1>Strings<\/h1>\n<p>Strings are enclosed in double quotes (&#8220;). 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.<\/p>\n<h1>Language keywords<\/h1>\n<h2>rule<\/h2>\n<p>Marks an FPAL rule. Rules are found at the top level of the file. The syntax is<\/p>\n<pre>rule &lt;uuid v4&gt; {\r\n}<\/pre>\n<h2>Addressing statements<\/h2>\n<p>A rule generates output in case it matches. The following types of output are recognized:<\/p>\n<h3>info<\/h3>\n<p>The string following the statement is written as an informational message.<\/p>\n<h3>warning<\/h3>\n<p>The string following the statement is written as a warning.<\/p>\n<h3>error<\/h3>\n<p>The string following the statement is written as an error.<\/p>\n<h3>aftn<\/h3>\n<p>The list of AFTN addresses separated by spaces is added to the flight plan addresses.<\/p>\n<h3>sita<\/h3>\n<p>The list of SITA addresses separated by spaces is added to the flight plan addresses.<\/p>\n<h3>email<\/h3>\n<p>The list of email addresses separated by spaces is added to the flight plan addresses.<\/p>\n<h3>fax<\/h3>\n<p>The list of fax numbers separated by spaces is added to the flight plan addresses.<\/p>\n<h2>Conditions<\/h2>\n<p>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.<\/p>\n<pre>cond \"MY_CONDITION\" {\r\n}<\/pre>\n<p>The following conditions are supported.<\/p>\n<h3>and<\/h3>\n<p>The list of expressions contained inside the block have to evaluate to true for the condition to match.<\/p>\n<h3>or<\/h3>\n<p>One expression contained inside the black has to evaluate to true for the condition to match.<\/p>\n<h3>gand<\/h3>\n<p>Global and. Iterates over all waypoints in the global context.<\/p>\n<h3>gor<\/h3>\n<p>Global or. Iterates over all waypoints in the global context. To illustrate the concept, let&#8217;s look at a rule that would trigger on a flight plan that has a flight rule change:<\/p>\n<pre>cond {\r\n   and {\r\n      gor {\r\n         vfr;\r\n         airspace EFIN\/fir F000-F999;\r\n      }\r\n      gor {\r\n         ifr;\r\n         airspace EFIN\/fir F000-F999;\r\n      }\r\n   }\r\n}<\/pre>\n<p>This rule triggers when both elements inside the <strong>and<\/strong> match. As the outer condition would iterate over all waypoints and thus the inner conditions only &#8220;see&#8221; one waypoint, we have to use <strong>gor<\/strong> to go over all waypoints. If at least one waypoint is VFR and in the Helsinki FIR, the <strong>gor<\/strong> condition will match. The same for the second <strong>gor<\/strong> and as they both match, the surrounding <strong>and<\/strong> will match and thus the rule.<\/p>\n<h3>seq<\/h3>\n<p>Matches when the conditions inside the element are met for subsequent waypoints.<\/p>\n<pre>seq {\r\n   airport EDDS;\r\n   navaid DKB;\r\n}<\/pre>\n<p>Would match if the next waypoint after the airport EDDS is the navaid DKB.<\/p>\n<h3>not<\/h3>\n<p>None of the conditions in the expression may evaluate to true for the condition to match. <strong>not<\/strong> can be combined with other operators such as <strong>not and<\/strong>, <strong>not or<\/strong> or <strong>not dep<\/strong>.<\/p>\n<h3>dep \/ departure<\/h3>\n<p>Matches if the current waypoint is the first waypoint (departure aerodrome).<\/p>\n<h3>dest \/ destination<\/h3>\n<p>Matches if the current waypoint is the last waypoint (destination aerodrome).<\/p>\n<h3>gdep<\/h3>\n<p>Returns the first waypoint (departure aerodrome).<\/p>\n<h3>gdest<\/h3>\n<p>Returns the last waypoint (destination aerodrome).<\/p>\n<h3>false<\/h3>\n<p>Never matches.<\/p>\n<h3>true<\/h3>\n<p>Always matches. Can be used in statements like the following to test whether the waypoint is not the departure aerodrome:<\/p>\n<pre>not dep true;<\/pre>\n<h3>airspace<\/h3>\n<p>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.<\/p>\n<pre>airspace EDGG\/fir F050-F100;<\/pre>\n<p>Would match between flight level 50 and flight level 100 in the Langen FIR in Germany.<\/p>\n<h3>ident<\/h3>\n<p>Matches if the waypoint is in the given list of identifiers. This means the type of waypoint does not have to be specified.<\/p>\n<h3>airport<\/h3>\n<p>Matches if the waypoint is one of the specified airports.<\/p>\n<pre>airport EDDS;\r\nairport \"ED*\";\r\nairport EDDS EDDM;<\/pre>\n<p>The first example matches the airport EDDS, the second all airports in Germany (starting with &#8220;ED&#8221;), the latter the airports EDDS and EDDM.<\/p>\n<h3>intersection<\/h3>\n<p>Matches the waypoint if it is one of the specified IFR waypoints.<\/p>\n<pre>intersection ABTAL;\r\nintersection ABTAL VATER UNSER;<\/pre>\n<h3>navaid<\/h3>\n<p>Matches the waypoint if it is one of the given navaids.<\/p>\n<h3>vor<\/h3>\n<p>Matches the waypoint if it is one of the given VORs.<\/p>\n<h3>dme<\/h3>\n<p>Matches the waypoint if it is one of the given DMEs.<\/p>\n<h3>tacan<\/h3>\n<p>Matches the waypoint if it is one of the given TACANs.<\/p>\n<h3>ndb<\/h3>\n<p>Matches the waypoint if it is one of the given NDBs.<\/p>\n<h3>regex<\/h3>\n<p>Matches the waypoint if the given regular expression matches.<\/p>\n<h3>ifr<\/h3>\n<p>Matches the waypoint if the flight rules at the waypoint are IFR.<\/p>\n<h3>ifrgat<\/h3>\n<p>Matches the waypoint if the flight rules are IFR GAT (as opposed to IFR OAT for military IFR and other flight rules).<\/p>\n<h3>vfr<\/h3>\n<p>Matches the waypoint if the flight rules at the waypoint are VFR.<\/p>\n<h3>vfrday<\/h3>\n<p>Matches the waypoint if the flight rules at the waypoint are VFR at daytime.<\/p>\n<h3>vfrnight<\/h3>\n<p>Matches the waypoint if the flight rules at the waypoint are VFR night time.<\/p>\n<h3>mtom<\/h3>\n<p>Matches if the aircraft&#8217;s MTOM. Value is in kilograms and can be a range.<\/p>\n<pre>mtom 0 ... 1999<\/pre>\n<h3>timetable<\/h3>\n<p>A timetable expresses a date\/time span and evaluates to true when the current time is within the span.<\/p>\n<pre>timetable {\r\n   applicability 2014-05-01T00:00:00Z;\r\n   {\r\n      sat sun;\r\n   }\r\n};<\/pre>\n<p>A timetable has an applicability group and then a group with day and time of day statements.<\/p>\n<h3>otherinfo<\/h3>\n<p>Returns true when the other information part of the flight plan (item 18) matches the following criteria.<\/p>\n<pre>not otherinfo RMK\/\"ASL\\\\d{10}\";<\/pre>\n<p>This condition matches when the flight plan does not contain a RMK\/ASL with a 10 digit number.<\/p>\n<h3>flighttype<\/h3>\n<p>Matches the flight type against the expression. The following example tests for military and state flights:<\/p>\n<pre>flighttype MX;<\/pre>\n<h3>radius<\/h3>\n<p>Matches a given radius in nautical miles (NM) around a given point within a given altitude range. Example:<\/p>\n<pre>radius 25 airport LGIO MSL-F050;<\/pre>\n<h3>polygon<\/h3>\n<p>&nbsp;<\/p>\n<h3>alternate<\/h3>\n<p>Matches if either the first or second alternate is in the list of alternates given.<\/p>\n<h3>alternate1<\/h3>\n<p>Matches if the first alternate is in the list of alternates given.<\/p>\n<h3>alternate2<\/h3>\n<p>Matches if the second alternate is in the list of alternates given.<\/p>\n<h3>aircraftid<\/h3>\n<p>Matches if the aircraft ID is in the list given.<\/p>\n<h3>daylightsaving<\/h3>\n<p>Matches when\u00a0daylight time saving in the specified timezone is active.<\/p>\n<pre>daylingsaving CET<\/pre>\n<p>would evaluate to true from the last Sunday in March until the last Sunday in October.<\/p>\n<h3>GND<\/h3>\n<p>Ground level for the altitude range instruction.<\/p>\n<h3>MSL<\/h3>\n<p>Sea level for the altitude range instruction.<\/p>\n<h3>UNL<\/h3>\n<p>Unlimited ceiling for the altitude range instructions.<\/p>\n<h2>Altitude range<\/h2>\n<h1>Operators<\/h1>\n<p>The language knows the following operators.<\/p>\n<h2>At sign (@)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Colon (:)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Comma (,)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Dot (.)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Assignment (=)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Minus (-)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Left square bracket ([)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Right square bracket (])<\/h2>\n<p>&nbsp;<\/p>\n<h2>Left curly bracket ({)<\/h2>\n<p>Opens a new block. Must be closed by the right curly bracket (}).<\/p>\n<h2>Right curly bracket (})<\/h2>\n<p>Closes a block which must have been opened before with the left curly bracket ({).<\/p>\n<h2>Left parenthesis ( ( )<\/h2>\n<p>&nbsp;<\/p>\n<h2>Right parenthesis ( ) )<\/h2>\n<p>&nbsp;<\/p>\n<h2>Pound sign (#)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Question mark (?)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Semicolon (;)<\/h2>\n<p>The semicolon operator terminates a statement. It is used the same way as in C.<\/p>\n<h2>Plus (+)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Logical not (!)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Binary not (~)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Binary and (&amp;)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Binary or (|)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Binary exclusive or (^)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Asterisk\u00a0(*)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Equal (==)<\/h2>\n<p>&nbsp;<\/p>\n<h2>Not equal (!=)<\/h2>\n<p>&nbsp;<\/p>\n<h1>Variables<\/h1>\n<h2>&lt;DEP&gt;<\/h2>\n<p>The departure aerodrome ICAO identifier.<\/p>\n<h2>&lt;DEST&gt;<\/h2>\n<p>The destination aerodrome ICAO identifier.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FPAL is a descriptive language with a syntax similar to C. 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":157,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-169","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/comments?post=169"}],"version-history":[{"count":19,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages\/169\/revisions"}],"predecessor-version":[{"id":863,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages\/169\/revisions\/863"}],"up":[{"embeddable":true,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages\/157"}],"wp:attachment":[{"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/media?parent=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}