home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / goattracker_2.68.zip / src / asm / expr.h < prev    next >
C/C++ Source or Header  |  2008-04-01  |  2KB  |  58 lines

  1. #ifndef ALREADY_INCLUDED_EXPR
  2. #define ALREADY_INCLUDED_EXPR
  3.  
  4. /*
  5.  * Copyright (c) 2005 Magnus Lind.
  6.  *
  7.  * This software is provided 'as-is', without any express or implied warranty.
  8.  * In no event will the authors be held liable for any damages arising from
  9.  * the use of this software.
  10.  *
  11.  * Permission is granted to anyone to use this software, alter it and re-
  12.  * distribute it freely for any non-commercial, non-profit purpose subject to
  13.  * the following restrictions:
  14.  *
  15.  *   1. The origin of this software must not be misrepresented; you must not
  16.  *   claim that you wrote the original software. If you use this software in a
  17.  *   product, an acknowledgment in the product documentation would be
  18.  *   appreciated but is not required.
  19.  *
  20.  *   2. Altered source versions must be plainly marked as such, and must not
  21.  *   be misrepresented as being the original software.
  22.  *
  23.  *   3. This notice may not be removed or altered from any distribution.
  24.  *
  25.  *   4. The names of this software and/or it's copyright holders may not be
  26.  *   used to endorse or promote products derived from this software without
  27.  *   specific prior written permission.
  28.  *
  29.  */
  30.  
  31. #include "int.h"
  32. #include "asmtab.h"
  33.  
  34. union expr_type
  35. {
  36.     i32 number;
  37.     const char *symref;
  38.     struct expr *arg1;
  39. };
  40.  
  41. struct expr
  42. {
  43.     union expr_type type;
  44.     struct expr *expr_arg2;
  45.     i16 expr_op;
  46. };
  47.  
  48. void expr_init(void);
  49. void expr_free(void);
  50.  
  51. struct expr *new_expr_op1(i16 op, struct expr *arg);
  52. struct expr *new_expr_op2(i16 op, struct expr *arg1, struct expr *arg2);
  53. struct expr *new_expr_symref(const char *symbol);
  54. struct expr *new_expr_number(i32 number);
  55. void expr_dump(int level, struct expr *e);
  56.  
  57. #endif
  58.