Skip to content

Commit

Permalink
WI TypeCobolTeam#1301 Calculate fully qualified name of variable only…
Browse files Browse the repository at this point in the history
… if needed

When searching variable in SymbolTable, fully qualified name is only
used when:
- Display errors when the searched SymbolReference is ambiguous
- Codegen: the full qualified name is use to create a unique hash for
index

For variable outside typedef call property VisualQualifiedName only if
needed.
For variable under typedef replace full qualified name of variable
with a more lightweight system (DataDefinitionPath).

DataDefinitionPath only store key DataDefinition.
These key DataDefinition can be used to reconstruct the full
qualified path of a variable under a typedef.
  • Loading branch information
osmedile committed Mar 17, 2019
1 parent f74a132 commit fbb8c47
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 108 deletions.
11 changes: 7 additions & 4 deletions Codegen/src/Actions/Qualifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ private void QualifiedStorageAreaSelecterForIndexes(StorageArea storageArea, Tup
{
if (UsedStorageArea != null && UsedStorageArea.Contains(storageArea))
return;
string name = storageArea.SymbolReference.Name;
string qualified_name = this.CurrentNode.QualifiedStorageAreas[storageArea];


string qualified_name = this.CurrentNode.GetQualifiedName(storageArea);

GenerateToken item = null;
string hashName = GeneratorHelper.ComputeIndexHashName(qualified_name, this.CurrentNode);
item = new GenerateToken(
Expand Down Expand Up @@ -255,7 +257,6 @@ public override bool Visit(IndexDefinition indexDefinition)
if (index.Name.Equals(indexDefinition.Name))
{
Tuple<int, int, int, List<int>, List<int>> sourcePositions = this.Generator.FromToPositions(indexDefinition.Parent);
string name = index.Name;
string qualified_name = indexDefinition.QualifiedName.ToString();
GenerateToken item = null;
string hashName = GeneratorHelper.ComputeIndexHashName(qualified_name, indexDefinition.Parent);
Expand Down Expand Up @@ -527,7 +528,9 @@ internal bool AreItemsInNodeQualifiedStorageAreas(IList<SymbolReference> items,
}
if (nCountInner == items.Count)
{
qualified_name = sourceNode.QualifiedStorageAreas[storage_area];

qualified_name = this.CurrentNode.GetQualifiedName(storage_area);

return true;
}
}
Expand Down
Loading

0 comments on commit fbb8c47

Please sign in to comment.