Created
October 17, 2020 13:17
-
-
Save ifknot/90d3a5d5617d79d0fcd541f08d33311d to your computer and use it in GitHub Desktop.
tokenize header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <string> | |
namespace R { | |
/** | |
* The 7 R-ish data types: | |
* r_raw, r_integer, r_numeric, r_string, r_logical, r_complex, r_date | |
* converted to tokens with an extra 'broken' token for unrecognized type | |
*/ | |
enum class token_t { raw_t, integer_t, numeric_t, string_t, logical_t, complex_t, date_t, broken_t }; | |
/** | |
* parsing input streams requires the ability to recognize the limited R-ish PODs | |
* @note unrecognized lexemes return btoken_t | |
* | |
* @param lexeme - the basic lexical unit to tokenize | |
*/ | |
token_t tokenize(std::string& lexeme); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment