00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef BmadParser_hpp
00025 #define BmadParser_hpp 1
00026
00027 #include "Translate/TranslateCore.hpp"
00028
00029
00030
00031 class BmadParser : public TranslateCore {
00032 public:
00033
00046 UAPNode* XRepToAMLRep (UAPNode* x_root, UAPNode* aml_root = NULL);
00047
00050 BmadParser();
00051
00052 protected:
00053
00054 void init_lists_bmad ();
00055 bool lcavity_found;
00056 bool lattice_type_set;
00057 StrVec n_factorial;
00058
00064 bool aml_ele_to_x_class (UAPNode* aml_ele, Str& x_class);
00065
00066 bool custom_x_statement_to_x (StrList word_list, Str comment, UAPNode* file_root);
00067
00068 bool custom_x_add_attributes (StrList& word_list, Str ele_class,
00069 Str& attrib_name, UAPNode* x_ele_root);
00070
00071 bool custom_x_node_to_aml (UAPNode* x_node, UAPNode* aml_root, UAPNode* aml_node);
00072
00073 void custom2_x_element_attribute_to_aml (UAPNode* x_node, UAPNode* aml_node);
00074
00075 void custom_aml_rep_to_x (UAPNode* lab, UAPNode* x_node);
00076
00077 void set_overlay_group_slave_attribute (UAPNode* x_rep, bool& resolved_all);
00078
00079 bool custom_aml_node_to_x (UAPNode* aml_ele, UAPNode* x_rep);
00080
00081 bool custom_aml_element_attribute_to_x(UAPNode* aml_root, UAPNode* aml_ele,
00082 UAPNode* aml_attrib, UAPNode* x_ele);
00083
00084 void custom2_aml_element_attribute_to_x (UAPNode* aml_ele, UAPNode* x_rep);
00085
00086 bool custom_x_element_to_x_file (UAPNode* x_node, Str& comment, StreamStruct& x_out);
00087
00088 bool custom_x_element_attribute_to_aml (Str x_class, UAPAttribute x_attrib, UAPNode* aml_node);
00089
00090 void custom_x_ele_attributes_to_x_file (UAPNode* x_node, const Str& ele_class, StreamStruct& x_out);
00091
00092 bool custom_aml_sector_or_element_to_x (UAPNode* aml_sector, UAPNode* x_root);
00093
00094 Str divide_by_n_factorial (int n, Str k);
00095
00096 };
00097
00098
00099 #endif