Click or drag to resize

LiteralExpressionSyntax Class



Represents a literal. The kind of literal is determined by the Kind property: IntegerLiteral, CharacterLiteral, BooleanLiteral, DecimalLiteral, FloatingLiteral, DateLiteral or StringLiteral. The value of the literal can be determined by casting the associated Token to the correct type and getting the value from the token.
Inheritance Hierarchy

Namespace:  Microsoft.CodeAnalysis.VisualBasic.Syntax
Assembly:  Microsoft.CodeAnalysis.VisualBasic (in Microsoft.CodeAnalysis.VisualBasic.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public sealed class LiteralExpressionSyntax : ExpressionSyntax

The LiteralExpressionSyntax type exposes the following members.

Properties
  NameDescription
Public propertyContainsAnnotations
Determines whether this node or any sub node, token or trivia has annotations.
(Inherited from SyntaxNode.)
Public propertyContainsDiagnostics
Determines whether this node or any of its descendant nodes, tokens or trivia have any diagnostics on them.
(Inherited from SyntaxNode.)
Public propertyContainsDirectives
Determines whether this node has any descendant preprocessor directives.
(Inherited from SyntaxNode.)
Public propertyContainsSkippedText
Determines whether this node has any descendant skipped text.
(Inherited from SyntaxNode.)
Public propertyFullSpan
The absolute span of this node in characters, including its leading and trailing trivia.
(Inherited from SyntaxNode.)
Public propertyHasLeadingTrivia
Determines whether this node has any leading trivia.
(Inherited from SyntaxNode.)
Public propertyHasStructuredTrivia
Determines whether a descendant trivia of this node is structured.
(Inherited from SyntaxNode.)
Public propertyHasTrailingTrivia
Determines whether this node has any trailing trivia.
(Inherited from SyntaxNode.)
Public propertyIsDirective
Returns True if this node represents a directive.
(Inherited from VisualBasicSyntaxNode.)
Public propertyIsMissing
Determines whether the node represents a language construct that was actually parsed from the source code. Missing nodes are generated by the parser in error scenarios to represent constructs that should have been present in the source code in order to compile successfully but were actually missing.
(Inherited from SyntaxNode.)
Public propertyIsStructuredTrivia
Determines whether this node represents a structured trivia.
(Inherited from SyntaxNode.)
Public propertyLanguage
The language name this node is syntax of.
(Inherited from VisualBasicSyntaxNode.)
Public propertyParent (Inherited from SyntaxNode.)
Public propertyParentTrivia (Inherited from SyntaxNode.)
Public propertyRawKind
An integer representing the language specific kind of this node.
(Inherited from SyntaxNode.)
Public propertySpan
The absolute span of this node in characters, not including its leading and trailing trivia.
(Inherited from SyntaxNode.)
Public propertySpanStart
Same as accessing Start on Span.
(Inherited from VisualBasicSyntaxNode.)
Public propertySyntaxTree
Returns SyntaxTree that owns the node or null if node does not belong to a SyntaxTree
(Inherited from SyntaxNode.)
Public propertyToken
The token that represents the literal. The Kind property determines what type this property returns: Kind=IntegerLiteral ==> Returns IntegerLiteralToken. Kind=CharacterLiteral ==> Returns CharacterLiteralToken. Kind=DecimalLiteral ==> Returns DecimalLiteralToken Kind=FloatingLiteral ==> Returns FloatingLiteralToken Kind=DateLiteral ==> Returns DateLiteralToken Kind=StringLiteral ==> Returns StringLiteralToken Kind=BooleanLiteral ==> Returns Keyword (with it's kind being TrueKeyword or FalseKeyword) Kind=NothingLiteral ==> Returns Keyword (with it's kind being NothingKeyword)
Top
Methods
  NameDescription
Public methodAccept(VisualBasicSyntaxVisitor) (Overrides VisualBasicSyntaxNodeAccept(VisualBasicSyntaxVisitor).)
Public methodAcceptTResult(VisualBasicSyntaxVisitorTResult) (Inherited from VisualBasicSyntaxNode.)
Public methodAcceptTResult(VisualBasicSyntaxVisitorTResult) (Overrides VisualBasicSyntaxNodeAcceptTResult(VisualBasicSyntaxVisitorTResult).)
Public methodAncestors (Inherited from SyntaxNode.)
Public methodAncestorsAndSelf (Inherited from SyntaxNode.)
Public methodChildNodes
Gets a list of the child nodes in prefix document order.
(Inherited from SyntaxNode.)
Public methodChildNodesAndTokens
The list of child nodes and tokens of this node, where each element is a SyntaxNodeOrToken instance.
(Inherited from SyntaxNode.)
Public methodChildThatContainsPosition (Inherited from SyntaxNode.)
Public methodChildTokens
Gets a list of the direct child tokens of this node.
(Inherited from SyntaxNode.)
Public methodContains
Determines if the specified node is a descendant of this node.
(Inherited from SyntaxNode.)
Public methodCopyAnnotationsToT
Copies all SyntaxAnnotations, if any, from this SyntaxNode instance and attaches them to a new instance based on node.
(Inherited from SyntaxNode.)
Public methodDescendantNodes(Void, SyntaxNode) (Inherited from SyntaxNode.)
Public methodDescendantNodes(Void, SyntaxNode, TextSpan) (Inherited from SyntaxNode.)
Public methodDescendantNodesAndSelf(Void, SyntaxNode) (Inherited from SyntaxNode.)
Public methodDescendantNodesAndSelf(Void, SyntaxNode, TextSpan) (Inherited from SyntaxNode.)
Public methodDescendantNodesAndTokens(Void, SyntaxNodeOrToken) (Inherited from SyntaxNode.)
Public methodDescendantNodesAndTokens(Void, SyntaxNodeOrToken, TextSpan) (Inherited from SyntaxNode.)
Public methodDescendantNodesAndTokensAndSelf(Void, SyntaxNodeOrToken) (Inherited from SyntaxNode.)
Public methodDescendantNodesAndTokensAndSelf(Void, SyntaxNodeOrToken, TextSpan) (Inherited from SyntaxNode.)
Public methodDescendantTokens(Void, SyntaxToken) (Inherited from SyntaxNode.)
Public methodDescendantTokens(Void, SyntaxToken, TextSpan) (Inherited from SyntaxNode.)
Public methodDescendantTrivia(Void, SyntaxTrivia) (Inherited from SyntaxNode.)
Public methodDescendantTrivia(Void, SyntaxTrivia, TextSpan) (Inherited from SyntaxNode.)
Public methodFindNode
Finds the node with the smallest FullSpan that contains span. getInnermostNodeForTie is used to determine the behavior in case of a tie (i.e. a node having the same span as its parent). If getInnermostNodeForTie is true, then it returns lowest descending node encompassing the given span. Otherwise, it returns the outermost node encompassing the given span.
(Inherited from SyntaxNode.)
Public methodFindToken
Finds a token according to the following rules: 1) If position matches the End of the node's Span, then its last token is returned. 2) If node.FullSpan.Contains(position) then the token that contains given position is returned. 3) Otherwise an IndexOutOfRange is thrown
(Inherited from VisualBasicSyntaxNode.)
Public methodFindTrivia(Int32, FuncT, TResult) (Inherited from SyntaxNode.)
Public methodFindTrivia(Int32, Boolean) (Inherited from VisualBasicSyntaxNode.)
Public methodFirstAncestorOrSelfTNode (Inherited from SyntaxNode.)
Public methodGetAnnotatedNodes(Void) (Inherited from SyntaxNode.)
Public methodGetAnnotatedNodesAndTokens(Void) (Inherited from SyntaxNode.)
Public methodGetAnnotatedTokens(Void) (Inherited from SyntaxNode.)
Public methodGetAnnotatedTrivia(Void) (Inherited from SyntaxNode.)
Public methodGetAnnotations(Void) (Inherited from SyntaxNode.)
Public methodGetDiagnostics
Gets a list of all the diagnostics in the sub tree that has this node as its root. This method does not filter diagnostics based on compiler options like nowarn, warnaserror etc.
(Inherited from VisualBasicSyntaxNode.)
Public methodGetDirectives (Inherited from VisualBasicSyntaxNode.)
Public methodGetFirstDirective (Inherited from VisualBasicSyntaxNode.)
Public methodGetFirstToken (Inherited from VisualBasicSyntaxNode.)
Public methodGetLastDirective (Inherited from VisualBasicSyntaxNode.)
Public methodGetLastToken (Inherited from VisualBasicSyntaxNode.)
Public methodGetLeadingTrivia
Get the preceding trivia nodes of this node. If this node is a token, returns the preceding trivia associated with this node. If this is a non-terminal, returns the preceding trivia of the first token of this node.
(Inherited from VisualBasicSyntaxNode.)
Public methodGetLocation
Gets the location of this node.
(Inherited from VisualBasicSyntaxNode.)
Public methodGetReference
Gets a SyntaxReference for this syntax node. CommonSyntaxReferences can be used to regain access to a syntax node without keeping the entire tree and source text in memory.
(Inherited from SyntaxNode.)
Public methodGetText
Gets the full text of this node as an new SourceText instance.
(Inherited from SyntaxNode.)
Public methodGetTrailingTrivia
Get the following trivia nodes of this node. If this node is a token, returns the following trivia associated with this node. If this is a non-terminal, returns the following trivia of the last token of this node.
(Inherited from VisualBasicSyntaxNode.)
Public methodHasAnnotation
Determines whether this node has the specific annotation.
(Inherited from SyntaxNode.)
Public methodHasAnnotations(IEnumerableT) (Inherited from SyntaxNode.)
Public methodHasAnnotations(String)
Determines whether this node has any annotations with the specific annotation kind.
(Inherited from SyntaxNode.)
Public methodIsEquivalentTo(SyntaxNode)
Determine whether this node is structurally equivalent to another.
(Inherited from SyntaxNode.)
Public methodIsEquivalentTo(SyntaxNode, Boolean)
Determines if two nodes are the same, disregarding trivia differences.
(Inherited from SyntaxNode.)
Public methodIsPartOfStructuredTrivia
Determines whether this node is a descendant of a structured trivia.
(Inherited from SyntaxNode.)
Public methodKind
Returns the SyntaxKind of the node.
(Inherited from VisualBasicSyntaxNode.)
Public methodSerializeTo (Inherited from SyntaxNode.)
Public methodToFullString
Returns full string representation of this node including its leading and trailing trivia.
(Inherited from SyntaxNode.)
Public methodToString
Returns the string representation of this node, not including its leading and trailing trivia.
(Inherited from SyntaxNode.)
Public methodUpdate
Returns a copy of this with the specified changes. Returns this instance if there are no actual changes.
Public methodWithToken
Returns a copy of this with the Token property changed to the specified value. Returns this instance if the specified value is the same as the current value.
Public methodWriteTo
Writes the full text of this node to the specified TextWriter.
(Inherited from SyntaxNode.)
Top
Extension Methods
  NameDescription
Public Extension MethodGetCurrentNodeTNode
Gets the node within the subtree corresponding to the original tracked node. Use TrackNodes to start tracking nodes.
(Defined by SyntaxNodeExtensions.)
Public Extension MethodGetFirstDirective(FuncT, TResult)Overloaded. (Defined by VisualBasicExtensions.)
Public Extension MethodGetFirstDirective(FuncT, TResult)Overloaded. (Defined by CSharpExtensions.)
Public Extension MethodGetLastDirective(FuncT, TResult)Overloaded. (Defined by VisualBasicExtensions.)
Public Extension MethodGetLastDirective(FuncT, TResult)Overloaded. (Defined by CSharpExtensions.)
Public Extension MethodIsKind(SyntaxKind)Overloaded.
Determines if SyntaxNode is a specified kind.
(Defined by VisualBasicExtensions.)
Public Extension MethodIsKind(SyntaxKind)Overloaded. (Defined by CSharpExtensions.)
Public Extension MethodKindOverloaded.
Returns SyntaxKind for SyntaxNode from RawKind property.
(Defined by VisualBasicExtensions.)
Public Extension MethodKindOverloaded. (Defined by CSharpExtensions.)
Top
See Also