-APP_NAME=test
-APP_OBJECTS=test.o tape_block.o silent_code.o data_block.o data_block_0.o
+APP_NAME=ldc2
+APP_OBJECTS= main.o silent_code.o
+
+APP_OBJECTS+= tape_block.o eot_block.o discard_block.o\
+ data_block.o data_block_0.o data_block_0_0.o\
+ data_block_0_label_extractor.o
+
+APP_OBJECTS+= data_block_0_10.o data_block_0_14.o data_block_0_1.o data_block_0_24.o\
+ data_block_0_2.o data_block_0_30.o data_block_0_3.o data_block_0_4.o\
+ data_block_0_50.o data_block_0_54.o data_block_0_60.o data_block_0_44.o
+
SRC_DIR=src
default: $(APP_NAME)
g++ -o$@ $^
clean:
- rm -rf $(APP_NAME) *.o doxy/ $(SRC_DIR)/*~
+ rm -rf $(APP_NAME) *.o doxy/ $(SRC_DIR)/*~ ul_timestamp
$(MAKE) -C doc clean
doxy/timestamp: $(SRC_DIR)/*
touch $@
doxy: doxy/timestamp
+upload: ul_timestamp
-upload: doxy/timestamp
- scp -r doxy/html ente:h316.web/ldc-doc
+ul_timestamp: doxy/timestamp
+ @cd doxy/html && tar -czf /tmp/doxy.tar.gz *
+ @touch ul_timestamp
+ @scp -q /tmp/doxy.tar.gz ente:/tmp/
+ @ssh ente "rm -rf h316.web/ldc-doc/* && cd h316.web/ldc-doc && tar -xzf /tmp/doxy.tar.gz"
doc:
$(MAKE) -C doc
all: $(APP_NAME) doxy doc
-.PHONY: all clean doxy upload doc
\ No newline at end of file
+.PHONY: all clean doxy upload docdata_block_0_0.o
public:
int get_subtype();
vector<string> get_description();
-
};
#endif
*\brief Parent class copy constructor.
*/
data_block_0_0::data_block_0_0(data_block_0 & org)
- :data_block_0(org)
+ :data_block_0_label_extractor(org),data_block_0(org)
{}
/*!
*/
vector<string> data_block_0_0::get_description(){
vector<string> result;
- result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block");
+ vector<string> labels=get_labels();
+ for (int i=0; i<labels.size();i++){
+ if (i==0) result.insert(result.end(),
+ labels[i]+" "+get_typestring()+"Subprogram Name");
+ else
+ result.insert(result.end(),
+ labels[i]+" "+get_typestring() +" \" \"");
+ }
return result;
}
#include <vector>
#include <string>
-#include "data_block_0.hh"
+#include "data_block_0_label_extractor.hh"
/*!
*\brief Class for block type (0-0).
*/
class data_block_0_0
- : public data_block_0
+ : public data_block_0_label_extractor
{
friend tape_block * tape_block::gen_from_fd(int,void(*)(void*),
void(*)(void*),void*);
#include "data_block_0_label_extractor.hh"
-
/*!
- *\brief Default constructor.
+ *\brief Constructor.
*/
+data_block_0_label_extractor::data_block_0_label_extractor(data_block_0& org)
+ : data_block_0(org)
+{}
/*!
*\brief Extract labels from data_block_0_* blocks
#include <vector>
#include <string>
-#include "data_block.hh"
+#include "data_block_0.hh"
/*!
*\brief Abstract class providing label extraction for some data_block_0 subtypes.
* This class cannot be instantiated.\n
*/
class data_block_0_label_extractor
- : public virtual data_block
+ : public virtual data_block_0
{
-private:
- data_block_0_label_extractor();
+protected:
+ data_block_0_label_extractor(data_block_0 &);
protected:
vector<string> get_labels();
--- /dev/null
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include "tape_block.hh"
+#include "data_block.hh"
+
+void tape_start(void* m){
+ printf("tape_start\n");
+}
+
+void tape_stop(void* m){
+ printf("tape_stop\n");
+}
+
+int main(){
+ tape_block * myblock=0;
+ do{
+ if (myblock) delete myblock;
+ myblock=tape_block::gen_from_fd(0);
+
+ vector<string> desc=myblock->get_description();
+ for (vector<string>::iterator iter=desc.begin();
+ iter!=desc.end();iter++)
+ printf("%s\n",(*iter).c_str());
+
+
+// if ((myblock->get_type()==0)&&(myblock->get_subtype()==050)){
+// data_block * dp=(data_block *)myblock;
+// printf ("0-50 symbol name: %s\n",dp->extract_string(4).c_str());
+// printf ("0-50 symbol name: %s\n",dp->extract_string(11).c_str());
+// printf ("Block size:%i\n",dp->get_word_size());
+// }
+ } while (myblock->get_state()==tape_block::TBS_OK);
+ printf("---");
+ printf("State:%i\n",myblock->get_state());
+ printf("raw size:%i\n",myblock->get_raw_size());
+ return 0;
+}
+++ /dev/null
-
-#include <stdio.h>
-#include <unistd.h>
-
-#include "tape_block.hh"
-#include "data_block.hh"
-
-void tape_start(void* m){
- printf("tape_start\n");
-}
-
-void tape_stop(void* m){
- printf("tape_stop\n");
-}
-
-int main(){
- tape_block * myblock=0;
- do{
- if (myblock) delete myblock;
- myblock=tape_block::gen_from_fd(0);
-
- vector<string> desc=myblock->get_description();
- for (vector<string>::iterator iter=desc.begin();
- iter!=desc.end();iter++)
- printf("%s\n",(*iter).c_str());
-
-
-// if ((myblock->get_type()==0)&&(myblock->get_subtype()==050)){
-// data_block * dp=(data_block *)myblock;
-// printf ("0-50 symbol name: %s\n",dp->extract_string(4).c_str());
-// printf ("0-50 symbol name: %s\n",dp->extract_string(11).c_str());
-// printf ("Block size:%i\n",dp->get_word_size());
-// }
- } while (myblock->get_state()==tape_block::TBS_OK);
- printf("---");
- printf("State:%i\n",myblock->get_state());
- printf("raw size:%i\n",myblock->get_raw_size());
- return 0;
-}