Back to index

tetex-bin  3.0
token.h
Go to the documentation of this file.
00001 /* $XConsortium: token.h,v 1.2 91/10/10 11:19:58 rws Exp $ */
00002 /* Copyright International Business Machines,Corp. 1991
00003  * All Rights Reserved
00004  *
00005  * License to use, copy, modify, and distribute this software
00006  * and its documentation for any purpose and without fee is
00007  * hereby granted, provided that the above copyright notice
00008  * appear in all copies and that both that copyright notice and
00009  * this permission notice appear in supporting documentation,
00010  * and that the name of IBM not be used in advertising or
00011  * publicity pertaining to distribution of the software without
00012  * specific, written prior permission.
00013  *
00014  * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES
00015  * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
00016  * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
00017  * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF
00018  * THIRD PARTY RIGHTS.  THE ENTIRE RISK AS TO THE QUALITY AND
00019  * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT
00020  * OR MAINTAIN, BELONGS TO THE LICENSEE.  SHOULD ANY PORTION OF
00021  * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES
00022  * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION.  IN
00023  * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
00024  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
00025  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
00026  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
00027  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
00028  * SOFTWARE.
00029  */
00030 #ifndef TOKEN_H
00031 #define TOKEN_H
00032  
00033 /* Special characters */
00034 #define CONTROL_C           (3)
00035  
00036 /* Token type codes */
00037 #define TOKEN_INVALID       (-3)
00038 #define TOKEN_BREAK         (-2)
00039 #define TOKEN_EOF           (-1)
00040 #define TOKEN_NONE          (0)
00041 #define TOKEN_LEFT_PAREN    (1)
00042 #define TOKEN_RIGHT_PAREN   (2)
00043 #define TOKEN_LEFT_ANGLE    (3)
00044 #define TOKEN_RIGHT_ANGLE   (4)
00045 #define TOKEN_LEFT_BRACE    (5)
00046 #define TOKEN_RIGHT_BRACE   (6)
00047 #define TOKEN_LEFT_BRACKET  (7)
00048 #define TOKEN_RIGHT_BRACKET (8)
00049 #define TOKEN_NAME          (9)
00050 #define TOKEN_LITERAL_NAME  (10)
00051 #define TOKEN_INTEGER       (11)
00052 #define TOKEN_REAL          (12)
00053 #define TOKEN_RADIX_NUMBER  (13)
00054 #define TOKEN_HEX_STRING    (14)
00055 #define TOKEN_STRING        (15)
00056 #define TOKEN_IMMED_NAME    (16)
00057  
00058 /* Token routines */
00059 extern void scan_token();
00060  
00061 /*
00062  * -------------------------------------------------------------------------
00063  * Globals shared  -- (everyone else KEEP YOUR MITTS OFF THEM!)
00064  * -------------------------------------------------------------------------
00065  */
00066  
00067 /* These variables are set by the caller */
00068 extern char     *tokenStartP; /* Pointer to token buffer in VM */
00069 extern char     *tokenMaxP;   /* Pointer to end of VM we may use + 1 */
00070  
00071 /* These variables are set by P_TOKEN */
00072 extern int      tokenLength;  /* Characters in token */
00073 extern boolean  tokenTooLong; /* Token too long for space available */
00074 extern int      tokenType;    /* Type of token identified */
00075 extern psvalue  tokenValue;   /* Token value */
00076  
00077 #endif /* TOKEN_H */