Class JavascriptGenerator

java.lang.Object
edu.nps.moves.dis7.source.generator.pdus.AbstractGenerator
edu.nps.moves.dis7.source.generator.pdus.JavascriptGenerator

public class JavascriptGenerator extends AbstractGenerator
Generates JavaScript source files that marshal and unmarshal to IEEE DIS.
Author:
DMcG
  • Constructor Details

    • JavascriptGenerator

      public JavascriptGenerator(Map<String,GeneratedClass> pClassDescriptions, Properties pJavascriptProperties)
      Given the input object, something of an abstract syntax tree, this generates a source code file in the JavaScript language.It has ivars, getters, setters, and serialization/deserialization methods.Warning: only partially implemented.
      Parameters:
      pClassDescriptions - String Map of classes
      pJavascriptProperties - special language properties
  • Method Details

    • writeClasses

      public void writeClasses()
      Generate the classes and write them to a directory
      Specified by:
      writeClasses in class AbstractGenerator
    • writeFlagMethods

      public void writeFlagMethods(PrintWriter pw, GeneratedClass aClass)
      Some fields have integers with bit fields defined, eg an integer where bits 0-2 represent some value, while bits 3-4 represent another value, and so on. This writes accessor and mutator methods for those fields.
      Parameters:
      pw - PrintWriter
      aClass - of interest of interest