}
public List<CCodeExpression> get_inner () {
- return new ReadOnlyList<CCodeExpression> (inner);
+ return inner;
}
public override void write (CCodeWriter writer) {
* @return children list
*/
public List<CCodeNode> get_children () {
- return new ReadOnlyList<CCodeNode> (children);
+ return children;
}
public override void write (CCodeWriter writer) {
* @return list of arguments
*/
public List<CCodeExpression> get_arguments () {
- return new ReadOnlyList<CCodeExpression> (arguments);
+ return arguments;
}
public override void write (CCodeWriter writer) {
iterator.vala \
list.vala \
map.vala \
- readonlycollection.vala \
- readonlylist.vala \
- readonlymap.vala \
- readonlyset.vala \
set.vala \
$(NULL)
+++ /dev/null
-/* readonlycollection.vala
- *
- * Copyright (C) 2007-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;
-
-/**
- * Represents a read-only collection of items.
- */
-public class Vala.ReadOnlyCollection<G> : CollectionObject, Iterable<G>, Collection<G> {
- public int size {
- get { return _collection.size; }
- }
-
- public Collection<G> collection {
- set { _collection = value; }
- }
-
- private Collection<G> _collection;
-
- public ReadOnlyCollection (Collection<G>? collection = null) {
- this.collection = collection;
- }
-
- public Type get_element_type () {
- return typeof (G);
- }
-
- public Vala.Iterator<G> iterator () {
- if (_collection == null) {
- return new Iterator<G> ();
- }
-
- return _collection.iterator ();
- }
-
- public bool contains (G item) {
- if (_collection == null) {
- return false;
- }
-
- return _collection.contains (item);
- }
-
- public bool add (G item) {
- assert_not_reached ();
- }
-
- public bool remove (G item) {
- assert_not_reached ();
- }
-
- public void clear () {
- assert_not_reached ();
- }
-
- private class Iterator<G> : CollectionObject, Vala.Iterator<G> {
- public bool next () {
- return false;
- }
-
- public G? get () {
- return null;
- }
- }
-}
-
+++ /dev/null
-/* readonlylist.vala
- *
- * Copyright (C) 2007-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;
-
-/**
- * Represents a read-only collection of items in a well-defined order.
- */
-public class Vala.ReadOnlyList<G> : CollectionObject, Iterable<G>, Collection<G>, List<G> {
- public int size {
- get { return _list.size; }
- }
-
- public List<G> list {
- set { _list = value; }
- }
-
- private List<G> _list;
-
- public ReadOnlyList (List<G>? list = null) {
- this.list = list;
- }
-
- public Type get_element_type () {
- return typeof (G);
- }
-
- public Vala.Iterator<G> iterator () {
- if (_list == null) {
- return new Iterator<G> ();
- }
-
- return _list.iterator ();
- }
-
- public bool contains (G item) {
- if (_list == null) {
- return false;
- }
-
- return _list.contains (item);
- }
-
- public int index_of (G item) {
- if (_list == null) {
- return -1;
- }
-
- return _list.index_of (item);
- }
-
- public bool add (G item) {
- assert_not_reached ();
- }
-
- public bool remove (G item) {
- assert_not_reached ();
- }
-
- public void insert (int index, G item) {
- assert_not_reached ();
- }
-
- public void remove_at (int index) {
- assert_not_reached ();
- }
-
- public G? get (int index) {
- if (_list == null) {
- return null;
- }
-
- return _list.get (index);
- }
-
- public void set (int index, G o) {
- assert_not_reached ();
- }
-
- public void clear () {
- assert_not_reached ();
- }
-
- class Iterator<G> : CollectionObject, Vala.Iterator<G> {
- public bool next () {
- return false;
- }
-
- public G? get () {
- return null;
- }
- }
-}
-
+++ /dev/null
-/* readonlymap.vala
- *
- * Copyright (C) 2007-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;
-
-/**
- * Represents a read-only collection of key/value pairs.
- */
-public class Vala.ReadOnlyMap<K,V> : CollectionObject, Map<K,V> {
- public int size {
- get { return _map.size; }
- }
-
- public Map<K,V> map {
- set { _map = value; }
- }
-
- private Map<K,V> _map;
-
- public ReadOnlyMap (Map<K,V>? map = null) {
- this.map = map;
- }
-
- public Set<K> get_keys () {
- if (_map == null) {
- return new ReadOnlySet<K> ();
- }
-
- return _map.get_keys ();
- }
-
- public Collection<V> get_values () {
- if (_map == null) {
- return new ReadOnlyCollection<V> ();
- }
-
- return _map.get_values ();
- }
-
- public bool contains (K key) {
- if (_map == null) {
- return false;
- }
-
- return _map.contains (key);
- }
-
- public V? get (K key) {
- if (_map == null) {
- return null;
- }
-
- return _map.get (key);
- }
-
- public void set (K key, V value) {
- assert_not_reached ();
- }
-
- public bool remove (K key) {
- assert_not_reached ();
- }
-
- public void clear () {
- assert_not_reached ();
- }
-}
-
+++ /dev/null
-/* readonlyset.vala
- *
- * Copyright (C) 2007-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;
-
-/**
- * Represents a read-only collection of items without duplicates.
- */
-public class Vala.ReadOnlySet<G> : CollectionObject, Iterable<G>, Collection<G>, Set<G> {
- public int size {
- get { return _set.size; }
- }
-
- public Set<G> set {
- set { _set = value; }
- }
-
- private Set<G> _set;
-
- public ReadOnlySet (Set<G>? set = null) {
- this.set = set;
- }
-
- public Type get_element_type () {
- return typeof (G);
- }
-
- public Vala.Iterator<G> iterator () {
- if (_set == null) {
- return new Iterator<G> ();
- }
-
- return _set.iterator ();
- }
-
- public bool contains (G item) {
- if (_set == null) {
- return false;
- }
-
- return _set.contains (item);
- }
-
- public bool add (G item) {
- assert_not_reached ();
- }
-
- public bool remove (G item) {
- assert_not_reached ();
- }
-
- public void clear () {
- assert_not_reached ();
- }
-
- private class Iterator<G> : CollectionObject, Vala.Iterator<G> {
- public bool next () {
- return false;
- }
-
- public G? get () {
- return null;
- }
- }
-}
-
* Get the sizes for all dimensions ascending from left to right.
*/
public List<Expression> get_sizes () {
- return new ReadOnlyList<Expression> (sizes);
+ return sizes;
}
public ArrayCreationExpression (DataType element_type, int rank, InitializerList? initializer_list, SourceReference source_reference) {
}
public List<weak BasicBlock> get_predecessors () {
- return new ReadOnlyList<weak BasicBlock> (predecessors);
+ return predecessors;
}
public List<weak BasicBlock> get_successors () {
- return new ReadOnlyList<weak BasicBlock> (successors);
+ return successors;
}
public void add_child (BasicBlock block) {
* @return variable declarator list
*/
public List<LocalVariable> get_local_variables () {
- return new ReadOnlyList<LocalVariable> (local_variables);
+ return local_variables;
}
public override void accept (CodeVisitor visitor) {
* @return list of classes
*/
public List<Class> get_classes () {
- return new ReadOnlyList<Class> (classes);
+ return classes;
}
/**
* @return list of structs
*/
public List<Struct> get_structs () {
- return new ReadOnlyList<Struct> (structs);
+ return structs;
}
/**
* @return list of enums
*/
public List<Enum> get_enums () {
- return new ReadOnlyList<Enum> (enums);
+ return enums;
}
/**
* @return list of delegates
*/
public List<Delegate> get_delegates () {
- return new ReadOnlyList<Delegate> (delegates);
+ return delegates;
}
/**
* @return list of base types
*/
public List<DataType> get_base_types () {
- return new ReadOnlyList<DataType> (base_types);
+ return base_types;
}
/**
* @return list of fields
*/
public List<Field> get_fields () {
- return new ReadOnlyList<Field> (fields);
+ return fields;
}
/**
* @return list of constants
*/
public List<Constant> get_constants () {
- return new ReadOnlyList<Constant> (constants);
+ return constants;
}
/**
* @return list of methods
*/
public override List<Method> get_methods () {
- return new ReadOnlyList<Method> (methods);
+ return methods;
}
/**
* @return list of properties
*/
public override List<Property> get_properties () {
- return new ReadOnlyList<Property> (properties);
+ return properties;
}
/**
* @return list of signals
*/
public override List<Signal> get_signals () {
- return new ReadOnlyList<Signal> (signals);
+ return signals;
}
/**
* @return list of source files
*/
public List<SourceFile> get_source_files () {
- return new ReadOnlyList<SourceFile> (source_files);
+ return source_files;
}
/**
* @return list of C source files
*/
public List<string> get_c_source_files () {
- return new ReadOnlyList<string> (c_source_files);
+ return c_source_files;
}
/**
* @return list of used packages
*/
public List<string> get_packages () {
- return new ReadOnlyList<string> (packages);
+ return packages;
}
/**
return _error_types;
}
if (_empty_type_list == null) {
- _empty_type_list = new ReadOnlyList<DataType> (new ArrayList<DataType> ());
+ _empty_type_list = new ArrayList<DataType> ();
}
return _empty_type_list;
}
return type_argument_list;
}
if (_empty_type_list == null) {
- _empty_type_list = new ReadOnlyList<DataType> (new ArrayList<DataType> ());
+ _empty_type_list = new ArrayList<DataType> ();
}
return _empty_type_list;
}
* @return parameter list
*/
public List<FormalParameter> get_parameters () {
- return new ReadOnlyList<FormalParameter> (parameters);
+ return parameters;
}
/**
}
public List<Expression> get_indices () {
- return new ReadOnlyList<Expression> (indices);
+ return indices;
}
public ElementAccess (Expression container, SourceReference source_reference) {
* @return list of enum values
*/
public List<EnumValue> get_values () {
- return new ReadOnlyList<EnumValue> (values);
+ return values;
}
/**
* @return list of methods
*/
public List<Method> get_methods () {
- return new ReadOnlyList<Method> (methods);
+ return methods;
}
public override void accept (CodeVisitor visitor) {
* @return list of error codes
*/
public List<ErrorCode> get_codes () {
- return new ReadOnlyList<ErrorCode> (codes);
+ return codes;
}
/**
* @return list of methods
*/
public List<Method> get_methods () {
- return new ReadOnlyList<Method> (methods);
+ return methods;
}
public override void accept (CodeVisitor visitor) {
* ascending from left to right.
*/
public List<CCodeExpression> get_array_sizes () {
- return new ReadOnlyList<CCodeExpression> (array_sizes);
+ return array_sizes;
}
public Statement? parent_statement {
* @return initializer list
*/
public List<Expression> get_initializer () {
- return new ReadOnlyList<Expression> (initializer);
+ return initializer;
}
/**
* @return iterator
*/
public List<Expression> get_iterator () {
- return new ReadOnlyList<Expression> (iterator);
+ return iterator;
}
public override void accept (CodeVisitor visitor) {
* @return expression list
*/
public List<Expression> get_initializers () {
- return new ReadOnlyList<Expression> (initializers);
+ return initializers;
}
/**
* @return list of classes
*/
public List<Class> get_classes () {
- return new ReadOnlyList<Class> (classes);
+ return classes;
}
/**
* @return list of structs
*/
public List<Struct> get_structs () {
- return new ReadOnlyList<Struct> (structs);
+ return structs;
}
/**
* @return list of enums
*/
public List<Enum> get_enums () {
- return new ReadOnlyList<Enum> (enums);
+ return enums;
}
/**
* @return list of delegates
*/
public List<Delegate> get_delegates () {
- return new ReadOnlyList<Delegate> (delegates);
+ return delegates;
}
/**
* @return list of base types
*/
public List<DataType> get_prerequisites () {
- return new ReadOnlyList<DataType> (prerequisites);
+ return prerequisites;
}
/**
* @return list of methods
*/
public override List<Method> get_methods () {
- return new ReadOnlyList<Method> (methods);
+ return methods;
}
/**
* @return list of fields
*/
public List<Field> get_fields () {
- return new ReadOnlyList<Field> (fields);
+ return fields;
}
/**
* @return list of constants
*/
public List<Constant> get_constants () {
- return new ReadOnlyList<Constant> (constants);
+ return constants;
}
/**
* @return list of properties
*/
public override List<Property> get_properties () {
- return new ReadOnlyList<Property> (properties);
+ return properties;
}
/**
* @return list of signals
*/
public override List<Signal> get_signals () {
- return new ReadOnlyList<Signal> (signals);
+ return signals;
}
/**
* @return parameter list
*/
public List<string> get_parameters () {
- return new ReadOnlyList<string> (parameters);
+ return parameters;
}
public override void accept (CodeVisitor visitor) {
cheader_filenames.add (source_reference.file.get_cinclude_filename ());
}
}
- return new ReadOnlyList<string> (cheader_filenames);
+ return cheader_filenames;
}
* @return type argument list
*/
public List<DataType> get_type_arguments () {
- return new ReadOnlyList<DataType> (type_argument_list);
+ return type_argument_list;
}
public override void accept (CodeVisitor visitor) {
}
public List<FormalParameter> get_parameters () {
- return new ReadOnlyList<FormalParameter> (parameters);
+ return parameters;
}
/**
* @return list of type parameters
*/
public List<TypeParameter> get_type_parameters () {
- return new ReadOnlyList<TypeParameter> (type_parameters);
+ return type_parameters;
}
public int get_type_parameter_index (string name) {
* @return list of preconditions
*/
public List<Expression> get_preconditions () {
- return new ReadOnlyList<Expression> (preconditions);
+ return preconditions;
}
/**
* @return list of postconditions
*/
public List<Expression> get_postconditions () {
- return new ReadOnlyList<Expression> (postconditions);
+ return postconditions;
}
public override void replace_type (DataType old_type, DataType new_type) {
* @return argument list
*/
public List<Expression> get_argument_list () {
- return new ReadOnlyList<Expression> (argument_list);
+ return argument_list;
}
public override void accept (CodeVisitor visitor) {
* @return comment list
*/
public List<Comment> get_comments () {
- return new ReadOnlyList<Comment> (comments);
+ return comments;
}
/**
* @return namespace list
*/
public List<Namespace> get_namespaces () {
- return new ReadOnlyList<Namespace> (namespaces);
+ return namespaces;
}
/**
* @return struct list
*/
public List<Struct> get_structs () {
- return new ReadOnlyList<Struct> (structs);
+ return structs;
}
/**
* @return class list
*/
public List<Class> get_classes () {
- return new ReadOnlyList<Class> (classes);
+ return classes;
}
/**
* @return interface list
*/
public List<Interface> get_interfaces () {
- return new ReadOnlyList<Interface> (interfaces);
+ return interfaces;
}
/**
* @return enum list
*/
public List<Enum> get_enums () {
- return new ReadOnlyList<Enum> (enums);
+ return enums;
}
/**
* @return error domain list
*/
public List<ErrorDomain> get_error_domains () {
- return new ReadOnlyList<ErrorDomain> (error_domains);
+ return error_domains;
}
/**
* @return field list
*/
public List<Field> get_fields () {
- return new ReadOnlyList<Field> (fields);
+ return fields;
}
/**
* @return constant list
*/
public List<Constant> get_constants () {
- return new ReadOnlyList<Constant> (constants);
+ return constants;
}
/**
* @return delegate list
*/
public List<Delegate> get_delegates () {
- return new ReadOnlyList<Delegate> (delegates);
+ return delegates;
}
/**
* @return method list
*/
public List<Method> get_methods () {
- return new ReadOnlyList<Method> (methods);
+ return methods;
}
/**
}
public override List<string> get_cheader_filenames () {
- return new ReadOnlyList<string> (cheader_filenames);
+ return cheader_filenames;
}
/**
* @return argument list
*/
public List<Expression> get_argument_list () {
- return new ReadOnlyList<Expression> (argument_list);
+ return argument_list;
}
/**
* @return member initializer list
*/
public List<MemberInitializer> get_object_initializer () {
- return new ReadOnlyList<MemberInitializer> (object_initializer);
+ return object_initializer;
}
public override void accept (CodeVisitor visitor) {
* @return list of type parameters
*/
public List<TypeParameter> get_type_parameters () {
- return new ReadOnlyList<TypeParameter> (type_parameters);
+ return type_parameters;
}
public override int get_type_parameter_index (string name) {
}
public Map<string,Symbol> get_symbol_table () {
- return new ReadOnlyMap<string,Symbol> (symbol_table);
+ return symbol_table;
}
}
}
public List<FormalParameter> get_parameters () {
- return new ReadOnlyList<FormalParameter> (parameters);
+ return parameters;
}
/**
* @return list of comments
*/
public List<Comment> get_comments () {
- return new ReadOnlyList<Comment> (comments);
+ return comments;
}
/**
* @return code node list
*/
public List<CodeNode> get_nodes () {
- return new ReadOnlyList<CodeNode> (nodes);
+ return nodes;
}
public void accept (CodeVisitor visitor) {
* @return list of type parameters
*/
public List<TypeParameter> get_type_parameters () {
- return new ReadOnlyList<TypeParameter> (type_parameters);
+ return type_parameters;
}
/**
* @return list of fields
*/
public List<Field> get_fields () {
- return new ReadOnlyList<Field> (fields);
+ return fields;
}
/**
* @return list of constants
*/
public List<Constant> get_constants () {
- return new ReadOnlyList<Constant> (constants);
+ return constants;
}
/**
* @return list of methods
*/
public List<Method> get_methods () {
- return new ReadOnlyList<Method> (methods);
+ return methods;
}
/**
* @return list of properties
*/
public List<Property> get_properties () {
- return new ReadOnlyList<Property> (properties);
+ return properties;
}
public override void accept (CodeVisitor visitor) {
* @return switch label list
*/
public List<SwitchLabel> get_labels () {
- return new ReadOnlyList<SwitchLabel> (labels);
+ return labels;
}
public bool has_default_label () {
* @return section list
*/
public List<SwitchSection> get_sections () {
- return new ReadOnlyList<SwitchSection> (sections);
+ return sections;
}
public override void accept (CodeVisitor visitor) {
* @return list of catch clauses
*/
public List<CatchClause> get_catch_clauses () {
- return new ReadOnlyList<CatchClause> (catch_clauses);
+ return catch_clauses;
}
public override void accept (CodeVisitor visitor) {
cheader_filenames.add (source_reference.file.get_cinclude_filename ());
}
}
- return new ReadOnlyList<string> (cheader_filenames);
+ return cheader_filenames;
}
/**