Skip to content

Commit

Permalink
Clean everything from metacallcli old parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Feb 7, 2024
1 parent 1400288 commit b9dfbca
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 1,172 deletions.
12 changes: 0 additions & 12 deletions source/cli/metacallcli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,13 @@ include(SecurityFlags)
#

set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}")
set(inline_path "${CMAKE_CURRENT_SOURCE_DIR}/inline/${target}")
set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source")

set(headers
${include_path}/tokenizer.hpp
${include_path}/parser.hpp
${include_path}/application.hpp
)

set(inline
${inline_path}/parser.inl
)

set(sources
${source_path}/tokenizer.cpp
${source_path}/parser.cpp
${source_path}/application.cpp
${source_path}/main.cpp
)
Expand Down Expand Up @@ -97,9 +88,6 @@ target_include_directories(${target}
${PROJECT_BINARY_DIR}/source/include
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
${PROJECT_BINARY_DIR}/source/inline
${CMAKE_CURRENT_SOURCE_DIR}/inline
${CMAKE_CURRENT_BINARY_DIR}/inline
${DEFAULT_INCLUDE_DIRECTORIES}

PUBLIC
Expand Down
95 changes: 1 addition & 94 deletions source/cli/metacallcli/include/metacallcli/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@

namespace metacallcli
{
/* -- Forward Declarations -- */

class tokenizer;

class parser;
class parser_parameter;

class application;

/* -- Class Definition -- */

/**
Expand Down Expand Up @@ -67,18 +58,6 @@ class application
*/
void run(void);

/**
* @brief
* Create a new value from arguments with parser @p
*
* @param[in] p
* Parser which points to the current iterator of the string
*
* @return
* Return a new value instanced if argument was correct
*/
void *argument_parse(parser_parameter &p);

protected:
/* -- Protected Methods -- */

Expand All @@ -98,91 +77,19 @@ class application
*/
bool load_path(const char *path, void **handle);

/**
* @brief
* Print a value @v in a readable form on error (throwable)
*
* @param[in] v
* Value to be printed
*
*/
void print(void *v);

/**
* @brief
* Invoke a function and print the result on error
*
* @param[in] func
* Command name matching the function registered from the plugins
*
* @param[in] args
* Function arguments as values
*
* @param[in] size
* Size of arguments
*
*/
void invoke(const char *func, void *args[], size_t size);

/**
* @brief
* Execute a command with string parameters
*
* @param[inout] tokens
* Array of values containing all the tokens of the input command
* Value of type array containing all the tokens of the input command
*
* @return
* Return result of the command execution
*/
void *execute(void *tokens);

private:
/* -- Private Class Definition -- */

class parameter_iterator
{
public:
/* -- Public Methods -- */

/**
* @brief
* Initialize parameter iterator
*
* @param[in] app
* Reference to the application
*/
parameter_iterator(application &app);

/**
* @brief
* Parameter iterator class destructor
*/
~parameter_iterator();

/**
* @brief
* Operator callback for iteration
*
* @param[in] parameter
* Current parameter being iterated
*/
void operator()(const char *parameter);

/**
* @brief
* Assignement operator for parameter iterator
*
* @return
* Returns a reference to itself
*/
parameter_iterator &operator=(const parameter_iterator &) = delete;

private:
/* -- Private Member Data -- */

application &app; /**< Reference to the application */
};

/* -- Private Member Data -- */

void *plugin_cli_handle; /**< Handle containing all loaded plugins for CLI */
Expand Down
231 changes: 0 additions & 231 deletions source/cli/metacallcli/include/metacallcli/parser.hpp

This file was deleted.

Loading

0 comments on commit b9dfbca

Please sign in to comment.