Index

_ConstChoice_0 Class Reference

_ConstChoice_0 non-terminal symbol class. More...

#include "ini___ConstChoice_0.h"


Inherited Class(es)


Public Functions

Protected Functions

Private Functions

Public Static Functions

Protected Variables

Protected Static Variables

Private Static Variables

Friends


Detailed Description

_ConstChoice_0 non-terminal symbol class.

This class provides the generated parse and expand code for a non-terminal.

It also contains the coded description of the rules defined for this non-terminal.


Functions Documentation

int maxOccurrences ( )   [  static  ] 

Returns the maximum allowed number of occurrences of this symbol or -1 if there is no limit.

See also:

Back to index

int minOccurrences ( )   [  static  ] 

Returns the minimum required number of occurrences of this symbol or -1 if there is no limit.

See also:

Back to index

void maxOccurrences ( int iMaxOcc   [  static  ] 

Sets the maximum allowed number of occurrences of this symbol. -1 if there is no limit.

See also:

Back to index

void minOccurrences ( int iMinOcc   [  static  ] 

Sets the minimum required number of occurrences of this symbol. -1 if there is no limit.

See also:

Back to index

_ConstChoice_0 ( ) 

Non-terminal symbol class constructor.

See also:

Back to index

~_ConstChoice_0 ( )   [  virtual  ] 

Non-terminal symbol class destructor.

See also:

Back to index

bool isToken ( ) const   [  virtual  ] 

Tells whether the symbol is token.

See also:

Back to index

bool isNonTerminal ( ) const   [  virtual  ] 

Tells whether the symbol is a non-terminal.

See also:

Back to index

unsigned long getNbRules ( ) const   [  private  ] 

Please refer to the matching overriden method description in base class.

See also:

virtual unsigned long gsp::Symbol::getNbRules ( ) const 
Back to index

unsigned long getNbSymbolsInRule ( long lRuleRank ) const   [  private  ] 

Please refer to the matching overriden method description in base class.

See also:

virtual unsigned long gsp::Symbol::getNbSymbolsInRule ( long lRuleRank ) const 
Back to index

unsigned long getSymbolDescription ( long lRuleRank , long lSymbolRank ) const   [  private  ] 

Please refer to the matching overriden method description in base class.

See also:

virtual unsigned long gsp::Symbol::getNbSymbolsInRule ( long lRuleRank ) const 
Back to index

const unsigned long * getFirstsDescriptions ( ) const   [  private  ]   [  virtual  ] 

Please refer to the matching overriden method description in base class.

See also:

virtual const unsigned long * gsp::Symbol::getFirstsDescriptions ( ) const 
Back to index

bool visit ( gsp::Visitor & visitor , gsp::Symbol * & pReturnSymbol   [  virtual  ] 

Visits the symbol with visitor and returns in pReturnSymbol a pointer to a replacing symbol (if any).

Returns true if the visit was accepted and successful.

See also:

virtual bool gsp::Symbol::visit ( gsp::Visitor & visitor Symbol * & pReturnSymbol ) = 0 
bool gsp::Symbol::visit ( gsp::Visitor & visitor ) = 0 
Back to index

bool parseSymbol ( gsp::LLParser & parser , gsp::Symbol * & rpReturnSymbol , gsp::Symbol * pParent   [  virtual  ] 

Please refer to the matching overriden method description in base class.

See also:

virtual bool gsp::Symbol::parseSymbol LLParser & parser Symbol * & rpReturnSymbol Symbol * pParent ) = 0 
bool _ConstChoice_0::parseSymbol ( ini::Parser & parser _ConstChoice_0 * & rpReturnSymbol , gsp::Symbol * pParent 
Back to index

bool parseSymbol ( ini::Parser & parser _ConstChoice_0 * & rpReturnSymbol , gsp::Symbol * pParent 

Used internally by the generated code to carry out the parsing of the symbol.

See also:

virtual bool gsp::Symbol::parseSymbol LLParser & parser Symbol * & rpReturnSymbol Symbol * pParent ) = 0 
Back to index

bool parseRoot ( ini::Parser & parser _ConstChoice_0 * & pReturnSymbol , gsp::Symbol * pParent , bool bBreakOff 

This function attempts to carry out a raw parsing of this symbol using parser, without pre-processing the input stream before.

The symbol is parsed as the root symbol would be, i.e. the line numbering in stream starts counting from zero and it is checked that the end of the stream is encountered if a stream break-off was expected.

pReturnSymbol is the symbol pointer returned by the parsing.

pParent gives the initial parent for the symbol parent to parse. By default it is null, i.e. the symbol is the root and has no parent.

bBreakOff tells whether a stream break-off is expected at the end of the parsing (true by default).

Returns true when the symbol could be successfully parsed, regardless of whether user errors were raised from reduction code. For that purpose, the return value of fail() should also always be checked in parallel to handle these errors.

See also:

virtual bool parse ( std::istream & is , std::ostream & os , gsp::Symbol * pParent = NULL , bool bExpectEOF = false , bool bDeactivatePreprocessing = false ) 
virtual bool parse ( std::istream & is , gsp::Symbol * pParent = NULL , bool bExpectEOF = false , bool bDeactivatePreprocessing = false ) 
bool gsp::Symbol::fail ( ) const 
void gsp::Symbol::error ( std::ostream & os , unsigned long uErrorLineNo , const char * pszFormattedMsg , ... ) 
void gsp::Symbol::error ( std::streampos errorOffset , unsigned int uErrorLineNo 
void gsp::Symbol::fatal ( const char * pszFormattedMsg , ... ) 
Back to index

bool parse ( std::istream & is , std::ostream & os , gsp::Symbol * pParent , bool bExpectEOF , bool bDeactivatePreprocessing   [  virtual  ] 

This function attempts to parse this symbol in a input stream is and error messages are re-directed to output stream os.

pParent gives the initial parent for the symbol parent to parse. By default it is null, i.e. the symbol is the root and has no parent.

bDeactivatePreprocessing tells whether preprocessing should be deactivated before the actual parsing takes place. This argument is optional and is set to false by default.

The symbol is parsed as the root symbol would be, i.e. the line numbering in stream starts counting from zero.

bExpectEOF tells whether to expect an end-of-stream at the end of parsing. This parameter is optional and set to false by default.

This function is useful when the users don't want to parse a stream starting from the root symbol of the grammar, but from whatever else symbol, without having to create by himself the parser object and output possible error messages.

With this function there is no way to get the symbol returned by the reduction code.

Basically, calling this method is equivalent to:

Example:

  ...Parser parser(is);
  ...parser.deactivatePreprocessing(bDeactivatePreprocessing);
  ...parser.preprocess();
  ...parseRoot();

See also:

bool parseRoot ( ini::Parser & parser _ConstChoice_0 * & pReturnSymbol , gsp::Symbol * pParent = NULL , bool bBreakOff = true ) 
Back to index

bool parse ( std::istream & is , gsp::Symbol * pParent , bool bExpectEOF , bool bDeactivatePreprocessing   [  virtual  ] 

This overloaded function is provided for convenience and behaves like the above function, except that error messages are forced to be output on the standard error output cerr.

Therefore, it is strictly equivalent to calling:

parse(is, cerr, pParent, bDeactivatePreprocessing)

See also:

virtual bool parse ( std::istream & is , std::ostream & os , gsp::Symbol * pParent = NULL , bool bExpectEOF = false , bool bDeactivatePreprocessing = false ) 
virtual bool parse ( std::istream & is , gsp::Symbol * pParent = NULL , bool bExpectEOF = false , bool bDeactivatePreprocessing = false ) 
Back to index

bool expand ( std::ostream & os , bool bRestoreWS   [  virtual  ] 

Expands the non-terminal. See documentation of overriden method referred to below.

This method ensures the following:

- If the default/normal expanding was ok and it is the root, the original trailing whitespaces are restored.

- If the non-terminal is a composite, the expanding will result of the expanding of all components.

- Return true on success only.

NO end-of-stream char ('\0') is appended to the result string.

See also:

virtual bool gsp::Symbol::expand ( std::ostream & os , bool bRestoreWS = true ) 
Back to index

universal::String expand ( bool bTrimFirstWhitespaces , bool bRestoreWS 

This function is provided for convenience and behaves like the other expand() function, except that :

on failure an empty string is returned;

the first leading whitespaces are removed by default. This can be switched off by setting bTrimFirstWhitespaces to false.

bRestoreWS is also optional and tells whether to restore all whitespaces. This is the case by default. If not so, the value of bTrimFirstWhitespaces is actually overriden and ignored.

See also:

universal::String gsp::Symbol::expand ( bool bTrimFirstWhitespaces = true , bool bRestoreWS = true ) 
Back to index

bool backtrace ( std::ostream & os   [  virtual  ] 

Backtraces the non-terminal.

See also:

virtual bool gsp::Symbol::backtrace ( std::ostream & os ) = 0 
Back to index

bool test ( std::ostream & os , bool bVerbose   [  virtual  ] 

Tests the symbol according to the test cases specified along with with the symbol definition.

For further information please see the test() function of the base symbol class.

See also:

bool gsp::Symbol::test ( std::ostream & os , unsigned long uNbTestCases , universal::String * pasTestCaseNames , universal::String * pasTestCaseInputs , universal::String * pasTestCaseOutputs , bool * pabResults , bool bVerbose 
virtual bool gsp::Symbol::backtrace ( std::ostream & os ) = 0 
void LLParser::outputFailureContext ( std::ostream & os , unsigned long uNbLinesAround = 1 ) 
Back to index

_ConstChoice_0Factory & factory ( )   [  static  ] 

Returns the factory object for such non-terminal.

See also:

Back to index

void setFactory _ConstChoice_0Factory * pNewFactory   [  static  ] 

Sets pNewFactory as the new factory object for such non-terminal.

The previous factory is not destroyed.

See also:

Back to index

bool is_a ( gsp::Symbol * pSymbol   [  static  ] 

Tells whether the passed symbol pointer narrows to a symbol pointer of this type.

See also:

Back to index

universal::String getSymbolName ( ) const 

Returns the name of this non-terminal symbol class.

See also:

Back to index

gsp::Symbol & getRightByIndex ( unsigned long uIndex   [  virtual  ] 

Please refer to the matching overriden method description in base class.

See also:

virtual Symbol & gsp::Symbol::getRightByIndex ( unsigned long uIndex 
Back to index

void reset ( )   [  virtual  ] 

Please refer to the matching overriden method description in base class.

If a rule was reduced for this symbol, all the right symbols appearing in that rule are destroyed/recycled using their respective factory.

If this is a composite symbol, the components are destroyed.

See also:

void gsp::Symbol::reset ( ) 
Back to index

void initRule ( )   [  protected  ] 

Initializes the symbol for parsing any of its rule.

See also:

Back to index


Generated with makedoc.