Class hierarchy   Compound list   File list   Compound Members   File Members  

Parser Class Reference

parser for command files. More...

List of all members.

Public Members

Private Members


Detailed Description

parser for command files.


Member Function Documentation

Parser::Parser(const char *_fname)

constructor

opens _fname for reading and initializes data

Parser::~Parser()

destructor

closes command file

void Parser::error(int errnum, const char *args, ...)

prints an error

errnum is one of the ERROR_ or WARNING_ constants from errdesc.h

calls describe_error

$$ is replaced by current token

void Parser::print(const char *args, ...)

replaces "$$" by current token, including ''

void Parser::printcurtok(void)

prints current token to screen. Used for $$ replacements

void Parser::gentoken(void)

drop current token and read next from input file

bool Parser::eatOpen(bool force)

eats a opening bracket '('.

if force is

Returns:
true if there was a bracket

bool Parser::eatClose(bool force)

eats a closing bracket ')'.

if force is

Returns:
true if there was a bracket

int Parser::eatNumber(void)

eats a positive integer

Returns:
  • >=0 if there was a number
  • -1 if there was no number

bool Parser::eatSNumber(int &)

eats a integer

writes it into the argument

Returns:
  • true if there was a number
  • false if there was no number

int Parser::gchar(void) [private]

void Parser::push(void) [private]

int Parser::type(int) [private]

void Parser::skipwhite(void) [private]

void Parser::vprint(const char *args, va_list ap) [private]

similar to vprintf()

replaces $$ by current token


Member Data Documentation

int Parser::curtok

current token type. Value is one of the PT_ defines.

class ensures that calling functions never get PT_CBEGIN, PT_CEND and PT_LINECOM.

char Parser::tok_text[MAX_TOK_LENGTH]

string with the current token if curtok is PT_TEXT

char* Parser::fname [private]

FILE* Parser::f [private]

int Parser::lineno [private]

int Parser::curch [private]


The documentation for this class was generated from the following files:
Generated at Wed May 31 21:08:20 2000 for Rvtmod/rvglue by doxygen  written by Dimitri van Heesch, © 1997-1998