Gyoji Compiler
Loading...
Searching...
No Matches
jformat-tree.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-frontend.hpp>
18
19namespace Gyoji::cmdline {
20 using namespace Gyoji::context;
21 using namespace Gyoji::frontend::ast;
22 using namespace Gyoji::frontend::tree;
29 public:
32 int process(const SyntaxNode & file);
33 private:
34 int indent;
36
37 std::string get_token_name(TokenID token) const;
38
39 void print_non_syntax(const TerminalNonSyntax & non_syntax);
40 void print_indent(void);
41 void print_comment_multi_line(const TerminalNonSyntax & node);
42 void print_comment_single_line(const TerminalNonSyntax & node);
43 void print_whitespace(const TerminalNonSyntax & node);
44 void print_file_metadata(const TerminalNonSyntax & node);
45
46
47 };
48
49};
Definition jformat-tree.hpp:28
Weakly-typed syntax node.
Definition syntax-node.hpp:69
Represents whitespace, comments, and metadata for the source file.
Definition tree.hpp:44
The context namespace deals with objects that should last the entire scope of compilation.
Definition gyoji-context.hpp:30
Abstract syntax tree.
Definition syntax-node.hpp:36
Strongly-typed syntax tree.
Definition forward.hpp:44