home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / assembler / as / src / h / code < prev    next >
Encoding:
Text File  |  1993-03-06  |  1.2 KB  |  75 lines

  1. /*
  2.  * code.h
  3.  * Copyright © 1992 Niklas Röjemo
  4.  */
  5.  
  6. #ifndef _code_h
  7. #define _code_h
  8.  
  9. #ifndef _global_h
  10. #include "global.h"
  11. #endif
  12.  
  13. #ifndef _lex_h
  14. #include "lex.h"
  15. #endif
  16.  
  17. #ifndef _symbol_h
  18. #include "symbol.h"
  19. #endif
  20.  
  21.  
  22. #ifndef _value_h
  23. #include "value.h"
  24. #endif
  25.  
  26. typedef enum {
  27.    CodeOperator,
  28.    CodeValue,
  29.    CodeSymbol
  30. } CodeTag;
  31.  
  32. typedef union CODE {
  33.    CodeTag Tag;
  34.    struct {
  35.     CodeTag Tag;
  36.     Operator op;
  37.    } CodeOperator;
  38.    struct {
  39.      CodeTag Tag;
  40.      Value   value;
  41.    } CodeValue;
  42.    struct {
  43.      CodeTag  Tag;
  44.      Symbol  *symbol;
  45.    } CodeSymbol;
  46. } Code;
  47.  
  48. #ifndef _reloc_h
  49. #include "reloc.h"
  50. #endif
  51.  
  52. #define CODE_SIZECODE  1024
  53. #define CODE_SIZESTACK 1024
  54. #define CODE_SIZELATE  1024
  55.  
  56. void codeInit(void);
  57.  
  58.  
  59. void codeOperator(Operator op);
  60. void codeSymbol(Symbol *symbol);
  61. void codeInt(int value);
  62. void codePosition(Symbol *area);
  63. void codeStorage(void);
  64. void codeString(int len, char *str);
  65. void codeFloat(FLOAT value);
  66.  
  67. void codeFixReloc(void);
  68. Value codeEvalLow(ValueTag legal, int size, Code *program);
  69. Value codeEval(ValueTag legal);
  70.  
  71. LateInfo *codeNewLateInfo(Symbol *symbol);
  72. Code *codeCopy(int len, Code *code);
  73. int  codeEqual(int len, Code *a,Code *b);
  74. #endif
  75.