Debian Codegraph @

texk/web2c/luatexdir/tex/scanning.h

raw
1 /* scanning.h
2
3 Copyright 2009 Taco Hoekwater <[email protected]>
4
5 This file is part of LuaTeX.
6
7 LuaTeX is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
11
12 LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
16
17 You should have received a copy of the GNU General Public License along
18 with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
19
20 */
21
22 #ifndef SCANNING_H
23 # define SCANNING_H
24
25 typedef enum {
26 int_val_level = 0, /* integer values */
27 attr_val_level, /* integer values */
28 dimen_val_level, /* dimension values */
29 glue_val_level, /* glue specifications */
30 mu_val_level, /* math glue specifications */
31 dir_val_level, /* directions */
32 ident_val_level, /* font identifier */
33 tok_val_level, /* token lists */
34 } value_level_code;
35
36 extern void scan_left_brace(void);
37 extern void scan_optional_equals(void);
38
39 extern int cur_val; /* value returned by numeric scanners */
40 extern int cur_val1; /* delcodes are sometimes 51 digits */
41 extern int cur_val_level; /* the ``level'' of this value */
42
43 extern void scan_something_simple(halfword cmd, halfword subitem);
44 extern void scan_something_internal(int level, boolean negative);
45
46 extern void scan_limited_int(int max, const char *name);
47
48 extern void negate_cur_val(boolean delete_glue);
49
50 # define scan_register_num() scan_limited_int(65535,"register code")
51 # define scan_mark_num() scan_limited_int(65535,"marks code")
52 # define scan_char_num() scan_limited_int(biggest_char,"character code")
53 # define scan_four_bit_int() scan_limited_int(15,NULL)
54 # define scan_math_family_int() scan_limited_int(255,"math family")
55 # define scan_real_fifteen_bit_int() scan_limited_int(32767,"mathchar")
56 # define scan_big_fifteen_bit_int() scan_limited_int(0x7FFFFFF,"extended mathchar")
57 # define scan_twenty_seven_bit_int() scan_limited_int(0777777777,"delimiter code")
58
59 extern void scan_fifteen_bit_int(void);
60 extern void scan_fifty_one_bit_int(void);
61
62 # define octal_token (other_token+'\'') /* apostrophe, indicates an octal constant */
63 # define hex_token (other_token+'"') /* double quote, indicates a hex constant */
64 # define alpha_token (other_token+'`') /* reverse apostrophe, precedes alpha constants */
65 # define point_token (other_token+'.') /* decimal point */
66 # define comma_token (other_token+',') /* decimal comma */
67 # define plus_token (other_token + '+')
68 # define minus_token (other_token + '-')
69 # define continental_point_token (other_token+',') /* decimal point, Eurostyle */
70 # define infinity 017777777777 /* the largest positive value that \TeX\ knows */
71 # define zero_token (other_token+'0') /* zero, the smallest digit */
72 # define nine_token (other_token+'9') /* zero, the smallest digit */
73 # define A_token (letter_token+'A') /* the smallest special hex digit */
74 # define other_A_token (other_token+'A') /* special hex digit of type |other_char| */
75 extern int radix;
76
77 extern void scan_int(void);
78
79 extern int cur_order;
80
81 # define scan_normal_dimen() scan_dimen(false,false,false)
82
83 extern void scan_dimen(boolean mu, boolean inf, boolean shortcut);
84 extern void scan_glue(int level);
85
86 extern halfword the_toks(void);
87 extern str_number the_scanned_result(void);
88 extern void set_font_dimen(void);
89 extern void get_font_dimen(void);
90
91 # define default_rule 26214 /* 0.4\thinspace pt */
92
93 extern halfword scan_rule_spec(void);
94
95 extern void scan_font_ident(void);
96 extern void scan_general_text(void);
97 extern void get_x_or_protected(void);
98 extern halfword scan_toks(boolean macrodef, boolean xpand);
99
100 extern void scan_normal_glue(void);
101 extern void scan_mu_glue(void);
102
103 /* extern int add_or_sub(int x, int y, int max_answer, boolean negative); */
104 /* extern int quotient(int n, int d); */
105 extern int fract(int x, int n, int d, int max_answer);
106
107 /* extern void scan_expr(void); */
108
109 #endif