@reiebenezer/gdspark-parser
v0.1.8
Published
GDSpark command lexer/parser library
Downloads
152
Maintainers
Readme
gdspark-cli
CLI parser for GDS-style commands. It tokenizes and parses input into an AST JSON output.
Requirements
Install
bun installRun
Start interactive mode:
bun run index.tsThen enter one command per line. The CLI prints parsed AST JSON for each line.
Exit commands:
exitquit:q
Commands Covered
The parser currently supports:
ANavailability lookupSSsell/select from availabilityNMpassenger name inputAPMpassenger mobileAPEpassenger emailTKTLticketing time limitERend/save recordXEcancel segmentFXPpricing on selected booking class (WIP)FXBlowest available pricing (WIP)TTKticket issuance with quantity (WIP)
Syntax Notes
AN:ANDDMMMOOODDDwith optional/AIRLINE- Example:
AN15SEPILOMNL,AN15SEPILOMNL/A5J SS: compact formatSS<passengerCount><bookingClass><flightNumber>- Example:
SS1Y3,SS2T5 NM: one or more entries in<count><SURNAME>/<Given>/<Given>format, comma-separated for multiple entries; trailing title is supported- Example:
NM1SMITH/John Mr,NM1SMITH/John,1ROXAS/Peter APM/APE: value must be attached directly to the command code- Example:
APM09171234567,[email protected] TKTL: compact date formatTKTLDDMMM- Example:
TKTL05MAR XE: segment number must be attached directly to the command code- Example:
XE2 TTK: requires/T<n>-<quantity>- Example:
TTK/T1-3
Examples
AN15SEPILOMNL
AN15SEPILOMNL/A5J
SS1Y3
NM2SMITH/John/Peter Mr
APM09171234567
[email protected]
TKTL05MAR
ER
XE2
FXP
FXB
TTK/T1-3