AbstractParser Class Reference

Search Toolkit Book for AbstractParser

#include <aparser.hpp>

Inheritance diagram for AbstractParser:

Inheritance graph
[legend]
Collaboration diagram for AbstractParser:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 45 of file aparser.hpp.

Public Types

enum  { eNoFetchNext = 1, eCombineNext = 2 }

Public Member Functions

 AbstractParser (AbstractLexer &lexer)
virtual ~AbstractParser (void)
virtual string GetLocation (void)
virtual void ParseError (const char *error, const char *expected, const AbstractToken &token)
virtual void EndCommentBlock (void)
void ParseError (const char *error, const char *expected)
void ParseError (const char *expected)
string Location (void) const
AbstractLexerLexer (void)
const AbstractLexerLexer (void) const
const AbstractTokenNextToken (void) const
TToken Next (void) const
int NextTokenLine (void) const
int LastTokenLine (void) const
void Consume (void)
const string & ConsumeAndValue (void)
bool Check (TToken token)
void Expect (TToken token, const char *expected)
bool ConsumeIf (TToken token)
void Consume (TToken token, const char *expected)
const string & ValueOf (TToken token, const char *expected)
bool CheckSymbol (char symbol)
void ExpectSymbol (char symbol)
bool ConsumeIfSymbol (char symbol)
void ConsumeSymbol (char symbol)
char CheckSymbols (char symbol1, char symbol2)
void CopyComments (CComments &comments)
void CopyLineComment (int line, CComments &comments, int flags=0)

Protected Member Functions

void SetLexer (AbstractLexer *lexer)

Private Attributes

AbstractLexerm_Lexer


Member Enumeration Documentation

anonymous enum
 

Enumerator:
eNoFetchNext 
eCombineNext 

Definition at line 169 of file aparser.hpp.


Constructor & Destructor Documentation

AbstractParser::AbstractParser AbstractLexer lexer  ) 
 

Definition at line 40 of file aparser.cpp.

AbstractParser::~AbstractParser void   )  [virtual]
 

Definition at line 45 of file aparser.cpp.


Member Function Documentation

bool AbstractParser::Check TToken  token  )  [inline]
 

Definition at line 102 of file aparser.hpp.

References Next().

Referenced by ConsumeIf(), and Expect().

bool AbstractParser::CheckSymbol char  symbol  )  [inline]
 

Definition at line 130 of file aparser.hpp.

References AbstractLexer::CheckSymbol(), and Lexer().

Referenced by ConsumeIfSymbol(), ExpectSymbol(), ASNParser::x_Type(), and ASNParser::x_Value().

char AbstractParser::CheckSymbols char  symbol1,
char  symbol2
[inline]
 

Definition at line 155 of file aparser.hpp.

References AbstractToken::GetSymbol(), Next(), NextToken(), and T_SYMBOL.

Referenced by ASNParser::x_Value().

void AbstractParser::Consume TToken  token,
const char *  expected
[inline]
 

Definition at line 119 of file aparser.hpp.

References Consume(), and Expect().

void AbstractParser::Consume void   )  [inline]
 

Definition at line 93 of file aparser.hpp.

References AbstractLexer::Consume(), and Lexer().

Referenced by Consume(), ConsumeIf(), ConsumeIfSymbol(), ConsumeSymbol(), ASNParser::HaveMoreElements(), ASNParser::Imports(), ASNParser::Module(), ASNParser::ModuleBody(), ASNParser::NamedDataType(), DTDParser::SkipConditionalSection(), ASNParser::SkipTo(), ASNParser::String(), ASNParser::x_Type(), and ASNParser::x_Value().

const string& AbstractParser::ConsumeAndValue void   )  [inline]
 

Definition at line 97 of file aparser.hpp.

References AbstractLexer::ConsumeAndValue(), and Lexer().

Referenced by ASNParser::Identifier(), ASNParser::ModuleReference(), ASNParser::TypeReference(), ValueOf(), ASNParser::x_Type(), and ASNParser::x_Value().

bool AbstractParser::ConsumeIf TToken  token  )  [inline]
 

Definition at line 112 of file aparser.hpp.

References Check(), and Consume().

Referenced by ASNParser::x_Type().

bool AbstractParser::ConsumeIfSymbol char  symbol  )  [inline]
 

Definition at line 142 of file aparser.hpp.

References CheckSymbol(), and Consume().

Referenced by ASNParser::Imports(), ASNParser::TypeList(), and ASNParser::x_Value().

void AbstractParser::ConsumeSymbol char  symbol  )  [inline]
 

Definition at line 149 of file aparser.hpp.

References Consume(), and ExpectSymbol().

Referenced by DTDParser::BeginEntityContent(), ASNParser::EnumeratedBlock(), ASNParser::EnumeratedValue(), ASNParser::Exports(), DTDParser::ParseAttributesContent(), DTDParser::ParseElementContent(), DTDParser::ParseEntityContent(), ASNParser::TypesBlock(), and ASNParser::x_Value().

void AbstractParser::CopyComments CComments comments  )  [inline]
 

Definition at line 165 of file aparser.hpp.

References AbstractLexer::FlushCommentsTo(), and Lexer().

Referenced by XSDParser::BuildDocumentTree(), WSDLParser::BuildDocumentTree(), DTDParser::EndCommentBlock(), ASNParser::EnumeratedValue(), ASNParser::Module(), DTDParser::Module(), ASNParser::ModuleBody(), ASNParser::Modules(), and ASNParser::NamedDataType().

void AbstractParser::CopyLineComment int  line,
CComments comments,
int  flags = 0
 

Definition at line 69 of file aparser.cpp.

References _TRACE, CComments::Add(), eCombineNext, eNoFetchNext, AbstractLexer::FillComments(), AbstractLexer::CComment::GetLine(), Lexer(), AbstractLexer::NextComment(), and AbstractLexer::SkipNextComment().

Referenced by ASNParser::EnumeratedBlock(), ASNParser::ModuleType(), and ASNParser::TypesBlock().

virtual void AbstractParser::EndCommentBlock void   )  [inline, virtual]
 

Reimplemented in DTDParser.

Definition at line 53 of file aparser.hpp.

Referenced by AbstractLexer::EndCommentBlock().

void AbstractParser::Expect TToken  token,
const char *  expected
[inline]
 

Definition at line 107 of file aparser.hpp.

References Check(), and ParseError().

Referenced by Consume(), ASNParser::String(), and ValueOf().

void AbstractParser::ExpectSymbol char  symbol  )  [inline]
 

Definition at line 135 of file aparser.hpp.

References CheckSymbol(), and ParseError().

Referenced by ConsumeSymbol().

string AbstractParser::GetLocation void   )  [virtual]
 

Reimplemented in DTDParser.

Definition at line 49 of file aparser.cpp.

References kEmptyStr.

Referenced by ParseError().

int AbstractParser::LastTokenLine void   )  const [inline]
 

Definition at line 88 of file aparser.hpp.

References AbstractLexer::LastTokenLine(), and Lexer().

Referenced by Location(), and ASNParser::ModuleType().

const AbstractLexer& AbstractParser::Lexer void   )  const [inline]
 

Definition at line 71 of file aparser.hpp.

References m_Lexer.

AbstractLexer& AbstractParser::Lexer void   )  [inline]
 

Definition at line 67 of file aparser.hpp.

References m_Lexer.

Referenced by CheckSymbol(), Consume(), ConsumeAndValue(), DTDParser::ConsumeAttributeContent(), CopyComments(), CopyLineComment(), DTDParser::EndCommentBlock(), ASNParser::Identifier(), ASNParser::L(), LastTokenLine(), ASNParser::Module(), DTDParser::Module(), ASNParser::ModuleReference(), XSDParser::ParseAttribute(), XSDParser::ParseAttributeGroup(), XSDParser::ParseContent(), XSDParser::ParseDocumentation(), XSDParser::ParseElementContent(), DTDParser::ParseElementContent(), DTDParser::ParseEnumeratedList(), XSDParser::ParseEnumeration(), XSDParser::ParseGroup(), WSDLParser::ParseHeader(), WSDLParser::ParseInput(), WSDLParser::ParseMessage(), WSDLParser::ParseOperation(), WSDLParser::ParseOutput(), WSDLParser::ParsePort(), WSDLParser::ParseService(), XSDParser::ParseTypeDefinition(), WSDLParser::ParseTypes(), XSDParser::SkipContent(), ASNParser::TypeReference(), and ASNParser::TypesBlock().

string AbstractParser::Location void   )  const
 

Definition at line 64 of file aparser.cpp.

References NStr::IntToString(), and LastTokenLine().

Referenced by ASNParser::ModuleBody(), XSDParser::ParseHeader(), and WSDLParser::ParseHeader().

TToken AbstractParser::Next void   )  const [inline]
 

Definition at line 80 of file aparser.hpp.

References AbstractToken::GetToken(), and NextToken().

