summaryrefslogtreecommitdiff
path: root/src/runtime/dotNet/Expr/MetaVariable.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/dotNet/Expr/MetaVariable.cs')
-rw-r--r--src/runtime/dotNet/Expr/MetaVariable.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/runtime/dotNet/Expr/MetaVariable.cs b/src/runtime/dotNet/Expr/MetaVariable.cs
new file mode 100644
index 000000000..30ead9004
--- /dev/null
+++ b/src/runtime/dotNet/Expr/MetaVariable.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace PGFSharp
+{
+ public class MetaVariableExpr : Expr {
+
+ internal MetaVariableExpr() {
+ _pool = new NativeGU.NativeMemoryPool();
+ IntPtr exprMetaPtr = NativeGU.gu_alloc_variant ((byte)PgfExprTag.PGF_EXPR_META,
+ (UIntPtr)Marshal.SizeOf <NativePgfExprMeta>(), UIntPtr.Zero, ref _ptr, _pool.Ptr);
+
+ Native.EditStruct<NativePgfExprMeta> (exprMetaPtr, (ref NativePgfExprMeta m) => m.Id = 0);
+ }
+
+ internal MetaVariableExpr(IntPtr ptr, NativeGU.NativeMemoryPool pool) : base(ptr, pool) { }
+
+
+ public int Id => Data.Id;
+ private NativePgfExprMeta Data => Marshal.PtrToStructure<NativePgfExprMeta>(DataPtr);
+
+ public override R Accept<R> (IVisitor<R> visitor)
+ {
+ // return visitor.VisitMetaVariable (Id);
+
+ // Not supported yet.
+ throw new NotImplementedException();
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ private struct NativePgfExprMeta { public int Id; }
+ }
+}
+