TeX in C
Explore TeX with modern c compiler.
scan.h
浏览该文件的文档.
1 #pragma once
2 #ifndef INC_SCAN_H
7 #define INC_SCAN_H
8 #include "global.h"
9 #include "lexer.h" // [macro] othertoken; [var] curcmd,
10 #include "str.h" // [type] widthoffset
11 
17 enum TokenLevel {
24 }; // [#410] enum TokenLevel
25 
27 #define INPUT_LINE_NO_CODE (GLUE_VAL + 1)
29 #define BADNESS_CODE (GLUE_VAL + 2)
31 #define MAX_DIMEN 1073741823L
33 #define ZERO_TOKEN (othertoken + '0')
34 // [#448] label
35 // /// go here to pack cur val and f into cur val
36 // #define attachfraction 88
37 // //// go here when cur val is correct except perhaps for sign
38 // #define attachsign 89
39 
41 #define SCAN_NORMAL_DIMEN() scan_dimen(false, false, false) // end group S402x463_P155x173
43 
44 
45 extern Integer cur_val;
47 extern SmallNumber radix;
48 extern GlueOrd cur_order;
49 
50 
51 extern void skip_spaces(void);
52 extern void skip_spaces_or_relax(void);
53 extern void scan_left_brace(void);
54 extern void scan_optional_equals(void);
55 extern Boolean scankeyword(StrNumber s);
56 // [tex] 1
57 extern void
59  Boolean negative);
60 extern void scan_eight_bit_int(void);
61 extern void scan_char_num(void);
62 extern void scan_four_bit_int(void);
63 extern void scan_fifteen_bit_int(void);
64 extern void scan_twenty_seven_bit_int(void);
65 extern void scan_int(void);
66 extern void scan_dimen(Boolean mu, Boolean inf, Boolean shortcut);
67 extern void scan_glue(SmallNumber level);
68 extern HalfWord scan_rule_spec(void);
69 
70 extern void scan_init();
71 
72 #endif // INC_SCAN_H
uint32_t HalfWord
[p43#113]: HalfWord(16=>32) .
Definition: tex_types.h:127
uint_fast32_t StrNumber
Definition: str.h:73
HalfWord scan_rule_spec(void)
[#463] returns a pointer to a rule node.
Definition: scan.c:1032
void skip_spaces(void)
[#406] Get the next non-blank non-call token.
Definition: scan.c:73
void scan_glue(SmallNumber level)
[#461] sets cur_val to a glue spec pointer.
Definition: scan.c:974
void scan_fifteen_bit_int(void)
[#436] scan mathchar = [0, 23767], use scan_int.
Definition: scan.c:547
GlueOrd cur_order
[#447] order of INFINITY found by scan_dimen.
Definition: scan.c:60
void scan_four_bit_int(void)
[#435] scan number = [0, 15], use scan_int.
Definition: scan.c:532
void scan_eight_bit_int(void)
[#433] scan register code = [0, 255], use scan_int.
Definition: scan.c:500
Integer cur_val
[#410] value returned by numeric scanners.
Definition: scan.c:53
Boolean scankeyword(StrNumber s)
[#407] look for a given string.
Definition: scan.c:139
void scan_init()
[#439]
Definition: scan.c:64
void scan_twenty_seven_bit_int(void)
[#437] scan mathchar = , use scan_int.
Definition: scan.c:562
void scan_int(void)
[#440] sets cur_val to an integer.
Definition: scan.c:584
void scan_char_num(void)
[#434] scan character code = [0, 255], use scan_int.
Definition: scan.c:517
SmallNumber radix
[#438] scan_int sets this to 8, 10, 16, or zero.
Definition: scan.c:58
TokenLevel
[#410]
Definition: scan.h:17
void scan_optional_equals(void)
[#405] looks for an optional = sign preceded by optional spaces.
Definition: scan.c:124
void scan_dimen(Boolean mu, Boolean inf, Boolean shortcut)
[#448] sets cur_val to a dimension.
Definition: scan.c:702
void scan_left_brace(void)
[#403] when a left brace is supposed to be the next non-blank token.
Definition: scan.c:95
void scan_something_internal(SmallNumber level, Boolean negative)
[#413] fetch an internal parameter.
Definition: scan.c:207
void skip_spaces_or_relax(void)
[#404] Get the next non-blank non-relax non-call token.
Definition: scan.c:82
SmallNumber cur_val_level
[#410] the "level" of this value.
Definition: scan.c:56
@ IDENT_VAL
font identifier
Definition: scan.h:22
@ DIMEN_VAL
dimension values
Definition: scan.h:19
@ INT_VAL
integer values
Definition: scan.h:18
@ MU_VAL
math glue specifications
Definition: scan.h:21
@ TOK_VAL
token lists
Definition: scan.h:23
@ GLUE_VAL
glue specifications
Definition: scan.h:20
int64_t Integer
Integer(64) =
Definition: tex_types.h:42
bool Boolean
布尔类型定义
Definition: tex_types.h:11
UChar SmallNumber
[p38#101]: SmallNumber::UChar(8) = [0, 255] only need: (6bit)[0, 63] .
Definition: tex_types.h:112
UChar GlueOrd
INFINITY to the 0, 1, 2, or 3 power.
Definition: tex_types.h:178