Home | Index | universal Index | gsp Index | Examples | Tutorial

ExpanderVisitor Class Reference

#include "gsp__Visitor.h"

The Expander Visitor's work consists in printing out the values of the parsed constants and tokens. More...


Inherited Class(es)


Public Functions

ExpanderVisitor ( std::ostream & os , bool bRestoreWS = true ) 
~ExpanderVisitor ( ) 
  • bool 
process gsp::Symbol * & rpSymbol 
  • bool 
process ( const char * c_pszConstant gsp::Symbol & parent , unsigned long uSymbolRank 

Private Variables

  • bool 
m_bRestoreWS 
  • std::ostream & 
m_os 

Detailed Description

The Expander Visitor's work consists in printing out the values of the parsed constants and tokens.

The symbol's expand() functions are implemented using this visitor.

See also:

virtual bool gsp::Symbol::expand ( std::ostream & os , bool bRestoreWS = true ) 
universal::String gsp::Symbol::expand ( bool bTrimFirstWhitespaces = true , bool bRestoreWS = true ) 


Files Included

#include "universal.h"

Functions Documentation

ExpanderVisitor ( std::ostream & os , bool bRestoreWS 

Constructor.

See also:

Back to index

~ExpanderVisitor ( )   [  virtual  ] 

Destructor.

See also:

Back to index

bool process gsp::Symbol * & rpSymbol   [  virtual  ] 

If the symbol is a non-terminal, it does nothing and true is returned. If the symbol is a token, it prints out the value of the token as it was parsed in the original input stream.

Returns true if the operation was successful, which is normally always the case if the expanded symbol was initially parsed successfully.

The code executed is the following:

Example:

  if (rpSymbol)
    {
      if (rpSymbol->isToken())
	{
	  rpSymbol->restore_ws(0, m_os);
	  rpSymbol->expand(m_os);
	}
      else // (rpSymbol->isNonTerminal())
	{
	  // Nothing to do
	}
      return true;
    }
  else
    {
      return false;
    }

See also:

virtual bool Visitor::process gsp::Symbol * & rpSymbol ) = 0 
virtual bool Visitor::process ( const char * c_pszConstant gsp::Symbol & parent , unsigned long uSymbolRank ) = 0 
Back to index

bool process ( const char * c_pszConstant gsp::Symbol & parent , unsigned long uSymbolRank   [  virtual  ] 

Prints out the value of the passed constant, restituting the preceding whitespaces that were eaten during parsing.

Returns always true.

The code executed is the following:

Example:

  parent.restore_ws(uSymbolRank, m_os);
  m_os << c_pszConstant;
  return true;

See also:

virtual bool Visitor::process gsp::Symbol * & rpSymbol ) = 0 
virtual bool Visitor::process ( const char * c_pszConstant gsp::Symbol & parent , unsigned long uSymbolRank ) = 0 
Back to index


This file is part of the LLOOP LL Object-Oriented Parser Generator and Object Expander Generator. Copyright (c) 2005-2006 Michel MEHL, France. All rights reserved. LLOOP is distributed by the company ERSA SaRL.


Copyright (c) 2005-2006 Michel MEHL, Haguenau, France
LLOOP version 1.1


Generated with makedoc.