struct charinfo;
struct node;
struct vunits;
class token {
symbol nm;
node *nd;
unsigned char c;
int val;
units dim;
enum token_type {
TOKEN_BACKSPACE,
TOKEN_BEGIN_TRAP,
TOKEN_CHAR, TOKEN_DUMMY,
TOKEN_EMPTY, TOKEN_END_TRAP,
TOKEN_ESCAPE, TOKEN_HYPHEN_INDICATOR,
TOKEN_INTERRUPT, TOKEN_ITALIC_CORRECTION, TOKEN_LEADER, TOKEN_LEFT_BRACE,
TOKEN_MARK_INPUT, TOKEN_NEWLINE, TOKEN_NODE,
TOKEN_NUMBERED_CHAR,
TOKEN_PAGE_EJECTOR,
TOKEN_REQUEST,
TOKEN_RIGHT_BRACE,
TOKEN_SPACE, TOKEN_SPECIAL, TOKEN_SPREAD, TOKEN_TAB, TOKEN_TRANSPARENT, TOKEN_EOF } type;
public:
token();
~token();
token(const token &);
void operator=(const token &);
void next();
void process();
void skip();
int eof();
int nspaces(); int space(); int white_space(); int newline(); int tab(); int leader();
int backspace();
int delimiter(int warn = 0); int dummy();
int transparent();
int left_brace();
int right_brace();
int page_ejector();
int hyphen_indicator();
int operator==(const token &); int operator!=(const token &); unsigned char ch();
charinfo *get_char(int required = 0);
int add_to_node_list(node **);
int title();
void make_space();
void make_newline();
const char *description();
friend void process_input_stack();
};
extern token tok;
extern symbol get_name(int required = 0);
extern symbol get_long_name(int required = 0);
extern charinfo *get_optional_char();
extern void check_missing_character();
extern void skip_line();
extern void handle_initial_title();
struct hunits;
extern void read_title_parts(node **part, hunits *part_width);
extern int get_number(units *result, unsigned char si);
extern int get_integer(int *result);
extern int get_number(units *result, unsigned char si, units prev_value);
extern int get_integer(int *result, int prev_value);
void interpolate_number_reg(symbol, int);
const char *asciify(int c);
inline int token::newline()
{
return type == TOKEN_NEWLINE;
}
inline int token::space()
{
return type == TOKEN_SPACE;
}
inline int token::nspaces()
{
if (type == TOKEN_SPACE)
return 1;
else
return 0;
}
inline int token::white_space()
{
return type == TOKEN_SPACE || type == TOKEN_TAB;
}
inline int token::transparent()
{
return type == TOKEN_TRANSPARENT;
}
inline int token::page_ejector()
{
return type == TOKEN_PAGE_EJECTOR;
}
inline unsigned char token::ch()
{
return type == TOKEN_CHAR ? c : 0;
}
inline int token::eof()
{
return type == TOKEN_EOF;
}
inline int token::dummy()
{
return type == TOKEN_DUMMY;
}
inline int token::left_brace()
{
return type == TOKEN_LEFT_BRACE;
}
inline int token::right_brace()
{
return type == TOKEN_RIGHT_BRACE;
}
inline int token::tab()
{
return type == TOKEN_TAB;
}
inline int token::leader()
{
return type == TOKEN_LEADER;
}
inline int token::backspace()
{
return type == TOKEN_BACKSPACE;
}
inline int token::hyphen_indicator()
{
return type == TOKEN_HYPHEN_INDICATOR;
}
int has_arg();