diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-12 07:41:29 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-12 07:41:29 +1000 |
| commit | 94ddc02e03ab942d0c881e29053e8df3d2940c30 (patch) | |
| tree | 4cd91b46b70a29ffd8a8247d68afd97d0852a0ce /Compiler/CCompilerVisitor.cs | |
| parent | 252ad79d05e3805f7a8c990e19dccb373a2c5231 (diff) | |
WIP: added type specification, indexes and hex numerics
Diffstat (limited to 'Compiler/CCompilerVisitor.cs')
| -rw-r--r-- | Compiler/CCompilerVisitor.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Compiler/CCompilerVisitor.cs b/Compiler/CCompilerVisitor.cs index cbfc758..9ffc639 100644 --- a/Compiler/CCompilerVisitor.cs +++ b/Compiler/CCompilerVisitor.cs @@ -268,6 +268,13 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> throw new CompilerException($"Invalid integer value: {valueString}"); } + public override string? VisitHexConstant(CGrammarParser.HexConstantContext context) + { + string valueString = context.HEX().GetText(); + valueString = valueString[2..]; // Remove 0x + return $"${valueString}"; + } + public override string? VisitNotExpression(CGrammarParser.NotExpressionContext context) { string? value = this.Visit(context.expression()); @@ -890,4 +897,10 @@ public class CCompilerVisitor : CGrammarBaseVisitor<string?> } return result; } +} + +public class CType +{ + public string + public int Size; }
\ No newline at end of file |
