Plot Script
Functions | Variables
token.cpp File Reference
#include "token.hpp"
#include <cctype>
#include <iostream>
Include dependency graph for token.cpp:

Functions

void store_ifnot_empty (std::string &token, TokenSequenceType &seq)
 
TokenSequenceType tokenize (std::istream &seq)
 Split a stream into a sequnce of tokens. More...
 

Variables

const char OPENCHAR = '('
 
const char CLOSECHAR = ')'
 
const char COMMENTCHAR = ';'
 

Function Documentation

◆ store_ifnot_empty()

void store_ifnot_empty ( std::string &  token,
TokenSequenceType seq 
)

◆ tokenize()

TokenSequenceType tokenize ( std::istream &  seq)

Split a stream into a sequnce of tokens.

Parameters
seqthe input character stream
Returns
The sequence of tokens

Split a stream into a sequnce of tokens where a token is one of OPEN or CLOSE or any space-delimited string

Ignores any whitespace and comments (from any ";" to end-of-line).

Variable Documentation

◆ CLOSECHAR

const char CLOSECHAR = ')'

◆ COMMENTCHAR

const char COMMENTCHAR = ';'

◆ OPENCHAR

const char OPENCHAR = '('