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


C# Ast.JAst类代码示例

本文整理汇总了C#中J.Tools.Parsing.Ast.JAst的典型用法代码示例。如果您正苦于以下问题:C# JAst类的具体用法?C# JAst怎么用?C# JAst使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JAst类属于J.Tools.Parsing.Ast命名空间,在下文中一共展示了JAst类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AppendCodeString

 internal override void AppendCodeString(StringBuilder res, JAst ast, CodeFormattingOptions format)
 {
     if (_preceeding != null) {
         _preceeding.AppendCodeString(res, ast, format);
     }
     res.Append(_verbatimImage ?? "<error>");
 }
开发者ID:borota,项目名称:JTVS,代码行数:7,代码来源:ErrorExpression.cs

示例2: AppendCodeString

        internal override void AppendCodeString(StringBuilder res, JAst ast, CodeFormattingOptions format)
        {
            Target.AppendCodeString(res, ast, format);
            format.Append(
                res,
                format.SpaceBeforeIndexBracket,
                " ",
                "",
                this.GetProceedingWhiteSpace(ast)
            );

            res.Append('[');
            _index.AppendCodeString(
                res,
                ast,
                format,
                format.SpaceWithinIndexBrackets != null ? format.SpaceWithinIndexBrackets.Value ? " " : "" : null
            );

            if (!this.IsMissingCloseGrouping(ast)) {
                format.Append(
                    res,
                    format.SpaceWithinIndexBrackets,
                    " ",
                    "",
                    this.GetSecondWhiteSpace(ast)
                );
                res.Append(']');
            }
        }
开发者ID:borota,项目名称:JTVS,代码行数:30,代码来源:IndexExpression.cs

示例3: GetLeadingWhiteSpace

 public override string GetLeadingWhiteSpace(JAst ast)
 {
     if (this.IsAltForm(ast)) {
         return Items[0].GetLeadingWhiteSpace(ast);
     }
     return base.GetLeadingWhiteSpace(ast);
 }
开发者ID:borota,项目名称:JTVS,代码行数:7,代码来源:TupleExpression.cs

示例4: GetLeadingWhiteSpace

 public override string GetLeadingWhiteSpace(JAst ast)
 {
     if (_sliceStart != null) {
         return _sliceStart.GetLeadingWhiteSpace(ast);
     }
     return this.GetProceedingWhiteSpace(ast);
 }
开发者ID:borota,项目名称:JTVS,代码行数:7,代码来源:SliceExpression.cs

示例5: AppendCodeString

 internal override void AppendCodeString(StringBuilder res, JAst ast, CodeFormattingOptions format, string leadingWhiteSpace)
 {
     string kwOnlyText = this.GetExtraVerbatimText(ast);
     if (kwOnlyText != null) {
         if (leadingWhiteSpace != null) {
             res.Append(leadingWhiteSpace);
             res.Append(kwOnlyText.TrimStart());
             leadingWhiteSpace = null;
         } else {
             res.Append(kwOnlyText);
         }
     }
     bool isAltForm = this.IsAltForm(ast);
     if (isAltForm) {
         res.Append(leadingWhiteSpace ?? this.GetProceedingWhiteSpace(ast));
         res.Append('(');
         leadingWhiteSpace = null;
     }
     _error.AppendCodeString(res, ast, format, leadingWhiteSpace);
     if (this.DefaultValue != null) {
         res.Append(this.GetSecondWhiteSpace(ast));
         res.Append('=');
         this.DefaultValue.AppendCodeString(res, ast, format);
     }
     if (isAltForm && !this.IsMissingCloseGrouping(ast)) {
         res.Append(this.GetSecondWhiteSpace(ast));
         res.Append(')');
     }
 }
开发者ID:borota,项目名称:JTVS,代码行数:29,代码来源:ErrorParameter.cs

示例6: CloneSubset

        /// <summary>
        /// Returns a new SuiteStatement which is composed of a subset of the statements in this suite statement.
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public SuiteStatement CloneSubset(JAst ast, int start, int end)
        {
            Statement[] statements = new Statement[end - start + 1];
            for (int i = start; i <= end; i++) {
                statements[i - start] = Statements[i];
            }

            var res = new SuiteStatement(statements);

            // propagate white space so we stay mostly the same...
            var itemWhiteSpace = this.GetListWhiteSpace(ast);
            var colonWhiteSpace = this.GetProceedingWhiteSpaceDefaultNull(ast);
            if (colonWhiteSpace != null) {
                ast.SetAttribute(res, NodeAttributes.PreceedingWhiteSpace, "");
            } else if (itemWhiteSpace != null) {
                // semi-colon list of statements, must end in a new line, but the original new line
                // could be multiple lines.
                ast.SetAttribute(res, NodeAttributes.ListWhiteSpace, new string[0]);
                var trailingNewLine = this.GetTrailingNewLine(ast);
                if (trailingNewLine != null) {
                    ast.SetAttribute(res, NodeAttributes.TrailingNewLine, "\r\n");
                }
            }

            if (this.IsAltForm(ast)) {
                ast.SetAttribute(res, NodeAttributes.IsAltFormValue, NodeAttributes.IsAltFormValue);
            }

            return res;
        }
