36 #ifndef _WOLFRAME_PARSE_UTILS_HPP_INCLUDED
37 #define _WOLFRAME_PARSE_UTILS_HPP_INCLUDED
52 CharTable(
const char* op=
"",
bool isInverse=
false);
84 std::map<std::string,int>
m_tab;
101 char parseNextToken( std::string& tok, std::string::const_iterator& itr, std::string::const_iterator end,
const CharTable& operatorTable,
const CharTable& alphaTable);
104 char parseNextToken( std::string& tok, std::string::const_iterator& itr, std::string::const_iterator end,
const CharTable& operatorTable);
107 char parseNextToken( std::string& tok, std::string::const_iterator& itr, std::string::const_iterator end);
110 char gotoNextToken( std::string::const_iterator& itr, std::string::const_iterator end);
116 std::string
parseLine( std::string::const_iterator& si,
const std::string::const_iterator& se);
131 std::pair<std::string,std::string>
parseTokenAssignement( std::string::const_iterator& itr, std::string::const_iterator end,
const CharTable& alphaTable);
137 std::pair<std::string,std::string>
parseTokenAssignement( std::string::const_iterator& itr, std::string::const_iterator end);
143 std::string
parseNextLine( std::string::const_iterator& itr, std::string::const_iterator end);
147 #endif // _MISC_UTILS_HPP_INCLUDED
Defines a data structure to hold positional info in a source string for error messsages etc...
std::string parseLine(std::string::const_iterator &si, const std::string::const_iterator &se)
Parse the rest of the line starting.
std::pair< std::string, std::string > parseTokenAssignement(std::string::const_iterator &itr, std::string::const_iterator end, const CharTable &alphaTable)
Parse a token assignement 'identifier = token'.
const CharTable & emptyCharTable()
Get an empty character set as table.
Character table structure for parseNextToken( std::string&,std::string::const_iterator&, std::string::const_iterator, ...);.
Definition: parseUtils.hpp:49
char gotoNextToken(std::string::const_iterator &itr, std::string::const_iterator end)
Skip to next token (skip white spaces)
Identifier table structure for parseNextIdentifier( std::string::const_iterator&, std::string::const_...
Definition: parseUtils.hpp:67
bool operator[](char ch) const
Definition: parseUtils.hpp:53
std::string tostring() const
Get the list of keywords defined as string for log messages.
const CharTable & anyCharTable()
Get the character set containing all characters as table.
std::map< std::string, int > m_tab
Definition: parseUtils.hpp:84
std::string parseNextLine(std::string::const_iterator &itr, std::string::const_iterator end)
CharTable(const char *op="", bool isInverse=false)
const CharTable & identifierCharTable()
Get the default identifier character table.
int parseNextIdentifier(std::string::const_iterator &si, const std::string::const_iterator &se, const IdentifierTable &idtab)
Parse the next identifier if it is in 'idtab' or goto the next token if not.
const char ** m_arg
Definition: parseUtils.hpp:85
bool m_casesensitive
Definition: parseUtils.hpp:83
bool m_ar[256]
Definition: parseUtils.hpp:55
const char * idstring(int id) const
Get the keyword with index 'id' (starting from 1)
char parseNextToken(std::string &tok, std::string::const_iterator &itr, std::string::const_iterator end, const CharTable &operatorTable, const CharTable &alphaTable)
Parsing the next token in a UTF-8 or Isolatin-1 string that is either.
int operator[](const std::string &) const
Lookup in table.
IdentifierTable(bool casesensitive_, const char **arg)
Constructor.