LiteralExpression Class
Represents a literal value expression (numbers, strings, booleans, null, etc.).
public class LiteralExpression : ExpressionExample
var intLiteral = new LiteralExpression(42);
var stringLiteral = new LiteralExpression("Hello");
var boolLiteral = new LiteralExpression(true);
var nullLiteral = new LiteralExpression(null);
Assert.Equal("42", intLiteral.ToCsharpString());
Assert.Equal("\"Hello\"", stringLiteral.ToCsharpString());
Assert.Equal("true", boolLiteral.ToCsharpString());
Assert.Equal("null", nullLiteral.ToCsharpString());- Inheritance
ExpressionLiteralExpression
Constructors
| Name | Description |
|---|---|
| LiteralExpression() | |
| LiteralExpression(object?) | Initializes a new instance of the LiteralExpression class with the specified value. |
LiteralExpression overloads
LiteralExpression()
LiteralExpression.cspublic LiteralExpression()No documentation is available.
LiteralExpression(object?)
LiteralExpression.csInitializes a new instance of the LiteralExpression class with the specified value.
public LiteralExpression(object? value)Parameters
valueobject?- The literal value.
Properties
| Name | Description |
|---|---|
| Value |