Commit 774705f4 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Switch to new construction syntax

2007-03-03  Jürg Billeter  <j@bitron.ch>

	* Switch to new construction syntax

svn path=/trunk/; revision=211
parent ce5a4140
2007-03-03 Jürg Billeter <j@bitron.ch>
* Switch to new construction syntax
2007-03-03 Jürg Billeter <j@bitron.ch>
* vala/parser.y: support new construction syntax
......
......@@ -41,7 +41,7 @@ public class Vala.CCodeAssignment : CCodeExpression {
*/
public CCodeExpression right { get; construct; }
public construct (CCodeExpression l, CCodeExpression r, CCodeAssignmentOperator op = CCodeAssignmentOperator.SIMPLE) {
public CCodeAssignment (CCodeExpression l, CCodeExpression r, CCodeAssignmentOperator op = CCodeAssignmentOperator.SIMPLE) {
left = l;
operator = op;
right = r;
......
......@@ -41,7 +41,7 @@ public class Vala.CCodeBinaryExpression : CCodeExpression {
*/
public CCodeExpression! right { get; set construct; }
public construct (CCodeBinaryOperator op, CCodeExpression! l, CCodeExpression! r) {
public CCodeBinaryExpression (CCodeBinaryOperator op, CCodeExpression! l, CCodeExpression! r) {
operator = op;
left = l;
right = r;
......
......@@ -33,7 +33,7 @@ public class Vala.CCodeCaseStatement : CCodeStatement {
private List<CCodeStatement> statements;
public construct (CCodeExpression! expr) {
public CCodeCaseStatement (CCodeExpression! expr) {
expression = expr;
}
......
......@@ -36,7 +36,7 @@ public class Vala.CCodeCastExpression : CCodeExpression {
*/
public string! type_name { get; set construct; }
public construct (CCodeExpression! expr, string! type) {
public CCodeCastExpression (CCodeExpression! expr, string! type) {
inner = expr;
type_name = type;
}
......
......@@ -31,7 +31,7 @@ public class Vala.CCodeComment : CCodeNode {
*/
public string! text { get; set construct; }
public construct (string! _text) {
public CCodeComment (string! _text) {
text = _text;
}
......
......@@ -41,7 +41,7 @@ public class Vala.CCodeConditionalExpression : CCodeExpression {
*/
public CCodeExpression! false_expression { get; set construct; }
public construct (CCodeExpression! cond, CCodeExpression! true_expr, CCodeExpression! false_expr) {
public CCodeConditionalExpression (CCodeExpression! cond, CCodeExpression! true_expr, CCodeExpression! false_expr) {
condition = cond;
true_expression = true_expr;
false_expression = false_expr;
......
......@@ -31,7 +31,7 @@ public class Vala.CCodeConstant : CCodeExpression {
*/
public string! name { get; set construct; }
public construct (string! _name) {
public CCodeConstant (string! _name) {
name = _name;
}
......
......@@ -38,7 +38,7 @@ public class Vala.CCodeDeclaration : CCodeStatement {
private List<CCodeDeclarator> declarators;
public construct (string! _type_name) {
public CCodeDeclaration (string! _type_name) {
type_name = _type_name;
}
......
......@@ -36,7 +36,7 @@ public class Vala.CCodeDoStatement : CCodeStatement {
*/
public CCodeExpression! condition { get; set construct; }
public construct (CCodeStatement stmt, CCodeExpression! cond) {
public CCodeDoStatement (CCodeStatement stmt, CCodeExpression! cond) {
body = stmt;
condition = cond;
}
......
......@@ -39,7 +39,7 @@ public class Vala.CCodeElementAccess : CCodeExpression {
*/
public CCodeExpression! index { get; set construct; }
public construct (CCodeExpression! cont, CCodeExpression! i) {
public CCodeElementAccess (CCodeExpression! cont, CCodeExpression! i) {
container = cont;
index = i;
}
......
......@@ -33,7 +33,7 @@ public class Vala.CCodeEnum : CCodeNode {
private List<string> values;
public construct (string n = null) {
public CCodeEnum (string n = null) {
name = n;
}
......
......@@ -31,7 +31,7 @@ public class Vala.CCodeExpressionStatement : CCodeStatement {
*/
public CCodeExpression! expression { get; set construct; }
public construct (CCodeExpression expr) {
public CCodeExpressionStatement (CCodeExpression expr) {
expression = expr;
}
......
......@@ -36,7 +36,7 @@ public class Vala.CCodeFormalParameter : CCodeNode {
*/
public string! type_name { get; set construct; }
public construct (string! n, string! type) {
public CCodeFormalParameter (string! n, string! type) {
name = n;
type_name = type;
}
......
......@@ -39,7 +39,7 @@ public class Vala.CCodeForStatement : CCodeStatement {
private List<CCodeExpression> initializer;
private List<CCodeExpression> iterator;
public construct (CCodeExpression! cond, CCodeStatement stmt = null) {
public CCodeForStatement (CCodeExpression! cond, CCodeStatement stmt = null) {
condition = cond;
body = stmt;
}
......
......@@ -48,7 +48,7 @@ public class Vala.CCodeFunction : CCodeNode {
private List<CCodeFormalParameter> parameters;
public construct (string! _name, string! _return_type) {
public CCodeFunction (string! _name, string! _return_type) {
name = _name;
return_type = _return_type;
}
......
......@@ -33,7 +33,7 @@ public class Vala.CCodeFunctionCall : CCodeExpression {
private List<CCodeExpression> arguments;
public construct (CCodeExpression _call = null) {
public CCodeFunctionCall (CCodeExpression _call = null) {
call = _call;
}
......
......@@ -33,7 +33,7 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator {
private List<CCodeFormalParameter> parameters;
public construct (string! n) {
public CCodeFunctionDeclarator (string! n) {
name = n;
}
......
......@@ -31,7 +31,7 @@ public class Vala.CCodeIdentifier : CCodeExpression {
*/
public string! name { get; set construct; }
public construct (string! _name) {
public CCodeIdentifier (string! _name) {
name = _name;
}
......
......@@ -41,7 +41,7 @@ public class Vala.CCodeIfStatement : CCodeStatement {
*/
public CCodeStatement false_statement { get; set construct; }
public construct (CCodeExpression! cond, CCodeStatement! true_stmt, CCodeStatement false_stmt = null) {
public CCodeIfStatement (CCodeExpression! cond, CCodeStatement! true_stmt, CCodeStatement false_stmt = null) {
condition = cond;
true_statement = true_stmt;
false_statement = false_stmt;
......
......@@ -37,7 +37,7 @@ public class Vala.CCodeIncludeDirective : CCodeNode {
*/
public bool local { get; set; }
public construct (string! _filename, bool _local = false) {
public CCodeIncludeDirective (string! _filename, bool _local = false) {
filename = _filename;
local = _local;
}
......
......@@ -36,7 +36,7 @@ public class Vala.CCodeLineDirective : CCodeNode {
*/
public int line { get; set; }
public construct (string! _filename, int _line) {
public CCodeLineDirective (string! _filename, int _line) {
filename = _filename;
line = _line;
}
......
......@@ -36,7 +36,7 @@ public class Vala.CCodeMacroReplacement : CCodeNode {
*/
public string! replacement { get; set construct; }
public construct (string! n, string! replace) {
public CCodeMacroReplacement (string! n, string! replace) {
name = n;
replacement = replace;
}
......
......@@ -41,13 +41,13 @@ public class Vala.CCodeMemberAccess : CCodeExpression {
*/
public bool is_pointer { get; set; }
public construct (CCodeExpression! container, string! member, bool pointer = false) {
public CCodeMemberAccess (CCodeExpression! container, string! member, bool pointer = false) {
inner = container;
member_name = member;
is_pointer = pointer;
}
public construct pointer (CCodeExpression! container, string! member) {
public CCodeMemberAccess.pointer (CCodeExpression! container, string! member) {
inner = container;
member_name = member;
is_pointer = true;
......
......@@ -31,7 +31,7 @@ public class Vala.CCodeOnceSection : CCodeFragment {
*/
public string! define { get; set construct; }
public construct (string! def) {
public CCodeOnceSection (string! def) {
define = def;
}
......
......@@ -31,7 +31,7 @@ public class Vala.CCodeParenthesizedExpression : CCodeExpression {
*/
public CCodeExpression! inner { get; set construct; }
public construct (CCodeExpression! expr) {
public CCodeParenthesizedExpression (CCodeExpression! expr) {
inner = expr;
}
......
......@@ -31,7 +31,7 @@ public class Vala.CCodeReturnStatement : CCodeStatement {
*/
public CCodeExpression return_expression { get; set; }
public construct (CCodeExpression expr = null) {
public CCodeReturnStatement (CCodeExpression expr = null) {
return_expression = expr;
}
......
......@@ -33,7 +33,7 @@ public class Vala.CCodeStruct : CCodeNode {
private List<CCodeDeclaration> declarations;
public construct (string! n) {
public CCodeStruct (string! n) {
name = n;
}
......
......@@ -33,7 +33,7 @@ public class Vala.CCodeSwitchStatement : CCodeStatement {
private List<CCodeCaseStatement> case_statements;
public construct (CCodeExpression! expr) {
public CCodeSwitchStatement (CCodeExpression! expr) {
expression = expr;
}
......
......@@ -36,7 +36,7 @@ public class Vala.CCodeTypeDefinition : CCodeNode {
*/
public CCodeDeclarator declarator { get; set; }
public construct (string type, CCodeDeclarator decl) {
public CCodeTypeDefinition (string type, CCodeDeclarator decl) {
type_name = type;
declarator = decl;
}
......
......@@ -36,7 +36,7 @@ public class Vala.CCodeUnaryExpression : CCodeExpression {
*/
public CCodeExpression! inner { get; set construct; }
public construct (CCodeUnaryOperator op, CCodeExpression! expr) {
public CCodeUnaryExpression (CCodeUnaryOperator op, CCodeExpression! expr) {
operator = op;
inner = expr;
}
......
......@@ -36,11 +36,11 @@ public class Vala.CCodeVariableDeclarator : CCodeDeclarator {
*/
public CCodeExpression initializer { get; set; }
public construct (string! _name) {
public CCodeVariableDeclarator (string! _name) {
name = _name;
}
public construct with_initializer (string! _name, CCodeExpression init) {
public CCodeVariableDeclarator.with_initializer (string! _name, CCodeExpression init) {
name = _name;
initializer = init;
}
......
......@@ -36,7 +36,7 @@ public class Vala.CCodeWhileStatement : CCodeStatement {
*/
public CCodeStatement body { get; set; }
public construct (CCodeExpression! cond, CCodeStatement stmt = null) {
public CCodeWhileStatement (CCodeExpression! cond, CCodeStatement stmt = null) {
condition = cond;
body = stmt;
}
......
......@@ -65,7 +65,7 @@ public class Vala.CCodeWriter {
/* at begin of line */
private bool _bol = true;
public construct (string! _filename) {
public CCodeWriter (string! _filename) {
filename = _filename;
}
......
......@@ -49,7 +49,7 @@ public class Vala.Array : DataType {
private ArrayResizeMethod resize_method;
public construct (DataType! _element_type, int _rank, SourceReference! _source_reference) {
public Array (DataType! _element_type, int _rank, SourceReference! _source_reference) {
rank = _rank;
element_type = _element_type;
source_reference = _source_reference;
......@@ -59,7 +59,7 @@ public class Vala.Array : DataType {
}
}
public construct with_type_parameter (TypeParameter! _element_type_parameter, int _rank, SourceReference! _source_reference) {
public Array.with_type_parameter (TypeParameter! _element_type_parameter, int _rank, SourceReference! _source_reference) {
rank = _rank;
element_type_parameter = _element_type_parameter;
source_reference = _source_reference;
......@@ -69,7 +69,7 @@ public class Vala.Array : DataType {
}
}
Array () {
construct {
/* FIXME: this implementation reveals compiler bugs
string commas = "";
int i = rank - 1;
......
......@@ -60,7 +60,7 @@ public class Vala.ArrayCreationExpression : Expression {
return sizes.copy ();
}
public construct (TypeReference _element_type, int _rank, InitializerList _initializer, SourceReference source) {
public ArrayCreationExpression (TypeReference _element_type, int _rank, InitializerList _initializer, SourceReference source) {
element_type = _element_type;
rank = _rank;
initializer_list = _initializer;
......
......@@ -26,7 +26,7 @@ using GLib;
* Represents the Array.length field.
*/
public class Vala.ArrayLengthField : Field {
ArrayLengthField () {
construct {
access = MemberAccessibility.PUBLIC;
var root_symbol = source_reference.file.context.get_root ();
......@@ -38,7 +38,7 @@ public class Vala.ArrayLengthField : Field {
*
* @return newly created field
*/
public construct (SourceReference! source) {
public ArrayLengthField (SourceReference! source) {
name = "length";
type_reference = new TypeReference ();
source_reference = source;
......
......@@ -26,7 +26,7 @@ using GLib;
* Represents the Array.resize method.
*/
public class Vala.ArrayResizeMethod : Method {
ArrayResizeMethod () {
construct {
access = MemberAccessibility.PUBLIC;
set_cname ("g_renew");
......@@ -45,7 +45,7 @@ public class Vala.ArrayResizeMethod : Method {
*
* @return newly created method
*/
public construct (SourceReference! _source_reference) {
public ArrayResizeMethod (SourceReference! _source_reference) {
name = "resize";
return_type = new TypeReference ();
source_reference = _source_reference;
......
......@@ -71,7 +71,7 @@ public class Vala.Assignment : Expression {
* @param source reference to source code
* @return newly created assignment
*/
public construct (Expression! _left, Expression! _right, AssignmentOperator _op = AssignmentOperator.SIMPLE, SourceReference _source = null) {
public Assignment (Expression! _left, Expression! _right, AssignmentOperator _op = AssignmentOperator.SIMPLE, SourceReference _source = null) {
left = _left;
operator = _op;
right = _right;
......
......@@ -43,7 +43,7 @@ public class Vala.Attribute : CodeNode {
* @param source reference to source code
* @return newly created attribute
*/
public construct (string! _name, SourceReference source) {
public Attribute (string! _name, SourceReference source) {
name = _name;
source_reference = source;
}
......
......@@ -32,7 +32,7 @@ public class Vala.BaseAccess : Expression {
* @param source reference to source code
* @return newly created base access expression
*/
public construct (SourceReference source = null) {
public BaseAccess (SourceReference source = null) {
source_reference = source;
}
......
......@@ -71,7 +71,7 @@ public class Vala.BinaryExpression : Expression {
* @param source reference to source code
* @return newly created binary expression
*/
public construct (BinaryOperator op, Expression! _left, Expression! _right, SourceReference source = null) {
public BinaryExpression (BinaryOperator op, Expression! _left, Expression! _right, SourceReference source = null) {
operator = op;
left = _left;
right = _right;
......
......@@ -40,7 +40,7 @@ public class Vala.Block : Statement {
*
* @param source reference to source code
*/
public construct (SourceReference source = null) {
public Block (SourceReference source = null) {
source_reference = source;
}
......
......@@ -38,7 +38,7 @@ public class Vala.BooleanLiteral : Literal {
* @param source reference to source code
* @return newly created boolean literal
*/
public construct (bool b, SourceReference source) {
public BooleanLiteral (bool b, SourceReference source) {
value = b;
source_reference = source;
}
......
......@@ -32,7 +32,7 @@ public class Vala.BreakStatement : Statement {
* @param source reference to source code
* @return newly created break statement
*/
public construct (SourceReference source) {
public BreakStatement (SourceReference source) {
source_reference = source;
}
......
......@@ -51,7 +51,7 @@ public class Vala.Callback : DataType {
* @param source reference to source code
* @return newly created callback
*/
public construct (string _name, TypeReference _return_type, SourceReference source = null) {
public Callback (string _name, TypeReference _return_type, SourceReference source = null) {
name = _name;
return_type = _return_type;
source_reference = source;
......
......@@ -53,7 +53,7 @@ public class Vala.CastExpression : Expression {
* @param type target type
* @return newly created cast expression
*/
public construct (Expression! _inner, TypeReference! type, SourceReference source) {
public CastExpression (Expression! _inner, TypeReference! type, SourceReference source) {
inner = _inner;
type_reference = type;
source_reference = source;
......
......@@ -51,7 +51,7 @@ public class Vala.CharacterLiteral : Literal {
* @param source reference to source code
* @return newly created character literal
*/
public construct (string! c, SourceReference source) {
public CharacterLiteral (string! c, SourceReference source) {
value = c;
source_reference = source;
......
......@@ -84,7 +84,7 @@ public class Vala.Class : DataType {
* @param source reference to source code
* @return newly created class
*/
public construct (string! _name, SourceReference source = null) {
public Class (string! _name, SourceReference source = null) {
name = _name;
source_reference = source;
}
......
......@@ -37,7 +37,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
* @param cl a class
* @return newly created class register function
*/
public construct (Class! cl) {
public ClassRegisterFunction (Class! cl) {
class_reference = cl;
}
......
......@@ -90,7 +90,7 @@ public class Vala.CodeGenerator : CodeVisitor {
DataType slist_type;
TypeReference mutex_type;
public construct (bool manage_memory = true) {
public CodeGenerator (bool manage_memory = true) {
memory_management = manage_memory;
predefined_marshal_list = new HashTable (str_hash, str_equal);
......
......@@ -49,7 +49,7 @@ public class Vala.ConditionalExpression : Expression {
* @param false_expr expression to be evaluated if condition is false
* @return newly created conditional expression
*/
public construct (Expression! cond, Expression! true_expr, Expression! false_expr, SourceReference source) {
public ConditionalExpression (Expression! cond, Expression! true_expr, Expression! false_expr, SourceReference source) {
condition = cond;
true_expression = true_expr;
false_expression = false_expr;
......
......@@ -62,7 +62,7 @@ public class Vala.Constant : Member, Lockable {
* @param source reference to source code
* @return newly created constant
*/
public construct (string! _name, TypeReference! type, Expression init, SourceReference source) {
public Constant (string! _name, TypeReference! type, Expression init, SourceReference source) {
name = _name;
type_reference = type;
initializer = init;
......
......@@ -51,7 +51,7 @@ public class Vala.Constructor : CodeNode {
* @param source reference to source code
* @return newly created constructor
*/
public construct (SourceReference source) {
public Constructor (SourceReference source) {
source_reference = source;
}
......
......@@ -32,7 +32,7 @@ public class Vala.ContinueStatement : Statement {
* @param source reference to source code
* @return newly created continue statement
*/
public construct (SourceReference source) {
public ContinueStatement (SourceReference source) {
source_reference = source;
}
......
......@@ -38,7 +38,7 @@ public class Vala.DeclarationStatement : Statement {
* @param source reference to source code
* @return newly created declaration statement
*/
public construct (LocalVariableDeclaration! decl, SourceReference source) {
public DeclarationStatement (LocalVariableDeclaration! decl, SourceReference source) {
declaration = decl;
source_reference = source;
}
......
......@@ -51,7 +51,7 @@ public class Vala.Destructor : CodeNode {
* @param source reference to source code
* @return newly created destructor
*/
public construct (SourceReference source) {
public Destructor (SourceReference source) {
source_reference = source;
}
......
......@@ -54,7 +54,7 @@ public class Vala.DoStatement : Statement {
* @param source reference to source code
* @return newly created do statement
*/
public construct (Statement! _body, Expression! cond, SourceReference source) {
public DoStatement (Statement! _body, Expression! cond, SourceReference source) {
body = _body;
condition = cond;
source_reference = source;
......
......@@ -44,7 +44,7 @@ public class Vala.ElementAccess : Expression {
return indices.copy ();
}
public construct (Expression _container, SourceReference source) {
public ElementAccess (Expression _container, SourceReference source) {
container = _container;
source_reference = source;
}
......
......@@ -32,7 +32,7 @@ public class Vala.EmptyStatement : Statement {
* @param source reference to source code
* @return newly created empty statement
*/
public construct (SourceReference source) {
public EmptyStatement (SourceReference source) {
source_reference = source;
}
......
......@@ -37,7 +37,7 @@ public class Vala.Enum : DataType {
* @param source reference to source code
* @return newly created enum
*/
public construct (string! _name, SourceReference source = null) {
public Enum (string! _name, SourceReference source = null) {
name = _name;
source_reference = source;
}
......
......@@ -44,7 +44,7 @@ public class Vala.EnumValue : CodeNode {
* @param name enum value name
* @return newly created enum value
*/
public construct (string! _name) {
public EnumValue (string! _name) {
name = _name;
}
......@@ -55,7 +55,7 @@ public class Vala.EnumValue : CodeNode {
* @param value numerical representation
* @return newly created enum value
*/
public construct with_value (string! _name, Expression _value) {
public EnumValue.with_value (string! _name, Expression _value) {
name = _name;
value = _value;
}
......
......@@ -49,7 +49,7 @@ public class Vala.ExpressionStatement : Statement {
* @param source reference to source code
* @return newly created expression statement
*/
public construct (Expression! expr, SourceReference source = null) {
public ExpressionStatement (Expression! expr, SourceReference source = null) {
expression = expr;
source_reference = source;
}
......
......@@ -82,7 +82,7 @@ public class Vala.Field : Member, Invokable, Lockable {
* @param source reference to source code
* @return newly created field
*/
public construct (string! _name, TypeReference! type, Expression init, SourceReference source) {
public Field (string! _name, TypeReference! type, Expression init, SourceReference source) {
name = _name;
type_reference = type;