Exemplo n.º 1
0
 /// <summary>
 /// <summary>
 /// Compute the typed proper paths of a data defintion. The proper root paths are
 /// root procedures path and data definition variables path.
 /// </summary>
 /// <param name="dataNode">The node owning the data dedinition.</param>
 /// <param name="dataDesc">The Data Description to compute the proper root path</param>
 /// <param name="properType"> The Proper type of the data definition </param>
 /// <param name="pathProcedures">[out] root procedures path</param>
 /// <param name="pathVariables">[out]typed variables path</param>
 public static void ComputeTypedProperPaths(Node dataNode, DataDescriptionEntry dataDesc, Compiler.Nodes.TypeDefinition properType, out List <string> pathProcedures, out List <Tuple <string, string> > pathVariables)
 {
     System.Diagnostics.Contracts.Contract.Requires(properType != null);
     pathProcedures = new List <string>();
     pathVariables  = new List <Tuple <string, string> >();
     if (properType == null)
     {
         return;
     }
     pathVariables.Add(new Tuple <string, string>(dataDesc.Name, properType.Name));
     Compiler.Nodes.Node parent = dataNode.Parent;
     while (parent != null)
     {
         if (parent is TypeCobol.Compiler.Nodes.DataDefinition)
         {
             TypeCobol.Compiler.Nodes.DataDefinition dataParent = parent as TypeCobol.Compiler.Nodes.DataDefinition;
             pathVariables.Add(new System.Tuple <string, string>(dataParent.Name, ""));
         }
         else if (!string.IsNullOrEmpty(parent.Name))
         {
             pathProcedures.Add(parent.Name);
         }
         parent = parent.Parent;
     }
 }
Exemplo n.º 2
0
        private static int CountAllChildren(Compiler.Nodes.Node node)
        {
            int count = node.Children.Count;

            foreach (var child in node.Children)
            {
                count += CountAllChildren(child);
            }
            return(count);
        }
Exemplo n.º 3
0
 protected override bool Process(Compiler.Nodes.Node node)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Does nothing
 /// </summary>
 /// <param name="node">Target node</param>
 /// <returns>return false</returns>
 protected override bool Process(Compiler.Nodes.Node node)
 {
     return(false);
 }