Domain-Specific Language for Aviation Flight Planning and Operations
A specialized programming language designed for aviation professionals, featuring natural syntax for flight operations, built-in aviation calculations, and comprehensive safety validation.
^^ Flight Planning in AirLang MAIN { BRIEFING { AIRCRAFT { Registration: C-GEGL; } FLIGHT { Number: AL120; } ROUTE { Departure: 45.3225, -75.6692; Arrival: 43.6777, -79.6248; } } ENDBRIEFING; LOADSHEET { Distance = AIRPATH; PRINT { "Flight Distance: " + Distance }; } ENDLOADSHEET; } ENDMAIN;
AirLang provides domain-specific abstractions that make flight planning code more readable, maintainable, and safer.
Native support for aircraft identifiers (C-GNBL), flight numbers (AC180), coordinates, and weather data with automatic validation.
Great circle distance (AIRPATH), wind components, fuel calculations, and weight & balance computations integrated into the language.
Compile-time checking of weight limits, fuel capacity, and regulatory constraints to prevent unsafe flight configurations.
Live METAR fetching from AviationWeather.gov API with automatic parsing, wind analysis, and real-time weather data integration.
Block-structured syntax that mirrors standard aviation documentation practices and operational procedures.
Complete 7-phase compiler implementation with aviation-specific optimizations and comprehensive error handling.
Traditional compiler design enhanced with aviation-specific features
See how AirLang simplifies common aviation programming tasks
REQUEST METAR FROM "https://airlangMetar.fly";
MAIN {
BRIEFING {
AIRCRAFT {
Registration: C-GEGL;
Type: "B737-800";
MaxTakeoffWeight: 79000;
}
FLIGHT {
Number: AC180;
Date: '2025-05-15';
DepartureTime: "14:30Z";
}
ROUTE {
Departure: 45.3225, -75.6692; ^^ CYOW Ottawa
Arrival: 43.6777, -79.6248; ^^ CYYZ Toronto
}
} ENDBRIEFING;
LOADSHEET {
Distance = AIRPATH;
CruiseSpeed = 450;
FlightTime = Distance / CruiseSpeed;
PRINT { "Flight Distance: " + Distance + " nm" };
PRINT { "Estimated Flight Time: " + FlightTime + " hours" };
} ENDLOADSHEET;
} ENDMAIN;
MAIN {
LOADSHEET {
^^ Aircraft Configuration
AircraftType: "C172"; ^^ Loads certified database entry
PassengerCount = 3;
BaggageWeight = 50;
EstimatedFuelRequired = 300;
^^ Weight & Balance Calculations
TotalWeight = TOTALWEIGHT; ^^ Automatic calculation
CenterOfGravity = CENTEROFGRAVITY; ^^ CG position from datum
WeightMoment = WEIGHTBAL; ^^ Total moment calculation
^^ Safety Validation
ValidationStatus = VALIDATEWB; ^^ Returns 1 if within limits
PRINT { "Aircraft: Cessna 172 Skyhawk" };
PRINT { "Total Weight: " + TotalWeight + " lbs" };
PRINT { "CG Position: " + CenterOfGravity + " inches" };
^^ Center of Gravity Validation
IF WeightBalanceStatus != 1 THEN
PRINT { "WARNING: Weight & Balance OUT OF LIMITS" };
PRINT { "CG Position: " + CenterOfGravity + " inches from datum" };
PRINT { "CG Position may be unsafe - Check loading!" };
ENDIF;
} ENDLOADSHEET;
} ENDMAIN;
MAIN {
WEATHER {
RECEIVEDDATA {
^^ Process METAR data
METAR: "CYOW 151400Z 24015G25KT 10SM FEW030 SCT100 M02/M08 A3012";
} ENDRECEIVEDDATA;
WINDANALYSIS {
^^ Wind Calculations
WIND() WITHCONFIG {
CYOW = HEADWIND();
CYOW = CROSSWIND();
};
} ENDWINDANALYSIS;
RUNWAYDATA {
RUNWAYHEADING() WITHCONFIG {
CYOW_RUNWAY: 070;
};
} ENDRUNWAYDATA;
SAFETYALERT {
IF CYOW_WIND_GUST > 20 THEN
PRINT{"ALERT: Excessive gusts at CYOW - " + CYOW_WIND_GUST + "kt (Limit: 20kt)"};
ENDIF;
IF CYOW_CROSSWIND > 15 THEN
PRINT{"WARNING: High crosswind at CYOW - " + CYOW_CROSSWIND + "kt(Limit: 15kt)"};
ENDIF;
} ENDSAFETYALERT;
} ENDWEATHER;
DISPATCH {
REPORT {
PRINT { " Headwind: " + CYOW_HEADWIND + "kt" };
PRINT { " Crosswind: " + CYOW_CROSSWIND + "kt" };
} ENDREPORT;
} ENDDISPATCH;
} ENDMAIN;
No manual METAR entry required - fetch real-time weather data directly from the API!
^^ Request live METAR from API
REQUEST METAR FROM "CYOW";
REQUEST METAR FROM "KJFK";
MAIN {
WEATHER {
RECEIVEDDATA {
^^ Automatically fetches latest weather
METAR: "CYOW"; ^^ Live from AviationWeather.gov
METAR: "KJFK"; ^^ Parsed automatically
} ENDRECEIVEDDATA;
RUNWAYDATA {
RUNWAYHEADING() WITHCONFIG {
CYOW_RUNWAY: 070;
KJFK_RUNWAY: 040;
};
} ENDRUNWAYDATA;
WINDANALYSIS {
^^ Wind components calculated from live data
WIND() WITHCONFIG {
CYOW = HEADWIND();
CYOW = CROSSWIND();
KJFK = HEADWIND();
KJFK = CROSSWIND();
};
} ENDWINDANALYSIS;
} ENDWEATHER;
DISPATCH {
REPORT {
PRINT { "Weather data received and analyzed" };
} ENDREPORT;
} ENDDISPATCH;
} ENDMAIN;
Exciting features and enhancements planned for future releases
Integration with live METAR/TAF feeds and real-time weather data sources
Advanced fuel burn calculations, climb/descent profiles, and route optimization
Connect with aircraft communication systems for real-time flight data
Multi-aircraft operations, crew scheduling, and fleet-wide optimization tools
This project was developed as part of the CST8152 Compilers course at Algonquin College, demonstrating practical application of compiler construction techniques to domain-specific language development.