当前位置: 首页>>代码示例>>C#>>正文


C# ProgramClassParser.ProcedureDivisionHeader方法代码示例

本文整理汇总了C#中ProgramClassParser.ProcedureDivisionHeader方法的典型用法代码示例。如果您正苦于以下问题:C# ProgramClassParser.ProcedureDivisionHeader方法的具体用法?C# ProgramClassParser.ProcedureDivisionHeader怎么用?C# ProgramClassParser.ProcedureDivisionHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProgramClassParser的用法示例。


在下文中一共展示了ProgramClassParser.ProcedureDivisionHeader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EnterProcedureDivision

 public override void EnterProcedureDivision(ProgramClassParser.ProcedureDivisionContext context)
 {
     var terminal = context.ProcedureDivisionHeader();
     var header = terminal != null? (ProcedureDivisionHeader)terminal.Symbol : null;
     Enter(new ProcedureDivision(header), context);
 }
开发者ID:laurentprudhon,项目名称:TypeCobol,代码行数:6,代码来源:CobolNodeBuilder.cs

示例2: EnterFunctionProcedureDivision

 /// <summary>Parent node: DECLARE FUNCTION</summary>
 /// <param name="context">PROCEDURE DIVISION</param>
 public override void EnterFunctionProcedureDivision(ProgramClassParser.FunctionProcedureDivisionContext context)
 {
     var header = (ProcedureDivisionHeader)context.ProcedureDivisionHeader().Symbol;
     if (header.UsingParameters != null && header.UsingParameters.Count > 0)
         DiagnosticUtils.AddError(header, "TCRFUN_DECLARATION_NO_USING");//TODO#249
     var declaration = (FunctionDeclarationHeader)CurrentNode.CodeElement;
     foreach(var parameter in declaration.Profile.InputParameters) {
         parameter.SymbolTable = CurrentNode.SymbolTable;
         CurrentNode.SymbolTable.AddVariable(parameter);
     }
     foreach(var parameter in declaration.Profile.OutputParameters) {
         parameter.SymbolTable = CurrentNode.SymbolTable;
         CurrentNode.SymbolTable.AddVariable(parameter);
     }
     foreach(var parameter in declaration.Profile.InoutParameters) {
         parameter.SymbolTable = CurrentNode.SymbolTable;
         CurrentNode.SymbolTable.AddVariable(parameter);
     }
     if (declaration.Profile.ReturningParameter != null) {
         declaration.Profile.ReturningParameter.SymbolTable = CurrentNode.SymbolTable;
         CurrentNode.SymbolTable.AddVariable(declaration.Profile.ReturningParameter);
     } else
     if (header.ReturningParameter != null) {
         // we might have a RETURNING parameter to convert, but only if there is neither
         // PICTURE nor TYPE clause for the returning parameter in the function declaration.
         // however, this is as syntax error.
         var pentry = new ParameterDescriptionEntry();
         var data = header.ReturningParameter.StorageArea as DataOrConditionStorageArea;
         if (data != null) pentry.DataName = new SymbolDefinition(data.SymbolReference.NameLiteral, data.SymbolReference.Type);
         // pentry.Picture will remain empty, we can't do anything about it
         pentry.DataType = DataType.Unknown;
         declaration.Profile.ReturningParameter = new ParameterDescription(pentry);
     }
     Enter(new ProcedureDivision(header), context);
 }
开发者ID:laurentprudhon,项目名称:TypeCobol,代码行数:37,代码来源:CobolNodeBuilder.cs


注:本文中的ProgramClassParser.ProcedureDivisionHeader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。