本文整理汇总了C#中CsTokenList类的典型用法代码示例。如果您正苦于以下问题:C# CsTokenList类的具体用法?C# CsTokenList怎么用?C# CsTokenList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CsTokenList类属于命名空间,在下文中一共展示了CsTokenList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: VariableDeclarationStatement
internal VariableDeclarationStatement(CsTokenList tokens, bool constant, VariableDeclarationExpression expression)
: base(StatementType.VariableDeclaration, tokens)
{
this.constant = constant;
this.expression = expression;
base.AddExpression(expression);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例7: UnsafeAccessExpression
internal UnsafeAccessExpression(CsTokenList tokens, Operator operatorType, Expression value)
: base(ExpressionType.UnsafeAccess, tokens)
{
this.operatorType = operatorType;
this.value = value;
base.AddExpression(value);
}
示例8: IncrementExpression
internal IncrementExpression(CsTokenList tokens, Expression value, IncrementType incrementType)
: base(ExpressionType.Increment, tokens)
{
this.value = value;
this.incrementType = incrementType;
base.AddExpression(value);
}
示例9: DecrementExpression
internal DecrementExpression(CsTokenList tokens, Expression value, DecrementType decrementType)
: base(ExpressionType.Decrement, tokens)
{
this.value = value;
this.decrementType = decrementType;
base.AddExpression(value);
}
示例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;
}
示例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);
}
示例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);
}
示例13: TypeParameterConstraintClause
internal TypeParameterConstraintClause(CsTokenList tokens, CsToken type, ICollection<CsToken> constraints)
{
this.tokens = tokens;
this.type = type;
this.constraints = constraints;
this.tokens.Trim();
}
示例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);
}
示例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);
}