home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / src / math_parser.h < prev    next >
C/C++ Source or Header  |  1998-04-23  |  2KB  |  97 lines

  1. // -*- C++ -*-
  2. /*
  3.  *  File:        math_parser.h
  4.  *  Purpose:     Declaration of parsing utilities for mathed
  5.  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
  6.  *  Created:     January 1996
  7.  *  Description: Parse LaTeX2e math mode code.
  8.  *
  9.  *  Dependencies: Xlib, XForms
  10.  *
  11.  *  Copyright: (c) 1996, Alejandro Aguilar Sierra
  12.  *
  13.  *   Version: 0.8beta.
  14.  *
  15.  *   You are free to use and modify this code under the terms of
  16.  *   the GNU General Public Licence version 2 or later.
  17.  */
  18.  
  19. #ifndef __MATH_PARSER__
  20. #define __MATH_PARSER__
  21.  
  22. #ifdef __GNUG__
  23. #pragma interface
  24. #endif
  25.  
  26. #include "symbol_def.h"
  27.  
  28. ///
  29. #define LM_TK_OPEN '{'
  30. ///
  31. #define LM_TK_CLOSE '}'
  32.  
  33. ///
  34. enum MathTokenEnum
  35. {
  36.    LM_TK_BOP = 256,
  37.      LM_TK_ALPHA,
  38.      LM_TK_STR,
  39.      LM_TK_SYM,
  40.      LM_TK_FRAC,
  41.      LM_TK_SQRT,
  42.      LM_TK_BEGIN,
  43.      LM_TK_END,
  44.      LM_TK_NEWLINE,
  45.      LM_TK_UNDEF,
  46.      LM_TK_FONT,
  47.      LM_TK_LEFT,
  48.      LM_TK_RIGHT,
  49.      LM_TK_ACCENT,
  50.      LM_TK_WIDE,
  51.      LM_TK_FUNC,
  52.      LM_TK_FUNCLIM,
  53.      LM_TK_BIGSYM,
  54.      LM_TK_LABEL,
  55.      LM_TK_NONUM,
  56.      LM_TK_SPACE,
  57.      LM_TK_DOTS,
  58.      LM_TK_LIMIT,
  59.      LM_TK_STY,
  60.      LM_TK_PMOD,
  61.      LM_TK_BMOD,
  62.      LM_TK_MACRO,
  63.      LM_TK_SPECIAL,
  64.      LM_TK_ARGUMENT, 
  65.      LM_TK_NEWCOMMAND,
  66.      LM_TK_STACK
  67. };
  68.  
  69. ///
  70. struct latexkeys { char const* name; short token; int id; };
  71.  
  72. ///
  73. struct latexkeys *
  74. in_word_set (register char const *str, register int len);
  75.  
  76. ///
  77. struct latexkeys *lm_get_key(int index);
  78.  
  79. ///
  80. struct latexkeys *lm_get_key_by_id(int id, short tc=LM_TK_SYM);
  81.  
  82. ///
  83. typedef union{
  84.   ///
  85. unsigned char c;
  86.   ///
  87. char *s;
  88.   ///
  89. int i;
  90.   ///
  91. latexkeys *l;
  92. } YYSTYPE;
  93.  
  94. extern YYSTYPE yylval;
  95.  
  96. #endif
  97.