Type: | Package |
Title: | Parsing Expression Grammars in Rcpp |
Version: | 1.0.0 |
URL: | https://github.com/Ironholds/piton |
BugReports: | https://github.com/Ironholds/piton/issues |
Author: | Os Keyes [aut, cre], Duncan Garmonsway [ctb], Colin Hirsch [cph], Daniel Frey [cph] |
Maintainer: | Os Keyes <ironholds@gmail.com> |
Description: | A wrapper around the 'Parsing Expression Grammar Template Library', a C++11 library for generating Parsing Expression Grammars, that makes it accessible within Rcpp. With this, developers can implement their own grammars and easily expose them in R packages. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
LazyData: | true |
LinkingTo: | Rcpp |
Imports: | Rcpp |
SystemRequirements: | C++11 |
RoxygenNote: | 7.1.1 |
Suggests: | testthat |
Date: | 2020-11-02 |
NeedsCompilation: | yes |
Packaged: | 2020-11-05 23:29:22 UTC; ironholds |
Repository: | CRAN |
Date/Publication: | 2020-11-15 17:00:02 UTC |
Parsing Expression Grammars in Rcpp
Description
This package wraps the PEGTL library to make Parsing Expression Grammars
available to R/C++ developers. As an exported, header-only package, it can be included
in other Rcpp codebases using depends
functionality, and is platform-independent.
See Also
the README,
or peg_sum
for an example.
Example PEG
Description
an example of a Parsing Expression Grammar (PEG) that takes a comma-separated string of digits and sums them together
Usage
peg_sum(x)
Arguments
x |
a vector of strings, each containing a comma-separated set of digits |
Value
a vector of numbers, containing either the sum of
the equivalent element of x
or (if the element
could not be parsed) NA
.
Examples
# Simple example
peg_sum("1,2, 5, 91, 34")