| LLOOP Index | GSP Language | GSP Library | Framework Classes | Component Classes |
#include "ini__SIniFile.h"
SIniFile non-terminal symbol class. More...
Public Functions | |||
| SIniFile | ( ) | ||
| ~SIniFile | ( ) | ||
| SectionListRef | ( ) | ||
| backtrace | ( std::ostream & os ) | |
| expand | ( std::ostream & os , bool bRestoreWS = true ) | |
| expand | ( bool bTrimFirstWhitespaces = true , bool bRestoreWS = true ) | |
| getRightByIndex | ( unsigned long uIndex ) | ||
| getSectionList | ( ) | ||
| getSymbolName | ( ) const | |
| isNonTerminal | ( ) const | |
| isToken | ( ) const | |
| parse | ( std::istream & is , std::ostream & os , gsp::Symbol * pParent = NULL , bool bExpectEOF = false , bool bDeactivatePreprocessing = false ) | |
| parse | ( std::istream & is , gsp::Symbol * pParent = NULL , bool bExpectEOF = false , bool bDeactivatePreprocessing = false ) | |
| parseRoot | ( ini::Parser & parser , SIniFile * & pReturnSymbol , gsp::Symbol * pParent = NULL , bool bBreakOff = true ) | |
| parseSymbol | ( gsp::LLParser & parser , gsp::Symbol * & rpReturnSymbol , gsp::Symbol * pParent = NULL ) | |
| parseSymbol | ( ini::Parser & parser , SIniFile * & rpReturnSymbol , gsp::Symbol * pParent = NULL ) | |
| reset | ( ) | |
| setSectionList | ( SectionList * pSectionList ) | |
| test | ( std::ostream & os , bool bVerbose = false ) | |
| visit | ( gsp::Visitor & visitor , gsp::Symbol * & pReturnSymbol ) | |
Protected Functions | |||
| initRule | ( ) | |
| reduce | ( ini::Parser & parser ) | |
| reduce | ( const long lRuleRank , ini::Parser & parser ) | |
Private Functions | |||
| getFirstsDescriptions | ( ) const | |
| getNbRules | ( ) const | |
| getNbSymbolsInRule | ( long lRuleRank ) const | |
| getSymbolDescription | ( long lRuleRank , long lSymbolRank ) const | |
Public Static Functions | |||
| factory | ( ) | ||
| is_a | ( gsp::Symbol * pSymbol ) | |
| maxOccurrences | ( ) | |
| maxOccurrences | ( int iMaxOcc ) | |
| minOccurrences | ( ) | |
| minOccurrences | ( int iMinOcc ) | |
| setFactory | ( SIniFileFactory * pNewFactory ) | |
Protected Variables | |||
| m_cWsFlag [ 2 + 1 ] [ 20 ] | ||
| m_uNbWs [ 2 + 1 ] | ||
Private Variables | |||
| m_bOption1_0Parsed | ||
| m_pSectionList | |||
Protected Static Variables | |||
| m_iMaxOccurrences | ||
| m_iMinOccurrences | ||
| ms_factory | |||
Private Static Variables | |||
| FIRSTS [ 1 + 1 ] | ||
| NB_FIRSTS | ||
| NB_RULES | ||
| RULES [ 1 ] [ 2 ] | ||
Friends | |||
| SIniFileFactory | ||
SIniFile 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.
Returns the maximum allowed number of occurrences of this symbol or -1 if there is no limit.
See also:
Returns the minimum required number of occurrences of this symbol or -1 if there is no limit.
See also:
Sets the maximum allowed number of occurrences of this symbol. -1 if there is no limit.
See also:
Sets the minimum required number of occurrences of this symbol. -1 if there is no limit.
See also:
Non-terminal symbol class constructor.
See also:
Non-terminal symbol class destructor.
See also:
Tells whether the symbol is token.
See also:
Tells whether the symbol is a non-terminal.
See also:
Please refer to the matching overriden method description in base class.
See also:
Please refer to the matching overriden method description in base class.
See also:
Please refer to the matching overriden method description in base class.
See also:
Please refer to the matching overriden method description in base class.
See also:
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:
Please refer to the matching overriden method description in base class.
See also:
Used internally by the generated code to carry out the parsing of the symbol.
See also:
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:
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:
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:
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:
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:
Backtraces the non-terminal.
See also:
Tests the symbol according to the test cases specified along the symbol definition.
For further information please see the test() function of the base symbol class.
See also:
Returns the factory object for such non-terminal.
See also:
Sets pNewFactory as the new factory object for such non-terminal.
The previous factory is not destroyed.
See also:
Tells whether the passed symbol pointer narrows to a symbol pointer of this type.
See also:
Self-explanatory.
See also:
Self-explanatory. If the object is null or was not parsed, fatal() is called. This raises an exception which is normally caught by the parser object during parsing.
See also:
Self-explanatory.
See also:
Returns the name of this non-terminal symbol class.
See also:
Executes the reduction code for the non-terminal. It includes the reduction code written for this non-terminal in the grammar.
Returns the pointer to the symbol returned by the reduction code. If the user does not specify another return symbol, it'll be a pointer to the symbol object itself.
See also:
Executes the reduction code for the rule of rank lRuleRank.
See also:
Please refer to the matching overriden method description in base class.
See also:
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:
Initializes the symbol for parsing any of its rule.
See also:
This file is part of the LLOOP Reversible Object-Oriented Parser 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 |