From 8164d91050606bb3b3b410c30a64cddf792561ed Mon Sep 17 00:00:00 2001 From: nickysn Date: Sat, 18 Apr 2020 14:17:06 +0000 Subject: [PATCH] + defined some tokens for the z80 asm reader git-svn-id: branches/z80@44779 - --- compiler/z80/raz80asm.pas | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/compiler/z80/raz80asm.pas b/compiler/z80/raz80asm.pas index 6d8a69be75..2d0f2deaed 100644 --- a/compiler/z80/raz80asm.pas +++ b/compiler/z80/raz80asm.pas @@ -30,8 +30,36 @@ Unit raz80asm; raz80, cpubase; + type + tasmtoken = ( + AS_NONE,AS_LABEL,AS_LLABEL,AS_STRING,AS_INTNUM, + AS_COMMA,AS_LPAREN, + AS_RPAREN,AS_COLON,AS_DOT,AS_PLUS,AS_MINUS,AS_STAR, + AS_SEPARATOR,AS_ID,AS_REGISTER,AS_OPCODE,AS_SLASH,AS_DOLLAR, + AS_HASH,AS_LSBRACKET,AS_RSBRACKET,AS_LBRACKET,AS_RBRACKET, + AS_EQUAL, + {------------------ Assembler directives --------------------} + AS_DEFB,AS_DEFW + ); + tasmkeyword = string[10]; + + const + { These tokens should be modified accordingly to the modifications } + { in the different enumerations. } + firstdirective = AS_DEFB; + lastdirective = AS_DEFW; + token2str : array[tasmtoken] of tasmkeyword=( + '','Label','LLabel','string','integer', + ',','(', + ')',':','.','+','-','*', + ';','identifier','register','opcode','/','$', + '#','{','}','[',']', + '=', + 'defb','defw'); + type tz80reader = class(tasmreader) + actasmtoken : tasmtoken; //function is_asmopcode(const s: string):boolean;override; //function is_register(const s:string):boolean;override; //procedure handleopcode;override;