lab3 feature: add negative operation sorting
This commit is contained in:
@@ -6,9 +6,31 @@
|
||||
namespace Syntax
|
||||
{
|
||||
|
||||
struct Range
|
||||
{
|
||||
int start, finish;
|
||||
|
||||
Range(void)
|
||||
{
|
||||
}
|
||||
|
||||
Range(int start, int finish)
|
||||
: start(start), finish(finish)
|
||||
{
|
||||
}
|
||||
|
||||
int in(int i) const
|
||||
{
|
||||
return i >= start && i <= finish;
|
||||
}
|
||||
};
|
||||
|
||||
int prepare_token_vector(std::vector<Expression::Token>& tv);
|
||||
std::vector<Expression::Operation> build_op_vector(const std::vector<Expression::Token>& tv);
|
||||
Expression::TreeNode ov_to_tree(const std::vector<Expression::Token>& tv, const std::vector<Expression::Operation>& ov);
|
||||
void print_op_tree(const Expression::TreeNode &node);
|
||||
|
||||
// lab3 extension
|
||||
void lab3_sort_by_weight(std::vector<Expression::Token>& tv);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user