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

C# CsTokenList类代码示例

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

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



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

示例1: FinallyStatement

 internal FinallyStatement(CsTokenList tokens, Microsoft.StyleCop.CSharp.TryStatement tryStatement, BlockStatement embeddedStatement)
     : base(StatementType.Finally, tokens)
 {
     this.tryStatement = tryStatement;
     this.embeddedStatement = embeddedStatement;
     base.AddStatement(embeddedStatement);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:7,代码来源:FinallyStatement.cs


示例2: VariableDeclarationStatement

 internal VariableDeclarationStatement(CsTokenList tokens, bool constant, VariableDeclarationExpression expression)
     : base(StatementType.VariableDeclaration, tokens)
 {
     this.constant = constant;
     this.expression = expression;
     base.AddExpression(expression);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:7,代码来源:VariableDeclarationStatement.cs


示例3: CatchStatement

 internal CatchStatement(CsTokenList tokens, Microsoft.StyleCop.CSharp.TryStatement tryStatement, Expression classExpression, BlockStatement embeddedStatement)
     : base(StatementType.Catch, tokens)
 {
     this.tryStatement = tryStatement;
     this.catchExpression = classExpression;
     this.embeddedStatement = embeddedStatement;
     if (classExpression != null)
     {
         base.AddExpression(classExpression);
         if (classExpression != null)
         {
             if (classExpression.ExpressionType == ExpressionType.Literal)
             {
                 this.classType = ((LiteralExpression) classExpression).Token as TypeToken;
             }
             else if (classExpression.ExpressionType == ExpressionType.VariableDeclaration)
             {
                 VariableDeclarationExpression expression = (VariableDeclarationExpression) classExpression;
                 this.classType = expression.Type;
                 foreach (VariableDeclaratorExpression expression2 in expression.Declarators)
                 {
                     this.identifier = expression2.Identifier.Text;
                     break;
                 }
             }
         }
     }
     base.AddStatement(embeddedStatement);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:29,代码来源:CatchStatement.cs


示例4: NewExpression

        /// <summary>
        /// Initializes a new instance of the NewExpression class.
        /// </summary>
        /// <param name="tokens">The list of tokens that form the expression.</param>
        /// <param name="typeCreationExpression">The type creation expression, or null
        /// for an anonymous type.</param>
        /// <param name="initializerExpression">The optional initializer expression.</param>
        internal NewExpression(CsTokenList tokens, Expression typeCreationExpression, Expression initializerExpression)
            : base(ExpressionType.New, tokens)
        {
            Param.AssertNotNull(tokens, "tokens");

            Param.Assert(
                typeCreationExpression == null ||
                typeCreationExpression.ExpressionType == ExpressionType.Literal ||
                typeCreationExpression.ExpressionType == ExpressionType.MemberAccess ||
                typeCreationExpression.ExpressionType == ExpressionType.MethodInvocation,
                "typeCreationExpression",
                "The type creation expression must be a valid expression type.");

            Param.Assert(
                initializerExpression == null ||
                initializerExpression.ExpressionType == ExpressionType.ObjectInitializer ||
                initializerExpression.ExpressionType == ExpressionType.CollectionInitializer,
                "initializerExpression",
                "The initializer expression must be null or a valid initializer expression type.");

            this.typeCreationExpression = typeCreationExpression;
            this.initializerExpression = initializerExpression;

            if (typeCreationExpression != null)
            {
                this.AddExpression(typeCreationExpression);
            }

            if (initializerExpression != null)
            {
                this.AddExpression(initializerExpression);
            }
        }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:40,代码来源:NewExpression.cs


示例5: QueryExpression

 internal QueryExpression(CsTokenList tokens, ICollection<QueryClause> clauses)
     : base(ExpressionType.Query, tokens)
 {
     this.clauses = new CodeUnitCollection<QueryClause>(this);
     this.clauses.AddRange(clauses);
     this.InitializeFromClauses(clauses);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:7,代码来源:QueryExpression.cs


示例6: SwitchStatement

        /// <summary>
        /// Initializes a new instance of the SwitchStatement class.
        /// </summary>
        /// <param name="tokens">The list of tokens that form the statement.</param>
        /// <param name="switchItem">The expression to switch off of.</param>
        /// <param name="caseStatements">The list of case statements under the switch statement.</param>
        /// <param name="defaultStatement">The default statement under the switch statement.</param>
        internal SwitchStatement(
            CsTokenList tokens, 
            Expression switchItem, 
            ICollection<SwitchCaseStatement> caseStatements, 
            SwitchDefaultStatement defaultStatement)
            : base(StatementType.Switch, tokens)
        {
            Param.AssertNotNull(tokens, "tokens");
            Param.AssertNotNull(switchItem, "switchItem");
            Param.AssertNotNull(caseStatements, "caseStatements");
            Param.Ignore(defaultStatement);

            this.switchItem = switchItem;
            this.caseStatements = caseStatements;
            this.defaultStatement = defaultStatement;

            Debug.Assert(caseStatements.IsReadOnly, "The collection of case statements should be read-only.");

            this.AddExpression(switchItem);

            foreach (Statement statement in caseStatements)
            {
                this.AddStatement(statement);
            }

            if (defaultStatement != null)
            {
                this.AddStatement(defaultStatement);
            }
        }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:37,代码来源:SwitchStatement.cs


示例7: UnsafeAccessExpression

 internal UnsafeAccessExpression(CsTokenList tokens, Operator operatorType, Expression value)
     : base(ExpressionType.UnsafeAccess, tokens)
 {
     this.operatorType = operatorType;
     this.value = value;
     base.AddExpression(value);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:7,代码来源:UnsafeAccessExpression.cs


示例8: IncrementExpression

 internal IncrementExpression(CsTokenList tokens, Expression value, IncrementType incrementType)
     : base(ExpressionType.Increment, tokens)
 {
     this.value = value;
     this.incrementType = incrementType;
     base.AddExpression(value);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:7,代码来源:IncrementExpression.cs


示例9: DecrementExpression

 internal DecrementExpression(CsTokenList tokens, Expression value, DecrementType decrementType)
     : base(ExpressionType.Decrement, tokens)
 {
     this.value = value;
     this.decrementType = decrementType;
     base.AddExpression(value);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:7,代码来源:DecrementExpression.cs


示例10: Argument

        /// <summary>
        /// Initializes a new instance of the Argument class.
        /// </summary>
        /// <param name="name">The optional name of the argument.</param>
        /// <param name="modifiers">Modifers applied to this argument.</param>
        /// <param name="argumentExpression">The expression that forms the body of the argument.</param>
        /// <param name="location">The location of the argument in the code.</param>
        /// <param name="parent">The parent code part.</param>
        /// <param name="tokens">The tokens that form the argument.</param>
        /// <param name="generated">Indicates whether the argument is located within a block of generated code.</param>
        internal Argument(
            CsToken name, 
            ParameterModifiers modifiers, 
            Expression argumentExpression,
            CodeLocation location, 
            Reference<ICodePart> parent,
            CsTokenList tokens, 
            bool generated)
        {
            Param.Ignore(name);
            Param.Ignore(modifiers);
            Param.AssertNotNull(argumentExpression, "argumentExpression");
            Param.AssertNotNull(location, "location");
            Param.AssertNotNull(parent, "parent");
            Param.Ignore(tokens);
            Param.Ignore(generated);

            this.name = name;
            this.modifiers = modifiers;
            this.argumentExpression = argumentExpression;
            this.location = location;
            this.parent = parent;
            this.tokens = tokens;
            this.generated = generated;
        }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:35,代码来源:Argument.cs


示例11: QueryJoinClause

        /// <summary>
        /// Initializes a new instance of the QueryJoinClause class.
        /// </summary>
        /// <param name="tokens">The list of tokens that form the clause.</param>
        /// <param name="rangeVariable">The variable that ranges over the values in the query result.</param>
        /// <param name="inExpression">The expression after the 'in' keyword.</param>
        /// <param name="onKeyExpression">The expression after the 'on' keyword.</param>
        /// <param name="equalsKeyExpression">The expression after the 'equals' keyword.</param>
        /// <param name="intoVariable">The optional variable that the result is placed into.</param>
        internal QueryJoinClause(
            CsTokenList tokens, 
            Variable rangeVariable, 
            Expression inExpression, 
            Expression onKeyExpression,
            Expression equalsKeyExpression,
            Variable intoVariable)
            : base(QueryClauseType.Join, tokens)
        {
            Param.AssertNotNull(tokens, "tokens");
            Param.AssertNotNull(rangeVariable, "rangeVariable");
            Param.AssertNotNull(inExpression, "inExpression");
            Param.AssertNotNull(onKeyExpression, "onKeyExpression");
            Param.AssertNotNull(equalsKeyExpression, "equalsKeyExpression");
            Param.Ignore(intoVariable);

            this.rangeVariable = rangeVariable;
            this.inExpression = inExpression;
            this.onKeyExpression = onKeyExpression;
            this.equalsKeyExpression = equalsKeyExpression;
            this.intoVariable = intoVariable;

            this.AddExpression(this.inExpression);
            this.AddExpression(this.onKeyExpression);
            this.AddExpression(this.equalsKeyExpression);
        }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:35,代码来源:QueryJoinClause.cs


示例12: QueryContinuationClause

 internal QueryContinuationClause(CsTokenList tokens, Microsoft.StyleCop.CSharp.Variable variable, ICollection<QueryClause> clauses)
     : base(QueryClauseType.Continuation, tokens)
 {
     this.variable = variable;
     this.clauses = new CodeUnitCollection<QueryClause>(this);
     this.clauses.AddRange(clauses);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:7,代码来源:QueryContinuationClause.cs


示例13: TypeParameterConstraintClause

 internal TypeParameterConstraintClause(CsTokenList tokens, CsToken type, ICollection<CsToken> constraints)
 {
     this.tokens = tokens;
     this.type = type;
     this.constraints = constraints;
     this.tokens.Trim();
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:7,代码来源:TypeParameterConstraintClause.cs


示例14: ArrayAccessExpression

 internal ArrayAccessExpression(CsTokenList tokens, Expression array, ICollection<Expression> arguments)
     : base(ExpressionType.ArrayAccess, tokens)
 {
     this.array = array;
     this.arguments = arguments;
     base.AddExpression(array);
     base.AddExpressions(arguments);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:8,代码来源:ArrayAccessExpression.cs


示例15: NameofExpression

 /// <summary>
 /// Initializes a new instance of the NameofExpression class.
 /// </summary>
 /// <param name="tokens">
 /// The list of tokens that form the expression.
 /// </param>
 /// <param name="name">
 /// The type literal to get the name of.
 /// </param>
 internal NameofExpression(CsTokenList tokens, Expression name)
     : base(ExpressionType.NameOf, tokens)
 {
     Param.AssertNotNull(tokens, "tokens");
     Param.AssertNotNull(name, "name");
     
     this.AddExpression(name);
 }
开发者ID:transformersprimeabcxyz,项目名称:_TO-FIRST-stylecop,代码行数:17,代码来源:NameofExpression.cs


示例16: MethodInvocationExpression

 internal MethodInvocationExpression(CsTokenList tokens, Expression name, IList<Expression> arguments)
     : base(ExpressionType.MethodInvocation, tokens)
 {
     this.name = name;
     this.arguments = arguments;
     base.AddExpression(name);
     base.AddExpressions(arguments);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:8,代码来源:MethodInvocationExpression.cs


示例17: DoWhileStatement

 internal DoWhileStatement(CsTokenList tokens, Expression conditionExpression, Statement embeddedStatement)
     : base(StatementType.DoWhile, tokens)
 {
     this.conditionExpression = conditionExpression;
     this.embeddedStatement = embeddedStatement;
     base.AddExpression(conditionExpression);
     base.AddStatement(embeddedStatement);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:8,代码来源:DoWhileStatement.cs


示例18: IsExpression

 internal IsExpression(CsTokenList tokens, Expression value, LiteralExpression type)
     : base(ExpressionType.Is, tokens)
 {
     this.value = value;
     this.type = CodeParser.ExtractTypeTokenFromLiteralExpression(type);
     base.AddExpression(value);
     base.AddExpression(type);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:8,代码来源:IsExpression.cs


示例19: NullCoalescingExpression

 internal NullCoalescingExpression(CsTokenList tokens, Expression leftHandSide, Expression rightHandSide)
     : base(ExpressionType.NullCoalescing, tokens)
 {
     this.leftHandSide = leftHandSide;
     this.rightHandSide = rightHandSide;
     base.AddExpression(leftHandSide);
     base.AddExpression(rightHandSide);
 }
开发者ID:katerina-marchenkova,项目名称:my,代码行数:8,代码来源:NullCoalescingExpression.cs


示例20: CollectionInitializerExpression

        /// <summary>
        /// Initializes a new instance of the CollectionInitializerExpression class.
        /// </summary>
        /// <param name="tokens">
        /// The list of tokens that form the expression.
        /// </param>
        /// <param name="initializers">
        /// The list of variable initializers within the 
        /// array initializer expression.
        /// </param>
        internal CollectionInitializerExpression(CsTokenList tokens, IEnumerable<Expression> initializers)
            : base(ExpressionType.CollectionInitializer, tokens)
        {
            Param.AssertNotNull(tokens, "tokens");
            Param.AssertNotNull(initializers, "initializers");

            this.AddExpressions(initializers);
        }
开发者ID:kopelli,项目名称:Visual-StyleCop,代码行数:18,代码来源:CollectionInitializerExpression.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CsdlSemanticsSchema类代码示例发布时间:2022-05-24
下一篇:
C# CsElement类代码示例发布时间: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