C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
exprtk_repl.cpp File Reference
#include <algorithm>
#include <cstdio>
#include <deque>
#include <fstream>
#include <iostream>
#include <numeric>
#include <string>
#include "exprtk.hpp"
Include dependency graph for exprtk_repl.cpp:

Go to the source code of this file.

Classes

struct  putch< T >
struct  putint< T >
struct  rnd_01< T >
struct  vector_access_rtc
class  expression_processor< T >
struct  expression_processor< T >::function_definition
struct  expression_processor< T >::parse_function_definition_impl

Functions

template<typename T>
void repl (int argc, char *argv[])
int main (int argc, char *argv[])

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 1063 of file exprtk_repl.cpp.

1064{
1065 repl<double>(argc,argv);
1066 return 0;
1067}
void repl(int argc, char *argv[])

References repl().

Here is the call graph for this function:

◆ repl()

template<typename T>
void repl ( int argc,
char * argv[] )

Definition at line 1029 of file exprtk_repl.cpp.

1030{
1031 expression_processor<T> processor;
1032
1033 if (argc > 1)
1034 {
1035 for (int i = 1; i < argc; ++i)
1036 {
1037 processor.process_from_file(argv[i]);
1038 }
1039 }
1040 else
1041 {
1042 for ( ; ; )
1043 {
1044 std::string expression;
1045
1046 std::cout << ">> ";
1047 std::getline(std::cin,expression);
1048
1049 if (expression.empty())
1050 continue;
1051 else if ("exit" == expression)
1052 break;
1053 else if ("quit" == expression)
1054 break;
1055 else if ('$' == expression[0])
1056 processor.process_directive(expression);
1057 else
1058 processor.process(expression);
1059 }
1060 }
1061}
void process_from_file(const std::string &file_name)
void process_directive(std::string expression)
void process(std::string program)

References expression_processor< T >::process(), expression_processor< T >::process_directive(), and expression_processor< T >::process_from_file().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function: