C# Class StyleCop.CSharp.CodeParser

The code parser.
Exibir arquivo Open project: Visual-Stylecop/Visual-StyleCop Class Usage Examples

Private Methods

Method Description
AdvanceToClosingGenericSymbol ( int startIndex ) : int
CheckPrecedence ( ExpressionPrecedence previousPrecedence, ExpressionPrecedence nextPrecedence ) : bool

Compares the precedence of the previous expression with the precedence of the next expression, to determine which has the higher precedence value.

ConvertTypeExpression ( Expression expression ) : StyleCop.CSharp.LiteralExpression

Converts the given expression into a literal expression containing a type token.

GetAnonymousMethodExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.AnonymousMethodExpression

Reads an anonymous method from the code.

GetAnonymousTypeInitializerExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.CollectionInitializerExpression

Reads an anonymous type initializer expression from the code.

GetArgumentList ( SymbolType closingSymbol, Reference parentReference, bool unsafeCode ) : IList

Reads the argument list for a method invocation expression.

GetArithmeticExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.ArithmeticExpression

Reads an arithmetic expression.

GetArrayAccessExpression ( Expression array, ExpressionPrecedence previousPrecedence, bool unsafeCode ) : StyleCop.CSharp.ArrayAccessExpression

Reads an array access expression.

GetArrayInitializerExpression ( bool unsafeCode ) : StyleCop.CSharp.ArrayInitializerExpression

Reads an array initializer expression.

GetAsExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.AsExpression

Reads an as expression.

GetAssignmentExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.AssignmentExpression

Reads an assignment expression.

GetAttachedCatchStatement ( StyleCop.CSharp.TryStatement tryStatement, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.CatchStatement

Looks for a catch-statement, and if it is found, parses and returns it.

GetAttachedElseStatement ( Reference parentReference, Statement parentStatement, bool unsafeCode ) : StyleCop.CSharp.ElseStatement

Looks for an else-statement, and if it is found, parses and returns it.

GetAttachedFinallyStatement ( StyleCop.CSharp.TryStatement tryStatement, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.FinallyStatement

Looks for a finally-statement, and if it is found, parses and returns it.

GetAwaitExpression ( Reference parentReference, bool unsafeCode ) : Expression

Reads an await expression from the code.

GetBodiedExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.BodiedExpression

Reads a bodied expression.

GetCastExpression ( bool unsafeCode ) : StyleCop.CSharp.CastExpression

Reads a cast expression.

GetCheckedExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.CheckedExpression

Reads a checked expression from the code.

GetCollectionInitializerExpression ( bool unsafeCode ) : StyleCop.CSharp.CollectionInitializerExpression

Gets a dictionary initializer expression.

GetConditionalExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, bool unsafeCode ) : StyleCop.CSharp.ConditionalExpression

Reads a conditional expression.

GetConditionalLogicalExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.ConditionalLogicalExpression

Reads a conditional logical expression.

GetDefaultValueExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.DefaultValueExpression

Reads a default value expression from the code.

GetDictionaryInitializerExpression ( bool unsafeCode ) : StyleCop.CSharp.DictionaryInitializerExpression

Gets a dictionary initializer expression.

GetDictionaryItemInitialization ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.DictionaryItemInitializationExpression

Gets the dictionary item initialization.

GetExpressionExtension ( Expression leftSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode, bool typeExpression, bool allowVariableDeclaration ) : Expression
GetIsExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.IsExpression

Reads an is expression.

GetLambdaExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.LambdaExpression

Reads a lambda expression.

GetLiteralExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.LiteralExpression

Reads an expression starting with an unknown word.

GetLogicalExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.LogicalExpression

Reads a logical expression.

GetMemberAccessExpression ( Expression leftSide, ExpressionPrecedence previousPrecedence, bool unsafeCode ) : StyleCop.CSharp.MemberAccessExpression

Reads a member access expression.

GetMethodInvocationExpression ( Expression methodName, ExpressionPrecedence previousPrecedence, bool unsafeCode ) : StyleCop.CSharp.MethodInvocationExpression

Reads a method access expression.

GetNameofExpression ( Reference parentReference, bool unsafeCode ) : NameofExpression

Reads a nameof expression from the code.

GetNewAllocationExpression ( Reference parentReference, bool unsafeCode ) : Expression

Reads a new allocation expression from the code.

GetNewAnonymousTypeExpression ( bool unsafeCode, Node firstTokenNode, Reference expressionReference ) : StyleCop.CSharp.NewExpression

Reads a new anonymous type allocation expression from the code.

GetNewArrayTypeExpression ( bool unsafeCode, Node firstTokenNode, Expression type, Reference expressionReference ) : StyleCop.CSharp.NewArrayExpression

Reads a new array allocation expression from the code.

GetNewNonArrayTypeExpression ( bool unsafeCode, Node firstTokenNode, Expression type, Reference expressionReference ) : StyleCop.CSharp.NewExpression

Reads a new non-array type allocation expression from the code.

GetNextExpression ( ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : Expression

Reads the next expression from the file and returns it.

GetNextExpression ( ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode, bool allowVariableDeclaration, bool typeExpression ) : Expression
GetNextStatement ( Reference parentReference, bool unsafeCode ) : Statement

Reads the next statement from the file and returns it.

GetNextStatement ( Reference parentReference, bool unsafeCode, VariableCollection variables ) : Statement
GetNullCoalescingExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.NullCoalescingExpression

Reads a null coalescing expression.

GetNullConditionExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : Expression

Reads a null condition expression from the code.

GetObjectInitializerExpression ( bool unsafeCode ) : StyleCop.CSharp.ObjectInitializerExpression

Gets an object initializer expression.

GetObjectOrCollectionInitializerExpression ( Reference parentReference, bool unsafeCode ) : Expression

Gets an object initializer or collection initializer expression.

GetOpenParenthesisExpression ( ExpressionPrecedence previousPrecedence, bool unsafeCode ) : Expression

Reads an expression beginning with an opening parenthesis.

GetOperatorPrecedence ( OperatorType type ) : ExpressionPrecedence
GetOperatorRightHandExpression ( ExpressionPrecedence precedence, Reference parentReference, bool unsafeCode ) : Expression

Reads and returns the right-hand expression of an operator expression.

GetOtherExpression ( Reference parentReference, bool allowVariableDeclaration, bool unsafeCode ) : Expression

Gets an expression that starts with an unknown word.

GetParenthesizedExpression ( bool unsafeCode ) : StyleCop.CSharp.ParenthesizedExpression

Reads an expression wrapped in parenthesis expression.

GetPrimaryDecrementExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence ) : StyleCop.CSharp.DecrementExpression

Reads a primary decrement expression.

GetPrimaryIncrementExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence ) : StyleCop.CSharp.IncrementExpression

Reads a primary increment expression.

GetQueryContinuationClause ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.QueryContinuationClause

Gets a query continuation clause.

GetQueryExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.QueryExpression

Reads a query expression.

GetQueryExpressionClauses ( Reference parentReference, bool unsafeCode, List clauses, List variables ) : CsTokenList

Gets the collection of query clauses.

GetQueryFromClause ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.QueryFromClause

Gets a query from clause.

GetQueryGroupClause ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.QueryGroupClause

Gets a query group clause.

GetQueryJoinClause ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.QueryJoinClause

Gets a query join clause.

GetQueryLetClause ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.QueryLetClause

Gets a query let clause.

GetQueryOrderByClause ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.QueryOrderByClause

Gets a query order-by clause.

GetQuerySelectClause ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.QuerySelectClause

Gets a query select clause.

GetQueryWhereClause ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.QueryWhereClause

Gets a query where clause.

