add main file
This commit is contained in:
+14
-3
@@ -27,17 +27,28 @@ target_include_directories(syntaxer PRIVATE
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_executable(tester)
|
add_executable(tester)
|
||||||
|
|
||||||
target_sources(tester PRIVATE
|
target_sources(tester PRIVATE
|
||||||
src/test.cpp
|
src/test.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(tester PRIVATE
|
target_include_directories(tester PRIVATE
|
||||||
${GLOBAL_INC}
|
${GLOBAL_INC}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(tester PRIVATE
|
target_link_libraries(tester PRIVATE
|
||||||
parser
|
parser
|
||||||
syntaxer
|
syntaxer
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_executable(main)
|
||||||
|
target_sources(main PRIVATE
|
||||||
|
src/main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(main PRIVATE
|
||||||
|
${GLOBAL_INC}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(main PRIVATE
|
||||||
|
parser
|
||||||
|
syntaxer
|
||||||
|
)
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include "parser.hpp"
|
||||||
|
#include "syntaxer.hpp"
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
if (argc != 2)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<Expression::Token> tv = Parser::tokenize_input(argv[1]);
|
||||||
|
Syntax::apply_corrections(tv);
|
||||||
|
std::vector<Expression::Operation> ov = Syntax::build_op_vector(tv);
|
||||||
|
}
|
||||||
+1
-1
@@ -386,7 +386,7 @@ void print_math_vector(const std::vector<Expression::Token>& tv)
|
|||||||
int i, l;
|
int i, l;
|
||||||
for (i = 0, l = tv.size() - 1; i < l; i++)
|
for (i = 0, l = tv.size() - 1; i < l; i++)
|
||||||
{
|
{
|
||||||
std::cout << *tv[i].to_math_str() << " ";
|
std::cout << *tv[i].to_math_str(); //<< " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << *tv[i].to_math_str() << "\n";
|
std::cout << *tv[i].to_math_str() << "\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user