chromium/third_party/angle/src/third_party/ceval/ceval.h

#ifndef CEVAL
#define CEVAL
//functions accessible from main() 
// - double ceval_result(char * inp) returns the result of valid math expression stored as a char array `inp`
// - void ceval_tree(char * inp) prints the parse tree for the input expression `inp`

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
#include<stdarg.h>
/****************************************** TOKENS ***********************************************/
ceval_node_id;
ceval_token_prec_specifiers;
ceval_token_type;
ceval_token_info_; 
ceval_token_info_ ceval_token_info[] =; 
#ifndef CEVAL_TOKEN_TABLE_SIZE
#define CEVAL_TOKEN_TABLE_SIZE
#endif
int ceval_is_binary_opr(ceval_node_id id) {}
int ceval_is_binary_fun(ceval_node_id id) {}
const char * ceval_token_symbol(ceval_node_id id) {}
ceval_node_id ceval_token_id(char * symbol) {}
double ceval_token_prec(ceval_node_id id) {}
ceval_node;
#ifdef __cplusplus
  #define CEVAL_CXX
  #include<iostream>
  #include<string>
#endif
/***************************************** !TOKENS *******************************************/

/****************************************** FUNCTIONS ******************************************/
//constant definitions
#ifdef M_PI
#define CEVAL_PI
#else
#define CEVAL_PI
#endif
#ifdef M_E
#define CEVAL_E
#else
#define CEVAL_E
#endif

#ifndef CEVAL_EPSILON
#define CEVAL_EPSILON
#endif
#ifndef CEVAL_DELTA
#define CEVAL_DELTA
#endif
#ifndef CEVAL_MAX_DIGITS
#define CEVAL_MAX_DIGITS
#endif
//these can be defined by the user before the include directive depending the desired level of precision

//helper function prototypes
void ceval_error(const char * , ...);
double ceval_gcd_binary(int, int);
char * ceval_shrink(char * );

//single argument funtion prototypes
double ceval_signum(double);
double ceval_asin(double);
double ceval_acos(double);
double ceval_atan(double);
double ceval_sin(double);
double ceval_cos(double);
double ceval_tan(double);
double ceval_sinh(double);
double ceval_cosh(double);
double ceval_tanh(double);
double ceval_rad2deg(double);
double ceval_deg2rad(double);
double ceval_int_part(double);
double ceval_frac_part(double);
double ceval_log10(double);
double ceval_ln(double);
double ceval_exp(double);
double ceval_factorial(double);
double ceval_positive_sign(double);
double ceval_negative_sign(double);
double ceval_abs(double);
double ceval_sqrt(double);
double ceval_sqrt(double);
double ceval_cbrt(double);
double ceval_ceil(double);
double ceval_floor(double);
double ceval_not(double);
double ceval_bit_not(double);

//double argument function prototypes
double ceval_sum(double, double, int);
double ceval_diff(double, double, int);
double ceval_prod(double, double, int);
double ceval_div(double, double, int);
double ceval_quotient(double, double, int);
double ceval_modulus(double, double, int);
double ceval_gcd(double, double, int);
double ceval_hcf(double, double, int);
double ceval_lcm(double, double, int);
double ceval_log(double, double, int);
double ceval_are_equal(double, double, int);
double ceval_not_equal(double, double, int);
double ceval_lesser(double, double, int);
double ceval_greater(double, double, int);
double ceval_lesser_s(double, double, int);
double ceval_greater_s(double, double, int);
double ceval_comma(double, double, int);
double ceval_power(double, double, int);
double ceval_atan2(double, double, int);
double ceval_sci2dec(double, double, int);
double ceval_and(double, double, int);
double ceval_or(double, double, int);
double ceval_bit_and(double, double, int);
double ceval_bit_xor(double, double, int);
double ceval_bit_or(double, double, int);
double ceval_bit_lshift(double, double, int);
double ceval_bit_rshift(double, double, int);

