Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Latest commit

 

History

History
113 lines (63 loc) · 2.49 KB

status.pod

File metadata and controls

113 lines (63 loc) · 2.49 KB

Status of WMLScript Translator

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 http://www.openmobilealliance.org/ (formerly http://www.wapforum.org/)

  • WAP-193_101-WMLS-20010928-a

    WMLScript Specification, Version 28-Sept-2001

  • WAP-194-WMLSL-20000925-a

    WMLScript Standard Libraries Specification, 25-SEP-2000

Translator

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

There are 4 applications :

  • wmlsd.pir : a disassembler

  • wmls2pir.pir : a PIR translator

  • wmls2pbc.pir : a PIR translator & PBC compiler

  • wmlsi.pir : an interpreter

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

TODO

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

WMLScript PMC

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

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

  • Integer dynext/pmc/wmlsinteger.pmc

  • Floating-Point dynext/pmc/wmlsfloat.pmc

  • String dynext/pmc/wmlsstring.pmc

  • Boolean dynext/pmc/wmlsboolean.pmc

  • Invalid dynext/pmc/wmlsinvalid.pmc

WMLScript Ops

dynext/ops/wmls.ops defines opcode with new signature.

WMLScript Standard Libraries

Some of these libraries are implemented in :

  • Lang wmlscript/library/wmlslang.pir

  • Float wmlscript/library/wmlsfloat.pir

  • String wmlscript/library/wmlsstring.pir

  • Console wmlscript/library/wmlsconsole.pir

wmlscript/wmlsstdlibs.pir gives an unique entry point and implements some helpers.

TODO

Some of these libraries are incomplete.

Author

Francois Perrad.