Last change
on this file since a03ed29 was
c92bdcc,
checked in by Andrew Beach <ajbeach@…>, 6 months ago
|
Updated the rest of the names in src/ (except for the generated files).
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[a16764a6] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
| 6 | // |
---|
[c92bdcc] | 7 | // ErrorObjects.hpp -- |
---|
[a16764a6] | 8 | // |
---|
| 9 | // Author : Thierry Delisle |
---|
| 10 | // Created On : Wed Feb 28 15:16:47 2018 |
---|
| 11 | // Last Modified By : |
---|
| 12 | // Last Modified On : |
---|
| 13 | // Update Count : |
---|
| 14 | // |
---|
| 15 | |
---|
| 16 | #pragma once |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #include <exception> // for exception |
---|
| 20 | #include <iostream> // for ostream |
---|
| 21 | #include <list> // for list |
---|
| 22 | #include <string> // for string |
---|
| 23 | #include <unistd.h> // for isatty |
---|
| 24 | |
---|
[c92bdcc] | 25 | #include "CodeLocation.hpp" // for CodeLocation, toString |
---|
[a16764a6] | 26 | |
---|
| 27 | struct error { |
---|
| 28 | CodeLocation location; |
---|
| 29 | std::string description; |
---|
| 30 | |
---|
| 31 | error() = default; |
---|
| 32 | error( CodeLocation loc, const std::string & str ) : location( loc ), description( str ) {} |
---|
| 33 | }; |
---|
| 34 | |
---|
| 35 | class SemanticErrorException : public std::exception { |
---|
| 36 | public: |
---|
[9d1e3f7] | 37 | SemanticErrorException() = default; |
---|
[a16764a6] | 38 | SemanticErrorException( CodeLocation location, std::string error ); |
---|
| 39 | ~SemanticErrorException() throw() {} |
---|
| 40 | |
---|
| 41 | void append( SemanticErrorException & other ); |
---|
| 42 | void append( CodeLocation location, const std::string & ); |
---|
| 43 | bool isEmpty() const; |
---|
| 44 | void print(); |
---|
| 45 | private: |
---|
| 46 | std::list< error > errors; |
---|
| 47 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.