Partilhar via


SyntaxFactory.LiteralExpression(SyntaxKind, SyntaxToken) Método

Definição

Representa um literal. O tipo de literal é determinado pela propriedade Kind: IntegerLiteral, CharacterLiteral, BooleanLiteral, DecimalLiteral, FloatingLiteral, DateLiteral ou StringLiteral. O valor do literal pode ser determinado convertendo o Token associado para o tipo correto e obtendo o valor do token.

public:
 static Microsoft::CodeAnalysis::VisualBasic::Syntax::LiteralExpressionSyntax ^ LiteralExpression(Microsoft::CodeAnalysis::VisualBasic::SyntaxKind kind, Microsoft::CodeAnalysis::SyntaxToken token);
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.LiteralExpressionSyntax LiteralExpression (Microsoft.CodeAnalysis.VisualBasic.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxToken token);
static member LiteralExpression : Microsoft.CodeAnalysis.VisualBasic.SyntaxKind * Microsoft.CodeAnalysis.SyntaxToken -> Microsoft.CodeAnalysis.VisualBasic.Syntax.LiteralExpressionSyntax
Public Shared Function LiteralExpression (kind As SyntaxKind, token As SyntaxToken) As LiteralExpressionSyntax

Parâmetros

kind
SyntaxKind

Um SyntaxKind que representa o tipo específico de LiteralExpressionSyntax. Um de CharacterLiteralExpression, TrueLiteralExpression, FalseLiteralExpression, NumericLiteralExpression, DateLiteralExpression, StringLiteralExpression, NothingLiteralExpression.

token
SyntaxToken

O token que representa o literal. A propriedade Kind determina que tipo essa propriedade retorna: Kind=IntegerLiteral ==> Retorna IntegerLiteralToken. Kind=CharacterLiteral ==> Retorna 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)

Retornos

Aplica-se a