summaryrefslogtreecommitdiff
path: root/vala/valasizeofexpression.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2007-05-31 12:33:24 +0000
committerJürg Billeter <juergbi@src.gnome.org>2007-05-31 12:33:24 +0000
commitc9f266a1ab0e66841a67134352027912c8e7cf71 (patch)
tree584cc0e6521936eabc9a9f5f1be309f0a15dee9f /vala/valasizeofexpression.vala
parent04e861211a4b7fed5e8289461e496132693ae96a (diff)
downloadvala-c9f266a1ab0e66841a67134352027912c8e7cf71.tar.gz
support sizeof expression update add struct_size param to GLib.Source
2007-05-31 Jürg Billeter <j@bitron.ch> * vala/scanner.l, vala/parser.y, vala/valasemanticanalyzer.vala, vala/valacodevisitor.vala, vala/valasizeofexpression.vala, gobject/valacodegenerator.vala: support sizeof expression * vala/vala.h, vala/Makefile.am: update * vapi/glib-2.0.vala: add struct_size param to GLib.Source construction method svn path=/trunk/; revision=317
Diffstat (limited to 'vala/valasizeofexpression.vala')
-rw-r--r--vala/valasizeofexpression.vala51
1 files changed, 51 insertions, 0 deletions
diff --git a/vala/valasizeofexpression.vala b/vala/valasizeofexpression.vala
new file mode 100644
index 000000000..b18ea9cb1
--- /dev/null
+++ b/vala/valasizeofexpression.vala
@@ -0,0 +1,51 @@
+/* valasizeofexpression.vala
+ *
+ * Copyright (C) 2006-2007 Jürg Billeter
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Jürg Billeter <j@bitron.ch>
+ */
+
+using GLib;
+
+/**
+ * Represents a sizeof expression in the source code.
+ */
+public class Vala.SizeofExpression : Expression {
+ /**
+ * The type whose size to be retrieved.
+ */
+ public TypeReference! type_reference { get; set construct; }
+
+ /**
+ * Creates a new sizeof expression.
+ *
+ * @param type a data type
+ * @param source reference to source code
+ * @return newly created sizeof expression
+ */
+ public SizeofExpression (TypeReference! type, SourceReference source) {
+ type_reference = type;
+ source_reference = source;
+ }
+
+ public override void accept (CodeVisitor! visitor) {
+ type_reference.accept (visitor);
+
+ visitor.visit_sizeof_expression (this);
+ }
+}