1 /* valaliteral.c generated by valac, the Vala compiler
2 * generated from valaliteral.vala, do not modify */
3
4 /* valaliteral.vala
5 *
6 * Copyright (C) 2006-2008 Jürg Billeter
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 *
22 * Author:
23 * Jürg Billeter <j@bitron.ch>
24 */
25
26 #include "vala.h"
27 #include <glib.h>
28
29 static gpointer vala_literal_parent_class = NULL;
30
31 static gboolean vala_literal_real_is_constant (ValaExpression* base);
32 static gboolean vala_literal_real_is_pure (ValaExpression* base);
33 static GType vala_literal_get_type_once (void);
34
35 static gboolean
vala_literal_real_is_constant(ValaExpression * base)36 vala_literal_real_is_constant (ValaExpression* base)
37 {
38 ValaLiteral * self;
39 gboolean result = FALSE;
40 self = (ValaLiteral*) base;
41 result = TRUE;
42 return result;
43 }
44
45 static gboolean
vala_literal_real_is_pure(ValaExpression * base)46 vala_literal_real_is_pure (ValaExpression* base)
47 {
48 ValaLiteral * self;
49 gboolean result = FALSE;
50 self = (ValaLiteral*) base;
51 result = TRUE;
52 return result;
53 }
54
55 ValaLiteral*
vala_literal_construct(GType object_type)56 vala_literal_construct (GType object_type)
57 {
58 ValaLiteral* self = NULL;
59 self = (ValaLiteral*) vala_expression_construct (object_type);
60 return self;
61 }
62
63 static void
vala_literal_class_init(ValaLiteralClass * klass,gpointer klass_data)64 vala_literal_class_init (ValaLiteralClass * klass,
65 gpointer klass_data)
66 {
67 vala_literal_parent_class = g_type_class_peek_parent (klass);
68 ((ValaExpressionClass *) klass)->is_constant = (gboolean (*) (ValaExpression*)) vala_literal_real_is_constant;
69 ((ValaExpressionClass *) klass)->is_pure = (gboolean (*) (ValaExpression*)) vala_literal_real_is_pure;
70 }
71
72 static void
vala_literal_instance_init(ValaLiteral * self,gpointer klass)73 vala_literal_instance_init (ValaLiteral * self,
74 gpointer klass)
75 {
76 }
77
78 /**
79 * Base class for all literals in the source code.
80 */
81 static GType
vala_literal_get_type_once(void)82 vala_literal_get_type_once (void)
83 {
84 static const GTypeInfo g_define_type_info = { sizeof (ValaLiteralClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_literal_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaLiteral), 0, (GInstanceInitFunc) vala_literal_instance_init, NULL };
85 GType vala_literal_type_id;
86 vala_literal_type_id = g_type_register_static (VALA_TYPE_EXPRESSION, "ValaLiteral", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
87 return vala_literal_type_id;
88 }
89
90 GType
vala_literal_get_type(void)91 vala_literal_get_type (void)
92 {
93 static volatile gsize vala_literal_type_id__volatile = 0;
94 if (g_once_init_enter (&vala_literal_type_id__volatile)) {
95 GType vala_literal_type_id;
96 vala_literal_type_id = vala_literal_get_type_once ();
97 g_once_init_leave (&vala_literal_type_id__volatile, vala_literal_type_id);
98 }
99 return vala_literal_type_id__volatile;
100 }
101
102