Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Parser Class Reference

The generalized parser. More...

#include <Parser.H>

Collaboration diagram for Parser:

Collaboration graph
[legend]
List of all members.

Public Types

enum  SearchStrategy { BottomUp, BestFirst }

Public Member Functions

 Parser (const string &configFile, Grammar *pGrammar=NULL)
virtual ~Parser ()
virtual vector< pair< BilexMTree *,
SCORE > > 
getParse (SentenceTuple &)
 compute the parse and return the resulting tree
virtual vector< pair< BilexMTree *,
SCORE > > 
getParse ()
virtual bool silentParse (SentenceTuple &)
 Attempt to achieve the parsing goal but do not compute or return the tree.
virtual void clear ()
 Clears the parser's state. Note that this does not include the grammar.
virtual void setGrammar (Grammar *pGrammar)
 Set the model for the parser.
virtual GrammargetGrammar () const

Protected Member Functions

 Parser ()
virtual void initialize (SentenceTuple &)
 Initializes the parser for new input.
virtual bool onePassParse ()
virtual bool multiPassParse ()

Protected Attributes

Logicm_pLogic
 The reference to the Logic.
Agendam_pAgenda
 The reference to the Agenda.
Grammarm_pGrammar
 The reference to the grammar.
ParseStats m_parseStats
bool m_multiPassParse
 if true, then we use multi-pass parsing

Private Member Functions

void parse ()
 This method kept private to avoid use/redefinition.

Detailed Description

The generalized parser.


Member Enumeration Documentation

enum Parser::SearchStrategy
 

Enumeration values:
BottomUp 
BestFirst 


Constructor & Destructor Documentation

Parser::Parser const string &  configFile,
Grammar pGrammar = NULL
 

Here is the call graph for this function:

Parser::~Parser  )  [virtual]
 

Here is the call graph for this function:

Parser::Parser  )  [inline, protected]
 


Member Function Documentation

void Parser::clear  )  [virtual]
 

Clears the parser's state. Note that this does not include the grammar.

Clears the parser by clearing the contents of its components. The components are still there, not being deleted. The grammar is not cleared.

Here is the call graph for this function:

Grammar * Parser::getGrammar  )  const [virtual]
 

vector< pair< BilexMTree *, SCORE > > Parser::getParse  )  [virtual]
 

This overloaded version reparses the currently initialized SentenceTuple. This could be useful if, e.g., the grammar is updated.

Here is the call graph for this function:

vector< pair< BilexMTree *, SCORE > > Parser::getParse SentenceTuple  )  [virtual]
 

compute the parse and return the resulting tree

Here is the call graph for this function:

void Parser::initialize SentenceTuple  )  [protected, virtual]
 

Initializes the parser for new input.

Here is the call graph for this function:

bool Parser::multiPassParse  )  [protected, virtual]
 

Parse, using multiple passes if necessary until the parsing goal is found. Note that if the multiPassParse in the constructor is false, then it is just ordinary parsing. Use the goal.trace() to see which sub-goal is achieved or whether the parsing fails. Whenever the agenda is empty, the parser restarts!!!

Here is the call graph for this function:

bool Parser::onePassParse  )  [protected, virtual]
 

One pass parsing until the goal is reached or the parsing fails. Use goal.trace() to see which sub-goal is achieved or whether the parsing fails. Whenever the agenda is empty, the parser restarts!!!

Here is the call graph for this function:

void Parser::parse  )  [inline, private]
 

This method kept private to avoid use/redefinition.

void Parser::setGrammar Grammar pGrammar  )  [virtual]
 

Set the model for the parser.

Here is the call graph for this function:

bool Parser::silentParse SentenceTuple  )  [virtual]
 

Attempt to achieve the parsing goal but do not compute or return the tree.

Here is the call graph for this function:


Member Data Documentation

bool Parser::m_multiPassParse [protected]
 

if true, then we use multi-pass parsing

Agenda* Parser::m_pAgenda [protected]
 

The reference to the Agenda.

ParseStats Parser::m_parseStats [protected]
 

Grammar* Parser::m_pGrammar [protected]
 

The reference to the grammar.

Logic* Parser::m_pLogic [protected]
 

The reference to the Logic.


The documentation for this class was generated from the following files:
Generated on Thu Jul 7 23:40:41 2005 for Generalized Parsers (GenPar) by  doxygen 1.4.1