1989-10-23 10:35:56 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1989-10-23 10:35:56 +00:00
|
|
|
/* D E F I N I T I O N S F O R T H E L E X I C A L A N A L Y Z E R */
|
2019-03-01 17:36:11 +00:00
|
|
|
#ifndef LLLEX_H_
|
|
|
|
#define LLLEX_H_
|
1989-10-23 10:35:56 +00:00
|
|
|
|
|
|
|
/* A token from the input stream is represented by an integer,
|
|
|
|
called a "symbol", but it may have other information associated
|
|
|
|
to it.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* the structure of a token: */
|
|
|
|
struct token {
|
|
|
|
int tok_symb; /* the token itself */
|
|
|
|
union {
|
|
|
|
char *tok_str;
|
1993-03-18 13:24:20 +00:00
|
|
|
struct {
|
|
|
|
int tok_unsigned;
|
|
|
|
arith tok_val; /* for INTEGER */
|
|
|
|
} tok_int;
|
1989-10-23 10:35:56 +00:00
|
|
|
} tok_data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#include "file_info.h"
|
|
|
|
|
|
|
|
#define tk_symb tok_symb
|
|
|
|
#define tk_str tok_data.tok_str
|
1993-03-18 13:24:20 +00:00
|
|
|
#define tk_val tok_data.tok_int.tok_val
|
|
|
|
#define tk_unsigned tok_data.tok_int.tok_unsigned
|
1989-10-23 10:35:56 +00:00
|
|
|
|
|
|
|
extern struct token dot;
|
|
|
|
|
|
|
|
extern int ReplaceMacros; /* "LLlex.c" */
|
|
|
|
extern int AccDefined; /* "LLlex.c" */
|
|
|
|
extern int Unstacked; /* "LLlex.c" */
|
|
|
|
extern int UnknownIdIsZero; /* "LLlex.c" */
|
|
|
|
extern int AccFileSpecifier; /* "LLlex.c" */
|
|
|
|
|
|
|
|
extern int NoUnstack; /* buffer.c */
|
|
|
|
|
|
|
|
extern int err_occurred; /* "error.c" */
|
|
|
|
|
|
|
|
#define DOT dot.tk_symb
|
|
|
|
|
|
|
|
#define EOF (-1)
|
2019-03-01 17:36:11 +00:00
|
|
|
|
|
|
|
/* Public function declarations */
|
|
|
|
|
|
|
|
int LLlex(void);
|
|
|
|
int GetToken(register struct token* ptok);
|
|
|
|
void skipcomment(void);
|
|
|
|
void skiplinecomment(void);
|
|
|
|
/* Get next character input, with trigraph parsing and newline */
|
|
|
|
int GetChar(void);
|
|
|
|
|
|
|
|
#endif /* LLLLEX_H_ */
|