File: tree_cst.cpp

package info (click to toggle)
foundry 0.0.20130809-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 632 kB
  • ctags: 2,340
  • sloc: cpp: 6,376; yacc: 366; makefile: 192; lex: 184
file content (32 lines) | stat: -rw-r--r-- 687 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_cst.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());
}