teditor  1.8.0@@fee5e94
Terminal based editor written in C++
Namespaces | Classes | Typedefs | Enumerations | Functions
teditor::calc Namespace Reference

Namespaces

 ops
 

Classes

class  CalcMode
 
struct  Number
 Core number used for computing in the calculator. More...
 
struct  Parser
 

Typedefs

typedef std::unordered_map< std::string, Num64VarMap
 
typedef Number< int32_t, float > Num32
 
typedef Number< int64_t, double > Num64
 
typedef std::stack< Num64NumStack
 

Enumerations

enum  Tokens {
  IVal = 0, FVal, BrktOpen, BrktClose,
  Var, Equals, Plus, Minus,
  Mul, Div, Exp, Func,
  Space, SemiColon
}
 

Functions

VarMapvars ()
 
Historycmds ()
 
void addCmd (const std::string &c)
 
 REGISTER_MODE (CalcMode, "calc")
 
 CONST (e, M_E)
 
 CONST (pi, M_PI)
 
 CONST (nan, NAN)
 
 CONST (log2e, M_LOG2E)
 
 CONST (log10e, M_LOG10E)
 
 CONST (sqrt2, M_SQRT2)
 
 CONST (sqrt1_2, M_SQRT1_2)
 
template<typename I , typename F >
Number< I, F > operator+ (const Number< I, F > &a, const Number< I, F > &b)
 
template<typename I , typename F >
Number< I, F > operator- (const Number< I, F > &a, const Number< I, F > &b)
 
template<typename I , typename F >
Number< I, F > operator* (const Number< I, F > &a, const Number< I, F > &b)
 
template<typename I , typename F >
Number< I, F > operator/ (const Number< I, F > &a, const Number< I, F > &b)
 
 FUNC (sq)
 
 FUNC (cube)
 
 FP_FUNC (abs)
 
 FP_FUNC (sin)
 
 FP_FUNC (tan)
 
 FP_FUNC (asin)
 
 FP_FUNC (atan)
 
 FP_FUNC (sinh)
 
 FP_FUNC (tanh)
 
 FP_FUNC (asinh)
 
 FP_FUNC (atanh)
 
 FP_FUNC (sqrt)
 
 FP_FUNC (cbrt)
 
 FP_FUNC (log)
 
 FP_FUNC (log10)
 
 FP_FUNC (exp)
 
 FP_FUNC (floor)
 
 FP_FUNC (ceil)
 
 FP_FUNC (round)
 
template<typename I , typename F >
Number< I, F > toInt (const Number< I, F > &a)
 
template<typename I , typename F >
Number< I, F > toFloat (const Number< I, F > &a)
 
 FP_FUNC2 (pow)
 
 FP_FUNC2 (hypot)
 
parser::LexergetLexer ()
 

Typedef Documentation

◆ Num32

typedef Number<int32_t, float> teditor::calc::Num32

◆ Num64

typedef Number<int64_t, double> teditor::calc::Num64

◆ NumStack

typedef std::stack<Num64> teditor::calc::NumStack

◆ VarMap

typedef std::unordered_map< std::string, Num64 > teditor::calc::VarMap

Enumeration Type Documentation

◆ Tokens

Enumerator
IVal 
FVal 
BrktOpen 
BrktClose 
Var 
Equals 
Plus 
Minus 
Mul 
Div 
Exp 
Func 
Space 
SemiColon 

Function Documentation

◆ addCmd()

void teditor::calc::addCmd ( const std::string &  c)

◆ cmds()

History & teditor::calc::cmds ( )

◆ CONST() [1/7]

teditor::calc::CONST ( ,
M_E   
)

◆ CONST() [2/7]

teditor::calc::CONST ( log10e  ,
M_LOG10E   
)

◆ CONST() [3/7]

teditor::calc::CONST ( log2e  ,
M_LOG2E   
)

◆ CONST() [4/7]

teditor::calc::CONST ( nan  ,
NAN   
)

◆ CONST() [5/7]

teditor::calc::CONST ( pi  ,
M_PI   
)

◆ CONST() [6/7]

teditor::calc::CONST ( sqrt1_2  ,
M_SQRT1_2   
)

◆ CONST() [7/7]

teditor::calc::CONST ( sqrt2  ,
M_SQRT2   
)

◆ FP_FUNC() [1/17]

teditor::calc::FP_FUNC ( abs  )

◆ FP_FUNC() [2/17]

teditor::calc::FP_FUNC ( asin  )

◆ FP_FUNC() [3/17]

teditor::calc::FP_FUNC ( asinh  )

◆ FP_FUNC() [4/17]

teditor::calc::FP_FUNC ( atan  )

◆ FP_FUNC() [5/17]

teditor::calc::FP_FUNC ( atanh  )

◆ FP_FUNC() [6/17]

teditor::calc::FP_FUNC ( cbrt  )

◆ FP_FUNC() [7/17]

teditor::calc::FP_FUNC ( ceil  )

◆ FP_FUNC() [8/17]

teditor::calc::FP_FUNC ( exp  )

◆ FP_FUNC() [9/17]

teditor::calc::FP_FUNC ( floor  )

◆ FP_FUNC() [10/17]

teditor::calc::FP_FUNC ( log  )

◆ FP_FUNC() [11/17]

teditor::calc::FP_FUNC ( log10  )

◆ FP_FUNC() [12/17]

teditor::calc::FP_FUNC ( round  )

◆ FP_FUNC() [13/17]

teditor::calc::FP_FUNC ( sin  )

◆ FP_FUNC() [14/17]

teditor::calc::FP_FUNC ( sinh  )

◆ FP_FUNC() [15/17]

teditor::calc::FP_FUNC ( sqrt  )

◆ FP_FUNC() [16/17]

teditor::calc::FP_FUNC ( tan  )

◆ FP_FUNC() [17/17]

teditor::calc::FP_FUNC ( tanh  )

◆ FP_FUNC2() [1/2]

teditor::calc::FP_FUNC2 ( hypot  )

◆ FP_FUNC2() [2/2]

teditor::calc::FP_FUNC2 ( pow  )

◆ FUNC() [1/2]

teditor::calc::FUNC ( cube  )

◆ FUNC() [2/2]

teditor::calc::FUNC ( sq  )

◆ getLexer()

parser::Lexer& teditor::calc::getLexer ( )

◆ operator*()

template<typename I , typename F >
Number<I, F> teditor::calc::operator* ( const Number< I, F > &  a,
const Number< I, F > &  b 
)

◆ operator+()

template<typename I , typename F >
Number<I, F> teditor::calc::operator+ ( const Number< I, F > &  a,
const Number< I, F > &  b 
)

◆ operator-()

template<typename I , typename F >
Number<I, F> teditor::calc::operator- ( const Number< I, F > &  a,
const Number< I, F > &  b 
)

◆ operator/()

template<typename I , typename F >
Number<I, F> teditor::calc::operator/ ( const Number< I, F > &  a,
const Number< I, F > &  b 
)

◆ REGISTER_MODE()

teditor::calc::REGISTER_MODE ( CalcMode  ,
"calc"   
)

◆ toFloat()

template<typename I , typename F >
Number<I, F> teditor::calc::toFloat ( const Number< I, F > &  a)

◆ toInt()

template<typename I , typename F >
Number<I, F> teditor::calc::toInt ( const Number< I, F > &  a)

◆ vars()

VarMap & teditor::calc::vars ( )