Skip to content

Commit

Permalink
#274: Reinstated calling operands operands.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdb committed Dec 21, 2018
1 parent 41ca049 commit 68b7a15
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
/**
* Base class for {@link ValueExpression}s with two operands.
* <p>
* A BinaryValueExpression implements a ValueExpression that has two fields:
* A BinaryValueExpression implements a ValueExpression that has two operands:
* <code>lefts</code> and <code>rights</code> (both {@link ValueExpression}s).
* Both fields are first evaluated. If at least one of the operands evaluates to
* Both operands are first evaluated. If at least one of the operands evaluates to
* {@link Optional#empty()}, the result of the ValueExpression itself will be
* empty as well.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

/**
* A {@link ValueExpression} that splits the results of evaluating its
* <code>operands</code> field into individual bytes.
* <code>operands</code> into individual bytes.
* <p>
* A Bytes expression has a single <code>operands</code> field (a
* A Bytes expression has a single <code>operands</code> (a
* {@link ValueExpression}). When evaluated, it evaluates <code>operands</code>
* and instead of returning the list of results, each result is split into
* {@link Value} objects representing each individual byte of the original
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/**
* A {@link ValueExpression} representing a constant value.
* <p>
* Const has a single field called <code>value</code> (a {@link Value}). When
* Const has a single operand called <code>value</code> (a {@link Value}). When
* evaluated, this value is returned.
*/
public class Const implements ValueExpression {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* A {@link ValueExpression} that implements the Elvis operator:
* <pre>?:</pre>.
* <p>
* An Elvis expression has two fields: <code>lefts</code> and <code>rights</code>
* (both {@link ValueExpression}s). Both fields are evaluated. The return value is
* An Elvis expression has two operands: <code>lefts</code> and <code>rights</code>
* (both {@link ValueExpression}s). Both operands are evaluated. The return value is
* a list with the size of the longest list returned by the two evaluations. At
* each index, the value at that index in the result returned by evaluating
* <code>lefts</code> is placed, except if it does not exist or is {@link Optional#empty()},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
* A {@link ValueExpression} that expands a result by copying and concatenating
* it a specified amount of times.
* <p>
* An Expand expression has two fields: <code>bases</code> and <code>count</code>
* (both {@link ValueExpression}s). Both fields are evaluated. An
* An Expand expression has two operands: <code>bases</code> and <code>count</code>
* (both {@link ValueExpression}s). Both operands are evaluated. An
* <code>IllegalStateException</code> is thrown if evaluating <code>count</code> yields
* more than a single value. Multiple copies of the result of evaluating
* <code>bases</code> are concatenated. The amount of copies equals the result of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* Base class for {@link ValueExpression} implementations of the Fold operation.
* <p>
* Fold has three fields: <code>values</code> (a {@link ValueExpression}),
* Fold has three operands: <code>values</code> (a {@link ValueExpression}),
* <code>reducer</code> (a {@link BinaryOperator}) and <code>initial</code> (a
* {@link ValueExpression}). First <code>initial</code> is evaluated. If it does not
* return a single value, the final result is an empty list. Next, <code>values</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* A {@link ValueExpression} that reverses the results of its operand.
* <p>
* Reverse has a single field <code>values</code> (a {@link ValueExpression}).
* Reverse has a single operand <code>values</code> (a {@link ValueExpression}).
* When evaluated, it evaluates <code>values</code> and then reverses and returns
* the result.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* Base class for {@link ValueExpression}s with one operand.
* <p>
* A UnaryValueExpression implements a ValueExpression that has a single <code>operands</code>
* field (a {@link ValueExpression}). <code>operands</code> is first evaluated. If it evaluates
* (a {@link ValueExpression}). <code>operands</code> is first evaluated. If it evaluates
* to {@link Optional#empty()}, the result of the ValueExpression itself will be that as well.
* <p>
* To implement a UnaryValueExpression, only the {@link #eval(Value, ParseState, Encoding)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

/**
* A {@link ValueExpression} that represents the amount of {@link Value}s
* returned by evaluating its <code>operands</code> field.
* returned by evaluating its <code>operands</code>.
*/
public class Count implements ValueExpression {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* iterable {@link Token} (when {@link Token#isIterable()} returns true, e.g. when
* inside a {@link Rep}, {@link RepN}) or {@link While}).
*
* The <code>level</code> field must evaluate to a single value that represents the
* The <code>level</code> operand must evaluate to a single value that represents the
* relative nesting level from the current parsing position in the {@link ParseState}.
*/
public class CurrentIteration implements ValueExpression {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

/**
* A {@link ValueExpression} that represents the first {@link Value} returned
* by evaluating its <code>operands</code> field.
* by evaluating its <code>operands</code>.
*/
public class First implements ValueExpression {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

/**
* A {@link ValueExpression} that represents the last {@link Value} returned
* by evaluating its <code>operands</code> field.
* by evaluating its <code>operands</code>.
*/
public class Last implements ValueExpression {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* A {@link UnaryValueExpression} that represents the sizes (in bytes) of all
* {@link Value}s returned by evaluating its <code>operands</code> field.
* {@link Value}s returned by evaluating its <code>operands</code>.
*/
public class Len extends UnaryValueExpression {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* A {@link ValueExpression} that returns an indexed list of {@link Value}s.
* <p>
* The Nth ValueExpression has two fields, <code>values</code> and
* The Nth ValueExpression has two operands, <code>values</code> and
* <code>indices</code> (both {@link ValueExpression}s). Both operands are
* evaluated. Next, the resulting values of evaluating <code>indices</code> is
* used as a list of integer indices into the results of evaluating
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.parsingdata.metal.data.ParseState;
import io.parsingdata.metal.data.ParseValue;
import io.parsingdata.metal.encoding.Encoding;
import io.parsingdata.metal.expression.value.Const;
import io.parsingdata.metal.expression.value.ConstantFactory;
import io.parsingdata.metal.expression.value.UnaryValueExpression;
import io.parsingdata.metal.expression.value.Value;
Expand All @@ -32,7 +33,7 @@
* <p>
* Only {@link ParseValue}s have an offset, since they originate in the input.
* If a result does not have an offset (such as the {@link Value}s returned by
* {@link io.parsingdata.metal.expression.value.Const}), empty is returned.
* {@link Const}), empty is returned.
*/
public class Offset extends UnaryValueExpression {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* state that match a provided object. This class only has a private
* constructor and instead must be instantiated through one of its subclasses:
* {@link NameRef} (to match on name) and {@link DefinitionRef} (to match on
* definition). The <code>limit</code> field is optional and is used to specify
* definition). The <code>limit</code> operand is optional and is used to specify
* an upper bound to the amount of returned results.
*
* @param <T> The type of reference to match on.
Expand Down

0 comments on commit 68b7a15

Please sign in to comment.