coan 4.2.4
The Hash-If-Control component interface
Collaboration diagram for The Hash-If-Control component interface:

Modules

 Macro-generated code

Files

file  if_control.c
file  if_control.h

Enumerations

enum  if_state_t {
  IF_STATE_OUTSIDE, IF_STATE_FALSE_PREFIX, IF_STATE_TRUE_PREFIX, IF_STATE_PASS_MIDDLE,
  IF_STATE_FALSE_MIDDLE, IF_STATE_TRUE_MIDDLE, IF_STATE_PASS_ELSE, IF_STATE_FALSE_ELSE,
  IF_STATE_TRUE_ELSE, IF_STATE_FALSE_TRAILER, IF_STATE_COUNT
}

Functions

void transition (line_type_t linetype)
bool dead_line (void)
bool was_unconditional_line (void)
bool is_unconditional_line (void)
size_t if_start_line (void)
size_t if_depth (void)
if_state_t if_state (void)
void if_control_toplevel (void)

Enumeration Type Documentation

enum if_state_t

Enumeration of the if-control states

Enumerator:
IF_STATE_OUTSIDE 

We are outside any hash-if

IF_STATE_FALSE_PREFIX 

We have a false hash-if followed by false hash-elif

IF_STATE_TRUE_PREFIX 

The first non-false hash-(el)if is true

IF_STATE_PASS_MIDDLE 

The first non-false hash-(el)if is unknown

IF_STATE_FALSE_MIDDLE 

We have a false hash-elif after a pass state

IF_STATE_TRUE_MIDDLE 

We have a true hash-elif after a pass state

IF_STATE_PASS_ELSE 

We have an hash-else after a pass state

IF_STATE_FALSE_ELSE 

We have an hash-else after a true state

IF_STATE_TRUE_ELSE 

We have an hash-else after only false states

IF_STATE_FALSE_TRAILER 

All hash-elif directives after a true are false

IF_STATE_COUNT 

Count of if-control states

Definition at line 57 of file if_control.h.


Function Documentation

bool dead_line ( void  )

Is the current line rejected?

Definition at line 408 of file if_control.c.

References GET_STATE, if_depth(), IF_STATE_FALSE_ELSE, IF_STATE_FALSE_MIDDLE, IF_STATE_FALSE_PREFIX, and IF_STATE_FALSE_TRAILER.

Referenced by dropping_line().

Here is the call graph for this function:

void if_control_toplevel ( void  )

Reset the depth of if-nesting to 0

Definition at line 456 of file if_control.c.

References SET_STATE.

Referenced by exit_diagnostics(), and node_proc().

size_t if_depth ( void  )

Return the current depth of if-nesting

Definition at line 444 of file if_control.c.

References GET_STATE.

Referenced by dead_line(), debug(), if_start_line(), if_state(), is_unconditional_line(), set_state(), transition(), vreport(), and was_unconditional_line().

size_t if_start_line ( void  )

For debug(), return the starting line number of the current hash-if-sequence.

Definition at line 450 of file if_control.c.

References GET_STATE, and if_depth().

Referenced by vreport().

Here is the call graph for this function:

if_state_t if_state ( void  )

Return the current if-state

Definition at line 438 of file if_control.c.

References GET_STATE, and if_depth().

Referenced by if_state_name().

Here is the call graph for this function:

bool is_unconditional_line ( void  )

Is the current line outside any hash-if-scope or in the scope of a satisfied hash-if-condition.

Definition at line 427 of file if_control.c.

References GET_STATE, if_depth(), IF_STATE_OUTSIDE, IF_STATE_TRUE_ELSE, IF_STATE_TRUE_MIDDLE, and IF_STATE_TRUE_PREFIX.

Referenced by eligible_line(), eval_line(), insert_pending_contradiction(), symbol_define(), and symbol_undefine().

Here is the call graph for this function:

void transition ( line_type_t  linetype)

Transition the if-control state given an evaluated line type.

Parameters:
linetypeThe linetype of the last evaluated input line.

The function advances a state-machine whose parameters are the current input linetype and the current if-control state. The transition performs the appropriate action to despatch the line just evaluated and sets a new if-state.

Definition at line 401 of file if_control.c.

References GET_STATE, if_depth(), and transition_table.

Referenced by eval_line(), and node_proc().

Here is the call graph for this function:

bool was_unconditional_line ( void  )

Is the current line outside any hash-if-scope?

Definition at line 419 of file if_control.c.

References GET_STATE, if_depth(), and IF_STATE_OUTSIDE.

Referenced by eval_line().

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines