My Project
programmer's documentation
Functions
mei_node.c File Reference

Nodal structure of the interpreter. More...

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "mei_node.h"
#include "mei_parser_glob.h"
Include dependency graph for mei_node.c:

Functions

mei_node_t * mei_const_node (const double value)
 Build a node for a constant. More...
 
mei_node_t * mei_id_node (const char *variable)
 Build a node for a variable. More...
 
mei_node_t * mei_func_node (const char *function, mei_node_t *const expr)
 Build a node for a function of a single variable. More...
 
mei_node_t * mei_funcx_node (const char *function, const int nops,...)
 Build a node for a function of a several variables. More...
 
mei_node_t * mei_opr_node (const int oper, const int nops,...)
 Build a node for an operators and its operands. More...
 
char * mei_label_node (mei_node_t *n)
 Return label of a node. More...
 
void mei_free_node (mei_node_t *n)
 Free memory. More...
 

Detailed Description

Nodal structure of the interpreter.

Function Documentation

◆ mei_const_node()

mei_node_t* mei_const_node ( const double  value)

Build a node for a constant.

Parameters
[in]valuereal value of the constant
Returns
built node

◆ mei_free_node()

void mei_free_node ( mei_node_t *  n)

Free memory.

Parameters
[in]nnode

◆ mei_func_node()

mei_node_t* mei_func_node ( const char *  function,
mei_node_t *const  expr 
)

Build a node for a function of a single variable.

Parameters
[in]functionlabel of the function
[in]exprnode that represents the variable of the function
Returns
built node

◆ mei_funcx_node()

mei_node_t* mei_funcx_node ( const char *  function,
const int  nops,
  ... 
)

Build a node for a function of a several variables.

Parameters
[in]functionlabel of the function
[in]nopsnumber of variables
[in]...list of nodes which represent variables of the function
Returns
built node

◆ mei_id_node()

mei_node_t* mei_id_node ( const char *  variable)

Build a node for a variable.

Parameters
[in]variablelabel of the variable
Returns
built node

◆ mei_label_node()

char* mei_label_node ( mei_node_t *  n)

Return label of a node.

Parameters
[in]nnode
Returns
label of a node

◆ mei_opr_node()

mei_node_t* mei_opr_node ( const int  oper,
const int  nops,
  ... 
)

Build a node for an operators and its operands.

Parameters
[in]operoperator
[in]nopsnumber of operand
[in]...list of nodes which represent operands
Returns
built node