Skip to content

Commit 5559ef4

Browse files
committed
Added support for values in more literal expressions.
1 parent 8bf27c4 commit 5559ef4

File tree

14 files changed

+287
-19
lines changed

14 files changed

+287
-19
lines changed

src/AST/Expr.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ public IntegerLiteral()
434434
}
435435

436436
public SourceLocation Location;
437+
public ulong Value;
437438
}
438439

439440
public partial class FixedPointLiteral : Expr
@@ -443,6 +444,7 @@ public FixedPointLiteral()
443444
}
444445

445446
public SourceLocation Location;
447+
public ulong Value;
446448
}
447449

448450
public partial class CharacterLiteral : Expr

src/CppParser/Bindings/CLI/Expr.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,16 @@ void CppSharp::Parser::AST::IntegerLiteral::Location::set(CppSharp::Parser::Sour
636636
((::CppSharp::CppParser::AST::IntegerLiteral*)NativePtr)->location = _marshal0;
637637
}
638638

639+
unsigned long long CppSharp::Parser::AST::IntegerLiteral::Value::get()
640+
{
641+
return ((::CppSharp::CppParser::AST::IntegerLiteral*)NativePtr)->value;
642+
}
643+
644+
void CppSharp::Parser::AST::IntegerLiteral::Value::set(unsigned long long value)
645+
{
646+
((::CppSharp::CppParser::AST::IntegerLiteral*)NativePtr)->value = value;
647+
}
648+
639649
CppSharp::Parser::AST::FixedPointLiteral::FixedPointLiteral(::CppSharp::CppParser::AST::FixedPointLiteral* native)
640650
: CppSharp::Parser::AST::Expr((::CppSharp::CppParser::AST::Expr*)native)
641651
{
@@ -679,6 +689,16 @@ void CppSharp::Parser::AST::FixedPointLiteral::Location::set(CppSharp::Parser::S
679689
((::CppSharp::CppParser::AST::FixedPointLiteral*)NativePtr)->location = _marshal0;
680690
}
681691

692+
unsigned long long CppSharp::Parser::AST::FixedPointLiteral::Value::get()
693+
{
694+
return ((::CppSharp::CppParser::AST::FixedPointLiteral*)NativePtr)->value;
695+
}
696+
697+
void CppSharp::Parser::AST::FixedPointLiteral::Value::set(unsigned long long value)
698+
{
699+
((::CppSharp::CppParser::AST::FixedPointLiteral*)NativePtr)->value = value;
700+
}
701+
682702
CppSharp::Parser::AST::CharacterLiteral::CharacterLiteral(::CppSharp::CppParser::AST::CharacterLiteral* native)
683703
: CppSharp::Parser::AST::Expr((::CppSharp::CppParser::AST::Expr*)native)
684704
{

src/CppParser/Bindings/CLI/Expr.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,12 @@ namespace CppSharp
741741
CppSharp::Parser::SourceLocation get();
742742
void set(CppSharp::Parser::SourceLocation);
743743
}
744+
745+
property unsigned long long Value
746+
{
747+
unsigned long long get();
748+
void set(unsigned long long);
749+
}
744750
};
745751

746752
public ref class FixedPointLiteral : CppSharp::Parser::AST::Expr
@@ -760,6 +766,12 @@ namespace CppSharp
760766
CppSharp::Parser::SourceLocation get();
761767
void set(CppSharp::Parser::SourceLocation);
762768
}
769+
770+
property unsigned long long Value
771+
{
772+
unsigned long long get();
773+
void set(unsigned long long);
774+
}
763775
};
764776

765777
public ref class CharacterLiteral : CppSharp::Parser::AST::Expr

src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24832,7 +24832,7 @@ public bool RefersToEnclosingVariableOrCapture
2483224832

