indicates whether this instruction should be parsed as infix.
indicates whether this instruction should be parsed as infix. Infix instructions expect exactly one argument on the left and should not be variadic on the right.
true if this instruction is infix, false otherwise.
returns the number of args this instruction takes on the right by default.
returns the total number of args, left and right, this instruction takes by default.
Specifies the arguments accepted by a primitive. Used by the compiler for type-checking.
You cannot instantiate this class directly. Instead, use the static construction methods
Syntax.commandSyntax(...)
orSyntax.reporterSyntax(...)
.For example, in a
Reporter
that takes two number arguments and returns a boolean, implementPrimitive.getSyntax()
as follows:An input can be made variadic, meaning that it can be repeated any number of times when enclosed in parentheses, if you add the
RepeatableType
flag. When using variadic inputs you should also define the default number of inputs, that is, the number of inputs expect if the user does not use parentheses. For example:Primitive#getSyntax()