Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

LabelSyntaxChecker Class Reference

Syntax checker implemented by recursive descending method. More...

#include <labelSyntaxChecker.h>

List of all members.

Public Types

enum  ELabelTextPattern {
  eEmptyPattern = 0,
  eNormalPattern,
  eAlphabetMinusPattern,
  eBarPattern,
  eAlphabetPattern,
  eEpsilonSymbPattern
}

Public Member Functions

 LabelSyntaxChecker (const ITransition::TCharSet &alphabet, const QString &alphabetSymb, const QString &epsilonSymb)
 ~LabelSyntaxChecker ()
bool checkSyntax (const StringProcessor::TCharacterList &characterList)
 starts recursive descent
ITransition::TCharSet getCharacters ()
ELabelTextPattern getPattern ()
QString getReport ()

Protected Member Functions

bool AlphabetOrAlphabetMinusPattern ()
bool BarPattern ()
bool BarPatternNext ()
bool End ()
bool hasNextToken ()
StringProcessor::CharacterInfo nextToken ()
 return next CharacterInfo from input list and
bool NormalPattern (ITransition::TCharSet &charSet)
 recursive descent methods
bool NormalPatternNext (ITransition::TCharSet &charSet)
bool processBarredCharacter (ITransition::TCharSet &charSet, const StringProcessor::CharacterInfo &charInfo)
 adds barred character to charSet and check if it's in alphabet
bool processCharacter (ITransition::TCharSet &charSet, const StringProcessor::CharacterInfo &charInfo)
 adds character to charSet and check if it's in alphabet

Protected Attributes

ITransition::TCharSet characters
const ITransition::TCharSet m_alphabet
const QString m_alphabetSymb
StringProcessor::TCharacterList m_characterList
const QString m_epsilonSymb
int m_idx
ELabelTextPattern pattern
QStringList report

Detailed Description

Syntax checker implemented by recursive descending method.

Computes characters and gives pattern used in label text. If fails, report is available.

Parameters:
characterList (created by StringProcessor)
See also:
StringProcessor

Definition at line 14 of file labelSyntaxChecker.h.


Member Enumeration Documentation

Enumerator:
eEmptyPattern 
eNormalPattern 
eAlphabetMinusPattern 
eBarPattern 
eAlphabetPattern 
eEpsilonSymbPattern 

Definition at line 17 of file labelSyntaxChecker.h.


Constructor & Destructor Documentation

LabelSyntaxChecker::LabelSyntaxChecker ( const ITransition::TCharSet alphabet,
const QString &  alphabetSymb,
const QString &  epsilonSymb 
)

Definition at line 6 of file labelSyntaxChecker.cpp.

References DBGLOG, and DBGPAR.

LabelSyntaxChecker::~LabelSyntaxChecker (  )  [inline]

Definition at line 28 of file labelSyntaxChecker.h.


Member Function Documentation

bool LabelSyntaxChecker::AlphabetOrAlphabetMinusPattern (  )  [protected]

Definition at line 228 of file labelSyntaxChecker.cpp.

References StringProcessor::CharacterInfo::character, characters, End(), hasNextToken(), nextToken(), NormalPattern(), pattern, and report.

Referenced by checkSyntax().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LabelSyntaxChecker::BarPattern (  )  [protected]

Definition at line 185 of file labelSyntaxChecker.cpp.

References BarPatternNext(), characters, hasNextToken(), nextToken(), processBarredCharacter(), and report.

Referenced by checkSyntax().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LabelSyntaxChecker::BarPatternNext (  )  [protected]

Definition at line 201 of file labelSyntaxChecker.cpp.

References StringProcessor::CharacterInfo::character, characters, hasNextToken(), nextToken(), processBarredCharacter(), and report.

Referenced by BarPattern().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LabelSyntaxChecker::checkSyntax ( const StringProcessor::TCharacterList characterList  ) 
bool LabelSyntaxChecker::End (  )  [protected]

Definition at line 289 of file labelSyntaxChecker.cpp.

References hasNextToken(), and report.

Referenced by AlphabetOrAlphabetMinusPattern(), and checkSyntax().

Here is the call graph for this function:

Here is the caller graph for this function:

ITransition::TCharSet LabelSyntaxChecker::getCharacters (  ) 

Definition at line 22 of file labelSyntaxChecker.cpp.

References characters.

Referenced by Transition::getCharacters().

Here is the caller graph for this function:

LabelSyntaxChecker::ELabelTextPattern LabelSyntaxChecker::getPattern (  ) 

Definition at line 27 of file labelSyntaxChecker.cpp.

References pattern.

Referenced by Transition::getCharacters().

Here is the caller graph for this function:

QString LabelSyntaxChecker::getReport (  ) 

Definition at line 17 of file labelSyntaxChecker.cpp.

References report.

Referenced by Transition::getCharacters().

Here is the caller graph for this function:

bool LabelSyntaxChecker::hasNextToken (  )  [protected]

Definition at line 38 of file labelSyntaxChecker.cpp.

References m_characterList, and m_idx.

Referenced by AlphabetOrAlphabetMinusPattern(), BarPattern(), BarPatternNext(), checkSyntax(), End(), NormalPattern(), and NormalPatternNext().

Here is the caller graph for this function:

StringProcessor::CharacterInfo LabelSyntaxChecker::nextToken (  )  [protected]

return next CharacterInfo from input list and

Definition at line 32 of file labelSyntaxChecker.cpp.

References m_characterList, and m_idx.

Referenced by AlphabetOrAlphabetMinusPattern(), BarPattern(), BarPatternNext(), checkSyntax(), NormalPattern(), and NormalPatternNext().

Here is the caller graph for this function:

bool LabelSyntaxChecker::NormalPattern ( ITransition::TCharSet charSet  )  [protected]

recursive descent methods

Definition at line 142 of file labelSyntaxChecker.cpp.

References hasNextToken(), nextToken(), NormalPatternNext(), processCharacter(), and report.

Referenced by AlphabetOrAlphabetMinusPattern(), and checkSyntax().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LabelSyntaxChecker::NormalPatternNext ( ITransition::TCharSet charSet  )  [protected]

Definition at line 158 of file labelSyntaxChecker.cpp.

References StringProcessor::CharacterInfo::character, hasNextToken(), m_idx, nextToken(), processCharacter(), and report.

Referenced by NormalPattern().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LabelSyntaxChecker::processBarredCharacter ( ITransition::TCharSet charSet,
const StringProcessor::CharacterInfo charInfo 
) [protected]

adds barred character to charSet and check if it's in alphabet

Definition at line 62 of file labelSyntaxChecker.cpp.

References StringProcessor::CharacterInfo::character, StringProcessor::eBar, StringProcessor::eOverline, m_alphabet, StringProcessor::CharacterInfo::modifier, and report.

Referenced by BarPattern(), and BarPatternNext().

Here is the caller graph for this function:

bool LabelSyntaxChecker::processCharacter ( ITransition::TCharSet charSet,
const StringProcessor::CharacterInfo charInfo 
) [protected]

adds character to charSet and check if it's in alphabet

Definition at line 43 of file labelSyntaxChecker.cpp.

References StringProcessor::CharacterInfo::character, StringProcessor::eBar, StringProcessor::eOverline, m_alphabet, StringProcessor::CharacterInfo::modifier, and report.

Referenced by NormalPattern(), and NormalPatternNext().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 42 of file labelSyntaxChecker.h.

Referenced by checkSyntax(), processBarredCharacter(), and processCharacter().

const QString LabelSyntaxChecker::m_alphabetSymb [protected]

Definition at line 43 of file labelSyntaxChecker.h.

Referenced by checkSyntax().

Definition at line 45 of file labelSyntaxChecker.h.

Referenced by checkSyntax(), hasNextToken(), and nextToken().

const QString LabelSyntaxChecker::m_epsilonSymb [protected]

Definition at line 44 of file labelSyntaxChecker.h.

Referenced by checkSyntax().

int LabelSyntaxChecker::m_idx [protected]

Definition at line 46 of file labelSyntaxChecker.h.

Referenced by checkSyntax(), hasNextToken(), nextToken(), and NormalPatternNext().

Definition at line 49 of file labelSyntaxChecker.h.

Referenced by AlphabetOrAlphabetMinusPattern(), checkSyntax(), and getPattern().

QStringList LabelSyntaxChecker::report [protected]

The documentation for this class was generated from the following files: