Skip to content

Commit

Permalink
#236 - Rework parser (remove RPN)
Browse files Browse the repository at this point in the history
  • Loading branch information
sys27 committed Aug 1, 2019
1 parent 14a1c29 commit e167bad
Show file tree
Hide file tree
Showing 25 changed files with 1,118 additions and 683 deletions.
1 change: 1 addition & 0 deletions xFunc.DotnetTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using xFunc.Maths.Analyzers.TypeAnalyzers;
using xFunc.Maths.Expressions;
using xFunc.Maths.Expressions.Collections;
using xFunc.Maths.Tokenization;

namespace xFunc.DotnetTool
{
Expand Down
248 changes: 116 additions & 132 deletions xFunc.Maths/ExpressionFactory.cs

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions xFunc.Maths/Expressions/BinaryExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace xFunc.Maths.Expressions
/// <summary>
/// The base class for binary operations.
/// </summary>
public abstract class BinaryExpression : IFunctionExpression
public abstract class BinaryExpression : IExpression
{

/// <summary>
Expand Down Expand Up @@ -197,14 +197,6 @@ public virtual IExpression Right
/// </summary>
public virtual IExpression Parent { get; set; }

/// <summary>
/// Gets the count of parameters.
/// </summary>
/// <value>
/// The count of parameters.
/// </value>
public virtual int ParametersCount => 2;

}

}
10 changes: 1 addition & 9 deletions xFunc.Maths/Expressions/Define.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace xFunc.Maths.Expressions
/// <summary>
/// Represents the Define operation.
/// </summary>
public class Define : IFunctionExpression
public class Define : IExpression
{

private IExpression key;
Expand Down Expand Up @@ -168,14 +168,6 @@ public IExpression Clone()
/// </summary>
public IExpression Parent { get; set; }

/// <summary>
/// Gets the count of parameters.
/// </summary>
/// <value>
/// The count of parameters.
/// </value>
public int ParametersCount => 2;

/// <summary>
/// Gets or sets the key.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion xFunc.Maths/Expressions/DifferentParametersExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace xFunc.Maths.Expressions
/// <summary>
/// The base class for expressions with different number of parameters.
/// </summary>
public abstract class DifferentParametersExpression : IFunctionExpression
public abstract class DifferentParametersExpression : IExpression
{

/// <summary>
Expand Down
35 changes: 0 additions & 35 deletions xFunc.Maths/Expressions/IFunctionExpression.cs

This file was deleted.

10 changes: 1 addition & 9 deletions xFunc.Maths/Expressions/UnaryExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace xFunc.Maths.Expressions
/// <summary>
/// The abstract base class that represents the unary operation.
/// </summary>
public abstract class UnaryExpression : IFunctionExpression
public abstract class UnaryExpression : IExpression
{

/// <summary>
Expand Down Expand Up @@ -165,14 +165,6 @@ public virtual IExpression Argument
/// </summary>
public IExpression Parent { get; set; }

/// <summary>
/// Gets the count of parameters.
/// </summary>
/// <value>
/// The count of parameters.
/// </value>
public virtual int ParametersCount => 1;

}

}
10 changes: 1 addition & 9 deletions xFunc.Maths/Expressions/Undefine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace xFunc.Maths.Expressions
/// <summary>
/// Represents the Undefice operation.
/// </summary>
public class Undefine : IFunctionExpression
public class Undefine : IExpression
{

private IExpression key;
Expand Down Expand Up @@ -158,14 +158,6 @@ public IExpression Clone()
[ExcludeFromCodeCoverage]
public IExpression Parent { get; set; }

/// <summary>
/// Gets the count of parameters.
/// </summary>
/// <value>
/// The count of parameters.
/// </value>
public int ParametersCount => 1;

/// <summary>
/// Gets or sets the key.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion xFunc.Maths/IExpressionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IExpressionFactory
/// <param name="token">The token.</param>
/// <param name="arguments">The list of arguments.</param>
/// <returns>The expression.</returns>
IExpression Create(IToken token, IEnumerable<IExpression> arguments);
IExpression Create(IToken token, params IExpression[] arguments);

}

Expand Down

0 comments on commit e167bad

Please sign in to comment.