开发者ID:borota,项目名称:JTVS,代码行数:36,代码来源:SuiteStatement.cs

示例7: AppendCodeStringStmt

 internal override void AppendCodeStringStmt(StringBuilder res, JAst ast, CodeFormattingOptions format)
 {
     foreach(var preceeding in _preceeding) {
         preceeding.AppendCodeString(res, ast, format);
     }
     res.Append(this.GetVerbatimImage(ast) ?? "<error stmt>");
 }
开发者ID:borota,项目名称:JTVS,代码行数:7,代码来源:ErrorStatement.cs

示例8: GetLeadingWhiteSpace

 public override string GetLeadingWhiteSpace(JAst ast)
 {
     var decorateWhiteSpace = this.GetNamesWhiteSpace(ast);
     if (decorateWhiteSpace != null && decorateWhiteSpace.Length > 0) {
         return decorateWhiteSpace[0];
     }
     return "";
 }
开发者ID:borota,项目名称:JTVS,代码行数:8,代码来源:DecoratorStatement.cs

示例9: AppendCodeStringStmt

 internal override void AppendCodeStringStmt(StringBuilder res, JAst ast, CodeFormattingOptions format)
 {
     _left.AppendCodeString(res, ast, format);
     res.Append(this.GetProceedingWhiteSpace(ast));
     res.Append(_op.ToCodeString());
     res.Append('=');
     _right.AppendCodeString(res, ast, format);
 }
开发者ID:borota,项目名称:JTVS,代码行数:8,代码来源:AugmentedAssignStatement.cs

示例10: AppendCodeString

 internal override void AppendCodeString(StringBuilder res, JAst ast, CodeFormattingOptions format)
 {
     if (this.IsAltForm(ast)) {
         this.AppendCodeString(res, ast, format, "", "", _item);
     } else {
         this.AppendCodeString(res, ast, format, "(", this.IsMissingCloseGrouping(ast) ? "" : ")", _item);
     }
 }
开发者ID:borota,项目名称:JTVS,代码行数:8,代码来源:GeneratorExpression.cs

示例11: GetLeadingWhiteSpace

 public override string GetLeadingWhiteSpace(JAst ast)
 {
     var whitespace = this.GetListWhiteSpace(ast);
     if (whitespace != null && whitespace.Length > 0) {
         return whitespace[0];
     }
     return null;
 }
开发者ID:borota,项目名称:JTVS,代码行数:8,代码来源:RelativeModuleName.cs

示例12: GetLeadingWhiteSpace

        public override string GetLeadingWhiteSpace(JAst ast)
        {
            if (_left.Length > 0 && _left[0] != null) {
                return _left[0].GetLeadingWhiteSpace(ast);
            }

            return null;
        }
开发者ID:borota,项目名称:JTVS,代码行数:8,代码来源:AssignmentStatement.cs

示例13: AppendCodeString

 internal override void AppendCodeString(StringBuilder res, JAst ast, CodeFormattingOptions format)
 {
     format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
     res.Append('`');
     _expression.AppendCodeString(res, ast, format);
     if (!this.IsMissingCloseGrouping(ast)) {
         res.Append(this.GetSecondWhiteSpace(ast));
         res.Append('`');
     }
 }
开发者ID:borota,项目名称:JTVS,代码行数:10,代码来源:BackQuoteExpression.cs

示例14: AppendCodeString

 internal override void AppendCodeString(StringBuilder res, JAst ast, CodeFormattingOptions format)
 {
     var whitespace = this.GetListWhiteSpace(ast);
     for (int i = 0; i < _dotCount; i++) {
         if (whitespace != null) {
             res.Append(whitespace[i]);
         }
         res.Append('.');
     }
     base.AppendCodeString(res, ast, format);
 }
开发者ID:borota,项目名称:JTVS,代码行数:11,代码来源:RelativeModuleName.cs

示例15: AppendCodeStringStmt

 internal override void AppendCodeStringStmt(StringBuilder res, JAst ast, CodeFormattingOptions format)
 {
     format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
     res.Append("assert");
     _test.AppendCodeString(res, ast, format);
     if (_message != null) {
         res.Append(this.GetSecondWhiteSpace(ast));
         res.Append(',');
         _message.AppendCodeString(res, ast, format);
     }
 }
开发者ID:borota,项目名称:JTVS,代码行数:11,代码来源:AssertStatement.cs


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