1  /* do not edit automatically generated by mc from bnflex.  */
       2  /* bnflex.def provides a simple lexical package for pg.
       3  
       4  Copyright (C) 2001-2023 Free Software Foundation, Inc.
       5  Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
       6  
       7  This file is part of GNU Modula-2.
       8  
       9  GNU Modula-2 is free software; you can redistribute it and/or modify
      10  it under the terms of the GNU General Public License as published by
      11  the Free Software Foundation; either version 3, or (at your option)
      12  any later version.
      13  
      14  GNU Modula-2 is distributed in the hope that it will be useful, but
      15  WITHOUT ANY WARRANTY; without even the implied warranty of
      16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      17  General Public License for more details.
      18  
      19  You should have received a copy of the GNU General Public License
      20  along with GNU Modula-2; see the file COPYING3.  If not see
      21  <http://www.gnu.org/licenses/>.  */
      22  
      23  
      24  #if !defined (_bnflex_H)
      25  #   define _bnflex_H
      26  
      27  #include "config.h"
      28  #include "system.h"
      29  #   ifdef __cplusplus
      30  extern "C" {
      31  #   endif
      32  #   if !defined (PROC_D)
      33  #      define PROC_D
      34         typedef void (*PROC_t) (void);
      35         typedef struct { PROC_t proc; } PROC;
      36  #   endif
      37  
      38  #   include "GNameKey.h"
      39  
      40  #   if defined (_bnflex_C)
      41  #      define EXTERN
      42  #   else
      43  #      define EXTERN extern
      44  #   endif
      45  
      46  typedef enum {bnflex_identtok, bnflex_literaltok, bnflex_codetok, bnflex_lbecomestok, bnflex_rbecomestok, bnflex_bartok, bnflex_lsparatok, bnflex_rsparatok, bnflex_lcparatok, bnflex_rcparatok, bnflex_lparatok, bnflex_rparatok, bnflex_errortok, bnflex_tfunctok, bnflex_symfunctok, bnflex_squotetok, bnflex_dquotetok, bnflex_moduletok, bnflex_begintok, bnflex_rulestok, bnflex_endtok, bnflex_lesstok, bnflex_gretok, bnflex_tokentok, bnflex_specialtok, bnflex_firsttok, bnflex_followtok, bnflex_BNFtok, bnflex_FNBtok, bnflex_declarationtok, bnflex_epsilontok, bnflex_eoftok} bnflex_TokenType;
      47  
      48  
      49  /*
      50     OpenSource - Attempts to open the source file, a.
      51                  The success of the operation is returned.
      52  */
      53  
      54  EXTERN unsigned int bnflex_OpenSource (const char *a_, unsigned int _a_high);
      55  
      56  /*
      57     CloseSource - Closes the current open file.
      58  */
      59  
      60  EXTERN void bnflex_CloseSource (void);
      61  
      62  /*
      63     GetChar - returns the current character on the input stream.
      64  */
      65  
      66  EXTERN char bnflex_GetChar (void);
      67  
      68  /*
      69     PutChar - pushes a character onto the push back stack, it also
      70               returns the character which has been pushed.
      71  */
      72  
      73  EXTERN char bnflex_PutChar (char ch);
      74  
      75  /*
      76     SymIs - if t is equal to the current token the next token is read
      77             and true is returned, otherwise false is returned.
      78  */
      79  
      80  EXTERN unsigned int bnflex_SymIs (bnflex_TokenType t);
      81  
      82  /*
      83     IsSym - returns the result of the comparison between the current token
      84             type and t.
      85  */
      86  
      87  EXTERN unsigned int bnflex_IsSym (bnflex_TokenType t);
      88  
      89  /*
      90     GetCurrentTokenType - returns the type of current token.
      91  */
      92  
      93  EXTERN bnflex_TokenType bnflex_GetCurrentTokenType (void);
      94  
      95  /*
      96     GetCurrentToken - returns the NameKey of the current token.
      97  */
      98  
      99  EXTERN NameKey_Name bnflex_GetCurrentToken (void);
     100  
     101  /*
     102     SkipUntilWhite - skips all characters until white space is seen.
     103  */
     104  
     105  EXTERN void bnflex_SkipUntilWhite (void);
     106  
     107  /*
     108     SkipWhite - skips all white space.
     109  */
     110  
     111  EXTERN void bnflex_SkipWhite (void);
     112  
     113  /*
     114     SkipUntilEoln - skips until a lf is seen. It consumes the lf.
     115  */
     116  
     117  EXTERN void bnflex_SkipUntilEoln (void);
     118  
     119  /*
     120     AdvanceToken - advances to the next token.
     121  */
     122  
     123  EXTERN void bnflex_AdvanceToken (void);
     124  
     125  /*
     126     IsReserved - returns TRUE if the name is a reserved word.
     127  */
     128  
     129  EXTERN unsigned int bnflex_IsReserved (NameKey_Name name);
     130  
     131  /*
     132     PushBackToken - pushes a token back onto input.
     133  */
     134  
     135  EXTERN void bnflex_PushBackToken (NameKey_Name t);
     136  
     137  /*
     138     SetDebugging - sets the debugging flag.
     139  */
     140  
     141  EXTERN void bnflex_SetDebugging (unsigned int flag);
     142  #   ifdef __cplusplus
     143  }
     144  #   endif
     145  
     146  #   undef EXTERN
     147  #endif