This is Unofficial EPICS BASE Doxygen Site
postfix.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
19 #ifndef INCpostfixh
20 #define INCpostfixh
21 
22 #include "libComAPI.h"
23 
25 #define CALCPERFORM_NARGS 12
26 
27 #define CALCPERFORM_STACK 80
28 
58 #define INFIX_TO_POSTFIX_SIZE(n) ((n)*21/6)
59 
65 #define MAX_INFIX_SIZE 100
66 
71 #define MAX_POSTFIX_SIZE INFIX_TO_POSTFIX_SIZE(MAX_INFIX_SIZE)
72 
81 #define CALC_ERR_NONE 0
82 
83 #define CALC_ERR_TOOMANY 1
84 
85 #define CALC_ERR_BAD_LITERAL 2
86 
87 #define CALC_ERR_BAD_ASSIGNMENT 3
88 
89 #define CALC_ERR_BAD_SEPERATOR 4
90 
91 #define CALC_ERR_PAREN_NOT_OPEN 5
92 
93 #define CALC_ERR_PAREN_OPEN 6
94 
95 #define CALC_ERR_CONDITIONAL 7
96 
97 #define CALC_ERR_INCOMPLETE 8
98 
99 #define CALC_ERR_UNDERFLOW 9
100 
101 #define CALC_ERR_OVERFLOW 10
102 
103 #define CALC_ERR_SYNTAX 11
104 
105 #define CALC_ERR_NULL_ARG 12
106 
107 #define CALC_ERR_INTERNAL 13
108 
111 #ifdef __cplusplus
112 extern "C" {
113 #endif
114 
298 LIBCOM_API long
299  postfix(const char *pinfix, char *ppostfix, short *perror);
300 
313 LIBCOM_API long
314  calcPerform(double *parg, double *presult, const char *ppostfix);
315 
340 LIBCOM_API long
341  calcArgUsage(const char *ppostfix, unsigned long *pinputs, unsigned long *pstores);
342 
350 LIBCOM_API const char *
351  calcErrorStr(short error);
352 
358 LIBCOM_API void
359  calcExprDump(const char *pinst);
360 
361 #ifdef __cplusplus
362 }
363 #endif
364 
365 #endif /* INCpostfixh */
LIBCOM_API const char * calcErrorStr(short error)
Convert an error code to a string.
Definition: postfix.c:493
LIBCOM_API void calcExprDump(const char *pinst)
Disassemble a postfix expression.
Definition: postfix.c:523
LIBCOM_API long calcArgUsage(const char *ppostfix, unsigned long *pinputs, unsigned long *pstores)
Find the inputs and outputs of an expression.
Definition: calcPerform.c:405
LIBCOM_API long calcPerform(double *parg, double *presult, const char *ppostfix)
Run the calculation engine.
Definition: calcPerform.c:45
LIBCOM_API long postfix(const char *pinfix, char *ppostfix, short *perror)
Compile an infix expression into postfix byte-code.
Definition: postfix.c:209