TeX in C
Explore TeX with modern c compiler.
tex_constant.h
浏览该文件的文档.
1 #pragma once
2 #ifndef INC_TEX_CONSTANT
10 #define INC_TEX_CONSTANT
11 #include "global_const.h"
12 
20 #define TEX_BANNER "This is TeX, Version 3.14159"
21 
22 
23 /* [#11]: Constants in the outer block.
24  The following parameters can be changed at compile time
25  to extend or reduce TEX’s capacity.
26  They may have different values in INITEX and
27  in production versions of TEX.
28 */
29 
37 #define MEM_MAX 3000000
43 #define MEM_MIN 0
51 #define BUF_SIZE 5000
52 
53 #ifndef TEX_TRIP_TEST
56 #define ERROR_LINE 72
61 #define HALF_ERROR_LINE 42
66 #define MAX_PRINT_LINE 79
67 #else
68 #define ERROR_LINE 64
69 #define HALF_ERROR_LINE 32
70 #define MAX_PRINT_LINE 72
71 #endif /* TEX_TRIP_TEST */
72 
75 #define STACK_SIZE 200
79 #define MAX_IN_OPEN 6
82 #define FONT_MAX 75
87 #define FONT_MEM_SIZE 200000
90 #define PARAM_SIZE 60
93 #define NEST_SIZE 40
97 #define SAVE_SIZE 600
103 #define TRIE_SIZE 131000
108 #define TRIE_OP_SIZE 5000
113 #define FILE_NAME_SIZE 240
118 #define POOL_NAME "TeXformats:TEX.POOL "
119 
123 #define MEM_BOT 0
130 #define MEM_TOP 3000000
133 #define FONT_BASE 0
139 #define HASH_SIZE 210000
145 #define HASH_PRIME 171553
148 #define HYPH_SIZE 307
149 
152 #define EMPTY 0 // end group S1x16_P3x9
154 
160 #define MIN_QUARTER_WORD 0
163 #define MAX_QUARTER_WORD 255
165 #define MIN_HALF_WORD 0
169 #define MAX_HALF_WORD 655350000L // end group S110x114_P42x43
171 
172 
178 enum CatCode {
184 
185  CAR_RET = 5,
190 
192  SPACER = 10,
197 
200 }; // [#207]: CatCode
201 
204  // [p73#207]
209 
212 
215 
220 
221 
222  // [p74#208]
223 
225  CHAR_NUM = 16,
231 
233  HMOVE = 21,
239 
240  HSKIP = 26,
245 
252 
253  HRULE = 36,
261 
268 
276 
284 
286  VCENTER = 56,
292 
299 
300  // [p75#208]
301 
303  RADICAL = 66,
313  LAST_ITEM = 70,
314 
317 
318 
319  // [p75#209]
320 
331 
342 
353 
361  REGISTER = 89,
366 
368  MULTIPLY = 91,
377 
388 
390  MAX_COMMAND = 100,
391 
392 
393  // [p76#210]
394 
401 
403  FI_OR_ELSE = 106,
406  THE,
409 
410  CALL = 111,
415 
417  DONT_EXPAND = 116,
426 
427 }; // [#208] enum TexCommandCode // end group S207x210_P73x76
429 
430 
432 enum CmdCode {
439 }; // [#468] enum CmdCode
440 
441 
442 // [ #1055~1135: BUILDING BOXES AND LISTS ]
443 
451  MSKIP_CODE
452 };
453 
454 
455 #endif // INC_TEX_CONSTANT
TexCommandCode
[#208]
Definition: tex_constant.h:203
CatCode
[#207]:
Definition: tex_constant.h:178
@ HSKIP
[#208] [\hskip, \hfil, ...] horizontal glue.
Definition: tex_constant.h:240
@ BEGIN_GROUP
[#208] [\begingroup] begin local grouping.
Definition: tex_constant.h:294
@ CHAR_GIVEN
[#208] character code defined by \chardef.
Definition: tex_constant.h:309
@ MAX_COMMAND
[#209] the largest command code seen at big switch.
Definition: tex_constant.h:390
@ MAX_INTERNAL
[#209] the largest code that can follow \the.
Definition: tex_constant.h:363
@ ITAL_CORR
[#208] [\/] italic correction.
Definition: tex_constant.h:266
@ IF_TEST
[#210] [\if, \ifcase,] conditional text.
Definition: tex_constant.h:400
@ DIVIDE
[#209] [\divide] divide a register or parameter.
Definition: tex_constant.h:370
@ THE
[#210] [\the] expand an internal quantity.
Definition: tex_constant.h:406
@ ASSIGN_FONT_DIMEN
[#209] [\fontdimen] user-defined font dimension.
Definition: tex_constant.h:335
@ NO_EXPAND
[#210] \noexpand[] special nonexpansion.
Definition: tex_constant.h:398
@ CHAR_NUM
[#208] [\char] character specified numerically.
Definition: tex_constant.h:225
@ UN_HBOX
[#208] [\unhbox, \unhcopy] unglue a box.
Definition: tex_constant.h:235
@ TOP_BOT_MARK
[#210] [\topmark,...] inserted mark.
Definition: tex_constant.h:408
@ MATCH
[#207] match a macro parameter.
Definition: tex_constant.h:211
@ OMIT
[#208] [\omit] omit alignment template.
Definition: tex_constant.h:296
@ REMOVE_ITEM
[#208] [\unpenalty, \unkern, \unskip] nullify last item.
Definition: tex_constant.h:238
@ RADICAL
[#208] [\radical] square root and similar signs.
Definition: tex_constant.h:303
@ SET_BOX_DIMEN
[#209] [\wd, \ht, \dp] change dimension of box.
Definition: tex_constant.h:348
@ UN_VBOX
[#208] [\unvbox, \unvcopy] unglue a box.
Definition: tex_constant.h:236
@ DONT_EXPAND
[#210] the following token was marked by \noexpand.
Definition: tex_constant.h:417
@ FI_OR_ELSE
[#210] [\else,...] delimiters for conditionals.
Definition: tex_constant.h:403
@ MIN_INTERNAL
[#208] the smallest code that can follow \the.
Definition: tex_constant.h:307
@ SET_INTERACTION
[#209] [\batchmode,...] define level of interaction.
Definition: tex_constant.h:387
@ SET_SHAPE
[#209] [\parshape] specify fancy paragraph shape.
Definition: tex_constant.h:350
@ MAX_CHAR_CODE
[#207] largest catcode for individual characters.
Definition: tex_constant.h:219
@ PAR_END
[#207] [\par] end of paragraph.
Definition: tex_constant.h:210
@ DEF_FONT
[#209] [\font] define a font file.
Definition: tex_constant.h:359
@ ACCENT
[#208] [\accent] attach accent in text.
Definition: tex_constant.h:267
@ AFTER_GROUP
[#208] [\aftergroup] save till group is done.
Definition: tex_constant.h:263
@ END_CS_NAME
[#208] [\endcsname] end control sequence.
Definition: tex_constant.h:305
@ DEF_FAMILY
[#209] [\textfont,] declare math fonts.
Definition: tex_constant.h:355
@ CONVERT
[#210] [\number, \string,...] convert to text.
Definition: tex_constant.h:405
@ DISCRETIONARY
[#208] [\−, \discretionary] discretionary texts.
Definition: tex_constant.h:272
@ END_MATCH
[#207] end of parameters to macro.
Definition: tex_constant.h:213
@ DEF
[#209] [\def, \gdef, \xdef, \edef] macro definition.
Definition: tex_constant.h:381
@ OUT_PARAM
[#207] output a macro parameter.
Definition: tex_constant.h:206
@ HYPH_DATA
[#209] [\hyphenation, \patterns] hyphenation data.
Definition: tex_constant.h:385
@ EXTENSION
[#208] [\write, \special,...] extensions to TEX.
Definition: tex_constant.h:290
@ DEF_CODE
[#209] [\catcode,...] define a character code.
Definition: tex_constant.h:352
@ LAST_ITEM
[#208] [\lastpenalty, \lastker, \lastskip] most recent item.
Definition: tex_constant.h:313
@ LONG_OUTER_CALL
[#210] long, outer control sequence.
Definition: tex_constant.h:413
@ MATH_CHAR_NUM
[#208] [\mathchar] explicit math code.
Definition: tex_constant.h:227
@ EXPAND_AFTER
[#210] [\expandafter] special expansion.
Definition: tex_constant.h:397
@ OUTER_CALL
[#210] non-long, outer control sequence.
Definition: tex_constant.h:412
@ EQ_NO
[#208] [\eqno, \leqno] equation number.
Definition: tex_constant.h:273
@ MATH_STYLE
[#208] [\displaystyle, ...] style specification.
Definition: tex_constant.h:281
@ STOP
[#207] [\end | \dump] end of job.
Definition: tex_constant.h:214
@ ASSIGN_FONT_INT
[#209] [\hyphenchar, \skewchar] user-defined font integer.
Definition: tex_constant.h:337
@ SHORTHAND_DEF
[#209] [\chardef, \countdef,...] code definition.
Definition: tex_constant.h:376
@ VMOVE
[#208] [\raise, \lower] vertical motion.
Definition: tex_constant.h:234
@ SHAPE_REF
[#210] the equivalent points to a parshape specification.
Definition: tex_constant.h:421
@ ASSIGN_INT
[#209] [\tolerance, \day,...] user-defined integer.
Definition: tex_constant.h:326
@ IGNORE_SPACES
[#208] [\ignorespaces] gobble SPACER tokens.
Definition: tex_constant.h:258
@ MATH_COMP
[#208] [\mathbin,...] component of formula.
Definition: tex_constant.h:275
@ IN_STREAM
[#208] [\openin, \closein] files for reading.
Definition: tex_constant.h:291
@ HRULE
[#208] [\hrule] horizontal rule.
Definition: tex_constant.h:253
@ RELAX
[#207] [\relax] do nothing.
Definition: tex_constant.h:205
@ UNDEFINED_CS
[#210] initial state of most eq_type fields.
Definition: tex_constant.h:396
@ MATH_GIVEN
[#208] math code defined by \mathchardef.
Definition: tex_constant.h:311
@ VALIGN
[#208] [\valign] vertical table alignment.
Definition: tex_constant.h:249
@ END_TEMPLATE
[#210] end of an alignment template.
Definition: tex_constant.h:414
@ VCENTER
[#208] [\vcenter] vertically center a vbox.
Definition: tex_constant.h:286
@ LONG_CALL
[#210] long, non-outer control sequence.
Definition: tex_constant.h:411
@ ASSIGN_GLUE
[#209] [\baselineskip,...] user-defined glue.
Definition: tex_constant.h:330
@ MKERN
[#208] [\mkern] math kern.
Definition: tex_constant.h:244
@ HALIGN
[#208] [\halign] horizontal table alignment.
Definition: tex_constant.h:248
@ NON_SCRIPT
[#208] [\nonscript] conditional math glue.
Definition: tex_constant.h:283
@ CS_NAME
[#210] [\csname] make a control sequence from tokens.
Definition: tex_constant.h:404
@ ASSIGN_TOKS
[#209] [\output, \everypar,...] special token list.
Definition: tex_constant.h:324
@ MAX_NON_PREFIXED_COMMAND
[#208] largest command code that can’t be \global.
Definition: tex_constant.h:316
@ NO_BOUNDARY
[#208] [\noboundary] suppress boundary ligatures.
Definition: tex_constant.h:298
@ DATA
[#210] the equivalent is simply a halfword number.
Definition: tex_constant.h:425
@ SET_BOX
[#209] [\setbox] set a box.
Definition: tex_constant.h:383
@ EX_SPACE
[#208] [\] explicit space.
Definition: tex_constant.h:297
@ INSERT
[#208] [\insert] vlist inserted in box.
Definition: tex_constant.h:254
@ BOX_REF
[#210] the equivalent points to a box node, or is null.
Definition: tex_constant.h:423
@ VRULE
[#208] [\vrule] vertical rule.
Definition: tex_constant.h:251
@ ABOVE
[#208] [\above, \atop,...] generalized fraction.
Definition: tex_constant.h:280
@ SET_PAGE_DIMEN
[#209] [\pagegoal,...] specify state info.
Definition: tex_constant.h:344
@ PREFIX
[#209] [\global, \long, \outer] qualify a definition.
Definition: tex_constant.h:372
@ MARK
[#208] [\mark] mark definition.
Definition: tex_constant.h:228
@ TOKS_REGISTER
[#209] [\toks] token list register.
Definition: tex_constant.h:322
@ MESSAGE
[#208] [\message, \errmessage] send to user.
Definition: tex_constant.h:289
@ ENDV
[#207] end of <v_j> list in alignment template.
Definition: tex_constant.h:208
@ START_PAR
[#208] [\indent, \noindent] begin paragraph.
Definition: tex_constant.h:265
@ ASSIGN_DIMEN
[#209] [\hsize,...] user-defined length.
Definition: tex_constant.h:328
@ SET_AUX
[#209] [\spacefactor, \prevdepth] specify state info.
Definition: tex_constant.h:339
@ CALL
[#210] non-long, non-outer control sequence.
Definition: tex_constant.h:410
@ GLUE_REF
[#210] the equivalent points to a glue specification.
Definition: tex_constant.h:419
@ MATH_ACCENT
[#208] [\mathaccent] attach accent in math.
Definition: tex_constant.h:270
@ VADJUST
[#208] [\vadjust] vlist inserted in enclosing paragraph.
Definition: tex_constant.h:256
@ LIMIT_SWITCH
[#208] [\displaylimits,...] diddle limit conventions.
Definition: tex_constant.h:278
@ KERN
[#208] [\kern] fixed space.
Definition: tex_constant.h:243
@ CASE_SHIFT
[#208] [\lowercase, \uppercase] force specific case.
Definition: tex_constant.h:288
@ NO_ALIGN
[#208] [\noalign] temporary escape from alignment.
Definition: tex_constant.h:250
@ REGISTER
[#209] [\count, \dimen,] internal register.
Definition: tex_constant.h:361
@ XRAY
[#208] [\show, \showbox, ...] peek inside of TEX.
Definition: tex_constant.h:229
@ AFTER_ASSIGNMENT
[#208] [\afterassignment] save till assignment is done.
Definition: tex_constant.h:260
@ HMOVE
[#208] [\moveleft, \moveright] horizontal motion.
Definition: tex_constant.h:233
@ MSKIP
[#208] [\mskip] math glue.
Definition: tex_constant.h:242
@ LEFT_RIGHT
[#208] [\left, \right] variable delimiter.
Definition: tex_constant.h:274
@ END_GROUP
[#208] [\endgroup] end local grouping.
Definition: tex_constant.h:295
@ ASSIGN_MU_GLUE
[#209] [\thinmuskip,...] user-defined muglue.
Definition: tex_constant.h:333
@ LEADER_SHIP
[#208] [\shipout, \leaders, ...] use a box.
Definition: tex_constant.h:247
@ ADVANCE
[#209] [\advance] ADVANCE a register or parameter.
Definition: tex_constant.h:365
@ SET_PREV_GRAF
[#209] [\prevgraf] specify state info.
Definition: tex_constant.h:341
@ INPUT
[#210] [\input, \endinput] input a source file.
Definition: tex_constant.h:399
@ MULTIPLY
[#209] [\multiply] multiply a register or parameter.
Definition: tex_constant.h:368
@ READ_TO_CS
[#209] [\read] read into a control sequence.
Definition: tex_constant.h:379
@ SET_PAGE_INT
[#209] [\deadcycles, \insertpenalties] specify state info.
Definition: tex_constant.h:346
@ DELIM_NUM
[#207] [\delimiter] specify delimiter numerically.
Definition: tex_constant.h:217
@ MAKE_BOX
[#208] [\box, \copy, \hbox, ...] make a box.
Definition: tex_constant.h:230
@ VSKIP
[#208] [\vskip, \vfil, ...] vertical glue.
Definition: tex_constant.h:241
@ BREAK_PENALTY
[#208] [\penalty] additional badness.
Definition: tex_constant.h:264
@ MATH_CHOICE
[#208] [\mathchoice] choice specification.
Definition: tex_constant.h:282
@ LET
[#209] [\let, \futurelet] assign a command code.
Definition: tex_constant.h:374
@ SET_FONT
[#209] set current font ( font identifiers ).
Definition: tex_constant.h:357
@ ESCAPE
[#207] [\\] escape delimiter.
Definition: tex_constant.h:179
@ SPACER
[#207] [ | \t] characters equivalent to blank space.
Definition: tex_constant.h:192
@ MAC_PARAM
[#207] [#] macro parameter symbol.
Definition: tex_constant.h:186
@ CAR_RET
[#207] [\r | \cr | \crcr] end of line.
Definition: tex_constant.h:185
@ SUP_MARK
[#207] [^] superscript.
Definition: tex_constant.h:187
@ OTHER_CHAR
[#207] none of the special character types.
Definition: tex_constant.h:194
@ RIGHT_BRACE
[#207] [}] ending of a group.
Definition: tex_constant.h:181
@ SUB_MARK
[#207] [_] subscript.
Definition: tex_constant.h:188
@ IGNORE
[#207] [\0 | ^^@] characters to ignore.
Definition: tex_constant.h:189
@ TAB_MARK
[#207] [& | \span] alignment delimiter.
Definition: tex_constant.h:183
@ ACTIVE_CHAR
[#207] [~] characters that invoke macros.
Definition: tex_constant.h:195
@ LEFT_BRACE
[#207] [{] beginning of a group.
Definition: tex_constant.h:180
@ COMMENT
[#207] [%] characters that introduce comments.
Definition: tex_constant.h:196
@ LETTER
[#207] [A-Za-z] characters regarded as letters.
Definition: tex_constant.h:193
@ MATH_SHIFT
[#207] [$] mathematics shift character.
Definition: tex_constant.h:182
@ INVALID_CHAR
[#207] [\127 | ^^?] characters that shouldn't appear.
Definition: tex_constant.h:199
CmdCode
[#468] command code for ...
Definition: tex_constant.h:432
@ jobnamecode
\jobname
Definition: tex_constant.h:438
@ romannumeralcode
\romannumeral
Definition: tex_constant.h:434
@ stringcode
\string
Definition: tex_constant.h:435
@ numbercode
\number
Definition: tex_constant.h:433
@ fontnamecode
\fontname
Definition: tex_constant.h:437
@ meaningcode
\meaning
Definition: tex_constant.h:436
hvSkipDiff
[#1058]
Definition: tex_constant.h:445
@ FILL_CODE
Definition: tex_constant.h:447
@ MSKIP_CODE
Definition: tex_constant.h:451
@ SS_CODE
Definition: tex_constant.h:448
@ SKIP_CODE
Definition: tex_constant.h:450
@ FIL_NEG_CODE
Definition: tex_constant.h:449
@ FIL_CODE
Definition: tex_constant.h:446