Update of /cvsroot/emc/rcslib/src/java/diagapplet/CodeGen
In directory sc8-pr-cvs1:/tmp/cvs-serv2724
Added Files:
Tag: wps_multiplat_dev_branch
CodeGenBellRingerInterface.java CodeGenCheckBoxInterface.java
CodeGenCmdLine.java CodeGenCmdLineJarInfo.txt
CodeGenCommon.java CodeGenCommonInterface.java CodeGenGui.java
CodeGenListInterface.java CodeGenListWrapper.java
CodeGenTextAreaInterface.java CodeGenTextAreaWrapper.java
CodeGenTextFieldInterface.java CodeGenTextFieldWrapper.java
Log Message:
.
--- NEW FILE: CodeGenBellRingerInterface.java ---
package diagapplet.CodeGen;
public interface CodeGenBellRingerInterface
{
public void RingBell();
}
--- NEW FILE: CodeGenCheckBoxInterface.java ---
package diagapplet.CodeGen;
public interface CodeGenCheckBoxInterface
{
public void setState(boolean state);
public boolean getState();
}
--- NEW FILE: CodeGenCmdLine.java ---
//******************************************************************************
// CodeGen.java: Applet
//
//******************************************************************************
package diagapplet.CodeGen;
import java.util.*;
import java.io.*;
import java.net.*;
import rcs.utils.URL_and_FileLoader;
import diagapplet.utils.URLLoadInfoPanelInterface;
import diagapplet.utils.FastListPanelInterface;
//==============================================================================
// Main Class for applet CodeGen
//
//==============================================================================
public class CodeGenCmdLine
{
public static String []orig_args=null;
public static boolean debug_on=false;
public static String includePath = "";
public static boolean print_prompt=true;
// STANDALONE APPLICATION SUPPORT
// The main() method acts as the applet's entry point when it is run
// as a standalone application. It is ignored if the applet is run from
// within an HTML page.
//--------------------------------------------------------------------------
public static void main(String args[])
{
for(int i = 0; i < args.length; i++)
{
if(args[i].startsWith("-I") && args[i].length() > 2)
{
URL_and_FileLoader.AddToSearchPath(args[i].substring(2));
includePath += args[i].substring(2)+";";
continue;
}
if(args[i].indexOf('=') < 0)
{
if(args[i].endsWith(".gen"))
{
args[i] = "script="+args[i];
}
else
{
args[i] = "HHFile="+args[i];
}
}
if(args[i].equals("debug_on=true"))
{
debug_on=true;
}
if(args[i].equals("noprompt"))
{
print_prompt = false;
}
}
if(debug_on)
{
System.out.println("cgc = new CodeGenCommon();");
}
CodeGenCommonInterface cgc= new CodeGenCommon();
cgc.set_update_with_name(true);
cgc.set_debug_on(debug_on);
cgc.set_ClassList( new diagapplet.utils.FakeFastListPanel());
cgc.append_includePath(includePath);
cgc.set_print_prompt(print_prompt);
orig_args = args;
if(debug_on)
{
System.out.println("cgc.GetParameters("+args+");");
}
cgc.GetParameters(args);
if(debug_on)
{
System.out.println("cgc.get_script_file() = "+cgc.get_script_file());
}
cgc.set_display_on(false);
if(cgc.get_script_file() == null)
{
if(debug_on)
{
System.out.println("cgc.set_script_file(cgc.createScriptFile("+args+"));");
}
cgc.set_script_file(cgc.createScriptFile(args));
if(debug_on)
{
System.out.println("cgc.get_script_file() = "+cgc.get_script_file());
}
}
if(debug_on)
{
System.out.println("cgc.RunScriptFile("+cgc.get_script_file()+");");
}
cgc.RunScriptFile(cgc.get_script_file());
}
}
--- NEW FILE: CodeGenCmdLineJarInfo.txt ---
Manifest-Version: 1.0
Main-Class: diagapplet.CodeGen.CodeGenCmdLine
Name: diagapplet/CodeGen
Specification-Title: "RCS CodeGenCmdLine"
Specification-Version: "1.0"
Specification-Vendor: "National Institute of Standards and Technology (Will Shackleford)"
Implementation-Title: "diagapplet.CodeGen"
Implementation-Version: "RCS_VERSION_STRING"
Implementation-Vendor: National Institute of Standards and Technology (Will Shackleford)"
Sealed: true
Name: diagapplet/utils
Specification-Title: "RCS-Diagnostics Utilities"
Specification-Version: "1.0"
Specification-Vendor: "National Institute of Standards and Technology (Will Shackleford)"
Implementation-Title: "diagapplet.utils"
Implementation-Version: "RCS_VERSION_STRING"
Implementation-Vendor: National Institute of Standards and Technology (Will Shackleford)"
Sealed: true
--- NEW FILE: CodeGenCommon.java ---
//******************************************************************************
// CodeGenCommon.java: Applet
//
//******************************************************************************
package diagapplet.CodeGen;
import java.util.*;
import java.io.*;
import java.net.*;
import rcs.utils.URL_and_FileLoader;
import diagapplet.utils.FastListPanelInterface;
import diagapplet.utils.URLLoadInfoPanelInterface;
import diagapplet.utils.CountButtonInterface;
//==============================================================================
// Main Class for applet CodeGen
//
[...8394 lines suppressed...]
return preserve_modules_hashtable;
}
public void set_preserve_modules_hashtable(boolean b)
{
preserve_modules_hashtable=b;
}
public boolean get_interrupt_loading()
{
return interrupt_loading;
}
public void set_interrupt_loading(boolean b)
{
interrupt_loading=b;
}
}
--- NEW FILE: CodeGenCommonInterface.java ---
//******************************************************************************
// CodeGen.java: Applet
//
//******************************************************************************
package diagapplet.CodeGen;
//==============================================================================
// Main Class for applet CodeGen
//
//==============================================================================
public interface CodeGenCommonInterface
{
public boolean get_interrupt_loading();
public void set_interrupt_loading(boolean b);
public boolean get_preserve_modules_hashtable();
public void set_preserve_modules_hashtable(boolean b);
public boolean get_update_with_name();
public void set_update_with_name(boolean b);
public diagapplet.utils.CountButtonInterface get_m_hierarchyFileLoadButton();
public void set_m_hierarchyFileLoadButton(diagapplet.utils.CountButtonInterface cbi);
public String get_lastIncludePath();
public void set_lastIncludePath(String s);
public boolean get_inside_diagapplet();
public void set_inside_diagapplet(boolean b);
public diagapplet.utils.URLLoadInfoPanelInterface get_m_loadingPanel();
public void set_m_loadingPanel(diagapplet.utils.URLLoadInfoPanelInterface lp);
public java.util.Hashtable get_m_modulesHashTable();
public void set_m_modulesHashTable(java.util.Hashtable ht);
public java.util.Hashtable get_serversHashtable();
public void set_serversHashtable(java.util.Hashtable ht);
public boolean get_running();
public void set_running(boolean b);
public boolean get_run_needed();
public void set_run_needed(boolean b);
public boolean get_is_loading_hierarchy();
public void set_is_loading_hierarchy(boolean b);
public boolean get_generating_code();
public void set_generating_code(boolean b);
public boolean get_running_script();
public void set_running_script(boolean b);
public boolean get_force_reload_file();
public void set_force_reload_file(boolean b);
public boolean get_first_java_class();
public void set_first_java_class(boolean b);
public boolean get_first_cpp_function();
public void set_first_cpp_function(boolean b);
public boolean get_RunIndependantly();
public void set_RunIndependantly(boolean b);
public boolean get_generate_java_classes_needed();
public void set_generate_java_classes_needed(boolean b);
public boolean get_generate_java_dictionary_needed();
public void set_generate_java_dictionary_needed(boolean b);
public boolean get_generate_cpp_update_functions_needed();
public void set_generate_cpp_update_functions_needed(boolean b);
public boolean get_generate_cpp_format_function_needed();
public void set_generate_cpp_format_function_needed(boolean b);
public boolean get_generate_cpp_constructors_needed();
public void set_generate_cpp_constructors_needed(boolean b);
public boolean get_reload_hierarchy_needed();
public void set_reload_hierarchy_needed(boolean b);
public CodeGenTextFieldInterface get_includePathField();
public void set_includePathField(CodeGenTextFieldInterface cgtfi);
public CodeGenTextFieldInterface get_configFileTextField();
public void set_configFileTextField(CodeGenTextFieldInterface cgtfi);
public CodeGenBellRingerInterface get_bell_ringer();
public void set_bell_ringer( CodeGenBellRingerInterface br);
public CodeGenTextAreaInterface get_codeTextArea();
public void set_codeTextArea(CodeGenTextAreaInterface cta);
public String get_m_hierarchyFile();
public void set_m_hierarchyFile(String str);
public String get_m_ConfigFile();
public void set_m_ConfigFile(String str);
public String get_cppFileName();
public void set_cppFileName(String str);
public String get_javaFileName();
public void set_javaFileName(String str);
public String get_script_file();
public void set_script_file(String scrf);
public boolean get_script_file_ran();
public void set_script_file_ran(boolean b);
public boolean get_display_on();
public void set_display_on(boolean dispon);
public String get_includePath();
public void append_includePath(String str);
public void set_includePath(String str);
public boolean get_debug_on();
public void set_debug_on(boolean dbg);
public boolean get_print_prompt();
public void set_print_prompt(boolean pp);
public void setVisible(boolean visible);
public diagapplet.utils.FastListPanelInterface get_ClassList();
public void set_ClassList(diagapplet.utils.FastListPanelInterface flp);
// PARAMETER SUPPORT:
// Parameters allow an HTML author to pass information to the applet;
// the HTML author specifies them using the <PARAM> tag within the <APPLET>
// tag. The following variables are used to store the values of the
// parameters.
//--------------------------------------------------------------------------
// Parameter names. To change a name of a parameter, you need only make
// a single change. Simply modify the value of the parameter string below.
//--------------------------------------------------------------------------
public static final String PARAM_HierarchyFile = "HierarchyFile";
public static final String PARAM_ConfigFile = "ConfigFile";
public static final String PARAM_HeaderFile = "HeaderFile";
public static final String PARAM_HFile = "HFile";
public static final String PARAM_HHFile = "HHFile";
public static final String PARAM_ScriptFile = "script";
public static final String PARAM_DebugOn = "debug_on";
public static final String PARAM_UpdateWithName = "update_with_name";
public static final String PARAM_DlaLengthInit = "dla_length_init";
public static final String PARAM_DisplayOn = "display_on";
public static final String PARAM_UseDefaultTypes = "UseDefaultTypes";
public String GetParameter(String strName, String args[]);
public boolean GetParametersFirstTime = true;
public void GetParameters(String args[]);
public String replace_white_space(String in);
static public String orig_args[]=null;
public String createScriptFile(String args[]);
public boolean CheckForCppEnum(String cpp_type);
public boolean CheckForCppClass(String cpp_type);
public boolean CheckForCppPosemathClass(String cpp_type);
public String GetEnumTypeName(String vardef);
public boolean VarIsUnsigned(String vardef);
public String GetCppVarDef( String var, StructureTypeInfo type_info);
public String ConvertCppTypeToJavaType(String cpp_type);
public boolean CheckForJavaStatic(String java_type);
public String last_java_classname=null;
public boolean CheckForJavaClass(String java_type);
public static final String ndla_string = "NML_DYNAMIC_LENGTH_ARRAY";
public static final String ndla_len_string = "length_for_nml_dynamic_length_array";
public static final String unbounded_string = "NML_UNBOUNDED_LENGTH_ARRAY";
public void CreateJavaDefinition(StructureTypeInfo type_info);
public void CreateJavaUpdateFunction(StructureTypeInfo type_info);
public void CreateCppUpdateFunction(StructureTypeInfo type_info);
public void PrintInfo(String options);
public void PrintInfo(StructureTypeInfo type_info, String var_prefix, int varnum, int offset);
public void CreateCppInitializer(StructureTypeInfo type_info);
public void CreateCppConstructor(StructureTypeInfo type_info);
public void GenerateJavaClass(String class_name);
public void GenerateJavaClasses();
public boolean IsNonUpdatebleClass(StructureTypeInfo type_info);
public void GenerateCppUpdateFunction(String class_name);
public void WriteOutput(String str);
public void GenerateCppInitializer(String class_name);
public void GenerateCppConstructor(String class_name);
public void GenerateCppUpdateFunctions();
public void GenerateCppConstructors();
public String find_common_root(String strs[]);
public boolean IsNMLMsg(String classname);
public void GenerateCppStartOfFile();
public String []RemoveDuplicates(String list[]);
public void GenerateCppPrototypesHeader();
public void GenerateCppFormatFunction();
public void SetOutputFile(String str) throws Exception;
public String get_base_name(String str);
public String RemoveStartingEndingSpace(String str);
public boolean IsInteger(String str);
public boolean IsDouble(String str);
public void GenerateJavaMessageDict();
public void ClearAll();
public void AddAlphabatizedItem(diagapplet.utils.FastListPanelInterface lst, String item, boolean select_it);
public boolean is_generic(String str);
public void SelectByFromFile(String filename);
public void InitializeClassList() throws Exception;
public void ResetGenericClasses();
// The init() method is called by the AWT when an applet is first loaded or
// reloaded. Override this method to perform whatever initialization your
// applet needs, such as initializing data structures, loading images or
// fonts, creating frame windows, setting the layout manager, or adding UI
// components.
//--------------------------------------------------------------------------
public void RingBell();
public void init();
public void ParseOptionsInfo();
public void LoadHierarchy() throws Exception;
public String remove_leading_whitespace(String str);
public void MakeListGeneric(diagapplet.utils.FastListPanelInterface lst);
public void RunScriptFile(String new_script_file);
public void RunScriptFile();
}
--- NEW FILE: CodeGenGui.java ---
//******************************************************************************
// CodeGen.java: Applet
//
//******************************************************************************
package diagapplet.CodeGen;
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.net.*;
import diagapplet.utils.*;
import rcs.utils.URL_and_FileLoader;
//==============================================================================
[...8564 lines suppressed...]
codegen_cycles++;
}
synchronized(this)
{
UpdateDisplay();
}
Thread.sleep(500);
}
catch (InterruptedException e)
{
// TODO: Place exception-handling code here in case an
// InterruptedException is thrown by Thread.sleep(),
// meaning that another thread has interrupted this one
e.printStackTrace();
stop();
}
}
running = false;
}
}
--- NEW FILE: CodeGenListInterface.java ---
package diagapplet.CodeGen;
public interface CodeGenListInterface
{
public void add(java.lang.String str);
public int getItemCount();
public void select(int i);
}
--- NEW FILE: CodeGenListWrapper.java ---
package diagapplet.CodeGen;
public class CodeGenListWrapper extends java.awt.List implements diagapplet.CodeGen.CodeGenListInterface
{
}
--- NEW FILE: CodeGenTextAreaInterface.java ---
package diagapplet.CodeGen;
public interface CodeGenTextAreaInterface
{
public void append(java.lang.String str);
public void setText(java.lang.String str);
public String getText();
}
--- NEW FILE: CodeGenTextAreaWrapper.java ---
package diagapplet.CodeGen;
public class CodeGenTextAreaWrapper extends java.awt.TextArea implements CodeGenTextAreaInterface
{
public CodeGenTextAreaWrapper(int rows, int collumns)
{
super(rows,collumns);
}
}
--- NEW FILE: CodeGenTextFieldInterface.java ---
package diagapplet.CodeGen;
public interface CodeGenTextFieldInterface
{
public void setText(java.lang.String str);
public String getText();
public void repaint();
}
--- NEW FILE: CodeGenTextFieldWrapper.java ---
package diagapplet.CodeGen;
import java.awt.*;
public class CodeGenTextFieldWrapper extends java.awt.TextField implements CodeGenTextFieldInterface
{
CodeGenTextFieldWrapper(String s)
{
super(s);
}
}
|