27 #ifndef IDLFE_IDL_FRONTEND_H_
28 #define IDLFE_IDL_FRONTEND_H_
70 int main (
int argc,
const char*
const argv []) noexcept
72 return run (
filename (argv [0]), argc - 1, argv + 1);
82 int run (
const char* command,
int argc,
const char*
const argv []) noexcept;
88 static const char*
filename (
const char* path) noexcept;
91 unsigned flags () const noexcept
112 friend class FE::Driver;
120 const char*
arg () const noexcept
127 bool end () const noexcept
151 CmdLine (
int argc, const
char* const argv []) :
157 const char*
const* arg_;
158 const char*
const* end_;
170 preprocess_to_stdout_ (false)
209 std::vector <std::string>&
defines () noexcept
223 return include_paths_;
233 std::vector <std::string>&
files () noexcept
267 bool compile (
const simplecpp::DUI& prep_params,
const std::string& file);
270 const char* command_;
272 std::vector <std::string> defines_;
273 std::vector <std::string> undefines_;
274 std::vector <std::string> include_paths_;
275 std::vector <std::string> includes_;
276 std::vector <std::string> files_;
277 std::ostream& err_out_;
278 bool preprocess_to_stdout_;
Abstract Syntax Tree root.
Command line argument iterator.
const char * parameter(const char *switch_end)
Get the parameter followed to the switch.
bool end() const noexcept
const char * arg() const noexcept
bool next() noexcept
Advances to the next argument.
IDL_FrontEnd(unsigned flags=0, std::ostream &err_out=std::cerr)
Constructor.
virtual void generate_code(const AST::Root &tree)=0
Generate user code from AST.
int main(int argc, const char *const argv[]) noexcept
Call this method from the main() function.
virtual void print_usage_info(const char *exe_name)
Prints usage information to std::cout.
static const unsigned FLAG_ENABLE_CONST_OBJREF
Allow Nirvana const interface references.
virtual bool parse_command_line(CmdLine &args)
Parse command line parameter.
std::vector< std::string > & includes() noexcept
std::vector< std::string > & defines() noexcept
static const unsigned FLAG_DEPRECATE_ANONYMOUS_TYPES
Disallows anonymous IDL types as required by the C++11 Language Mapping Specification.
std::vector< std::string > & include_paths() noexcept
virtual void parse_arguments(CmdLine &args)
Parse command line parameters.
static const char * filename(const char *path) noexcept
Get file name from path.
virtual void file_begin(const std::filesystem::path &file, AST::Builder &builder)
Begin of the file parsing.
int run(const char *command, int argc, const char *const argv[]) noexcept
The same as main (), but aruments must not include the first main() argument (executable file name).
std::vector< std::string > & undefines() noexcept
unsigned flags() const noexcept
std::vector< std::string > & files() noexcept
virtual void interface_end(const AST::Interface &itf, AST::Builder &builder)
End of the interface parsing.
std::ostream & err_out() const noexcept
static const unsigned FLAG_DEPRECATE_PSEUDO_INTERFACES
Disallows pseudo interfaces.
Abstract Syntax Tree namespace.