Lexer#
-
class numpy::Lexer#
numpy C++ class.
Example#
#include <numpy/np_ndarray.h>
using namespace numpy;
// Use Lexer
Lexer obj;
// ... operations ...
Other Methods#
Signature |
Return Type |
Location |
Example |
|---|---|---|---|
|
void |
df_query.h:89 |
|
|
char |
df_query.h:80 |
|
|
explicit Lexer(std::string input) : |
df_query.h:164 |
|
|
Token |
df_query.h:166 |
|
|
char |
df_query.h:84 |
|
|
Token |
df_query.h:99 |
|
|
Token |
df_query.h:115 |
|
|
Token |
df_query.h:141 |
|
|
void |
df_query.h:93 |
|
|
Token |
df_query.h:136 |
Code Examples#
The following examples are extracted from the test suite.
skip_whitespace (np_test_5_all.cpp:976)
966 assert_condition(type1 == "int", "Failed to detect int type");
967 assert_condition(type2 == "float", "Failed to detect float type");
968 assert_condition(type3 == "string", "Failed to detect string type");
969
970 // std::cout << " Tested value type detection" << std::endl;
971
972 std::cout << " -> tests passed" << std::endl;
973 }
974
975 void np_test_io_skip_whitespace() {
976 std::cout << "========= skip_whitespace() utility ============================";
977
978 // Test whitespace skipping
979 std::string test = " \t\n text";
980 size_t pos = 0;
981
982 // Skip whitespace
983 while (pos < test.size() && std::isspace(test[pos])) {
984 ++pos;
985 }