Jelajahi Sumber

+ defined some tokens for the z80 asm reader

git-svn-id: branches/z80@44779 -
nickysn 5 tahun lalu
induk
melakukan
8164d91050
1 mengubah file dengan 28 tambahan dan 0 penghapusan
  1. 28 0
      compiler/z80/raz80asm.pas

+ 28 - 0
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;