Commit 08904a68 authored by rdubner's avatar rdubner

Got REDEFINES working for Levels 01 and 77, too.

parent 2d2e4f8d
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
using namespace std; using namespace std;
// #define DUMPING #define DUMPING
void void
scan_test(const string &filename) scan_test(const string &filename)
...@@ -308,11 +308,6 @@ main(int argc, char *argv[]) ...@@ -308,11 +308,6 @@ main(int argc, char *argv[])
// a normalized rendition of the parsed STORAGE sections. We read that // a normalized rendition of the parsed STORAGE sections. We read that
// in, and build a COBOL identifier tree based on the various storage // in, and build a COBOL identifier tree based on the various storage
// sections and the COBOL 77 01 02 03 data heirarchy. // sections and the COBOL 77 01 02 03 data heirarchy.
variable_tree.ReadFromFile(params.cbl_lst);
variable_tree.BuildCanonicalName();
#if defined(DUMPING)
// variable_tree.Dump();
#endif
// Scan the .h files for working storage and local storage locations // Scan the .h files for working storage and local storage locations
ScanAllDotHFiles(params.c_filename.Path(), ScanAllDotHFiles(params.c_filename.Path(),
...@@ -330,6 +325,9 @@ main(int argc, char *argv[]) ...@@ -330,6 +325,9 @@ main(int argc, char *argv[])
cob_fields cob_fields
); );
variable_tree.ReadFromFile(params.cbl_lst);
variable_tree.BuildCanonicalName(cob_data);
// The f_/b_ cross reference is as complete as we know how to make it. // The f_/b_ cross reference is as complete as we know how to make it.
// Scan cob_fields, updating the parent variables and building the lookup map // Scan cob_fields, updating the parent variables and building the lookup map
cob_fields.FixLookup(cob_data); cob_fields.FixLookup(cob_data);
...@@ -352,10 +350,11 @@ main(int argc, char *argv[]) ...@@ -352,10 +350,11 @@ main(int argc, char *argv[])
// The Consolidate() routine puts them together. // The Consolidate() routine puts them together.
variable_tree.Dump();
variable_tree.Consolidate(cob_fields); variable_tree.Consolidate(cob_fields);
#if defined(DUMPING) #if defined(DUMPING)
variable_tree.Dump(); variable_tree.Dump();
variable_tree.DumpFlatList(); //variable_tree.DumpFlatList();
#endif #endif
// Create the .sym.c file that will be compiled and linked into the // Create the .sym.c file that will be compiled and linked into the
// executable, providing the text that will become the executable's // executable, providing the text that will become the executable's
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommandArguments>-f C:\Users\Bob\repos\cbl-gdb-samples\ref_test_2\rtest C:\Users\Bob\repos\cbl-gdb-samples\ref_test_2\rtest.cbl</LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>-f C:\Users\Bob\repos\cbl-gdb-samples\ref_test_8\rtest C:\Users\Bob\repos\cbl-gdb-samples\ref_test_8\rtest.cbl</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerCommandArguments>-f C:\Users\Bob\repos\cbl-gdb-samples\ref_test_2\rtest C:\Users\Bob\repos\cbl-gdb-samples\ref_test_2\rtest.cbl</LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>-f C:\Users\Bob\repos\cbl-gdb-samples\ref_test_8\rtest C:\Users\Bob\repos\cbl-gdb-samples\ref_test_8\rtest.cbl</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommandArguments>-f C:\Users\Bob\repos\cbl-gdb-samples\ref_test_2\rtest C:\Users\Bob\repos\cbl-gdb-samples\ref_test_2\rtest.cbl</LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>-f C:\Users\Bob\repos\cbl-gdb-samples\ref_test_8\rtest C:\Users\Bob\repos\cbl-gdb-samples\ref_test_8\rtest.cbl</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerCommandArguments>-f C:\Users\Bob\repos\cbl-gdb-samples\ref_test_2\rtest C:\Users\Bob\repos\cbl-gdb-samples\ref_test_2\rtest.cbl</LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>-f C:\Users\Bob\repos\cbl-gdb-samples\ref_test_8\rtest C:\Users\Bob\repos\cbl-gdb-samples\ref_test_8\rtest.cbl</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
\ No newline at end of file
...@@ -209,8 +209,8 @@ public: ...@@ -209,8 +209,8 @@ public:
std::cout << std::setw(20) << "name" ; std::cout << std::setw(20) << "name" ;
std::cout << std::setw(20) << "storage"; std::cout << std::setw(20) << "storage";
std::cout << std::setw(20) << "size"; std::cout << std::setw(20) << "size";
std::cout << std::setw(20) << "program_id";
std::cout << std::setw(20) << "cbl_name"; std::cout << std::setw(20) << "cbl_name";
std::cout << std::setw(20) << "program_id";
std::cout << std::endl; std::cout << std::endl;
...@@ -221,8 +221,8 @@ public: ...@@ -221,8 +221,8 @@ public:
std::cout << std::setw(20) << symbol.name ; std::cout << std::setw(20) << symbol.name ;
std::cout << std::setw(20) << symbol.storage_type; std::cout << std::setw(20) << symbol.storage_type;
std::cout << std::setw(20) << symbol.size; std::cout << std::setw(20) << symbol.size;
std::cout << std::setw(20) << symbol.program_id;
std::cout << std::setw(20) << symbol.cbl_name; std::cout << std::setw(20) << symbol.cbl_name;
std::cout << std::setw(20) << symbol.program_id;
std::cout << std::endl; std::cout << std::endl;
} }
std::cout << std::endl; std::cout << std::endl;
...@@ -541,9 +541,9 @@ public: ...@@ -541,9 +541,9 @@ public:
std::cout << std::setw(20) << "offset" ; std::cout << std::setw(20) << "offset" ;
std::cout << std::setw(20) << "size"; std::cout << std::setw(20) << "size";
std::cout << std::setw(20) << "a_name"; std::cout << std::setw(20) << "a_name";
std::cout << std::setw(20) << "program_id";
std::cout << std::setw(20) << "parent";
std::cout << std::setw(20) << "child"; std::cout << std::setw(20) << "child";
std::cout << std::setw(20) << "parent";
std::cout << std::setw(20) << "program_id";
std::cout << std::endl; std::cout << std::endl;
for( V_COB_FIELDS::const_iterator it = v_cob_fields.begin(); for( V_COB_FIELDS::const_iterator it = v_cob_fields.begin();
...@@ -555,9 +555,9 @@ public: ...@@ -555,9 +555,9 @@ public:
std::cout << std::setw(20) << field.offset ; std::cout << std::setw(20) << field.offset ;
std::cout << std::setw(20) << field.size; std::cout << std::setw(20) << field.size;
std::cout << std::setw(20) << field.a_name; std::cout << std::setw(20) << field.a_name;
std::cout << std::setw(20) << field.program_id;
std::cout << std::setw(20) << field.parent;
std::cout << std::setw(20) << field.child; std::cout << std::setw(20) << field.child;
std::cout << std::setw(20) << field.parent;
std::cout << std::setw(20) << field.program_id;
std::cout << std::endl; std::cout << std::endl;
} }
std::cout << std::endl; std::cout << std::endl;
......
This diff is collapsed.
...@@ -222,7 +222,7 @@ private: ...@@ -222,7 +222,7 @@ private:
void DumpNode(std::ostream &sout, const VAR_NODE *node); void DumpNode(std::ostream &sout, const VAR_NODE *node);
void FindParentOf(VVAR_NODES &parents,int level); void FindParentOf(VVAR_NODES &parents,int level);
void ForceParent(VVAR_NODES &parents,const std::string &program_id); void ForceParent(VVAR_NODES &parents,const std::string &program_id);
void BuildCanonicalName(VAR_NODE *var_node); void BuildCanonicalName(VAR_NODE *var_node, const COB_DATA &cob_data);
void BuildFlatList(VAR_NODE *node,VVAR_NODES &flat); void BuildFlatList(VAR_NODE *node,VVAR_NODES &flat);
void AdjustFlatList(); void AdjustFlatList();
...@@ -238,7 +238,7 @@ public: ...@@ -238,7 +238,7 @@ public:
~VARIABLE_TREE(); ~VARIABLE_TREE();
void ChopDownTheTree(); void ChopDownTheTree();
void ReadFromFile(std::ifstream &ifs); void ReadFromFile(std::ifstream &ifs);
void BuildCanonicalName(); void BuildCanonicalName(const COB_DATA &cob_data);
void Dump(std::ostream &s = std::cout); void Dump(std::ostream &s = std::cout);
void Consolidate(const COB_FIELDS &cob_fields); void Consolidate(const COB_FIELDS &cob_fields);
void DumpANode(const VAR_NODE *node) const; void DumpANode(const VAR_NODE *node) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment