File: tree_cst.cpp

package info (click to toggle)
foundry 0.0.20100226-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 392 kB
  • ctags: 1,574
  • sloc: cpp: 4,191; yacc: 292; lex: 141; makefile: 123
file content (32 lines) | stat: -rw-r--r-- 660 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Copyright 2009 Simon Richter <Simon.Richter@hogyros.de>
 *
 * Released under the GNU General Public Licence version 3.
 */

#include <sstream>

#include <stdexcept>

#include "tree_cst_tree.hpp"
#include "tree_cst_parse.hpp"

class parse_error :
    public std::logic_error
{
public:
    parse_error(std::string const &msg);
};

parse_error::parse_error(std::string const &msg) :
    std::logic_error(msg)
{
    return;
}

int tree_cst_error(YYLTYPE *loc, void *, foundry::tree::cst::start *&, char const *msg)
{
    std::ostringstream msgstr;

    msgstr << loc->first_line << ":" << loc->first_column << ":" << msg;
    throw parse_error(msgstr.str());
}