This is Unofficial EPICS BASE Doxygen Site
lalr.c File Reference
#include "defs.h"
+ Include dependency graph for lalr.c:

Go to the source code of this file.

Classes

struct  shorts
 

Typedefs

typedef struct shorts shorts
 

Functions

void lalr (void)
 
int map_goto (int state, int symbol)
 

Variables

int tokensetsize
 
short * lookaheads
 
short * LAruleno
 
unsigned * LA
 
short * accessing_symbol
 
core ** state_table
 
shifts ** shift_table
 
reductions ** reduction_table
 
short * goto_map
 
short * from_state
 
short * to_state
 

Typedef Documentation

typedef struct shorts shorts

Function Documentation

void lalr ( void  )

Definition at line 60 of file lalr.c.

61 {
63 
64  set_state_table();
65  set_accessing_symbol();
66  set_shift_table();
67  set_reduction_table();
68  set_maxrhs();
69  initialize_LA();
70  set_goto_map();
71  initialize_F();
72  build_relations();
73  compute_FOLLOWS();
74  compute_lookaheads();
75 }
#define WORDSIZE(n)
Definition: defs.h:34
int tokensetsize
Definition: lalr.c:19
int ntokens
Definition: antelope.c:58
int map_goto ( int  state,
int  symbol 
)

Definition at line 265 of file lalr.c.

266 {
267  int high;
268  int low;
269  int middle;
270  int s;
271 
272  low = goto_map[symbol];
273  high = goto_map[symbol + 1];
274 
275  for (;;)
276  {
277  assert(low <= high);
278  middle = (low + high) >> 1;
279  s = from_state[middle];
280  if (s == state)
281  return (middle);
282  else if (s < state)
283  low = middle + 1;
284  else
285  high = middle - 1;
286  }
287 }
#define assert(exp)
Declare that a condition should be true.
Definition: epicsAssert.h:70
short * goto_map
Definition: lalr.c:27
short * from_state
Definition: lalr.c:28

Variable Documentation

short* accessing_symbol

Definition at line 23 of file lalr.c.

short* from_state

Definition at line 28 of file lalr.c.

short* goto_map

Definition at line 27 of file lalr.c.

unsigned* LA

Definition at line 22 of file lalr.c.

short* LAruleno

Definition at line 21 of file lalr.c.

short* lookaheads

Definition at line 20 of file lalr.c.

reductions** reduction_table

Definition at line 26 of file lalr.c.

shifts** shift_table

Definition at line 25 of file lalr.c.

core** state_table

Definition at line 24 of file lalr.c.

short* to_state

Definition at line 29 of file lalr.c.

int tokensetsize

Definition at line 19 of file lalr.c.