]> Shamusworld >> Repos - rmac/blob - expr.h
Initial commit.
[rmac] / expr.h
1 ////////////////////////////////////////////////////////////////////////////////////////////////////
2 // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
3 // EXPR.H - Expression Analyzer
4 // Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
5 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
6 // Source Utilised with the Kind Permission of Landon Dyer
7
8 #ifndef __EXPR_H__
9 #define __EXPR_H__
10
11 #include "rmac.h"
12
13 // Tunable definitions
14 #define STKSIZE      64                                     // Size of expression stacks
15 #define EVSTACKSIZE  64                                     // Expression evaluator stack size
16
17 // Token classes in order of precedence
18 #define END          0                                      // End/beginning of input
19 #define ID           1                                      // Symbol or constant
20 #define OPAR         2                                      // (
21 #define CPAR         3                                      // )
22 #define SUNARY       4                                      // Special unary (^^defined, etc.)
23 #define UNARY        5                                      // Unary class: ! ~ -
24 #define MULT         6                                      // Multiplicative class: * / %
25 #define ADD          7                                      // Additive class: + -
26 #define SHIFT        8                                      // Shift class: << >>
27 #define REL          9                                      // Relational class: <= >= < > <> = !=
28 #define AND          10                                     // Bitwise and: &
29 #define XOR          11                                     // Bitwise xor: ^
30 #define OR           12                                     // Bitwise or: |
31
32 // Prototypes
33 void init_expr(void);
34 int expr1(void);
35 int expr2(void);
36 int expr(TOKEN *, VALUE *, WORD *, SYM **);
37 int evexpr(TOKEN *, VALUE *, WORD *, SYM **);
38
39 #endif // __EXPR_H__