home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / lr.zip / SAMPLE.H < prev    next >
C/C++ Source or Header  |  1993-05-15  |  2KB  |  43 lines

  1.  
  2.  
  3.  #ifndef __SAMPLE_H
  4.  #define __SAMPLE_H
  5.  /*
  6.   ╔══════════════════════════════════════════════════════════════════════════╗
  7.   ║ Copyright (C) Transcendental Automation, 1993.                           ║
  8.   ╟──────────────────────────────────────────────────────────────────────────╢
  9.   ║ SAMPLE.H                                                                 ║
  10.   ╟──────────────────────────────────────────────────────────────────────────╢
  11.   ║ This file is used by all modules and contains all necessary definitions  ║
  12.   ║ and declarations                                                         ║
  13.   ╚══════════════════════════════════════════════════════════════════════════╝
  14.  */
  15.  #include <io.h>
  16.  #include <lrx.inc>
  17.  #include <process.h>
  18.  #include "sample.str"
  19.  
  20.  #define STACK_SIZE 1000                       // size of stack of automaton.
  21.  
  22.  typedef void(*LRSAF)(void*,SAMPLE_NPS*,LR_PT*);// type of semantic action.
  23.  
  24.  extern LRSAF cmd[SAMPLE_n]; //table of semantic action(LRSAF - LR Semantic Action Function).
  25.  void  InitCmdTable();       //initialization of this table
  26.  
  27.  extern SAMPLE_NPS NTPS;      // nonterminal pointer set
  28.  extern LR2      *grammar;   // Pointer to compiled grammar
  29.  
  30.  void    InitTable (void);   // see table.c for more information about these
  31.  float   LookUp    (char*);  // functions.
  32.  void    SetItem   (char*,float);
  33.  void    FreeTable (void);
  34.  
  35.  void    InitFloatStack  (void);
  36.  void    pushFloat        (float);
  37.  float   popFloat        (void);
  38.  void    FreeFloatStack  (void);
  39.  
  40.  #endif
  41.    
  42.  
  43.