@reiebenezer/gdspark-parser
v0.1.2
Published
GDS command lexer/parser library
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 recordXEdelete line numberFXPpricing on selected booking classFXBlowest available pricingTTKticket issuance by TST selectorTTticket issuance with quantity
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: accepts dashed and non-dashed value entry- Example:
APM - 09171234567,APE - [email protected] TKTL: compact date formatTKTLDDMMM- Example:
TKTL05MAR XE: requires whitespace before integer line number- Example:
XE 2 TTK: requires/T<n>or/T*- Example:
TTK/T1,TTK/T* TT: requires/T<n>-<quantity>- Example:
TT/T1-3
Examples
AN15SEPILOMNL
AN15SEPILOMNL/A5J
SS1Y3
NM2SMITH/John/Peter Mr
APM - 09171234567
APE - [email protected]
TKTL05MAR
ER
XE 2
FXP
FXB
TTK/T1
TTK/T*
TT/T1-3