Package: Ramble 0.1.1

Ramble: Parser Combinator for R

Parser generator for R using combinatory parsers. It is inspired by combinatory parsers developed in Haskell.

Authors:Chapman Siu

Ramble_0.1.1.tar.gz
Ramble_0.1.1.zip(r-4.5)Ramble_0.1.1.zip(r-4.4)Ramble_0.1.1.zip(r-4.3)
Ramble_0.1.1.tgz(r-4.4-any)Ramble_0.1.1.tgz(r-4.3-any)
Ramble_0.1.1.tar.gz(r-4.5-noble)Ramble_0.1.1.tar.gz(r-4.4-noble)
Ramble_0.1.1.tgz(r-4.4-emscripten)Ramble_0.1.1.tgz(r-4.3-emscripten)
Ramble.pdf |Ramble.html
Ramble/json (API)

# Install 'Ramble' in R:
install.packages('Ramble', repos = c('https://8bit-pixies.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/chappers/ramble/issues

On CRAN:

combinatory-parsersparser-combinatorsparsing

5.93 score 22 stars 39 scripts 113 downloads 26 exports 0 dependencies

Last updated 8 years agofrom:772f7df113. Checks:OK: 3 NOTE: 4. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 04 2024
R-4.5-winNOTENov 04 2024
R-4.5-linuxNOTENov 04 2024
R-4.4-winNOTENov 04 2024
R-4.4-macNOTENov 04 2024
R-4.3-winOKNov 04 2024
R-4.3-macOKNov 04 2024

Exports:%alt%%then%%thentree%%using%AlphaAlphaNumDigitidentidentifieritemliteralLowermanymaybenatnaturalsatisfysomespaceSpaceCheckStringsucceedsymbolthentreetokenUpper

Dependencies:

Higher-Order Functions for Parsing in R

Rendered fromHigher-Order_Functions_for_Parsing_in_R.Rmdusingknitr::rmarkdownon Nov 04 2024.

Last update: 2017-05-14
Started: 2014-12-08

Readme and manuals

Help Manual

Help pageTopics
'%alt%' is the infix notation for the 'alt' function.%alt%
'%then%' is the infix operator for the then combinator.%then%
'%thentree%' is the infix operator for the then combinator, and it is the preferred way to use the 'thentree' operator.%thentree%
'%using%' is the infix operator for using%using%
Alpha checks for single alphabet characterAlpha
AlphaNum checks for a single alphanumeric characterAlphaNum
'alt' combinator is similar to alternation in BNF. the parser '(alt(p1, p2))' recognises anything that 'p1' or 'p2' would. The approach taken in this parser follows (Fairbairn86), in which either is interpretted in a sequential (or exclusive) manner, returning the result of the first parser to succeed, and failure if neither does.alt
Digit checks for single digitDigit
'ident' is a parser which matches zero or more alphanumeric characters.ident
'identifier' creates an identifieridentifier
'item' is a parser that consumes the first character of the string and returns the rest. If it cannot consume a single character from the string, it will emit the empty list, indicating the parser has failed.item
'literal' is a parser for single symbols. It will attempt to match the single symbol with the first character in the string.literal
Lower checks for single lower case characterLower
'many' matches 0 or more of pattern 'p'. In BNF notation, repetition occurs often enough to merit its own abbreviation. When zero or more repetitions of a phrase 'p' are admissible, we simply write 'p*'. The 'many' combinator corresponds directly to this operator, and is defined in much the same way.many
'maybe' matches 0 or 1 of pattern 'p'. In EBNF notation, this corresponds to a question mark ('?').maybe
'nat' is a parser which matches one or more numeric characters.nat
'natural' creates a token parser for natural numbersnatural
Ramble is a parser generator using combinatory parsers.Ramble-package package-ramble Ramble ramble
'satisfy' is a function which allows us to make parsers that recognise single symbols.satisfy
'some' matches 1 or more of pattern 'p'. in BNF notation, repetition occurs often enough to merit its own abbreviation. When zero or more repetitions of a phrase 'p' are admissible, we simply write 'p+'. The 'some' combinator corresponds directly to this operator, and is defined in much the same way.some
'space' matches zero or more space characters.space
SpaceCheck checks for a single space characterSpaceCheck
'String' is a combinator which allows us to build parsers which recognise strings of symbols, rather than just single symbolsString
'succeed' is based on the empty string symbol in the BNF notation The 'succeed' parser always succeeds, without actually consuming any input string. Since the outcome of succeed does not depend on its input, its result value must be pre-detemined, so it is included as an extra parameter.succeed
'symbol' creates a token for a symbolsymbol
'then' combinator corresponds to sequencing in BNF. The parser '(then(p1, p2))' recognises anything that 'p1' and 'p2' would if placed in succession.then
'thentree' keeps the full tree representation of the results of parsing. Otherwise, it is identical to 'then'.thentree
'token' is a new primitive that ignores any space before and after applying a parser to a token.token
Unlist is the same as unlist, but doesn't recurse all the way to preserve the type. This function is not well optimised.Unlist
Upper checks for a single upper case characterUpper
'using' combinator allows us to manipulate results from a parser, for example building a parse tree. The parser '(p %using% f)' has the same behaviour as the parser 'p', except that the function 'f' is applied to each of its result values.using