case class Syntax extends Product with Serializable
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(...)
or Syntax.reporterSyntax(...)
.
For example, in a Reporter
that takes two number arguments
and returns a boolean, implement Primitive.getSyntax()
as follows:
public Syntax getSyntax() { return Syntax.reporterSyntax( new int[] { Syntax.NumberType(), Syntax.NumberType() }, Syntax.BooleanType()); }
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:
public Syntax getSyntax() { return Syntax.reporterSyntax( new int[] { Syntax.WildcardType() | Syntax.RepeatableType() }, Syntax.ListType(), 2); }
- Source
- Syntax.scala
- See also
Primitive#getSyntax()
- Alphabetic
- By Inheritance
- Syntax
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val agentClassString: String
- def allArgs: List[Int]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val blockAgentClassString: Option[String]
- val canBeConcise: Boolean
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
- val defaultOption: Option[Int]
- def dfault: Int
- def dump: String
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- val introducesContext: Boolean
-
def
isInfix: Boolean
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.
- returns
true if this instruction is infix, false otherwise.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val isRightAssociative: Boolean
-
def
isVariadic: Boolean
determines whether an instruction allows a variable number of args.
- val left: Int
- def minimum: Int
- val minimumOption: Option[Int]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- val precedence: Int
- val ret: Int
- val right: List[Int]
-
def
rightDefault: Int
returns the number of args this instruction takes on the right by default.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def takesOptionalCommandBlock: Boolean
-
def
totalDefault: Int
returns the total number of args, left and right, this instruction takes by default.
- def totalMinimum: Int
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )