Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation expression #9

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Calculation expression #9

wants to merge 12 commits into from

Conversation

MinyazevR
Copy link
Owner

No description provided.

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

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

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)

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);
}

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

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>

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

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>

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

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();

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