summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex/scanning.h
blob: e4189a0f67a4921d589da3a06c3971a6113d11e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* scanning.h

   Copyright 2009 Taco Hoekwater <taco@luatex.org>

   This file is part of LuaTeX.

   LuaTeX is free software; you can redistribute it and/or modify it under
   the terms of the GNU General Public License as published by the Free
   Software Foundation; either version 2 of the License, or (at your
   option) any later version.

   LuaTeX is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
   License for more details.

   You should have received a copy of the GNU General Public License along
   with LuaTeX; if not, see <http://www.gnu.org/licenses/>.

*/

#ifndef SCANNING_H
#  define SCANNING_H

typedef enum {
    int_val_level = 0,          /* integer values */
    attr_val_level,             /* integer values */
    dimen_val_level,            /* dimension values */
    glue_val_level,             /* glue specifications */
    mu_val_level,               /* math glue specifications */
    dir_val_level,              /* directions */
    ident_val_level,            /* font identifier */
    tok_val_level,              /* token lists */
} value_level_code;

extern void scan_left_brace(void);
extern void scan_optional_equals(void);

extern int cur_val;             /* value returned by numeric scanners */
extern int cur_val1;            /* delcodes are sometimes 51 digits */
extern int cur_val_level;       /* the ``level'' of this value */

extern void scan_something_simple(halfword cmd, halfword subitem);
extern void scan_something_internal(int level, boolean negative);

extern void scan_limited_int(int max, const char *name);

extern void negate_cur_val(boolean delete_glue);

#  define scan_register_num() scan_limited_int(65535,"register code")
#  define scan_mark_num() scan_limited_int(65535,"marks code")
#  define scan_char_num() scan_limited_int(biggest_char,"character code")
#  define scan_four_bit_int() scan_limited_int(15,NULL)
#  define scan_math_family_int() scan_limited_int(255,"math family")
#  define scan_real_fifteen_bit_int() scan_limited_int(32767,"mathchar")
#  define scan_big_fifteen_bit_int() scan_limited_int(0x7FFFFFF,"extended mathchar")
#  define scan_twenty_seven_bit_int() scan_limited_int(0777777777,"delimiter code")

extern void scan_fifteen_bit_int(void);
extern void scan_fifty_one_bit_int(void);

#  define octal_token (other_token+'\'')            /* apostrophe, indicates an octal constant */
#  define hex_token (other_token+'"')               /* double quote, indicates a hex constant */
#  define alpha_token (other_token+'`')             /* reverse apostrophe, precedes alpha constants */
#  define point_token (other_token+'.')             /* decimal point */
#  define comma_token (other_token+',')             /* decimal comma */
#  define plus_token (other_token + '+')
#  define minus_token (other_token + '-')
#  define continental_point_token (other_token+',') /* decimal point, Eurostyle */
#  define infinity 017777777777                     /* the largest positive value that \TeX\ knows */
#  define zero_token (other_token+'0')              /* zero, the smallest digit */
#  define nine_token (other_token+'9')              /* zero, the smallest digit */
#  define A_token (letter_token+'A')                /* the smallest special hex digit */
#  define other_A_token (other_token+'A')           /* special hex digit of type |other_char| */
extern int radix;

extern void scan_int(void);

extern int cur_order;

#  define scan_normal_dimen() scan_dimen(false,false,false)

extern void scan_dimen(boolean mu, boolean inf, boolean shortcut);
extern void scan_glue(int level);

extern halfword the_toks(void);
extern str_number the_scanned_result(void);
extern void set_font_dimen(void);
extern void get_font_dimen(void);

#  define default_rule 26214    /* 0.4\thinspace pt */

extern halfword scan_rule_spec(void);

extern void scan_font_ident(void);
extern void scan_general_text(void);
extern void get_x_or_protected(void);
extern halfword scan_toks(boolean macrodef, boolean xpand);

extern void scan_normal_glue(void);
extern void scan_mu_glue(void);

/* extern int add_or_sub(int x, int y, int max_answer, boolean negative); */
/* extern int quotient(int n, int d); */
extern int fract(int x, int n, int d, int max_answer);

/* extern void scan_expr(void); */

#endif