products/Sources/formale Sprachen/VDM/VDMPP/CodegenPP image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: nativetest.vdmpp   Sprache: VDM

Original von: VDM©

class codegen_Util

instance variables

compiler : Compiler := new Compiler();
codegen : Codegen := new Codegen();
--io : IO := new IO();

operations

public Run : () ==> (bool|int|seq of char)
Run() ==
 let programs = getSimpleNames() in
 Run(programs);
    
public Run : seq of seq of char ==> seq of char
Run(programs) ==
 if programs = [] then
  return []
 else
  let
   program = hd programs,
   z = parseSimpleProgram(program),
   a = compiler.Compile(program, z),
   b = codegen.Generate(a),
   real_b = b ^ " public static void main(String[] argv){ System.exit(x()); }}",
   c = writeProgram(program, real_b),
   d = compileProgram(program),
   e = runProgram(program)
  in
   if e <> 42 then
    return "\nTest " ^ program ^ " failed with code: " ^ iToS(e) ^ Run(tl programs)
   else
    return "\nTest " ^ program ^ " success" ^ Run(tl programs);
 
functions
 public iToS : int -> seq of char
 iToS(i) == is not yet specified;

 public showType : int -> int
 showType(type) == is not yet specified;

 public getSimpleNames : () -> seq of seq of char
 getSimpleNames() == is not yet specified;

 public parseSimpleProgram : seq of char -> SimpleSpecification
 parseSimpleProgram(filename) == is not yet specified;
 
 public writeProgram : seq of char * seq of char -> bool
 writeProgram(fileName, contents) == is not yet specified;
 
 public compileProgram : seq of char -> bool
 compileProgram(fileName) == is not yet specified;
 
 public runProgram : seq of char -> (int|bool)
 runProgram(fileName) == is not yet specified;
 
end codegen_Util


¤ Dauer der Verarbeitung: 0.20 Sekunden  (vorverarbeitet)  ¤





Download des
Quellennavigators
Download des
sprechenden Kalenders

in der Quellcodebibliothek suchen




Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.


Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.


Bot Zugriff