# type checking parameters: # + concatenates rules, pad does smart padding flight_number: char(2) + pad(integer(0 .. 9999)) flight_type: char(1) # variable passed as a parameter to the template total_seats: integer(0 .. :total_seats) occupied_seats: integer(0 .. :total_seats) # length checks the list, "of string" could be implicit passenger_list: list(0 .. :total_seats) of string # further validation and processing processing: # & references a previously declared field # :flights_table could be a list or a hash # this might be more appropriate to be on # the previous "parameters" instead of here - exists &flight_number in :flights_table # maps the flight type code into a descriptive string # using the flight_types hash - map &flight_type into :flight_types # some simple and obvious checks - check $occupied_seats < &total_seats - check &passenger_list = &occupied_seats # in-template variable declaration declare: flight_types: A: Commercial B: Non-Commercial C: Cargo