Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a89df24b3c34782b2b9adf0ab690227f > files > 60

dyalog-1.11.3-1mdv2008.1.i586.rpm

/* $Id: token.h 260 2002-11-04 09:22:21Z clerger $
 * Copyright (C) 1997 Eric de la Clergerie
 * ------------------------------------------------------------
 *
 *   Token
 *
 * ------------------------------------------------------------
 * Description
 *    Misc macros and types for the lexer and parser
 * ------------------------------------------------------------
 */

#ifndef READ_TOKEN
#define READ_TOKEN

typedef enum {
    TK_ERROR = -1
    ,TK_EOF=0		/* END of file, not end of clause */
    ,TK_VAR	        /* type is a variable */
    ,TK_FUNC            /* type is atom( */
    ,TK_FEAT_FUNC	/* type is atom{ */
    ,TK_FSET_FUNC	/* type is atom[ */
    ,TK_INT	        /* type is an integer number */
    ,TK_CHAR	        /* type is a char */
    ,TK_ATOM	        /* type is an atom */
    ,TK_EOC		/* END of clause but not of file */
    ,TK_REAL	        /* type is a real number */
    ,TK_STR	        /* type is a char string */
    ,TK_CHAR_LIST	/* type is a char string */
    ,TK_COMA
    ,TK_BAR
    ,TK_LPAR
    ,TK_RPAR
    ,TK_LBRACE
    ,TK_RBRACE
    ,TK_LBRACKET
    ,TK_RBRACKET
    ,TK_DOT
    ,TK_MODULE          /* module part */
} TK_Kind;

extern char *token_value;
extern buffer auxbuf;
void Syntax_Error( const char *s, ... ) __attribute__ ((__noreturn__));
void Syntax_Warning( const char *s, ... );

extern int lexer_mode;
extern char *lexer_port;

TK_Kind lexer();		/* prototype of the lexer */

#define yycopy()        strcpy((char *)GC_MALLOC_ATOMIC( yyleng+1 ),yytext)

#endif /* READ_TOKEN */