The add operator is an arithmetic operator which performs the sum of two number objects.
Its token is named ADDITION.
Phrases[]
Infix[]
Infix notation can be achieved using the phrases added to
, plus
or and
.
Its FDS is
Example[]
I wrote
the number
2
added to
the number
5
.
This prints 7
.
Java equivalent:
System.out.println((double)2 + (double)5);
Prefix[]
Prefix notation can be achieved using the phrase add
and the infix separator and
.
Its FDS is
Example[]
I wrote
add
2
and
5
.
7
Increment[]
The increment operator is a special case of addition, and adds the fixed value 1
to a variable and cannot be used on literals.
This operator is a single instruction by itself.
It can be achieved by using the phrase got one more
.
Its FDS is
<variable:number>
<whitespace>
got one more
<punctuation>
Example[]
Spike
got one more
.
This adds 1
to the variable Spike
.
Java equivalent:
Spike++;
Phrases (list) | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|