► |  | How to Design Classes Languages

1 | Professor J Beginner
2 | Professor J Intermediate
3 | Professor J Intermediate + Access
4 | Professor J Advanced
| Index

▼ | 1 | Professor J Beginner

1.1 | import
1.2 | class
1.3 | interface
1.4 | Field
1.5 | Method
1.6 | Constructor
1.7 | Statement
1.8 | Expression

Version: 4.1.4
top← prev up next →

### 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 $.

top← prev up next →