Skip to content

Calculation expression#9

Open
MinyazevR wants to merge 12 commits into
mainfrom
CalculationExpression
Open

Calculation expression#9
MinyazevR wants to merge 12 commits into
mainfrom
CalculationExpression

Conversation

@MinyazevR
Copy link
Copy Markdown
Owner

No description provided.

public class ParsingTree
{
/// <summary>
/// abstract nested class for dividing node into operators and operands for building a parse tree
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Везде с заглавной, а тут со строчной, неконсистентно

/// <summary>
/// A class representing operands
/// </summary>
public class Operand : Node
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operand не должен быть по идее вложенным в Node, потому что а зачем :) Пусть он будет вложенным в ParsingTree

Comment on lines +26 to +27
private readonly string Value;
public Operand(string element)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private readonly string Value;
public Operand(string element)
private readonly string Value;
public Operand(string element)

Comment on lines +33 to +36
public override float Count()
{
return float.Parse(Value);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public override float Count()
{
return float.Parse(Value);
}
public override float Count()
=> float.Parse(Value);

Value = element;
}

// The operand class calculates the value for them and returns it
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Комментарии с // используются только для комментариев внутри методов, тут бы ///
Но можно /// <inheritdoc /> — что комментарий наследуется от предка

Comment on lines +7 to +9
{

/// <summary>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
/// <summary>
{
/// <summary>

/// <summary>
/// Parse Tree Interface
/// </summary>
public interface IParsingTree
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Он у Вас нигде не используется, следовательно не нужен

Comment on lines +6 to +9
using System;


/// <summary>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
using System;
/// <summary>
using System;
/// <summary>

/// <summary>
/// A class for testing a parsing tree
/// </summary>
public class TestsrsingTree
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что-то опечатка

/// </summary>
public class TestsrsingTree
{
ParsingTree tree = new();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants