
=head1 TITLE

Status of WMLScript Translator

=head1 Introduction

The language WMLScript is a subset of ECMAScript (ie JavaScript).
WMLScript defines also an bytecode interpreter (stack based), a binary format.

WMLScript is a part of the Wireless Application Protocol specifications.

The complete specification are available on
L<http://www.openmobilealliance.org/> (formerly L<http://www.wapforum.org/>)

=over 4

=item * WAP-193_101-WMLS-20010928-a

WMLScript Specification, Version 28-Sept-2001

=item * WAP-194-WMLSL-20000925-a

WMLScript Standard Libraries Specification, 25-SEP-2000

=back

=head1 Translator

The translator is in 3 files C<src/script.pir>, C<src/opcode.pir>
(generated by C<build/translator.pl> from C<src/translation.rules>) and
C<src/stdlibs.pir> (generated by C<build/stdlibs.pl> from C<src/wmlslib.cfg>).

There are 4 applications :

=over 4

=item * F<languages/WMLScript/wmlsd.pir> : a disassembler

=item * F<languages/WMLScript/wmls2pir.pir> : a PIR translator

=item * F<languages/WMLScript/wmls2pbc.pir> : a PIR translator & PBC compiler

=item * F<languages/WMLScript/wmlsi.pir> : an interpreter

=back

The design of the Translator & Stack to Register Mapping comes from the
Jonathan Worthington's work (see F<languages/dotnet/doc/contents.pod>).

=head2 TODO

Find optimization (like Register or OptRegister) compatible with opcodes
SCAND & SCOR. These 2 opcodes pop one value, and push one I<or> two values.

=head1 WMLScript PMC

F<languages/WMLScript/pmc/wmlsbytecode.pmc> is a singleton PMC what holds
a method C<load>. This method is used to decode Bytecode File Format.

There are five types in WMLScript, each of them is implemented by a PMC.

=over 4

=item * Integer F<languages/WMLScript/pmc/wmlsinteger.pmc>

=item * Floating-Point F<languages/WMLScript/pmc/wmlsfloat.pmc>

=item * String F<languages/WMLScript/pmc/wmlsstring.pmc>

=item * Boolean F<languages/WMLScript/pmc/wmlsboolean.pmc>

=item * Invalid F<languages/WMLScript/pmc/wmlsinvalid.pmc>

=back

=head1 WMLScript Ops

F<languages/WMLScript/ops/wmls.ops> defines opcode with new signature.

=head1 WMLScript Standard Libraries

Some of these libraries are implemented in :

=over 4

=item * Lang F<languages/WMLScript/runtime/wmlslang.pir>

=item * Float F<languages/WMLScript/runtime/wmlsfloat.pir>

=item * String F<languages/WMLScript/runtime/wmlsstring.pir>

=item * Console F<languages/WMLScript/runtime/wmlsconsole.pir>

=back

F<languages/WMLScript/src/wmlsstdlibs.pir> gives an unique entry point
and implements some helpers.

=head2 TODO

Some of these libraries are incomplete.

=head1 AUTHOR

Francois Perrad.

=cut
