/* lex.h - lexical interface constants and prototypes.
 *  Copyright (C) 2022 by Jed Marti
 *   This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see https://www.gnu.org/licenses/.
 */

#ifndef lex_h
#define lex_h

// Input buffer line size.
#define INLINESIZE 120

// Maximum size of a string or token.
#define MAXSTR 118

// Lexical types.
enum {
  LEXID,
  LEXNUM,
  LEXFLOAT,
  LEXSTRING,
  LEXPUNCT,
  LEXEOL
};


// The various input possibilities - see in.c
enum {
  file0In,              // File system - file 0.
  file1In,              // File system - file 1.
  serialIn,             // Serial port input (default)
  remoteFIn,            // CTERM file in.
  i2cIn                 // I2C in/out.
};


// Called at startup.
void initLex(void);

// Get the new line.
void newLine(void);

// Get the next token.
void ntok(void);

// Check for punctuation.
__bit isPunctuation(char *p);

// Check for keyword.
__bit isKeyword(char *k);

#endif


// EOF
