home *** CD-ROM | disk | FTP | other *** search
-
- /* e4priority.c (c)Copyright Sequiter Software Inc., 1987, 1988, 1989. All rights reserved.
-
- - used by e4parse to return the priority of an operator
- */
-
- #include "d4base.h"
- #include "e4parse.h"
-
-
- e4priority( ch)
- char ch ;
- {
- switch(ch)
- {
- case Q_NO_FUNCTION: /* for no operator on stack - never pop */
- return(0) ;
-
- case Q_COMMA:
- return(1) ;
- case Q_L_BRACKET:
- return(2) ;
-
- case L_OR:
- return(3) ;
- case L_AND:
- return(4) ;
- case L_NOT:
- return(5) ;
-
- case R_GE:
- case R_LE:
- case R_GT:
- case R_LT:
- case R_NE:
- case R_EQ:
- case R_SUB_COMPARE:
- return(6) ;
-
- case A_ADD:
- case A_SUBTRACT:
- return(7) ;
-
- case A_MULTIPLY:
- case A_DIVIDE:
- return(8) ;
-
- #ifndef UNIX
- case A_POWER:
- return(9) ;
- #endif
-
- case Q_R_BRACKET:
- return(100) ;
-
- default:
- return(7) ;
- }
- }
-
-