Implement associativity storage for operators.
This commit is contained in:
@@ -17,6 +17,10 @@ struct libab_operator_s {
|
||||
* The precedence of the operator.
|
||||
*/
|
||||
int precedence;
|
||||
/**
|
||||
* The associativity of the operator.
|
||||
*/
|
||||
int associativity;
|
||||
/**
|
||||
* The functionality of the operator.
|
||||
*/
|
||||
|
||||
@@ -45,10 +45,11 @@ libab_result libab_init(libab* ab);
|
||||
* @param ab the libabacus instance to reigster the operator with.
|
||||
* @param op the operator string to register.
|
||||
* @param precedence the precedence of the operator.
|
||||
* @param associativity the associativity of the operator.
|
||||
* @param func the function that describes the functionality of the operator.
|
||||
* @return the result of the initialization.
|
||||
*/
|
||||
libab_result libab_register_operator_infix(libab* ab, const char* op, int precedence, libab_function_ptr func);
|
||||
libab_result libab_register_operator_infix(libab* ab, const char* op, int precedence, int associativity, libab_function_ptr func);
|
||||
/**
|
||||
* Registers an operation with libabacus that appears
|
||||
* before its operand.
|
||||
|
||||
Reference in New Issue
Block a user