Massive reformating and cleanup

This commit is contained in:
2024-12-06 21:07:54 +01:00
parent 79390b94b7
commit d2cbdc2910
33 changed files with 1030 additions and 1100 deletions

View File

@ -1,18 +1,18 @@
/*
* Fsh Grammar
*
* Command_Line ::= Command EOF
*
* Command_Line ::= Command EOF
* | Command Pipeline_Command
*
*
* Pipeline_Command ::= "|" Command EOF
* | "|" Command "|" Pipeline_Command
*
*
* Command ::= Command_Name [Flag_Opt] {Command_Argument} [Redirect]
*
*
* Redirects ::= [LRedirect Word] RRedirect Word | [RRedirect Word] LRedirect Word
*
*
* Command_Argument ::= Word | String_Literal
*
*
* Command_Name ::= Word
*/
#pragma once
@ -21,26 +21,24 @@
#include "util/text.hpp"
#include "ast/ast_base.hpp"
#include "ast/ast_token.hpp"
#include "ast/ast_component.hpp"
#include "ast/ast_executable.hpp"
#include "ast/ast_token.hpp"
namespace fsh {
class AstFactory {
public:
class AstFactory {
public:
// Generates an abstract syntax tree
static std::shared_ptr<ExecutableNode> generate_ast(std::list<Token>& list) {
auto it = list.begin();
return CommandLineNode::build(it);
}
// Generates an abstract syntax tree
static std::shared_ptr<ExecutableNode> generate_ast(std::list<Token>& list) {
auto it = list.begin();
return CommandLineNode::build(it);
}
private:
static AstFactory& get_factory();
AstFactory() {}
AstFactory(const AstFactory&) = default;
};
private:
static AstFactory& get_factory();
AstFactory() {}
AstFactory(const AstFactory&) = default;
};
}
} // namespace fsh