@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@
@@ __|__ @@
@@-------@--o--(_)--o--@-------@@
@@ @@
@@ A I R L A N G @@
@@ @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Author: Tisha Patel
A domain-specific programming language designed for aviation flight planning and dispatch operations
๐ NEW: Version 2.0 - Real-time METAR integration now available! Jump to v2.0 features โ
No more manual METAR entry! Just provide the airport ICAO code:
REQUEST METAR FROM "CYOW"; ^^ Fetches live data automatically!
Before v2.0 (Manual):
METAR: "METAR CYOW 290100Z 07006KT 15SM SKC 06/M02 A3038";
After v2.0 (Automatic):
REQUEST METAR FROM "CYOW"; ^^ That's it! Live data from AviationWeather.gov
- โ Real-time weather data from official AviationWeather.gov API
- โ Automatic parsing - wind, temperature, visibility, altimeter, gusts
- โ Multiple airports - fetch weather for entire route
- โ Smart validation - comprehensive error handling with helpful messages
- โ Backward compatible - all v1.0 code still works
- โ Zero syntax changes - no parser or grammar modifications
REQUEST METAR FROM "KJFK";
REQUEST METAR FROM "CYOW";
MAIN {
WEATHER {
RUNWAYDATA {
RUNWAYHEADING() WITHCONFIG {
KJFK_RUNWAY: 040;
CYOW_RUNWAY: 070;
};
} ENDRUNWAYDATA;
WINDANALYSIS {
WIND() WITHCONFIG {
KJFK = HEADWIND();
KJFK = CROSSWIND();
CYOW = HEADWIND();
CYOW = CROSSWIND();
};
} ENDWINDANALYSIS;
SAFETYALERT {
IF KJFK_WIND_GUST > 25 THEN
PRINT {"WARNING: High gusts at KJFK - " + KJFK_WIND_GUST + "kt"};
ENDIF;
} ENDSAFETYALERT;
} ENDWEATHER;
} ENDMAIN;
Output:
Fetching METAR for KJFK...
โ METAR received for KJFK
Raw METAR: METAR KJFK 290151Z 04018G29KT 10SM -RA BKN050 12/04 A3021...
WARNING: High gusts at KJFK - 29kt
Variable values:
KJFK_WIND_DIR = 40
KJFK_WIND_SPEED = 18
KJFK_WIND_GUST = 29
KJFK_TEMP = 12
KJFK_HEADWIND = 18
KJFK_CROSSWIND = 0
- Windows 10/11
- Visual Studio 2022
- vcpkg package manager
- Install libcurl via vcpkg:
cd C:\vcpkg
.\vcpkg install curl:x64-windows- Clone and build:
git clone https://github.com/tishap27/AirLang.git
cd AirLang
git checkout v2.0-metar-curl-
Open in Visual Studio:
- Open
Assignment1.sln - Build โ Build Solution (Ctrl+Shift+B)
- Open
-
Copy DLLs (automatic with Post-Build event or manual):
xcopy /y "C:\vcpkg\installed\x64-windows\bin\*.dll" "x64\Debug\"New Components:
metarFetcher.c/metarFetcher.h- API communication layer- Modified
handleRequestStatement()- ICAO code detection - Enhanced error handling with aviation-specific validation
Architecture Highlights:
- Zero breaking changes - existing v1.0 code runs unmodified
- Parser-transparent - detection at execution time, not parsing
- Modular design - METAR fetching isolated in a separate module
- Error handling - comprehensive validation with user-friendly messages
Invalid ICAO code:
REQUEST METAR FROM "CYOWW";
ERROR: Invalid METAR request format: 'CYOWW'
Valid formats:
1. ICAO Code (4 letters): REQUEST METAR FROM "KJFK";
2. Full METAR string: REQUEST METAR FROM "METAR KJFK 290151Z ...";
Your input 'CYOWW' doesn't start with 'METAR'. Manual entries must begin with 'METAR '.
Network failure:
ERROR: Failed to fetch METAR for 'KJFK'
Please check:
- ICAO code is correct (e.g., KJFK, CYOW, EGLL)
- Internet connection is active
- AviationWeather.gov service is available
| Feature | v1.0 | v2.0 |
|---|---|---|
| METAR Entry | Manual string | Automatic fetch OR manual |
| Data Source | User provides | AviationWeather.gov API |
| Error Handling | Basic | Comprehensive with hints |
| Network Support | โ | โ libcurl integration |
| Backward Compatible | N/A | โ All v1.0 code works |
๐ Full v2.0 Documentation | ๐ง Migration Guide | ๐ Changelog
AirLang is a specialized domain-specific language engineered for aviation operations and flight planning workflows. Designed with aviation professionals in mind, it features native aviation syntax and comprehensive safety validation to streamline flight dispatch and planning processes.
BRIEFING {
AIRCRAFT {
AircraftID: C-GNBL;
AircraftType: "Piper Cherokee PA-28-140";
}
ROUTE {
DepartureCoords: 45.3225, -75.6692; ^^ Ottawa (CYOW)
ArrivalCoords: 43.6777, -79.6248; ^^ Toronto (CYYZ)
}
} ENDBRIEFING;
DISPATCH {
Distance = AIRPATH; ^^ Automatic great circle calculation
PRINT {"Flight distance: " + Distance + " nautical miles"};
} ENDDISPATCH;
Output:
AIRCRAFT DATABASE: Loaded PA-28-140 configuration
Flight distance: 196.10 nautical miles
DISPATCH STATUS: CLEARED FOR DEPARTURE
- Download: โฌ๏ธ AirLang ZIP
- Extract to any folder (e.g.,
C:\AirLang) - Open Command Prompt in that folder and run:
airlang install- Restart your terminal and type:
airlang helpUsage
airlang run flight_plan_demo.txt
airlang help
airlang version1. Clone: git clone https://github.com/tishap27/AirLang.git
2. Open AirLang.sln in Visual Studio 2022
3. Build โ Build Solution (Ctrl+Shift+B)
4. Run: x64\Debug\airlang.exe your_flight_plan.air- Aircraft IDs:
C-GNBL(automatic ICAO validation) - Flight Numbers:
AL123(IATA format checking) - Coordinates:
45.3225, -75.6692(precision validation) - Weather: Native METAR parsing
- Compile-time validation of weight limits
- Automatic checking of fuel capacity constraints
- Center of gravity boundary enforcement
- Weather minimums validation
- Great Circle Navigation: Sub-1% accuracy using Haversine formula
- Wind Components: Automatic headwind/crosswind calculations
- Weight & Balance: Complete CG analysis with safety margins
- Performance: Fuel burn, flight time, ground speed calculations
BRIEFING โ WEATHER โ LOADSHEET โ DISPATCH
Mirrors real aviation documentation structure
AirLang features a complete 7-stage compiler pipeline:
Source Code โ Lexical Analysis โ Parser โ Semantic Analysis โ Code Generation โ Bytecode โ Virtual Machine
- 237+ VM Instructions optimized for aviation calculations
- Finite State Automata for aviation identifier recognition
- Recursive Descent Parser with BNF grammar
- Stack-based Virtual Machine with type safety
- Custom Mathematical Library for navigation precision
MAIN {
BRIEFING {
AIRCRAFT {
AircraftID: C-GNBL;
AircraftType: "Piper Cherokee PA-28-140";
MaxTakeoffWeight: 2150;
}
ROUTE {
DepartureCoords: 45.3225, -75.6692;
ArrivalCoords: 43.6777, -79.6248;
}
} ENDBRIEFING;
LOADSHEET {
PassengerCount: 3;
PassengerWeight = PassengerCount * 170;
TotalWeight = EmptyWeight + PassengerWeight + FuelWeight;
IF TotalWeight > MaxTakeoffWeight THEN
PRINT {"WARNING: Exceeds MTOW"};
ENDIF;
} ENDLOADSHEET;
DISPATCH {
Distance = AIRPATH;
PRINT {"Flight cleared for " + Distance + " nm"};
} ENDDISPATCH;
} ENDMAIN;
WEATHER {
RECEIVEDDATA {
METAR: "METAR CYOW 251630Z 27015G25KT 5000 -RA BKN008 OVC015 08/06 A2995 RMK";
} ENDRECEIVEDDATA;
RUNWAYDATA {
RUNWAYHEADING() WITHCONFIG {
CYOW_RUNWAY: 070;
};
} ENDRUNWAYDATA;
WINDANALYSIS {
CYOW = HEADWIND();
CYOW = CROSSWIND();
} ENDWINDANALYSIS;
} ENDWEATHER;
More examples in /examples directory.
| Resource | Description |
|---|---|
| User Guide | Complete programming reference |
| Language Syntax | All language constructs and grammar |
| Tokens Reference | Built-in aviation functions |
| VM Architecture | Virtual machine instruction set |
| Examples | Sample programs and tutorials |
- General Aviation: Pre-flight planning and weight-balance
- Aviation Students: Learning aviation mathematics
- Researchers: Modeling aviation workflows and safety constraints
- Flight Schools: Teaching flight planning calculations
| Metric | Value |
|---|---|
| Compilation Speed | 41-164ms for typical programs |
| Navigation Accuracy | ยฑ0.1 nautical miles |
| Memory Usage | <50MB for complex flight plans |
| Supported Aircraft | 15+ built-in configurations |
/
โโโ src code # Compiler source code
โโโ examples/ # Sample AirLang programs
โโโ docs/ # Complete documentation
โโโ tests/ # Test suite
โโโ standalone/ # Compiled executables
# Debug build
make debug
# Release build
make release
# Run tests
make testAirLang is designed as an educational and research project. Contributions welcome:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
This project was developed as part of Computer Engineering Technology program at Algonquin College, demonstrating:
- Compiler Design Principles applied to domain-specific languages
- Aviation Domain Expertise informing language design
- Safety-Critical Software development practices
- Complete Software Engineering lifecycle
Academic Research Paper: AirLang: A Domain-Specific Language for Aviation Flight Planning and Operations
This project is licensed under the MIT License - see the LICENSE file for details.
Tisha Patel
- GitHub: @tishap27
- Email: [email protected]
- Project Website: AirLang Official Site
โญ Star this repository if AirLang helped you understand domain-specific languages or aviation programming!
Built by a pilot who codes