example Namespace Reference

The example namespace is used to encapsulate the three parser classes example::Parser, example::Scanner and example::Driver. More...


Classes

class  Driver
 The Driver class brings together all components. More...
class  location
 Abstract a location. More...
class  Parser
 A Bison parser. More...
class  position
 Abstract a position. More...
class  Scanner
 Scanner is a derived class to add some extra function to the scanner class. More...
class  stack
class  slice
 Present a slice of the top of a stack. More...

Functions

const location operator+ (const location &begin, const location &end)
 Join two location objects to create a location.
const location operator+ (const location &begin, unsigned int width)
 Add two location objects.
locationoperator+= (location &res, unsigned int width)
 Add and assign a location.
bool operator== (const location &loc1, const location &loc2)
 Compare two location objects.
bool operator!= (const location &loc1, const location &loc2)
 Compare two location objects.
std::ostream & operator<< (std::ostream &ostr, const location &loc)
 Intercept output stream redirection.
const positionoperator+= (position &res, const int width)
 Add and assign a position.
const position operator+ (const position &begin, const int width)
 Add two position objects.
const positionoperator-= (position &res, const int width)
 Add and assign a position.
const position operator- (const position &begin, const int width)
 Add two position objects.
bool operator== (const position &pos1, const position &pos2)
 Compare two position objects.
bool operator!= (const position &pos1, const position &pos2)
 Compare two position objects.
std::ostream & operator<< (std::ostream &ostr, const position &pos)
 Intercept output stream redirection.


Detailed Description

The example namespace is used to encapsulate the three parser classes example::Parser, example::Scanner and example::Driver.


Function Documentation

bool example::operator!= ( const position &  pos1,
const position &  pos2 
) [inline]

Compare two position objects.

Definition at line 142 of file position.hh.

bool example::operator!= ( const location &  loc1,
const location &  loc2 
) [inline]

Compare two location objects.

Definition at line 136 of file location.hh.

const position example::operator+ ( const position &  begin,
const int  width 
) [inline]

Add two position objects.

Definition at line 110 of file position.hh.

const location example::operator+ ( const location &  begin,
unsigned int  width 
) [inline]

Add two location objects.

Definition at line 113 of file location.hh.

References example::location::columns().

const location example::operator+ ( const location &  begin,
const location &  end 
) [inline]

Join two location objects to create a location.

Definition at line 105 of file location.hh.

References example::location::end.

const position& example::operator+= ( position &  res,
const int  width 
) [inline]

Add and assign a position.

Definition at line 102 of file position.hh.

References example::position::columns().

location& example::operator+= ( location &  res,
unsigned int  width 
) [inline]

Add and assign a location.

Definition at line 121 of file location.hh.

References example::location::columns().

const position example::operator- ( const position &  begin,
const int  width 
) [inline]

Add two position objects.

Definition at line 125 of file position.hh.

const position& example::operator-= ( position &  res,
const int  width 
) [inline]

Add and assign a position.

Definition at line 118 of file position.hh.

std::ostream& example::operator<< ( std::ostream &  ostr,
const position &  pos 
) [inline]

Intercept output stream redirection.

Parameters:
ostr the destination output stream
pos a reference to the position to redirect

Definition at line 152 of file position.hh.

References example::position::column, example::position::filename, and example::position::line.

std::ostream& example::operator<< ( std::ostream &  ostr,
const location &  loc 
) [inline]

Intercept output stream redirection.

Parameters:
ostr the destination output stream
loc a reference to the location to redirect
Avoid duplicate information.

Definition at line 147 of file location.hh.

References example::location::begin, example::position::column, example::location::end, example::position::filename, and example::position::line.

bool example::operator== ( const position &  pos1,
const position &  pos2 
) [inline]

Compare two position objects.

Definition at line 132 of file position.hh.

References example::position::column, example::position::filename, and example::position::line.

bool example::operator== ( const location &  loc1,
const location &  loc2 
) [inline]

Compare two location objects.

Definition at line 129 of file location.hh.

References example::location::begin, and example::location::end.


Generated on Sat Sep 5 10:26:25 2009 for Flex Bison C++ Example by  doxygen 1.5.9