Class DefaultMarkerExpression

java.lang.Object
dev.frostlake.executor.expressions.DefaultMarkerExpression
All Implemented Interfaces:
Expression

public class DefaultMarkerExpression extends Object implements Expression
The bare word DEFAULT where a DML value is expected — INSERT … VALUES (DEFAULT), UPDATE t SET c = DEFAULT, and the same two inside MERGE. It means "write this column's declared default", so it is not a value at all until a target column is known, which is why it travels as a marker instead of evaluating to something.

The line live draws is where the word STANDS ALONE. In any larger expression it is an ordinary name that resolves to nothing — UPDATE t SET c = DEFAULT + 1 is "invalid identifier 'DEFAULT'" — and that falls out of this design rather than being coded twice: a write path takes the marker only when it IS the whole value, and every other route evaluates it, which raises exactly that refusal.

See Also:
  • Constructor Details

    • DefaultMarkerExpression

      public DefaultMarkerExpression(SourcePosition where)
  • Method Details

    • getWhere

      public SourcePosition getWhere()
      Where the word was written, for the refusal raised when it is evaluated rather than written.
    • accept

      public <T> T accept(ExpressionVisitor<T> visitor)
      Description copied from interface: Expression
      Accept a visitor for the visitor pattern
      Specified by:
      accept in interface Expression
    • toString

      public String toString()
      Overrides:
      toString in class Object