2011-12-27 01:54:45 +02:00
|
|
|
//
|
2021-03-08 00:43:25 +02:00
|
|
|
// RMAC - Renamed Macro Assembler for all Atari computers
|
2011-12-27 00:50:27 +02:00
|
|
|
// EXPR.H - Expression Analyzer
|
2021-03-08 00:43:25 +02:00
|
|
|
// Copyright (C) 199x Landon Dyer, 2011-2021 Reboot and Friends
|
2011-12-27 00:50:27 +02:00
|
|
|
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
|
2015-02-19 16:56:14 +02:00
|
|
|
// Source utilised with the kind permission of Landon Dyer
|
2011-12-27 01:54:45 +02:00
|
|
|
//
|
2011-12-27 00:50:27 +02:00
|
|
|
|
|
|
|
#ifndef __EXPR_H__
|
|
|
|
#define __EXPR_H__
|
|
|
|
|
|
|
|
#include "rmac.h"
|
|
|
|
|
|
|
|
// Tunable definitions
|
2014-05-17 23:56:15 +03:00
|
|
|
#define STKSIZE 64 // Size of expression stacks
|
|
|
|
#define EVSTACKSIZE 64 // Expression evaluator stack size
|
2011-12-27 00:50:27 +02:00
|
|
|
|
|
|
|
// Token classes in order of precedence
|
2014-05-17 23:56:15 +03:00
|
|
|
#define END 0 // End/beginning of input
|
|
|
|
#define ID 1 // Symbol or constant
|
|
|
|
#define OPAR 2 // (
|
|
|
|
#define CPAR 3 // )
|
|
|
|
#define SUNARY 4 // Special unary (^^defined, etc.)
|
|
|
|
#define UNARY 5 // Unary class: ! ~ -
|
|
|
|
#define MULT 6 // Multiplicative class: * / %
|
|
|
|
#define ADD 7 // Additive class: + -
|
|
|
|
#define SHIFT 8 // Shift class: << >>
|
|
|
|
#define REL 9 // Relational class: <= >= < > <> = !=
|
|
|
|
#define AND 10 // Bitwise and: &
|
|
|
|
#define XOR 11 // Bitwise xor: ^
|
|
|
|
#define OR 12 // Bitwise or: |
|
2011-12-27 00:50:27 +02:00
|
|
|
|
2017-04-20 22:29:31 +03:00
|
|
|
// Exported functions
|
2013-03-05 19:47:22 +02:00
|
|
|
void InitExpression(void);
|
2011-12-27 00:50:27 +02:00
|
|
|
int expr1(void);
|
|
|
|
int expr2(void);
|
2017-11-29 15:57:58 +02:00
|
|
|
int expr(TOKEN *, uint64_t *, WORD *, SYM **);
|
|
|
|
int evexpr(TOKEN *, uint64_t *, WORD *, SYM **);
|
2018-02-10 07:08:47 +02:00
|
|
|
uint16_t ExpressionLength(TOKEN *);
|
2011-12-27 00:50:27 +02:00
|
|
|
|
2012-11-23 18:39:09 +02:00
|
|
|
#endif // __EXPR_H__
|
2018-02-10 07:08:47 +02:00
|
|
|
|