Java Reference
In-Depth Information
B.4 j--Expressions and Operators
j-- supports the following Java expressions and operators.
Expression
Operators
Assignment = , +=
Conditional &&
Equality ==
Relational > , <= , instanceof 2
Additive + , -
Multiplicative *
Unary (prex) ++ , -
Simple unary !
Postx --
It also supports casting expressions, field selection, and message expressions. Both this
and super may be the targets of field selection and message expressions.
j-- also provides literals for the types it can talk about, including String s.
B.5 j--Statements and Declarations
In addition to statement expressions 3 , j-- provides for the if statement, if-else statement,
while statement, return statement, and blocks. All of these statements follow the Java
rules.
Static and instance field declarations, local variable declarations, and variable initializa-
tions are supported, and follow the Java rules.
B.6 Syntax
This section describes the lexical and syntactic grammars for the j-- programming language;
the former specifies how individual tokens in the language are composed, and the latter
specifies how language constructs are formed.
We employ the following notation to describe the grammars.
// indicates comments;
Non-terminals are written in the form of Java (mixed-case) identifiers;
Terminals are written in bold;
2 Technically, instanceof is a keyword.
3 A statement expression is an expression that can act as a statement. Examples include, i--; , x=y
+z; and x.doSomething(); .
 
Search WWH ::




Custom Search