void KH::GrammarPL0::Error(bool &result, std::string message, bool skipit){

	InsertError(KH::GrammarPL0::ErrorType( GetLine(),": " + message) );
	if(skipit) skip(1);
	result = false;

}
Пример #2
0
  ///\brief Adds left child.
  ///
  /// Inserts node structure as left child, if not exists.
  /// Normalizes inserted subtree.
  /// Throws node::InsertError exception in other way.
  ///
  ///\param iNode -- source of node structure to insert.
  Node& Node::addLeft(const Node& iNode)
  {
    if (this->left == 0) {
	this->left = new Node(iNode);
	_connect(this->left, this);
    }
    else
      throw InsertError(this);

    unsigned int maxLevel = this->level;
    this->_normalizeLevel(this->level, maxLevel);
    return *this;
  }
Пример #3
0
  ///\brief Adds right child.
  ///
  /// Inserts node with specified name as right child, if not exists.
  /// Normalizes inserted node.
  /// Throws node::InsertError exception in other way.
  ///
  ///\param iName -- name of node to insert.
  Node& Node::addRight(const std::string& iName)
  {
    if (this->right == 0)
      {      
	this->right = new Node(iName);
	_connect(this->right, this);
      }
    else
      throw InsertError(this);

    unsigned int maxLevel = this->level;
    this->_normalizeLevel(this->level, maxLevel);
    return *this;
  }