GetRelationalExpression ( Expression leftHandSide, ExpressionPrecedence previousPrecedence, Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.RelationalExpression

Reads a relational expression.

GetSizeofExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.SizeofExpression

Reads a sizeof expression from the code.

GetStackallocExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.StackallocExpression

Reads a stackalloc expression from the code.

GetTypeofExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.TypeofExpression

Reads a typeof expression from the code.

GetUnaryDecrementExpression ( bool unsafeCode ) : StyleCop.CSharp.DecrementExpression

Reads a unary decrement expression.

GetUnaryExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.UnaryExpression

Reads a unary expression.

GetUnaryIncrementExpression ( bool unsafeCode ) : StyleCop.CSharp.IncrementExpression

Reads a unary increment expression.

GetUncheckedExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.UncheckedExpression

Reads an unchecked expression from the code.

GetUnsafeAccessExpression ( Reference parentReference, bool unsafeCode ) : StyleCop.CSharp.UnsafeAccessExpression

Reads an unsafe access expression.

GetUnsafeTypeExpression ( Expression type, ExpressionPrecedence previousPrecedence, Reference parentReference ) : StyleCop.CSharp.UnsafeAccessExpression

Reads an unsafe type expression.

GetVariableDeclarationExpression ( Expression type, ExpressionPrecedence previousPrecedence, bool unsafeCode ) : StyleCop.CSharp.VariableDeclarationExpression

Reads an expression beginning with two unknown words.

HasTypeSignature ( int startIndex, bool unsafeCode, int &endIndex ) : bool

Checks whether the symbol manager is currently sitting on an expression that looks like a type.

HasTypeSignature ( int startIndex, bool unsafeCode, int &endIndex, bool &generic ) : bool
IsAwaitExpression ( ) : bool

Determines whether the next expression is an 'await' expression.

IsBodiedExpression ( ) : bool

Determines whether the next expression is a bodied expression.

IsCastExpression ( ExpressionPrecedence previousPrecedence, bool unsafeCode ) : bool
IsDelegateExpression ( ) : bool

Determines whether the next expression is a delegate expression, skipping the optional async keyword as required.

IsDereferenceExpression ( Expression leftSide ) : bool

Analyzes the current expression to determine whether it is a dereference expression.

IsDictionaryInitialization ( ) : bool

Determines whether [is dictionary initialization].

IsLambdaExpression ( ) : bool

Determines whether the next expression is a lambda expression.

IsQueryExpression ( bool unsafeCode ) : bool

Determines whether the next expression is a query expression.

IsUnaryExpression ( ) : bool
IsWhenExpression ( ) : bool

Determines whether [is when expression].

MovePastArrayBrackets ( Reference parentReference ) : void

Moves past all array brackets. This assumes that the brackets are part of a new array allocation.

MoveToStatement ( Reference parentReference ) : bool

Moves past whitespace, comments, and preprocessors, up to the start of the next statement.

ParseAwaitStatement ( Reference parentReference, bool unsafeCode ) : AwaitStatement

Reads the next await-statement from the file and returns it.

ParseBlockStatement ( bool unsafeCode ) : BlockStatement

Reads the next block statement from the file and returns it.

ParseBreakStatement ( Reference parentReference ) : BreakStatement

Reads the next break-statement from the file and returns it.

ParseCheckedStatement ( Reference parentReference, bool unsafeCode ) : CheckedStatement

Reads the next checked-statement from the file and returns it.

ParseContinueStatement ( Reference parentReference ) : ContinueStatement

Reads the next continue-statement from the file and returns it.

ParseDoWhileStatement ( Reference parentReference, bool unsafeCode ) : DoWhileStatement

Reads the next do-while-statement from the file and returns it.

ParseExpressionStatement ( bool unsafeCode ) : ExpressionStatement

Reads the next expression statement from the file and returns it.

ParseFixedStatement ( Reference parentReference, bool unsafeCode ) : FixedStatement

Reads the next fixed-statement from the file and returns it.

ParseForStatement ( Reference parentReference, bool unsafeCode ) : ForStatement

Reads the next for-statement from the file and returns it.

ParseForStatementCondition ( Reference statementReference, bool unsafeCode ) : Expression

Parses the condition expression from a for-statement.

ParseForStatementInitializers ( Reference statementReference, bool unsafeCode ) : List

Parses the initializers from a for-statement.

ParseForStatementIterators ( Reference statementReference, bool unsafeCode, Bracket openParenthesis, Node openParenthesisNode ) : List

Parses the iterators from a for-statement.

ParseForeachStatement ( Reference parentReference, bool unsafeCode ) : ForeachStatement

Reads the next foreach statement from the file and returns it.

ParseGotoStatement ( Reference parentReference, bool unsafeCode ) : GotoStatement

Reads the next goto statement from the file and returns it.

ParseIfStatement ( Reference parentReference, bool unsafeCode ) : IfStatement

Reads the next if-statement from the file and returns it.

ParseLabelStatement ( Reference parentReference, bool unsafeCode ) : LabelStatement

Reads a label statement.

ParseLockStatement ( Reference parentReference, bool unsafeCode ) : LockStatement

Reads the next lock-statement from the file and returns it.

ParseOtherStatement ( Reference parentReference, bool unsafeCode, VariableCollection variables ) : Statement

Reads a statement beginning with an unknown word.

ParseReturnStatement ( Reference parentReference, bool unsafeCode ) : ReturnStatement

Reads the next return-statement from the file and returns it.

ParseStatementContainer ( CsElement element, bool interfaceType, bool unsafeCode ) : void

Parses the body of an element that contains a list of statements as children.

ParseStatementScope ( IWriteableCodeUnit parent, Reference parentReference, bool unsafeCode ) : Node

Parses the body of an element that contains a list of statements as children.

ParseSwitchCaseStatement ( Reference parentReference, bool unsafeCode ) : SwitchCaseStatement

Reads the next case-statement from the file and returns it.

ParseSwitchDefaultStatement ( Reference parentReference, bool unsafeCode ) : SwitchDefaultStatement

Reads the next default-statement from the file and returns it.

ParseSwitchStatement ( Reference parentReference, bool unsafeCode ) : SwitchStatement

Reads the next switch-statement from the file and returns it.

ParseSwitchStatementCaseStatements ( Reference statementReference, bool unsafeCode, SwitchDefaultStatement &defaultStatement ) : List

Parses the case and default statements within a switch statement.

ParseThrowStatement ( Reference parentReference, bool unsafeCode ) : ThrowStatement

Reads the next throw-statement from the file and returns it.

ParseTryStatement ( Reference parentReference, bool unsafeCode ) : TryStatement

Reads the next try-statement from the file and returns it.

ParseUncheckedStatement ( Reference parentReference, bool unsafeCode ) : UncheckedStatement

Reads the next unchecked-statement from the file and returns it.

ParseUnsafeStatement ( Reference parentReference ) : UnsafeStatement

Reads the next unsafe-statement from the file and returns it.

ParseUsingStatement ( Reference parentReference, bool unsafeCode ) : UsingStatement

Reads the next using-statement from the file and returns it.

ParseVariableDeclarationStatement ( Reference parentReference, bool unsafeCode, VariableCollection variables ) : VariableDeclarationStatement

Reads the next variable declaration statement from the file and returns it.

ParseWhenStatement ( Reference parentReference, bool unsafeCode ) : Statement

Parses the when statement.

ParseWhileStatement ( Reference parentReference, bool unsafeCode ) : WhileStatement

Reads the next while-statement from the file and returns it.

ParseYieldStatement ( Reference parentReference, bool unsafeCode ) : YieldStatement

Reads the next yield-statement from the file and returns it.

PeekOperatorToken ( Reference parentReference, Reference tokenParent ) : OperatorSymbol

Reads an operator token.