1010 void *visit(program_declaration_c *symbol) { |
1011 void *visit(program_declaration_c *symbol) { |
1011 s4o.print("PROGRAM "); |
1012 s4o.print("PROGRAM "); |
1012 symbol->program_type_name->accept(*this); |
1013 symbol->program_type_name->accept(*this); |
1013 s4o.print("\n"); |
1014 s4o.print("\n"); |
1014 s4o.indent_right(); |
1015 s4o.indent_right(); |
|
1016 s4o.print(s4o.indent_spaces); |
1015 symbol->var_declarations->accept(*this); |
1017 symbol->var_declarations->accept(*this); |
1016 s4o.print("\n"); |
1018 s4o.print("\n"); |
1017 symbol->function_block_body->accept(*this); |
1019 symbol->function_block_body->accept(*this); |
1018 s4o.indent_left(); |
1020 s4o.indent_left(); |
1019 s4o.print(s4o.indent_spaces + "END_PROGRAM\n\n\n"); |
1021 s4o.print("\n"); |
1020 return NULL; |
1022 s4o.print("END_PROGRAM\n\n\n"); |
|
1023 return NULL; |
|
1024 } |
|
1025 |
|
1026 /***********************************/ |
|
1027 /* B 1.6 Sequential Function Chart */ |
|
1028 /***********************************/ |
|
1029 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1030 |
|
1031 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1032 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1033 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1034 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1035 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1036 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1037 |
|
1038 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1039 |
|
1040 void *visit(sequential_function_chart_c *symbol) { |
|
1041 print_list(symbol, "", "\n\n", ""); |
|
1042 return NULL; |
|
1043 } |
|
1044 |
|
1045 void *visit(sfc_network_c *symbol) { |
|
1046 print_list(symbol, "", "\n\n", ""); |
|
1047 return NULL; |
|
1048 } |
|
1049 |
|
1050 void *visit(initial_step_c *symbol) { |
|
1051 s4o.print(s4o.indent_spaces); |
|
1052 s4o.print("INITIAL_STEP "); |
|
1053 symbol->step_name->accept(*this); |
|
1054 s4o.print(" :\n"); |
|
1055 s4o.indent_right(); |
|
1056 symbol->action_association_list->accept(*this); |
|
1057 s4o.print("\n"); |
|
1058 s4o.indent_left(); |
|
1059 s4o.print(s4o.indent_spaces); |
|
1060 s4o.print("END_STEP "); |
|
1061 return NULL; |
|
1062 } |
|
1063 |
|
1064 void *visit(step_c *symbol) { |
|
1065 s4o.print(s4o.indent_spaces); |
|
1066 s4o.print("STEP "); |
|
1067 symbol->step_name->accept(*this); |
|
1068 s4o.print(" :\n"); |
|
1069 s4o.indent_right(); |
|
1070 symbol->action_association_list->accept(*this); |
|
1071 s4o.print("\n"); |
|
1072 s4o.indent_left(); |
|
1073 s4o.print(s4o.indent_spaces); |
|
1074 s4o.print("END_STEP "); |
|
1075 return NULL; |
|
1076 } |
|
1077 |
|
1078 void *visit(action_association_list_c *symbol) { |
|
1079 print_list(symbol, "", "\n", ""); |
|
1080 return NULL; |
|
1081 } |
|
1082 |
|
1083 void *visit(action_association_c *symbol) { |
|
1084 if(symbol->action_qualifier != NULL){ |
|
1085 symbol->action_name->accept(*this); |
|
1086 } |
|
1087 s4o.print(" ("); |
|
1088 if(symbol->action_qualifier != NULL){ |
|
1089 symbol->action_qualifier->accept(*this); |
|
1090 } |
|
1091 s4o.print(" "); |
|
1092 if(symbol->action_qualifier != NULL){ |
|
1093 symbol->indicator_name_list->accept(*this); |
|
1094 } |
|
1095 s4o.print(" )"); |
|
1096 return NULL; |
|
1097 } |
|
1098 |
|
1099 void *visit(indicator_name_list_c *symbol) { |
|
1100 print_list(symbol, "", ", ", ""); |
|
1101 return NULL; |
|
1102 } |
|
1103 |
|
1104 void *visit(action_qualifier_c *symbol) { |
|
1105 symbol->action_qualifier->accept(*this); |
|
1106 symbol->action_time->accept(*this); |
|
1107 return NULL; |
|
1108 } |
|
1109 |
|
1110 void *visit(qualifier_c *symbol) { |
|
1111 symbol->accept(*this); |
|
1112 return NULL; |
|
1113 } |
|
1114 |
|
1115 void *visit(timed_qualifier_c *symbol) { |
|
1116 symbol->accept(*this); |
|
1117 return NULL; |
|
1118 } |
|
1119 |
|
1120 void *visit(transition_c *symbol) { |
|
1121 s4o.print(s4o.indent_spaces); |
|
1122 s4o.print("TRANSITION "); |
|
1123 if (symbol->transition_name != NULL){ |
|
1124 symbol->transition_name->accept(*this); |
|
1125 s4o.print(" "); |
|
1126 } |
|
1127 if (symbol->integer != NULL){ |
|
1128 s4o.print("(PRIORITY := "); |
|
1129 symbol->integer->accept(*this); |
|
1130 s4o.print(") "); |
|
1131 } |
|
1132 s4o.print("FROM "); |
|
1133 symbol->from_steps->accept(*this); |
|
1134 s4o.print("TO "); |
|
1135 symbol->to_steps->accept(*this); |
|
1136 s4o.indent_right(); |
|
1137 s4o.print(s4o.indent_spaces); |
|
1138 symbol->transition_condition->accept(*this); |
|
1139 s4o.indent_left(); |
|
1140 s4o.print(s4o.indent_spaces); |
|
1141 s4o.print("END_TRANSITION"); |
|
1142 return NULL; |
|
1143 } |
|
1144 |
|
1145 void *visit(steps_c *symbol) { |
|
1146 if(symbol->step_name != NULL){ |
|
1147 symbol->step_name->accept(*this); |
|
1148 s4o.print(" "); |
|
1149 } |
|
1150 if(symbol->step_name_list != NULL){ |
|
1151 symbol->step_name_list->accept(*this); |
|
1152 } |
|
1153 return NULL; |
|
1154 } |
|
1155 |
|
1156 void *visit(step_name_list_c *symbol) { |
|
1157 print_list(symbol, "(", ", ", ") "); |
|
1158 return NULL; |
|
1159 } |
|
1160 |
|
1161 void *visit(transition_condition_c *symbol) { |
|
1162 if (symbol->simple_instr_list != NULL) { |
|
1163 s4o.print(s4o.indent_spaces); |
|
1164 s4o.print(":\n"); |
|
1165 symbol->simple_instr_list->accept(*this); |
|
1166 } |
|
1167 if (symbol->expression != NULL) { |
|
1168 s4o.print("\n"); |
|
1169 s4o.print(s4o.indent_spaces); |
|
1170 s4o.print(":= "); |
|
1171 symbol->expression->accept(*this); |
|
1172 s4o.print(";\n"); |
|
1173 } |
|
1174 return NULL; |
|
1175 } |
|
1176 |
|
1177 void *visit(action_c *symbol) { |
|
1178 s4o.print(s4o.indent_spaces); |
|
1179 s4o.print("ACTION "); |
|
1180 symbol->action_name->accept(*this); |
|
1181 s4o.print(": "); |
|
1182 s4o.indent_right(); |
|
1183 s4o.print(s4o.indent_spaces); |
|
1184 symbol->function_block_body->accept(*this); |
|
1185 s4o.print("\n "); |
|
1186 s4o.indent_left(); |
|
1187 s4o.print(s4o.indent_spaces); |
|
1188 s4o.print("END_ACTION"); |
|
1189 return NULL; |
1021 } |
1190 } |
1022 |
1191 |
1023 |
1192 |
1024 |
1193 |
1025 /********************************/ |
1194 /********************************/ |