<s>
Oberon-2	B-Language
is	O
an	O
extension	O
of	O
the	O
original	O
Oberon	B-Language
programming	I-Language
language	I-Language
that	O
adds	O
limited	O
reflection	B-Language
and	O
object-oriented	B-Language
programming	I-Language
facilities	O
,	O
open	O
arrays	B-Data_Structure
as	O
pointer	O
base	O
types	O
,	O
read-only	O
field	O
export	O
,	O
and	O
reintroduces	O
the	O
FOR	O
loop	O
from	O
Modula-2	B-Language
.	O
</s>
<s>
Oberon-2	B-Language
is	O
a	O
superset	O
of	O
Oberon	B-Language
,	O
is	O
fully	O
compatible	O
with	O
it	O
,	O
and	O
was	O
a	O
redesign	O
of	O
Object	B-Language
Oberon	I-Language
.	O
</s>
<s>
Oberon-2	B-Language
inherited	O
limited	O
reflection	B-Language
and	O
single	O
inheritance	B-Language
(	O
"	O
type	O
extension	O
"	O
)	O
without	O
the	O
interfaces	O
or	O
mixins	B-Language
from	O
Oberon	B-Language
,	O
but	O
added	O
efficient	O
virtual	O
methods	B-Language
(	O
"	O
type	O
bound	O
procedures	O
"	O
)	O
.	O
</s>
<s>
Method	B-Language
calls	I-Language
were	O
resolved	O
at	B-Library
runtime	I-Library
using	O
C++	B-Language
-style	O
virtual	O
method	O
tables	O
.	O
</s>
<s>
Compared	O
to	O
fully	O
object-oriented	B-Language
languages	I-Language
like	O
Smalltalk	B-Application
,	O
in	O
Oberon-2	B-Language
,	O
basic	O
data	O
types	O
and	O
classes	O
are	O
not	O
objects	O
,	O
many	O
operations	O
are	O
not	O
methods	B-Language
,	O
there	O
is	O
no	O
message	B-Architecture
passing	I-Architecture
(	O
it	O
can	O
be	O
emulated	O
somewhat	O
by	O
reflection	B-Language
and	O
through	O
message	O
extension	O
,	O
as	O
demonstrated	O
in	O
ETH	O
Oberon	B-Language
)	O
,	O
and	O
polymorphism	B-Application
is	O
limited	O
to	O
subclasses	O
of	O
a	O
common	O
class	O
(	O
no	O
duck	B-Application
typing	I-Application
as	O
in	O
Python	B-Language
,	O
and	O
it	O
's	O
not	O
possible	O
to	O
define	O
interfaces	O
as	O
in	O
Java	B-Language
)	O
.	O
</s>
<s>
Oberon-2	B-Language
does	O
not	O
support	O
encapsulation	B-Application
at	O
object	O
or	O
class	O
level	O
,	O
but	O
modules	B-Architecture
can	O
be	O
used	O
for	O
this	O
purpose	O
.	O
</s>
<s>
Reflection	B-Language
in	O
Oberon-2	B-Language
does	O
not	O
use	O
metaobjects	O
,	O
but	O
simply	O
reads	O
from	O
type	O
descriptors	O
compiled	B-Language
into	O
the	O
executable	O
binaries	O
,	O
and	O
exposed	O
in	O
the	O
modules	B-Architecture
that	O
define	O
the	O
types	O
and/or	O
procedures	O
.	O
</s>
<s>
If	O
the	O
format	O
of	O
these	O
structures	O
are	O
exposed	O
at	O
the	O
language	O
level	O
(	O
as	O
is	O
the	O
case	O
for	O
ETH	O
Oberon	B-Language
,	O
for	O
example	O
)	O
,	O
reflection	B-Language
could	O
be	O
implemented	O
at	O
the	O
library	B-Library
level	O
.	O
</s>
<s>
It	O
could	O
thus	O
be	O
implemented	O
almost	O
entirely	O
at	O
library	B-Library
level	O
,	O
without	O
changing	O
the	O
language	O
code	O
.	O
</s>
<s>
Indeed	O
,	O
ETH	O
Oberon	B-Language
makes	O
use	O
of	O
language-level	O
and	O
library-level	O
reflection	B-Language
abilities	O
extensively	O
.	O
</s>
<s>
Oberon-2	B-Language
provides	O
built-in	O
runtime	B-Library
support	O
for	O
garbage	B-General_Concept
collection	I-General_Concept
similar	O
to	O
Java	B-Language
and	O
performs	O
bounds	O
and	O
array	O
index	O
checks	O
,	O
etc.	O
,	O
that	O
eliminate	O
the	O
potential	O
stack	O
and	O
array	O
bounds	O
overwriting	O
problems	O
and	O
manual	O
memory	O
management	O
issues	O
inherent	O
in	O
C	B-Language
and	O
C++	B-Language
.	O
</s>
<s>
Separate	O
compiling	B-Language
using	O
symbol	O
files	O
and	O
namespaces	O
via	O
the	O
module	B-Architecture
architecture	O
ensure	O
fast	O
rebuilds	O
since	O
only	O
modules	B-Architecture
with	O
changed	O
interfaces	O
need	O
to	O
be	O
recompiled	B-Language
.	O
</s>
<s>
The	O
language	O
Component	B-Language
Pascal	I-Language
is	O
a	O
refinement	O
(	O
a	O
superset	O
)	O
of	O
Oberon-2	B-Language
.	O
</s>
<s>
The	O
following	O
Oberon-2	B-Language
code	O
implements	O
a	O
simple	O
binary	O
tree	O
:	O
</s>
<s>
They	O
are	O
equivalent	O
to	O
instance	B-Language
methods	I-Language
in	O
object-oriented	B-Language
terminology	O
.	O
</s>
<s>
Open	O
arrays	B-Data_Structure
which	O
formerly	O
could	O
only	O
be	O
declared	O
as	O
formal	O
parameter	O
types	O
may	O
now	O
be	O
declared	O
as	O
pointer	O
base	O
types	O
.	O
</s>
<s>
The	O
FOR	O
statement	O
of	O
Pascal	B-Application
and	O
Modula-2	B-Language
was	O
not	O
implemented	O
in	O
Oberon	B-Language
.	O
</s>
<s>
It	O
is	O
reintroduced	O
in	O
Oberon-2	B-Language
.	O
</s>
<s>
Oberon-2	B-Language
provides	O
several	O
mechanisms	O
for	O
checking	O
the	O
dynamic	O
type	O
of	O
an	O
object	O
.	O
</s>
<s>
For	O
example	O
,	O
where	O
a	O
Bird	O
object	O
might	O
be	O
instantiated	O
to	O
either	O
a	O
Duck	O
or	O
a	O
Cuckoo	O
,	O
Oberon-2	B-Language
allows	O
the	O
programmer	O
to	O
respond	O
to	O
the	O
actual	O
type	O
of	O
the	O
object	O
at	B-Library
runtime	I-Library
.	O
</s>
<s>
Note	O
that	O
the	O
form	O
of	O
WITH	O
statement	O
used	O
in	O
Oberon-2	B-Language
is	O
unrelated	O
to	O
the	O
Pascal	B-Application
and	O
Modula-2	B-Language
WITH	O
statement	O
.	O
</s>
<s>
This	O
method	O
of	O
abbreviating	O
access	O
to	O
record	O
fields	O
is	O
not	O
implemented	O
in	O
Oberon	B-Language
or	O
Oberon-2	B-Language
.	O
</s>
<s>
The	O
development	O
of	O
the	O
ALGOL	B-Language
→	O
Pascal	B-Application
→	O
Modula-2	B-Language
→	O
Oberon	B-Language
→	O
Component	B-Language
Pascal	I-Language
language	O
family	O
is	O
marked	O
by	O
a	O
reduction	O
in	O
the	O
complexity	O
of	O
the	O
language	O
syntax	O
.	O
</s>
<s>
The	O
entire	O
Oberon-2	B-Language
language	O
is	O
described	O
(	O
Mössenböck	O
&	O
Wirth	O
,	O
March	O
1995	O
)	O
using	O
only	O
33	O
grammatical	O
productions	O
in	O
the	O
extended	O
Backus	O
–	O
Naur	O
form	O
,	O
as	O
shown	O
below	O
.	O
</s>
<s>
Oberon-2	B-Language
compilers	B-Language
maintained	O
by	O
ETH	O
include	O
versions	O
for	O
Windows	B-Application
,	O
Linux	B-Application
,	O
Solaris	B-Application
,	O
macOS	B-Application
.	O
</s>
<s>
The	O
compiles	B-Language
to	O
native	O
machine	O
code	O
and	O
can	O
use	O
a	O
JIT	O
on	O
Windows	B-Application
,	O
Linux	B-Application
and	O
Mac	B-Application
OS	I-Application
X	O
.	O
</s>
<s>
There	O
is	O
an	O
Oberon-2	B-Language
Lex	B-General_Concept
scanner	O
and	O
Yacc	B-Application
parser	B-Language
by	O
Stephen	O
J	O
.	O
Bevan	O
of	O
Manchester	O
University	O
,	O
UK	O
,	O
based	O
on	O
the	O
one	O
in	O
the	O
Mössenböck	O
and	O
Wirth	O
reference	O
.	O
</s>
<s>
There	O
is	O
a	O
release	O
called	O
Native	O
Oberon	B-Language
which	O
includes	O
an	O
operating	O
system	O
,	O
and	O
can	O
directly	O
boot	O
on	O
PC	O
class	O
hardware	O
.	O
</s>
<s>
A	O
.NET	B-Application
implementation	O
of	O
Oberon	B-Language
with	O
the	O
addition	O
of	O
some	O
minor	O
.NET-related	O
extensions	O
has	O
also	O
been	O
developed	O
at	O
ETHZ	O
.	O
</s>
<s>
is	O
a	O
very	O
simple	O
integrated	O
development	O
environment	O
,	O
which	O
is	O
provided	O
with	O
editor	O
,	O
linker	O
,	O
and	O
Oberon-2	B-Language
compiler	B-Language
.	O
</s>
<s>
This	O
compiles	B-Language
to	O
Windows	B-Application
executables	O
.	O
</s>
<s>
Full	O
source	O
code	O
is	O
provided	O
;	O
the	O
compiler	B-Language
is	O
written	O
in	O
Oberon-2	B-Language
.	O
</s>
<s>
It	O
produces	O
object	O
code	O
in	O
the	O
form	O
of	O
Java	B-Language
class	O
files	O
(	O
bytecode	O
)	O
.	O
</s>
<s>
Some	O
JOB-specific	O
classes	O
are	O
provided	O
which	O
are	O
Java	B-Language
compatible	O
,	O
but	O
which	O
use	O
a	O
more	O
Oberon-like	O
component	O
hierarchy	O
.	O
</s>
<s>
The	O
compiles	B-Language
to	O
C	B-Language
,	O
using	O
the	O
GNU	B-Application
Compiler	I-Application
Collection	I-Application
(	O
GCC	B-Application
)	O
toolchain	O
for	O
program	O
generation	O
.	O
</s>
<s>
is	O
a	O
compiler	B-Language
that	O
translates	O
the	O
full	O
Oberon	B-Language
language	O
into	O
JavaScript	B-Language
.	O
</s>
<s>
The	O
compiler	B-Language
is	O
written	O
in	O
JavaScript	B-Language
and	O
can	O
thus	O
be	O
called	O
from	O
Web	O
pages	O
to	O
process	O
scripts	O
written	O
in	O
Oberon	B-Language
.	O
</s>
<s>
It	O
contains	O
an	O
optimizing	O
compiler	B-Language
for	O
Intel	O
Pentium	O
,	O
or	O
"	O
via-C	O
"	O
translator	O
for	O
cross-platform	B-Operating_System
software	I-Operating_System
development	O
.	O
</s>
<s>
Available	O
for	O
Windows	B-Application
and	O
Linux	B-Application
.	O
</s>
<s>
The	O
compiler	B-Language
is	O
written	O
in	O
Oberon-2	B-Language
and	O
compiles	B-Language
itself	O
.	O
</s>
<s>
is	O
a	O
project	O
to	O
bring	O
Oberon	B-Language
2	I-Language
and	O
Component	B-Language
Pascal	I-Language
(	O
BlackBox	B-Application
Component	I-Application
Builder	I-Application
)	O
to	O
Linux	B-Application
and	O
Win32	O
.	O
</s>
<s>
The	O
Linux	B-Application
port	O
of	O
BlackBox	O
was	O
unavailable	O
before	O
and	O
it	O
originally	O
ran	O
on	O
only	O
Microsoft	B-Application
Windows	I-Application
.	O
</s>
<s>
XOberon	O
is	O
a	O
real-time	B-Operating_System
operating	I-Operating_System
system	I-Operating_System
for	O
PowerPC	B-Architecture
,	O
written	O
in	O
Oberon-2	B-Language
.	O
</s>
<s>
The	O
Portable	O
Oberon-2	B-Language
Compiler	B-Language
(	O
OP2	O
)	O
was	O
developed	O
to	O
port	O
the	O
Oberon	B-Application
System	I-Application
onto	O
commercially	O
available	O
platforms	O
.	O
</s>
<s>
Oberon-2	B-Language
can	O
target	O
the	O
Keiko	O
Virtual	O
machine	O
.	O
</s>
<s>
For	O
example	O
,	O
like	O
some	O
other	O
language	B-Language
compilers	I-Language
(	O
see	O
O-code	B-Language
,	O
p-code	O
,	O
etc	O
.	O
</s>
<s>
the	O
first	O
compiles	B-Language
to	O
an	O
intermediate	O
bytecode	O
(	O
Keiko	O
bytecode	O
)	O
which	O
can	O
be	O
interpreted	O
with	O
a	O
byte-code	O
interpreter	O
or	O
use	O
just-in-time	O
compilation	B-Language
.	O
</s>
