2008-08-14 Jürg Billeter <j@bitron.ch>
+ Don't derive from GObject in libvala where not necessary to improve
+ compilation performance
+
+2008-08-14 Jürg Billeter <j@bitron.ch>
+
* configure.ac: Post-release version bump
2008-08-14 Jürg Billeter <j@bitron.ch>
/**
* Left hand side of the assignment.
*/
- public CCodeExpression left { get; construct; }
+ public CCodeExpression left { get; set; }
/**
* Assignment operator.
/**
* Right hand side of the assignment.
*/
- public CCodeExpression right { get; construct; }
+ public CCodeExpression right { get; set; }
public CCodeAssignment (CCodeExpression l, CCodeExpression r, CCodeAssignmentOperator op = CCodeAssignmentOperator.SIMPLE) {
left = l;
/**
* The left operand.
*/
- public CCodeExpression left { get; set construct; }
+ public CCodeExpression left { get; set; }
/**
* The right operand.
*/
- public CCodeExpression right { get; set construct; }
+ public CCodeExpression right { get; set; }
public CCodeBinaryExpression (CCodeBinaryOperator op, CCodeExpression l, CCodeExpression r) {
operator = op;
/**
* The expression to be cast.
*/
- public CCodeExpression inner { get; set construct; }
+ public CCodeExpression inner { get; set; }
/**
* The target type.
*/
- public string type_name { get; set construct; }
+ public string type_name { get; set; }
public CCodeCastExpression (CCodeExpression expr, string type) {
inner = expr;
/**
* The text content of the comment.
*/
- public string text { get; set construct; }
+ public string text { get; set; }
public CCodeComment (string _text) {
text = _text;
/**
* The condition.
*/
- public CCodeExpression condition { get; set construct; }
+ public CCodeExpression condition { get; set; }
/**
* The expression to be evaluated if the condition holds.
*/
- public CCodeExpression true_expression { get; set construct; }
+ public CCodeExpression true_expression { get; set; }
/**
* The expression to be evaluated if the condition doesn't hold.
*/
- public CCodeExpression false_expression { get; set construct; }
+ public CCodeExpression false_expression { get; set; }
public CCodeConditionalExpression (CCodeExpression cond, CCodeExpression true_expr, CCodeExpression false_expr) {
condition = cond;
/**
* The name of this constant.
*/
- public string name { get; set construct; }
+ public string name { get; set; }
public CCodeConstant (string _name) {
name = _name;
/**
* The loop condition.
*/
- public CCodeExpression condition { get; set construct; }
+ public CCodeExpression condition { get; set; }
public CCodeDoStatement (CCodeStatement stmt, CCodeExpression cond) {
body = stmt;
/**
* Expression representing the container on which we want to access.
*/
- public CCodeExpression container { get; set construct; }
+ public CCodeExpression container { get; set; }
/**
* Expression representing the index we want to access inside the
* container.
*/
- public CCodeExpression index { get; set construct; }
+ public CCodeExpression index { get; set; }
public CCodeElementAccess (CCodeExpression cont, CCodeExpression i) {
container = cont;
/**
* The expression to evaluate.
*/
- public CCodeExpression expression { get; set construct; }
+ public CCodeExpression expression { get; set; }
public CCodeExpressionStatement (CCodeExpression expr) {
expression = expr;
/**
* The name of the target label.
*/
- public string name { get; set construct; }
+ public string name { get; set; }
public CCodeGotoStatement (string name) {
this.name = name;
/**
* The name of this identifier.
*/
- public string name { get; set construct; }
+ public string name { get; set; }
public CCodeIdentifier (string _name) {
name = _name;
/**
* The boolean condition to evaluate.
*/
- public CCodeExpression condition { get; set construct; }
+ public CCodeExpression condition { get; set; }
/**
* The statement to be evaluated if the condition holds.
*/
- public CCodeStatement true_statement { get; set construct; }
+ public CCodeStatement true_statement { get; set; }
/**
* The optional statement to be evaluated if the condition doesn't hold.
*/
- public CCodeStatement? false_statement { get; set construct; }
+ public CCodeStatement? false_statement { get; set; }
public CCodeIfStatement (CCodeExpression cond, CCodeStatement true_stmt, CCodeStatement? false_stmt = null) {
condition = cond;
/**
* The file to be included.
*/
- public string filename { get; set construct; }
+ public string filename { get; set; }
/**
* Specifies whether the specified file should be searched in the local
/**
* The name of this label.
*/
- public string name { get; set construct; }
+ public string name { get; set; }
public CCodeLabel (string name) {
this.name = name;
/**
* The name of the source file to be presumed.
*/
- public string filename { get; set construct; }
+ public string filename { get; set; }
/**
* The line number in the source file to be presumed.
/**
* The name of this macro.
*/
- public string name { get; set construct; }
+ public string name { get; set; }
/**
* The replacement of this macro.
/**
* The parent of the member.
*/
- public CCodeExpression inner { get; set construct; }
+ public CCodeExpression inner { get; set; }
/**
* The name of the member.
*/
- public string member_name { get; set construct; }
+ public string member_name { get; set; }
/**
* Specifies whether the member access happens by pointer dereferencing.
/* valaccodenode.vala
*
- * Copyright (C) 2006-2007 Jürg Billeter
+ * Copyright (C) 2006-2008 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
/**
* Represents a node in the C code tree.
*/
-public abstract class Vala.CCodeNode : Object {
+public abstract class Vala.CCodeNode {
/**
* The source file name and line number to be presumed for this code
* node.
/**
* The name of the guarding define.
*/
- public string define { get; set construct; }
+ public string define { get; set; }
public CCodeOnceSection (string def) {
define = def;
/**
* The expression in the parenthesis.
*/
- public CCodeExpression inner { get; set construct; }
+ public CCodeExpression inner { get; set; }
public CCodeParenthesizedExpression (CCodeExpression expr) {
inner = expr;
/**
* The operand.
*/
- public CCodeExpression inner { get; set construct; }
+ public CCodeExpression inner { get; set; }
public CCodeUnaryExpression (CCodeUnaryOperator op, CCodeExpression expr) {
operator = op;
/**
* The variable name.
*/
- public string name { get; set construct; }
+ public string name { get; set; }
/**
* The optional initializer expression.
/**
* The loop condition.
*/
- public CCodeExpression condition { get; set construct; }
+ public CCodeExpression condition { get; set; }
/**
* The loop body.
/**
* Represents a writer to write C source files.
*/
-public class Vala.CCodeWriter : Object {
+public class Vala.CCodeWriter {
/**
* Specifies the file to be written.
*/
- public string filename {
- get {
- return _filename;
- }
- construct {
- _filename = value;
- }
- }
+ public string filename { get; set; }
/**
* Specifies whether to emit line directives.
get { return _bol; }
}
- private string _filename;
private string temp_filename;
private bool file_exists;
/* at begin of line */
private bool _bol = true;
- public CCodeWriter (string _filename) {
- filename = _filename;
+ public CCodeWriter (string filename) {
+ this.filename = filename;
}
/**
* false otherwise
*/
public bool open () {
- file_exists = FileUtils.test (_filename, FileTest.EXISTS);
+ file_exists = FileUtils.test (filename, FileTest.EXISTS);
if (file_exists) {
- temp_filename = "%s.valatmp".printf (_filename);
+ temp_filename = "%s.valatmp".printf (filename);
stream = FileStream.open (temp_filename, "w");
} else {
- stream = FileStream.open (_filename, "w");
+ stream = FileStream.open (filename, "w");
}
return (stream != null);
var changed = true;
try {
- var old_file = new MappedFile (_filename, false);
+ var old_file = new MappedFile (filename, false);
var new_file = new MappedFile (temp_filename, false);
var len = old_file.get_length ();
if (len == new_file.get_length ()) {
}
if (changed) {
- FileUtils.rename (temp_filename, _filename);
+ FileUtils.rename (temp_filename, filename);
} else {
FileUtils.unlink (temp_filename);
}
using GLib;
-class Vala.Compiler : Object {
+class Vala.Compiler {
static string basedir;
static string directory;
static bool version;
libgee_la_VALASOURCES = \
arraylist.vala \
collection.vala \
+ collectionobject.vala \
hashmap.vala \
hashset.vala \
iterable.vala \
/**
* Arrays of arbitrary elements which grow automatically as elements are added.
*/
-public class Gee.ArrayList<G> : Object, Iterable<G>, Collection<G>, List<G> {
+public class Gee.ArrayList<G> : CollectionObject, Iterable<G>, Collection<G>, List<G> {
public int size {
get { return _size; }
}
_items.resize (value);
}
- private class Iterator<G> : Object, Gee.Iterator<G> {
+ private class Iterator<G> : CollectionObject, Gee.Iterator<G> {
public ArrayList<G> list {
set {
_list = value;
--- /dev/null
+/* collectionobject.vala
+ *
+ * Copyright (C) 2008 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.1 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;
+
+/**
+ * Base class for all collections.
+ */
+public class Gee.CollectionObject {
+}
+
/**
* Hashtable implementation of the Map interface.
*/
-public class Gee.HashMap<K,V> : Object, Map<K,V> {
+public class Gee.HashMap<K,V> : CollectionObject, Map<K,V> {
public int size {
get { return _nnodes; }
}
this.key_hash_func = key_hash_func;
this.key_equal_func = key_equal_func;
this.value_equal_func = value_equal_func;
- }
-
- construct {
_array_size = MIN_SIZE;
_nodes = new Node<K,V>[_array_size];
}
}
}
- private class KeySet<K,V> : Object, Iterable<K>, Collection<K>, Set<K> {
+ private class KeySet<K,V> : CollectionObject, Iterable<K>, Collection<K>, Set<K> {
public HashMap<K,V> map {
set { _map = value; }
}
}
}
- private class KeyIterator<K,V> : Object, Iterator<K> {
+ private class KeyIterator<K,V> : CollectionObject, Iterator<K> {
public HashMap<K,V> map {
set {
_map = value;
}
}
- private class ValueCollection<K,V> : Object, Iterable<V>, Collection<V> {
+ private class ValueCollection<K,V> : CollectionObject, Iterable<V>, Collection<V> {
public HashMap<K,V> map {
set { _map = value; }
}
}
}
- private class ValueIterator<K,V> : Object, Iterator<V> {
+ private class ValueIterator<K,V> : CollectionObject, Iterator<V> {
public HashMap<K,V> map {
set {
_map = value;
/**
* Hashtable implementation of the Set interface.
*/
-public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
+public class Gee.HashSet<G> : CollectionObject, Iterable<G>, Collection<G>, Set<G> {
public int size {
get { return _nnodes; }
}
public HashSet (HashFunc hash_func = GLib.direct_hash, EqualFunc equal_func = GLib.direct_equal) {
this.hash_func = hash_func;
this.equal_func = equal_func;
- }
-
- construct {
_array_size = MIN_SIZE;
_nodes = new Node<G>[_array_size];
}
}
}
- private class Iterator<G> : Object, Gee.Iterator<G> {
+ private class Iterator<G> : CollectionObject, Gee.Iterator<G> {
public HashSet<G> set {
set {
_set = value;
* Implemented by classes that support a simple iteration over instances of the
* collection.
*/
-public interface Gee.Iterable<G> : GLib.Object {
+public interface Gee.Iterable<G> : CollectionObject {
public abstract Type get_element_type ();
/**
* Implemented by classes that support a simple iteration over instances of the
* collection.
*/
-public interface Gee.Iterator<G> : GLib.Object {
+public interface Gee.Iterator<G> : CollectionObject {
/**
* Advances to the next element in the iteration.
*
/**
* A map is a generic collection of key/value pairs.
*/
-public interface Gee.Map<K,V> : GLib.Object {
+public interface Gee.Map<K,V> : CollectionObject {
/**
* The number of items in this map.
*/
/**
* Represents a read-only collection of items.
*/
-public class Gee.ReadOnlyCollection<G> : Object, Iterable<G>, Collection<G> {
+public class Gee.ReadOnlyCollection<G> : CollectionObject, Iterable<G>, Collection<G> {
public int size {
get { return _collection.size; }
}
assert_not_reached ();
}
- private class Iterator<G> : Object, Gee.Iterator<G> {
+ private class Iterator<G> : CollectionObject, Gee.Iterator<G> {
public bool next () {
return false;
}
/**
* Represents a read-only collection of items in a well-defined order.
*/
-public class Gee.ReadOnlyList<G> : Object, Iterable<G>, Collection<G>, List<G> {
+public class Gee.ReadOnlyList<G> : CollectionObject, Iterable<G>, Collection<G>, List<G> {
public int size {
get { return _list.size; }
}
assert_not_reached ();
}
- class Iterator<G> : Object, Gee.Iterator<G> {
+ class Iterator<G> : CollectionObject, Gee.Iterator<G> {
public bool next () {
return false;
}
/**
* Represents a read-only collection of key/value pairs.
*/
-public class Gee.ReadOnlyMap<K,V> : Object, Map<K,V> {
+public class Gee.ReadOnlyMap<K,V> : CollectionObject, Map<K,V> {
public int size {
get { return _map.size; }
}
/**
* Represents a read-only collection of items without duplicates.
*/
-public class Gee.ReadOnlySet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
+public class Gee.ReadOnlySet<G> : CollectionObject, Iterable<G>, Collection<G>, Set<G> {
public int size {
get { return _set.size; }
}
assert_not_reached ();
}
- private class Iterator<G> : Object, Gee.Iterator<G> {
+ private class Iterator<G> : CollectionObject, Gee.Iterator<G> {
public bool next () {
return false;
}
/**
* Interface to the C compiler.
*/
-public class Vala.CCodeCompiler : Object {
+public class Vala.CCodeCompiler {
public CCodeCompiler () {
}
private Set<string> wrappers;
public CCodeGenerator () {
- }
-
- construct {
predefined_marshal_set = new HashSet<string> (str_hash, str_equal);
predefined_marshal_set.add ("VOID:VOID");
predefined_marshal_set.add ("VOID:BOOLEAN");
/**
* C function to register a type at runtime.
*/
-public abstract class Vala.TypeRegisterFunction : Object {
+public abstract class Vala.TypeRegisterFunction {
private CCodeFragment declaration_fragment = new CCodeFragment ();
private CCodeFragment definition_fragment = new CCodeFragment ();
public Foo (construct string bar) {
}
- public string bar { get; set construct; }
+ public string bar { get; set; }
static void test_integer_array () {
stdout.printf ("One dimensional array creation and assignment: 1");
get {
return _inner;
}
- set construct {
+ set {
_inner = value;
_inner.parent_node = this;
}
/**
* The rank of the array.
*/
- public int rank { get; set construct; }
+ public int rank { get; set; }
/**
* The size for each dimension ascending from left to right.
/**
* The root array initializer list.
*/
- public InitializerList? initializer_list { get; set construct; }
+ public InitializerList? initializer_list { get; set; }
private DataType _element_type;
* @return newly created field
*/
public ArrayLengthField (SourceReference source_reference) {
+ base.init ();
name = "length";
external = true;
this.source_reference = source_reference;
* @return newly created method
*/
public ArrayMoveMethod (SourceReference source_reference) {
+ base.init ();
name = "move";
external = true;
this.source_reference = source_reference;
* @return newly created method
*/
public ArrayResizeMethod (SourceReference source_reference) {
+ base.init ();
name = "resize";
external = true;
this.source_reference = source_reference;
- }
-
- construct {
cinstance_parameter_position = 0.1;
}
}
*/
public Expression left {
get { return _left; }
- set construct {
+ set {
_left = value;
_left.parent_node = this;
}
*/
public Expression right {
get { return _right; }
- set construct {
+ set {
_right = value;
_right.parent_node = this;
}
* Represents a basic block, i.e. a straight-line piece of code without any
* jumps or jump targets.
*/
-public class Vala.BasicBlock : Object {
+public class Vala.BasicBlock {
private Gee.List<CodeNode> nodes = new ArrayList<CodeNode> ();
private Gee.List<weak BasicBlock> predecessors = new ArrayList<weak BasicBlock> ();
get {
return _left;
}
- set construct {
+ set {
_left = value;
_left.parent_node = this;
}
get {
return _right;
}
- set construct {
+ set {
_right = value;
_right.parent_node = this;
}
* @param source reference to source code
*/
public Block (SourceReference source_reference) {
+ base.init ();
this.source_reference = source_reference;
}
get {
return _inner;
}
- set construct {
+ set {
_inner = value;
_inner.parent_node = this;
}
/**
* Checked casts return NULL instead of raising an error.
*/
- public bool is_silent_cast { get; set construct; }
+ public bool is_silent_cast { get; set; }
private Expression _inner;
* Code visitor building the control flow graph.
*/
public class Vala.CFGBuilder : CodeVisitor {
- private class JumpTarget : Object {
+ private class JumpTarget {
public bool break_target { get; set; }
public bool continue_target { get; set; }
public bool return_target { get; set; }
get {
return _value;
}
- set construct {
+ set {
_value = value;
if (!value.validate () || (value.len () != 3 && value.next_char ().get_char () != '\\')) {
* @return newly created class
*/
public Class (string name, SourceReference? source_reference = null) {
+ base.init ();
this.source_reference = source_reference;
this.name = name;
}
/**
* The link between a source code node and generated code.
*/
-public abstract class Vala.CodeBinding : Object {
+public abstract class Vala.CodeBinding {
}
/**
* The root of the code tree.
*/
-public class Vala.CodeContext : Object {
+public class Vala.CodeContext {
/**
* Specifies the name of the library to be built.
*
/**
* The selected code generator.
*/
- public CodeGenerator codegen { get; set; }
+ public CodeGenerator codegen { get; set; default = new CodeGenerator (); }
public CodeContext () {
}
- construct {
- codegen = new CodeGenerator ();
- }
-
/**
* Returns a copy of the list of source files.
*
* Code nodes get created by the parser and are used throughout the whole
* compilation process.
*/
-public abstract class Vala.CodeNode : Object {
+public abstract class Vala.CodeNode {
/**
* Parent of this code node.
*/
public virtual string to_string () {
var str = new StringBuilder ();
- str.append ("/* ").append (get_type ().name ());
+ str.append ("/* ");
if (source_reference != null) {
str.append ("@").append (source_reference.to_string ());
/**
* Abstract code node visitor for traversing source code tree.
*/
-public abstract class Vala.CodeVisitor : Object {
+public abstract class Vala.CodeVisitor {
/**
* Visit operation called for source files.
*
/**
* The condition.
*/
- public Expression condition { get; set construct; }
+ public Expression condition { get; set; }
/**
* The expression to be evaluated if the condition holds.
*/
- public Expression true_expression { get; set construct; }
+ public Expression true_expression { get; set; }
/**
* The expression to be evaluated if the condition doesn't hold.
*/
- public Expression false_expression { get; set construct; }
+ public Expression false_expression { get; set; }
/**
* Creates a new conditional expression.
* @return newly created constant
*/
public Constant (string name, DataType type_reference, Expression? initializer, SourceReference? source_reference) {
+ base.init ();
this.name = name;
this.type_reference = type_reference;
this.initializer = initializer;
* @return newly created constructor
*/
public Constructor (SourceReference source) {
+ base.init ();
source_reference = source;
}
* @return newly created method
*/
public CreationMethod (string? type_name, string? name, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.source_reference = source_reference;
this.type_name = type_name;
/**
* The local variable or constant declaration.
*/
- public Symbol declaration { get; set construct; }
+ public Symbol declaration { get; set; }
/**
* Creates a new declaration statement.
* @return newly created delegate
*/
public Delegate (string? name, DataType return_type, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.return_type = return_type;
this.source_reference = source_reference;
- }
- construct {
cinstance_parameter_position = -1;
carray_length_parameter_position = -3;
cdelegate_target_parameter_position = -3;
* @return newly created destructor
*/
public Destructor (SourceReference? source_reference = null) {
+ base.init ();
this.source_reference = source_reference;
}
get {
return _condition;
}
- set construct {
+ set {
_condition = value;
_condition.parent_node = this;
}
static int dynamic_method_id;
public DynamicMethod (DataType dynamic_type, string name, DataType return_type, SourceReference? source_reference = null) {
+ base.init ();
this.dynamic_type = dynamic_type;
this.name = name;
this.return_type = return_type;
private string cname;
public DynamicProperty (DataType dynamic_type, string name, SourceReference? source_reference = null) {
+ base.init ();
this.dynamic_type = dynamic_type;
this.name = name;
this.source_reference = source_reference;
public Expression handler { get; set; }
public DynamicSignal (DataType dynamic_type, string name, DataType return_type, SourceReference? source_reference = null) {
+ base.init ();
this.dynamic_type = dynamic_type;
this.name = name;
this.return_type = return_type;
* @return newly created enum
*/
public Enum (string name, SourceReference? source_reference = null) {
+ base.init ();
this.source_reference = source_reference;
this.name = name;
}
* @return newly created enum value
*/
public EnumValue (string name, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.source_reference = source_reference;
}
* @return newly created enum value
*/
public EnumValue.with_value (string name, Expression value, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.value = value;
this.source_reference = source_reference;
* @return newly created enum value
*/
public ErrorCode (string name, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.source_reference = source_reference;
}
* @return newly created enum value
*/
public ErrorCode.with_value (string name, Expression value, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.value = value;
this.source_reference = source_reference;
* @return newly created error domain
*/
public ErrorDomain (string name, SourceReference? source_reference = null) {
+ base.init ();
this.source_reference = source_reference;
this.name = name;
}
get {
return _expression;
}
- set construct {
+ set {
_expression = value;
_expression.parent_node = this;
}
* @return newly created field
*/
public Field (string name, DataType field_type, Expression? initializer, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.field_type = field_type;
this.initializer = initializer;
/**
* Specifies the element variable name.
*/
- public string variable_name { get; set construct; }
+ public string variable_name { get; set; }
/**
* Specifies the container.
get {
return _collection;
}
- set construct {
+ set {
_collection = value;
_collection.parent_node = this;
}
* @return newly created foreach statement
*/
public ForeachStatement (DataType? type_reference, string variable_name, Expression collection, Block body, SourceReference source_reference) {
+ base.init ();
this.variable_name = variable_name;
this.collection = collection;
this.body = body;
* @return newly created formal parameter
*/
public FormalParameter (string name, DataType parameter_type, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.parameter_type = parameter_type;
this.source_reference = source_reference;
+
+ access = SymbolAccessibility.PUBLIC;
}
/**
* parameters.
*/
public FormalParameter.with_ellipsis (SourceReference? source = null) {
+ base.init ();
ellipsis = true;
source_reference = source;
- }
- construct {
access = SymbolAccessibility.PUBLIC;
}
get {
return _condition;
}
- set construct {
+ set {
_condition = value;
if (_condition != null) {
_condition.parent_node = this;
PRIVATE = 1 << 7
}
- construct {
+ public Parser () {
tokens = new TokenInfo[BUFFER_SIZE];
class_name = null;
current_expr_is_lambda = false;
/**
* Lexical scanner for Genie source files.
*/
-public class Vala.Genie.Scanner : Object {
- public SourceFile source_file { get; construct; }
+public class Vala.Genie.Scanner {
+ public SourceFile source_file { get; private set; }
- public int indent_spaces { get;set;}
+ public int indent_spaces { get; set;}
char* begin;
char* current;
string _comment;
-
-
public Scanner (SourceFile source_file) {
this.source_file = source_file;
- }
- construct {
begin = source_file.get_mapped_contents ();
end = begin + source_file.get_mapped_length ();
get {
return _condition;
}
- set construct {
+ set {
_condition = value;
_condition.parent_node = this;
}
/**
* The statement to be evaluated if the condition holds.
*/
- public Block true_statement { get; set construct; }
+ public Block true_statement { get; set; }
/**
* The optional statement to be evaluated if the condition doesn't hold.
*/
- public Block? false_statement { get; set construct; }
+ public Block? false_statement { get; set; }
private Expression _condition;
/**
* The target type.
*/
- public weak TypeSymbol type_reference { get; set construct; }
+ public weak TypeSymbol type_reference { get; set; }
/**
* The expression to be cast.
*/
- public CCodeExpression inner { get; set construct; }
+ public CCodeExpression inner { get; set; }
/**
* Creates a new instance cast expression.
public InstanceCast (CCodeExpression expr, TypeSymbol type) {
inner = expr;
type_reference = type;
- }
-
- construct {
+
call = new CCodeIdentifier (type_reference.get_upper_case_cname (null));
add_argument ((CCodeExpression) inner);
}
* @return newly created interface
*/
public Interface (string name, SourceReference? source_reference = null) {
+ base.init ();
this.source_reference = source_reference;
this.name = name;
}
*/
public Expression call {
get { return _call; }
- set construct {
+ set {
_call = value;
_call.parent_node = this;
}
* @return newly created variable declarator
*/
public LocalVariable (DataType? variable_type, string name, Expression? initializer = null, SourceReference? source_reference = null) {
+ base.init ();
this.variable_type = variable_type;
this.name = name;
this.initializer = initializer;
/**
* Represents a lockable object.
*/
-public interface Vala.Lockable : Object {
+public interface Vala.Lockable {
/**
* Indicates a specific lockable object beeing actually locked somewhere.
*/
/**
* Expression representing the resource to be locked.
*/
- public Expression resource { get; set construct; }
+ public Expression resource { get; set; }
/**
* The statement during its execution the resource is locked.
*/
- public Block body { get; set construct; }
+ public Block body { get; set; }
public LockStatement (Expression resource, Block body, SourceReference? source_reference = null) {
this.body = body;
/**
* Represents a general class member.
*/
-public class Vala.Member : Symbol {
+public abstract class Vala.Member : Symbol {
private Gee.List<string> cheader_filenames = new ArrayList<string> ();
public override void accept (CodeVisitor visitor) {
* @return newly created method
*/
public Method (string name, DataType return_type, SourceReference? source_reference = null) {
+ base.init ();
this.return_type = return_type;
this.source_reference = source_reference;
this.name = name;
- }
- construct {
carray_length_parameter_position = -3;
cdelegate_target_parameter_position = -3;
}
/**
* The name of a property.
*/
- public string name { get; set construct; }
+ public string name { get; set; }
/**
* The expression the property should assign.
*/
- public Expression argument { get; set construct; }
+ public Expression argument { get; set; }
/**
* Creates a new named argument.
* @return newly created namespace
*/
public Namespace (string? name, SourceReference? source_reference = null) {
+ base.init ();
this.source_reference = source_reference;
this.name = name;
access = SymbolAccessibility.PUBLIC;
get {
return _inner;
}
- set construct {
+ set {
_inner = value;
_inner.parent_node = this;
}
VIRTUAL = 1 << 6
}
- construct {
+ public Parser () {
tokens = new TokenInfo[BUFFER_SIZE];
}
get {
return _inner;
}
- set construct {
+ set {
_inner = value;
_inner.parent_node = this;
}
/**
* The operand, must be a variable or a property.
*/
- public Expression inner { get; set construct; }
+ public Expression inner { get; set; }
/**
* Specifies whether value should be incremented or decremented.
* @return newly created property
*/
public Property (string name, DataType property_type, PropertyAccessor? get_accessor, PropertyAccessor? set_accessor, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.property_type = property_type;
this.get_accessor = get_accessor;
get {
return _inner;
}
- set construct {
+ set {
_inner = value;
_inner.parent_node = this;
}
/**
* Lexical scanner for Vala source files.
*/
-public class Vala.Scanner : Object {
- public SourceFile source_file { get; construct; }
+public class Vala.Scanner {
+ public SourceFile source_file { get; private set; }
char* current;
char* end;
public Scanner (SourceFile source_file) {
this.source_file = source_file;
- }
-
- construct {
+
char* begin = source_file.get_mapped_contents ();
end = begin + source_file.get_mapped_length ();
/**
* Represents a part of the symbol tree.
*/
-public class Vala.Scope : Object {
+public class Vala.Scope {
/**
* The symbol that owns this scope.
*/
* @return newly created signal
*/
public Signal (string name, DataType return_type, SourceReference? source_reference = null) {
+ base.init ();
this.name = name;
this.return_type = return_type;
this.source_reference = source_reference;
/**
* Represents a Vala source or VAPI package file.
*/
-public class Vala.SourceFile : Object {
+public class Vala.SourceFile {
/**
* The name of this source file.
*/
/* valasourcefilecycle.vala
*
- * Copyright (C) 2006-2007 Jürg Billeter
+ * Copyright (C) 2006-2008 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
/**
* Represents a dependency cycle of source files.
*/
-public class Vala.SourceFileCycle : Object {
+public class Vala.SourceFileCycle {
/**
* The members of this source file cycle.
*/
/**
* Represents a reference to a location in a source file.
*/
-public class Vala.SourceReference : Object {
+public class Vala.SourceReference {
/**
* The source file to be referenced.
*/
* @return newly created struct
*/
public Struct (string name, SourceReference? source_reference = null) {
+ base.init ();
this.source_reference = source_reference;
this.name = name;
}
* @return newly created switch section
*/
public SwitchSection (SourceReference source_reference) {
+ base.init ();
this.source_reference = source_reference;
}
get {
return _expression;
}
- set construct {
+ set {
_expression = value;
_expression.parent_node = this;
}
* of the block to determine which variables need to be freed before
* jump statements.
*/
- public bool active { get; set; }
+ public bool active { get; set; default = true; }
/**
* Specifies the accessibility of this symbol. Public accessibility
private weak Scope _owner;
private Scope _scope;
- construct {
+ public void init () {
_scope = new Scope (this);
- active = true;
}
/**
/**
* The expression to be checked.
*/
- public Expression expression { get; set construct; }
+ public Expression expression { get; set; }
/**
* The type to be matched against.
* @return newly created generic type parameter
*/
public TypeParameter (string _name, SourceReference source) {
+ base.init ();
name = _name;
source_reference = source;
}
get {
return _inner;
}
- set construct {
+ set {
_inner = value;
_inner.parent_node = this;
}
get {
return _condition;
}
- set construct {
+ set {
_condition = value;
_condition.parent_node = this;
}