home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / unofficial-plug-ins / mathmap / postfix.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-21  |  1.7 KB  |  74 lines

  1. /*
  2.  * postfix.h
  3.  *
  4.  * MathMap
  5.  *
  6.  * Copyright (C) 1997-2000 Mark Probst
  7.  *
  8.  * This program is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU General Public License
  10.  * as published by the Free Software Foundation; either version 2
  11.  * of the License, or (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; if not, write to the Free Software
  20.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23. #ifndef __POSTFIX_H__
  24. #define __POSTFIX_H__
  25.  
  26. #include "tuples.h"
  27. #include "vars.h"
  28. #include "internals.h"
  29.  
  30. struct _userval_t;
  31.  
  32. typedef union
  33. {
  34.     int integer;
  35.     tuple_t tuple;
  36.     internal_t *internal;
  37.     variable_t *user_var;
  38.     struct _userval_t *userval;
  39. } postfix_arg;
  40.  
  41. typedef void (*stackfunc) (postfix_arg*);
  42.  
  43. typedef struct _postfix
  44. {
  45.     stackfunc func;
  46.     postfix_arg arg;
  47. } postfix;
  48.  
  49. extern tuple_t stack[];
  50. extern int stackp;
  51.  
  52. extern postfix expression[];
  53. extern int exprp;
  54.  
  55. extern int num_ops;
  56.  
  57. struct _exprtree;
  58.  
  59. void make_postfix (struct _exprtree *tree);
  60. void make_empty_postfix (void);
  61. void output_postfix (void);
  62. tuple_t* eval_postfix (void);
  63.  
  64. void make_postfix_recursive (struct _exprtree *tree);
  65.  
  66. void stack_push (postfix_arg *arg);
  67. void stack_select_i (postfix_arg *arg);
  68. void stack_tuple (postfix_arg *arg);
  69. void stack_dupn_i (postfix_arg *arg);
  70. void stack_cast (postfix_arg *arg);
  71. void stack_push_internal (postfix_arg *arg);
  72.  
  73. #endif
  74.