2483324833
public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable
2483424834
{
24835-
[StructLayout(LayoutKind.Explicit, Size = 44)]
24835+
[StructLayout(LayoutKind.Explicit, Size = 52)]
2483624836
public new partial struct __Internal
2483724837
{
2483824838
[FieldOffset(0)]
@@ -24880,6 +24880,9 @@ public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, I
2488024880
[FieldOffset(40)]
2488124881
internal global::CppSharp.Parser.SourceLocation.__Internal location;
2488224882

24883+
[FieldOffset(44)]
24884+
internal ulong value;
24885+
2488324886
[SuppressUnmanagedCodeSecurity]
2488424887
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
2488524888
EntryPoint="_ZN8CppSharp9CppParser3AST14IntegerLiteralC2Ev")]
@@ -24954,11 +24957,24 @@ public IntegerLiteral(global::CppSharp.Parser.AST.IntegerLiteral _0)
2495424957
((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance;
2495524958
}
2495624959
}
24960+
24961+
public ulong Value
24962+
{
24963+
get
24964+
{
24965+
return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value;
24966+
}
24967+
24968+
set
24969+
{
24970+
((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value;
24971+
}
24972+
}
2495724973
}
2495824974

2495924975
public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable
2496024976
{
24961-
[StructLayout(LayoutKind.Explicit, Size = 44)]
24977+
[StructLayout(LayoutKind.Explicit, Size = 52)]
2496224978
public new partial struct __Internal
2496324979
{
2496424980
[FieldOffset(0)]
@@ -25006,6 +25022,9 @@ public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr
2500625022
[FieldOffset(40)]
2500725023
internal global::CppSharp.Parser.SourceLocation.__Internal location;
2500825024

25025+
[FieldOffset(44)]
25026+
internal ulong value;
25027+
2500925028
[SuppressUnmanagedCodeSecurity]
2501025029
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
2501125030
EntryPoint="_ZN8CppSharp9CppParser3AST17FixedPointLiteralC2Ev")]
@@ -25080,6 +25099,19 @@ public FixedPointLiteral(global::CppSharp.Parser.AST.FixedPointLiteral _0)
2508025099
((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance;
2508125100
}
2508225101
}
25102+
25103+
public ulong Value
25104+
{
25105+
get
25106+
{
25107+
return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value;
25108+
}
25109+
25110+
set
25111+
{
25112+
((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value;
25113+
}
25114+
}
2508325115
}
2508425116

2508525117
public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable

src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24832,7 +24832,7 @@ public bool RefersToEnclosingVariableOrCapture
2483224832

2483324833
public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable
2483424834
{
24835-
[StructLayout(LayoutKind.Explicit, Size = 44)]
24835+
[StructLayout(LayoutKind.Explicit, Size = 56)]
2483624836
public new partial struct __Internal
2483724837
{
2483824838
[FieldOffset(0)]
@@ -24880,6 +24880,9 @@ public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, I
2488024880
[FieldOffset(40)]
2488124881
internal global::CppSharp.Parser.SourceLocation.__Internal location;
2488224882

24883+
[FieldOffset(48)]
24884+
internal ulong value;
24885+
2488324886
[SuppressUnmanagedCodeSecurity]
2488424887
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
2488524888
EntryPoint="??0IntegerLiteral@AST@CppParser@CppSharp@@QAE@XZ")]
@@ -24954,11 +24957,24 @@ public IntegerLiteral(global::CppSharp.Parser.AST.IntegerLiteral _0)
2495424957
((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance;
2495524958
}
2495624959
}
24960+
24961+
public ulong Value
24962+
{
24963+
get
24964+
{
24965+
return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value;
24966+
}
24967+
24968+
set
24969+
{
24970+
((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value;
24971+
}
24972+
}
2495724973
}
2495824974

2495924975
public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable
2496024976
{
24961-
[StructLayout(LayoutKind.Explicit, Size = 44)]
24977+
[StructLayout(LayoutKind.Explicit, Size = 56)]
2496224978
public new partial struct __Internal
2496324979
{
2496424980
[FieldOffset(0)]
@@ -25006,6 +25022,9 @@ public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr
2500625022
[FieldOffset(40)]
2500725023
internal global::CppSharp.Parser.SourceLocation.__Internal location;
2500825024

25025+
[FieldOffset(48)]
25026+
internal ulong value;
25027+
2500925028
[SuppressUnmanagedCodeSecurity]
2501025029
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
2501125030
EntryPoint="??0FixedPointLiteral@AST@CppParser@CppSharp@@QAE@XZ")]
@@ -25080,6 +25099,19 @@ public FixedPointLiteral(global::CppSharp.Parser.AST.FixedPointLiteral _0)
2508025099
((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance;
2508125100
}
2508225101
}
25102+
25103+
public ulong Value
25104+
{
25105+
get
25106+
{
25107+
return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value;
25108+
}
25109+
25110+
set
25111+
{
25112+
((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value;
25113+
}
25114+
}
2508325115
}
2508425116

2508525117
public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable

src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24831,7 +24831,7 @@ public bool RefersToEnclosingVariableOrCapture
2483124831

2483224832
public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable
2483324833
{
24834-
[StructLayout(LayoutKind.Explicit, Size = 56)]
24834+
[StructLayout(LayoutKind.Explicit, Size = 64)]
2483524835
public new partial struct __Internal
2483624836
{
2483724837
[FieldOffset(0)]
@@ -24879,6 +24879,9 @@ public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, I
2487924879
[FieldOffset(48)]
2488024880
internal global::CppSharp.Parser.SourceLocation.__Internal location;
2488124881

24882+
[FieldOffset(56)]
24883+
internal ulong value;
24884+
2488224885
[SuppressUnmanagedCodeSecurity]
2488324886
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
2488424887
EntryPoint="_ZN8CppSharp9CppParser3AST14IntegerLiteralC2Ev")]
@@ -24953,11 +24956,24 @@ public IntegerLiteral(global::CppSharp.Parser.AST.IntegerLiteral _0)
2495324956
((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance;
2495424957
}
2495524958
}
24959+
24960+
public ulong Value
24961+
{
24962+
get
24963+
{
24964+
return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value;
24965+
}
24966+
24967+
set
24968+
{
24969+
((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value;
24970+
}
24971+
}
2495624972
}
2495724973

2495824974
public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable
2495924975
{
24960-
[StructLayout(LayoutKind.Explicit, Size = 56)]
24976+
[StructLayout(LayoutKind.Explicit, Size = 64)]
2496124977
public new partial struct __Internal
2496224978
{
2496324979
[FieldOffset(0)]
@@ -25005,6 +25021,9 @@ public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr
2500525021
[FieldOffset(48)]
2500625022
internal global::CppSharp.Parser.SourceLocation.__Internal location;
2500725023

25024+
[FieldOffset(56)]
25025+
internal ulong value;
25026+
2500825027
[SuppressUnmanagedCodeSecurity]
2500925028
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
2501025029
EntryPoint="_ZN8CppSharp9CppParser3AST17FixedPointLiteralC2Ev")]
@@ -25079,6 +25098,19 @@ public FixedPointLiteral(global::CppSharp.Parser.AST.FixedPointLiteral _0)
2507925098
((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance;
2508025099
}
2508125100
}
25101+
25102+
public ulong Value
25103+
{
25104+
get
25105+
{
25106+
return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value;
25107+
}
25108+
25109+
set
25110+
{
25111+
((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value;
25112+
}
25113+
}
2508225114
}
2508325115

2508425116
public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable

src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24831,7 +24831,7 @@ public bool RefersToEnclosingVariableOrCapture
2483124831

2483224832
public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable
2483324833
{
24834-
[StructLayout(LayoutKind.Explicit, Size = 56)]
24834+
[StructLayout(LayoutKind.Explicit, Size = 64)]
2483524835
public new partial struct __Internal
2483624836
{
2483724837
[FieldOffset(0)]
@@ -24879,6 +24879,9 @@ public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, I
2487924879
[FieldOffset(48)]
2488024880
internal global::CppSharp.Parser.SourceLocation.__Internal location;
2488124881

24882+
[FieldOffset(56)]
24883+
internal ulong value;
24884+
2488224885
[SuppressUnmanagedCodeSecurity]
2488324886
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
2488424887
EntryPoint="_ZN8CppSharp9CppParser3AST14IntegerLiteralC2Ev")]
@@ -24953,11 +24956,24 @@ public IntegerLiteral(global::CppSharp.Parser.AST.IntegerLiteral _0)
2495324956
((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance;
2495424957
}
2495524958
}
24959+
24960+
public ulong Value
24961+
{
24962+
get
24963+
{
24964+
return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value;
24965+
}
24966+
24967+
set
24968+
{
24969+
((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value;
24970+
}
24971+
}
2495624972
}
2495724973

2495824974
public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable
2495924975
{
24960-
[StructLayout(LayoutKind.Explicit, Size = 56)]
24976+
[StructLayout(LayoutKind.Explicit, Size = 64)]
2496124977
public new partial struct __Internal
2496224978
{
2496324979
[FieldOffset(0)]
@@ -25005,6 +25021,9 @@ public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr
2500525021
[FieldOffset(48)]
2500625022
internal global::CppSharp.Parser.SourceLocation.__Internal location;
2500725023

25024+
[FieldOffset(56)]
25025+
internal ulong value;
25026+
2500825027
[SuppressUnmanagedCodeSecurity]
2500925028
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
2501025029
EntryPoint="_ZN8CppSharp9CppParser3AST17FixedPointLiteralC2Ev")]
@@ -25079,6 +25098,19 @@ public FixedPointLiteral(global::CppSharp.Parser.AST.FixedPointLiteral _0)
2507925098
((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance;
2508025099
}
2508125100
}
25101+
25102+
public ulong Value
25103+
{
25104+
get
25105+
{
25106+
return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value;
25107+
}
25108+
25109+
set
25110+
{
25111+
((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value;
25112+
}
25113+
}
2508225114
}
2508325115

2508425116
public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable

0 commit comments

Comments
 (0)