Gyoji Compiler
Loading...
Searching...
No Matches
gyoji-context.hpp
1/* Copyright 2025 Jonathan S. Arney
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * https://github.com/jarney/gyoji/blob/master/LICENSE
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#pragma once
16
17#include <gyoji-context/errors.hpp>
18#include <gyoji-context/token-stream.hpp>
19#include <gyoji-context/source-reference.hpp>
20
30namespace Gyoji::context {
31
45 public:
55
63 bool has_errors() const;
64
69 Errors & get_errors() const;
70
79
89 const std::string & get_filename() const;
90
99 void add_filename(const std::string & _filename);
100 private:
102 Gyoji::owned<TokenStream> token_stream;
103 std::vector<std::string> filenames;
104 };
105};
Compiler Context.
Definition gyoji-context.hpp:44
TokenStream & get_token_stream() const
Definition compiler-context.cpp:37
bool has_errors() const
Definition compiler-context.cpp:29
Errors & get_errors() const
Definition compiler-context.cpp:33
void add_filename(const std::string &_filename)
Definition compiler-context.cpp:45
const std::string & get_filename() const
Definition compiler-context.cpp:41
Container for errors reported.
Definition errors.hpp:145
Stream of tokens read by the parser to provide context for errors.
Definition token-stream.hpp:120
The context namespace deals with objects that should last the entire scope of compilation.
Definition gyoji-context.hpp:30