1 ProfessorJ Beginner

  Program

 

=

 

Import ... Def ...

  Import

 

=

 

import Name ; 

import Name.* ; 

  Def

 

=

 

class Id {Member Member ...}

class Id implements Id {Member Member ...}

interface Id {Signature ...}

  Signature

 

=

 

Type Id (Type Id ,...) ; 

  Member

 

=

 

Field

Method

Constructor

  Field

 

=

 

Type Id = Expression ; 

Type Id ; 

  Method

 

=

 

Type Id (Type Id ,...) {Statement}

  Constructor

 

=

 

Id (Type Id ,...) {Init ...}

  Init

 

=

 

this.Id = Id ; 

  Statement

 

=

 

if (Expression) {Statement} else {Statement}

return Expression ; 

  Expression

 

=

 

Expression Op Expression

- Expression

! Expression

this

Expression.Id (Expression ,...)

Expression.Id

new Id (Expression ,...)

check Expression expect Expression

check Expression expect Expression within Expression

(Expression)

Id

Number

Character

String

true

false

  Name

 

=

 

Id. ... Id

  Op

 

=

 

+

-

*

/

<

<=

==

>

>=

&&

||

  Type

 

=

 

Id

boolean

int

char

double

float

long

byte

short

An Id is a sequence of alphanumeric characters, _, and $.