streamParser {qmrparser} | R Documentation |
Generic interface for character processing, allowing forward and backwards translation.
Description
Generic interface for character processing. It allows going forward sequentially or backwards to a previous arbitrary position.
Each one of these functions performs an operation on or obtains information from a character sequence (stream).
Usage
streamParserNextChar(stream)
streamParserNextCharSeq(stream)
streamParserPosition(stream)
streamParserClose(stream)
Arguments
stream |
object containing information about the text to be processed and, specifically, about the next character to be read |
Details
streamParserNextChar
Reads next character, checking if position to be read is correct.
streamParserNextCharSeq
Reads next character, without checking if position to be read is correct. Implemented since it is faster than streamParserNextChar
streamParserPosition
Returns information about text position being read.
streamParserClose
Closes the stream
Value
streamParserNextChar and streamParserNextCharSeq |
Three field list:
|
streamParserPosition |
Three field list:
|
streamParserClose |
NULL |
See Also
streamParserFromFileName
streamParserFromString
Examples
stream<- streamParserFromString("Hello world")
cstream <- streamParserNextChar(stream)
while( cstream$status == "ok" ) {
print(streamParserPosition(cstream$stream))
print(cstream$char)
cstream <- streamParserNextCharSeq(cstream$stream)
}
streamParserClose(stream)