Parser Class |
Namespace: Nova.Parsing
public class Parser : IDisposable
The Parser type exposes the following members.
Name | Description | |
---|---|---|
Char |
The next character to be processed.
| |
CurrentConditionalDirectiveState |
Get the current conditional directive state.
| |
HasNestedPeekedTypeArguments |
Return true if the parser has multiple nested peek-ahead type argument lists in progress.
| |
HasUnused |
Returns true if there are any Unused items.
| |
HasUnusedExpression |
Returns true if the last Unused item is a valid Expression or a token that is an identifier.
| |
HasUnusedExpressionNonDirective |
Returns true if the last Unused item is a valid Expression or a token that is an identifier,
skipping over any compiler directives if a non-compiler directive exists.
| |
HasUnusedIdentifier |
Returns true if the last Unused item is a Token which is an Identifier.
| |
HasUnusedModifiersOnly |
Return true if the unused items are all modifiers (or annotations).
| |
HasUnusedToken |
Returns true if the last Unused item is a Token.
| |
HasUnusedTypeRef |
Return true if the last unused item is a TypeRef or possible TypeRef.
| |
HasUnusedTypeRefAndExpression |
Return true if the last 2 unused items are a TypeRef or possible TypeRef followed by an Expression.
| |
HasUnusedTypeRefAndExpressionNonDirective |
Return true if the last 2 unused items are a TypeRef or possible TypeRef followed by an Expression,
skipping over any compiler directives.
| |
HasUnusedTypeRefAndIdentifier |
Return true if the last 2 unused items are a TypeRef or possible TypeRef followed by an identifier.
| |
InDocComment |
True if parsing a documentation comment.
| |
InEmbeddedExpression |
True if parsing an embedded expression (such as inside an interpolated string).
| |
IsGenerated |
True if parsing a generated file (such as '.g.cs' or '.Designer.cs'). Formatting and code cleanup settings will be ignored.
| |
IsGeneratedRegion |
True if parsing a region of generated code (such as code from the MS Component Designer). Formatting and code cleanup settings will be ignored.
| |
LastPeekedToken |
Get the last token that was returned by PeekNextToken().
| |
LastPeekedTokenText |
Get the text of the last token that was returned by PeekNextToken().
| |
LastUnused |
Get the last parsed object in the Unused list (Token or UnusedCodeObject).
| |
LastUnusedCodeObject |
Get the last parsed object in the Unused list as a CodeObject (null if none, or not an UnusedCodeObject).
| |
LastUnusedToken |
Get the last parsed object in the Unused list as a Token (null if none, or not a Token).
| |
LastUnusedTokenText |
Get the text of the last parsed object in the Unused list as a Token (null if none).
| |
PeekChar |
The character after the next character to be processed.
| |
Token |
The current token.
| |
TokenLineNumber |
Get the line number of the current token.
|
Name | Description | |
---|---|---|
AddCompilerDirectiveParsePoint |
Add a parse-point for a compiler directive - triggers the callback when the specified token appears after the '#'.
| |
AddDocCommentParseTag |
Add a documentation comment tag for callback during parsing.
| |
AddOperatorParsePoint(String, Int32, Boolean, Boolean, ParserParseDelegate) |
Add a parse-point to the parser for an operator - the callback is triggered when the token is found.
| |
AddOperatorParsePoint(String, Int32, Int32, Boolean, Boolean, ParserParseDelegate, Type) |
Add a parse-point to the parser for an operator - the callback is triggered when the token appears in the specified context.
| |
AddParsePoint(String, ParserParseDelegate) |
Add a parse-point to the parser - the callback is triggered when the token is found.
| |
AddParsePoint(String, ParserParseDelegate, Type) |
Add a parse-point to the parser - the callback is triggered when the token appears in the specified context.
| |
AddParsePoint(String, Int32, ParserParseDelegate) |
Add a parse-point to the parser - the callback is triggered when the token is found.
| |
AddParsePoint(String, Int32, ParserParseDelegate, Type) |
Add a parse-point to the parser - the callback is triggered when the token appears in the specified context.
| |
AddUnused(CodeObject) |
Add a code object that was just parsed but not yet needed to the unused list.
| |
AddUnused(Token) |
Add a token that was just parsed but not yet needed to the unused list.
| |
AttachMessage |
Create a parser error message in connection with the specified Token and attach it to the related CodeObject.
| |
CheckForUnusedTypeRef |
Check that there appears to be an unused identifier, TypeRef, or UnresolvedRef at the specified offset.
| |
CurrentTokenIndentedLessThan |
Determine if the current token is indented less than the specified starting token.
| |
Dispose | Releases all resources used by the Parser | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetCurrentLine |
Get the current line of text including the EOL character.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetIdentifier |
Get the current token if it's an identifier, otherwise return null; also, advance to the next token.
| |
GetIdentifierText |
Get the text of the current token if it's an identifier, otherwise return null; also, advance to the next token.
Does NOT return the '@' verbatim prefix if there was one.
| |
GetLastPeekedTokenText |
Get the previously peeked token text at the specified index (-1 is the last peeked token, -2 the one before that, etc).
| |
GetLastUnusedNonDirective |
Get the last parsed object in the Unused list (Token or UnusedCodeObject),
skipping over any compiler directives if a non-compiler directive exists.
| |
GetNormalizationBlocker |
Get the current normalization blocker object.
| |
GetOperatorInfoForToken |
Get the OperatorInfo structure for the current token.
| |
GetToDelimiter |
Parse from just after the current token up to (but not including) the specified delimiter, returning that as a string, and
advancing to the delimiter as the next token. Stops just short of EOL if the delimiter isn't found.
If the optional 'abortDelimiter' is non-zero, the string extraction will stop if it is encountered.
| |
GetTokenToEOL |
Parse from the current token up to (but not including) the EOL, returning that as a string, and advancing to the next token.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetUnused |
Get the object in the Unused list at the specified index.
| |
GetUnusedCodeObject |
Get the object in the Unused list at the specified index as a CodeObject.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
MergeTokens |
Merge the specified 2nd token into the first one.
| |
MoveCommentsToPostUnused |
Move any non-EOL comments we just passed to the Post unused list.
| |
MoveCommentsToUnused |
Move any non-EOL comments we just passed to the unused list.
| |
MovePostUnusedToUnused |
Move the current post-unused list to the unused list.
| |
MoveUnusedToPostUnused |
Move the current unused list to the post-unused list.
| |
NextChar | ||
NextToken |
Get the next token, skipping comments (which are attached to the last token).
| |
NextToken(Boolean) |
Get the next token, optionally including comments.
| |
NextTokenSameLine |
Get the next token on the same line (including comments). Returns null if none.
| |
ParseCharLiteral | ||
ParseCodeBlockUntil |
Parse an embedded code block inside a documentation comment, starting with the current token, and parsing
up to the specified delimiter.
| |
ParseCodeExpressionUntil |
Parse an embedded code expression inside a documentation comment, starting with the current token, and parsing
up to the specified delimiter.
| |
ParseEmbeddedExpressionUntil |
Parse an embedded expression (such as inside an interpolated string), starting with the current token, and
parsing up to the specified delimiter(s).
| |
ParseInterpolatedString | ||
ParseInterpolatedVerbatimString | ||
ParseNextToken | ||
ParseString | ||
ParseVerbatimString | ||
PeekNextToken |
Peek ahead at the next unparsed token, skipping comments.
Peek-ahead tokens are saved in a special queue so they are still processed by NextToken().
Returns null on EOF or if a compiler directive ('#') is encountered.
| |
PeekNextTokenText |
Peek at the next token, and return the text (avoids a null ref check).
| |
PopNormalizationBlocker |
Pop the last normalization blocker object.
| |
PopUnusedList |
Restore the previous Unused list.
| |
ProcessToken |
Process the current token using the specified flags, returning a CodeObject if successful,
otherwise returns null and the unrecognized token is saved in the Unused list for later.
| |
ProcessTrailingComments | ||
PushNormalizationBlocker |
Push an object that will block EOL comment bubble-up normalization.
| |
PushUnusedList |
Push the current Unused list.
| |
RemoveLastUnused |
Remove the last object from the Unused list.
| |
RemoveLastUnusedExpression |
Remove the last object from the Unused list, converted to an Expression.
Does NOT remove tokens that aren't valid identifiers.
| |
RemoveLastUnusedExpression(Boolean) |
Remove the last object from the Unused list, converted to an Expression.
| |
RemoveLastUnusedToken |
Remove the last object from the Unused list, IF it's a Token.
| |
ResetPeekAhead |
Reset the peek ahead queue index.
| |
SaveAndNextToken |
Save the current token in the Unused list, and get the next one.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TrackConditionalDirective |
Track multi-part compiler directives.
| |
TrackEndRegionDirective |
Track an EndRegionDirective, returning any related RegionDirective.
| |
TrackRegionDirective |
Track a RegionDirective.
| |
Unpeek |
Unpeek the specified number of tokens.
| |
UsingMoreTabsThanSpaces |
Returns true if more lines in the parsed file start with tabs than spaces.
|
Name | Description | |
---|---|---|
_ch | ||
_conditionalNestingLevelStack | ||
_isSLOC | ||
_length | ||
_line | ||
_linesWithSpaces | ||
_linesWithTabs | ||
_normalizationBlockerStack | ||
_peekAheadIndex | ||
_peekAheadTokens | ||
_pk | ||
_pos | ||
_previous | ||
_start | ||
_startLine | ||
_textReader | ||
_token | ||
_unusedListStack | ||
_wasEscaped | ||
CodeUnit |
The CodeUnit being parsed.
| |
ConditionalNestingLevel |
The current nesting level if parsing the '?' clause of a Conditional expression.
| |
InDirectiveExpression |
True if parsing a compiler directive expression.
| |
LastToken |
The last token.
| |
LineNumber |
The current line number.
| |
ParentStartingToken |
The starting token of the last parent code object.
| |
ParseFlags |
Global parsing flags.
| |
PostUnused |
Special-case Unused objects after the current code object instead of before it.
| |
SingleUnusedIdentifierParser |
Delegate for parsing single unused identifiers in Blocks (used for EnumDecls).
| |
SkipToken |
Special object used to skip processing of a token.
| |
SLOC |
SLOC count: Lines with other than blanks, comments, symbols (such as braces).
| |
TerminatingKeywords |
Optional keywords that should terminate the current parsing if encountered
(used for things such as context-sensitive keywords within LINQ queries).
| |
TokenText |
The text of the current token (null if none).
| |
TokenType |
The type of the current token (None if none).
| |
Unused |
Unused tokens or code objects in the current active scope.
|