Referenced by Check(), CheckSymbols(), DTDParser::GetNextToken(), ASNParser::Identifier(), ASNParser::Module(), ASNParser::ModuleBody(), ASNParser::ModuleReference(), ASNParser::Modules(), ASNParser::NamedDataType(), DTDParser::SkipConditionalSection(), ASNParser::SkipTo(), ASNParser::TypeReference(), ASNParser::x_Type(), and ASNParser::x_Value().

const AbstractToken& AbstractParser::NextToken void   )  const [inline]
 

Definition at line 76 of file aparser.hpp.

References m_Lexer, and AbstractLexer::NextToken().

Referenced by DTDParser::BeginEntityContent(), DTDParser::BuildDocumentTree(), CheckSymbols(), DTDParser::ConsumeElementContent(), DTDParser::EndElementContent(), XSDParser::GetNextToken(), DTDParser::GetNextToken(), ASNParser::HaveMoreElements(), ASNParser::Module(), Next(), NextTokenLine(), DTDParser::ParseEnumeratedList(), ParseError(), ASNParser::SkipTo(), and ASNParser::x_Value().

int AbstractParser::NextTokenLine void   )  const [inline]
 

Definition at line 84 of file aparser.hpp.

References AbstractToken::GetLine(), and NextToken().

Referenced by ASNParser::EnumeratedBlock(), ASNParser::Type(), ASNParser::TypesBlock(), and ASNParser::Value().

void AbstractParser::ParseError const char *  expected  )  [inline]
 

Definition at line 60 of file aparser.hpp.

References ParseError().

void AbstractParser::ParseError const char *  error,
const char *  expected
[inline]
 

Definition at line 55 of file aparser.hpp.

References NextToken(), and ParseError().

void AbstractParser::ParseError const char *  error,
const char *  expected,
const AbstractToken token
[virtual]
 

Definition at line 54 of file aparser.cpp.

References AbstractToken::GetLine(), GetLocation(), AbstractToken::GetText(), NStr::IntToString(), and NCBI_THROW.

Referenced by DTDParser::AddElementContent(), DTDParser::BeginEntityContent(), XSDParser::BuildDocumentTree(), WSDLParser::BuildDocumentTree(), DTDParser::BuildDocumentTree(), DTDParser::ConsumeAttributeContent(), DTDParser::ConsumeElementContent(), DTDParser::EndElementContent(), Expect(), ExpectSymbol(), DTDParser::GenerateDataTree(), XSDParser::GetNextToken(), ASNParser::Identifier(), ASNParser::ModuleReference(), WSDLParser::ParseAddress(), XSDParser::ParseAnnotation(), XSDParser::ParseAny(), XSDParser::ParseAttributeGroup(), XSDParser::ParseAttributeGroupRef(), WSDLParser::ParseBinding(), XSDParser::ParseContent(), XSDParser::ParseDocumentation(), DTDParser::ParseElementContent(), DTDParser::ParseEntityContent(), DTDParser::ParseEnumeratedList(), ParseError(), XSDParser::ParseExtension(), XSDParser::ParseGroup(), XSDParser::ParseGroupRef(), XSDParser::ParseHeader(), WSDLParser::ParseHeader(), WSDLParser::ParseMessage(), WSDLParser::ParseOperation(), WSDLParser::ParsePart(), WSDLParser::ParsePort(), XSDParser::ParseRestriction(), WSDLParser::ParseService(), WSDLParser::ParseTypes(), DTDParser::PushEntityLexer(), ASNParser::TypeReference(), DTDParser::x_AttribType(), DTDParser::x_AttribValue(), ASNParser::x_Type(), and ASNParser::x_Value().

void AbstractParser::SetLexer AbstractLexer lexer  )  [inline, protected]
 

Definition at line 176 of file aparser.hpp.

References m_Lexer.

Referenced by DTDParser::PopEntityLexer().

const string& AbstractParser::ValueOf TToken  token,
const char *  expected
[inline]
 

Definition at line 124 of file aparser.hpp.

References ConsumeAndValue(), and Expect().

Referenced by ASNParser::Double(), and ASNParser::Number().


Member Data Documentation

AbstractLexer* AbstractParser::m_Lexer [private]
 

Definition at line 182 of file aparser.hpp.

Referenced by Lexer(), NextToken(), and SetLexer().


The documentation for this class was generated from the following files:
Generated on Wed Dec 9 07:49:06 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Wed Dec 09 08:18:46 2009 by modify_doxy.py rev. 173732