• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SourceSpan类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DoStatementBuilder

        internal DoStatementBuilder(SourceSpan statementSpan, SourceLocation location, Statement body) {
            Contract.RequiresNotNull(body, "body");

            _body = body;
            _doLocation = location;
            _statementSpan = statementSpan;
        }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:7,代码来源:DoStatementBuilder.cs


示例2: Catch

 public static CatchBlock Catch(SourceSpan span, SourceLocation header, Type type, Variable target, Statement body)
 {
     Contract.RequiresNotNull(type, "type");
     Contract.Requires(target == null || TypeUtils.CanAssign(target.Type, type), "target");
     Contract.RequiresNotNull(body, "body");
     return new CatchBlock(span, header, type, target, body);
 }
开发者ID:robertlj,项目名称:IronScheme,代码行数:7,代码来源:CatchBlock.cs


示例3: TryCatchFinally

 public static TryStatement TryCatchFinally(SourceSpan span, SourceLocation header, Statement body, CatchBlock[] handlers, Statement @finally)
 {
     return new TryStatement(
         span, header,
          body, CollectionUtils.ToReadOnlyCollection(handlers), @finally
     );
 }
开发者ID:robertlj,项目名称:IronScheme,代码行数:7,代码来源:TryStatementBuilder.cs


示例4: Scope

        public static ScopeStatement Scope(SourceSpan span, Expression scope, Statement body) {
            Contract.RequiresNotNull(scope, "scope");
            Contract.RequiresNotNull(body, "body");
            Contract.Requires(TypeUtils.CanAssign(typeof(IAttributesCollection), scope.Type), "scope", "Scope must be IAttributesCollection");

            return new ScopeStatement(span, scope, body);
        }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:7,代码来源:ScopeStatment.cs


示例5: Throw

 public static ThrowStatement Throw(SourceSpan span, Expression value)
 {
     if (value != null) {
         Contract.Requires(TypeUtils.CanAssign(typeof(Exception), value.Type));
     }
     return new ThrowStatement(span, value);
 }
开发者ID:robertlj,项目名称:IronScheme,代码行数:7,代码来源:ThrowStatement.cs


示例6: Switch

        public static SwitchStatement Switch(SourceSpan span, SourceLocation header, Expression value, params SwitchCase[] cases)
        {
            Contract.RequiresNotNull(value, "value");
            Contract.Requires(value.Type == typeof(int), "value", "Value must be int");
            Contract.RequiresNotEmpty(cases, "cases");
            Contract.RequiresNotNullItems(cases, "cases");

            bool @default = false;
            int max = Int32.MinValue;
            int min = Int32.MaxValue;
            foreach (SwitchCase sc in cases) {
                if (sc.IsDefault) {
                    Contract.Requires(@default == false, "cases", "Only one default clause allowed");
                    @default = true;
                } else {
                    int val = sc.Value;
                    if (val > max) max = val;
                    if (val < min) min = val;
                }
            }

            Contract.Requires(UniqueCaseValues(cases, min, max), "cases", "Case values must be unique");

            return new SwitchStatement(span, header, value, CollectionUtils.ToReadOnlyCollection(cases));
        }
开发者ID:robertlj,项目名称:IronScheme,代码行数:25,代码来源:SwitchStatement.cs


示例7: CustomErrorCorrection

 public CustomErrorCorrection(int errorId, SourceSpan errorSpan, params object[] parameters)
     : base(CorrectionMethod.Custom)
 {
     ErrorId = errorId;
     ErrorSpan = errorSpan;
     Parameters = parameters;
 }
开发者ID:jiangzhen,项目名称:VBF,代码行数:7,代码来源:ErrorCorrection.cs


示例8: LexemeValue

        public LexemeValue(string content, SourceSpan span)
        {
            CodeContract.RequiresArgumentNotNull(span, "span");

            Content = content;
            Span = span;
        }
开发者ID:destinyclown,项目名称:VBF,代码行数:7,代码来源:LexemeValue.cs


示例9: DoStatement

 /// <summary>
 /// Called by <see cref="DoStatementBuilder"/>.
 /// </summary>
 internal DoStatement(SourceSpan span, SourceLocation header, Expression /*!*/ test, Statement /*!*/ body)
     : base(AstNodeType.DoStatement, span)
 {
     _header = header;
     _test = test;
     _body = body;
 }
开发者ID:robertlj,项目名称:IronScheme,代码行数:10,代码来源:DoStatement.cs


示例10: LoopStatement

 /// <summary>
 /// Null test means infinite loop.
 /// </summary>
 internal LoopStatement(SourceSpan span, SourceLocation header, Expression test, Expression increment, Statement /*!*/ body, Statement @else)
     : base(AstNodeType.LoopStatement, span) {
     _test = test;
     _increment = increment;
     _body = body;
     _else = @else;
     _header = header;
 }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:11,代码来源:LoopStatement.cs


示例11: IfCondition

        public static IfStatementTest IfCondition(SourceSpan span, SourceLocation header, Expression test, Statement body)
        {
            Contract.RequiresNotNull(test, "test");
            Contract.RequiresNotNull(body, "body");
            Contract.Requires(test.Type == typeof(bool), "test", "Test must be boolean");

            return new IfStatementTest(span, header, test, body);
        }