//helper function definitions
void ceval_error(const char* error_format_string, ...) {}
double ceval_gcd_binary(int a, int b) {}
char * ceval_shrink(char * x) {}
//single argument function definitions
double( * single_arg_fun[])(double) =;
double ceval_signum(double x) {}
double ceval_asin(double x) {}
double ceval_acos(double x) {}
double ceval_atan(double x) {}
double ceval_sin(double x) {}
double ceval_cos(double x) {}
double ceval_tan(double x) {}
double ceval_rad2deg(double x) {}
double ceval_deg2rad(double x) {}
double ceval_int_part(double x) {}
double ceval_frac_part(double x) {}
double ceval_log10(double x) {}
double ceval_ln(double x) {}
double ceval_exp(double x) {}
double ceval_factorial(double x) {}
double ceval_positive_sign(double x) {}
double ceval_negative_sign(double x) {}
double ceval_abs(double x) {}
double ceval_sqrt(double x) {}
double ceval_cbrt(double x) {}
double ceval_ceil(double x) {}
double ceval_floor(double x) {}
double ceval_sinh(double x) {}
double ceval_cosh(double x) {}
double ceval_tanh(double x) {}
double ceval_not(double x) {}
double ceval_bit_not(double x) {}
//double argument function definitions
double( * double_arg_fun[])(double, double, int) =;
double ceval_sum(double a, double b, int arg_check) {}
double ceval_diff(double a, double b, int arg_check) {}
double ceval_prod(double a, double b, int arg_check) {}
double ceval_div(double a, double b, int arg_check) {}
double ceval_modulus(double a, double b, int arg_check) {}
double ceval_quotient(double a, double b, int arg_check) {}
double ceval_gcd(double a, double b, int arg_check) {}
double ceval_hcf(double a, double b, int arg_check) {}
double ceval_lcm(double a, double b, int arg_check) {}
double ceval_log(double b, double x, int arg_check) {}
double ceval_are_equal(double a, double b, int arg_check) {}
double ceval_not_equal(double a, double b, int arg_check) {}
double ceval_lesser(double a, double b, int arg_check) {}
double ceval_greater(double a, double b, int arg_check) {}
double ceval_lesser_s(double a, double b, int arg_check) {}
double ceval_greater_s(double a, double b, int arg_check) {}
double ceval_comma(double x, double y, int arg_check) {}
double ceval_power(double x, double y, int arg_check) {}
double ceval_atan2(double x, double y, int arg_check) {}
double ceval_sci2dec(double m, double e, int arg_check) {}
double ceval_and(double x, double y, int arg_check) {}
double ceval_or(double x, double y, int arg_check) {}
double ceval_bit_and(double x, double y, int arg_check) {}
double ceval_bit_xor(double x, double y, int arg_check) {}
double ceval_bit_or(double x, double y, int arg_check) {}
double ceval_bit_lshift(double x, double y, int arg_check) {}
double ceval_bit_rshift(double x, double y, int arg_check) {}
/**************************************** !FUNCTIONS ********************************************/

/***************************************** PARSE_TREE_CONSTRUCTION *******************************************/
void * ceval_make_tree(char * );
ceval_node * ceval_insert_node(ceval_node * , ceval_node, int);
void ceval_print_tree(const void * );
void ceval_print_node(const ceval_node * , int);
void ceval_delete_node(ceval_node * );
void ceval_delete_tree(void * );

void ceval_delete_node(ceval_node * node) {}
void ceval_delete_tree(void * tree) {}
ceval_node * ceval_insert_node(ceval_node * current, ceval_node item, int isRightAssoc) {}

void * ceval_make_tree(char * expression) {}
void ceval_print_node(const ceval_node * node, int indent) {}
void ceval_print_tree(const void * tree) {}
/***************************************** !PARSE_TREE_CONSTRUCTION *******************************************/

/***************************************** EVALUATION *******************************************/
double ceval_evaluate_tree_(const ceval_node * );
double ceval_evaluate_tree(const void * );

double ceval_evaluate_tree_(const ceval_node * node) {}
double ceval_evaluate_tree(const void * node) {}
/***************************************** !EVALUATION *******************************************/

/***************************************** MAIN FUNCTIONS *******************************************/
// functions accessible from main() 
// - double ceval_result(char * inp) returns the result of valid math expression stored as a char array `inp`
// - void ceval_tree(char * inp) prints the parse tree for the input expression `inp`
// - define CEVAL_EPSILON (default value : 1e-2), CEVAL_DELTA (default value : 1e-6) and CEVAL_MAX_DIGITS (default value : 15) manually before the include directive
// - define CEVAL_STOICAL before the #include directive to use the parser/evaluator in stoical (non-complaining) mode. It suppresses all the error messages from [ceval]. 

double ceval_result(char * expr) {}
void ceval_tree(char * expr) {}

#ifdef CEVAL_CXX
    double ceval_result(std::string expr) {}
    void ceval_tree(std::string expr) {}
#endif
/***************************************** !MAIN FUNCTIONS *******************************************/
#endif