Back to index

texmacs  1.0.7.15
tree_label.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : tree_label.hpp
00004 * DESCRIPTION: labels of trees
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef TREE_LABEL_H
00013 #define TREE_LABEL_H
00014 #include "string.hpp"
00015 
00016 /******************************************************************************
00017 * Standard tree labels
00018 ******************************************************************************/
00019 
00020 enum tree_label {
00021   STRING= 0, UNKNOWN, UNINIT, ERROR, RAW_DATA,
00022 
00023   // basic formatting tags
00024   DOCUMENT, PARA, SURROUND, CONCAT,
00025   RIGID, HIDDEN, FREEZE, UNFREEZE,
00026   HSPACE, VAR_VSPACE, VSPACE, SPACE, HTAB,
00027   MOVE, SHIFT, RESIZE, CLIPPED,
00028   REPEAT, _FLOAT, DATOMS, DLINES, DPAGES, DBOX,
00029 
00030   // zero-ary formatting directives
00031   // modify is_formatting predicate when inserting new tags
00032   WITH_LIMITS, LINE_BREAK, NEW_LINE, NEXT_LINE,
00033   NO_BREAK, YES_INDENT, NO_INDENT, VAR_YES_INDENT,
00034   VAR_NO_INDENT, VAR_PAGE_BREAK, PAGE_BREAK,
00035   VAR_NO_PAGE_BREAK, NO_PAGE_BREAK, VAR_NEW_PAGE,
00036   NEW_PAGE, VAR_NEW_DPAGE, NEW_DPAGE,
00037 
00038   // mathematics
00039   AROUND, VAR_AROUND, BIG_AROUND,
00040   LEFT, MID, RIGHT, BIG, LONG_ARROW,
00041   LPRIME, RPRIME, BELOW, ABOVE,
00042   LSUB, LSUP, RSUB, RSUP,
00043   FRAC, SQRT, WIDE, VAR_WIDE, NEG, TREE,
00044   SYNTAX,
00045 
00046   // tabular material
00047   TFORMAT, TWITH, CWITH, TMARKER,
00048   TABLE, ROW, CELL, SUBTABLE,
00049 
00050   // macro language
00051   ASSIGN, WITH, PROVIDES, VALUE, QUOTE_VALUE,
00052   MACRO, DRD_PROPS, ARG, QUOTE_ARG, COMPOUND,
00053   XMACRO, GET_LABEL, GET_ARITY, MAP_ARGS, EVAL_ARGS,
00054   MARK, EXPAND_AS,
00055   EVAL, QUOTE, QUASI, QUASIQUOTE, UNQUOTE, VAR_UNQUOTE, COPY,
00056   IF, VAR_IF, CASE, WHILE, FOR_EACH,
00057   EXTERN, INCLUDE, USE_PACKAGE, USE_MODULE,
00058 
00059   // computational markup
00060   OR, XOR, AND, NOT,
00061   PLUS, MINUS, TIMES, OVER, DIV, MOD, MINIMUM, MAXIMUM,
00062   MATH_SQRT, EXP, LOG, POW, COS, SIN, TAN,
00063   MERGE, LENGTH, RANGE, NUMBER, _DATE, TRANSLATE, CHANGE_CASE, FIND_FILE,
00064   IS_TUPLE, LOOK_UP,
00065   EQUAL, UNEQUAL, LESS, LESSEQ, GREATER, GREATEREQ,
00066 
00067   // built-in length units
00068   CM_LENGTH, MM_LENGTH, IN_LENGTH, PT_LENGTH,
00069   BP_LENGTH, DD_LENGTH, PC_LENGTH, CC_LENGTH,     // standard absolute units
00070   FS_LENGTH, FBS_LENGTH, EM_LENGTH,
00071   LN_LENGTH, SEP_LENGTH, YFRAC_LENGTH, EX_LENGTH, // font specific
00072   FN_LENGTH, FNS_LENGTH, BLS_LENGTH,
00073   FNBOT_LENGTH, FNTOP_LENGTH,
00074   SPC_LENGTH, XSPC_LENGTH,                        // font specific & stretchy
00075   PAR_LENGTH, PAG_LENGTH,                         // other
00076   GW_LENGTH, GH_LENGTH,                           // width & height of graphics
00077   TMPT_LENGTH, PX_LENGTH,                         // miscellaneous
00078   MSEC_LENGTH, SEC_LENGTH, MIN_LENGTH, HR_LENGTH,  // durations
00079 
00080   // tags for source tree editing
00081   STYLE_WITH, VAR_STYLE_WITH, STYLE_ONLY, VAR_STYLE_ONLY,
00082   ACTIVE, VAR_ACTIVE, INACTIVE, VAR_INACTIVE,
00083   REWRITE_INACTIVE, INLINE_TAG, OPEN_TAG, MIDDLE_TAG, CLOSE_TAG,
00084   SYMBOL, LATEX, HYBRID,
00085 
00086   // linking primitives
00087   LOCUS, ID, HARD_ID,
00088   LINK, URL, SCRIPT, HLINK, ACTION,
00089   SET_BINDING, GET_BINDING, LABEL, REFERENCE, PAGEREF, WRITE,
00090 
00091   // various other tags
00092   TUPLE, ATTR, TMLEN, COLLECTION, ASSOCIATE, BACKUP, PATTERN, GRADIENT,
00093   SPECIFIC, FLAG,
00094 
00095   // animations
00096   ANIM_COMPOSE, ANIM_REPEAT, ANIM_CONSTANT,
00097   ANIM_TRANSLATE, ANIM_PROGRESSIVE, VIDEO, SOUND,
00098 
00099   // graphical tags
00100   GRAPHICS,
00101   SUPERPOSE,
00102   GR_GROUP, GR_LINEAR_TRANSFORM,
00103   TEXT_AT, MATH_AT, _POINT,
00104   LINE, CLINE, ARC, CARC, SPLINE, VAR_SPLINE, CSPLINE,
00105   FILL, IMAGE,
00106   BOX_INFO, FRAME_DIRECT, FRAME_INVERSE,
00107   IS_EQUAL, IS_INTERSECTION,
00108   ON_CURVE, ON_TEXT_BORDER, ON_GRID,
00109 
00110   // graphical interface markup
00111   CANVAS, ORNAMENT,
00112 
00113   // obsolete tags
00114   FORMAT, LINE_SEP, SPLIT, DELAY, HOLD, RELEASE,
00115   OLD_MATRIX, OLD_TABLE, OLD_MOSAIC, OLD_MOSAIC_ITEM,
00116   SET, RESET, EXPAND, VAR_EXPAND, HIDE_EXPAND,
00117   APPLY, BEGIN, END, FUNC, ENV,
00118   AUTHORIZE, POSTSCRIPT,
00119 
00120   // user extensions
00121   START_EXTENSIONS
00122 };
00123 
00124 inline tree_label SUB (bool right) { return right? RSUB: LSUB; }
00125 inline tree_label SUP (bool right) { return right? RSUP: LSUP; }
00126 
00127 /******************************************************************************
00128 * Conversions from tree_labels to strings and vice versa
00129 ******************************************************************************/
00130 
00131 void make_tree_label (tree_label l, string s);
00132 tree_label make_tree_label (string s); // for extensions
00133 string as_string (tree_label l);
00134 tree_label as_tree_label (string s);
00135 bool existing_tree_label (string s);
00136 
00137 #ifdef OS_WIN32
00138 inline bool operator == (tree_label first, tree_label second) {
00139   return (int) first == (int) second; }
00140 inline bool operator != (tree_label first, tree_label second) {
00141   return (int) first != (int) second; }
00142 #endif
00143 
00144 #endif // defined TREE_LABEL_H