]> Shamusworld >> Repos - rmac/blob - expr.h
Fixed missing error reporting on fixup stage.
[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
9 #ifndef __EXPR_H__
10 #define __EXPR_H__
11
12 #include "rmac.h"
13
14 // Tunable definitions
15 #define STKSIZE      64                 // Size of expression stacks
16 #define EVSTACKSIZE  64                 // Expression evaluator stack size
17
18 // Token classes in order of precedence
19 #define END          0                  // End/beginning of input
20 #define ID           1                  // Symbol or constant
21 #define OPAR         2                  // (
22 #define CPAR         3                  // )
23 #define SUNARY       4                  // Special unary (^^defined, etc.)
24 #define UNARY        5                  // Unary class: ! ~ -
25 #define MULT         6                  // Multiplicative class: * / %
26 #define ADD          7                  // Additive class: + -
27 #define SHIFT        8                  // Shift class: << >>
28 #define REL          9                  // Relational class: <= >= < > <> = !=
29 #define AND          10                 // Bitwise and: &
30 #define XOR          11                 // Bitwise xor: ^
31 #define OR           12                 // Bitwise or: |
32
33 // Prototypes
34 void init_expr(void);
35 int expr1(void);
36 int expr2(void);
37 int expr(TOKEN *, VALUE *, WORD *, SYM **);
38 int evexpr(TOKEN *, VALUE *, WORD *, SYM **);
39
40 #endif // __EXPR_H__