/* * Fsh Grammar * * 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 #include "lexer.hpp" #include "util/text.hpp" #include "ast/ast_base.hpp" #include "ast/ast_component.hpp" #include "ast/ast_executable.hpp" #include "ast/ast_token.hpp" namespace fsh { class AstFactory { public: // Generise abstraktno sintaksno drvo po ebnf formuli gore static std::shared_ptr generate_ast(std::list& list) { auto it = list.begin(); return CommandLineNode::build(it); } private: static AstFactory& get_factory(); AstFactory() {} AstFactory(const AstFactory&) = default; }; }