Released 2018-07-31
mmap_file<>
support for Windows.Released 2018-07-22
Released 2018-06-22
pegtl/contrib/unescape.hh
to no longer accept unmatched surrogates.two
.three
.Released 2018-05-31
opt
and until
to work as documented in some rare edge cases.opt_must
and star_must
to optimise some included grammars.Released 2018-05-14
opt_must
.if_must
.Released 2018-05-01
memory_input<>
to obtain the line around a position.memory_input<>
to start again from the beginning.-fms-extensions
.-fms-extensions
is used (clang-cl
).Released 2018-02-17
TAOCPP_PEGTL_
to TAO_PEGTL_
. Compatibility macros with the old names are provided, they will be removed in version 3.0.memory_input<>
from a temporary std::string
.Released 2018-02-08
O_CLOEXEC
is not available.Released 2018-01-01
noexcept
-specifications.clang-tidy
-issues.Released 2017-12-16
Released 2017-12-14
tao::pegtl::internal::file_open
.source
parameter of string_input<>
.Released 2017-12-11
read_input<>
that accepts a FILE*
, see issue #78.apply
, apply0
and if_apply
to support apply()
/apply0()
-methods returning boolean values.raw_string
, the optional Contents...
rules' apply()
/apply0()
-methods are now called with the original states.apply()
/apply0()
-methods returning boolean values. (Thanks Joel Frederico)examples/parse_tree.cpp
.Released 2017-11-22
Released 2017-11-22
failure()
-method when a rule with an apply()
-method with a boolean return type fails.examples/abnf2pegtl.cc
.Released 2017-09-24
apply()
- or apply0()
-methods to return a bool
which is then used to determine overall success or failure of the rule to which such an action was attached.<tao/pegtl/contrib/parse_tree.hpp>
and the examples/parse_tree.cpp
application that shows how to build a parse tree. The example goes beyond a traditional parse tree and demonstrates how to select which nodes to include in the parse tree and how to transform the nodes into an AST-like structure.bom
rules for UTF-8, UTF-16 and UTF-32.config.hpp
.Released 2017-06-27
Released 2017-06-27
raw_string
with optional parameters.Released 2017-06-25
Released 2017-06-25
Released 2017-06-23
raw_string
for rules that the content must match.rep_one_min_max
and ellipsis
.TAOCPP_PEGTL_KEYWORD
macro.Released 2017-05-18
Project
Migrated to "The Art of C++".
The semantics of all parsing rules and grammars is the same as for versions 1.y.
Input Layer
Added support for custom incremental input readers.
std::FILE*
.std::istream
.position_info
to position
.position
.input
class into multiple input classes.begin()
member from class position
.Removed most parsing front-end functions.
Parsing Rules
Added combinator class minus
.
keyword
.string
rules for UTF-8, UTF-16 and UTF-32.apply
, apply0
and if_apply
rules for intrusive actions.String Macros
Renamed to TAOCPP_PEGTL_(I)STRING
.
Reduced template instantiation depth.
Other Changes
Added apply()
and apply0()
methods to control class.
Released 2016-04-06
eol
instead of hard-coded line ending.Released 2016-04-06
eol
and eolf
to accept both Unix and MS-DOS line endings.analyze()
tests).Released 2015-11-12
examples/json_changes.hh
to pegtl/contrib/changes.hh
.Released 2015-09-21
file_parser
as alias for mmap_parser
or read_parser
depending on availability of the former.json_build_one
example.Released 2015-08-23
pegtl_string_t
and pegtl_istring_t
to simplify string definitions as follows:pegtl::string< 'h', 'e', 'l', 'l', 'o' > // Normal pegtl_string_t( "hello" ) // New shortcut
examples/abnf2pegtl.cc
application that converts grammars based on ABNF (RFC 5234) into a PEGTL C++ grammar.contrib/alphabet.hh
with integer constants for alphabetic ASCII letters.Released 2015-07-31
pegtl::ucs4
to pegtl::utf32
and generally adopted UTF-32 in all naming.pegtl/contrib/unescape.hh
.S::success()
-method can now have an extended signature to get access to the current apply_mode
, action- and control class (template).contrib/raw_string
class template now calls Action<raw_string<...>::content>::apply()
with the user's state(s).Released 2015-03-29
Version 1.0.0 was a very large refactoring based on the previous years of experience. The core design and approach were kept, but nearly all details of the implementation were changed, and some parts were added to, or removed from, the library. Semantic versioning was introduced with version 1.0.0.
ifmust<>
is now if_must<>
.apply<>
and if_apply<>
that were used to directly call actions from within the grammar (reintroduced in 2.0.0), and:action<>
, in PEGTL 1.y the action class template can be chosen by the user and changed at any point in the grammar.std::string
with a copy of the matched data), therefore:at<>
and not_at<>
rules now call their subordinate rules with actions disabled.states...
arguments that are passed through all rule invocations for use by the actions are not forwarded with std::forward<>
anymore since it (usually) doesn't make much sense to move them, and accidentially moving multiple times was a possible error scenario.rep
rules for repeating a sequence of rules with more control over the acceptable or required number of repetitions.try_catch<>
and try_catch_type<>
that convert global errors, i.e. exceptions, into local errors, i.e. a return value of false
.parse()
-function, there is another class template that is called for debug/trace and error throwing purposes; both can be changed at any point within the grammar.pad< Rule, Padding >
rule contains star< Padding >
in its implementation, so a specialisation of the action-class-template for star< Padding >
would be called within pad<>
, even though the star< Pad >
was not explicitly written by the user; in PEGTL 1.y these unintended action invocations no longer occur.one<>
and range<>
also being supplied in a UTF-8 (and experimental UTF-16 and UTF-32) aware version(s) that can correctly process arbitrary code points from 0
to 0x10ffff
.parse_error
contains a vector of parse positions.list<>
-rule was replaced by a set of new list rules with different padding semantics.at_one<>
and other rules foo
that are merely shortcuts for at< foo >
were removed.if_then<>
rule was removed.error_mode
flag was removed.must<>
rules was changed to convert local failure to global failure only for the immediate sub-rules of a must<>
rule.parse
methods now return a bool
and can also produce local failures. To obtain the previous behaviour of success-or-global-failure, the top-level grammar rule has to be wrapped in a must<>
.Released 2012-12
not_at
rule regarding wrong propagation of errors (issue 3 from Google code hosting).Released 2011-02
not_at
rule regarding wrong propagation of errors (issue 3 from Google code hosting).smart_parse_string()
.space_until_eof
and blank_until_eol
.printer
and some related functions.rule_helper
to rule_base
and action_helper
to action_base
.pegtl::parse_error
.basic_debug
to only generate a grammar back-trace when a pegtl::parse_error
is flying.*_parse_*_nothrow()
parse functions._throws
substring from all remaining parse functions and changed the return type to void
.file_input
, ascii_file_input
and dummy_file_input
for custom parse functions.until
and if...
rules (consistency).action
to ifapply
and removed rule action_nth
(orthogonality).apply_nth
to nth
, and renamed some other actions (consistency).apply
and ifapply
rules (completeness).The last of these changes effectively requires custom action classes to derive either from a valid rule class, or from the new class pegtl::action_helper<>
, passing itself as template argument.
enclose
, useful for quoted strings (convenience).apply
to unconditionally apply an action with empty matched string (convenience).list
rule and added action nop
for use as default action (convenience).padl
and padr
(convenience).pad
to not suppress the padding in diagnostic messages (consistency).-std=c++0x -pedantic
(compliance).g++
, which can be overriden by $CXX
(consistency).char
is signed but -fno-strict-overflow
is not given (compliance).list/not_list/at_list/at_not_list
, but one/not_one/at_one/at_not_one
are now variadic (orthogonality).space_star
, space_plus
, blank_star
, and blank_plus
(minimalism).list
(not to be confused with the old, very different, rule list
) (convenience).seq
to invoke the marker
with a modified Must
flag for single-rule sequences (performance).until1
to be a specialisation of until
, rather than have a different name (consistency).until
rule (consistency and flexibility).rep
rule and reduced to strict repeat (minimalism).mmap()
ing an empty file (correctness).pegtl.hh
header file to the release archive...action_nth
(flexibility).action_all
back to action
(was better that way).pegtl.hh
include file out of pegtl
directory (simplicity).s_match
to match
(readability).matched
to apply
(readability).s_insert
to prepare
(consistency).action
to invoke arbitrary many actions (succinctness).ifmust
and ifthen
to accept arbitrary many 'then' rules (succinctness).names
(correctness).parse_forward
for forward iterators (completeness).parse_input
(consistency).parse_file
for files, implemented with mmap(2)
(necessity).action_nth
(flexibility).action
to action_all
(consistency).marker
to a nop when "must" is true (performance).dummy_debug
to interpret "must" tracking (consistency).PEGTL_IMPURE_OPTIMISATIONS
macro (correctness).white
, space
, or blank
(consistency).smart_parse
-functions (correctness).seq<>
and string<>
(performance).iterator_input
to forward_input (consistency).string_input
to initialise forward_input from a string (convenience).matched()
method (simplicity).rewind()
method to class iterator_input
(indirect).sexpression.cc
(correctness).string
(correctness).position
(correctness).Released 2008
Development of the PEGTL started in November 2007 as an experiment in C++0x. It is based on ideas from the YARD library by Christopher Diggins.
Copyright (c) 2007-2018 Dr. Colin Hirsch and Daniel Frey