// // PDF token parsing functions for pdfio. // // Copyright © 2021 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. // // // Include necessary headers... // #include "pdfio-private.h" // // This file parses PDF language syntax: // // << dict >> "<<" and ">>" delimit a dictionary // (string) "(" and ")" delimit a string // [array] "[" and "]" delimit an array // "<" and ">" delimit a hex string // {...} "{" and "}" delimit ??? // /name "/" starts a name with any special characters // quoted as "#HH" where HH is the byte value in hex. // %comment "%" starts a comment to the end of a line // keyword A keyword consists of upper/lowercase letters // [-+]?[0-9]*(.[0-9]*)? A number optionally starts with "+" or "-". // // Newlines are CR, LF, or CR LF. // // Strings and names are returned with the leading delimiter ("(string", // "