TeX in C
Explore TeX with modern c compiler.
PART 28: Conditional processing

宏定义

#define getxtokenoractivechar()
 
#define ifnodesize   2
 number of words in stack entry for conditionals. 更多...
 
#define iflinefield(x)   mem[x + 1].int_
 [p182#489] 更多...
 

枚举

enum  ConditionPrimitives {
  IF_CHAR_CODE , IF_CAT_CODE , IF_INT_CODE , IF_DIM_CODE ,
  IF_ODD_CODE , IF_VMODE_CODE , IF_HMODE_CODE , IF_MMODE_CODE ,
  IF_INNER_CODE , IF_VOID_CODE , IF_HBOX_CODE , IF_VBOX_CODE ,
  IF_X_CODE , IF_EOF_CODE , IF_TRUE_CODE , IF_FALSE_CODE ,
  IF_CASE_CODE
}
 [p181#487]: Conditional processing 更多...
 
enum  IfCode { ifcode = 1 , ficode , elsecode , orcode }
 [#489] 更多...
 

函数

void cond_process_init ()
 [#490] 更多...
 
static void passtext (void)
 [#494] ignores text until coming to an \or, \else, or \fi at level zero of \if...\fi nesting. 更多...
 
static void changeiflimit (SmallNumber l, HalfWord p)
 [#497] changes the iflimit code corresponding to a given value of condptr. 更多...
 
static void conditional (void)
 [#498] when the expand procedure encounters an if test command. 更多...
 

变量

Pointer condptr
 [#489] top of the condition stack. 更多...
 
UChar iflimit
 [#489] upper bound on fi_or_else codes 更多...
 
SmallNumber curif
 [#489] type of conditional being worked on 更多...
 
Integer ifline
 [#489] line where that conditional began 更多...
 
Integer skipline
 [#493] skipping began here 更多...
 

详细描述

宏定义说明

◆ getxtokenoractivechar

#define getxtokenoractivechar ( )
值:
cur_chr = curtok - CS_TOKEN_FLAG - ACTIVE_BASE) \
: (cur_chr = curchr))
@ RELAX
[#207] [\relax] do nothing.
Definition: tex_constant.h:205
@ ACTIVE_CHAR
[#207] [~] characters that invoke macros.
Definition: tex_constant.h:195
#define ACTIVE_BASE
[p82#222] [region 1] eqtb[ACTIVE_BASE, (HASH_BASE - 1)] holds current equivalents of single-character...
Definition: eqtb.h:18
#define CS_TOKEN_FLAG
[#298] amount added to the eqtb location in a token that stands for a control sequence.
Definition: lexer.h:87
HalfWord curchr
[#297]: operand of current command a character code or other modifier of the command code.
Definition: lexer.c:43
EightBits curcmd
[#297]: current command set by get_next a command code from the long list of codes given above.
Definition: lexer.c:40
HalfWord curtok
[#297]: packed representative of curcmd and curchr.
Definition: lexer.c:48
#define noexpandflag
[p136#341] label not_use
Definition: lexer.h:211
void get_x_token(void)
Definition: expand.c:535

◆ iflinefield

#define iflinefield (   x)    mem[x + 1].int_

[p182#489]

◆ ifnodesize

#define ifnodesize   2

number of words in stack entry for conditionals.

枚举类型说明

◆ ConditionPrimitives

[p181#487]: Conditional processing

枚举值
IF_CHAR_CODE 

\if

IF_CAT_CODE 

\ifcat

IF_INT_CODE 

\ifnum

IF_DIM_CODE 

\ifdim

IF_ODD_CODE 

\ifodd

IF_VMODE_CODE 

\ifvmode

IF_HMODE_CODE 

\ifhmode

IF_MMODE_CODE 

\ifmmode

IF_INNER_CODE 

\ifinner

IF_VOID_CODE 

\ifvoid

IF_HBOX_CODE 

\ifhbox

IF_VBOX_CODE 

\ifvbox

IF_X_CODE 

\ifx

IF_EOF_CODE 

\ifeof

IF_TRUE_CODE 

\iftrue

IF_FALSE_CODE 

\iffalse

IF_CASE_CODE 

\ifcase

◆ IfCode

enum IfCode

[#489]

枚举值
ifcode 

code for \if... being evaluated

ficode 

code for \fi

elsecode 

code for \else

orcode 

code for \or

函数说明

◆ changeiflimit()

static void changeiflimit ( SmallNumber  l,
HalfWord  p 
)
static

[#497] changes the iflimit code corresponding to a given value of condptr.

◆ cond_process_init()

void cond_process_init ( )

[#490]

◆ conditional()

static void conditional ( void  )
static

[#498] when the expand procedure encounters an if test command.

◆ passtext()

static void passtext ( void  )
static

[#494] ignores text until coming to an \or, \else, or \fi at level zero of \if...\fi nesting.

变量说明

◆ condptr

Pointer condptr

[#489] top of the condition stack.

◆ curif

SmallNumber curif

[#489] type of conditional being worked on

◆ iflimit

UChar iflimit

[#489] upper bound on fi_or_else codes

◆ ifline

Integer ifline

[#489] line where that conditional began

◆ skipline

Integer skipline

[#493] skipping began here