wiki:JooPo structure

Version 6 (modified by schuhmac, 9 years ago) (diff)

--

JooPo structure

JooPo is made up from several Java packages.

  • the main package
  • interface packages
    • machine provides an interface to java classfiles and java bytecode.
  • control packages
    • transforming a routine
      1. flow structures control flow into a flow of intercepts
      2. statement accumulates commands towards statements and expressions
      3. block constrains flow towards block structure
      4. loop classifies loops
      5. bilingual recognizes loopo loops
    • result converts the routine to interlinked classfile and loopo source
  • utility packages
    • expression operates on a logical accumulation of commands

For an exact description of the packages see the javadoc documentation. Here we the explain the overall design of them avoiding redundance with other documentation.

Main package

Main passes the input through the control packages. Its staple class is FixClass which creates a classfile and a loopo source file. The classfile is all at strictest protected and abstract in order to be refined by the output from loopo.

Machine package

Machine uses objectweb asm to interface classfiles. The other packages rely on it to interpret and possibly expand machine code.

Flow package

Flow interprets control flow of an input routine. It extracts machine code basic blocks from it and builds a succession structure of so called Intercepts. Intercepts wrap code chunks called Computations.

Statement package

Statement assembles operand stack operations that belong together. It accumulates them towards units called Statements which are made of Expressions.

Block package

Block uses the described algorithm to construct block nested code. Output is a Procedure made up of Paragraphs, which may be Scripts wrapping Computations or Blocks. Blocks can be Loops or Conditionals. Additionally block allows to extract loops from a procedure.

Loop package

Loop can refine loop blocks of Procedures towards CountLoops.

Bilingual package

Bilingual further refines CountLoops towards LoopoLoops filled with LoopoParagraphs. LoopoParagraphs may be LoopoScripts wrapping LoopoComputations of LoopoDependences or LoopoExtBlocks, statement computation blocks not interfering with array usage.

Result package

Result separates code into method seeds of machine code called Entries and loopo source. CallCode is introduced to hold machine code which calls certain loopo methods. Also loopo dependences with calls of machine code methods are translated to loopo source files.

Expression package

Expression interprets and translates accumulated machine code commands. It parses the code and can translate some parts to loopo source.

Attachments (2)

Download all attachments as: .zip