-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
public class ParsingTree | ||
{ | ||
/// <summary> | ||
/// abstract nested class for dividing node into operators and operands for building a parse tree |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Operand не должен быть по идее вложенным в Node, потому что а зачем :) Пусть он будет вложенным в ParsingTree
private readonly string Value; | ||
public Operand(string element) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private readonly string Value; | |
public Operand(string element) | |
private readonly string Value; | |
public Operand(string element) |
public override float Count() | ||
{ | ||
return float.Parse(Value); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Комментарии с // используются только для комментариев внутри методов, тут бы ///
Но можно /// <inheritdoc />
— что комментарий наследуется от предка
{ | ||
|
||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | |
/// <summary> | |
{ | |
/// <summary> |
/// <summary> | ||
/// Parse Tree Interface | ||
/// </summary> | ||
public interface IParsingTree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Он у Вас нигде не используется, следовательно не нужен
using System; | ||
|
||
|
||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using System; | |
/// <summary> | |
using System; | |
/// <summary> |
/// <summary> | ||
/// A class for testing a parsing tree | ||
/// </summary> | ||
public class TestsrsingTree |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
No description provided.