Overview of PEGTL Rules
mainPEGTL provides a vast library of rules categorized by their behavior and the character sets they target. Rules are grouped into several functional categories:
- Atomic: Basic building blocks like
eof,bol(beginning of line),eot(end of text), andeverything. - ASCII: Rules specifically targeting the ASCII character set, such as
alnum,digit,blank, andstring<C...>. - Unicode/ICU: Rules based on Unicode properties and ICU rules, including
alphabetic,id_start,id_continue, and variousgraphemeproperties. - Combinators: Rules that combine other rules, such as
seq<R...>(sequence),opt<R>(optional),star<R>(zero or more), andplus<R>(one or more). - Controlling: Rules that manage the parsing state or flow, such as
action<A, R...>,control<C, R...>, andstate<S, R...>. - Convenience: High-level rules for common patterns, like
list<R, S>,separated<S, R...>, andrep<Num, R...>. - Exceptional: Rules for error handling and conditional logic, such as
must<R...>,raise<T>, and varioustry_catchvariants. - Member: Rules that operate on members of a set, such as
not_one<M, U...>orstring<M, U...>.