Skip to content

Commit

Permalink
System Functions brush-up (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
Claes65 authored Aug 4, 2023
1 parent a68b623 commit 144244c
Show file tree
Hide file tree
Showing 53 changed files with 1,025 additions and 283 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.amshove.natparse.natural;

public interface IAbsOperandNode extends IOperandNode
{
IOperandNode parameter(); // TODO: (type-check)
}
public interface IAbsOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.amshove.natparse.natural;

public interface IAtnOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.amshove.natparse.natural;

public interface IAverOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.amshove.natparse.natural;

public interface ICosOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.amshove.natparse.natural;

public interface ICountOperandNode extends IOperandNode
{
IVariableReferenceNode variable();
}
public interface ICountOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ public interface IDataType

boolean hasDynamicLength();

default boolean isNumericFamily()
{
return format() == NUMERIC || format() == PACKED || format() == FLOAT || format() == INTEGER;
}

default boolean isAlphaNumericFamily()
{
return format() == ALPHANUMERIC || format() == UNICODE || format() == BINARY;
}

/**
* Determines if this type fits into the given type. Implicit conversion is taken into account.</br>
* <strong>This does not compare by byte size</strong>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.amshove.natparse.natural;

public interface IExpOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.amshove.natparse.natural;

public interface IFracOperandNode extends IOperandNode
{
IOperandNode parameter(); // TODO: (type-check)
}
public interface IFracOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.amshove.natparse.natural;

public interface IIntOperandNode extends IOperandNode
{
IVariableReferenceNode variable(); // TODO: (type-check)
}
public interface IIntOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.amshove.natparse.natural;

public interface ILogOperandNode extends IOperandNode
{
IOperandNode parameter();
}
public interface ILogOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.amshove.natparse.natural;

public interface IMathFunctionOperandNode extends IOperandNode
{
IOperandNode parameter();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.amshove.natparse.natural;

public interface IMaxOperandNode extends IProcessingLoopFunctionNode
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.amshove.natparse.natural;

public interface IMinOperandNode extends IProcessingLoopFunctionNode
{}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.amshove.natparse.natural;

public interface IOldOperandNode extends IOperandNode
{
IOperandNode operand();
}
public interface IOldOperandNode extends IProcessingLoopFunctionNode
{}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.amshove.natparse.natural;

public interface IPosNode extends IOperandNode
public interface IPosOperandNode extends IOperandNode
{
IVariableReferenceNode positionOf();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.amshove.natparse.natural;

public interface IProcessingLoopFunctionNode extends IOperandNode
{
IOperandNode parameter();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.amshove.natparse.natural;

public interface ISignOperandNode extends IOperandNode
{
IOperandNode parameter(); // TODO: (type-check)
}
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.amshove.natparse.natural;

public interface ISinOperandNode extends IOperandNode
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.amshove.natparse.natural;

public interface ISortKeyOperandNode extends IOperandNode
{
IVariableReferenceNode variable();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.amshove.natparse.natural;

public interface ISqrtOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.amshove.natparse.natural;

public interface ISumOperandNode extends IOperandNode
{
IVariableReferenceNode variable(); // TODO (type-check)
}
public interface ISumOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.amshove.natparse.natural;

public interface ITanOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.amshove.natparse.natural;

public interface ITotalOperandNode extends IOperandNode
{
IVariableReferenceNode variable();
}
public interface ITotalOperandNode extends IMathFunctionOperandNode
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public interface IValOperandNode extends IOperandNode
{
IOperandNode operand(); // TODO (type-check)
IOperandNode parameter();
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.amshove.natparse.parsing;

import org.amshove.natparse.natural.IAbsOperandNode;
import org.amshove.natparse.natural.IMathFunctionOperandNode;
import org.amshove.natparse.natural.IOperandNode;

class AbsOperandNode extends BaseSyntaxNode implements IAbsOperandNode
class AbsOperandNode extends BaseSyntaxNode implements IMathFunctionOperandNode
{
private IOperandNode parameter;

Expand Down
Loading

0 comments on commit 144244c

Please sign in to comment.