| Home | Index | universal Index | gsp Index | Examples | Tutorial |
#include "gsp__Symbol.h"
This class allows to navigate backwards or forwards through the symbols of a rule in order to get information about them. More...
Public Functions | |||
| SymbolInfoCursor | ( const Symbol & nonTerminal , const LLParser & parser ) | ||
| ~SymbolInfoCursor | ( ) | ||
| getInfo | ( ) const | ||
| jump | ( long lOffset ) | |
| next | ( ) | |
| prev | ( ) | |
Private Functions | |||
| SymbolInfoCursor | ( const Symbol & nonTerminal , const LLParser & parser , const unsigned long * uSymbolDescs ) | ||
Private Variables | |||
| m_lCurrentSymbolRank | ||
| m_lRuleRank | ||
| m_nonTerminal | ||
| m_parser | ||
| m_uNbRules | ||
| m_uNbSymbolsInRule | ||
| m_uSymbolDescs | ||
Friends | |||
| Symbol | ||
This class allows to navigate backwards or forwards through the symbols of a rule in order to get information about them.
Information about symbols are contained within SymbolInfo objects.
An example of use is given in the implementation of the getPreviousSymbolInfo() method of base class Symbol:
Example:
SymbolInfo Symbol::getPreviousSymbolInfo(const LLParser& parser) const
{
SymbolInfoCursor infoCursor(parent(), parser);
infoCursor.prev();
return infoCursor.getInfo();
}Constructs a symbol information cursor pointing to the current parsed symbol (nonTerminal.getCurrentSymbolRank()) in the current parsed rule (nonTerminal.getCurrentRuleRank()) of the passed non-terminal.
See also:
Constructs a symbol information cursor that allows to get information about symbols described by the passed list of symbol descriptions uSymbolDescs. It is assumed that the cursor is pointing just before the first symbol, i.e. next() must be called first to point to the first symbol.
This constructor is used internally by the generated code and is not intended for end-users.
nonTerminal is not relevant.
See also:
Destructor.
See also:
Moves the cursor to the next symbol in rule.
Returns true if the cursor could be moved successfully, false otherwise, i.e. if the current rule or symbol is invalid, or if the cursor was already positioned on the last symbol of the rule.
Information on the new current symbol can be obtained using the getInfo() method.
See also:
Moves the cursor to the previous symbol in rule.
Returns true if the cursor could be moved successfully, false otherwise, i.e. if the current rule or symbol is invalid, or if the cursor was already positioned on the first symbol of the rule.
Information on the new current symbol can be obtained using the getInfo() method.
See also:
Moves the cursor of the specified offset (negative or positive) in the rule.
Returns true if the cursor could be positioned on a valid symbol in the rule.
If the cursor would be positioned outside the valid range, the cursor is either put just before the first symbol or just after the last one, depending on respectively whether the new position would be negative or point beyond the last symbol of the rule. Returns false in all these cases.
Returns false if the current rule or symbol is invalid.
See also:
Returns in a SymbolInfo object the symbol information of the symbol on which is currently positioned the cursor.
Returns an invalid SymbolInfo object if the cursor is positioned on an invalid rule or an invalid symbol in the rule (outside valid position range).
See also:
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 |