开发者ID:robertlj,项目名称:IronScheme,代码行数:8,代码来源:IfStatementTest.cs


示例12: SwitchStatement

        internal SwitchStatement(SourceSpan span, SourceLocation header, Expression/*!*/ testValue, ReadOnlyCollection<SwitchCase>/*!*/ cases)
            : base(AstNodeType.SwitchStatement, span) {
            Assert.NotNullItems(cases);

            _testValue = testValue;
            _cases = cases;
            _header = header;
        }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:8,代码来源:SwitchStatement.cs


示例13: Lexeme

 internal Lexeme(ScannerInfo scannerInfo, int state, SourceSpan span, string value, int skippedTokenCount)
 {
     m_scannerInfo = scannerInfo;
     m_stateIndex = state;
     Span = span;
     Value = value;
     SkippedTokenCount = skippedTokenCount;
 }
开发者ID:zhoufoxcn,项目名称:VBF,代码行数:8,代码来源:Lexeme.cs


示例14: Lexeme

        internal Lexeme(ScannerInfo scannerInfo, int state, SourceSpan span, string content)
        {
            m_scannerInfo = scannerInfo;
            m_stateIndex = state;
            Value = new LexemeValue(content, span);

            m_trivia = s_emptyTrivia;
        }
开发者ID:destinyclown,项目名称:VBF,代码行数:8,代码来源:Lexeme.cs


示例15: TryStatement

 /// <summary>
 /// Called by <see cref="TryStatementBuilder"/>.
 /// Creates a try/catch/finally/else block.
 /// 
 /// The body is protected by the try block.
 /// The handlers consist of a set of language-dependent tests which call into the LanguageContext.
 /// The elseSuite runs if no exception is thrown.
 /// The finallySuite runs regardless of how control exits the body.
 /// </summary>
 internal TryStatement(SourceSpan span, SourceLocation header, Statement body, ReadOnlyCollection<CatchBlock> handlers, Statement @finally)
     : base(AstNodeType.TryStatement, span)
 {
     _body = body;
     _handlers = handlers;
     _finally = @finally;
     _header = header;
 }
开发者ID:robertlj,项目名称:IronScheme,代码行数:17,代码来源:TryStatement.cs


示例16: Add

 private SourceSpan Add(string message, SourceSpan span, Severity severity)
 {
     if (severity == Severity.Warning) {
         Warnings.Add(new ErrorResult(message, span));
     } else if (severity == Severity.FatalError || severity == Severity.Error) {
         Errors.Add(new ErrorResult(message, span));
     }
     return span;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:9,代码来源:CollectingErrorSink.cs


示例17: Generator

        public static CodeBlock Generator(SourceSpan span, string name, Type generator, Type next)
        {
            Contract.RequiresNotNull(name, "name");
            Contract.RequiresNotNull(generator, "generator");
            Contract.RequiresNotNull(next, "next");
            Contract.Requires(TypeUtils.CanAssign(typeof(Generator), generator), "generator", "The generator type must inherit from Generator");

            return new GeneratorCodeBlock(span, name, generator, next);
        }
开发者ID:robertlj,项目名称:IronScheme,代码行数:9,代码来源:GeneratorCodeBlock.cs


示例18: IfStatementTest

 internal IfStatementTest(SourceSpan span, SourceLocation header, Expression /*!*/ test, Statement /*!*/ body)
     : base(AstNodeType.IfStatementTest)
 {
     _test = test;
     _body = body;
     _header = header;
     _start = span.Start;
     _end = span.End;
 }
开发者ID:robertlj,项目名称:IronScheme,代码行数:9,代码来源:IfStatementTest.cs


示例19: ReportItem

 /// <summary>
 /// Initializes an instance of the ReportItem class.
 /// </summary>
 /// <param name="descriptor">A message descriptor.</param>
 /// <param name="sourceFile">A source file.</param>
 /// <param name="sourceSpan">A source span.</param>
 /// <param name="sourceLine">A source line.</param>
 /// <param name="args">Some arguments required by the message descriptor.</param>
 public ReportItem(MessageDescriptor descriptor, SourceFile sourceFile, SourceSpan sourceSpan,
                   TokenList sourceLine, params string[] args)
 {
     MessageDescriptor = descriptor;
     SourceFile = sourceFile;
     SourceSpan = sourceSpan;
     SourceLine = sourceLine;
     Arguments = args;
 }
开发者ID:robertsundstrom,项目名称:vb-lite-compiler,代码行数:17,代码来源:ReportItem.cs


示例20: IfThenElse

 public static IfStatement IfThenElse(SourceSpan span, Expression test, Statement body, Statement @else)
 {
     return If(
         span,
         new IfStatementTest[] {
             Ast.IfCondition(SourceSpan.None, SourceLocation.None, test, body)
         },
         @else
     );
 }
开发者ID:robertlj,项目名称:IronScheme,代码行数:10,代码来源:IfStatementBuilder.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SourceType类代码示例发布时间:2022-05-24
下一篇:
C# SourceRepository类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap