Token streams

The TokenStream struct supports reading of tokenizable ASCII files

API

ExtendableGrids.TokenStream — Type
mutable struct TokenStream

Tokenstream allows to read tokenized data from file without keeping the file ocntent in memory.

  • input::IOStream: Input stream
  • tokens::Vector{SubString{String}}: Array of current tokens kept in memory.
  • itoken::Int64: Position of actual token in tokens array
  • lineno::Int64: Line number in IOStream
  • comment::Char: Comment character
  • dlm::Function: Function telling if given character is a delimiter.
source
ExtendableGrids.trytoken — Method
trytoken(tks::TokenStream, expected::String) -> Bool

Try for keyword token.

It token is missing, the token read is put back into stream, a value of false is returned and the next try/gettoken command continues at the same position,

Otherwise, true is returned, and reading continues after the token found.

source