2008-04-13 Jürg Billeter <j@bitron.ch>
+ * vala/valaparser.vala: report warning when using obsolete syntax
+ for non-null types
+
+ * */*.vala, */*.vapi: port to new syntax
+
+2008-04-13 Jürg Billeter <j@bitron.ch>
+
* vala/valaparser.vala: report warning when using deprecated syntax
for property default values
right = r;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
left.write (writer);
writer.write_string (" ");
/**
* The left operand.
*/
- public CCodeExpression! left { get; set construct; }
+ public CCodeExpression left { get; set construct; }
/**
* The right operand.
*/
- public CCodeExpression! right { get; set construct; }
+ public CCodeExpression right { get; set construct; }
- public CCodeBinaryExpression (CCodeBinaryOperator op, CCodeExpression! l, CCodeExpression! r) {
+ public CCodeBinaryExpression (CCodeBinaryOperator op, CCodeExpression l, CCodeExpression r) {
operator = op;
left = l;
right = r;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
left.write (writer);
writer.write_string (" ");
/* valaccodeblock.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
/**
* Prepend the specified statement to the list of statements.
*/
- public void prepend_statement (CCodeNode! statement) {
+ public void prepend_statement (CCodeNode statement) {
statements.insert (0, statement);
}
/**
* Append the specified statement to the list of statements.
*/
- public void add_statement (CCodeNode! statement) {
+ public void add_statement (CCodeNode statement) {
/* allow generic nodes to include comments */
statements.add (statement);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
// the last reachable statement
CCodeNode last_statement = null;
* Represents a break statement in the C code.
*/
public class Vala.CCodeBreakStatement : CCodeStatement {
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent (line);
writer.write_string ("break;");
writer.write_newline ();
/**
* The case expression.
*/
- public CCodeExpression! expression { get; set; }
+ public CCodeExpression expression { get; set; }
private Gee.List<CCodeStatement> statements = new ArrayList<CCodeStatement> ();
- public CCodeCaseStatement (construct CCodeExpression! expression) {
+ public CCodeCaseStatement (construct CCodeExpression expression) {
}
/**
*
* @param stmt a statement
*/
- public void add_statement (CCodeStatement! stmt) {
+ public void add_statement (CCodeStatement stmt) {
statements.add (stmt);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent (line);
writer.write_string ("case ");
expression.write (writer);
/**
* The expression to be cast.
*/
- public CCodeExpression! inner { get; set construct; }
+ public CCodeExpression inner { get; set construct; }
/**
* The target type.
*/
- public string! type_name { get; set construct; }
+ public string type_name { get; set construct; }
- public CCodeCastExpression (CCodeExpression! expr, string! type) {
+ public CCodeCastExpression (CCodeExpression expr, string type) {
inner = expr;
type_name = type;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_string ("((");
writer.write_string (type_name);
writer.write_string (") ");
*
* @param expr a C code expression
*/
- public void append_expression (CCodeExpression! expr) {
+ public void append_expression (CCodeExpression expr) {
inner.add (expr);
}
return new ReadOnlyCollection<CCodeExpression> (inner);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
bool first = true;
writer.write_string ("(");
/**
* The text content of the comment.
*/
- public string! text { get; set construct; }
+ public string text { get; set construct; }
- public CCodeComment (string! _text) {
+ public CCodeComment (string _text) {
text = _text;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_comment (text);
}
}
/**
* The condition.
*/
- public CCodeExpression! condition { get; set construct; }
+ public CCodeExpression condition { get; set construct; }
/**
* The expression to be evaluated if the condition holds.
*/
- public CCodeExpression! true_expression { get; set construct; }
+ public CCodeExpression true_expression { get; set construct; }
/**
* The expression to be evaluated if the condition doesn't hold.
*/
- public CCodeExpression! false_expression { get; set construct; }
+ public CCodeExpression false_expression { get; set construct; }
- public CCodeConditionalExpression (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;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_string ("(");
condition.write (writer);
writer.write_string (" ? ");
/**
* The name of this constant.
*/
- public string! name { get; set construct; }
+ public string name { get; set construct; }
- public CCodeConstant (string! _name) {
+ public CCodeConstant (string _name) {
name = _name;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_string (name);
}
}
* Represents a continue statement in the C code.
*/
public class Vala.CCodeContinueStatement : CCodeStatement {
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent (line);
writer.write_string ("continue;");
writer.write_newline ();
/**
* The type of the local variable.
*/
- public string! type_name { get; set; }
+ public string type_name { get; set; }
/**
* The declaration modifier.
private Gee.List<CCodeDeclarator> declarators = new ArrayList<CCodeDeclarator> ();
- public CCodeDeclaration (construct string! type_name) {
+ public CCodeDeclaration (construct string type_name) {
}
/**
*
* @param decl a declarator
*/
- public void add_declarator (CCodeDeclarator! decl) {
+ public void add_declarator (CCodeDeclarator decl) {
declarators.add (decl);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
if ((modifiers & (CCodeModifiers.STATIC | CCodeModifiers.EXTERN)) != 0) {
// combined declaration and initialization for static and extern variables
writer.write_indent (line);
return true;
}
- public override void write_declaration (CCodeWriter! writer) {
+ public override void write_declaration (CCodeWriter writer) {
if ((modifiers & (CCodeModifiers.STATIC | CCodeModifiers.EXTERN)) != 0) {
// no separate declaration for static variables
return;
*
* @param writer a C code writer
*/
- public virtual void write_initialization (CCodeWriter! writer) {
+ public virtual void write_initialization (CCodeWriter writer) {
}
}
/**
* The loop condition.
*/
- public CCodeExpression! condition { get; set construct; }
+ public CCodeExpression condition { get; set construct; }
- public CCodeDoStatement (CCodeStatement stmt, CCodeExpression! cond) {
+ public CCodeDoStatement (CCodeStatement stmt, CCodeExpression cond) {
body = stmt;
condition = cond;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent (line);
writer.write_string ("do");
/**
* Expression representing the container on which we want to access.
*/
- public CCodeExpression! container { get; set construct; }
+ public CCodeExpression container { get; set construct; }
/**
* Expression representing the index we want to access inside the
* container.
*/
- public CCodeExpression! index { get; set construct; }
+ public CCodeExpression index { get; set construct; }
- public CCodeElementAccess (CCodeExpression! cont, CCodeExpression! i) {
+ public CCodeElementAccess (CCodeExpression cont, CCodeExpression i) {
container = cont;
index = i;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
container.write (writer);
writer.write_string ("[");
index.write (writer);
* Represents an empty statement in the C code.
*/
public class Vala.CCodeEmptyStatement : CCodeStatement {
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent ();
writer.write_string (";");
writer.write_newline ();
* @param name enum value name
* @param value optional numerical value
*/
- public void add_value (CCodeEnumValue! value) {
+ public void add_value (CCodeEnumValue value) {
values.add (value);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
if (name != null) {
writer.write_string ("typedef ");
}
/**
* The name of this enum value.
*/
- public string! name { get; set; }
+ public string name { get; set; }
/**
* The numerical representation of this enum value.
*/
public CCodeExpression value { get; set; }
- public CCodeEnumValue (construct string! name, construct CCodeExpression value = null) {
+ public CCodeEnumValue (construct string name, construct CCodeExpression value = null) {
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_string (name);
if (value != null) {
writer.write_string (" = ");
/**
* The expression to evaluate.
*/
- public CCodeExpression! expression { get; set construct; }
+ public CCodeExpression expression { get; set construct; }
public CCodeExpressionStatement (CCodeExpression expr) {
expression = expr;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
if (expression is CCodeCommaExpression) {
// expand comma expression into multiple statements
// to improve code readability
*/
public bool ellipsis { get; set; }
- public CCodeFormalParameter (string! n, string! type) {
+ public CCodeFormalParameter (string n, string type) {
name = n;
type_name = type;
}
ellipsis = true;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
if (!ellipsis) {
writer.write_string (type_name);
writer.write_string (" ");
/**
* The loop condition.
*/
- public CCodeExpression! condition { get; set; }
+ public CCodeExpression condition { get; set; }
/**
* The loop body.
private Gee.List<CCodeExpression> initializer = new ArrayList<CCodeExpression> ();
private Gee.List<CCodeExpression> iterator = new ArrayList<CCodeExpression> ();
- public CCodeForStatement (construct CCodeExpression! condition, construct CCodeStatement body = null) {
+ public CCodeForStatement (construct CCodeExpression condition, construct CCodeStatement body = null) {
}
/**
*
* @param expr an initializer expression
*/
- public void add_initializer (CCodeExpression! expr) {
+ public void add_initializer (CCodeExpression expr) {
initializer.add (expr);
}
*
* @param expr an iterator expression
*/
- public void add_iterator (CCodeExpression! expr) {
+ public void add_iterator (CCodeExpression expr) {
iterator.add (expr);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
bool first;
writer.write_indent (line);
*
* @param node a C code node
*/
- public void append (CCodeNode! node) {
+ public void append (CCodeNode node) {
children.add (node);
}
return new ReadOnlyCollection<CCodeNode> (children);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
foreach (CCodeNode node in children) {
node.write (writer);
}
}
- public override void write_declaration (CCodeWriter! writer) {
+ public override void write_declaration (CCodeWriter writer) {
foreach (CCodeNode node in children) {
node.write_declaration (writer);
}
}
- public override void write_combined (CCodeWriter! writer) {
+ public override void write_combined (CCodeWriter writer) {
foreach (CCodeNode node in children) {
node.write_combined (writer);
}
/**
* The name of this function.
*/
- public string! name { get; set; }
+ public string name { get; set; }
/**
* The function modifiers.
/**
* The function return type.
*/
- public string! return_type { get; set; }
+ public string return_type { get; set; }
/**
* The function body.
private Gee.List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
- public CCodeFunction (construct string! name, construct string! return_type) {
+ public CCodeFunction (construct string name, construct string return_type) {
}
/**
*
* @param param a formal parameter
*/
- public void add_parameter (CCodeFormalParameter! param) {
+ public void add_parameter (CCodeFormalParameter param) {
parameters.add (param);
}
*
* @return copied function
*/
- public CCodeFunction! copy () {
+ public CCodeFunction copy () {
var func = new CCodeFunction (name, return_type);
func.modifiers = modifiers;
return func;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent (line);
if (CCodeModifiers.STATIC in modifiers) {
writer.write_string ("static ");
*
* @param expr a C code expression
*/
- public void add_argument (CCodeExpression! expr) {
+ public void add_argument (CCodeExpression expr) {
arguments.add (expr);
}
return new ReadOnlyList<CCodeExpression> (arguments);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
call.write (writer);
writer.write_string (" (");
/**
* The declarator name.
*/
- public string! name { get; set; }
+ public string name { get; set; }
private Gee.List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
- public CCodeFunctionDeclarator (construct string! name) {
+ public CCodeFunctionDeclarator (construct string name) {
}
/**
*
* @param param a formal parameter
*/
- public void add_parameter (CCodeFormalParameter! param) {
+ public void add_parameter (CCodeFormalParameter param) {
parameters.add (param);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
write_declaration (writer);
}
- public override void write_declaration (CCodeWriter! writer) {
+ public override void write_declaration (CCodeWriter writer) {
writer.write_string ("(*");
writer.write_string (name);
writer.write_string (") (");
/**
* The name of the target label.
*/
- public string! name { get; set construct; }
+ public string name { get; set construct; }
- public CCodeGotoStatement (construct string! name) {
+ public CCodeGotoStatement (construct string name) {
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent ();
writer.write_string ("goto ");
writer.write_string (name);
/**
* The name of this identifier.
*/
- public string! name { get; set construct; }
+ public string name { get; set construct; }
- public CCodeIdentifier (string! _name) {
+ public CCodeIdentifier (string _name) {
name = _name;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_string (name);
}
}
/**
* The boolean condition to evaluate.
*/
- public CCodeExpression! condition { get; set construct; }
+ public CCodeExpression condition { get; set construct; }
/**
* The statement to be evaluated if the condition holds.
*/
- public CCodeStatement! true_statement { get; set construct; }
+ public CCodeStatement true_statement { get; set construct; }
/**
* The optional statement to be evaluated if the condition doesn't hold.
*/
public CCodeStatement false_statement { get; set construct; }
- public CCodeIfStatement (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;
*/
public bool else_if { get; set; }
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
if (!else_if) {
writer.write_indent (line);
} else {
/**
* The file to be included.
*/
- public string! filename { get; set construct; }
+ public string filename { get; set construct; }
/**
* Specifies whether the specified file should be searched in the local
*/
public bool local { get; set; }
- public CCodeIncludeDirective (string! _filename, bool _local = false) {
+ public CCodeIncludeDirective (string _filename, bool _local = false) {
filename = _filename;
local = _local;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent ();
writer.write_string ("#include ");
if (local) {
*
* @param expr an expression
*/
- public void append (CCodeExpression! expr) {
+ public void append (CCodeExpression expr) {
initializers.add (expr);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_string ("{");
bool first = true;
/**
* The name of this label.
*/
- public string! name { get; set construct; }
+ public string name { get; set construct; }
- public CCodeLabel (construct string! name) {
+ public CCodeLabel (construct string name) {
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent ();
writer.write_string (name);
writer.write_string (":");
/**
* The name of the source file to be presumed.
*/
- public string! filename { get; set construct; }
+ public string filename { get; set construct; }
/**
* The line number in the source file to be presumed.
*/
public int line { get; set; }
- public CCodeLineDirective (string! _filename, int _line) {
+ public CCodeLineDirective (string _filename, int _line) {
filename = _filename;
line = _line;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
if (!writer.bol) {
writer.write_newline ();
}
/**
* The name of this macro.
*/
- public string! name { get; set construct; }
+ public string name { get; set construct; }
/**
* The replacement of this macro.
*/
- public string! replacement { get; set; }
+ public string replacement { get; set; }
/**
* The replacement expression of this macro.
*/
public CCodeExpression replacement_expression { get; set; }
- public CCodeMacroReplacement (construct string! name, construct string! replacement) {
+ public CCodeMacroReplacement (construct string name, construct string replacement) {
}
- public CCodeMacroReplacement.with_expression (construct string! name, construct CCodeExpression! replacement_expression) {
+ public CCodeMacroReplacement.with_expression (construct string name, construct CCodeExpression replacement_expression) {
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent ();
writer.write_string ("#define ");
writer.write_string (name);
/**
* The parent of the member.
*/
- public CCodeExpression! inner { get; set construct; }
+ public CCodeExpression inner { get; set construct; }
/**
* The name of the member.
*/
- public string! member_name { get; set construct; }
+ public string member_name { get; set construct; }
/**
* Specifies whether the member access happens by pointer dereferencing.
*/
public bool is_pointer { get; set; }
- public CCodeMemberAccess (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 CCodeMemberAccess.pointer (CCodeExpression! container, string! member) {
+ public CCodeMemberAccess.pointer (CCodeExpression container, string member) {
inner = container;
member_name = member;
is_pointer = true;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
inner.write (writer);
if (is_pointer) {
writer.write_string ("->");
* Represents a line break in the C code.
*/
public class Vala.CCodeNewline : CCodeNode {
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_newline ();
}
}
*
* @param writer a C code writer
*/
- public abstract void write (CCodeWriter! writer);
+ public abstract void write (CCodeWriter writer);
/**
* Writes declaration for this code node with the specified C code
*
* @param writer a C code writer
*/
- public virtual void write_declaration (CCodeWriter! writer) {
+ public virtual void write_declaration (CCodeWriter writer) {
}
/**
*
* @param writer a C code writer
*/
- public virtual void write_combined (CCodeWriter! writer) {
+ public virtual void write_combined (CCodeWriter writer) {
write_declaration (writer);
write (writer);
}
/**
* The name of the guarding define.
*/
- public string! define { get; set construct; }
+ public string define { get; set construct; }
- public CCodeOnceSection (string! def) {
+ public CCodeOnceSection (string def) {
define = def;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent ();
writer.write_string ("#ifndef ");
writer.write_string (define);
writer.write_newline ();
}
- public override void write_declaration (CCodeWriter! writer) {
+ public override void write_declaration (CCodeWriter writer) {
}
}
/**
* The expression in the parenthesis.
*/
- public CCodeExpression! inner { get; set construct; }
+ public CCodeExpression inner { get; set construct; }
- public CCodeParenthesizedExpression (CCodeExpression! expr) {
+ public CCodeParenthesizedExpression (CCodeExpression expr) {
inner = expr;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_string ("(");
inner.write (writer);
return_expression = expr;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent (line);
writer.write_string ("return");
/**
* The struct name.
*/
- public string! name { get; set; }
+ public string name { get; set; }
private Gee.List<CCodeDeclaration> declarations = new ArrayList<CCodeDeclaration> ();
- public CCodeStruct (construct string! name) {
+ public CCodeStruct (construct string name) {
}
/**
*
* @param decl a variable declaration
*/
- public void add_declaration (CCodeDeclaration! decl) {
+ public void add_declaration (CCodeDeclaration decl) {
declarations.add (decl);
}
* @param type_name field type
* @param name member name
*/
- public void add_field (string! type_name, string! name) {
+ public void add_field (string type_name, string name) {
var decl = new CCodeDeclaration (type_name);
decl.add_declarator (new CCodeVariableDeclarator (name));
add_declaration (decl);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_string ("struct ");
writer.write_string (name);
writer.write_begin_block ();
/**
* The switch expression.
*/
- public CCodeExpression! expression { get; set; }
+ public CCodeExpression expression { get; set; }
private Gee.List<CCodeCaseStatement> case_statements = new ArrayList<CCodeCaseStatement> ();
private Gee.List<CCodeStatement> default_statements = new ArrayList<CCodeStatement> ();
- public CCodeSwitchStatement (construct CCodeExpression! expression) {
+ public CCodeSwitchStatement (construct CCodeExpression expression) {
}
/**
*
* @param case_stmt a case statement
*/
- public void add_case (CCodeCaseStatement! case_stmt) {
+ public void add_case (CCodeCaseStatement case_stmt) {
case_statements.add (case_stmt);
}
*
* @param stmt a statement
*/
- public void add_default_statement (CCodeStatement! stmt) {
+ public void add_default_statement (CCodeStatement stmt) {
default_statements.add (stmt);
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent (line);
writer.write_string ("switch (");
expression.write (writer);
declarator = decl;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
}
- public override void write_declaration (CCodeWriter! writer) {
+ public override void write_declaration (CCodeWriter writer) {
writer.write_indent ();
writer.write_string ("typedef ");
/**
* The operand.
*/
- public CCodeExpression! inner { get; set construct; }
+ public CCodeExpression inner { get; set construct; }
- public CCodeUnaryExpression (CCodeUnaryOperator op, CCodeExpression! expr) {
+ public CCodeUnaryExpression (CCodeUnaryOperator op, CCodeExpression expr) {
operator = op;
inner = expr;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
if (operator == CCodeUnaryOperator.PLUS) {
writer.write_string ("+");
} else if (operator == CCodeUnaryOperator.MINUS) {
/**
* The variable name.
*/
- public string! name { get; set construct; }
+ public string name { get; set construct; }
/**
* The optional initializer expression.
*/
public CCodeExpression initializer { get; set; }
- public CCodeVariableDeclarator (string! _name) {
+ public CCodeVariableDeclarator (string _name) {
name = _name;
}
- public CCodeVariableDeclarator.with_initializer (string! _name, CCodeExpression init) {
+ public CCodeVariableDeclarator.with_initializer (string _name, CCodeExpression init) {
name = _name;
initializer = init;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_string (name);
if (initializer != null) {
}
}
- public override void write_declaration (CCodeWriter! writer) {
+ public override void write_declaration (CCodeWriter writer) {
writer.write_string (name);
// initializer lists can't be moved to a separate statement
}
}
- public override void write_initialization (CCodeWriter! writer) {
+ public override void write_initialization (CCodeWriter writer) {
if (initializer != null && !(initializer is CCodeInitializerList)) {
writer.write_indent (line);
/**
* The loop condition.
*/
- public CCodeExpression! condition { get; set construct; }
+ public CCodeExpression condition { get; set construct; }
/**
* The loop body.
*/
public CCodeStatement body { get; set; }
- public CCodeWhileStatement (CCodeExpression! cond, CCodeStatement stmt = null) {
+ public CCodeWhileStatement (CCodeExpression cond, CCodeStatement stmt = null) {
condition = cond;
body = stmt;
}
- public override void write (CCodeWriter! writer) {
+ public override void write (CCodeWriter writer) {
writer.write_indent (line);
writer.write_string ("while (");
/* at begin of line */
private bool _bol = true;
- public CCodeWriter (string! _filename) {
+ public CCodeWriter (string _filename) {
filename = _filename;
}
*
* @param s a string
*/
- public void write_string (string! s) {
+ public void write_string (string s) {
stream.printf ("%s", s);
_bol = false;
}
*
* @param text the comment text
*/
- public void write_comment (string! text) {
+ public void write_comment (string text) {
write_indent ();
stream.printf ("/*");
bool first = true;
}
}
- private bool add_package (CodeContext! context, string! pkg) {
+ private bool add_package (CodeContext context, string pkg) {
if (context.has_package (pkg)) {
// ignore multiple occurences of the same package
return true;
}
/* ported from glibc */
- private static string! realpath (string! name) {
+ private static string realpath (string name) {
string rpath;
// start of path component
// concurrent modification protection
public int _stamp = 0;
- public Iterator (construct ArrayList! list) {
+ public Iterator (construct ArrayList list) {
}
public bool next () {
private HashMap<K,V> _map;
- public KeySet (construct HashMap! map) {
+ public KeySet (construct HashMap map) {
}
public Type get_element_type () {
// concurrent modification protection
private int _stamp;
- public KeyIterator (construct HashMap! map) {
+ public KeyIterator (construct HashMap map) {
}
public bool next () {
private HashMap<K,V> _map;
- public ValueCollection (construct HashMap! map) {
+ public ValueCollection (construct HashMap map) {
}
public Type get_element_type () {
// concurrent modification protection
private int _stamp;
- public ValueIterator (construct HashMap! map) {
+ public ValueIterator (construct HashMap map) {
}
public bool next () {
// concurrent modification protection
private int _stamp = 0;
- public Iterator (construct HashSet! set) {
+ public Iterator (construct HashSet set) {
}
public bool next () {
ok_button.grab_default ();
}
- private HBox create_hbox (string! title, SizeGroup! size_group) {
+ private HBox create_hbox (string title, SizeGroup size_group) {
var hbox = new HBox (false, 6);
((VBox) vbox).pack_start (hbox, false, false, 0);
hbox.show ();
project_name = Path.get_basename (project_path);
// only use [a-zA-Z0-9-]* as projectname
- String project_name_str = new String ();
- String make_name_str = new String ();
- String namespace_name_str = new String ();
+ var project_name_str = new StringBuilder ();
+ var make_name_str = new StringBuilder ();
+ var namespace_name_str = new StringBuilder ();
for (int i = 0; i < project_name.len (); i++) {
unichar c = project_name[i];
if ((c >= 'a' && c <= 'z' ) || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) {
}
private void write_autogen_sh () throws FileError {
- String s = new String();
+ var s = new StringBuilder ();
s.append ("#!/bin/sh\n");
s.append ("# Run this to generate all the initial makefiles, etc.\n\n");
private void write_configure_ac () throws FileError {
bool use_gtk = (project_type == ProjectType.GTK_APPLICATION);
- String s = new String();
+ var s = new StringBuilder ();
s.append_printf ("AC_INIT([%s], [0.1.0], [%s], [%s])\n", project_name, email_address, project_name);
s.append ("AC_CONFIG_SRCDIR([Makefile.am])\n");
private void write_makefile_am () throws FileError {
bool use_gtk = (project_type == ProjectType.GTK_APPLICATION);
- String s = new String();
+ var s = new StringBuilder ();
s.append ("NULL = \n\n");
FileUtils.set_contents (project_path + "/Makefile.am", s.str, -1);
}
- private string generate_source_file_header (string! filename) {
- String s = new String();
+ private string generate_source_file_header (string filename) {
+ var s = new StringBuilder ();
TimeVal tv;
tv.get_current_time ();
}
private void write_main_vala () throws FileError {
- String s = new String();
+ var s = new StringBuilder ();
s.append (generate_source_file_header ("main.vala"));
}
private void write_mainwindow_vala () throws FileError {
- String s = new String();
+ var s = new StringBuilder ();
s.append (generate_source_file_header ("mainwindow.vala"));
private void write_potfiles () throws FileError {
bool use_gtk = (project_type == ProjectType.GTK_APPLICATION);
- String s = new String();
+ var s = new StringBuilder ();
s.append ("[encoding: UTF-8]\n");
s.append ("# List of source files which contain translatable strings.\n");
namespace GLib {
[CCode (cheader_filename = "gidlparser.h")]
public static class Idl {
- public static List<IdlModule> parse_file (string! filename) throws MarkupError;
+ public static List<IdlModule> parse_file (string filename) throws MarkupError;
}
[CCode (free_function = "g_idl_module_free", cheader_filename = "gidlmodule.h")]
* The link between an assignment and generated code.
*/
public class Vala.CCodeArrayCreationExpressionBinding : CCodeExpressionBinding {
- public ArrayCreationExpression! array_creation_expression { get; set; }
+ public ArrayCreationExpression array_creation_expression { get; set; }
- public CCodeArrayCreationExpressionBinding (construct CodeGenerator! codegen, construct ArrayCreationExpression! array_creation_expression) {
+ public CCodeArrayCreationExpressionBinding (construct CodeGenerator codegen, construct ArrayCreationExpression array_creation_expression) {
}
public override void emit () {
* The link between an assignment and generated code.
*/
public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
- public Assignment! assignment { get; set; }
+ public Assignment assignment { get; set; }
- public CCodeAssignmentBinding (construct CodeGenerator! codegen, construct Assignment! assignment) {
+ public CCodeAssignmentBinding (construct CodeGenerator codegen, construct Assignment assignment) {
}
private void emit_property_assignment () {
* @param context a code context
*/
[NoArrayLength]
- public void compile (CodeContext! context, string cc_command, string[] cc_options) {
+ public void compile (CodeContext context, string cc_command, string[] cc_options) {
string pc = "pkg-config --cflags";
if (!context.compile_only) {
pc += " --libs";
* The link between an element access and generated code.
*/
public class Vala.CCodeElementAccessBinding : CCodeExpressionBinding {
- public ElementAccess! element_access { get; set; }
+ public ElementAccess element_access { get; set; }
- public CCodeElementAccessBinding (construct CodeGenerator! codegen, construct ElementAccess! element_access) {
+ public CCodeElementAccessBinding (construct CodeGenerator codegen, construct ElementAccess element_access) {
}
public override void emit () {
public ErrorType gerror_type;
public Typesymbol glist_type;
public Typesymbol gslist_type;
- public Typesymbol gstring_type;
public Typesymbol gstringbuilder_type;
public Typesymbol garray_type;
public DataType gquark_type;
c_keywords.add ("cdecl");
}
- public override void emit (CodeContext! context) {
+ public override void emit (CodeContext context) {
this.context = context;
context.find_header_cycles ();
gerror_type = new ErrorType (null, null);
glist_type = (Typesymbol) glib_ns.scope.lookup ("List");
gslist_type = (Typesymbol) glib_ns.scope.lookup ("SList");
- gstring_type = (Typesymbol) glib_ns.scope.lookup ("StringBuilder");
- gstringbuilder_type = (Typesymbol) glib_ns.scope.lookup ("String");
+ gstringbuilder_type = (Typesymbol) glib_ns.scope.lookup ("StringBuilder");
garray_type = (Typesymbol) glib_ns.scope.lookup ("Array");
gquark_type = new ValueType ((Typesymbol) glib_ns.scope.lookup ("Quark"));
}
}
- public override void visit_enum (Enum! en) {
+ public override void visit_enum (Enum en) {
cenum = new CCodeEnum (en.get_cname ());
if (en.source_reference.comment != null) {
source_type_member_definition.append (regfun);
}
- public override void visit_enum_value (EnumValue! ev) {
+ public override void visit_enum_value (EnumValue ev) {
if (ev.value == null) {
cenum.add_value (new CCodeEnumValue (ev.get_cname ()));
} else {
}
}
- public override void visit_delegate (Delegate! d) {
+ public override void visit_delegate (Delegate d) {
d.accept_children (this);
var cfundecl = new CCodeFunctionDeclarator (d.get_cname ());
}
}
- public override void visit_member (Member! m) {
+ public override void visit_member (Member m) {
/* stuff meant for all lockable members */
if (m is Lockable && ((Lockable)m).get_lock_used ()) {
instance_priv_struct.add_field (mutex_type.get_cname (), get_symbol_lock_name (m));
}
}
- public override void visit_constant (Constant! c) {
+ public override void visit_constant (Constant c) {
c.accept_children (this);
if (!c.is_internal_symbol () && !(c.type_reference is ArrayType)) {
}
}
- public override void visit_field (Field! f) {
+ public override void visit_field (Field f) {
f.accept_children (this);
var cl = f.parent_symbol as Class;
}
}
- private bool is_constant_ccode_expression (CCodeExpression! cexpr) {
+ private bool is_constant_ccode_expression (CCodeExpression cexpr) {
if (cexpr is CCodeConstant) {
return true;
} else if (cexpr is CCodeBinaryExpression) {
* Returns whether the passed cexpr is a pure expression, i.e. an
* expression without side-effects.
*/
- public bool is_pure_ccode_expression (CCodeExpression! cexpr) {
+ public bool is_pure_ccode_expression (CCodeExpression cexpr) {
if (cexpr is CCodeConstant || cexpr is CCodeIdentifier) {
return true;
} else if (cexpr is CCodeBinaryExpression) {
return (null != cparenthesized && is_pure_ccode_expression (cparenthesized.inner));
}
- public override void visit_formal_parameter (FormalParameter! p) {
+ public override void visit_formal_parameter (FormalParameter p) {
p.accept_children (this);
if (!p.ellipsis) {
}
}
- public override void visit_property (Property! prop) {
+ public override void visit_property (Property prop) {
int old_next_temp_var_id = next_temp_var_id;
next_temp_var_id = 0;
}
}
- public override void visit_property_accessor (PropertyAccessor! acc) {
+ public override void visit_property_accessor (PropertyAccessor acc) {
current_property_accessor = acc;
current_method_inner_error = false;
current_property_accessor = null;
}
- public override void visit_constructor (Constructor! c) {
+ public override void visit_constructor (Constructor c) {
current_method_inner_error = false;
in_constructor = true;
}
}
- public override void visit_destructor (Destructor! d) {
+ public override void visit_destructor (Destructor d) {
d.accept_children (this);
}
- public override void visit_block (Block! b) {
+ public override void visit_block (Block b) {
current_symbol = b;
b.accept_children (this);
current_symbol = current_symbol.parent_symbol;
}
- public override void visit_empty_statement (EmptyStatement! stmt) {
+ public override void visit_empty_statement (EmptyStatement stmt) {
stmt.ccodenode = new CCodeEmptyStatement ();
}
- public override void visit_declaration_statement (DeclarationStatement! stmt) {
+ public override void visit_declaration_statement (DeclarationStatement stmt) {
/* split declaration statement as var declarators
* might have different types */
temp_vars.clear ();
}
- private string! get_variable_cname (string! name) {
+ private string get_variable_cname (string name) {
if (c_keywords.contains (name)) {
return name + "_";
} else {
}
}
- public override void visit_variable_declarator (VariableDeclarator! decl) {
+ public override void visit_variable_declarator (VariableDeclarator decl) {
decl.accept_children (this);
if (decl.type_reference is ArrayType) {
decl.active = true;
}
- public override void visit_initializer_list (InitializerList! list) {
+ public override void visit_initializer_list (InitializerList list) {
list.accept_children (this);
var clist = new CCodeInitializerList ();
list.ccodenode = clist;
}
- public VariableDeclarator get_temp_variable_declarator (DataType! type, bool takes_ownership = true, CodeNode node_reference = null) {
+ public VariableDeclarator get_temp_variable_declarator (DataType type, bool takes_ownership = true, CodeNode node_reference = null) {
var decl = new VariableDeclarator ("_tmp%d".printf (next_temp_var_id));
decl.type_reference = type.copy ();
decl.type_reference.is_ref = false;
return decl;
}
- private CCodeExpression get_type_id_expression (DataType! type) {
+ private CCodeExpression get_type_id_expression (DataType type) {
if (type.data_type != null) {
return new CCodeIdentifier (type.data_type.get_type_id ());
} else if (type.type_parameter != null) {
}
}
- private CCodeExpression get_dup_func_expression (DataType! type, SourceReference source_reference) {
+ private CCodeExpression get_dup_func_expression (DataType type, SourceReference source_reference) {
if (type.data_type != null) {
string dup_function;
if (type.data_type.is_reference_counting ()) {
}
}
- private CCodeExpression get_destroy_func_expression (DataType! type) {
+ private CCodeExpression get_destroy_func_expression (DataType type) {
if (type.data_type != null) {
string unref_function;
if (type.data_type.is_reference_counting ()) {
}
}
- public CCodeExpression get_unref_expression (CCodeExpression! cvar, DataType! type, Expression expr) {
+ public CCodeExpression get_unref_expression (CCodeExpression cvar, DataType type, Expression expr) {
/* (foo == NULL ? NULL : foo = (unref (foo), NULL)) */
/* can be simplified to
cunrefcall.add_argument (new CCodeConstant ("NULL"));
ccomma.append_expression (cunrefcall);
}
- } else if (type.data_type == gstring_type || type.data_type == gstringbuilder_type) {
+ } else if (type.data_type == gstringbuilder_type) {
ccall.add_argument (new CCodeConstant ("TRUE"));
} else if (type is ArrayType) {
var array_type = (ArrayType) type;
return new CCodeConditionalExpression (cisnull, new CCodeConstant ("NULL"), new CCodeParenthesizedExpression (cassign));
}
- public override void visit_end_full_expression (Expression! expr) {
+ public override void visit_end_full_expression (Expression expr) {
/* expr is a full expression, i.e. an initializer, the
* expression in an expression statement, the controlling
* expression in if, while, for, or foreach statements
temp_ref_vars.clear ();
}
- private void append_temp_decl (CCodeFragment! cfrag, Collection<VariableDeclarator> temp_vars) {
+ private void append_temp_decl (CCodeFragment cfrag, Collection<VariableDeclarator> temp_vars) {
foreach (VariableDeclarator decl in temp_vars) {
var cdecl = new CCodeDeclaration (decl.type_reference.get_cname (true, !decl.type_reference.takes_ownership));
}
}
- private void add_simple_check (CodeNode! node, CCodeFragment! cfrag) {
+ private void add_simple_check (CodeNode node, CCodeFragment cfrag) {
current_method_inner_error = true;
var cprint_frag = new CCodeFragment ();
}
}
- public override void visit_expression_statement (ExpressionStatement! stmt) {
+ public override void visit_expression_statement (ExpressionStatement stmt) {
stmt.ccodenode = new CCodeExpressionStatement ((CCodeExpression) stmt.expression.ccodenode);
if (stmt.tree_can_fail && stmt.expression.can_fail) {
temp_ref_vars.clear ();
}
- private void create_temp_decl (Statement! stmt, Collection<VariableDeclarator> temp_vars) {
+ private void create_temp_decl (Statement stmt, Collection<VariableDeclarator> temp_vars) {
/* declare temporary variables */
if (temp_vars.size == 0) {
((CodeNode) stmt).ccodenode = cfrag;
}
- public override void visit_if_statement (IfStatement! stmt) {
+ public override void visit_if_statement (IfStatement stmt) {
stmt.accept_children (this);
if (stmt.false_statement != null) {
create_temp_decl (stmt, stmt.condition.temp_vars);
}
- public override void visit_switch_statement (SwitchStatement! stmt) {
+ public override void visit_switch_statement (SwitchStatement stmt) {
// we need a temporary variable to save the property value
var temp_decl = get_temp_variable_declarator (stmt.expression.static_type, true, stmt);
stmt.expression.temp_vars.insert (0, temp_decl);
cswitchblock.append (ctopstmt);
}
- public override void visit_switch_section (SwitchSection! section) {
+ public override void visit_switch_section (SwitchSection section) {
visit_block (section);
}
- public override void visit_while_statement (WhileStatement! stmt) {
+ public override void visit_while_statement (WhileStatement stmt) {
stmt.accept_children (this);
stmt.ccodenode = new CCodeWhileStatement ((CCodeExpression) stmt.condition.ccodenode, (CCodeStatement) stmt.body.ccodenode);
create_temp_decl (stmt, stmt.condition.temp_vars);
}
- public override void visit_do_statement (DoStatement! stmt) {
+ public override void visit_do_statement (DoStatement stmt) {
stmt.accept_children (this);
stmt.ccodenode = new CCodeDoStatement ((CCodeStatement) stmt.body.ccodenode, (CCodeExpression) stmt.condition.ccodenode);
create_temp_decl (stmt, stmt.condition.temp_vars);
}
- public override void visit_for_statement (ForStatement! stmt) {
+ public override void visit_for_statement (ForStatement stmt) {
stmt.accept_children (this);
CCodeExpression ccondition = null;
}
}
- public override void visit_foreach_statement (ForeachStatement! stmt) {
+ public override void visit_foreach_statement (ForeachStatement stmt) {
stmt.variable_declarator.active = true;
stmt.collection_variable_declarator.active = true;
if (stmt.iterator_variable_declarator != null) {
}
}
- public override void visit_break_statement (BreakStatement! stmt) {
+ public override void visit_break_statement (BreakStatement stmt) {
stmt.ccodenode = new CCodeBreakStatement ();
create_local_free (stmt, true);
}
- public override void visit_continue_statement (ContinueStatement! stmt) {
+ public override void visit_continue_statement (ContinueStatement stmt) {
stmt.ccodenode = new CCodeContinueStatement ();
create_local_free (stmt, true);
expr.temp_vars.add (return_expr_decl);
}
- public override void visit_return_statement (ReturnStatement! stmt) {
+ public override void visit_return_statement (ReturnStatement stmt) {
if (stmt.return_expression != null) {
// avoid unnecessary ref/unref pair
if (stmt.return_expression.ref_missing &&
}
}
- public override void visit_throw_statement (ThrowStatement! stmt) {
+ public override void visit_throw_statement (ThrowStatement stmt) {
stmt.accept_children (this);
var cfrag = new CCodeFragment ();
stmt.ccodenode = cfrag;
}
- public override void visit_try_statement (TryStatement! stmt) {
+ public override void visit_try_statement (TryStatement stmt) {
var old_try = current_try;
var old_try_id = current_try_id;
current_try = stmt;
current_try_id = old_try_id;
}
- public override void visit_catch_clause (CatchClause! clause) {
+ public override void visit_catch_clause (CatchClause clause) {
current_method_inner_error = true;
clause.accept_children (this);
clause.ccodenode = cfrag;
}
- private string get_symbol_lock_name (Symbol! sym) {
+ private string get_symbol_lock_name (Symbol sym) {
return "__lock_%s".printf (sym.name);
}
- public override void visit_lock_statement (LockStatement! stmt) {
+ public override void visit_lock_statement (LockStatement stmt) {
var cn = new CCodeFragment ();
CCodeExpression l = null;
CCodeFunctionCall fc;
stmt.ccodenode = new CCodeExpressionStatement (ccall);
}
- public override void visit_array_creation_expression (ArrayCreationExpression! expr) {
+ public override void visit_array_creation_expression (ArrayCreationExpression expr) {
expr.code_binding.emit ();
}
- public override void visit_boolean_literal (BooleanLiteral! expr) {
+ public override void visit_boolean_literal (BooleanLiteral expr) {
expr.ccodenode = new CCodeConstant (expr.value ? "TRUE" : "FALSE");
visit_expression (expr);
}
- public override void visit_character_literal (CharacterLiteral! expr) {
+ public override void visit_character_literal (CharacterLiteral expr) {
if (expr.get_char () >= 0x20 && expr.get_char () < 0x80) {
expr.ccodenode = new CCodeConstant (expr.value);
} else {
visit_expression (expr);
}
- public override void visit_integer_literal (IntegerLiteral! expr) {
+ public override void visit_integer_literal (IntegerLiteral expr) {
expr.ccodenode = new CCodeConstant (expr.value);
visit_expression (expr);
}
- public override void visit_real_literal (RealLiteral! expr) {
+ public override void visit_real_literal (RealLiteral expr) {
expr.ccodenode = new CCodeConstant (expr.value);
visit_expression (expr);
}
- public override void visit_string_literal (StringLiteral! expr) {
+ public override void visit_string_literal (StringLiteral expr) {
expr.ccodenode = new CCodeConstant (expr.value);
visit_expression (expr);
}
- public override void visit_null_literal (NullLiteral! expr) {
+ public override void visit_null_literal (NullLiteral expr) {
expr.ccodenode = new CCodeConstant ("NULL");
visit_expression (expr);
}
- public override void visit_parenthesized_expression (ParenthesizedExpression! expr) {
+ public override void visit_parenthesized_expression (ParenthesizedExpression expr) {
expr.accept_children (this);
expr.ccodenode = new CCodeParenthesizedExpression ((CCodeExpression) expr.inner.ccodenode);
visit_expression (expr);
}
- private string! get_array_length_cname (string! array_cname, int dim) {
+ private string get_array_length_cname (string array_cname, int dim) {
return "%s_length%d".printf (array_cname, dim);
}
- public CCodeExpression! get_array_length_cexpression (Expression! array_expr, int dim = -1) {
+ public CCodeExpression get_array_length_cexpression (Expression array_expr, int dim = -1) {
// dim == -1 => total size over all dimensions
if (dim == -1) {
var array_type = array_expr.static_type as ArrayType;
}
}
- private string! get_delegate_target_cname (string! delegate_cname) {
+ private string get_delegate_target_cname (string delegate_cname) {
return "%s_target".printf (delegate_cname);
}
- public CCodeExpression! get_delegate_target_cexpression (Expression! delegate_expr) {
+ public CCodeExpression get_delegate_target_cexpression (Expression delegate_expr) {
bool is_out = false;
if (delegate_expr is UnaryExpression) {
return new CCodeConstant ("NULL");
}
- public override void visit_element_access (ElementAccess! expr) {
+ public override void visit_element_access (ElementAccess expr) {
expr.code_binding.emit ();
}
- public override void visit_base_access (BaseAccess! expr) {
+ public override void visit_base_access (BaseAccess expr) {
expr.ccodenode = new InstanceCast (new CCodeIdentifier ("self"), expr.static_type.data_type);
}
- public override void visit_postfix_expression (PostfixExpression! expr) {
+ public override void visit_postfix_expression (PostfixExpression expr) {
MemberAccess ma = find_property_access (expr.inner);
if (ma != null) {
// property postfix expression
visit_expression (expr);
}
- private MemberAccess find_property_access (Expression! expr) {
+ private MemberAccess find_property_access (Expression expr) {
if (expr is ParenthesizedExpression) {
var pe = (ParenthesizedExpression) expr;
return find_property_access (pe.inner);
return null;
}
- private CCodeExpression get_ref_expression (Expression! expr) {
+ private CCodeExpression get_ref_expression (Expression expr) {
/* (temp = expr, temp == NULL ? NULL : ref (temp))
*
* can be simplified to
}
}
- public void visit_expression (Expression! expr) {
+ public void visit_expression (Expression expr) {
if (expr.static_type != null &&
expr.static_type.transfers_ownership &&
expr.static_type.floating_reference) {
}
}
- public override void visit_object_creation_expression (ObjectCreationExpression! expr) {
+ public override void visit_object_creation_expression (ObjectCreationExpression expr) {
expr.accept_children (this);
CCodeExpression instance = null;
visit_expression (expr);
}
- public override void visit_sizeof_expression (SizeofExpression! expr) {
+ public override void visit_sizeof_expression (SizeofExpression expr) {
var csizeof = new CCodeFunctionCall (new CCodeIdentifier ("sizeof"));
csizeof.add_argument (new CCodeIdentifier (expr.type_reference.data_type.get_cname ()));
expr.ccodenode = csizeof;
}
- public override void visit_typeof_expression (TypeofExpression! expr) {
+ public override void visit_typeof_expression (TypeofExpression expr) {
expr.ccodenode = get_type_id_expression (expr.type_reference);
}
- public override void visit_unary_expression (UnaryExpression! expr) {
+ public override void visit_unary_expression (UnaryExpression expr) {
CCodeUnaryOperator op;
if (expr.operator == UnaryOperator.PLUS) {
op = CCodeUnaryOperator.PLUS;
visit_expression (expr);
}
- public override void visit_cast_expression (CastExpression! expr) {
+ public override void visit_cast_expression (CastExpression expr) {
if (expr.type_reference.data_type != null && expr.type_reference.data_type.is_subtype_of (gtypeinstance_type)) {
// GObject cast
if (expr.is_silent_cast) {
visit_expression (expr);
}
- public override void visit_pointer_indirection (PointerIndirection! expr) {
+ public override void visit_pointer_indirection (PointerIndirection expr) {
expr.ccodenode = new CCodeUnaryExpression (CCodeUnaryOperator.POINTER_INDIRECTION, (CCodeExpression) expr.inner.ccodenode);
}
- public override void visit_addressof_expression (AddressofExpression! expr) {
+ public override void visit_addressof_expression (AddressofExpression expr) {
expr.ccodenode = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, (CCodeExpression) expr.inner.ccodenode);
}
- public override void visit_reference_transfer_expression (ReferenceTransferExpression! expr) {
+ public override void visit_reference_transfer_expression (ReferenceTransferExpression expr) {
/* (tmp = var, var = null, tmp) */
var ccomma = new CCodeCommaExpression ();
var temp_decl = get_temp_variable_declarator (expr.static_type, true, expr);
visit_expression (expr);
}
- public override void visit_binary_expression (BinaryExpression! expr) {
+ public override void visit_binary_expression (BinaryExpression expr) {
var cleft = (CCodeExpression) expr.left.ccodenode;
var cright = (CCodeExpression) expr.right.ccodenode;
visit_expression (expr);
}
- static CCodeFunctionCall create_type_check (CCodeNode! ccodenode, Typesymbol! type) {
+ static CCodeFunctionCall create_type_check (CCodeNode ccodenode, Typesymbol type) {
var ccheck = new CCodeFunctionCall (new CCodeIdentifier (type.get_upper_case_cname ("IS_")));
ccheck.add_argument ((CCodeExpression) ccodenode);
return ccheck;
}
- public override void visit_type_check (TypeCheck! expr) {
+ public override void visit_type_check (TypeCheck expr) {
expr.ccodenode = create_type_check (expr.expression.ccodenode, expr.type_reference.data_type);
}
- public override void visit_conditional_expression (ConditionalExpression! expr) {
+ public override void visit_conditional_expression (ConditionalExpression expr) {
expr.ccodenode = new CCodeConditionalExpression ((CCodeExpression) expr.condition.ccodenode, (CCodeExpression) expr.true_expression.ccodenode, (CCodeExpression) expr.false_expression.ccodenode);
visit_expression (expr);
}
- public override void visit_lambda_expression (LambdaExpression! l) {
+ public override void visit_lambda_expression (LambdaExpression l) {
var old_temp_vars = temp_vars;
var old_temp_ref_vars = temp_ref_vars;
temp_vars = new ArrayList<VariableDeclarator> ();
l.ccodenode = new CCodeIdentifier (l.method.get_cname ());
}
- public CCodeExpression! convert_from_generic_pointer (CCodeExpression! cexpr, DataType! actual_type) {
+ public CCodeExpression convert_from_generic_pointer (CCodeExpression cexpr, DataType actual_type) {
var result = cexpr;
if (actual_type.data_type is Struct) {
var st = (Struct) actual_type.data_type;
return result;
}
- public CCodeExpression! convert_to_generic_pointer (CCodeExpression! cexpr, DataType! actual_type) {
+ public CCodeExpression convert_to_generic_pointer (CCodeExpression cexpr, DataType actual_type) {
var result = cexpr;
if (actual_type.data_type is Struct) {
var st = (Struct) actual_type.data_type;
return result;
}
- public CCodeExpression! get_implicit_cast_expression (CCodeExpression! cexpr, DataType expression_type, DataType! target_type) {
+ public CCodeExpression get_implicit_cast_expression (CCodeExpression cexpr, DataType expression_type, DataType target_type) {
if (null == expression_type) {
return cexpr;
}
return wrapper_name;
}
- public override void visit_assignment (Assignment! a) {
+ public override void visit_assignment (Assignment a) {
a.code_binding.emit ();
}
- public CCodeFunctionCall get_property_set_call (Property! prop, MemberAccess! ma, CCodeExpression! cexpr) {
+ public CCodeFunctionCall get_property_set_call (Property prop, MemberAccess ma, CCodeExpression cexpr) {
var set_func = "g_object_set";
var base_property = prop;
return type;
}
- public override CodeBinding create_namespace_binding (Namespace! node) {
+ public override CodeBinding create_namespace_binding (Namespace node) {
return null;
}
- public override CodeBinding create_class_binding (Class! node) {
+ public override CodeBinding create_class_binding (Class node) {
return null;
}
- public override CodeBinding create_struct_binding (Struct! node) {
+ public override CodeBinding create_struct_binding (Struct node) {
return null;
}
- public override CodeBinding create_interface_binding (Interface! node) {
+ public override CodeBinding create_interface_binding (Interface node) {
return null;
}
- public override CodeBinding create_enum_binding (Enum! node) {
+ public override CodeBinding create_enum_binding (Enum node) {
return null;
}
- public override CodeBinding create_enum_value_binding (EnumValue! node) {
+ public override CodeBinding create_enum_value_binding (EnumValue node) {
return null;
}
return null;
}
- public override CodeBinding create_delegate_binding (Delegate! node) {
+ public override CodeBinding create_delegate_binding (Delegate node) {
return null;
}
- public override CodeBinding create_constant_binding (Constant! node) {
+ public override CodeBinding create_constant_binding (Constant node) {
return null;
}
- public override CodeBinding create_field_binding (Field! node) {
+ public override CodeBinding create_field_binding (Field node) {
return null;
}
- public override CodeBinding create_method_binding (Method! node) {
+ public override CodeBinding create_method_binding (Method node) {
return new CCodeMethodBinding (this, node);
}
- public override CodeBinding create_creation_method_binding (CreationMethod! node) {
+ public override CodeBinding create_creation_method_binding (CreationMethod node) {
return null;
}
- public override CodeBinding create_formal_parameter_binding (FormalParameter! node) {
+ public override CodeBinding create_formal_parameter_binding (FormalParameter node) {
return null;
}
- public override CodeBinding create_property_binding (Property! node) {
+ public override CodeBinding create_property_binding (Property node) {
return null;
}
- public override CodeBinding create_property_accessor_binding (PropertyAccessor! node) {
+ public override CodeBinding create_property_accessor_binding (PropertyAccessor node) {
return null;
}
- public override CodeBinding create_signal_binding (Signal! node) {
+ public override CodeBinding create_signal_binding (Signal node) {
return null;
}
- public override CodeBinding create_constructor_binding (Constructor! node) {
+ public override CodeBinding create_constructor_binding (Constructor node) {
return null;
}
- public override CodeBinding create_destructor_binding (Destructor! node) {
+ public override CodeBinding create_destructor_binding (Destructor node) {
return null;
}
- public override CodeBinding create_type_parameter_binding (TypeParameter! node) {
+ public override CodeBinding create_type_parameter_binding (TypeParameter node) {
return null;
}
- public override CodeBinding create_block_binding (Block! node) {
+ public override CodeBinding create_block_binding (Block node) {
return null;
}
- public override CodeBinding create_empty_statement_binding (EmptyStatement! node) {
+ public override CodeBinding create_empty_statement_binding (EmptyStatement node) {
return null;
}
- public override CodeBinding create_declaration_statement_binding (DeclarationStatement! node) {
+ public override CodeBinding create_declaration_statement_binding (DeclarationStatement node) {
return null;
}
- public override CodeBinding create_local_variable_declaration_binding (LocalVariableDeclaration! node) {
+ public override CodeBinding create_local_variable_declaration_binding (LocalVariableDeclaration node) {
return null;
}
- public override CodeBinding create_variable_declarator_binding (VariableDeclarator! node) {
+ public override CodeBinding create_variable_declarator_binding (VariableDeclarator node) {
return null;
}
- public override CodeBinding create_initializer_list_binding (InitializerList! node) {
+ public override CodeBinding create_initializer_list_binding (InitializerList node) {
return null;
}
- public override CodeBinding create_expression_statement_binding (ExpressionStatement! node) {
+ public override CodeBinding create_expression_statement_binding (ExpressionStatement node) {
return null;
}
- public override CodeBinding create_if_statement_binding (IfStatement! node) {
+ public override CodeBinding create_if_statement_binding (IfStatement node) {
return null;
}
- public override CodeBinding create_switch_statement_binding (SwitchStatement! node) {
+ public override CodeBinding create_switch_statement_binding (SwitchStatement node) {
return null;
}
- public override CodeBinding create_switch_section_binding (SwitchSection! node) {
+ public override CodeBinding create_switch_section_binding (SwitchSection node) {
return null;
}
- public override CodeBinding create_switch_label_binding (SwitchLabel! node) {
+ public override CodeBinding create_switch_label_binding (SwitchLabel node) {
return null;
}
- public override CodeBinding create_while_statement_binding (WhileStatement! node) {
+ public override CodeBinding create_while_statement_binding (WhileStatement node) {
return null;
}
- public override CodeBinding create_do_statement_binding (DoStatement! node) {
+ public override CodeBinding create_do_statement_binding (DoStatement node) {
return null;
}
- public override CodeBinding create_for_statement_binding (ForStatement! node) {
+ public override CodeBinding create_for_statement_binding (ForStatement node) {
return null;
}
- public override CodeBinding create_foreach_statement_binding (ForeachStatement! node) {
+ public override CodeBinding create_foreach_statement_binding (ForeachStatement node) {
return null;
}
- public override CodeBinding create_break_statement_binding (BreakStatement! node) {
+ public override CodeBinding create_break_statement_binding (BreakStatement node) {
return null;
}
- public override CodeBinding create_continue_statement_binding (ContinueStatement! node) {
+ public override CodeBinding create_continue_statement_binding (ContinueStatement node) {
return null;
}
- public override CodeBinding create_return_statement_binding (ReturnStatement! node) {
+ public override CodeBinding create_return_statement_binding (ReturnStatement node) {
return null;
}
- public override CodeBinding create_throw_statement_binding (ThrowStatement! node) {
+ public override CodeBinding create_throw_statement_binding (ThrowStatement node) {
return null;
}
- public override CodeBinding create_try_statement_binding (TryStatement! node) {
+ public override CodeBinding create_try_statement_binding (TryStatement node) {
return null;
}
- public override CodeBinding create_catch_clause_binding (CatchClause! node) {
+ public override CodeBinding create_catch_clause_binding (CatchClause node) {
return null;
}
- public override CodeBinding create_lock_statement_binding (LockStatement! node) {
+ public override CodeBinding create_lock_statement_binding (LockStatement node) {
return null;
}
return null;
}
- public override CodeBinding create_array_creation_expression_binding (ArrayCreationExpression! node) {
+ public override CodeBinding create_array_creation_expression_binding (ArrayCreationExpression node) {
return new CCodeArrayCreationExpressionBinding (this, node);
}
- public override CodeBinding create_boolean_literal_binding (BooleanLiteral! node) {
+ public override CodeBinding create_boolean_literal_binding (BooleanLiteral node) {
return null;
}
- public override CodeBinding create_character_literal_binding (CharacterLiteral! node) {
+ public override CodeBinding create_character_literal_binding (CharacterLiteral node) {
return null;
}
- public override CodeBinding create_integer_literal_binding (IntegerLiteral! node) {
+ public override CodeBinding create_integer_literal_binding (IntegerLiteral node) {
return null;
}
- public override CodeBinding create_real_literal_binding (RealLiteral! node) {
+ public override CodeBinding create_real_literal_binding (RealLiteral node) {
return null;
}
- public override CodeBinding create_string_literal_binding (StringLiteral! node) {
+ public override CodeBinding create_string_literal_binding (StringLiteral node) {
return null;
}
- public override CodeBinding create_null_literal_binding (NullLiteral! node) {
+ public override CodeBinding create_null_literal_binding (NullLiteral node) {
return null;
}
- public override CodeBinding create_parenthesized_expression_binding (ParenthesizedExpression! node) {
+ public override CodeBinding create_parenthesized_expression_binding (ParenthesizedExpression node) {
return null;
}
- public override CodeBinding create_member_access_binding (MemberAccess! node) {
+ public override CodeBinding create_member_access_binding (MemberAccess node) {
return null;
}
- public override CodeBinding create_member_access_simple_binding (MemberAccess! node) {
+ public override CodeBinding create_member_access_simple_binding (MemberAccess node) {
return null;
}
- public override CodeBinding create_invocation_expression_binding (InvocationExpression! node) {
+ public override CodeBinding create_invocation_expression_binding (InvocationExpression node) {
return null;
}
- public override CodeBinding create_element_access_binding (ElementAccess! node) {
+ public override CodeBinding create_element_access_binding (ElementAccess node) {
return new CCodeElementAccessBinding (this, node);
}
- public override CodeBinding create_base_access_binding (BaseAccess! node) {
+ public override CodeBinding create_base_access_binding (BaseAccess node) {
return null;
}
- public override CodeBinding create_postfix_expression_binding (PostfixExpression! node) {
+ public override CodeBinding create_postfix_expression_binding (PostfixExpression node) {
return null;
}
- public override CodeBinding create_object_creation_expression_binding (ObjectCreationExpression! node) {
+ public override CodeBinding create_object_creation_expression_binding (ObjectCreationExpression node) {
return null;
}
- public override CodeBinding create_sizeof_expression_binding (SizeofExpression! node) {
+ public override CodeBinding create_sizeof_expression_binding (SizeofExpression node) {
return null;
}
- public override CodeBinding create_typeof_expression_binding (TypeofExpression! node) {
+ public override CodeBinding create_typeof_expression_binding (TypeofExpression node) {
return null;
}
- public override CodeBinding create_unary_expression_binding (UnaryExpression! node) {
+ public override CodeBinding create_unary_expression_binding (UnaryExpression node) {
return null;
}
- public override CodeBinding create_cast_expression_binding (CastExpression! node) {
+ public override CodeBinding create_cast_expression_binding (CastExpression node) {
return null;
}
- public override CodeBinding create_pointer_indirection_binding (PointerIndirection! node) {
+ public override CodeBinding create_pointer_indirection_binding (PointerIndirection node) {
return null;
}
- public override CodeBinding create_addressof_expression_binding (AddressofExpression! node) {
+ public override CodeBinding create_addressof_expression_binding (AddressofExpression node) {
return null;
}
- public override CodeBinding create_reference_transfer_expression_binding (ReferenceTransferExpression! node) {
+ public override CodeBinding create_reference_transfer_expression_binding (ReferenceTransferExpression node) {
return null;
}
- public override CodeBinding create_binary_expression_binding (BinaryExpression! node) {
+ public override CodeBinding create_binary_expression_binding (BinaryExpression node) {
return null;
}
- public override CodeBinding create_type_check_binding (TypeCheck! node) {
+ public override CodeBinding create_type_check_binding (TypeCheck node) {
return null;
}
- public override CodeBinding create_conditional_expression_binding (ConditionalExpression! node) {
+ public override CodeBinding create_conditional_expression_binding (ConditionalExpression node) {
return null;
}
- public override CodeBinding create_lambda_expression_binding (LambdaExpression! node) {
+ public override CodeBinding create_lambda_expression_binding (LambdaExpression node) {
return null;
}
- public override CodeBinding create_lambda_expression_with_statement_body_binding (LambdaExpression! node) {
+ public override CodeBinding create_lambda_expression_with_statement_body_binding (LambdaExpression node) {
return null;
}
- public override CodeBinding create_assignment_binding (Assignment! node) {
+ public override CodeBinding create_assignment_binding (Assignment node) {
return new CCodeAssignmentBinding (this, node);
}
}
using GLib;
public class Vala.CCodeGenerator {
- public override void visit_class (Class! cl) {
+ public override void visit_class (Class cl) {
var old_symbol = current_symbol;
var old_type_symbol = current_type_symbol;
var old_class = current_class;
instance_dispose_fragment = old_instance_dispose_fragment;
}
- private void add_class_init_function (Class! cl) {
+ private void add_class_init_function (Class cl) {
var class_init = new CCodeFunction ("%s_class_init".printf (cl.get_lower_case_cname (null)), "void");
class_init.add_parameter (new CCodeFormalParameter ("klass", "%sClass *".printf (cl.get_cname ())));
class_init.modifiers = CCodeModifiers.STATIC;
source_type_member_definition.append (class_init);
}
- private void add_interface_init_function (Class! cl, Interface! iface) {
+ private void add_interface_init_function (Class cl, Interface iface) {
var iface_init = new CCodeFunction ("%s_%s_interface_init".printf (cl.get_lower_case_cname (null), iface.get_lower_case_cname (null)), "void");
iface_init.add_parameter (new CCodeFormalParameter ("iface", "%s *".printf (iface.get_type_cname ())));
iface_init.modifiers = CCodeModifiers.STATIC;
source_type_member_definition.append (iface_init);
}
- private void add_instance_init_function (Class! cl) {
+ private void add_instance_init_function (Class cl) {
var instance_init = new CCodeFunction ("%s_init".printf (cl.get_lower_case_cname (null)), "void");
instance_init.add_parameter (new CCodeFormalParameter ("self", "%s *".printf (cl.get_cname ())));
instance_init.modifiers = CCodeModifiers.STATIC;
source_type_member_definition.append (instance_init);
}
- private void add_dispose_function (Class! cl) {
+ private void add_dispose_function (Class cl) {
function = new CCodeFunction ("%s_dispose".printf (cl.get_lower_case_cname (null)), "void");
function.modifiers = CCodeModifiers.STATIC;
source_type_member_definition.append (function);
}
- public CCodeIdentifier! get_value_setter_function (DataType! type_reference) {
+ public CCodeIdentifier get_value_setter_function (DataType type_reference) {
if (type_reference.data_type != null) {
return new CCodeIdentifier (type_reference.data_type.get_set_value_function ());
} else {
}
}
- private bool class_has_readable_properties (Class! cl) {
+ private bool class_has_readable_properties (Class cl) {
foreach (Property prop in cl.get_properties ()) {
if (prop.get_accessor != null) {
return true;
return false;
}
- private bool class_has_writable_properties (Class! cl) {
+ private bool class_has_writable_properties (Class cl) {
foreach (Property prop in cl.get_properties ()) {
if (prop.set_accessor != null) {
return true;
return false;
}
- private void add_get_property_function (Class! cl) {
+ private void add_get_property_function (Class cl) {
var get_prop = new CCodeFunction ("%s_get_property".printf (cl.get_lower_case_cname (null)), "void");
get_prop.modifiers = CCodeModifiers.STATIC;
get_prop.add_parameter (new CCodeFormalParameter ("object", "GObject *"));
source_type_member_definition.append (get_prop);
}
- private void add_set_property_function (Class! cl) {
+ private void add_set_property_function (Class cl) {
var set_prop = new CCodeFunction ("%s_set_property".printf (cl.get_lower_case_cname (null)), "void");
set_prop.modifiers = CCodeModifiers.STATIC;
set_prop.add_parameter (new CCodeFormalParameter ("object", "GObject *"));
using GLib;
public class Vala.CCodeGenerator {
- public override void visit_interface (Interface! iface) {
+ public override void visit_interface (Interface iface) {
current_symbol = iface;
current_type_symbol = iface;
current_type_symbol = null;
}
- private CCodeFunctionCall! get_param_spec (Property! prop) {
+ private CCodeFunctionCall get_param_spec (Property prop) {
var cspec = new CCodeFunctionCall ();
cspec.add_argument (prop.get_canonical_cconstant ());
cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.nick)));
return cspec;
}
- private CCodeFunctionCall! get_signal_creation (Signal! sig, Typesymbol! type) {
+ private CCodeFunctionCall get_signal_creation (Signal sig, Typesymbol type) {
var csignew = new CCodeFunctionCall (new CCodeIdentifier ("g_signal_new"));
csignew.add_argument (new CCodeConstant ("\"%s\"".printf (sig.name)));
csignew.add_argument (new CCodeIdentifier (type.get_upper_case_cname ("TYPE_")));
return csignew;
}
- private void add_interface_base_init_function (Interface! iface) {
+ private void add_interface_base_init_function (Interface iface) {
var base_init = new CCodeFunction ("%s_base_init".printf (iface.get_lower_case_cname (null)), "void");
base_init.add_parameter (new CCodeFormalParameter ("iface", "%sIface *".printf (iface.get_cname ())));
base_init.modifiers = CCodeModifiers.STATIC;
using Gee;
public class Vala.CCodeGenerator {
- public override void visit_invocation_expression (InvocationExpression! expr) {
+ public override void visit_invocation_expression (InvocationExpression expr) {
expr.accept_children (this);
// the bare function call
}
}
- private CCodeExpression! get_dbus_array_type (ArrayType array_type) {
+ private CCodeExpression get_dbus_array_type (ArrayType array_type) {
var carray_type = new CCodeFunctionCall (new CCodeIdentifier ("dbus_g_type_get_collection"));
carray_type.add_argument (new CCodeConstant ("\"GArray\""));
carray_type.add_argument (new CCodeIdentifier (array_type.element_type.data_type.get_type_id ()));
using GLib;
public class Vala.CCodeGenerator {
- private void process_cmember (MemberAccess! expr, CCodeExpression pub_inst, DataType base_type) {
+ private void process_cmember (MemberAccess expr, CCodeExpression pub_inst, DataType base_type) {
if (expr.symbol_reference is Method) {
var m = (Method) expr.symbol_reference;
}
}
- public override void visit_member_access (MemberAccess! expr) {
+ public override void visit_member_access (MemberAccess expr) {
CCodeExpression pub_inst = null;
DataType base_type = null;
using Gee;
public class Vala.CCodeGenerator {
- public override void visit_method (Method! m) {
+ public override void visit_method (Method m) {
Method old_method = current_method;
DataType old_return_type = current_return_type;
bool old_method_inner_error = current_method_inner_error;
}
}
- private CCodeStatement create_method_type_check_statement (Method! m, DataType! return_type, Typesymbol! t, bool non_null, string! var_name) {
+ private CCodeStatement create_method_type_check_statement (Method m, DataType return_type, Typesymbol t, bool non_null, string var_name) {
return create_type_check_statement (m, return_type, t, non_null, var_name);
}
- private CCodeStatement create_property_type_check_statement (Property! prop, bool check_return_type, Typesymbol! t, bool non_null, string! var_name) {
+ private CCodeStatement create_property_type_check_statement (Property prop, bool check_return_type, Typesymbol t, bool non_null, string var_name) {
if (check_return_type) {
return create_type_check_statement (prop, prop.type_reference, t, non_null, var_name);
} else {
}
}
- private CCodeStatement create_type_check_statement (CodeNode! method_node, DataType ret_type, Typesymbol! t, bool non_null, string! var_name) {
+ private CCodeStatement create_type_check_statement (CodeNode method_node, DataType ret_type, Typesymbol t, bool non_null, string var_name) {
var ccheck = new CCodeFunctionCall ();
if ((t is Class && ((Class) t).is_subtype_of (gobject_type)) || (t is Interface && !((Interface) t).declaration_only)) {
return new CCodeExpressionStatement (ccheck);
}
- private CCodeStatement create_precondition_statement (CodeNode! method_node, DataType ret_type, Expression precondition) {
+ private CCodeStatement create_precondition_statement (CodeNode method_node, DataType ret_type, Expression precondition) {
var ccheck = new CCodeFunctionCall ();
ccheck.add_argument ((CCodeExpression) precondition.ccodenode);
return new CCodeExpressionStatement (cassert);
}
- private CCodeExpression default_value_for_type (DataType! type, bool initializer_expression) {
+ private CCodeExpression default_value_for_type (DataType type, bool initializer_expression) {
if ((type.data_type != null && type.data_type.is_reference_type ()) || type is PointerType || type is ArrayType) {
return new CCodeConstant ("NULL");
} else if (type.data_type != null && type.data_type.get_default_value () != null) {
return null;
}
- public override void visit_creation_method (CreationMethod! m) {
+ public override void visit_creation_method (CreationMethod m) {
if (m.body != null && current_type_symbol is Class && current_class.is_subtype_of (gobject_type)) {
int n_params = 0;
foreach (Statement stmt in m.body.get_statements ()) {
visit_method (m);
}
- private bool is_possible_entry_point (Method! m, ref bool return_value, ref bool args_parameter) {
+ private bool is_possible_entry_point (Method m, ref bool return_value, ref bool args_parameter) {
if (m.name == null || m.name != "main") {
// method must be called "main"
return false;
return true;
}
- private void add_object_creation (CCodeBlock! b, bool has_params) {
+ private void add_object_creation (CCodeBlock b, bool has_params) {
var cl = (Class) current_type_symbol;
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_object_newv"));
b.add_statement (cdeclaration);
}
- private Class find_fundamental_class (Class! cl) {
+ private Class find_fundamental_class (Class cl) {
var fundamental_class = cl;
while (fundamental_class != null && fundamental_class.base_class != gtypeinstance_type) {
fundamental_class = fundamental_class.base_class;
}
}
- public string get_signal_marshaller_function (Signal! sig, string prefix = null) {
+ public string get_signal_marshaller_function (Signal sig, string prefix = null) {
var signature = get_signal_signature (sig);
string ret;
var params = sig.get_parameters ();
return ret;
}
- private string get_value_type_name_from_type_reference (DataType! t) {
+ private string get_value_type_name_from_type_reference (DataType t) {
if (t is PointerType || t.type_parameter != null || t.is_ref || t.is_out) {
return "gpointer";
} else if (t is VoidType) {
return null;
}
- private string get_signal_signature (Signal! sig) {
+ private string get_signal_signature (Signal sig) {
string signature;
var params = sig.get_parameters ();
return signature;
}
- public override void visit_signal (Signal! sig) {
+ public override void visit_signal (Signal sig) {
// parent_symbol may be null for late bound signals
if (sig.parent_symbol != null) {
var dt = sig.parent_symbol as Typesymbol;
using Gee;
public class Vala.CCodeGenerator {
- private CCodeIncludeDirective get_internal_include (string! filename) {
+ private CCodeIncludeDirective get_internal_include (string filename) {
return new CCodeIncludeDirective (filename, context.library == null);
}
source_type_member_definition.append (fun);
}
- public override void visit_source_file (SourceFile! source_file) {
+ public override void visit_source_file (SourceFile source_file) {
header_begin = new CCodeFragment ();
header_type_declaration = new CCodeFragment ();
header_type_definition = new CCodeFragment ();
source_signal_marshaller_declaration = null;
}
- private static string get_define_for_filename (string! filename) {
- var define = new String ("__");
+ private static string get_define_for_filename (string filename) {
+ var define = new StringBuilder ("__");
var i = filename;
while (i.len () > 0) {
using GLib;
public class Vala.CCodeGenerator {
- public override void visit_struct (Struct! st) {
+ public override void visit_struct (Struct st) {
var old_type_symbol = current_type_symbol;
var old_instance_struct = instance_struct;
var old_instance_dispose_fragment = instance_dispose_fragment;
* The link between a method and generated code.
*/
public class Vala.CCodeMethodBinding : CCodeBinding {
- public Method! method { get; set; }
+ public Method method { get; set; }
public bool has_wrapper {
get { return (method.get_attribute ("NoWrapper") == null); }
}
- public CCodeMethodBinding (construct CodeGenerator! codegen, construct Method! method) {
+ public CCodeMethodBinding (construct CodeGenerator codegen, construct Method method) {
}
- public static CCodeMethodBinding! get (Method! method) {
+ public static CCodeMethodBinding get (Method method) {
return (CCodeMethodBinding) method.code_binding;
}
/**
* Specifies the class to be registered.
*/
- public weak Class! class_reference { get; set; }
+ public weak Class class_reference { get; set; }
/**
* Creates a new C function to register the specified class at runtime.
* @param cl a class
* @return newly created class register function
*/
- public ClassRegisterFunction (Class! cl) {
+ public ClassRegisterFunction (Class cl) {
class_reference = cl;
}
- public override Typesymbol! get_type_declaration () {
+ public override Typesymbol get_type_declaration () {
return class_reference;
}
- public override string! get_type_struct_name () {
+ public override string get_type_struct_name () {
return "%sClass".printf (class_reference.get_cname ());
}
- public override string! get_base_init_func_name () {
+ public override string get_base_init_func_name () {
return "NULL";
}
- public override string! get_class_init_func_name () {
+ public override string get_class_init_func_name () {
return "%s_class_init".printf (class_reference.get_lower_case_cname (null));
}
- public override string! get_instance_struct_size () {
+ public override string get_instance_struct_size () {
return "sizeof (%s)".printf (class_reference.get_cname ());
}
- public override string! get_instance_init_func_name () {
+ public override string get_instance_init_func_name () {
return "%s_init".printf (class_reference.get_lower_case_cname (null));
}
- public override string! get_parent_type_name () {
+ public override string get_parent_type_name () {
return class_reference.base_class.get_upper_case_cname ("TYPE_");
}
return class_reference.access;
}
- public override CCodeFragment! get_type_interface_init_declaration () {
+ public override CCodeFragment get_type_interface_init_declaration () {
var frag = new CCodeFragment ();
foreach (DataType base_type in class_reference.get_base_types ()) {
return frag;
}
- public override CCodeFragment! get_type_interface_init_statements () {
+ public override CCodeFragment get_type_interface_init_statements () {
var frag = new CCodeFragment ();
foreach (DataType base_type in class_reference.get_base_types ()) {
public DBusBindingProvider () {
}
- public Symbol get_binding (MemberAccess! ma) {
+ public Symbol get_binding (MemberAccess ma) {
if (connection_type != null && ma.inner != null && ma.inner.static_type != null && ma.inner.static_type.data_type == connection_type) {
var type_args = ma.get_type_arguments ();
if (type_args.size != 1) {
return null;
}
- private bool is_dbus_interface (DataType! t) {
+ private bool is_dbus_interface (DataType t) {
if (!(t.data_type is Interface)) {
return false;
}
return new ReadOnlyCollection<string> ();
}
- public override string! get_default_cname () {
+ public override string get_default_cname () {
return "dbus_g_proxy_begin_call";
}
}
* @param context a code context
* @param filename a relative or absolute filename
*/
- public void write_file (CodeContext! context, string! filename) {
+ public void write_file (CodeContext context, string filename) {
this.context = context;
var root_symbol = context.root;
stream = null;
}
- public override void visit_namespace (Namespace! ns) {
+ public override void visit_namespace (Namespace ns) {
if (ns.pkg) {
return;
}
stream.printf ("</namespace>\n");
}
- public override void visit_class (Class! cl) {
+ public override void visit_class (Class cl) {
if (cl.source_reference != null && cl.source_reference.file.pkg) {
return;
}
}
}
- public override void visit_struct (Struct! st) {
+ public override void visit_struct (Struct st) {
if (st.source_reference != null && st.source_reference.file.pkg) {
return;
}
stream.printf ("</struct>\n");
}
- public override void visit_interface (Interface! iface) {
+ public override void visit_interface (Interface iface) {
if (iface.source_reference != null && iface.source_reference.file.pkg) {
return;
}
stream.printf ("</interface>\n");
}
- public override void visit_enum (Enum! en) {
+ public override void visit_enum (Enum en) {
if (en.source_reference != null && en.source_reference.file.pkg) {
return;
}
stream.printf ("</enum>\n");
}
- public override void visit_enum_value (EnumValue! ev) {
+ public override void visit_enum_value (EnumValue ev) {
write_indent ();
stream.printf ("<member name=\"%s\"/>\n", ev.get_cname ());
}
stream.printf ("<member name=\"%s\"/>\n", ecode.get_cname ());
}
- public override void visit_constant (Constant! c) {
+ public override void visit_constant (Constant c) {
if (c.source_reference != null && c.source_reference.file.pkg) {
return;
}
stream.printf ("<constant name=\"%s\"/>\n", c.get_cname ());
}
- public override void visit_field (Field! f) {
+ public override void visit_field (Field f) {
if (f.source_reference != null && f.source_reference.file.pkg) {
return;
}
stream.printf ("</parameters>\n");
}
- public override void visit_delegate (Delegate! cb) {
+ public override void visit_delegate (Delegate cb) {
if (cb.source_reference != null && cb.source_reference.file.pkg) {
return;
}
stream.printf ("</callback>\n");
}
- public override void visit_method (Method! m) {
+ public override void visit_method (Method m) {
if (m.source_reference != null && m.source_reference.file.pkg) {
return;
}
stream.printf ("</method>\n");
}
- public override void visit_creation_method (CreationMethod! m) {
+ public override void visit_creation_method (CreationMethod m) {
if (m.source_reference != null && m.source_reference.file.pkg) {
return;
}
stream.printf ("</constructor>\n");
}
- public override void visit_property (Property! prop) {
+ public override void visit_property (Property prop) {
if (!check_accessibility (prop) || prop.overrides || prop.base_interface_property != null) {
return;
}
stream.printf ("/>\n");
}
- public override void visit_signal (Signal! sig) {
+ public override void visit_signal (Signal sig) {
if (!check_accessibility (sig)) {
return;
}
}
}
- private void write_return_type (DataType! type) {
+ private void write_return_type (DataType type) {
write_indent ();
stream.printf ("<return-type type=\"%s\"", get_gidl_type_name (type));
if (type.transfers_ownership) {
stream.printf ("/>\n");
}
- private bool check_accessibility (Symbol! sym) {
+ private bool check_accessibility (Symbol sym) {
if (sym.access == SymbolAccessibility.PUBLIC ||
sym.access == SymbolAccessibility.PROTECTED) {
return true;
/**
* Specifies the interface to be registered.
*/
- public weak Interface! interface_reference { get; set; }
+ public weak Interface interface_reference { get; set; }
- public InterfaceRegisterFunction (Interface! iface) {
+ public InterfaceRegisterFunction (Interface iface) {
interface_reference = iface;
}
- public override Typesymbol! get_type_declaration () {
+ public override Typesymbol get_type_declaration () {
return interface_reference;
}
- public override string! get_type_struct_name () {
+ public override string get_type_struct_name () {
return interface_reference.get_type_cname ();
}
- public override string! get_base_init_func_name () {
+ public override string get_base_init_func_name () {
return "%s_base_init".printf (interface_reference.get_lower_case_cname (null));
}
- public override string! get_class_init_func_name () {
+ public override string get_class_init_func_name () {
return "NULL";
}
- public override string! get_instance_struct_size () {
+ public override string get_instance_struct_size () {
return "0";
}
- public override string! get_instance_init_func_name () {
+ public override string get_instance_init_func_name () {
return "NULL";
}
- public override string! get_parent_type_name () {
+ public override string get_parent_type_name () {
return "G_TYPE_INTERFACE";
}
return interface_reference.access;
}
- public override CCodeFragment! get_type_interface_init_statements () {
+ public override CCodeFragment get_type_interface_init_statements () {
var frag = new CCodeFragment ();
/* register all prerequisites */
*
* @return type to be registered
*/
- public abstract Typesymbol! get_type_declaration ();
+ public abstract Typesymbol get_type_declaration ();
/**
* Returns the name of the type struct in C code.
*
* @return C struct name
*/
- public abstract string! get_type_struct_name ();
+ public abstract string get_type_struct_name ();
/**
* Returns the name of the base_init function in C code.
*
* @return C function name
*/
- public abstract string! get_base_init_func_name ();
+ public abstract string get_base_init_func_name ();
/**
* Returns the name of the class_init function in C code.
*
* @return C function name
*/
- public abstract string! get_class_init_func_name ();
+ public abstract string get_class_init_func_name ();
/**
* Returns the size of the instance struct in C code.
*
* @return C instance struct size
*/
- public abstract string! get_instance_struct_size ();
+ public abstract string get_instance_struct_size ();
/**
* Returns the name of the instance_init function in C code.
*
* @return C function name
*/
- public abstract string! get_instance_init_func_name ();
+ public abstract string get_instance_init_func_name ();
/**
* Returns the name of the parent type in C code.
*
* @return C parent type name
*/
- public abstract string! get_parent_type_name ();
+ public abstract string get_parent_type_name ();
/**
* Returns the set of type flags to be applied when registering.
*
* @return C declarations
*/
- public virtual CCodeFragment! get_type_interface_init_declaration () {
+ public virtual CCodeFragment get_type_interface_init_declaration () {
return new CCodeFragment ();
}
*
* @return C statements
*/
- public abstract CCodeFragment! get_type_interface_init_statements ();
+ public abstract CCodeFragment get_type_interface_init_statements ();
/**
* Returns the declaration for this type register function in C code.
*
* @return C function declaration fragment
*/
- public CCodeFragment! get_declaration () {
+ public CCodeFragment get_declaration () {
return declaration_fragment;
}
*
* @return C function definition fragment
*/
- public CCodeFragment! get_definition () {
+ public CCodeFragment get_definition () {
return definition_fragment;
}
/**
* The variable whose address is to be computed.
*/
- public Expression! inner {
+ public Expression inner {
get {
return _inner;
}
}
}
- private Expression! _inner;
+ private Expression _inner;
/**
* Creates a new address-of expression.
* @param inner variable whose address is to be computed
* @return newly created address-of expression
*/
- public AddressofExpression (construct Expression! inner, construct SourceReference source_reference = null) {
+ public AddressofExpression (construct Expression inner, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
inner.accept (visitor);
visitor.visit_addressof_expression (this);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
}
/**
* Add a size expression.
*/
- public void append_size (Expression! size) {
+ public void append_size (Expression size) {
sizes.add (size);
}
public ArrayCreationExpression (construct DataType element_type, construct int rank, construct InitializerList initializer_list, construct SourceReference source_reference) {
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (element_type != null) {
element_type.accept (visitor);
}
}
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_array_creation_expression (this);
}
return false;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (element_type == old_type) {
element_type = new_type;
}
private ArrayResizeMethod resize_method;
private ArrayMoveMethod move_method;
- public ArrayType (DataType! element_type, int rank, SourceReference source_reference) {
+ public ArrayType (DataType element_type, int rank, SourceReference source_reference) {
this.element_type = element_type;
this.rank = rank;
this.source_reference = source_reference;
return move_method;
}
- public override DataType! copy () {
+ public override DataType copy () {
var result = new ArrayType (element_type, rank, source_reference);
result.transfers_ownership = transfers_ownership;
result.takes_ownership = takes_ownership;
return true;
}
- public override string! to_string () {
+ public override string to_string () {
return element_type.to_string () + "[]";
}
- public override bool compatible (DataType! target_type, bool enable_non_null) {
+ public override bool compatible (DataType target_type, bool enable_non_null) {
if (target_type is PointerType || (target_type.data_type != null && target_type.data_type.get_attribute ("PointerType") != null)) {
/* any array type can be cast to a generic pointer */
return true;
/**
* Left hand side of the assignment.
*/
- public Expression! left {
+ public Expression left {
get { return _left; }
set construct {
_left = value;
/**
* Right hand side of the assignment.
*/
- public Expression! right {
+ public Expression right {
get { return _right; }
set construct {
_right = value;
}
}
- private Expression! _left;
- private Expression! _right;
+ private Expression _left;
+ private Expression _right;
/**
* Creates a new assignment.
* @param source_reference reference to source code
* @return newly created assignment
*/
- public Assignment (construct Expression! left, construct Expression! right, construct AssignmentOperator operator = AssignmentOperator.SIMPLE, construct SourceReference source_reference = null) {
+ public Assignment (construct Expression left, construct Expression right, construct AssignmentOperator operator = AssignmentOperator.SIMPLE, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_assignment (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
left.accept (visitor);
right.accept (visitor);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (left == old_node) {
left = new_node;
}
/**
* The name of the attribute type.
*/
- public string! name { get; set; }
+ public string name { get; set; }
/**
* Contains all specified attribute arguments.
* @param source_reference reference to source code
* @return newly created attribute
*/
- public Attribute (construct string! name, construct SourceReference source_reference) {
+ public Attribute (construct string name, construct SourceReference source_reference) {
}
/**
*
* @param arg named argument
*/
- public void add_argument (NamedArgument! arg) {
+ public void add_argument (NamedArgument arg) {
args.add (arg);
}
* @param name argument name
* @return true if the argument has been found, false otherwise
*/
- public bool has_argument (string! name) {
+ public bool has_argument (string name) {
// FIXME: use hash table
foreach (NamedArgument arg in args) {
if (arg.name == name) {
* @param name argument name
* @return string value
*/
- public string get_string (string! name) {
+ public string get_string (string name) {
// FIXME: use hash table
foreach (NamedArgument arg in args) {
if (arg.name == name) {
* @param name argument name
* @return integer value
*/
- public int get_integer (string! name) {
+ public int get_integer (string name) {
// FIXME: use hash table
foreach (NamedArgument arg in args) {
if (arg.name == name) {
* @param name argument name
* @return double value
*/
- public double get_double (string! name) {
+ public double get_double (string name) {
// FIXME: use hash table
foreach (NamedArgument arg in args) {
if (arg.name == name) {
* @param name argument name
* @return boolean value
*/
- public bool get_bool (string! name) {
+ public bool get_bool (string name) {
// FIXME: use hash table
foreach (NamedArgument arg in args) {
if (arg.name == name) {
*
* @param context a code context
*/
- public void process (CodeContext! context) {
+ public void process (CodeContext context) {
context.accept (this);
}
- public override void visit_source_file (SourceFile! source_file) {
+ public override void visit_source_file (SourceFile source_file) {
source_file.accept_children (this);
}
- public override void visit_namespace (Namespace! ns) {
+ public override void visit_namespace (Namespace ns) {
ns.process_attributes ();
foreach (Namespace ns in ns.get_namespaces ()) {
}
}
- public override void visit_class (Class! cl) {
+ public override void visit_class (Class cl) {
cl.process_attributes ();
cl.accept_children (this);
}
- public override void visit_struct (Struct! st) {
+ public override void visit_struct (Struct st) {
st.process_attributes ();
st.accept_children (this);
}
- public override void visit_interface (Interface! iface) {
+ public override void visit_interface (Interface iface) {
iface.process_attributes ();
iface.accept_children (this);
}
- public override void visit_enum (Enum! en) {
+ public override void visit_enum (Enum en) {
en.process_attributes ();
}
- public override void visit_method (Method! m) {
+ public override void visit_method (Method m) {
m.process_attributes ();
m.accept_children (this);
}
- public override void visit_creation_method (CreationMethod! m) {
+ public override void visit_creation_method (CreationMethod m) {
m.process_attributes ();
m.accept_children (this);
}
- public override void visit_formal_parameter (FormalParameter! p) {
+ public override void visit_formal_parameter (FormalParameter p) {
p.process_attributes ();
}
- public override void visit_property (Property! prop) {
+ public override void visit_property (Property prop) {
prop.process_attributes ();
}
- public override void visit_delegate (Delegate! d) {
+ public override void visit_delegate (Delegate d) {
d.process_attributes ();
d.accept_children (this);
}
- public override void visit_constant (Constant! c) {
+ public override void visit_constant (Constant c) {
c.process_attributes ();
}
- public override void visit_field (Field! f) {
+ public override void visit_field (Field f) {
f.process_attributes ();
}
- public override void visit_signal (Signal! sig) {
+ public override void visit_signal (Signal sig) {
sig.process_attributes ();
sig.accept_children (this);
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_base_access (this);
}
- public override string! to_string () {
+ public override string to_string () {
return "base";
}
/**
* The left operand.
*/
- public Expression! left {
+ public Expression left {
get {
return _left;
}
/**
* The right operand.
*/
- public Expression! right {
+ public Expression right {
get {
return _right;
}
}
}
- private Expression! _left;
- private Expression! _right;
+ private Expression _left;
+ private Expression _right;
/**
* Creates a new binary expression.
* @param source reference to source code
* @return newly created binary expression
*/
- public BinaryExpression (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;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
left.accept (visitor);
right.accept (visitor);
visitor.visit_binary_expression (this);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (left == old_node) {
left = new_node;
}
}
}
- private string! get_operator_string () {
+ private string get_operator_string () {
switch (_operator) {
case BinaryOperator.PLUS: return "+";
case BinaryOperator.MINUS: return "-";
assert_not_reached ();
}
- public override string! to_string () {
+ public override string to_string () {
return _left.to_string () + get_operator_string () + _right.to_string ();
}
* @param ma member access expression
* @return resolved symbol or null if no binding can be provided
*/
- public abstract Symbol get_binding (MemberAccess! ma);
+ public abstract Symbol get_binding (MemberAccess ma);
}
*
* @param stmt a statement
*/
- public void add_statement (Statement! stmt) {
+ public void add_statement (Statement stmt) {
statement_list.add (stmt);
}
*
* @param decl a variable declarator
*/
- public void add_local_variable (VariableDeclarator! decl) {
+ public void add_local_variable (VariableDeclarator decl) {
local_variables.add (decl);
}
return new ReadOnlyCollection<VariableDeclarator> (local_variables);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_block (this);
}
- public override void accept_children (CodeVisitor! visitor) {
- foreach (Statement! stmt in statement_list) {
+ public override void accept_children (CodeVisitor visitor) {
+ foreach (Statement stmt in statement_list) {
stmt.accept (visitor);
}
}
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_boolean_literal (this);
}
- public override string! to_string () {
+ public override string to_string () {
if (value) {
return "true";
} else {
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_break_statement (this);
}
}
/**
* The expression to be cast.
*/
- public Expression! inner {
+ public Expression inner {
get {
return _inner;
}
/**
* The target type.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
*/
public bool is_silent_cast { get; set construct; }
- private Expression! _inner;
+ private Expression _inner;
private DataType _data_type;
* @param type target type
* @return newly created cast expression
*/
- public CastExpression (construct Expression! inner, construct DataType! type_reference, construct SourceReference source_reference, construct bool is_silent_cast) {
+ public CastExpression (construct Expression inner, construct DataType type_reference, construct SourceReference source_reference, construct bool is_silent_cast) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
inner.accept (visitor);
type_reference.accept (visitor);
visitor.visit_cast_expression (this);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
}
return inner.is_pure ();
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
public CatchClause (construct DataType? type_reference, construct string variable_name, construct Block body, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_catch_clause (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (type_reference != null) {
type_reference.accept (visitor);
}
body.accept (visitor);
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
*
* @param context a code context
*/
- public void build_cfg (CodeContext! context) {
+ public void build_cfg (CodeContext context) {
this.context = context;
/* we're only interested in non-pkg source files */
}
}
- public override void visit_source_file (SourceFile! source_file) {
+ public override void visit_source_file (SourceFile source_file) {
source_file.accept_children (this);
}
- public override void visit_class (Class! cl) {
+ public override void visit_class (Class cl) {
cl.accept_children (this);
}
- public override void visit_struct (Struct! st) {
+ public override void visit_struct (Struct st) {
st.accept_children (this);
}
- public override void visit_interface (Interface! iface) {
+ public override void visit_interface (Interface iface) {
iface.accept_children (this);
}
- public override void visit_enum (Enum! en) {
+ public override void visit_enum (Enum en) {
en.accept_children (this);
}
- public override void visit_method (Method! m) {
+ public override void visit_method (Method m) {
if (m.body == null) {
return;
}
}
}
- public override void visit_property (Property! prop) {
+ public override void visit_property (Property prop) {
prop.accept_children (this);
}
- public override void visit_property_accessor (PropertyAccessor! acc) {
+ public override void visit_property_accessor (PropertyAccessor acc) {
if (acc.body == null) {
return;
}
}
}
- public override void visit_block (Block! b) {
+ public override void visit_block (Block b) {
b.accept_children (this);
}
- public override void visit_declaration_statement (DeclarationStatement! stmt) {
+ public override void visit_declaration_statement (DeclarationStatement stmt) {
if (unreachable (stmt)) {
return;
}
}
}
- public override void visit_expression_statement (ExpressionStatement! stmt) {
+ public override void visit_expression_statement (ExpressionStatement stmt) {
if (unreachable (stmt)) {
return;
}
}
}
- public override void visit_if_statement (IfStatement! stmt) {
+ public override void visit_if_statement (IfStatement stmt) {
if (unreachable (stmt)) {
return;
}
}
}
- public override void visit_switch_statement (SwitchStatement! stmt) {
+ public override void visit_switch_statement (SwitchStatement stmt) {
if (unreachable (stmt)) {
return;
}
jump_stack.remove_at (jump_stack.size - 1);
}
- public override void visit_while_statement (WhileStatement! stmt) {
+ public override void visit_while_statement (WhileStatement stmt) {
if (unreachable (stmt)) {
return;
}
jump_stack.remove_at (jump_stack.size - 1);
}
- public override void visit_do_statement (DoStatement! stmt) {
+ public override void visit_do_statement (DoStatement stmt) {
if (unreachable (stmt)) {
return;
}
jump_stack.remove_at (jump_stack.size - 1);
}
- public override void visit_for_statement (ForStatement! stmt) {
+ public override void visit_for_statement (ForStatement stmt) {
if (unreachable (stmt)) {
return;
}
jump_stack.remove_at (jump_stack.size - 1);
}
- public override void visit_foreach_statement (ForeachStatement! stmt) {
+ public override void visit_foreach_statement (ForeachStatement stmt) {
if (unreachable (stmt)) {
return;
}
jump_stack.remove_at (jump_stack.size - 1);
}
- public override void visit_break_statement (BreakStatement! stmt) {
+ public override void visit_break_statement (BreakStatement stmt) {
if (unreachable (stmt)) {
return;
}
stmt.error = true;
}
- public override void visit_continue_statement (ContinueStatement! stmt) {
+ public override void visit_continue_statement (ContinueStatement stmt) {
if (unreachable (stmt)) {
return;
}
stmt.error = true;
}
- public override void visit_return_statement (ReturnStatement! stmt) {
+ public override void visit_return_statement (ReturnStatement stmt) {
if (unreachable (stmt)) {
return;
}
}
}
- public override void visit_throw_statement (ThrowStatement! stmt) {
+ public override void visit_throw_statement (ThrowStatement stmt) {
if (unreachable (stmt)) {
return;
}
assert_not_reached ();
}
- public override void visit_try_statement (TryStatement! stmt) {
+ public override void visit_try_statement (TryStatement stmt) {
if (unreachable (stmt)) {
return;
}
}
}
- public override void visit_lock_statement (LockStatement! stmt) {
+ public override void visit_lock_statement (LockStatement stmt) {
if (unreachable (stmt)) {
return;
}
/**
* The literal value.
*/
- public string! value {
+ public string value {
get {
return _value;
}
}
}
- private string! _value;
+ private string _value;
/**
* Creates a new character literal.
* @param source reference to source code
* @return newly created character literal
*/
- public CharacterLiteral (string! c, SourceReference source) {
+ public CharacterLiteral (string c, SourceReference source) {
value = c;
source_reference = source;
}
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_character_literal (this);
}
* @param source reference to source code
* @return newly created class
*/
- public Class (construct string! name, construct SourceReference source_reference = null) {
+ public Class (construct string name, construct SourceReference source_reference = null) {
}
/**
*
* @param type a class or interface reference
*/
- public void add_base_type (DataType! type) {
+ public void add_base_type (DataType type) {
base_types.add (type);
type.parent_node = this;
}
*
* @param p a type parameter
*/
- public void add_type_parameter (TypeParameter! p) {
+ public void add_type_parameter (TypeParameter p) {
type_parameters.add (p);
p.type = this;
scope.add (p.name, p);
*
* @param c a constant
*/
- public void add_constant (Constant! c) {
+ public void add_constant (Constant c) {
constants.add (c);
scope.add (c.name, c);
}
*
* @param f a field
*/
- public void add_field (Field! f) {
+ public void add_field (Field f) {
fields.add (f);
if (f.access == SymbolAccessibility.PRIVATE && f.instance) {
has_private_fields = true;
*
* @param m a method
*/
- public void add_method (Method! m) {
+ public void add_method (Method m) {
if (m.instance || m is CreationMethod) {
if (m.this_parameter != null) {
m.scope.remove (m.this_parameter.name);
*
* @param prop a property
*/
- public void add_property (Property! prop, bool no_field = false) {
+ public void add_property (Property prop, bool no_field = false) {
properties.add (prop);
scope.add (prop.name, prop);
*
* @param sig a signal
*/
- public void add_signal (Signal! sig) {
+ public void add_signal (Signal sig) {
signals.add (sig);
scope.add (sig.name, sig);
}
*
* @param cl a class
*/
- public void add_class (Class! cl) {
+ public void add_class (Class cl) {
classes.add (cl);
scope.add (cl.name, cl);
}
*
* @param st a struct
*/
- public void add_struct (Struct! st) {
+ public void add_struct (Struct st) {
structs.add (st);
scope.add (st.name, st);
}
*
* @param d a delegate
*/
- public void add_delegate (Delegate! d) {
+ public void add_delegate (Delegate d) {
delegates.add (d);
scope.add (d.name, d);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_class (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (DataType type in base_types) {
type.accept (visitor);
}
}
}
- public override string! get_cprefix () {
+ public override string get_cprefix () {
return get_cname ();
}
*
* @return the name to be used in C code by default
*/
- public string! get_default_cname () {
+ public string get_default_cname () {
return "%s%s".printf (parent_symbol.get_cprefix (), name);
}
*
* @param cname the name to be used in C code
*/
- public void set_cname (string! cname) {
+ public void set_cname (string cname) {
this.cname = cname;
}
return "%s%s%s".printf (parent_symbol.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
}
- public override string! get_lower_case_cprefix () {
+ public override string get_lower_case_cprefix () {
if (lower_case_cprefix == null) {
lower_case_cprefix = "%s_".printf (get_lower_case_cname (null));
}
return true;
}
- private void process_ccode_attribute (Attribute! a) {
+ private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("ref_function")) {
set_ref_function (a.get_string ("ref_function"));
}
return type_id;
}
- public void set_type_id (string! type_id) {
+ public void set_type_id (string type_id) {
this.type_id = type_id;
}
}
}
- public void set_ref_function (string! name) {
+ public void set_ref_function (string name) {
this.ref_function = name;
}
}
}
- public void set_unref_function (string! name) {
+ public void set_unref_function (string name) {
this.unref_function = name;
}
return copy_function;
}
- public void set_dup_function (string! name) {
+ public void set_dup_function (string name) {
this.copy_function = name;
}
return free_function;
}
- public void set_free_function (string! name) {
+ public void set_free_function (string name) {
this.free_function = name;
}
- public override bool is_subtype_of (Typesymbol! t) {
+ public override bool is_subtype_of (Typesymbol t) {
if (this == t) {
return true;
}
return false;
}
- public override int get_type_parameter_index (string! name) {
+ public override int get_type_parameter_index (string name) {
int i = 0;
foreach (TypeParameter parameter in type_parameters) {
if (parameter.name == name) {
return -1;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
for (int i = 0; i < base_types.size; i++) {
if (base_types[i] == old_type) {
base_types[i] = new_type;
*/
public weak Class class_symbol { get; set; }
- public ClassType (construct Class! class_symbol) {
+ public ClassType (construct Class class_symbol) {
data_type = class_symbol;
}
private Gee.List<SourceFile> source_files = new ArrayList<SourceFile> ();
private Gee.List<string> c_source_files = new ArrayList<string> ();
- private Namespace! _root = new Namespace (null);
+ private Namespace _root = new Namespace (null);
private Gee.List<SourceFileCycle> cycles = new ArrayList<SourceFileCycle> ();
*
* @return root namespace
*/
- public Namespace! root {
+ public Namespace root {
get { return _root; }
}
*
* @param file a source file
*/
- public void add_source_file (SourceFile! file) {
+ public void add_source_file (SourceFile file) {
source_files.add (file);
}
*
* @param file a C source file
*/
- public void add_c_source_file (string! file) {
+ public void add_c_source_file (string file) {
c_source_files.add (file);
}
* @param pkg a package name
* @return true if the specified package is being used
*/
- public bool has_package (string! pkg) {
+ public bool has_package (string pkg) {
return packages.contains (pkg);
}
*
* @param pkg a package name
*/
- public void add_package (string! pkg) {
+ public void add_package (string pkg) {
packages.add (pkg);
}
*
* @param visitor the visitor to be called when traversing
*/
- public void accept (CodeVisitor! visitor) {
+ public void accept (CodeVisitor visitor) {
root.accept (visitor);
foreach (SourceFile file in source_files) {
}
- private weak SourceFile find_cycle_head (SourceFile! file) {
+ private weak SourceFile find_cycle_head (SourceFile file) {
foreach (SourceFile dep in file.get_header_internal_full_dependencies ()) {
if (dep == file) {
/* ignore file-internal dependencies */
return file;
}
- private void visit (SourceFile! file, Collection<SourceFile> chain) {
+ private void visit (SourceFile file, Collection<SourceFile> chain) {
Gee.List<SourceFile> l = new ArrayList<SourceFile> ();
foreach (SourceFile chain_file in chain) {
l.add (chain_file);
}
}
- public string get_package_path (string! pkg, [CCode (array_length_pos = 1.9)] string[] vapi_directories) {
+ public string get_package_path (string pkg, [CCode (array_length_pos = 1.9)] string[] vapi_directories) {
string basename = "%s.vapi".printf (pkg);
string filename = null;
return null;
}
- public Namespace! create_namespace (string name, SourceReference source_reference = null) {
+ public Namespace create_namespace (string name, SourceReference source_reference = null) {
var node = new Namespace (name, source_reference);
node.code_binding = codegen.create_namespace_binding (node);
return node;
}
- public Class! create_class (string! name, SourceReference source_reference = null) {
+ public Class create_class (string name, SourceReference source_reference = null) {
var node = new Class (name, source_reference);
node.code_binding = codegen.create_class_binding (node);
return node;
}
- public Struct! create_struct (string! name, SourceReference source_reference = null) {
+ public Struct create_struct (string name, SourceReference source_reference = null) {
var node = new Struct (name, source_reference);
node.code_binding = codegen.create_struct_binding (node);
return node;
}
- public Interface! create_interface (string! name, SourceReference source_reference = null) {
+ public Interface create_interface (string name, SourceReference source_reference = null) {
var node = new Interface (name, source_reference);
node.code_binding = codegen.create_interface_binding (node);
return node;
}
- public Enum! create_enum (string! name, SourceReference source_reference = null) {
+ public Enum create_enum (string name, SourceReference source_reference = null) {
var node = new Enum (name, source_reference);
node.code_binding = codegen.create_enum_binding (node);
return node;
}
- public EnumValue! create_enum_value (string! name, SourceReference source_reference = null) {
+ public EnumValue create_enum_value (string name, SourceReference source_reference = null) {
var node = new EnumValue (name, source_reference);
node.code_binding = codegen.create_enum_value_binding (node);
return node;
}
- public EnumValue! create_enum_value_with_value (string! name, Expression value, SourceReference source_reference = null) {
+ public EnumValue create_enum_value_with_value (string name, Expression value, SourceReference source_reference = null) {
var node = new EnumValue.with_value (name, value, source_reference);
node.code_binding = codegen.create_enum_value_binding (node);
return node;
}
- public ErrorDomain create_error_domain (string! name, SourceReference source_reference = null) {
+ public ErrorDomain create_error_domain (string name, SourceReference source_reference = null) {
var node = new ErrorDomain (name, source_reference);
node.code_binding = codegen.create_error_domain_binding (node);
return node;
}
- public ErrorCode create_error_code (string! name) {
+ public ErrorCode create_error_code (string name) {
var node = new ErrorCode (name);
node.code_binding = codegen.create_error_code_binding (node);
return node;
}
- public ErrorCode create_error_code_with_value (string! name, Expression value) {
+ public ErrorCode create_error_code_with_value (string name, Expression value) {
var node = new ErrorCode.with_value (name, value);
node.code_binding = codegen.create_error_code_binding (node);
return node;
}
- public Delegate! create_delegate (string name, DataType return_type, SourceReference source_reference = null) {
+ public Delegate create_delegate (string name, DataType return_type, SourceReference source_reference = null) {
var node = new Delegate (name, return_type, source_reference);
node.code_binding = codegen.create_delegate_binding (node);
return node;
}
- public Constant! create_constant (string! name, DataType! type_reference, Expression initializer, SourceReference source_reference) {
+ public Constant create_constant (string name, DataType type_reference, Expression initializer, SourceReference source_reference) {
var node = new Constant (name, type_reference, initializer, source_reference);
node.code_binding = codegen.create_constant_binding (node);
return node;
}
- public Field! create_field (string! name, DataType! type_reference, Expression initializer, SourceReference source_reference = null) {
+ public Field create_field (string name, DataType type_reference, Expression initializer, SourceReference source_reference = null) {
var node = new Field (name, type_reference, initializer, source_reference);
node.code_binding = codegen.create_field_binding (node);
return node;
}
- public Method! create_method (string name, DataType return_type, SourceReference source_reference = null) {
+ public Method create_method (string name, DataType return_type, SourceReference source_reference = null) {
var node = new Method (name, return_type, source_reference);
node.code_binding = codegen.create_method_binding (node);
return node;
}
- public CreationMethod! create_creation_method (string type_name, string name, SourceReference source_reference = null) {
+ public CreationMethod create_creation_method (string type_name, string name, SourceReference source_reference = null) {
var node = new CreationMethod (type_name, name, source_reference);
node.code_binding = codegen.create_creation_method_binding (node);
return node;
}
- public FormalParameter! create_formal_parameter (string! name, DataType type_reference, SourceReference source_reference = null) {
+ public FormalParameter create_formal_parameter (string name, DataType type_reference, SourceReference source_reference = null) {
var node = new FormalParameter (name, type_reference, source_reference);
node.code_binding = codegen.create_formal_parameter_binding (node);
return node;
}
- public FormalParameter! create_formal_parameter_with_ellipsis (SourceReference source_reference = null) {
+ public FormalParameter create_formal_parameter_with_ellipsis (SourceReference source_reference = null) {
var node = new FormalParameter.with_ellipsis (source_reference);
node.code_binding = codegen.create_formal_parameter_binding (node);
return node;
}
- public Property! create_property (string! name, DataType! type_reference, PropertyAccessor get_accessor, PropertyAccessor set_accessor, SourceReference source_reference) {
+ public Property create_property (string name, DataType type_reference, PropertyAccessor get_accessor, PropertyAccessor set_accessor, SourceReference source_reference) {
var node = new Property (name, type_reference, get_accessor, set_accessor, source_reference);
node.code_binding = codegen.create_property_binding (node);
return node;
}
- public PropertyAccessor! create_property_accessor (bool readable, bool writable, bool construction, Block body, SourceReference source_reference) {
+ public PropertyAccessor create_property_accessor (bool readable, bool writable, bool construction, Block body, SourceReference source_reference) {
var node = new PropertyAccessor (readable, writable, construction, body, source_reference);
node.code_binding = codegen.create_property_accessor_binding (node);
return node;
}
- public Signal! create_signal (string! name, DataType! return_type, SourceReference source_reference = null) {
+ public Signal create_signal (string name, DataType return_type, SourceReference source_reference = null) {
var node = new Signal (name, return_type, source_reference);
node.code_binding = codegen.create_signal_binding (node);
return node;
}
- public Constructor! create_constructor (SourceReference source_reference) {
+ public Constructor create_constructor (SourceReference source_reference) {
var node = new Constructor (source_reference);
node.code_binding = codegen.create_constructor_binding (node);
return node;
}
- public Destructor! create_destructor (SourceReference source_reference = null) {
+ public Destructor create_destructor (SourceReference source_reference = null) {
var node = new Destructor (source_reference);
node.code_binding = codegen.create_destructor_binding (node);
return node;
}
- public TypeParameter! create_type_parameter (string name, SourceReference source_reference) {
+ public TypeParameter create_type_parameter (string name, SourceReference source_reference) {
var node = new TypeParameter (name, source_reference);
node.code_binding = codegen.create_type_parameter_binding (node);
return node;
}
- public Block! create_block (SourceReference source_reference = null) {
+ public Block create_block (SourceReference source_reference = null) {
var node = new Block (source_reference);
node.code_binding = codegen.create_block_binding (node);
return node;
}
- public EmptyStatement! create_empty_statement (SourceReference source_reference = null) {
+ public EmptyStatement create_empty_statement (SourceReference source_reference = null) {
var node = new EmptyStatement (source_reference);
node.code_binding = codegen.create_empty_statement_binding (node);
return node;
}
- public DeclarationStatement! create_declaration_statement (LocalVariableDeclaration! declaration, SourceReference source_reference) {
+ public DeclarationStatement create_declaration_statement (LocalVariableDeclaration declaration, SourceReference source_reference) {
var node = new DeclarationStatement (declaration, source_reference);
node.code_binding = codegen.create_declaration_statement_binding (node);
return node;
}
- public LocalVariableDeclaration! create_local_variable_declaration (DataType type_reference, SourceReference source_reference) {
+ public LocalVariableDeclaration create_local_variable_declaration (DataType type_reference, SourceReference source_reference) {
var node = new LocalVariableDeclaration (type_reference, source_reference);
node.code_binding = codegen.create_local_variable_declaration_binding (node);
return node;
}
- public LocalVariableDeclaration! create_local_variable_declaration_var_type (SourceReference source_reference) {
+ public LocalVariableDeclaration create_local_variable_declaration_var_type (SourceReference source_reference) {
var node = new LocalVariableDeclaration.var_type (source_reference);
node.code_binding = codegen.create_local_variable_declaration_binding (node);
return node;
}
- public VariableDeclarator! create_variable_declarator (string! name, Expression initializer = null, SourceReference source_reference = null) {
+ public VariableDeclarator create_variable_declarator (string name, Expression initializer = null, SourceReference source_reference = null) {
var node = new VariableDeclarator (name, initializer, source_reference);
node.code_binding = codegen.create_variable_declarator_binding (node);
return node;
}
- public InitializerList! create_initializer_list (SourceReference source_reference) {
+ public InitializerList create_initializer_list (SourceReference source_reference) {
var node = new InitializerList (source_reference);
node.code_binding = codegen.create_initializer_list_binding (node);
return node;
}
- public ExpressionStatement! create_expression_statement (Expression! expression, SourceReference source_reference = null) {
+ public ExpressionStatement create_expression_statement (Expression expression, SourceReference source_reference = null) {
var node = new ExpressionStatement (expression, source_reference);
node.code_binding = codegen.create_expression_statement_binding (node);
return node;
}
- public IfStatement! create_if_statement (Expression! condition, Block! true_statement, Block false_statement, SourceReference source_reference) {
+ public IfStatement create_if_statement (Expression condition, Block true_statement, Block false_statement, SourceReference source_reference) {
var node = new IfStatement (condition, true_statement, false_statement, source_reference);
node.code_binding = codegen.create_if_statement_binding (node);
return node;
}
- public SwitchStatement! create_switch_statement (Expression! expression, SourceReference source_reference) {
+ public SwitchStatement create_switch_statement (Expression expression, SourceReference source_reference) {
var node = new SwitchStatement (expression, source_reference);
node.code_binding = codegen.create_switch_statement_binding (node);
return node;
}
- public SwitchSection! create_switch_section (SourceReference source_reference) {
+ public SwitchSection create_switch_section (SourceReference source_reference) {
var node = new SwitchSection (source_reference);
node.code_binding = codegen.create_switch_section_binding (node);
return node;
}
- public SwitchLabel! create_switch_label (Expression expression, SourceReference source_reference = null) {
+ public SwitchLabel create_switch_label (Expression expression, SourceReference source_reference = null) {
var node = new SwitchLabel (expression, source_reference);
node.code_binding = codegen.create_switch_label_binding (node);
return node;
}
- public SwitchLabel! create_switch_label_with_default (SourceReference source_reference = null) {
+ public SwitchLabel create_switch_label_with_default (SourceReference source_reference = null) {
var node = new SwitchLabel.with_default (source_reference);
node.code_binding = codegen.create_switch_label_binding (node);
return node;
}
- public WhileStatement! create_while_statement (Expression! condition, Block! body, SourceReference source_reference = null) {
+ public WhileStatement create_while_statement (Expression condition, Block body, SourceReference source_reference = null) {
var node = new WhileStatement (condition, body, source_reference);
node.code_binding = codegen.create_while_statement_binding (node);
return node;
}
- public DoStatement! create_do_statement (Block! body, Expression! condition, SourceReference source_reference = null) {
+ public DoStatement create_do_statement (Block body, Expression condition, SourceReference source_reference = null) {
var node = new DoStatement (body, condition, source_reference);
node.code_binding = codegen.create_do_statement_binding (node);
return node;
}
- public ForStatement! create_for_statement (Expression condition, Block body, SourceReference source_reference = null) {
+ public ForStatement create_for_statement (Expression condition, Block body, SourceReference source_reference = null) {
var node = new ForStatement (condition, body, source_reference);
node.code_binding = codegen.create_for_statement_binding (node);
return node;
}
- public ForeachStatement! create_foreach_statement (DataType! type_reference, string! variable_name, Expression! collection, Block body, SourceReference source_reference) {
+ public ForeachStatement create_foreach_statement (DataType type_reference, string variable_name, Expression collection, Block body, SourceReference source_reference) {
var node = new ForeachStatement (type_reference, variable_name, collection, body, source_reference);
node.code_binding = codegen.create_foreach_statement_binding (node);
return node;
}
- public BreakStatement! create_break_statement (SourceReference source_reference) {
+ public BreakStatement create_break_statement (SourceReference source_reference) {
var node = new BreakStatement (source_reference);
node.code_binding = codegen.create_break_statement_binding (node);
return node;
}
- public ContinueStatement! create_continue_statement (SourceReference source_reference) {
+ public ContinueStatement create_continue_statement (SourceReference source_reference) {
var node = new ContinueStatement (source_reference);
node.code_binding = codegen.create_continue_statement_binding (node);
return node;
}
- public ReturnStatement! create_return_statement (Expression return_expression = null, SourceReference source_reference = null) {
+ public ReturnStatement create_return_statement (Expression return_expression = null, SourceReference source_reference = null) {
var node = new ReturnStatement (return_expression, source_reference);
node.code_binding = codegen.create_return_statement_binding (node);
return node;
}
- public ThrowStatement! create_throw_statement (Expression! error_expression, SourceReference source_reference = null) {
+ public ThrowStatement create_throw_statement (Expression error_expression, SourceReference source_reference = null) {
var node = new ThrowStatement (error_expression, source_reference);
node.code_binding = codegen.create_throw_statement_binding (node);
return node;
}
- public TryStatement! create_try_statement (Block! body, Block finally_body, SourceReference source_reference = null) {
+ public TryStatement create_try_statement (Block body, Block finally_body, SourceReference source_reference = null) {
var node = new TryStatement (body, finally_body, source_reference);
node.code_binding = codegen.create_try_statement_binding (node);
return node;
}
- public CatchClause! create_catch_clause (DataType type_reference, string variable_name, Block body, SourceReference source_reference = null) {
+ public CatchClause create_catch_clause (DataType type_reference, string variable_name, Block body, SourceReference source_reference = null) {
var node = new CatchClause (type_reference, variable_name, body, source_reference);
node.code_binding = codegen.create_catch_clause_binding (node);
return node;
}
- public LockStatement! create_lock_statement (Expression resource, Block body, SourceReference source_reference = null) {
+ public LockStatement create_lock_statement (Expression resource, Block body, SourceReference source_reference = null) {
var node = new LockStatement (resource, body, source_reference);
node.code_binding = codegen.create_lock_statement_binding (node);
return node;
return node;
}
- public ArrayCreationExpression! create_array_creation_expression (DataType element_type, int rank, InitializerList initializer_list, SourceReference source_reference) {
+ public ArrayCreationExpression create_array_creation_expression (DataType element_type, int rank, InitializerList initializer_list, SourceReference source_reference) {
var node = new ArrayCreationExpression (element_type, rank, initializer_list, source_reference);
node.code_binding = codegen.create_array_creation_expression_binding (node);
return node;
}
- public BooleanLiteral! create_boolean_literal (bool value, SourceReference source_reference) {
+ public BooleanLiteral create_boolean_literal (bool value, SourceReference source_reference) {
var node = new BooleanLiteral (value, source_reference);
node.code_binding = codegen.create_boolean_literal_binding (node);
return node;
}
- public CharacterLiteral! create_character_literal (string! value, SourceReference source_reference) {
+ public CharacterLiteral create_character_literal (string value, SourceReference source_reference) {
var node = new CharacterLiteral (value, source_reference);
node.code_binding = codegen.create_character_literal_binding (node);
return node;
}
- public IntegerLiteral! create_integer_literal (string! value, SourceReference source_reference = null) {
+ public IntegerLiteral create_integer_literal (string value, SourceReference source_reference = null) {
var node = new IntegerLiteral (value, source_reference);
node.code_binding = codegen.create_integer_literal_binding (node);
return node;
}
- public RealLiteral! create_real_literal (string value, SourceReference source_reference) {
+ public RealLiteral create_real_literal (string value, SourceReference source_reference) {
var node = new RealLiteral (value, source_reference);
node.code_binding = codegen.create_real_literal_binding (node);
return node;
}
- public StringLiteral! create_string_literal (string value, SourceReference source_reference) {
+ public StringLiteral create_string_literal (string value, SourceReference source_reference) {
var node = new StringLiteral (value, source_reference);
node.code_binding = codegen.create_string_literal_binding (node);
return node;
}
- public NullLiteral! create_null_literal (SourceReference source_reference = null) {
+ public NullLiteral create_null_literal (SourceReference source_reference = null) {
var node = new NullLiteral (source_reference);
node.code_binding = codegen.create_null_literal_binding (node);
return node;
}
- public ParenthesizedExpression! create_parenthesized_expression (Expression! inner, SourceReference source_reference) {
+ public ParenthesizedExpression create_parenthesized_expression (Expression inner, SourceReference source_reference) {
var node = new ParenthesizedExpression (inner, source_reference);
node.code_binding = codegen.create_parenthesized_expression_binding (node);
return node;
}
- public MemberAccess! create_member_access (Expression inner, string! member_name, SourceReference source_reference = null) {
+ public MemberAccess create_member_access (Expression inner, string member_name, SourceReference source_reference = null) {
var node = new MemberAccess (inner, member_name, source_reference);
node.code_binding = codegen.create_member_access_binding (node);
return node;
}
- public MemberAccess! create_member_access_simple (string! member_name, SourceReference source_reference = null) {
+ public MemberAccess create_member_access_simple (string member_name, SourceReference source_reference = null) {
var node = new MemberAccess.simple (member_name, source_reference);
node.code_binding = codegen.create_member_access_binding (node);
return node;
}
- public MemberAccess! create_member_access_pointer (Expression inner, string! member_name, SourceReference source_reference = null) {
+ public MemberAccess create_member_access_pointer (Expression inner, string member_name, SourceReference source_reference = null) {
var node = new MemberAccess.pointer (inner, member_name, source_reference);
node.code_binding = codegen.create_member_access_binding (node);
return node;
}
- public InvocationExpression! create_invocation_expression (Expression! call, SourceReference source_reference = null) {
+ public InvocationExpression create_invocation_expression (Expression call, SourceReference source_reference = null) {
var node = new InvocationExpression (call, source_reference);
node.code_binding = codegen.create_invocation_expression_binding (node);
return node;
}
- public ElementAccess! create_element_access (Expression container, SourceReference source_reference) {
+ public ElementAccess create_element_access (Expression container, SourceReference source_reference) {
var node = new ElementAccess (container, source_reference);
node.code_binding = codegen.create_element_access_binding (node);
return node;
}
- public BaseAccess! create_base_access (SourceReference source_reference = null) {
+ public BaseAccess create_base_access (SourceReference source_reference = null) {
var node = new BaseAccess (source_reference);
node.code_binding = codegen.create_base_access_binding (node);
return node;
}
- public PostfixExpression! create_postfix_expression (Expression! inner, bool increment, SourceReference source_reference) {
+ public PostfixExpression create_postfix_expression (Expression inner, bool increment, SourceReference source_reference) {
var node = new PostfixExpression (inner, increment, source_reference);
node.code_binding = codegen.create_postfix_expression_binding (node);
return node;
}
- public ObjectCreationExpression! create_object_creation_expression (MemberAccess! member_name, SourceReference source_reference) {
+ public ObjectCreationExpression create_object_creation_expression (MemberAccess member_name, SourceReference source_reference) {
var node = new ObjectCreationExpression (member_name, source_reference);
node.code_binding = codegen.create_object_creation_expression_binding (node);
return node;
}
- public SizeofExpression! create_sizeof_expression (DataType! type_reference, SourceReference source_reference) {
+ public SizeofExpression create_sizeof_expression (DataType type_reference, SourceReference source_reference) {
var node = new SizeofExpression (type_reference, source_reference);
node.code_binding = codegen.create_sizeof_expression_binding (node);
return node;
}
- public TypeofExpression! create_typeof_expression (DataType! type_reference, SourceReference source_reference) {
+ public TypeofExpression create_typeof_expression (DataType type_reference, SourceReference source_reference) {
var node = new TypeofExpression (type_reference, source_reference);
node.code_binding = codegen.create_typeof_expression_binding (node);
return node;
}
- public UnaryExpression! create_unary_expression (UnaryOperator operator, Expression! inner, SourceReference source_reference) {
+ public UnaryExpression create_unary_expression (UnaryOperator operator, Expression inner, SourceReference source_reference) {
var node = new UnaryExpression (operator, inner, source_reference);
node.code_binding = codegen.create_unary_expression_binding (node);
return node;
}
- public CastExpression! create_cast_expression (Expression! inner, DataType! type_reference, SourceReference source_reference, bool is_silent_cast) {
+ public CastExpression create_cast_expression (Expression inner, DataType type_reference, SourceReference source_reference, bool is_silent_cast) {
var node = new CastExpression (inner, type_reference, source_reference, is_silent_cast);
node.code_binding = codegen.create_cast_expression_binding (node);
return node;
}
- public PointerIndirection! create_pointer_indirection (Expression! inner, SourceReference source_reference = null) {
+ public PointerIndirection create_pointer_indirection (Expression inner, SourceReference source_reference = null) {
var node = new PointerIndirection (inner, source_reference);
node.code_binding = codegen.create_pointer_indirection_binding (node);
return node;
}
- public AddressofExpression! create_addressof_expression (Expression! inner, SourceReference source_reference = null) {
+ public AddressofExpression create_addressof_expression (Expression inner, SourceReference source_reference = null) {
var node = new AddressofExpression (inner, source_reference);
node.code_binding = codegen.create_addressof_expression_binding (node);
return node;
}
- public ReferenceTransferExpression! create_reference_transfer_expression (Expression! inner, SourceReference source_reference = null) {
+ public ReferenceTransferExpression create_reference_transfer_expression (Expression inner, SourceReference source_reference = null) {
var node = new ReferenceTransferExpression (inner, source_reference);
node.code_binding = codegen.create_reference_transfer_expression_binding (node);
return node;
}
- public BinaryExpression! create_binary_expression (BinaryOperator operator, Expression! left, Expression! right, SourceReference source_reference = null) {
+ public BinaryExpression create_binary_expression (BinaryOperator operator, Expression left, Expression right, SourceReference source_reference = null) {
var node = new BinaryExpression (operator, left, right, source_reference);
node.code_binding = codegen.create_binary_expression_binding (node);
return node;
}
- public TypeCheck! create_type_check (Expression! expression, DataType! type_reference, SourceReference source_reference) {
+ public TypeCheck create_type_check (Expression expression, DataType type_reference, SourceReference source_reference) {
var node = new TypeCheck (expression, type_reference, source_reference);
node.code_binding = codegen.create_type_check_binding (node);
return node;
}
- public ConditionalExpression! create_conditional_expression (Expression! condition, Expression! true_expression, Expression! false_expression, SourceReference source_reference) {
+ public ConditionalExpression create_conditional_expression (Expression condition, Expression true_expression, Expression false_expression, SourceReference source_reference) {
var node = new ConditionalExpression (condition, true_expression, false_expression, source_reference);
node.code_binding = codegen.create_conditional_expression_binding (node);
return node;
}
- public LambdaExpression! create_lambda_expression (Expression! expression_body, SourceReference source_reference) {
+ public LambdaExpression create_lambda_expression (Expression expression_body, SourceReference source_reference) {
var node = new LambdaExpression (expression_body, source_reference);
node.code_binding = codegen.create_lambda_expression_binding (node);
return node;
}
- public LambdaExpression! create_lambda_expression_with_statement_body (Block! statement_body, SourceReference source_reference) {
+ public LambdaExpression create_lambda_expression_with_statement_body (Block statement_body, SourceReference source_reference) {
var node = new LambdaExpression.with_statement_body (statement_body, source_reference);
node.code_binding = codegen.create_lambda_expression_binding (node);
return node;
}
- public Assignment! create_assignment (Expression! left, Expression! right, AssignmentOperator operator = AssignmentOperator.SIMPLE, SourceReference source_reference = null) {
+ public Assignment create_assignment (Expression left, Expression right, AssignmentOperator operator = AssignmentOperator.SIMPLE, SourceReference source_reference = null) {
var node = new Assignment (left, right, operator, source_reference);
node.code_binding = codegen.create_assignment_binding (node);
return node;
*
* @param context a code context
*/
- public virtual void emit (CodeContext! context) {
+ public virtual void emit (CodeContext context) {
}
- public virtual CodeBinding create_namespace_binding (Namespace! node) {
+ public virtual CodeBinding create_namespace_binding (Namespace node) {
return null;
}
- public virtual CodeBinding create_class_binding (Class! node) {
+ public virtual CodeBinding create_class_binding (Class node) {
return null;
}
- public virtual CodeBinding create_struct_binding (Struct! node) {
+ public virtual CodeBinding create_struct_binding (Struct node) {
return null;
}
- public virtual CodeBinding create_interface_binding (Interface! node) {
+ public virtual CodeBinding create_interface_binding (Interface node) {
return null;
}
- public virtual CodeBinding create_enum_binding (Enum! node) {
+ public virtual CodeBinding create_enum_binding (Enum node) {
return null;
}
- public virtual CodeBinding create_enum_value_binding (EnumValue! node) {
+ public virtual CodeBinding create_enum_value_binding (EnumValue node) {
return null;
}
return null;
}
- public virtual CodeBinding create_delegate_binding (Delegate! node) {
+ public virtual CodeBinding create_delegate_binding (Delegate node) {
return null;
}
- public virtual CodeBinding create_constant_binding (Constant! node) {
+ public virtual CodeBinding create_constant_binding (Constant node) {
return null;
}
- public virtual CodeBinding create_field_binding (Field! node) {
+ public virtual CodeBinding create_field_binding (Field node) {
return null;
}
- public virtual CodeBinding create_method_binding (Method! node) {
+ public virtual CodeBinding create_method_binding (Method node) {
return null;
}
- public virtual CodeBinding create_creation_method_binding (CreationMethod! node) {
+ public virtual CodeBinding create_creation_method_binding (CreationMethod node) {
return null;
}
- public virtual CodeBinding create_formal_parameter_binding (FormalParameter! node) {
+ public virtual CodeBinding create_formal_parameter_binding (FormalParameter node) {
return null;
}
- public virtual CodeBinding create_property_binding (Property! node) {
+ public virtual CodeBinding create_property_binding (Property node) {
return null;
}
- public virtual CodeBinding create_property_accessor_binding (PropertyAccessor! node) {
+ public virtual CodeBinding create_property_accessor_binding (PropertyAccessor node) {
return null;
}
- public virtual CodeBinding create_signal_binding (Signal! node) {
+ public virtual CodeBinding create_signal_binding (Signal node) {
return null;
}
- public virtual CodeBinding create_constructor_binding (Constructor! node) {
+ public virtual CodeBinding create_constructor_binding (Constructor node) {
return null;
}
- public virtual CodeBinding create_destructor_binding (Destructor! node) {
+ public virtual CodeBinding create_destructor_binding (Destructor node) {
return null;
}
- public virtual CodeBinding create_type_parameter_binding (TypeParameter! node) {
+ public virtual CodeBinding create_type_parameter_binding (TypeParameter node) {
return null;
}
- public virtual CodeBinding create_block_binding (Block! node) {
+ public virtual CodeBinding create_block_binding (Block node) {
return null;
}
- public virtual CodeBinding create_empty_statement_binding (EmptyStatement! node) {
+ public virtual CodeBinding create_empty_statement_binding (EmptyStatement node) {
return null;
}
- public virtual CodeBinding create_declaration_statement_binding (DeclarationStatement! node) {
+ public virtual CodeBinding create_declaration_statement_binding (DeclarationStatement node) {
return null;
}
- public virtual CodeBinding create_local_variable_declaration_binding (LocalVariableDeclaration! node) {
+ public virtual CodeBinding create_local_variable_declaration_binding (LocalVariableDeclaration node) {
return null;
}
- public virtual CodeBinding create_variable_declarator_binding (VariableDeclarator! node) {
+ public virtual CodeBinding create_variable_declarator_binding (VariableDeclarator node) {
return null;
}
- public virtual CodeBinding create_initializer_list_binding (InitializerList! node) {
+ public virtual CodeBinding create_initializer_list_binding (InitializerList node) {
return null;
}
- public virtual CodeBinding create_expression_statement_binding (ExpressionStatement! node) {
+ public virtual CodeBinding create_expression_statement_binding (ExpressionStatement node) {
return null;
}
- public virtual CodeBinding create_if_statement_binding (IfStatement! node) {
+ public virtual CodeBinding create_if_statement_binding (IfStatement node) {
return null;
}
- public virtual CodeBinding create_switch_statement_binding (SwitchStatement! node) {
+ public virtual CodeBinding create_switch_statement_binding (SwitchStatement node) {
return null;
}
- public virtual CodeBinding create_switch_section_binding (SwitchSection! node) {
+ public virtual CodeBinding create_switch_section_binding (SwitchSection node) {
return null;
}
- public virtual CodeBinding create_switch_label_binding (SwitchLabel! node) {
+ public virtual CodeBinding create_switch_label_binding (SwitchLabel node) {
return null;
}
- public virtual CodeBinding create_while_statement_binding (WhileStatement! node) {
+ public virtual CodeBinding create_while_statement_binding (WhileStatement node) {
return null;
}
- public virtual CodeBinding create_do_statement_binding (DoStatement! node) {
+ public virtual CodeBinding create_do_statement_binding (DoStatement node) {
return null;
}
- public virtual CodeBinding create_for_statement_binding (ForStatement! node) {
+ public virtual CodeBinding create_for_statement_binding (ForStatement node) {
return null;
}
- public virtual CodeBinding create_foreach_statement_binding (ForeachStatement! node) {
+ public virtual CodeBinding create_foreach_statement_binding (ForeachStatement node) {
return null;
}
- public virtual CodeBinding create_break_statement_binding (BreakStatement! node) {
+ public virtual CodeBinding create_break_statement_binding (BreakStatement node) {
return null;
}
- public virtual CodeBinding create_continue_statement_binding (ContinueStatement! node) {
+ public virtual CodeBinding create_continue_statement_binding (ContinueStatement node) {
return null;
}
- public virtual CodeBinding create_return_statement_binding (ReturnStatement! node) {
+ public virtual CodeBinding create_return_statement_binding (ReturnStatement node) {
return null;
}
- public virtual CodeBinding create_throw_statement_binding (ThrowStatement! node) {
+ public virtual CodeBinding create_throw_statement_binding (ThrowStatement node) {
return null;
}
- public virtual CodeBinding create_try_statement_binding (TryStatement! node) {
+ public virtual CodeBinding create_try_statement_binding (TryStatement node) {
return null;
}
- public virtual CodeBinding create_catch_clause_binding (CatchClause! node) {
+ public virtual CodeBinding create_catch_clause_binding (CatchClause node) {
return null;
}
- public virtual CodeBinding create_lock_statement_binding (LockStatement! node) {
+ public virtual CodeBinding create_lock_statement_binding (LockStatement node) {
return null;
}
return null;
}
- public virtual CodeBinding create_array_creation_expression_binding (ArrayCreationExpression! node) {
+ public virtual CodeBinding create_array_creation_expression_binding (ArrayCreationExpression node) {
return null;
}
- public virtual CodeBinding create_boolean_literal_binding (BooleanLiteral! node) {
+ public virtual CodeBinding create_boolean_literal_binding (BooleanLiteral node) {
return null;
}
- public virtual CodeBinding create_character_literal_binding (CharacterLiteral! node) {
+ public virtual CodeBinding create_character_literal_binding (CharacterLiteral node) {
return null;
}
- public virtual CodeBinding create_integer_literal_binding (IntegerLiteral! node) {
+ public virtual CodeBinding create_integer_literal_binding (IntegerLiteral node) {
return null;
}
- public virtual CodeBinding create_real_literal_binding (RealLiteral! node) {
+ public virtual CodeBinding create_real_literal_binding (RealLiteral node) {
return null;
}
- public virtual CodeBinding create_string_literal_binding (StringLiteral! node) {
+ public virtual CodeBinding create_string_literal_binding (StringLiteral node) {
return null;
}
- public virtual CodeBinding create_null_literal_binding (NullLiteral! node) {
+ public virtual CodeBinding create_null_literal_binding (NullLiteral node) {
return null;
}
- public virtual CodeBinding create_parenthesized_expression_binding (ParenthesizedExpression! node) {
+ public virtual CodeBinding create_parenthesized_expression_binding (ParenthesizedExpression node) {
return null;
}
- public virtual CodeBinding create_member_access_binding (MemberAccess! node) {
+ public virtual CodeBinding create_member_access_binding (MemberAccess node) {
return null;
}
- public virtual CodeBinding create_member_access_simple_binding (MemberAccess! node) {
+ public virtual CodeBinding create_member_access_simple_binding (MemberAccess node) {
return null;
}
- public virtual CodeBinding create_invocation_expression_binding (InvocationExpression! node) {
+ public virtual CodeBinding create_invocation_expression_binding (InvocationExpression node) {
return null;
}
- public virtual CodeBinding create_element_access_binding (ElementAccess! node) {
+ public virtual CodeBinding create_element_access_binding (ElementAccess node) {
return null;
}
- public virtual CodeBinding create_base_access_binding (BaseAccess! node) {
+ public virtual CodeBinding create_base_access_binding (BaseAccess node) {
return null;
}
- public virtual CodeBinding create_postfix_expression_binding (PostfixExpression! node) {
+ public virtual CodeBinding create_postfix_expression_binding (PostfixExpression node) {
return null;
}
- public virtual CodeBinding create_object_creation_expression_binding (ObjectCreationExpression! node) {
+ public virtual CodeBinding create_object_creation_expression_binding (ObjectCreationExpression node) {
return null;
}
- public virtual CodeBinding create_sizeof_expression_binding (SizeofExpression! node) {
+ public virtual CodeBinding create_sizeof_expression_binding (SizeofExpression node) {
return null;
}
- public virtual CodeBinding create_typeof_expression_binding (TypeofExpression! node) {
+ public virtual CodeBinding create_typeof_expression_binding (TypeofExpression node) {
return null;
}
- public virtual CodeBinding create_unary_expression_binding (UnaryExpression! node) {
+ public virtual CodeBinding create_unary_expression_binding (UnaryExpression node) {
return null;
}
- public virtual CodeBinding create_cast_expression_binding (CastExpression! node) {
+ public virtual CodeBinding create_cast_expression_binding (CastExpression node) {
return null;
}
- public virtual CodeBinding create_pointer_indirection_binding (PointerIndirection! node) {
+ public virtual CodeBinding create_pointer_indirection_binding (PointerIndirection node) {
return null;
}
- public virtual CodeBinding create_addressof_expression_binding (AddressofExpression! node) {
+ public virtual CodeBinding create_addressof_expression_binding (AddressofExpression node) {
return null;
}
- public virtual CodeBinding create_reference_transfer_expression_binding (ReferenceTransferExpression! node) {
+ public virtual CodeBinding create_reference_transfer_expression_binding (ReferenceTransferExpression node) {
return null;
}
- public virtual CodeBinding create_binary_expression_binding (BinaryExpression! node) {
+ public virtual CodeBinding create_binary_expression_binding (BinaryExpression node) {
return null;
}
- public virtual CodeBinding create_type_check_binding (TypeCheck! node) {
+ public virtual CodeBinding create_type_check_binding (TypeCheck node) {
return null;
}
- public virtual CodeBinding create_conditional_expression_binding (ConditionalExpression! node) {
+ public virtual CodeBinding create_conditional_expression_binding (ConditionalExpression node) {
return null;
}
- public virtual CodeBinding create_lambda_expression_binding (LambdaExpression! node) {
+ public virtual CodeBinding create_lambda_expression_binding (LambdaExpression node) {
return null;
}
- public virtual CodeBinding create_lambda_expression_with_statement_body_binding (LambdaExpression! node) {
+ public virtual CodeBinding create_lambda_expression_with_statement_body_binding (LambdaExpression node) {
return null;
}
- public virtual CodeBinding create_assignment_binding (Assignment! node) {
+ public virtual CodeBinding create_assignment_binding (Assignment node) {
return null;
}
}
*
* @param visitor the visitor to be called while traversing
*/
- public virtual void accept (CodeVisitor! visitor) {
+ public virtual void accept (CodeVisitor visitor) {
}
/**
*
* @param visitor the visitor to be called while traversing
*/
- public virtual void accept_children (CodeVisitor! visitor) {
+ public virtual void accept_children (CodeVisitor visitor) {
}
- public virtual void replace_type (DataType! old_type, DataType! new_type) {
+ public virtual void replace_type (DataType old_type, DataType new_type) {
}
- public virtual void replace_expression (Expression! old_node, Expression! new_node) {
+ public virtual void replace_expression (Expression old_node, Expression new_node) {
}
/**
* @param name attribute name
* @return attribute
*/
- public Attribute get_attribute (string! name) {
+ public Attribute get_attribute (string name) {
// FIXME: use hash table
foreach (Attribute a in attributes) {
if (a.name == name) {
*
* @return a string representation
*/
- public virtual string! to_string () {
- var str = new String ();
+ public virtual string to_string () {
+ var str = new StringBuilder ();
str.append ("/* ").append (get_type ().name ());
*
* @param source_file a source file
*/
- public virtual void visit_source_file (SourceFile! source_file) {
+ public virtual void visit_source_file (SourceFile source_file) {
}
/**
*
* @param ns a namespace
*/
- public virtual void visit_namespace (Namespace! ns) {
+ public virtual void visit_namespace (Namespace ns) {
}
/**
*
* @param cl a class
*/
- public virtual void visit_class (Class! cl) {
+ public virtual void visit_class (Class cl) {
}
/**
*
* @param st a struct
*/
- public virtual void visit_struct (Struct! st) {
+ public virtual void visit_struct (Struct st) {
}
/**
*
* @param iface an interface
*/
- public virtual void visit_interface (Interface! iface) {
+ public virtual void visit_interface (Interface iface) {
}
/**
*
* @param en an enum
*/
- public virtual void visit_enum (Enum! en) {
+ public virtual void visit_enum (Enum en) {
}
/**
*
* @param ev an enum value
*/
- public virtual void visit_enum_value (EnumValue! ev) {
+ public virtual void visit_enum_value (EnumValue ev) {
}
/**
*
* @param d a delegate
*/
- public virtual void visit_delegate (Delegate! d) {
+ public virtual void visit_delegate (Delegate d) {
}
/**
*
* @param m a member
*/
- public virtual void visit_member (Member! m) {
+ public virtual void visit_member (Member m) {
}
/**
*
* @param c a constant
*/
- public virtual void visit_constant (Constant! c) {
+ public virtual void visit_constant (Constant c) {
}
/**
*
* @param f a field
*/
- public virtual void visit_field (Field! f) {
+ public virtual void visit_field (Field f) {
}
/**
*
* @param m a method
*/
- public virtual void visit_method (Method! m) {
+ public virtual void visit_method (Method m) {
}
/**
*
* @param m a method
*/
- public virtual void visit_creation_method (CreationMethod! m) {
+ public virtual void visit_creation_method (CreationMethod m) {
}
/**
*
* @param p a formal parameter
*/
- public virtual void visit_formal_parameter (FormalParameter! p) {
+ public virtual void visit_formal_parameter (FormalParameter p) {
}
/**
*
* @param prop a property
*/
- public virtual void visit_property (Property! prop) {
+ public virtual void visit_property (Property prop) {
}
/**
*
* @param acc a property accessor
*/
- public virtual void visit_property_accessor (PropertyAccessor! acc) {
+ public virtual void visit_property_accessor (PropertyAccessor acc) {
}
/**
*
* @param sig a signal
*/
- public virtual void visit_signal (Signal! sig) {
+ public virtual void visit_signal (Signal sig) {
}
/**
*
* @param c a constructor
*/
- public virtual void visit_constructor (Constructor! c) {
+ public virtual void visit_constructor (Constructor c) {
}
/**
*
* @param d a destructor
*/
- public virtual void visit_destructor (Destructor! d) {
+ public virtual void visit_destructor (Destructor d) {
}
/**
*
* @param n a named argument
*/
- public virtual void visit_named_argument (NamedArgument! n) {
+ public virtual void visit_named_argument (NamedArgument n) {
}
/**
*
* @param p a type parameter
*/
- public virtual void visit_type_parameter (TypeParameter! p) {
+ public virtual void visit_type_parameter (TypeParameter p) {
}
/**
*
* @param ns a namespace reference
*/
- public virtual void visit_namespace_reference (NamespaceReference! ns) {
+ public virtual void visit_namespace_reference (NamespaceReference ns) {
}
/**
*
* @param type a type reference
*/
- public virtual void visit_data_type (DataType! type) {
+ public virtual void visit_data_type (DataType type) {
}
/**
*
* @param b a block
*/
- public virtual void visit_block (Block! b) {
+ public virtual void visit_block (Block b) {
}
/**
*
* @param stmt an empty statement
*/
- public virtual void visit_empty_statement (EmptyStatement! stmt) {
+ public virtual void visit_empty_statement (EmptyStatement stmt) {
}
/**
*
* @param stmt a declaration statement
*/
- public virtual void visit_declaration_statement (DeclarationStatement! stmt) {
+ public virtual void visit_declaration_statement (DeclarationStatement stmt) {
}
/**
*
* @param decl a local variable declaration
*/
- public virtual void visit_local_variable_declaration (LocalVariableDeclaration! decl) {
+ public virtual void visit_local_variable_declaration (LocalVariableDeclaration decl) {
}
/**
*
* @param decl a variable declarator
*/
- public virtual void visit_variable_declarator (VariableDeclarator! decl) {
+ public virtual void visit_variable_declarator (VariableDeclarator decl) {
}
/**
*
* @param list an initializer list
*/
- public virtual void visit_initializer_list (InitializerList! list) {
+ public virtual void visit_initializer_list (InitializerList list) {
}
/**
*
* @param stmt an expression statement
*/
- public virtual void visit_expression_statement (ExpressionStatement! stmt) {
+ public virtual void visit_expression_statement (ExpressionStatement stmt) {
}
/**
*
* @param stmt an if statement
*/
- public virtual void visit_if_statement (IfStatement! stmt) {
+ public virtual void visit_if_statement (IfStatement stmt) {
}
/**
*
* @param stmt a switch statement
*/
- public virtual void visit_switch_statement (SwitchStatement! stmt) {
+ public virtual void visit_switch_statement (SwitchStatement stmt) {
}
/**
*
* @param section a switch section
*/
- public virtual void visit_switch_section (SwitchSection! section) {
+ public virtual void visit_switch_section (SwitchSection section) {
}
/**
*
* @param label a switch label
*/
- public virtual void visit_switch_label (SwitchLabel! label) {
+ public virtual void visit_switch_label (SwitchLabel label) {
}
/**
*
* @param stmt an while statement
*/
- public virtual void visit_while_statement (WhileStatement! stmt) {
+ public virtual void visit_while_statement (WhileStatement stmt) {
}
/**
*
* @param stmt a do statement
*/
- public virtual void visit_do_statement (DoStatement! stmt) {
+ public virtual void visit_do_statement (DoStatement stmt) {
}
/**
*
* @param stmt a for statement
*/
- public virtual void visit_for_statement (ForStatement! stmt) {
+ public virtual void visit_for_statement (ForStatement stmt) {
}
/**
*
* @param stmt a foreach statement
*/
- public virtual void visit_foreach_statement (ForeachStatement! stmt) {
+ public virtual void visit_foreach_statement (ForeachStatement stmt) {
}
/**
*
* @param stmt a break statement
*/
- public virtual void visit_break_statement (BreakStatement! stmt) {
+ public virtual void visit_break_statement (BreakStatement stmt) {
}
/**
*
* @param stmt a continue statement
*/
- public virtual void visit_continue_statement (ContinueStatement! stmt) {
+ public virtual void visit_continue_statement (ContinueStatement stmt) {
}
/**
*
* @param stmt a return statement
*/
- public virtual void visit_return_statement (ReturnStatement! stmt) {
+ public virtual void visit_return_statement (ReturnStatement stmt) {
}
/**
*
* @param stmt a throw statement
*/
- public virtual void visit_throw_statement (ThrowStatement! stmt) {
+ public virtual void visit_throw_statement (ThrowStatement stmt) {
}
/**
*
* @param stmt a try statement
*/
- public virtual void visit_try_statement (TryStatement! stmt) {
+ public virtual void visit_try_statement (TryStatement stmt) {
}
/**
*
* @param clause a catch cluase
*/
- public virtual void visit_catch_clause (CatchClause! clause) {
+ public virtual void visit_catch_clause (CatchClause clause) {
}
/**
*
* @param stmt a lock statement
*/
- public virtual void visit_lock_statement (LockStatement! stmt) {
+ public virtual void visit_lock_statement (LockStatement stmt) {
}
/**
*
* @param expr an array creation expression
*/
- public virtual void visit_array_creation_expression (ArrayCreationExpression! expr) {
+ public virtual void visit_array_creation_expression (ArrayCreationExpression expr) {
}
/**
*
* @param lit a boolean literal
*/
- public virtual void visit_boolean_literal (BooleanLiteral! lit) {
+ public virtual void visit_boolean_literal (BooleanLiteral lit) {
}
/**
*
* @param lit a character literal
*/
- public virtual void visit_character_literal (CharacterLiteral! lit) {
+ public virtual void visit_character_literal (CharacterLiteral lit) {
}
/**
*
* @param lit an integer literal
*/
- public virtual void visit_integer_literal (IntegerLiteral! lit) {
+ public virtual void visit_integer_literal (IntegerLiteral lit) {
}
/**
*
* @param lit a real literal
*/
- public virtual void visit_real_literal (RealLiteral! lit) {
+ public virtual void visit_real_literal (RealLiteral lit) {
}
/**
*
* @param lit a string literal
*/
- public virtual void visit_string_literal (StringLiteral! lit) {
+ public virtual void visit_string_literal (StringLiteral lit) {
}
/**
*
* @param lit a null literal
*/
- public virtual void visit_null_literal (NullLiteral! lit) {
+ public virtual void visit_null_literal (NullLiteral lit) {
}
/**
*
* @param expr a parenthesized expression
*/
- public virtual void visit_parenthesized_expression (ParenthesizedExpression! expr) {
+ public virtual void visit_parenthesized_expression (ParenthesizedExpression expr) {
}
/**
*
* @param expr a member access expression
*/
- public virtual void visit_member_access (MemberAccess! expr) {
+ public virtual void visit_member_access (MemberAccess expr) {
}
/**
*
* @param expr an invocation expression
*/
- public virtual void visit_invocation_expression (InvocationExpression! expr) {
+ public virtual void visit_invocation_expression (InvocationExpression expr) {
}
/**
*
* @param expr an element access expression
*/
- public virtual void visit_element_access (ElementAccess! expr) {
+ public virtual void visit_element_access (ElementAccess expr) {
}
/**
*
* @param expr a base access expression
*/
- public virtual void visit_base_access (BaseAccess! expr) {
+ public virtual void visit_base_access (BaseAccess expr) {
}
/**
*
* @param expr a postfix expression
*/
- public virtual void visit_postfix_expression (PostfixExpression! expr) {
+ public virtual void visit_postfix_expression (PostfixExpression expr) {
}
/**
*
* @param expr an object creation expression
*/
- public virtual void visit_object_creation_expression (ObjectCreationExpression! expr) {
+ public virtual void visit_object_creation_expression (ObjectCreationExpression expr) {
}
/**
*
* @param expr a sizeof expression
*/
- public virtual void visit_sizeof_expression (SizeofExpression! expr) {
+ public virtual void visit_sizeof_expression (SizeofExpression expr) {
}
/**
*
* @param expr a typeof expression
*/
- public virtual void visit_typeof_expression (TypeofExpression! expr) {
+ public virtual void visit_typeof_expression (TypeofExpression expr) {
}
/**
*
* @param expr an unary expression
*/
- public virtual void visit_unary_expression (UnaryExpression! expr) {
+ public virtual void visit_unary_expression (UnaryExpression expr) {
}
/**
*
* @param expr a call expression
*/
- public virtual void visit_cast_expression (CastExpression! expr) {
+ public virtual void visit_cast_expression (CastExpression expr) {
}
/**
*
* @param expr a pointer indirection
*/
- public virtual void visit_pointer_indirection (PointerIndirection! expr) {
+ public virtual void visit_pointer_indirection (PointerIndirection expr) {
}
/**
*
* @param expr an address-of expression
*/
- public virtual void visit_addressof_expression (AddressofExpression! expr) {
+ public virtual void visit_addressof_expression (AddressofExpression expr) {
}
/**
*
* @param expr a reference transfer expression
*/
- public virtual void visit_reference_transfer_expression (ReferenceTransferExpression! expr) {
+ public virtual void visit_reference_transfer_expression (ReferenceTransferExpression expr) {
}
/**
*
* @param expr a binary expression
*/
- public virtual void visit_binary_expression (BinaryExpression! expr) {
+ public virtual void visit_binary_expression (BinaryExpression expr) {
}
/**
*
* @param expr a type check expression
*/
- public virtual void visit_type_check (TypeCheck! expr) {
+ public virtual void visit_type_check (TypeCheck expr) {
}
/**
*
* @param expr a conditional expression
*/
- public virtual void visit_conditional_expression (ConditionalExpression! expr) {
+ public virtual void visit_conditional_expression (ConditionalExpression expr) {
}
/**
*
* @param expr a lambda expression
*/
- public virtual void visit_lambda_expression (LambdaExpression! expr) {
+ public virtual void visit_lambda_expression (LambdaExpression expr) {
}
/**
*
* @param a an assignment
*/
- public virtual void visit_assignment (Assignment! a) {
+ public virtual void visit_assignment (Assignment a) {
}
/**
*
* @param expr a full expression
*/
- public virtual void visit_end_full_expression (Expression! expr) {
+ public virtual void visit_end_full_expression (Expression expr) {
}
}
/**
* The condition.
*/
- public Expression! condition { get; set construct; }
+ public Expression condition { get; set construct; }
/**
* The expression to be evaluated if the condition holds.
*/
- public Expression! true_expression { get; set construct; }
+ public Expression true_expression { get; set construct; }
/**
* The expression to be evaluated if the condition doesn't hold.
*/
- public Expression! false_expression { get; set construct; }
+ public Expression false_expression { get; set construct; }
/**
* Creates a new conditional expression.
* @param false_expr expression to be evaluated if condition is false
* @return newly created conditional expression
*/
- public ConditionalExpression (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;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
condition.accept (visitor);
true_expression.accept (visitor);
false_expression.accept (visitor);
/**
* The data type of this constant.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
* @param source_reference reference to source code
* @return newly created constant
*/
- public Constant (construct string! name, construct DataType! type_reference, construct Expression initializer, construct SourceReference source_reference) {
+ public Constant (construct string name, construct DataType type_reference, construct Expression initializer, construct SourceReference source_reference) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_member (this);
visitor.visit_constant (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
type_reference.accept (visitor);
if (initializer != null) {
*
* @return the name to be used in C code
*/
- public string! get_cname () {
+ public string get_cname () {
if (cname == null) {
if (parent_symbol == null) {
// global constant
lock_used = used;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
}
- private void process_ccode_attribute (Attribute! a) {
+ private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("cname")) {
cname = a.get_string ("cname");
}
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_constructor (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (body != null) {
body.accept (visitor);
}
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_continue_statement (this);
}
}
return_type = new VoidType ();
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_creation_method (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (FormalParameter param in get_parameters()) {
param.accept (visitor);
}
}
}
- public override string! get_default_cname () {
+ public override string get_default_cname () {
var parent = parent_symbol as Typesymbol;
string infix = "new";
*
* @param arg a type reference
*/
- public void add_type_argument (DataType! arg) {
+ public void add_type_argument (DataType arg) {
type_argument_list.add (arg);
arg.parent_node = this;
}
type_argument_list.clear ();
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
if (type_argument_list.size > 0) {
foreach (DataType type_arg in type_argument_list) {
type_arg.accept (visitor);
return data_type.get_lower_case_cname (infix);
}
- public override string! to_string () {
+ public override string to_string () {
string s;
if (data_type != null) {
* @return true if this type reference is equal to type2, false
* otherwise
*/
- public virtual bool equals (DataType! type2) {
+ public virtual bool equals (DataType type2) {
if (type2.transfers_ownership != transfers_ownership) {
return false;
}
* @param type2 a type reference
* @return true if this type reference is stricter or equal
*/
- public virtual bool stricter (DataType! type2) {
+ public virtual bool stricter (DataType type2) {
if (type2.transfers_ownership != transfers_ownership) {
return false;
}
return true;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
for (int i = 0; i < type_argument_list.size; i++) {
if (type_argument_list[i] == old_type) {
type_argument_list[i] = new_type;
}
}
- public virtual bool compatible (DataType! target_type, bool enable_non_null = true) {
+ public virtual bool compatible (DataType target_type, bool enable_non_null = true) {
if (target_type is DelegateType && this is DelegateType) {
return ((DelegateType) target_type).delegate_symbol == ((DelegateType) this).delegate_symbol;
}
/**
* The local variable declaration.
*/
- public LocalVariableDeclaration! declaration { get; set construct; }
+ public LocalVariableDeclaration declaration { get; set construct; }
/**
* Creates a new declaration statement.
* @param source reference to source code
* @return newly created declaration statement
*/
- public DeclarationStatement (LocalVariableDeclaration! decl, SourceReference source) {
+ public DeclarationStatement (LocalVariableDeclaration decl, SourceReference source) {
declaration = decl;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
declaration.accept (visitor);
visitor.visit_declaration_statement (this);
*
* @param p a type parameter
*/
- public void add_type_parameter (TypeParameter! p) {
+ public void add_type_parameter (TypeParameter p) {
type_parameters.add (p);
p.type = this;
scope.add (p.name, p);
*
* @param param a formal parameter
*/
- public void add_parameter (FormalParameter! param) {
+ public void add_parameter (FormalParameter param) {
if (no_array_length) {
param.no_array_length = true;
}
* @param m a method
* @return true if the specified method is compatible to this callback
*/
- public bool matches_method (Method! m) {
+ public bool matches_method (Method m) {
// method is allowed to ensure stricter return type (stronger postcondition)
if (!m.return_type.stricter (return_type)) {
return false;
return true;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_delegate (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (TypeParameter p in type_parameters) {
p.accept (visitor);
}
return_type.accept (visitor);
- foreach (FormalParameter! param in parameters) {
+ foreach (FormalParameter param in parameters) {
param.accept (visitor);
}
}
return "g_value_set_pointer";
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (return_type == old_type) {
return_type = new_type;
}
return delegate_symbol.get_parameters ();
}
- public override string! to_string () {
+ public override string to_string () {
return delegate_symbol.get_full_name ();
}
- public override DataType! copy () {
+ public override DataType copy () {
return new DelegateType (delegate_symbol);
}
this.source_reference = source_reference;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_delete_statement (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
expression.accept (visitor);
}
}
public Destructor (construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_destructor (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (body != null) {
body.accept (visitor);
}
/**
* Specifies the loop condition.
*/
- public Expression! condition {
+ public Expression condition {
get {
return _condition;
}
}
}
- private Expression! _condition;
+ private Expression _condition;
private Block _body;
/**
* @param source reference to source code
* @return newly created do statement
*/
- public DoStatement (construct Block! body, construct Expression! condition, construct SourceReference source_reference = null) {
+ public DoStatement (construct Block body, construct Expression condition, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_do_statement (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
body.accept (visitor);
condition.accept (visitor);
visitor.visit_end_full_expression (condition);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (condition == old_node) {
condition = new_node;
}
/**
* Expression representing the container on wich we want to access.
*/
- public Expression! container { get; set; }
+ public Expression container { get; set; }
/**
* Expressions representing the indices we want to access inside the container.
*/
- private Gee.List<Expression>! indices = new ArrayList<Expression> ();
+ private Gee.List<Expression> indices = new ArrayList<Expression> ();
- public void append_index (Expression! index) {
+ public void append_index (Expression index) {
indices.add (index);
index.parent_node = this;
}
public ElementAccess (construct Expression container, construct SourceReference source_reference) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
container.accept (visitor);
foreach (Expression e in indices) {
e.accept (visitor);
visitor.visit_element_access (this);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (container == old_node) {
container = new_node;
}
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_empty_statement (this);
}
}
* @param source_reference reference to source code
* @return newly created enum
*/
- public Enum (construct string! name, construct SourceReference source_reference = null) {
+ public Enum (construct string name, construct SourceReference source_reference = null) {
}
/**
*
* @param value an enum value
*/
- public void add_value (EnumValue! value) {
+ public void add_value (EnumValue value) {
values.add (value);
scope.add (value.name, value);
}
*
* @param m a method
*/
- public void add_method (Method! m) {
+ public void add_method (Method m) {
if (m is CreationMethod) {
Report.error (m.source_reference, "construction methods may only be declared within classes and structs");
return new ReadOnlyCollection<Method> (methods);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_enum (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (EnumValue value in values) {
value.accept (visitor);
}
return cname;
}
- public override string! get_lower_case_cprefix () {
+ public override string get_lower_case_cprefix () {
if (lower_case_cprefix == null) {
lower_case_cprefix = "%s_".printf (get_lower_case_cname (null));
}
return false;
}
- private void set_cname (string! cname) {
+ private void set_cname (string cname) {
this.cname = cname;
}
*
* @return the prefix to be used in C code
*/
- public string! get_cprefix () {
+ public string get_cprefix () {
if (cprefix == null) {
cprefix = "%s_".printf (get_upper_case_cname ());
}
*
* @param cprefix the prefix to be used in C code
*/
- public void set_cprefix (string! cprefix) {
+ public void set_cprefix (string cprefix) {
this.cprefix = cprefix;
}
- private void process_ccode_attribute (Attribute! a) {
+ private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("cname")) {
set_cname (a.get_string ("cname"));
}
}
}
- public void set_type_id (string! type_id) {
+ public void set_type_id (string type_id) {
this.type_id = type_id;
}
* @param name enum value name
* @return newly created enum value
*/
- public EnumValue (construct string! name, SourceReference source_reference = null) {
+ public EnumValue (construct string name, SourceReference source_reference = null) {
this.source_reference = source_reference;
}
* @param value numerical representation
* @return newly created enum value
*/
- public EnumValue.with_value (construct string! name, construct Expression value, SourceReference source_reference = null) {
+ public EnumValue.with_value (construct string name, construct Expression value, SourceReference source_reference = null) {
this.source_reference = source_reference;
}
*
* @return string literal to be used in C code
*/
- public CCodeConstant! get_canonical_cconstant () {
- var str = new String ("\"");
+ public CCodeConstant get_canonical_cconstant () {
+ var str = new StringBuilder ("\"");
string i = name;
return new CCodeConstant (str.str);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_enum_value (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (value != null) {
value.accept (visitor);
}
*
* @return the name to be used in C code
*/
- public string! get_cname () {
+ public string get_cname () {
if (cname == null) {
var en = (Enum) parent_symbol;
cname = "%s%s".printf (en.get_cprefix (), name);
* @param name enum value name
* @return newly created enum value
*/
- public ErrorCode (construct string! name) {
+ public ErrorCode (construct string name) {
}
/**
* @param value numerical representation
* @return newly created enum value
*/
- public ErrorCode.with_value (construct string! name, construct Expression value) {
+ public ErrorCode.with_value (construct string name, construct Expression value) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_error_code (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (value != null) {
value.accept (visitor);
}
*
* @return the name to be used in C code
*/
- public string! get_cname () {
+ public string get_cname () {
if (cname == null) {
var edomain = (ErrorDomain) parent_symbol;
cname = "%s%s".printf (edomain.get_cprefix (), name);
* @param source_reference reference to source code
* @return newly created error domain
*/
- public ErrorDomain (construct string! name, construct SourceReference source_reference = null) {
+ public ErrorDomain (construct string name, construct SourceReference source_reference = null) {
}
/**
*
* @param m a method
*/
- public void add_method (Method! m) {
+ public void add_method (Method m) {
if (m is CreationMethod) {
Report.error (m.source_reference, "construction methods may only be declared within classes and structs");
return new ReadOnlyCollection<Method> (methods);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_error_domain (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (ErrorCode ecode in codes) {
ecode.accept (visitor);
}
return cname;
}
- public override string! get_lower_case_cprefix () {
+ public override string get_lower_case_cprefix () {
if (lower_case_cprefix == null) {
lower_case_cprefix = "%s_".printf (get_lower_case_cname (null));
}
return false;
}
- private void set_cname (string! cname) {
+ private void set_cname (string cname) {
this.cname = cname;
}
*
* @return the prefix to be used in C code
*/
- public string! get_cprefix () {
+ public string get_cprefix () {
if (cprefix == null) {
cprefix = "%s_".printf (get_upper_case_cname (null));
}
*
* @param cprefix the prefix to be used in C code
*/
- public void set_cprefix (string! cprefix) {
+ public void set_cprefix (string cprefix) {
this.cprefix = cprefix;
}
- private void process_ccode_attribute (Attribute! a) {
+ private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("cname")) {
set_cname (a.get_string ("cname"));
}
this.source_reference = source_reference;
}
- public override bool compatible (DataType! target_type, bool enable_non_null = true) {
+ public override bool compatible (DataType target_type, bool enable_non_null = true) {
/* temporarily ignore type parameters */
if (target_type.type_parameter != null) {
return true;
}
}
- public override bool equals (DataType! type2) {
+ public override bool equals (DataType type2) {
var et = type2 as ErrorType;
if (et == null) {
/**
* Specifies the expression to evaluate.
*/
- public Expression! expression {
+ public Expression expression {
get {
return _expression;
}
}
}
- private Expression! _expression;
+ private Expression _expression;
/**
* Creates a new expression statement.
* @param source reference to source code
* @return newly created expression statement
*/
- public ExpressionStatement (construct Expression! expression, construct SourceReference source_reference = null) {
+ public ExpressionStatement (construct Expression expression, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
expression.accept (visitor);
visitor.visit_expression_statement (this);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (expression == old_node) {
expression = new_node;
}
/**
* The data type of this field.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
* @param source reference to source code
* @return newly created field
*/
- public Field (construct string! name, construct DataType! type_reference, construct Expression initializer, construct SourceReference source_reference = null) {
+ public Field (construct string name, construct DataType type_reference, construct Expression initializer, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_member (this);
visitor.visit_field (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
type_reference.accept (visitor);
if (initializer != null) {
*
* @return the name to be used in C code
*/
- public string! get_cname () {
+ public string get_cname () {
if (cname == null) {
cname = get_default_cname ();
}
*
* @param cname the name to be used in C code
*/
- public void set_cname (string! cname) {
+ public void set_cname (string cname) {
this.cname = cname;
}
*
* @return the name to be used in C code by default
*/
- public string! get_default_cname () {
+ public string get_default_cname () {
if (!instance) {
return parent_symbol.get_lower_case_cprefix () + name;
} else {
}
}
- private void process_ccode_attribute (Attribute! a) {
+ private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("cname")) {
set_cname (a.get_string ("cname"));
}
lock_used = used;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
/**
* Specifies the element type.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
/**
* Specifies the element variable name.
*/
- public string! variable_name { get; set construct; }
+ public string variable_name { get; set construct; }
/**
* Specifies the container.
*/
- public Expression! collection {
+ public Expression collection {
get {
return _collection;
}
*/
public VariableDeclarator iterator_variable_declarator { get; set; }
- private Expression! _collection;
+ private Expression _collection;
private Block _body;
private DataType _data_type;
* @param source reference to source code
* @return newly created foreach statement
*/
- public ForeachStatement (construct DataType! type_reference, construct string! variable_name, construct Expression! collection, construct Block body, construct SourceReference source_reference) {
+ public ForeachStatement (construct DataType type_reference, construct string variable_name, construct Expression collection, construct Block body, construct SourceReference source_reference) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_foreach_statement (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
type_reference.accept (visitor);
collection.accept (visitor);
body.accept (visitor);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (collection == old_node) {
collection = new_node;
}
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
* @param source reference to source code
* @return newly created formal parameter
*/
- public FormalParameter (string! _name, DataType type, SourceReference source = null) {
+ public FormalParameter (string _name, DataType type, SourceReference source = null) {
name = _name;
type_reference = type;
source_reference = source;
access = SymbolAccessibility.PUBLIC;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_formal_parameter (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (!ellipsis) {
type_reference.accept (visitor);
}
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
private Gee.List<Expression> initializer = new ArrayList<Expression> ();
private Gee.List<Expression> iterator = new ArrayList<Expression> ();
- private Expression! _condition;
+ private Expression _condition;
private Block _body;
/**
*
* @param init an initializer expression
*/
- public void add_initializer (Expression! init) {
+ public void add_initializer (Expression init) {
init.parent_node = this;
initializer.add (init);
}
*
* @param iter an iterator expression
*/
- public void add_iterator (Expression! iter) {
+ public void add_iterator (Expression iter) {
iter.parent_node = this;
iterator.add (iter);
}
return new ReadOnlyCollection<Expression> (iterator);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_for_statement (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (Expression init_expr in initializer) {
init_expr.accept (visitor);
visitor.visit_end_full_expression (init_expr);
body.accept (visitor);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (condition == old_node) {
condition = new_node;
return;
/**
* The boolean condition to evaluate.
*/
- public Expression! condition {
+ public Expression condition {
get {
return _condition;
}
/**
* The statement to be evaluated if the condition holds.
*/
- public Block! true_statement { get; set construct; }
+ public Block true_statement { get; set construct; }
/**
* The optional statement to be evaluated if the condition doesn't hold.
*/
public Block false_statement { get; set construct; }
- private Expression! _condition;
+ private Expression _condition;
/**
* Creates a new if statement.
* @param false_stmt statement to be evaluated if condition is false
* @return newly created if statement
*/
- public IfStatement (Expression! cond, Block! true_stmt, Block false_stmt, SourceReference source) {
+ public IfStatement (Expression cond, Block true_stmt, Block false_stmt, SourceReference source) {
condition = cond;
true_statement = true_stmt;
false_statement = false_stmt;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_if_statement (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
condition.accept (visitor);
visitor.visit_end_full_expression (condition);
}
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (condition == old_node) {
condition = new_node;
}
*
* @param expr an expression
*/
- public void append (Expression! expr) {
+ public void append (Expression expr) {
initializers.add (expr);
}
public InitializerList (construct SourceReference source_reference) {
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (Expression expr in initializers) {
expr.accept (visitor);
}
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_initializer_list (this);
}
/**
* The target type.
*/
- public weak Typesymbol! type_reference { get; set construct; }
+ public weak Typesymbol type_reference { get; set construct; }
/**
* The expression to be cast.
*/
- public CCodeExpression! inner { get; set construct; }
+ public CCodeExpression inner { get; set construct; }
/**
* Creates a new instance cast expression.
* @param type the target type
* @return newly created instance cast expression
*/
- public InstanceCast (CCodeExpression! expr, Typesymbol! type) {
+ public InstanceCast (CCodeExpression expr, Typesymbol type) {
inner = expr;
type_reference = type;
}
/**
* The literal value.
*/
- public string! value { get; set; }
+ public string value { get; set; }
/**
* Creates a new integer literal.
* @param source reference to source code
* @return newly created integer literal
*/
- public IntegerLiteral (string! i, SourceReference source = null) {
+ public IntegerLiteral (string i, SourceReference source = null) {
value = i;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_integer_literal (this);
}
- public override string! to_string () {
+ public override string to_string () {
return value;
}
*
* @return the name of literal type
*/
- public string! get_type_name () {
+ public string get_type_name () {
string number = value;
int l = 0;
public class Vala.IntegerType : ValueType {
public IntegerLiteral literal { get; set; }
- public IntegerType (construct Typesymbol! type_symbol) {
+ public IntegerType (construct Typesymbol type_symbol) {
data_type = type_symbol;
}
- public override DataType! copy () {
+ public override DataType copy () {
var type = new IntegerType (type_symbol);
type.literal = literal;
return type;
}
- public override bool compatible (DataType! target_type, bool enable_non_null = true) {
+ public override bool compatible (DataType target_type, bool enable_non_null = true) {
if (target_type.data_type is Struct && literal.get_type_name () == "int") {
// int literals are implicitly convertible to integer types
// of a lower rank if the value of the literal is within
* @param source reference to source code
* @return newly created interface
*/
- public Interface (construct string! name, construct SourceReference source_reference = null) {
+ public Interface (construct string name, construct SourceReference source_reference = null) {
}
/**
*
* @param p a type parameter
*/
- public void add_type_parameter (TypeParameter! p) {
+ public void add_type_parameter (TypeParameter p) {
type_parameters.add (p);
p.type = this;
scope.add (p.name, p);
*
* @param type an interface or class reference
*/
- public void add_prerequisite (DataType! type) {
+ public void add_prerequisite (DataType type) {
prerequisites.add (type);
type.parent_node = this;
}
*
* @param type an interface or class reference
*/
- public void prepend_prerequisite (DataType! type) {
+ public void prepend_prerequisite (DataType type) {
prerequisites.insert (0, type);
}
*
* @param m a method
*/
- public void add_method (Method! m) {
+ public void add_method (Method m) {
if (m is CreationMethod) {
Report.error (m.source_reference, "construction methods may only be declared within classes and structs");
*
* @param f a field
*/
- public void add_field (Field! f) {
+ public void add_field (Field f) {
fields.add (f);
scope.add (f.name, f);
}
*
* @param prop a property
*/
- public void add_property (Property! prop) {
+ public void add_property (Property prop) {
properties.add (prop);
scope.add (prop.name, prop);
}
*
* @param sig a signal
*/
- public void add_signal (Signal! sig) {
+ public void add_signal (Signal sig) {
signals.add (sig);
scope.add (sig.name, sig);
}
*
* @param cl a class
*/
- public void add_class (Class! cl) {
+ public void add_class (Class cl) {
classes.add (cl);
scope.add (cl.name, cl);
}
*
* @param st a struct
*/
- public void add_struct (Struct! st) {
+ public void add_struct (Struct st) {
structs.add (st);
scope.add (st.name, st);
}
*
* @param d a delegate
*/
- public void add_delegate (Delegate! d) {
+ public void add_delegate (Delegate d) {
delegates.add (d);
scope.add (d.name, d);
}
*
* @return the suffix to be used in C code
*/
- public string! get_lower_case_csuffix () {
+ public string get_lower_case_csuffix () {
if (lower_case_csuffix == null) {
lower_case_csuffix = get_default_lower_case_csuffix ();
}
*
* @return the suffix to be used in C code
*/
- public string! get_default_lower_case_csuffix () {
+ public string get_default_lower_case_csuffix () {
string result = camel_case_to_lower_case (name);
// remove underscores in some cases to avoid conflicts of type macros
*
* @param csuffix the suffix to be used in C code
*/
- public void set_lower_case_csuffix (string! csuffix) {
+ public void set_lower_case_csuffix (string csuffix) {
this.lower_case_csuffix = csuffix;
}
return "%s%s%s".printf (parent_symbol.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
}
- public override string! get_lower_case_cprefix () {
+ public override string get_lower_case_cprefix () {
return "%s_".printf (get_lower_case_cname (null));
}
return get_lower_case_cname (infix).up ();
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_interface (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (DataType type in prerequisites) {
type.accept (visitor);
}
return "g_object_unref";
}
- public override bool is_subtype_of (Typesymbol! t) {
+ public override bool is_subtype_of (Typesymbol t) {
if (this == t) {
return true;
}
return false;
}
- private void process_ccode_attribute (Attribute! a) {
+ private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("type_cname")) {
set_type_cname (a.get_string ("type_cname"));
}
}
}
- private void process_dbus_interface_attribute (Attribute! a) {
+ private void process_dbus_interface_attribute (Attribute a) {
if (declaration_only) {
cname = "DBusGProxy";
}
*
* @param type_cname the type struct name to be used in C code
*/
- public void set_type_cname (string! type_cname) {
+ public void set_type_cname (string type_cname) {
this.type_cname = type_cname;
}
return type_id;
}
- public override int get_type_parameter_index (string! name) {
+ public override int get_type_parameter_index (string name) {
int i = 0;
foreach (TypeParameter parameter in type_parameters) {
if (parameter.name == name) {
return -1;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
for (int i = 0; i < prerequisites.size; i++) {
if (prerequisites[i] == old_type) {
prerequisites[i] = new_type;
*/
public weak Interface interface_symbol { get; set; }
- public InterfaceType (construct Interface! interface_symbol) {
+ public InterfaceType (construct Interface interface_symbol) {
data_type = interface_symbol;
}
* @param context a code context
* @param filename a relative or absolute filename
*/
- public void write_file (CodeContext! context, string! filename) {
+ public void write_file (CodeContext context, string filename) {
this.context = context;
stream = FileStream.open (filename, "w");
stream = null;
}
- public override void visit_namespace (Namespace! ns) {
+ public override void visit_namespace (Namespace ns) {
if (ns.pkg) {
return;
}
write_newline ();
}
- public override void visit_class (Class! cl) {
+ public override void visit_class (Class cl) {
if (cl.source_reference != null && cl.source_reference.file.pkg) {
return;
}
write_newline ();
}
- public override void visit_struct (Struct! st) {
+ public override void visit_struct (Struct st) {
if (st.source_reference != null && st.source_reference.file.pkg) {
return;
}
write_newline ();
}
- public override void visit_interface (Interface! iface) {
+ public override void visit_interface (Interface iface) {
if (iface.source_reference != null && iface.source_reference.file.pkg) {
return;
}
write_newline ();
}
- public override void visit_enum (Enum! en) {
+ public override void visit_enum (Enum en) {
if (en.source_reference != null && en.source_reference.file.pkg) {
return;
}
write_newline ();
}
- public override void visit_constant (Constant! c) {
+ public override void visit_constant (Constant c) {
if (c.source_reference != null && c.source_reference.file.pkg) {
return;
}
write_newline ();
}
- public override void visit_field (Field! f) {
+ public override void visit_field (Field f) {
if (f.source_reference != null && f.source_reference.file.pkg) {
return;
}
}
- var ccode_params = new String ();
+ var ccode_params = new StringBuilder ();
var separator = "";
if (!float_equal (param.carray_length_parameter_position, i + 0.1)) {
write_string (")");
}
- public override void visit_delegate (Delegate! cb) {
+ public override void visit_delegate (Delegate cb) {
if (cb.source_reference != null && cb.source_reference.file.pkg) {
return;
}
write_newline ();
}
- public override void visit_method (Method! m) {
+ public override void visit_method (Method m) {
if (m.source_reference != null && m.source_reference.file.pkg) {
return;
}
}
}
- var ccode_params = new String ();
+ var ccode_params = new StringBuilder ();
var separator = "";
if (m.get_cname () != m.get_default_cname ()) {
write_newline ();
}
- public override void visit_creation_method (CreationMethod! m) {
+ public override void visit_creation_method (CreationMethod m) {
visit_method (m);
}
- public override void visit_property (Property! prop) {
+ public override void visit_property (Property prop) {
if (!check_accessibility (prop) || prop.overrides || prop.base_interface_property != null) {
return;
}
write_newline ();
}
- public override void visit_signal (Signal! sig) {
+ public override void visit_signal (Signal sig) {
if (!check_accessibility (sig)) {
return;
}
bol = false;
}
- private void write_identifier (string! s) {
+ private void write_identifier (string s) {
if (s == "base" || s == "break" || s == "class" ||
s == "construct" || s == "delegate" || s == "delete" ||
s == "do" || s == "foreach" || s == "in" ||
write_string (s);
}
- private void write_return_type (DataType! type) {
+ private void write_return_type (DataType type) {
if (type.is_reference_type_or_type_parameter ()) {
if (!type.transfers_ownership) {
write_string ("weak ");
write_type (type);
}
- private void write_type (DataType! type) {
+ private void write_type (DataType type) {
write_string (type.to_string ());
}
- private void write_string (string! s) {
+ private void write_string (string s) {
stream.printf ("%s", s);
bol = false;
}
stream.printf ("}");
}
- private bool check_accessibility (Symbol! sym) {
+ private bool check_accessibility (Symbol sym) {
if (sym.access == SymbolAccessibility.PUBLIC ||
sym.access == SymbolAccessibility.PROTECTED) {
return true;
return false;
}
- private void write_accessibility (Symbol! sym) {
+ private void write_accessibility (Symbol sym) {
if (sym.access == SymbolAccessibility.PUBLIC) {
write_string ("public ");
} else if (sym.access == SymbolAccessibility.PROTECTED) {
/**
* The method to call.
*/
- public Expression! call {
+ public Expression call {
get { return _call; }
set construct {
_call = value;
public CCodeExpression delegate_target { get; set; }
- public Expression! _call;
+ public Expression _call;
private Gee.List<Expression> argument_list = new ArrayList<Expression> ();
private Gee.List<CCodeExpression> array_sizes = new ArrayList<CCodeExpression> ();
* @param source_reference reference to source code
* @return newly created invocation expression
*/
- public InvocationExpression (construct Expression! call, construct SourceReference source_reference = null) {
+ public InvocationExpression (construct Expression call, construct SourceReference source_reference = null) {
}
/**
*
* @param arg an argument
*/
- public void add_argument (Expression! arg) {
+ public void add_argument (Expression arg) {
argument_list.add (arg);
arg.parent_node = this;
}
/**
* Add an array size C code expression.
*/
- public void append_array_size (CCodeExpression! size) {
+ public void append_array_size (CCodeExpression size) {
array_sizes.add (size);
}
return new ReadOnlyList<CCodeExpression> (array_sizes);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_invocation_expression (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
call.accept (visitor);
foreach (Expression expr in argument_list) {
}
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (call == old_node) {
call = new_node;
}
* @param source_reference reference to source code
* @return newly created lambda expression
*/
- public LambdaExpression (construct Expression! expression_body, construct SourceReference source_reference) {
+ public LambdaExpression (construct Expression expression_body, construct SourceReference source_reference) {
}
/**
* @param source_reference reference to source code
* @return newly created lambda expression
*/
- public LambdaExpression.with_statement_body (construct Block! statement_body, construct SourceReference source_reference) {
+ public LambdaExpression.with_statement_body (construct Block statement_body, construct SourceReference source_reference) {
}
/**
*
* @param param parameter name
*/
- public void add_parameter (string! param) {
+ public void add_parameter (string param) {
parameters.add (param);
}
return new ReadOnlyCollection<string> (parameters);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_lambda_expression (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (method == null) {
if (expression_body != null) {
expression_body.accept (visitor);
/**
* The type of the local variable.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
*
* @param declarator a variable declarator
*/
- public void add_declarator (VariableDeclarator! declarator) {
+ public void add_declarator (VariableDeclarator declarator) {
variable_declarators.add (declarator);
}
return new ReadOnlyCollection<VariableDeclarator> (variable_declarators);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
if (type_reference != null) {
type_reference.accept (visitor);
}
visitor.visit_local_variable_declaration (this);
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
/**
* Expression representing the resource to be locked.
*/
- public Expression! resource { get; set construct; }
+ public Expression resource { get; set construct; }
/**
* The statement during its execution the resource is locked.
*/
- public Block! body { get; set construct; }
+ public Block body { get; set construct; }
public LockStatement (construct Expression resource, construct Block body, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
resource.accept (visitor);
body.accept (visitor);
visitor.visit_lock_statement (this);
public class Vala.Member : Symbol {
private Gee.List<string> cheader_filenames = new ArrayList<string> ();
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_member (this);
}
*
* @param filename a C header filename
*/
- public void add_cheader_filename (string! filename) {
+ public void add_cheader_filename (string filename) {
cheader_filenames.add (filename);
}
}
/**
* The name of the member.
*/
- public string! member_name { get; set; }
+ public string member_name { get; set; }
/**
* Pointer member access.
* @param source_reference reference to source code
* @return newly created member access expression
*/
- public MemberAccess (construct Expression inner, construct string! member_name, construct SourceReference source_reference = null) {
+ public MemberAccess (construct Expression inner, construct string member_name, construct SourceReference source_reference = null) {
}
- public MemberAccess.simple (construct string! member_name, construct SourceReference source_reference = null) {
+ public MemberAccess.simple (construct string member_name, construct SourceReference source_reference = null) {
}
- public MemberAccess.pointer (construct Expression inner, construct string! member_name, construct SourceReference source_reference = null) {
+ public MemberAccess.pointer (construct Expression inner, construct string member_name, construct SourceReference source_reference = null) {
pointer_member_access = true;
}
*
* @param arg a type reference
*/
- public void add_type_argument (DataType! arg) {
+ public void add_type_argument (DataType arg) {
type_argument_list.add (arg);
arg.parent_node = this;
}
return new ReadOnlyCollection<DataType> (type_argument_list);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
if (inner != null) {
inner.accept (visitor);
}
visitor.visit_member_access (this);
}
- public override string! to_string () {
+ public override string to_string () {
if (inner == null) {
return member_name;
} else {
}
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
}
return (inner == null || inner.is_pure ()) && !(symbol_reference is Property);
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
for (int i = 0; i < type_argument_list.size; i++) {
if (type_argument_list[i] == old_type) {
type_argument_list[i] = new_type;
/**
* Member name.
*/
- public string! name { get; set; }
+ public string name { get; set; }
/**
* Initializer expression.
*/
- public Expression! initializer { get; set; }
+ public Expression initializer { get; set; }
/**
* The symbol this expression refers to.
* @param source_reference reference to source code
* @return newly created member initializer
*/
- public MemberInitializer (construct string! name, construct Expression! initializer, construct SourceReference source_reference = null) {
+ public MemberInitializer (construct string name, construct Expression initializer, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
initializer.accept (visitor);
}
}
*
* @param context a code context
*/
- public void analyze (CodeContext! context) {
+ public void analyze (CodeContext context) {
context.accept (this);
}
- private void visit_possibly_leaked_expression (Expression! expr) {
+ private void visit_possibly_leaked_expression (Expression expr) {
if (expr.static_type != null
&& expr.static_type.transfers_ownership) {
/* mark reference as leaked */
}
}
- private void visit_possibly_missing_copy_expression (Expression! expr) {
+ private void visit_possibly_missing_copy_expression (Expression expr) {
if (expr.static_type != null
&& !expr.static_type.transfers_ownership
&& !(expr.static_type is NullType)) {
}
}
- public override void visit_source_file (SourceFile! source_file) {
+ public override void visit_source_file (SourceFile source_file) {
if (!source_file.pkg) {
source_file.accept_children (this);
}
}
- public override void visit_class (Class! cl) {
+ public override void visit_class (Class cl) {
cl.accept_children (this);
}
- public override void visit_struct (Struct! st) {
+ public override void visit_struct (Struct st) {
st.accept_children (this);
}
- public override void visit_interface (Interface! iface) {
+ public override void visit_interface (Interface iface) {
iface.accept_children (this);
}
- public override void visit_field (Field! f) {
+ public override void visit_field (Field f) {
if (f.initializer != null) {
if (!(f.type_reference is PointerType)) {
if (f.type_reference.takes_ownership) {
}
}
- public override void visit_method (Method! m) {
+ public override void visit_method (Method m) {
var old_symbol = current_symbol;
current_symbol = m;
current_symbol = old_symbol;
}
- public override void visit_creation_method (CreationMethod! m) {
+ public override void visit_creation_method (CreationMethod m) {
visit_method (m);
}
- public override void visit_property (Property! prop) {
+ public override void visit_property (Property prop) {
current_symbol = prop;
prop.accept_children (this);
}
- public override void visit_property_accessor (PropertyAccessor! acc) {
+ public override void visit_property_accessor (PropertyAccessor acc) {
acc.accept_children (this);
}
- public override void visit_constructor (Constructor! c) {
+ public override void visit_constructor (Constructor c) {
c.accept_children (this);
}
- public override void visit_destructor (Destructor! d) {
+ public override void visit_destructor (Destructor d) {
d.accept_children (this);
}
- public override void visit_named_argument (NamedArgument! n) {
+ public override void visit_named_argument (NamedArgument n) {
visit_possibly_leaked_expression (n.argument);
}
- public override void visit_block (Block! b) {
+ public override void visit_block (Block b) {
b.accept_children (this);
}
- public override void visit_variable_declarator (VariableDeclarator! decl) {
+ public override void visit_variable_declarator (VariableDeclarator decl) {
decl.accept_children (this);
if (decl.initializer != null) {
}
}
- public override void visit_initializer_list (InitializerList! list) {
+ public override void visit_initializer_list (InitializerList list) {
list.accept_children (this);
}
- public override void visit_expression_statement (ExpressionStatement! stmt) {
+ public override void visit_expression_statement (ExpressionStatement stmt) {
visit_possibly_leaked_expression (stmt.expression);
}
- public override void visit_if_statement (IfStatement! stmt) {
+ public override void visit_if_statement (IfStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_switch_section (SwitchSection! section) {
+ public override void visit_switch_section (SwitchSection section) {
section.accept_children (this);
}
- public override void visit_while_statement (WhileStatement! stmt) {
+ public override void visit_while_statement (WhileStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_do_statement (DoStatement! stmt) {
+ public override void visit_do_statement (DoStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_for_statement (ForStatement! stmt) {
+ public override void visit_for_statement (ForStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_foreach_statement (ForeachStatement! stmt) {
+ public override void visit_foreach_statement (ForeachStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_return_statement (ReturnStatement! stmt) {
+ public override void visit_return_statement (ReturnStatement stmt) {
stmt.accept_children (this);
if (stmt.return_expression != null) {
}
}
- public override void visit_throw_statement (ThrowStatement! stmt) {
+ public override void visit_throw_statement (ThrowStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_try_statement (TryStatement! stmt) {
+ public override void visit_try_statement (TryStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_catch_clause (CatchClause! clause) {
+ public override void visit_catch_clause (CatchClause clause) {
clause.accept_children (this);
}
- public override void visit_array_creation_expression (ArrayCreationExpression! e) {
+ public override void visit_array_creation_expression (ArrayCreationExpression e) {
if (e.initializer_list != null) {
foreach (Expression init in e.initializer_list.get_initializers ()) {
if (init.static_type.is_reference_type_or_type_parameter ()) {
}
}
- public override void visit_parenthesized_expression (ParenthesizedExpression! expr) {
+ public override void visit_parenthesized_expression (ParenthesizedExpression expr) {
expr.accept_children (this);
}
- public override void visit_member_access (MemberAccess! expr) {
+ public override void visit_member_access (MemberAccess expr) {
if (expr.inner != null) {
visit_possibly_leaked_expression (expr.inner);
}
}
- public override void visit_invocation_expression (InvocationExpression! expr) {
+ public override void visit_invocation_expression (InvocationExpression expr) {
expr.accept_children (this);
var mtype = expr.call.static_type;
}
}
- public override void visit_object_creation_expression (ObjectCreationExpression! expr) {
+ public override void visit_object_creation_expression (ObjectCreationExpression expr) {
expr.accept_children (this);
if (!(expr.symbol_reference is Method)) {
}
}
- public override void visit_binary_expression (BinaryExpression! expr) {
+ public override void visit_binary_expression (BinaryExpression expr) {
visit_possibly_leaked_expression (expr.left);
visit_possibly_leaked_expression (expr.right);
}
- public override void visit_lambda_expression (LambdaExpression! l) {
+ public override void visit_lambda_expression (LambdaExpression l) {
l.accept_children (this);
}
- public override void visit_assignment (Assignment! a) {
+ public override void visit_assignment (Assignment a) {
a.accept_children (this);
if (a.left is PointerIndirection || a.left.symbol_reference is Signal) {
/**
* The name of the vfunc of this method as it is used in C code.
*/
- public string! vfunc_name {
+ public string vfunc_name {
get {
if (_vfunc_name == null) {
_vfunc_name = this.name;
/**
* The sentinel to use for terminating variable length argument lists.
*/
- public string! sentinel {
+ public string sentinel {
get {
if (_sentinel == null) {
return DEFAULT_SENTINEL;
*
* @param param a formal parameter
*/
- public void add_parameter (FormalParameter! param) {
+ public void add_parameter (FormalParameter param) {
if (no_array_length) {
param.no_array_length = true;
}
return new ReadOnlyCollection<FormalParameter> (parameters);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_method (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (return_type != null) {
return_type.accept (visitor);
}
*
* @return the name to be used in C code
*/
- public string! get_cname () {
+ public string get_cname () {
if (cname == null) {
cname = get_default_cname ();
}
*
* @return the name to be used in C code by default
*/
- public virtual string! get_default_cname () {
+ public virtual string get_default_cname () {
if (name == "main" && parent_symbol.name == null) {
// avoid conflict with generated main function
return "_main";
*
* @return the name to be used in C code
*/
- public string! get_real_cname () {
+ public string get_real_cname () {
if (base_method != null || base_interface_method != null) {
return "%s_real_%s".printf (parent_symbol.get_lower_case_cname (null), name);
} else {
* @param m a method
* @return true if the specified method is compatible to this method
*/
- public bool equals (Method! m2) {
+ public bool equals (Method m2) {
if (!m2.return_type.equals (return_type)) {
return false;
}
*
* @param error_domain an error domain
*/
- public void add_error_domain (DataType! error_domain) {
+ public void add_error_domain (DataType error_domain) {
error_domains.add (error_domain);
error_domain.parent_node = this;
}
*
* @param precondition a boolean precondition expression
*/
- public void add_precondition (Expression! precondition) {
+ public void add_precondition (Expression precondition) {
preconditions.add (precondition);
precondition.parent_node = this;
}
*
* @param postcondition a boolean postcondition expression
*/
- public void add_postcondition (Expression! postcondition) {
+ public void add_postcondition (Expression postcondition) {
postconditions.add (postcondition);
postcondition.parent_node = this;
}
return new ReadOnlyCollection<Expression> (postconditions);
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (return_type == old_type) {
return_type = new_type;
return;
return method_symbol.get_parameters ();
}
- public override DataType! copy () {
+ public override DataType copy () {
return new MethodType (method_symbol);
}
- public override bool compatible (DataType! target_type, bool enable_non_null = true) {
+ public override bool compatible (DataType target_type, bool enable_non_null = true) {
var dt = target_type as DelegateType;
if (dt == null) {
// method types incompatible to anything but delegates
return dt.delegate_symbol.matches_method (method_symbol);
}
- public override string! to_string () {
+ public override string to_string () {
return method_symbol.get_full_name ();
}
}
/**
* The name of a property.
*/
- public string! name { get; set construct; }
+ public string name { get; set construct; }
/**
* The expression the property should assign.
*/
- public Expression! argument { get; set construct; }
+ public Expression argument { get; set construct; }
/**
* Creates a new named argument.
* @param source reference to source code
* @return newly created named argument
*/
- public NamedArgument (string! _name, Expression! arg, SourceReference source) {
+ public NamedArgument (string _name, Expression arg, SourceReference source) {
name = _name;
argument = arg;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
argument.accept (visitor);
visitor.visit_named_argument (this);
*
* @param ns a namespace
*/
- public void add_namespace (Namespace! ns) {
+ public void add_namespace (Namespace ns) {
namespaces.add (ns);
scope.add (ns.name, ns);
}
*
* @param cl a class
*/
- public void add_class (Class! cl) {
+ public void add_class (Class cl) {
classes.add (cl);
scope.add (cl.name, cl);
}
*
* @param iface an interface
*/
- public void add_interface (Interface! iface) {
+ public void add_interface (Interface iface) {
interfaces.add (iface);
scope.add (iface.name, iface);
}
*
* @param st a struct
*/
- public void add_struct (Struct! st) {
+ public void add_struct (Struct st) {
structs.add (st);
scope.add (st.name, st);
}
*
* @param en an enum
*/
- public void add_enum (Enum! en) {
+ public void add_enum (Enum en) {
enums.add (en);
scope.add (en.name, en);
}
*
* @param d a delegate
*/
- public void add_delegate (Delegate! d) {
+ public void add_delegate (Delegate d) {
delegates.add (d);
scope.add (d.name, d);
}
*
* @param constant a constant
*/
- public void add_constant (Constant! constant) {
+ public void add_constant (Constant constant) {
constants.add (constant);
scope.add (constant.name, constant);
}
*
* @param f a field
*/
- public void add_field (Field! f) {
+ public void add_field (Field f) {
fields.add (f);
scope.add (f.name, f);
}
*
* @param m a method
*/
- public void add_method (Method! m) {
+ public void add_method (Method m) {
if (m is CreationMethod) {
Report.error (m.source_reference, "construction methods may only be declared within classes and structs");
scope.add (m.name, m);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_namespace (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (Namespace ns in namespaces) {
ns.accept (visitor);
}
}
}
- public override string! get_cprefix () {
+ public override string get_cprefix () {
if (cprefixes.size > 0) {
return cprefixes[0];
} else if (null != name) {
*
* @param cprefixes the camel case prefixes used in C code
*/
- public void add_cprefix (string! cprefix) {
+ public void add_cprefix (string cprefix) {
return_if_fail (cprefix.len() >= 1);
cprefixes.add (cprefix);
}
*
* @return the lower case prefix to be used in C code
*/
- public override string! get_lower_case_cprefix () {
+ public override string get_lower_case_cprefix () {
if (lower_case_cprefix == null) {
if (name == null) {
lower_case_cprefix = "";
* @return header filename
*/
public string get_cheader_filename () {
- var s = new String ();
+ var s = new StringBuilder ();
bool first = true;
foreach (string cheader_filename in get_cheader_filenames ()) {
if (first) {
*
* @param cheader_filename header filename
*/
- public void set_cheader_filename (string! cheader_filename) {
+ public void set_cheader_filename (string cheader_filename) {
cheader_filenames = new ArrayList<string> ();
cheader_filenames.add (cheader_filename);
}
- private void process_ccode_attribute (Attribute! a) {
+ private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("cprefix")) {
foreach (string name in a.get_string ("cprefix").split (","))
add_cprefix (name);
/**
* The name of the namespace this reference is referring to.
*/
- public string! name { get; set; }
+ public string name { get; set; }
/**
* The resolved symbol of the namespace this reference is referring to.
* @param source_reference reference to source code
* @return newly created namespace reference
*/
- public NamespaceReference (construct string! name, construct SourceReference source_reference) {
+ public NamespaceReference (construct string name, construct SourceReference source_reference) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_namespace_reference (this);
}
}
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_null_literal (this);
}
- public override string! to_string () {
+ public override string to_string () {
return "null";
}
this.source_reference = source_reference;
}
- public override bool compatible (DataType! target_type, bool enable_non_null = true) {
+ public override bool compatible (DataType target_type, bool enable_non_null = true) {
if (!(target_type is PointerType) && (target_type is NullType || (target_type.data_type == null && target_type.type_parameter == null))) {
return true;
}
return false;
}
- public override DataType! copy () {
+ public override DataType copy () {
return new NullType (source_reference);
}
}
/**
* The object type to create.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
* @param source_reference reference to source code
* @return newly created object creation expression
*/
- public ObjectCreationExpression (construct MemberAccess! member_name, construct SourceReference source_reference) {
+ public ObjectCreationExpression (construct MemberAccess member_name, construct SourceReference source_reference) {
}
/**
*
* @param arg an argument
*/
- public void add_argument (Expression! arg) {
+ public void add_argument (Expression arg) {
argument_list.add (arg);
arg.parent_node = this;
}
*
* @param init a member initializer
*/
- public void add_member_initializer (MemberInitializer! init) {
+ public void add_member_initializer (MemberInitializer init) {
object_initializer.add (init);
init.parent_node = this;
}
return new ReadOnlyCollection<MemberInitializer> (object_initializer);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_object_creation_expression (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (type_reference != null) {
type_reference.accept (visitor);
}
}
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
int index = argument_list.index_of (old_node);
if (index >= 0 && new_node.parent_node == null) {
argument_list[index] = new_node;
return false;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
/**
* The inner expression.
*/
- public Expression! inner {
+ public Expression inner {
get {
return _inner;
}
}
}
- private Expression! _inner;
+ private Expression _inner;
/**
* Creates a new parenthesized expression.
* @param source reference to source code
* @return newly created parenthesized expression
*/
- public ParenthesizedExpression (Expression! _inner, SourceReference source) {
+ public ParenthesizedExpression (Expression _inner, SourceReference source) {
inner = _inner;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_parenthesized_expression (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
inner.accept (visitor);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
}
*
* @param context a code context
*/
- public void parse (CodeContext! context) {
+ public void parse (CodeContext context) {
this.context = context;
context.accept (this);
}
- public override void visit_source_file (SourceFile! source_file) {
+ public override void visit_source_file (SourceFile source_file) {
if (source_file.filename.has_suffix (".vala") || source_file.filename.has_suffix (".vapi")) {
parse_file (source_file);
}
expect (TokenType.CLOSE_BRACKET);
}
- // deprecated
- accept (TokenType.OP_NEG);
+ if (accept (TokenType.OP_NEG)) {
+ Report.warning (get_last_src (), "obsolete syntax, types are non-null by default");
+ }
bool nullable = accept (TokenType.INTERR);
/**
* The pointer to dereference.
*/
- public Expression! inner {
+ public Expression inner {
get {
return _inner;
}
}
}
- private Expression! _inner;
+ private Expression _inner;
/**
* Creates a new pointer indirection.
* @param inner pointer to be dereferenced
* @return newly created pointer indirection
*/
- public PointerIndirection (construct Expression! inner, construct SourceReference source_reference = null) {
+ public PointerIndirection (construct Expression inner, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
inner.accept (visitor);
visitor.visit_pointer_indirection (this);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
}
*/
public DataType base_type { get; set; }
- public PointerType (construct DataType! base_type) {
+ public PointerType (construct DataType base_type) {
}
- public override string! to_string () {
+ public override string to_string () {
return base_type.to_string () + "*";
}
}
}
- public override DataType! copy () {
+ public override DataType copy () {
return new PointerType (base_type);
}
- public override bool compatible (DataType! target_type, bool enable_non_null = true) {
+ public override bool compatible (DataType target_type, bool enable_non_null = true) {
if (target_type is PointerType || (target_type.data_type != null && target_type.data_type.get_attribute ("PointerType") != null)) {
return true;
}
/**
* The operand, must be a variable or a property.
*/
- public Expression! inner { get; set construct; }
+ public Expression inner { get; set construct; }
/**
* Specifies whether value should be incremented or decremented.
* @param source reference to source code
* @return newly created postfix expression
*/
- public PostfixExpression (Expression! _inner, bool inc, SourceReference source) {
+ public PostfixExpression (Expression _inner, bool inc, SourceReference source) {
inner = _inner;
increment = inc;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
inner.accept (visitor);
visitor.visit_postfix_expression (this);
/**
* The property type.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
* @param source reference to source code
* @return newly created property
*/
- public Property (string! _name, DataType! type, PropertyAccessor _get_accessor, PropertyAccessor _set_accessor, SourceReference source) {
+ public Property (string _name, DataType type, PropertyAccessor _get_accessor, PropertyAccessor _set_accessor, SourceReference source) {
name = _name;
type_reference = type;
get_accessor = _get_accessor;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_member (this);
visitor.visit_property (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
type_reference.accept (visitor);
if (get_accessor != null) {
*
* @return the upper case name to be used in C code
*/
- public string! get_upper_case_cname () {
+ public string get_upper_case_cname () {
return "%s_%s".printf (parent_symbol.get_lower_case_cname (null), camel_case_to_lower_case (name)).up ();
}
*
* @return string literal to be used in C code
*/
- public CCodeConstant! get_canonical_cconstant () {
+ public CCodeConstant get_canonical_cconstant () {
return new CCodeConstant ("\"%s\"".printf (get_canonical_name ()));
}
private string get_canonical_name () {
- var str = new String ();
+ var str = new StringBuilder ();
string i = name;
* @return true if the specified property is compatible to this
* property
*/
- public bool equals (Property! prop2) {
+ public bool equals (Property prop2) {
if (!prop2.type_reference.equals (type_reference)) {
return false;
}
return true;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
public PropertyAccessor (construct bool readable, construct bool writable, construct bool construction, construct Block body, construct SourceReference source_reference) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_property_accessor (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (body != null) {
body.accept (visitor);
}
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_real_literal (this);
}
*
* @return the name of literal type
*/
- public string! get_type_name () {
+ public string get_type_name () {
if (value.has_suffix ("F")) {
return "float";
}
/**
* The variable whose reference is to be transferred.
*/
- public Expression! inner {
+ public Expression inner {
get {
return _inner;
}
}
}
- private Expression! _inner;
+ private Expression _inner;
/**
* Creates a new reference transfer expression.
* @param inner variable whose reference is to be transferred
* @return newly created reference transfer expression
*/
- public ReferenceTransferExpression (construct Expression! inner, construct SourceReference source_reference = null) {
+ public ReferenceTransferExpression (construct Expression inner, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
inner.accept (visitor);
visitor.visit_reference_transfer_expression (this);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
}
/**
* Pretty-print the actual line of offending code if possible.
*/
- private static void report_source (SourceReference! source) {
+ private static void report_source (SourceReference source) {
if (source.first_line != source.last_line) {
// FIXME Cannot report multi-line issues currently
return;
* @param source reference to source code
* @param message warning message
*/
- public static void warning (SourceReference source, string! message) {
+ public static void warning (SourceReference source, string message) {
warnings++;
if (source == null) {
stderr.printf ("warning: %s\n", message);
* @param source reference to source code
* @param message error message
*/
- public static void error (SourceReference source, string! message) {
+ public static void error (SourceReference source, string message) {
errors++;
if (source == null) {
stderr.printf ("error: %s\n", message);
}
}
- private Expression! _return_expression;
+ private Expression _return_expression;
/**
* Creates a new return statement.
public ReturnStatement (construct Expression return_expression = null, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_return_statement (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (return_expression != null) {
return_expression.accept (visitor);
}
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (return_expression == old_node) {
return_expression = new_node;
}
}
}
- void push_comment (string! comment_item, bool file_comment) {
+ void push_comment (string comment_item, bool file_comment) {
if (_comment == null) {
_comment = comment_item;
} else {
* @param name name for the specified symbol
* @param sym a symbol
*/
- public void add (string name, Symbol! sym) {
+ public void add (string name, Symbol sym) {
if (name != null) {
if (symbol_table == null) {
symbol_table = new HashMap<string,Symbol> (str_hash, str_equal);
* @param name name of the symbol to be returned
* @return found symbol or null
*/
- public Symbol lookup (string! name) {
+ public Symbol lookup (string name) {
if (symbol_table == null) {
return null;
}
public SemanticAnalyzer () {
}
- public void add_binding_provider (BindingProvider! binding_provider) {
+ public void add_binding_provider (BindingProvider binding_provider) {
binding_providers.add (binding_provider);
}
*
* @param context a code context
*/
- public void analyze (CodeContext! context) {
+ public void analyze (CodeContext context) {
this.context = context;
root_symbol = context.root;
context.accept (this);
}
- public override void visit_source_file (SourceFile! file) {
+ public override void visit_source_file (SourceFile file) {
current_source_file = file;
current_using_directives = file.get_using_directives ();
current_using_directives = null;
}
- public override void visit_class (Class! cl) {
+ public override void visit_class (Class cl) {
current_symbol = cl;
current_class = cl;
current_class = null;
}
- private void get_all_prerequisites (Interface! iface, Collection<Typesymbol> list) {
+ private void get_all_prerequisites (Interface iface, Collection<Typesymbol> list) {
foreach (DataType prereq in iface.get_prerequisites ()) {
Typesymbol type = prereq.data_type;
/* skip on previous errors */
}
}
- private bool class_is_a (Class! cl, Typesymbol! t) {
+ private bool class_is_a (Class cl, Typesymbol t) {
if (cl == t) {
return true;
}
return false;
}
- public override void visit_struct (Struct! st) {
+ public override void visit_struct (Struct st) {
current_symbol = st;
current_struct = st;
current_struct = null;
}
- public override void visit_interface (Interface! iface) {
+ public override void visit_interface (Interface iface) {
current_symbol = iface;
foreach (DataType prerequisite_reference in iface.get_prerequisites ()) {
current_symbol = current_symbol.parent_symbol;
}
- public override void visit_enum (Enum! en) {
+ public override void visit_enum (Enum en) {
en.accept_children (this);
}
- public override void visit_enum_value (EnumValue! ev) {
+ public override void visit_enum_value (EnumValue ev) {
ev.accept_children (this);
}
- public override void visit_delegate (Delegate! d) {
+ public override void visit_delegate (Delegate d) {
d.accept_children (this);
}
- public override void visit_constant (Constant! c) {
+ public override void visit_constant (Constant c) {
c.type_reference.accept (this);
if (!current_source_file.pkg) {
}
}
- public override void visit_field (Field! f) {
+ public override void visit_field (Field f) {
f.accept_children (this);
if (f.instance && f.parent_symbol is Interface) {
}
}
- public override void visit_method (Method! m) {
+ public override void visit_method (Method m) {
if (m.is_abstract) {
if (m.parent_symbol is Class) {
var cl = (Class) m.parent_symbol;
}
}
- private void find_base_class_method (Method! m, Class! cl) {
+ private void find_base_class_method (Method m, Class cl) {
var sym = cl.scope.lookup (m.name);
if (sym is Method) {
var base_method = (Method) sym;
}
}
- private void find_base_interface_method (Method! m, Class! cl) {
+ private void find_base_interface_method (Method m, Class cl) {
// FIXME report error if multiple possible base methods are found
foreach (DataType type in cl.get_base_types ()) {
if (type.data_type is Interface) {
}
}
- public override void visit_creation_method (CreationMethod! m) {
+ public override void visit_creation_method (CreationMethod m) {
if (m.type_name != null && m.type_name != current_symbol.name) {
// type_name is null for constructors generated by GIdlParser
Report.error (m.source_reference, "missing return type in method `%s.%s´".printf (current_symbol.get_full_name (), m.type_name));
}
}
- public override void visit_formal_parameter (FormalParameter! p) {
+ public override void visit_formal_parameter (FormalParameter p) {
p.accept_children (this);
if (!p.ellipsis) {
return true;
}
- private void find_base_class_property (Property! prop, Class! cl) {
+ private void find_base_class_property (Property prop, Class cl) {
var sym = cl.scope.lookup (prop.name);
if (sym is Property) {
var base_property = (Property) sym;
}
}
- private void find_base_interface_property (Property! prop, Class! cl) {
+ private void find_base_interface_property (Property prop, Class cl) {
// FIXME report error if multiple possible base properties are found
foreach (DataType type in cl.get_base_types ()) {
if (type.data_type is Interface) {
}
}
- public override void visit_property (Property! prop) {
+ public override void visit_property (Property prop) {
current_symbol = prop;
if (!prop.instance) {
}
}
- public override void visit_property_accessor (PropertyAccessor! acc) {
+ public override void visit_property_accessor (PropertyAccessor acc) {
acc.prop = (Property) current_symbol;
if (acc.readable) {
current_return_type = null;
}
- public override void visit_signal (Signal! sig) {
+ public override void visit_signal (Signal sig) {
sig.accept_children (this);
}
- public override void visit_constructor (Constructor! c) {
+ public override void visit_constructor (Constructor c) {
c.this_parameter = new FormalParameter ("this", new ClassType (current_class));
c.scope.add (c.this_parameter.name, c.this_parameter);
current_symbol = current_symbol.parent_symbol;
}
- public override void visit_destructor (Destructor! d) {
+ public override void visit_destructor (Destructor d) {
d.owner = current_symbol.scope;
current_symbol = d;
current_symbol = current_symbol.parent_symbol;
}
- public override void visit_named_argument (NamedArgument! n) {
+ public override void visit_named_argument (NamedArgument n) {
}
- public override void visit_block (Block! b) {
+ public override void visit_block (Block b) {
b.owner = current_symbol.scope;
current_symbol = b;
current_symbol = current_symbol.parent_symbol;
}
- public override void visit_variable_declarator (VariableDeclarator! decl) {
+ public override void visit_variable_declarator (VariableDeclarator decl) {
if (decl.initializer != null) {
decl.initializer.expected_type = decl.type_reference;
}
*
* @param list an initializer list
*/
- public override void visit_initializer_list (InitializerList! list) {
+ public override void visit_initializer_list (InitializerList list) {
if (list.expected_type is ArrayType) {
/* initializer is used as array initializer */
var array_type = (ArrayType) list.expected_type;
}
}
- public override void visit_expression_statement (ExpressionStatement! stmt) {
+ public override void visit_expression_statement (ExpressionStatement stmt) {
if (stmt.expression.error) {
// ignore inner error
stmt.error = true;
stmt.tree_can_fail = stmt.expression.tree_can_fail;
}
- public override void visit_if_statement (IfStatement! stmt) {
+ public override void visit_if_statement (IfStatement stmt) {
stmt.accept_children (this);
if (stmt.condition.error) {
}
}
- public override void visit_switch_section (SwitchSection! section) {
+ public override void visit_switch_section (SwitchSection section) {
foreach (SwitchLabel label in section.get_labels ()) {
label.accept (this);
}
current_symbol = current_symbol.parent_symbol;
}
- public override void visit_while_statement (WhileStatement! stmt) {
+ public override void visit_while_statement (WhileStatement stmt) {
stmt.accept_children (this);
if (stmt.condition.error) {
}
}
- public override void visit_do_statement (DoStatement! stmt) {
+ public override void visit_do_statement (DoStatement stmt) {
stmt.accept_children (this);
if (stmt.condition.error) {
}
}
- public override void visit_for_statement (ForStatement! stmt) {
+ public override void visit_for_statement (ForStatement stmt) {
stmt.accept_children (this);
if (stmt.condition != null && stmt.condition.error) {
}
}
- public override void visit_foreach_statement (ForeachStatement! stmt) {
+ public override void visit_foreach_statement (ForeachStatement stmt) {
current_source_file.add_type_dependency (stmt.type_reference, SourceFileDependencyType.SOURCE);
stmt.variable_declarator = new VariableDeclarator (stmt.variable_name);
stmt.tree_can_fail = stmt.collection.tree_can_fail || stmt.body.tree_can_fail;
}
- public override void visit_return_statement (ReturnStatement! stmt) {
+ public override void visit_return_statement (ReturnStatement stmt) {
stmt.accept_children (this);
if (stmt.return_expression != null && stmt.return_expression.error) {
}
}
- public override void visit_throw_statement (ThrowStatement! stmt) {
+ public override void visit_throw_statement (ThrowStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_try_statement (TryStatement! stmt) {
+ public override void visit_try_statement (TryStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_catch_clause (CatchClause! clause) {
+ public override void visit_catch_clause (CatchClause clause) {
if (clause.type_reference != null) {
current_source_file.add_type_dependency (clause.type_reference, SourceFileDependencyType.SOURCE);
clause.accept_children (this);
}
- public override void visit_lock_statement (LockStatement! stmt) {
+ public override void visit_lock_statement (LockStatement stmt) {
/* resource must be a member access and denote a Lockable */
if (!(stmt.resource is MemberAccess && stmt.resource.symbol_reference is Lockable)) {
stmt.error = true;
}
}
- private int create_sizes_from_initializer_list (InitializerList! il, int rank, Gee.List<Literal>! sl) {
+ private int create_sizes_from_initializer_list (InitializerList il, int rank, Gee.List<Literal> sl) {
var init = new IntegerLiteral (il.size.to_string (), il.source_reference);
init.accept (this);
sl.add (init);
*
* @param expr an array creation expression
*/
- public override void visit_array_creation_expression (ArrayCreationExpression! expr) {
+ public override void visit_array_creation_expression (ArrayCreationExpression expr) {
Collection<Expression> size = expr.get_sizes ();
var initlist = expr.initializer_list;
expr.static_type.add_type_argument (expr.element_type);
}
- public override void visit_boolean_literal (BooleanLiteral! expr) {
+ public override void visit_boolean_literal (BooleanLiteral expr) {
expr.static_type = bool_type;
}
- public override void visit_character_literal (CharacterLiteral! expr) {
+ public override void visit_character_literal (CharacterLiteral expr) {
expr.static_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("char"));
}
- public override void visit_integer_literal (IntegerLiteral! expr) {
+ public override void visit_integer_literal (IntegerLiteral expr) {
var int_type = new IntegerType ((Typesymbol) root_symbol.scope.lookup (expr.get_type_name ()));
int_type.literal = expr;
expr.static_type = int_type;
}
- public override void visit_real_literal (RealLiteral! expr) {
+ public override void visit_real_literal (RealLiteral expr) {
expr.static_type = new ValueType ((Typesymbol) root_symbol.scope.lookup (expr.get_type_name ()));
}
- public override void visit_string_literal (StringLiteral! expr) {
+ public override void visit_string_literal (StringLiteral expr) {
expr.static_type = string_type.copy ();
}
- public override void visit_null_literal (NullLiteral! expr) {
+ public override void visit_null_literal (NullLiteral expr) {
expr.static_type = new NullType (expr.source_reference);
}
- private DataType get_static_type_for_symbol (Symbol! sym) {
+ private DataType get_static_type_for_symbol (Symbol sym) {
if (sym is Field) {
var f = (Field) sym;
return f.type_reference;
return null;
}
- public static Symbol symbol_lookup_inherited (Symbol! sym, string! name) {
+ public static Symbol symbol_lookup_inherited (Symbol sym, string name) {
var result = sym.scope.lookup (name);
if (result != null) {
return result;
return null;
}
- public override void visit_parenthesized_expression (ParenthesizedExpression! expr) {
+ public override void visit_parenthesized_expression (ParenthesizedExpression expr) {
expr.inner.expected_type = expr.expected_type;
expr.accept_children (this);
expr.static_type.floating_reference = false;
}
- public override void visit_member_access (MemberAccess! expr) {
+ public override void visit_member_access (MemberAccess expr) {
Symbol base_symbol = null;
bool may_access_instance_members = false;
current_source_file.add_symbol_dependency (expr.symbol_reference, SourceFileDependencyType.SOURCE);
}
- public override void visit_invocation_expression (InvocationExpression! expr) {
+ public override void visit_invocation_expression (InvocationExpression expr) {
expr.call.accept (this);
if (expr.call.error) {
check_arguments (expr, mtype, params, expr.get_argument_list ());
}
- private bool check_arguments (Expression! expr, DataType! mtype, Collection<FormalParameter> params, Collection<Expression> args) {
+ private bool check_arguments (Expression expr, DataType mtype, Collection<FormalParameter> params, Collection<Expression> args) {
Expression prev_arg = null;
Iterator<Expression> arg_it = args.iterator ();
return actual_type;
}
- public override void visit_element_access (ElementAccess! expr) {
+ public override void visit_element_access (ElementAccess expr) {
if (expr.container.static_type == null) {
/* don't proceed if a child expression failed */
expr.error = true;
}
}
- public override void visit_base_access (BaseAccess! expr) {
+ public override void visit_base_access (BaseAccess expr) {
if (current_class == null) {
if (current_struct == null) {
expr.error = true;
expr.symbol_reference = expr.static_type.data_type;
}
- public override void visit_postfix_expression (PostfixExpression! expr) {
+ public override void visit_postfix_expression (PostfixExpression expr) {
expr.static_type = expr.inner.static_type;
}
- public override void visit_object_creation_expression (ObjectCreationExpression! expr) {
+ public override void visit_object_creation_expression (ObjectCreationExpression expr) {
if (expr.member_name != null) {
expr.member_name.accept (this);
}
}
}
- public override void visit_sizeof_expression (SizeofExpression! expr) {
+ public override void visit_sizeof_expression (SizeofExpression expr) {
expr.static_type = ulong_type;
}
- public override void visit_typeof_expression (TypeofExpression! expr) {
+ public override void visit_typeof_expression (TypeofExpression expr) {
expr.static_type = type_type;
}
- private bool is_numeric_type (DataType! type) {
+ private bool is_numeric_type (DataType type) {
if (!(type.data_type is Struct)) {
return false;
}
return st.is_integer_type () || st.is_floating_type ();
}
- private bool is_integer_type (DataType! type) {
+ private bool is_integer_type (DataType type) {
if (!(type.data_type is Struct)) {
return false;
}
return st.is_integer_type ();
}
- public override void visit_unary_expression (UnaryExpression! expr) {
+ public override void visit_unary_expression (UnaryExpression expr) {
if (expr.inner.error) {
/* if there was an error in the inner expression, skip type check */
expr.error = true;
}
}
- private MemberAccess find_member_access (Expression! expr) {
+ private MemberAccess find_member_access (Expression expr) {
if (expr is ParenthesizedExpression) {
var pe = (ParenthesizedExpression) expr;
return find_member_access (pe.inner);
return null;
}
- public override void visit_cast_expression (CastExpression! expr) {
+ public override void visit_cast_expression (CastExpression expr) {
if (expr.inner.error) {
expr.error = true;
return;
expr.static_type.transfers_ownership = expr.inner.static_type.transfers_ownership;
}
- public override void visit_pointer_indirection (PointerIndirection! expr) {
+ public override void visit_pointer_indirection (PointerIndirection expr) {
if (expr.inner.error) {
return;
}
}
}
- public override void visit_addressof_expression (AddressofExpression! expr) {
+ public override void visit_addressof_expression (AddressofExpression expr) {
if (expr.inner.error) {
return;
}
}
}
- public override void visit_reference_transfer_expression (ReferenceTransferExpression! expr) {
+ public override void visit_reference_transfer_expression (ReferenceTransferExpression expr) {
if (expr.inner.error) {
/* if there was an error in the inner expression, skip type check */
expr.error = true;
expr.static_type.takes_ownership = false;
}
- private DataType get_arithmetic_result_type (DataType! left_type, DataType! right_type) {
+ private DataType get_arithmetic_result_type (DataType left_type, DataType right_type) {
if (!(left_type.data_type is Struct) || !(right_type.data_type is Struct)) {
// at least one operand not struct
return null;
}
}
- public override void visit_binary_expression (BinaryExpression! expr) {
+ public override void visit_binary_expression (BinaryExpression expr) {
if (expr.left.error || expr.right.error) {
/* if there were any errors in inner expressions, skip type check */
expr.error = true;
}
}
- public override void visit_type_check (TypeCheck! expr) {
+ public override void visit_type_check (TypeCheck expr) {
if (expr.type_reference.data_type == null) {
/* if type resolving didn't succeed, skip this check */
expr.error = true;
expr.static_type = bool_type;
}
- public override void visit_conditional_expression (ConditionalExpression! expr) {
+ public override void visit_conditional_expression (ConditionalExpression expr) {
if (!expr.condition.static_type.compatible (bool_type)) {
expr.error = true;
Report.error (expr.condition.source_reference, "Condition must be boolean");
return false;
}
- public override void visit_lambda_expression (LambdaExpression! l) {
+ public override void visit_lambda_expression (LambdaExpression l) {
if (!(l.expected_type is DelegateType)) {
l.error = true;
Report.error (l.source_reference, "lambda expression not allowed in this context");
l.accept_children (this);
}
- public override void visit_assignment (Assignment! a) {
+ public override void visit_assignment (Assignment a) {
a.left.lvalue = true;
a.left.accept (this);
/**
* The return type of handlers of this signal.
*/
- public DataType! return_type {
+ public DataType return_type {
get { return _return_type; }
set {
_return_type = value;
* @param source reference to source code
* @return newly created signal
*/
- public Signal (construct string! name, construct DataType! return_type, construct SourceReference source_reference = null) {
+ public Signal (construct string name, construct DataType return_type, construct SourceReference source_reference = null) {
}
/**
*
* @param param a formal parameter
*/
- public void add_parameter (FormalParameter! param) {
+ public void add_parameter (FormalParameter param) {
// default C parameter position
param.cparameter_position = parameters.size + 1;
param.carray_length_parameter_position = param.cparameter_position + 0.1;
*
* @return delegate
*/
- public Delegate! get_delegate () {
+ public Delegate get_delegate () {
if (generated_delegate == null) {
generated_delegate = new Delegate (null, return_type);
generated_delegate.instance = true;
var sender_param = new FormalParameter ("sender", sender_type);
generated_delegate.add_parameter (sender_param);
- foreach (FormalParameter! param in parameters) {
+ foreach (FormalParameter param in parameters) {
generated_delegate.add_parameter (param);
}
}
*
* @return the name to be used in C code
*/
- public string! get_cname () {
+ public string get_cname () {
if (cname == null) {
cname = name;
}
*
* @return string literal to be used in C code
*/
- public CCodeConstant! get_canonical_cconstant () {
- var str = new String ("\"");
+ public CCodeConstant get_canonical_cconstant () {
+ var str = new StringBuilder ("\"");
string i = name;
return new CCodeConstant (str.str);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_member (this);
visitor.visit_signal (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
return_type.accept (visitor);
foreach (FormalParameter param in parameters) {
lock_used = used;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (return_type == old_type) {
return_type = new_type;
}
return signal_symbol.get_parameters ();
}
- public override DataType! copy () {
+ public override DataType copy () {
return new SignalType (signal_symbol);
}
}
/**
* The type whose size to be retrieved.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
* @param source reference to source code
* @return newly created sizeof expression
*/
- public SizeofExpression (DataType! type, SourceReference source) {
+ public SizeofExpression (DataType type, SourceReference source) {
type_reference = type;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
type_reference.accept (visitor);
visitor.visit_sizeof_expression (this);
return true;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
/**
* The name of this source file.
*/
- public string! filename { get; set; }
+ public string filename { get; set; }
/**
* The header comment of this source file.
* @param pkg true if this is a VAPI package file
* @return newly created source file
*/
- public SourceFile (construct CodeContext! context, construct string! filename, construct bool pkg = false) {
+ public SourceFile (construct CodeContext context, construct string filename, construct bool pkg = false) {
}
/**
*
* @param ns reference to namespace
*/
- public void add_using_directive (NamespaceReference! ns) {
+ public void add_using_directive (NamespaceReference ns) {
using_directives.add (ns);
}
*
* @param node a code node
*/
- public void add_node (CodeNode! node) {
+ public void add_node (CodeNode node) {
nodes.add (node);
}
- public void remove_node (CodeNode! node) {
+ public void remove_node (CodeNode node) {
nodes.remove (node);
}
return new ReadOnlyCollection<CodeNode> (nodes);
}
- public void accept (CodeVisitor! visitor) {
+ public void accept (CodeVisitor visitor) {
visitor.visit_source_file (this);
}
- public void accept_children (CodeVisitor! visitor) {
+ public void accept_children (CodeVisitor visitor) {
foreach (NamespaceReference ns_ref in using_directives) {
ns_ref.accept (visitor);
}
}
}
- private string! get_subdir () {
+ private string get_subdir () {
if (context.basedir == null) {
return "";
}
return "";
}
- private string! get_destination_directory () {
+ private string get_destination_directory () {
if (context.directory == null) {
return get_subdir ();
}
*
* @return generated C header filename
*/
- public string! get_cheader_filename () {
+ public string get_cheader_filename () {
if (cheader_filename == null) {
var basename = filename.ndup ((uint) (filename.len () - ".vala".len ()));
basename = Path.get_basename (basename);
*
* @return generated C source filename
*/
- public string! get_csource_filename () {
+ public string get_csource_filename () {
if (csource_filename == null) {
var basename = filename.ndup ((uint) (filename.len () - ".vala".len ()));
basename = Path.get_basename (basename);
*
* @return C header filename to include
*/
- public string! get_cinclude_filename () {
+ public string get_cinclude_filename () {
if (cinclude_filename == null) {
var basename = filename.ndup ((uint) (filename.len () - ".vala".len ()));
basename = Path.get_basename (basename);
* @param sym a symbol
* @param dep_type type of dependency
*/
- public void add_symbol_dependency (Symbol! sym, SourceFileDependencyType dep_type) {
+ public void add_symbol_dependency (Symbol sym, SourceFileDependencyType dep_type) {
if (pkg) {
return;
}
* @param type a data type
* @param dep_type type of dependency
*/
- public void add_type_dependency (DataType! type, SourceFileDependencyType dep_type) {
+ public void add_type_dependency (DataType type, SourceFileDependencyType dep_type) {
foreach (Symbol type_symbol in type.get_symbols ()) {
add_symbol_dependency (type_symbol, dep_type);
}
*
* @param include internal include for C header file
*/
- public void add_header_internal_include (string! include) {
+ public void add_header_internal_include (string include) {
/* skip includes to self */
if (include != get_cinclude_filename ()) {
header_internal_includes.add (include);
*
* @return human-readable string
*/
- public string! to_string () {
+ public string to_string () {
return ("%s:%d.%d-%d.%d".printf (file.filename, first_line, first_column, last_line, last_column));
}
}
return noquotes.compress ();
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_string_literal (this);
}
* @param source_reference reference to source code
* @return newly created struct
*/
- public Struct (construct string! name, construct SourceReference source_reference = null) {
+ public Struct (construct string name, construct SourceReference source_reference = null) {
}
/**
*
* @param p a type parameter
*/
- public void add_type_parameter (TypeParameter! p) {
+ public void add_type_parameter (TypeParameter p) {
type_parameters.add (p);
p.type = this;
scope.add (p.name, p);
*
* @param c a constant
*/
- public void add_constant (Constant! c) {
+ public void add_constant (Constant c) {
constants.add (c);
scope.add (c.name, c);
}
*
* @param f a field
*/
- public void add_field (Field! f) {
+ public void add_field (Field f) {
fields.add (f);
scope.add (f.name, f);
}
*
* @param m a method
*/
- public void add_method (Method! m) {
+ public void add_method (Method m) {
return_if_fail (m != null);
if (m.instance) {
return new ReadOnlyCollection<Method> (methods);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_struct (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (DataType type in base_types) {
type.accept (visitor);
}
return cname;
}
- private void set_cname (string! cname) {
+ private void set_cname (string cname) {
this.cname = cname;
}
- private void set_const_cname (string! cname) {
+ private void set_const_cname (string cname) {
this.const_cname = cname;
}
- public override string! get_lower_case_cprefix () {
+ public override string get_lower_case_cprefix () {
if (lower_case_cprefix == null) {
lower_case_cprefix = "%s_".printf (get_lower_case_cname (null));
}
return rank;
}
- private void process_ccode_attribute (Attribute! a) {
+ private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("cname")) {
set_cname (a.get_string ("cname"));
}
}
}
- private void process_integer_type_attribute (Attribute! a) {
+ private void process_integer_type_attribute (Attribute a) {
integer_type = true;
if (a.has_argument ("rank")) {
rank = a.get_integer ("rank");
}
}
- private void process_floating_type_attribute (Attribute! a) {
+ private void process_floating_type_attribute (Attribute a) {
floating_type = true;
if (a.has_argument ("rank")) {
rank = a.get_integer ("rank");
return type_id;
}
- public void set_type_id (string! name) {
+ public void set_type_id (string name) {
this.type_id = name;
}
return marshaller_type_name;
}
- private void set_marshaller_type_name (string! name) {
+ private void set_marshaller_type_name (string name) {
this.marshaller_type_name = name;
}
}
}
- private void set_get_value_function (string! function) {
+ private void set_get_value_function (string function) {
get_value_function = function;
}
- private void set_set_value_function (string! function) {
+ private void set_set_value_function (string function) {
set_value_function = function;
}
return null;
}
- private void set_default_value (string! value) {
+ private void set_default_value (string value) {
default_value = value;
}
*
* @param type a class or interface reference
*/
- public void add_base_type (DataType! type) {
+ public void add_base_type (DataType type) {
base_types.add (type);
type.parent_node = this;
}
return new ReadOnlyCollection<DataType> (base_types);
}
- public override int get_type_parameter_index (string! name) {
+ public override int get_type_parameter_index (string name) {
int i = 0;
foreach (TypeParameter p in type_parameters) {
this.simple_type = simple_type;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
for (int i = 0; i < base_types.size; i++) {
if (base_types[i] == old_type) {
base_types[i] = new_type;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
if (expression != null) {
expression.accept (visitor);
*
* @param label a switch label
*/
- public void add_label (SwitchLabel! label) {
+ public void add_label (SwitchLabel label) {
labels.add (label);
}
*
* @param stmt a statement
*/
- public void add_statement (Statement! stmt) {
+ public void add_statement (Statement stmt) {
statement_list.add (stmt);
}
return new ReadOnlyCollection<Statement> (statement_list);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_switch_section (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
foreach (SwitchLabel label in labels) {
label.accept (visitor);
}
/**
* Specifies the switch expression.
*/
- public Expression! expression {
+ public Expression expression {
get {
return _expression;
}
}
}
- private Expression! _expression;
+ private Expression _expression;
private Gee.List<SwitchSection> sections = new ArrayList<SwitchSection> ();
/**
* @param source_reference reference to source code
* @return newly created switch statement
*/
- public SwitchStatement (construct Expression! expression, construct SourceReference source_reference) {
+ public SwitchStatement (construct Expression expression, construct SourceReference source_reference) {
}
/**
*
* @param section a switch section
*/
- public void add_section (SwitchSection! section) {
+ public void add_section (SwitchSection section) {
section.parent_node = this;
sections.add (section);
}
return new ReadOnlyCollection<SwitchSection> (sections);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
expression.accept (visitor);
visitor.visit_end_full_expression (expression);
visitor.visit_switch_statement (this);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (expression == old_node) {
expression = new_node;
}
*
* @return the camel case prefix to be used in C code
*/
- public virtual string! get_cprefix () {
+ public virtual string get_cprefix () {
if (name == null) {
return "";
} else {
*
* @return the lower case prefix to be used in C code
*/
- public virtual string! get_lower_case_cprefix () {
+ public virtual string get_lower_case_cprefix () {
return "";
}
* @param camel_case a string in camel case
* @return the specified string converted to lower case
*/
- public static string! camel_case_to_lower_case (string! camel_case) {
- String result = new String ("");
+ public static string camel_case_to_lower_case (string camel_case) {
+ var result = new StringBuilder ("");
weak string i = camel_case;
*
* @param context a code context
*/
- public void resolve (CodeContext! context) {
+ public void resolve (CodeContext context) {
root_symbol = context.root;
current_scope = root_symbol.scope;
context.accept (this);
}
- public override void visit_source_file (SourceFile! file) {
+ public override void visit_source_file (SourceFile file) {
current_using_directives = file.get_using_directives ();
current_scope = root_symbol.scope;
current_using_directives = null;
}
- public override void visit_class (Class! cl) {
+ public override void visit_class (Class cl) {
current_scope = cl.scope;
cl.accept_children (this);
current_scope = current_scope.parent_scope;
}
- public override void visit_struct (Struct! st) {
+ public override void visit_struct (Struct st) {
current_scope = st.scope;
st.accept_children (this);
current_scope = current_scope.parent_scope;
}
- public override void visit_interface (Interface! iface) {
+ public override void visit_interface (Interface iface) {
current_scope = iface.scope;
iface.accept_children (this);
current_scope = current_scope.parent_scope;
}
- public override void visit_enum (Enum! en) {
+ public override void visit_enum (Enum en) {
current_scope = en.scope;
en.accept_children (this);
current_scope = current_scope.parent_scope;
}
- public override void visit_delegate (Delegate! cb) {
+ public override void visit_delegate (Delegate cb) {
current_scope = cb.scope;
cb.accept_children (this);
current_scope = current_scope.parent_scope;
}
- public override void visit_constant (Constant! c) {
+ public override void visit_constant (Constant c) {
current_scope = c.scope;
c.accept_children (this);
}
- public override void visit_field (Field! f) {
+ public override void visit_field (Field f) {
current_scope = f.scope;
f.accept_children (this);
current_scope = current_scope.parent_scope;
}
- public override void visit_method (Method! m) {
+ public override void visit_method (Method m) {
current_scope = m.scope;
m.accept_children (this);
current_scope = current_scope.parent_scope;
}
- public override void visit_creation_method (CreationMethod! m) {
+ public override void visit_creation_method (CreationMethod m) {
m.accept_children (this);
}
- public override void visit_formal_parameter (FormalParameter! p) {
+ public override void visit_formal_parameter (FormalParameter p) {
p.accept_children (this);
}
- public override void visit_property (Property! prop) {
+ public override void visit_property (Property prop) {
prop.accept_children (this);
}
- public override void visit_property_accessor (PropertyAccessor! acc) {
+ public override void visit_property_accessor (PropertyAccessor acc) {
acc.accept_children (this);
}
- public override void visit_signal (Signal! sig) {
+ public override void visit_signal (Signal sig) {
sig.accept_children (this);
}
- public override void visit_constructor (Constructor! c) {
+ public override void visit_constructor (Constructor c) {
c.accept_children (this);
}
- public override void visit_destructor (Destructor! d) {
+ public override void visit_destructor (Destructor d) {
d.accept_children (this);
}
- public override void visit_block (Block! b) {
+ public override void visit_block (Block b) {
b.accept_children (this);
}
- public override void visit_namespace_reference (NamespaceReference! ns) {
+ public override void visit_namespace_reference (NamespaceReference ns) {
ns.namespace_symbol = current_scope.lookup (ns.name);
if (ns.namespace_symbol == null) {
ns.error = true;
}
}
- private DataType! resolve_type (UnresolvedType! unresolved_type) {
+ private DataType resolve_type (UnresolvedType unresolved_type) {
DataType type = null;
// still required for vapigen
return type;
}
- public override void visit_data_type (DataType! data_type) {
+ public override void visit_data_type (DataType data_type) {
if (!(data_type is UnresolvedType)) {
return;
}
unresolved_type.parent_node.replace_type (unresolved_type, resolve_type (unresolved_type));
}
- public override void visit_variable_declarator (VariableDeclarator! decl) {
+ public override void visit_variable_declarator (VariableDeclarator decl) {
decl.accept_children (this);
}
- public override void visit_initializer_list (InitializerList! list) {
+ public override void visit_initializer_list (InitializerList list) {
list.accept_children (this);
}
- public override void visit_if_statement (IfStatement! stmt) {
+ public override void visit_if_statement (IfStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_switch_section (SwitchSection! section) {
+ public override void visit_switch_section (SwitchSection section) {
section.accept_children (this);
}
- public override void visit_while_statement (WhileStatement! stmt) {
+ public override void visit_while_statement (WhileStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_do_statement (DoStatement! stmt) {
+ public override void visit_do_statement (DoStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_for_statement (ForStatement! stmt) {
+ public override void visit_for_statement (ForStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_foreach_statement (ForeachStatement! stmt) {
+ public override void visit_foreach_statement (ForeachStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_return_statement (ReturnStatement! stmt) {
+ public override void visit_return_statement (ReturnStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_throw_statement (ThrowStatement! stmt) {
+ public override void visit_throw_statement (ThrowStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_try_statement (TryStatement! stmt) {
+ public override void visit_try_statement (TryStatement stmt) {
stmt.accept_children (this);
}
- public override void visit_catch_clause (CatchClause! clause) {
+ public override void visit_catch_clause (CatchClause clause) {
clause.accept_children (this);
}
- public override void visit_array_creation_expression (ArrayCreationExpression! e) {
+ public override void visit_array_creation_expression (ArrayCreationExpression e) {
e.accept_children (this);
}
- public override void visit_parenthesized_expression (ParenthesizedExpression! expr) {
+ public override void visit_parenthesized_expression (ParenthesizedExpression expr) {
expr.accept_children (this);
}
- public override void visit_invocation_expression (InvocationExpression! expr) {
+ public override void visit_invocation_expression (InvocationExpression expr) {
expr.accept_children (this);
}
- public override void visit_object_creation_expression (ObjectCreationExpression! expr) {
+ public override void visit_object_creation_expression (ObjectCreationExpression expr) {
expr.accept_children (this);
}
- public override void visit_lambda_expression (LambdaExpression! l) {
+ public override void visit_lambda_expression (LambdaExpression l) {
l.accept_children (this);
}
- public override void visit_assignment (Assignment! a) {
+ public override void visit_assignment (Assignment a) {
a.accept_children (this);
}
}
}
}
- private Expression! _error_expression;
+ private Expression _error_expression;
/**
* Creates a new throw statement.
* @param source_reference reference to source code
* @return newly created throw statement
*/
- public ThrowStatement (construct Expression! error_expression, construct SourceReference source_reference = null) {
+ public ThrowStatement (construct Expression error_expression, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_throw_statement (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (error_expression != null) {
error_expression.accept (visitor);
}
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (error_expression == old_node) {
error_expression = new_node;
}
/**
* Specifies the body of the try statement.
*/
- public Block! body { get; set; }
+ public Block body { get; set; }
/**
* Specifies the body of the optional finally clause.
* @param source_reference reference to source code
* @return newly created try statement
*/
- public TryStatement (construct Block! body, construct Block finally_body, construct SourceReference source_reference = null) {
+ public TryStatement (construct Block body, construct Block finally_body, construct SourceReference source_reference = null) {
}
/**
*
* @param clause a catch clause
*/
- public void add_catch_clause (CatchClause! clause) {
+ public void add_catch_clause (CatchClause clause) {
catch_clauses.add (clause);
}
return new ReadOnlyList<CatchClause> (catch_clauses);
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_try_statement (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
body.accept (visitor);
foreach (CatchClause clause in catch_clauses) {
/**
* The expression to be checked.
*/
- public Expression! expression { get; set construct; }
+ public Expression expression { get; set construct; }
/**
* The type to be matched against.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
* @param source reference to source code
* @return newly created type check expression
*/
- public TypeCheck (Expression! expr, DataType! type, SourceReference source) {
+ public TypeCheck (Expression expr, DataType type, SourceReference source) {
expression = expr;
type_reference = type;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
expression.accept (visitor);
type_reference.accept (visitor);
return expression.is_pure ();
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
/**
* The type to be retrieved.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
* @param source reference to source code
* @return newly created typeof expression
*/
- public TypeofExpression (DataType! type, SourceReference source) {
+ public TypeofExpression (DataType type, SourceReference source) {
type_reference = type;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
type_reference.accept (visitor);
visitor.visit_typeof_expression (this);
return true;
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
* @param source reference to source code
* @return newly created generic type parameter
*/
- public TypeParameter (string! _name, SourceReference source) {
+ public TypeParameter (string _name, SourceReference source) {
name = _name;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_type_parameter (this);
}
* @return true if this type parameter is equal to param2, false
* otherwise
*/
- public bool equals (TypeParameter! param2) {
+ public bool equals (TypeParameter param2) {
// FIXME check whether the corresponding data type of one of the
// parameters is a base type of the corresponding data
// type of the other parameter and check along the path
*
* @param filename a C header filename
*/
- public void add_cheader_filename (string! filename) {
+ public void add_cheader_filename (string filename) {
cheader_filenames.add (filename);
}
* @param t a data type
* @return true if t is a supertype of this data type, false otherwise
*/
- public virtual bool is_subtype_of (Typesymbol! t) {
+ public virtual bool is_subtype_of (Typesymbol t) {
return (this == t);
}
/**
* Return the index of the specified type parameter name.
*/
- public virtual int get_type_parameter_index (string! name) {
+ public virtual int get_type_parameter_index (string name) {
return -1;
}
}
/**
* The operand.
*/
- public Expression! inner {
+ public Expression inner {
get {
return _inner;
}
}
}
- private Expression! _inner;
+ private Expression _inner;
/**
* Creates a new unary expression.
* @param source reference to source code
* @return newly created binary expression
*/
- public UnaryExpression (UnaryOperator op, Expression! _inner, SourceReference source) {
+ public UnaryExpression (UnaryOperator op, Expression _inner, SourceReference source) {
operator = op;
inner = _inner;
source_reference = source;
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
inner.accept (visitor);
visitor.visit_unary_expression (this);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
}
}
- private string! get_operator_string () {
+ private string get_operator_string () {
switch (_operator) {
case UnaryOperator.PLUS: return "+";
case UnaryOperator.MINUS: return "-";
assert_not_reached ();
}
- public override string! to_string () {
+ public override string to_string () {
return get_operator_string () + _inner.to_string ();
}
* @param source reference to source code
* @return newly created type reference
*/
- public static UnresolvedType new_from_expression (Expression! expr) {
+ public static UnresolvedType new_from_expression (Expression expr) {
string ns = null;
string type_name = null;
if (expr is MemberAccess) {
return null;
}
- public override DataType! copy () {
+ public override DataType copy () {
var result = new UnresolvedType ();
result.source_reference = source_reference;
result.transfers_ownership = transfers_ownership;
*/
public weak Typesymbol type_symbol { get; set; }
- public ValueType (construct Typesymbol! type_symbol) {
+ public ValueType (construct Typesymbol type_symbol) {
data_type = type_symbol;
}
/**
* The variable type.
*/
- public DataType! type_reference {
+ public DataType type_reference {
get { return _data_type; }
set {
_data_type = value;
* @param source reference to source code
* @return newly created variable declarator
*/
- public VariableDeclarator (construct string! name, construct Expression initializer = null, construct SourceReference source_reference = null) {
+ public VariableDeclarator (construct string name, construct Expression initializer = null, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_variable_declarator (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
if (initializer != null) {
initializer.accept (visitor);
}
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (initializer == old_node) {
initializer = new_node;
}
}
- public override void replace_type (DataType! old_type, DataType! new_type) {
+ public override void replace_type (DataType old_type, DataType new_type) {
if (type_reference == old_type) {
type_reference = new_type;
}
public VoidType () {
}
- public override bool stricter (DataType! type2) {
+ public override bool stricter (DataType type2) {
return (type2 is VoidType);
}
- public override string! to_string () {
+ public override string to_string () {
return "void";
}
/**
* Specifies the loop condition.
*/
- public Expression! condition {
+ public Expression condition {
get {
return _condition;
}
}
}
- private Expression! _condition;
+ private Expression _condition;
private Block _body;
/**
* @param source reference to source code
* @return newly created while statement
*/
- public WhileStatement (construct Expression! condition, construct Block! body, construct SourceReference source_reference = null) {
+ public WhileStatement (construct Expression condition, construct Block body, construct SourceReference source_reference = null) {
}
- public override void accept (CodeVisitor! visitor) {
+ public override void accept (CodeVisitor visitor) {
visitor.visit_while_statement (this);
}
- public override void accept_children (CodeVisitor! visitor) {
+ public override void accept_children (CodeVisitor visitor) {
condition.accept (visitor);
visitor.visit_end_full_expression (condition);
body.accept (visitor);
}
- public override void replace_expression (Expression! old_node, Expression! new_node) {
+ public override void replace_expression (Expression old_node, Expression new_node) {
if (condition == old_node) {
condition = new_node;
}
public void rectangle (double x, double y, double width, double height);
public void glyph_path (Glyph[] glyphs);
- public void text_path (string! utf8);
+ public void text_path (string utf8);
public void rel_curve_to (double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
public void rel_line_to (double dx, double dy);
public void device_to_user (ref double x, ref double y);
public void device_to_user_distance (ref double dx, ref double dy);
- public void select_font_face (string! family, FontSlant slant, FontWeight weight);
+ public void select_font_face (string family, FontSlant slant, FontWeight weight);
public void set_font_size (double size);
public void set_font_matrix (Matrix matrix);
public void get_font_matrix (out Matrix matrix);
- public void set_font_options (ref FontOptions! options);
+ public void set_font_options (ref FontOptions options);
public void get_font_options (ref FontOptions options);
- public void show_text (string! utf8);
+ public void show_text (string utf8);
public void show_glyphs (Glyph[] glyphs);
public weak FontFace get_font_face ();
public void font_extents (ref FontExtents extents);
public void set_font_face (FontFace font_face);
- public void set_scaled_font (ScaledFont! font);
- public void text_extents (string! utf8, ref TextExtents extents);
+ public void set_scaled_font (ScaledFont font);
+ public void text_extents (string utf8, ref TextExtents extents);
public void glyph_extents (Glyph[] glyphs, ref TextExtents extents);
}
[CCode (cname = "cairo_pattern_create_rgba")]
public Pattern.rgba (double red, double green, double blue, double alpha);
[CCode (cname = "cairo_pattern_create_for_surface")]
- public Pattern.for_surface (Surface! surface);
+ public Pattern.for_surface (Surface surface);
[CCode (cname = "cairo_pattern_create_linear")]
public Pattern.linear (double x0, double y0, double x1, double y1);
[CCode (cname = "cairo_pattern_create_radial")]
public ScaledFont (Matrix font_matrix, Matrix ctm, ref FontOptions options);
public Status status ();
public void extents (ref FontExtents extents);
- public void text_extents (string! utf8, ref TextExtents extents);
+ public void text_extents (string utf8, ref TextExtents extents);
public void glyph_extents (Glyph[] glyphs, ref TextExtents extents);
public weak FontFace get_font_face ();
public void get_font_options (ref FontOptions options);
[CCode (ref_function = "cairo_surface_reference", unref_function = "cairo_surface_destroy", cname = "cairo_surface_t", cheader_filename = "cairo.h")]
public class Surface {
[CCode (cname = "cairo_surface_create_similar")]
- public Surface.similar (Surface! other, Content content, int width, int height);
+ public Surface.similar (Surface other, Content content, int width, int height);
public void finish ();
public void flush ();
public void get_font_options (ref FontOptions options);
public Status status ();
public SurfaceType get_type ();
- public Status write_to_png (string! filename);
+ public Status write_to_png (string filename);
public Status write_to_png_stream (WriteFunc write_func, pointer closure);
}
public int get_stride ();
[CCode (cname = "cairo_image_surface_create_from_png")]
- public ImageSurface.from_png (string! filename);
+ public ImageSurface.from_png (string filename);
[CCode (cname = "cairo_image_surface_create_from_png_stream")]
public ImageSurface.from_png_stream (ReadFunc read_func, pointer closure);
}
[CCode (cname = "cairo_surface_t", cheader_filename = "cairo-pdf.h")]
public class PdfSurface : Surface {
[CCode (cname = "cairo_pdf_surface_create")]
- public PdfSurface (string! filename, double width_in_points, double height_in_points);
+ public PdfSurface (string filename, double width_in_points, double height_in_points);
[CCode (cname = "cairo_pdf_surface_create_for_stream")]
public PdfSurface.for_stream (WriteFunc write_func, pointer closure, double width_in_points, double height_in_points);
public void set_size (double width_in_points, double height_in_points);
[CCode (cname = "cairo_surface_t", cheader_filename = "cairo-ps.h")]
public class PsSurface : Surface {
[CCode (cname = "cairo_ps_surface_create")]
- public PsSurface (string! filename, double width_in_points, double height_in_points);
+ public PsSurface (string filename, double width_in_points, double height_in_points);
[CCode (cname = "cairo_ps_surface_create_for_stream")]
public PsSurface.for_stream (WriteFunc write_func, pointer closure, double width_in_points, double height_in_points);
public void set_size (double width_in_points, double height_in_points);
public void dsc_begin_setup ();
public void dsc_begin_page_setup ();
- public void dsc_comment (string! comment);
+ public void dsc_comment (string comment);
}
[CCode (cname = "cairo_surface_t", cheader_filename = "cairo-svg.h")]
public class SvgSurface : Surface {
[CCode (cname = "cairo_svg_surface_create")]
- public SvgSurface (string! filename, double width_in_points, double height_in_points);
+ public SvgSurface (string filename, double width_in_points, double height_in_points);
[CCode (cname = "cairo_svg_surface_create_for_stream")]
public SvgSurface.for_stream (WriteFunc write_func, pointer closure, double width_in_points, double height_in_points);
public void restrict_to_version (SvgVersion version);
}
public int version ();
- public weak string! version_string ();
+ public weak string version_string ();
}
public struct char {
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%hhi");
+ public string to_string (string format = "%hhi");
public bool isalnum ();
public bool isalpha ();
public bool iscntrl ();
public struct uchar {
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%hhu");
+ public string to_string (string format = "%hhu");
}
[SimpleType]
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%i");
+ public string to_string (string format = "%i");
[CCode (cname = "CLAMP")]
public int clamp (int low, int high);
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%u");
+ public string to_string (string format = "%u");
[CCode (cname = "CLAMP")]
public uint clamp (uint low, uint high);
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%hi");
+ public string to_string (string format = "%hi");
}
[SimpleType]
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%hu");
+ public string to_string (string format = "%hu");
}
[SimpleType]
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%li");
+ public string to_string (string format = "%li");
}
[SimpleType]
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%lu");
+ public string to_string (string format = "%lu");
}
[SimpleType]
[InstanceLast]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%zu");
+ public string to_string (string format = "%zu");
[CCode (cname = "GSIZE_TO_POINTER")]
public pointer to_pointer ();
[InstanceLast]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%zi");
+ public string to_string (string format = "%zi");
}
[SimpleType]
public static int8 MAX;
[CCode (cname = "g_strdup_printf", instance_pos = -1), InstanceLast]
- public string! to_string (string! format = "%hhi");
+ public string to_string (string format = "%hhi");
}
[SimpleType]
public static uint8 MAX;
[CCode (cname = "g_strdup_printf", instance_pos = -1), InstanceLast]
- public string! to_string (string! format = "%hhu");
+ public string to_string (string format = "%hhu");
}
[SimpleType]
public static int16 MAX;
[CCode (cname = "g_strdup_printf", instance_pos = -1), InstanceLast]
- public string! to_string (string! format = "%hi");
+ public string to_string (string format = "%hi");
}
[SimpleType]
public static uint16 MAX;
[CCode (cname = "g_strdup_printf", instance_pos = -1), InstanceLast]
- public string! to_string (string! format = "%hu");
+ public string to_string (string format = "%hu");
}
[SimpleType]
public static int32 MAX;
[CCode (cname = "g_strdup_printf", instance_pos = -1), InstanceLast]
- public string! to_string (string! format = "%i");
+ public string to_string (string format = "%i");
}
[SimpleType]
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%u");
+ public string to_string (string format = "%u");
}
[SimpleType]
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%lli");
+ public string to_string (string format = "%lli");
}
[SimpleType]
[InstanceLast ()]
[CCode (cname = "g_strdup_printf", instance_pos = -1)]
- public string! to_string (string! format = "%llu");
+ public string to_string (string format = "%llu");
}
[SimpleType]
public int is_infinity ();
[CCode (cname = "g_strdup_printf", instance_pos = -1), InstanceLast]
- public string! to_string (string! format = "%g");
+ public string to_string (string format = "%g");
}
[SimpleType]
public int is_infinity ();
[CCode (cname = "g_strdup_printf", instance_pos = -1), InstanceLast]
- public string! to_string (string! format = "%g");
+ public string to_string (string format = "%g");
}
[SimpleType]
[CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "G_TYPE_STRING", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string")]
public class string {
[CCode (cname = "strstr")]
- public weak string str (string! needle);
+ public weak string? str (string needle);
[CCode (cname = "g_str_has_prefix")]
- public bool has_prefix (string! prefix);
+ public bool has_prefix (string prefix);
[CCode (cname = "g_str_has_suffix")]
- public bool has_suffix (string! suffix);
+ public bool has_suffix (string suffix);
[CCode (cname = "g_strdup_printf"), PrintfFormat]
public string printf (...);
[CCode (cname = "sscanf", cheader_filename = "stdio.h")]
public string compress ();
[CCode (cname = "g_strsplit")]
[NoArrayLength]
- public string[] split (string! delimiter, int max_tokens = 0);
+ public string[] split (string delimiter, int max_tokens = 0);
[CCode (cname = "g_strsplit_set")]
[NoArrayLength]
- public string[] split_set (string! delimiters, int max_tokens = 0);
+ public string[] split_set (string delimiters, int max_tokens = 0);
[CCode (cname = "g_strjoinv")]
[NoArrayLength]
- public static string joinv (string! separator, string[] str_array);
+ public static string joinv (string separator, string[] str_array);
[CCode (cname = "g_strnfill")]
- public static string! nfill (ulong length, char fill_char);
+ public static string nfill (ulong length, char fill_char);
[CCode (cname = "g_utf8_next_char")]
public weak string next_char ();
[CCode (cname = "g_utf8_strrchr")]
public weak string rchr (long len, unichar c);
[CCode (cname = "g_utf8_strreverse")]
- public string! reverse (int len = -1);
+ public string reverse (int len = -1);
[CCode (cname = "g_utf8_validate")]
public bool validate (long max_len = -1, out string end = null);
public int collate (string str2);
[CCode (cname = "g_locale_to_utf8")]
- public string! locale_to_utf8 (long len, out ulong bytes_read, out ulong bytes_written, out GLib.Error error = null);
+ public string locale_to_utf8 (long len, out ulong bytes_read, out ulong bytes_written, out GLib.Error error = null);
[CCode (cname = "g_strchomp")]
public weak string chomp();
[CCode (cname = "g_utf8_skip")]
public static char[] skip;
- public string! substring (long offset, long len);
+ public string substring (long offset, long len);
}
[Import ()]
public Type[] children ();
public uint depth ();
- public static Type from_name (string! name);
+ public static Type from_name (string name);
public Type[] interfaces ();
public bool is_a (Type is_a_type);
- public weak string! name ();
+ public weak string name ();
public Quark qname ();
public Type parent ();
public class TypeModule : TypePlugin {
public bool use ();
public void unuse ();
- public void set_name (string! name);
+ public void set_name (string name);
}
[CCode (ref_function = "g_param_spec_ref", unref_function = "g_param_spec_unref")]
[CCode (lower_case_csuffix = "object_class")]
public class ObjectClass : TypeClass {
- public weak ParamSpec find_property (string! property_name);
+ public weak ParamSpec find_property (string property_name);
public weak ParamSpec[] list_properties ();
}
public Object ref_sink ();
public void get (...);
public void set (...);
- public void get_property (string! property_name, Value value);
- public pointer get_data (string! key);
- public void set_data (string! key, pointer data);
- public void set_data_full (string! key, pointer data, DestroyNotify destroy);
- public pointer steal_data (string! key);
+ public void get_property (string property_name, Value value);
+ public pointer get_data (string key);
+ public void set_data (string key, pointer data);
+ public void set_data_full (string key, pointer data, DestroyNotify destroy);
+ public pointer steal_data (string key);
public pointer get_qdata (Quark quark);
public void set_qdata (Quark quark, pointer data);
public void set_qdata_full (Quark quark, pointer data, DestroyNotify destroy);
public signal void notify (ParamSpec pspec);
- public weak Object connect (string! signal_spec, ...);
+ public weak Object connect (string signal_spec, ...);
}
public struct Parameter {
public static bool supported ();
public static string build_path (string directory, string module_name);
public static Module open (string file_name, ModuleFlags @flags);
- public bool symbol (string! symbol_name, out pointer symbol);
+ public bool symbol (string symbol_name, out pointer symbol);
public weak string name ();
public void make_resident ();
public static weak string error ();
public IOStatus read_chars (char[] buf, out size_t bytes_read) throws ConvertError, IOChannelError;
public IOStatus read_unichar (out unichar thechar) throws ConvertError, IOChannelError;
public IOStatus read_line (out string str_return, out size_t length, out size_t terminator_pos) throws ConvertError, IOChannelError;
- public IOStatus read_line_string (String buffer, out size_t terminator_pos) throws ConvertError, IOChannelError;
+ public IOStatus read_line_string (StringBuilder buffer, out size_t terminator_pos) throws ConvertError, IOChannelError;
public IOStatus read_to_end (out string str_return, out size_t length) throws ConvertError, IOChannelError;
public IOStatus write_chars (char[] buf, out size_t bytes_written) throws ConvertError, IOChannelError;
public IOStatus write_unichar (unichar thechar) throws ConvertError, IOChannelError;
[ErrorBase]
[CCode (copy_function = "g_error_copy", free_function = "g_error_free")]
public class Error {
- public Error (Quark domain, int code, string! format, ...);
+ public Error (Quark domain, int code, string format, ...);
public Error copy ();
public bool matches (Quark domain, int code);
/* Character Set Conversions */
- public static string convert (string! str, long len, string! to_codeset, string! from_codeset, out int bytes_read = null, out int bytes_written = null) throws ConvertError;
+ public static string convert (string str, long len, string to_codeset, string from_codeset, out int bytes_read = null, out int bytes_written = null) throws ConvertError;
public struct IConv {
[CCode (cname = "g_iconv_open")]
}
public static class Filename {
- public static string to_utf8 (string! opsysstring, out ulong bytes_read, out ulong bytes_written) throws ConvertError;
- public static string from_utf8 (string! utf8string, long len, out ulong bytes_read, out ulong bytes_written) throws ConvertError;
- public static string from_uri (string! uri, out string hostname = null) throws ConvertError;
- public static string to_uri (string! filename, string hostname = null) throws ConvertError;
- public static string display_name (string! filename);
- public static string display_basename (string! filename);
+ public static string to_utf8 (string opsysstring, out ulong bytes_read, out ulong bytes_written) throws ConvertError;
+ public static string from_utf8 (string utf8string, long len, out ulong bytes_read, out ulong bytes_written) throws ConvertError;
+ public static string from_uri (string uri, out string hostname = null) throws ConvertError;
+ public static string to_uri (string filename, string hostname = null) throws ConvertError;
+ public static string display_name (string filename);
+ public static string display_basename (string filename);
}
public errordomain ConvertError {
[CCode (instance_pos = -1)]
public bool from_iso8601 (string iso_date);
[InstanceByReference]
- public string! to_iso8601 ();
+ public string to_iso8601 ();
}
public struct DateDay : uchar {
public void set_dmy (DateDay day, DateMonth month, DateYear y);
public void set_julian (uint julian_day);
public void set_time_val (TimeVal timeval);
- public void set_parse (string! str);
+ public void set_parse (string str);
public void add_days (uint n_days);
public void subtract_days (uint n_days);
public void add_months (uint n_months);
public void subtract_months (uint n_months);
public void add_years (uint n_years);
public void subtract_years (uint n_years);
- public int days_between (Date! date2);
- public int compare (Date! rhs);
+ public int days_between (Date date2);
+ public int compare (Date rhs);
public void clamp (Date min_date, Date max_date);
- public void order (Date! date2);
+ public void order (Date date2);
public DateDay get_day ();
public DateMonth get_month ();
public DateYear get_year ();
public static class Environment {
[CCode (cname = "g_get_application_name")]
- public static weak string get_application_name ();
+ public static weak string? get_application_name ();
[CCode (cname = "g_set_application_name")]
public static void set_application_name (string application_name);
[CCode (cname = "g_get_prgname")]
[CCode (cname = "g_set_prgname")]
public static void set_prgname (string application_name);
[CCode (cname = "g_getenv")]
- public static weak string get_variable (string! variable);
+ public static weak string? get_variable (string variable);
[CCode (cname = "g_setenv")]
- public static bool set_variable (string! variable, string! value, bool overwrite);
+ public static bool set_variable (string variable, string value, bool overwrite);
[CCode (cname = "g_listenv")]
[NoArrayLength]
public static string[] list_variables ();
[CCode (cname = "g_get_system_config_dirs"), NoArrayLength]
public static weak string[] get_system_config_dirs ();
[CCode (cname = "g_get_host_name")]
- public static weak string! get_host_name ();
+ public static weak string get_host_name ();
[CCode (cname = "g_get_home_dir")]
public static weak string get_home_dir ();
[CCode (cname = "g_get_current_dir")]
}
public static class Path {
- public static bool is_absolute (string! file_name);
- public static weak string skip_root (string! file_name);
+ public static bool is_absolute (string file_name);
+ public static weak string skip_root (string file_name);
public static string get_basename (string file_name);
public static string get_dirname (string file_name);
[CCode (cname = "g_build_filename")]
public static bool spawn_async (string working_directory, string[] argv, string[] envp, SpawnFlags _flags, SpawnChildSetupFunc child_setup, pointer user_data, out Pid child_pid) throws SpawnError;
[NoArrayLength ()]
public static bool spawn_sync (string working_directory, string[] argv, string[] envp, SpawnFlags _flags, SpawnChildSetupFunc child_setup, pointer user_data, out string standard_output = null, out string standard_error = null, out int exit_status = null) throws SpawnError;
- public static bool spawn_command_line_async (string! command_line) throws SpawnError;
- public static bool spawn_command_line_sync (string! command_line, out string standard_output = null, out string standard_error = null, out int exit_status = null) throws SpawnError;
+ public static bool spawn_command_line_async (string command_line) throws SpawnError;
+ public static bool spawn_command_line_sync (string command_line, out string standard_output = null, out string standard_error = null, out int exit_status = null) throws SpawnError;
[CCode (cname = "g_spawn_close_pid")]
public static void close_pid (Pid pid);
[CCode (cprefix = "g_file_", cheader_filename = "glib/gstdio.h")]
public static class FileUtils {
- public static bool get_contents (string! filename, out string contents, out ulong length = null) throws FileError;
- public static bool set_contents (string! filename, string contents, long length = -1) throws FileError;
+ public static bool get_contents (string filename, out string contents, out ulong length = null) throws FileError;
+ public static bool set_contents (string filename, string contents, long length = -1) throws FileError;
public static bool test (string filename, FileTest test);
public static int open_tmp (string tmpl, out string name_used) throws FileError;
public static string read_link (string filename) throws FileError;
public static int chmod (string filename, int mode);
[CCode (cname = "symlink")]
- public static int symlink (string! oldpath, string! newpath);
+ public static int symlink (string oldpath, string newpath);
}
[CCode (cname = "stat")]
}
public static class Shell {
- public static bool parse_argv (string! command_line, [CCode (array_length_pos = 1.9)] out string[] argvp) throws ShellError;
- public static string! quote (string! unquoted_string);
- public static string! unquote (string! quoted_string) throws ShellError;
+ public static bool parse_argv (string command_line, [CCode (array_length_pos = 1.9)] out string[] argvp) throws ShellError;
+ public static string quote (string unquoted_string);
+ public static string unquote (string quoted_string) throws ShellError;
}
/* Commandline option parser */
[CCode (ref_function = "g_regex_ref", unref_function = "g_regex_unref")]
public class Regex : Boxed {
- public Regex (string! pattern, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0) throws RegexError;
- public string! get_pattern ();
+ public Regex (string pattern, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0) throws RegexError;
+ public string get_pattern ();
public int get_max_backref ();
public int get_capture_count ();
- public int get_string_number (string! name);
- public static string! escape_string (string! str, int length = -1);
- public static bool match_simple (string! pattern, string! str, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
- public bool match (string! str, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
- public bool match_full (string! str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
- public bool match_all (string! str, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
- public bool match_all_full (string! str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
+ public int get_string_number (string name);
+ public static string escape_string (string str, int length = -1);
+ public static bool match_simple (string pattern, string str, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
+ public bool match (string str, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
+ public bool match_full (string str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
+ public bool match_all (string str, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
+ public bool match_all_full (string str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
[NoArrayLength]
- public static string[] split_simple (string! pattern, string! str, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
+ public static string[] split_simple (string pattern, string str, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
[NoArrayLength]
- public string[] split (string! str, RegexMatchFlags match_options = 0);
+ public string[] split (string str, RegexMatchFlags match_options = 0);
[NoArrayLength]
- public bool split_full (string! str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, int max_tokens = 0) throws RegexError;
- public string replace (string! str, long string_len, int start_position, string! replacement, RegexMatchFlags match_options = 0) throws RegexError;
- public string replace_literal (string! str, long string_len, int start_position, string! replacement, RegexMatchFlags match_options = 0) throws RegexError;
- public string replace_eval (string! str, long string_len, int start_position, RegexMatchFlags match_options = 0, RegexEvalCallback eval, pointer user_data) throws RegexError;
+ public bool split_full (string str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, int max_tokens = 0) throws RegexError;
+ public string replace (string str, long string_len, int start_position, string replacement, RegexMatchFlags match_options = 0) throws RegexError;
+ public string replace_literal (string str, long string_len, int start_position, string replacement, RegexMatchFlags match_options = 0) throws RegexError;
+ public string replace_eval (string str, long string_len, int start_position, RegexMatchFlags match_options = 0, RegexEvalCallback eval, pointer user_data) throws RegexError;
public static bool check_replacement (out bool has_references = null) throws RegexError;
}
- public static delegate bool RegexEvalCallback (MatchInfo match_info, String result, pointer user_data);
+ public static delegate bool RegexEvalCallback (MatchInfo match_info, StringBuilder result, pointer user_data);
[CCode (free_function = "g_match_info_free")]
public class MatchInfo {
public bool next () throws RegexError;
public int get_match_count ();
public bool is_partial_match ();
- public string! expand_references (string! string_to_expand) throws RegexError;
+ public string expand_references (string string_to_expand) throws RegexError;
public string fetch (int match_num);
public bool fetch_pos (int match_num, out int start_pos, out int end_pos);
- public string fetch_named (string! name);
- public bool fetch_named_pos (string! name, out int start_pos, out int end_pos);
+ public string fetch_named (string name);
+ public bool fetch_named_pos (string name, out int start_pos, out int end_pos);
[NoArrayLength]
public string[] fetch_all ();
}
}
public static class Markup {
- public static string! escape_text (string! text, long length = -1);
+ public static string escape_text (string text, long length = -1);
[PrintfFormat]
- public static string! printf_escaped (string! format, ...);
+ public static string printf_escaped (string format, ...);
}
/* Key-value file parser */
public class KeyFile {
public KeyFile ();
public void set_list_separator (char separator);
- public bool load_from_file (string! file, KeyFileFlags @flags) throws KeyFileError;
- public bool load_from_data (string! data, ulong length, KeyFileFlags @flags) throws KeyFileError;
- public bool load_from_data_dirs (string! file, out string full_path, KeyFileFlags @flags) throws KeyFileError;
+ public bool load_from_file (string file, KeyFileFlags @flags) throws KeyFileError;
+ public bool load_from_data (string data, ulong length, KeyFileFlags @flags) throws KeyFileError;
+ public bool load_from_data_dirs (string file, out string full_path, KeyFileFlags @flags) throws KeyFileError;
public string to_data (out ulong length) throws KeyFileError;
public string get_start_group ();
[CCode (array_length_type = "gsize")]
public string[] get_groups ();
[CCode (array_length_type = "gsize")]
- public string[] get_keys (string! group_name) throws KeyFileError;
- public bool has_group (string! group_name);
- public bool has_key (string! group_name, string! key) throws KeyFileError;
- public string get_value (string! group_name, string! key) throws KeyFileError;
- public string get_string (string! group_name, string! key) throws KeyFileError;
- public string get_locale_string (string! group_name, string! key, string! locale) throws KeyFileError;
- public bool get_boolean (string! group_name, string! key) throws KeyFileError;
- public int get_integer (string! group_name, string! key) throws KeyFileError;
- public double get_double (string! group_name, string! key) throws KeyFileError;
+ public string[] get_keys (string group_name) throws KeyFileError;
+ public bool has_group (string group_name);
+ public bool has_key (string group_name, string key) throws KeyFileError;
+ public string get_value (string group_name, string key) throws KeyFileError;
+ public string get_string (string group_name, string key) throws KeyFileError;
+ public string get_locale_string (string group_name, string key, string locale) throws KeyFileError;
+ public bool get_boolean (string group_name, string key) throws KeyFileError;
+ public int get_integer (string group_name, string key) throws KeyFileError;
+ public double get_double (string group_name, string key) throws KeyFileError;
[CCode (array_length_type = "gsize")]
- public string[] get_string_list (string! group_name, string! key) throws KeyFileError;
+ public string[] get_string_list (string group_name, string key) throws KeyFileError;
[CCode (array_length_type = "gsize")]
- public string[] get_locale_string_list (string! group_name, string! key, string! locale) throws KeyFileError;
+ public string[] get_locale_string_list (string group_name, string key, string locale) throws KeyFileError;
[CCode (array_length_type = "gsize")]
- public bool[] get_boolean_list (string! group_name, string! key) throws KeyFileError;
+ public bool[] get_boolean_list (string group_name, string key) throws KeyFileError;
[CCode (array_length_type = "gsize")]
- public int[] get_integer_list (string! group_name, string! key) throws KeyFileError;
+ public int[] get_integer_list (string group_name, string key) throws KeyFileError;
[CCode (array_length_type = "gsize")]
- public double[] get_double_list (string! group_name, string! key) throws KeyFileError;
- public string get_comment (string! group_name, string! key) throws KeyFileError;
- public void set_value (string! group_name, string! key, string! value);
- public void set_string (string! group_name, string! key, string! str);
- public void set_locale_string (string! group_name, string! key, string! locale, string! str);
- public void set_boolean (string! group_name, string! key, bool value);
- public void set_integer (string! group_name, string! key, int value);
- public void set_double (string! group_name, string! key, double value);
- public void set_string_list (string! group_name, string! key, string[] list);
- public void set_locale_string_list (string! group_name, string! key, string! locale, string[] list);
- public void set_boolean_list (string! group_name, string! key, bool[] list);
- public void set_integer_list (string! group_name, string! key, int[] list);
- public void set_double_list (string! group_name, string! key, double[] list);
- public void set_comment (string! group_name, string! key, string! comment);
- public void remove_group (string! group_name) throws KeyFileError;
- public void remove_key (string! group_name, string! key) throws KeyFileError;
- public void remove_comment (string! group_name, string! key) throws KeyFileError;
+ public double[] get_double_list (string group_name, string key) throws KeyFileError;
+ public string get_comment (string group_name, string key) throws KeyFileError;
+ public void set_value (string group_name, string key, string value);
+ public void set_string (string group_name, string key, string str);
+ public void set_locale_string (string group_name, string key, string locale, string str);
+ public void set_boolean (string group_name, string key, bool value);
+ public void set_integer (string group_name, string key, int value);
+ public void set_double (string group_name, string key, double value);
+ public void set_string_list (string group_name, string key, string[] list);
+ public void set_locale_string_list (string group_name, string key, string locale, string[] list);
+ public void set_boolean_list (string group_name, string key, bool[] list);
+ public void set_integer_list (string group_name, string key, int[] list);
+ public void set_double_list (string group_name, string key, double[] list);
+ public void set_comment (string group_name, string key, string comment);
+ public void remove_group (string group_name) throws KeyFileError;
+ public void remove_key (string group_name, string key) throws KeyFileError;
+ public void remove_comment (string group_name, string key) throws KeyFileError;
}
[CCode (cprefix = "G_KEY_FILE_")]
[CCode (free_function = "g_bookmark_file_free")]
public class BookmarkFile {
public BookmarkFile ();
- public bool load_from_file (string! file) throws BookmarkFileError;
- public bool load_from_data (string! data, size_t length) throws BookmarkFileError;
- public bool load_from_data_dirs (string! file, out string full_path) throws BookmarkFileError;
+ public bool load_from_file (string file) throws BookmarkFileError;
+ public bool load_from_data (string data, size_t length) throws BookmarkFileError;
+ public bool load_from_data_dirs (string file, out string full_path) throws BookmarkFileError;
public string to_data (out size_t length) throws BookmarkFileError;
- public bool to_file (string! filename) throws BookmarkFileError;
- public bool has_item (string! uri);
- public bool has_group (string! uri, string! group) throws BookmarkFileError;
- public bool has_application (string! uri, string! name) throws BookmarkFileError;
+ public bool to_file (string filename) throws BookmarkFileError;
+ public bool has_item (string uri);
+ public bool has_group (string uri, string group) throws BookmarkFileError;
+ public bool has_application (string uri, string name) throws BookmarkFileError;
public int get_size ();
public string[] get_uris ();
public string get_title (string uri) throws BookmarkFileError;
public string get_description (string uri) throws BookmarkFileError;
public string get_mime_type (string uri) throws BookmarkFileError;
- public bool get_is_private (string! uri) throws BookmarkFileError;
- public bool get_icon (string! uri, out string href, out string mime_type) throws BookmarkFileError;
- public long get_added (string! uri) throws BookmarkFileError;
- public long get_modified (string! uri) throws BookmarkFileError;
- public long get_visited (string! uri) throws BookmarkFileError;
- public string[] get_groups (string! uri) throws BookmarkFileError;
- public string[] get_applications (string! uri) throws BookmarkFileError;
- public bool get_app_info (string! uri, string! name, out string exec, out uint count, out long stamp) throws BookmarkFileError;
+ public bool get_is_private (string uri) throws BookmarkFileError;
+ public bool get_icon (string uri, out string href, out string mime_type) throws BookmarkFileError;
+ public long get_added (string uri) throws BookmarkFileError;
+ public long get_modified (string uri) throws BookmarkFileError;
+ public long get_visited (string uri) throws BookmarkFileError;
+ public string[] get_groups (string uri) throws BookmarkFileError;
+ public string[] get_applications (string uri) throws BookmarkFileError;
+ public bool get_app_info (string uri, string name, out string exec, out uint count, out long stamp) throws BookmarkFileError;
public void set_title (string uri, string title);
public void set_description (string uri, string description);
public void set_mime_type (string uri, string mime_type);
- public void set_is_private (string! uri, bool is_private);
- public void set_icon (string! uri, string href, string mime_type);
- public void set_added (string! uri, long time_);
- public void set_groups (string! uri, string[] groups);
- public void set_modified (string! uri, long time_);
- public void set_visited (string! uri, long time_);
- public bool set_app_info (string! uri, string! name, string! exec, int count, long time_) throws BookmarkFileError;
- public void add_group (string! uri, string! group);
- public void add_application (string! uri, string! name, string! exec);
- public bool remove_group (string! uri, string! group) throws BookmarkFileError;
- public bool remove_application (string! uri, string! name) throws BookmarkFileError;
- public bool remove_item (string! uri) throws BookmarkFileError;
- public bool move_item (string! old_uri, string! new_uri) throws BookmarkFileError;
+ public void set_is_private (string uri, bool is_private);
+ public void set_icon (string uri, string href, string mime_type);
+ public void set_added (string uri, long time_);
+ public void set_groups (string uri, string[] groups);
+ public void set_modified (string uri, long time_);
+ public void set_visited (string uri, long time_);
+ public bool set_app_info (string uri, string name, string exec, int count, long time_) throws BookmarkFileError;
+ public void add_group (string uri, string group);
+ public void add_application (string uri, string name, string exec);
+ public bool remove_group (string uri, string group) throws BookmarkFileError;
+ public bool remove_application (string uri, string name) throws BookmarkFileError;
+ public bool remove_item (string uri) throws BookmarkFileError;
+ public bool move_item (string old_uri, string new_uri) throws BookmarkFileError;
}
public errordomain BookmarkFileError {
public StringBuilder (string init = "");
[CCode (cname = "g_string_sized_new")]
public StringBuilder.sized (ulong dfl_size);
- public weak StringBuilder assign (string! rval);
- public weak StringBuilder append (string! val);
+ public weak StringBuilder assign (string rval);
+ public weak StringBuilder append (string val);
public weak StringBuilder append_c (char c);
public weak StringBuilder append_unichar (unichar wc);
- public weak StringBuilder append_len (string! val, long len);
- public weak StringBuilder prepend (string! val);
+ public weak StringBuilder append_len (string val, long len);
+ public weak StringBuilder prepend (string val);
public weak StringBuilder prepend_c (char c);
public weak StringBuilder prepend_unichar (unichar wc);
- public weak StringBuilder prepend_len (string! val, long len);
- public weak StringBuilder insert (long pos, string! val);
+ public weak StringBuilder prepend_len (string val, long len);
+ public weak StringBuilder insert (long pos, string val);
public weak StringBuilder erase (long pos, long len);
[PrintfFormat]
- public void printf (string! format, ...);
+ public void printf (string format, ...);
[PrintfFormat]
- public void append_printf (string! format, ...);
+ public void append_printf (string format, ...);
public string str;
public long len;
public long allocated_len;
}
- // will be removed in Vala 0.1.8
- [CCode (free_function = "g_string_free", type_id = "G_TYPE_GSTRING")]
- public class String : Boxed {
- public String (string init = "");
- [CCode (cname = "g_string_sized_new")]
- public String.sized (ulong dfl_size);
- public weak String assign (string! rval);
- public weak String append (string! val);
- public weak String append_c (char c);
- public weak String append_unichar (unichar wc);
- public weak String append_len (string! val, long len);
- public weak String prepend (string! val);
- public weak String prepend_c (char c);
- public weak String prepend_unichar (unichar wc);
- public weak String prepend_len (string! val, long len);
- public weak String insert (long pos, string! val);
- public weak String erase (long pos, long len);
-
- [PrintfFormat]
- public void printf (string! format, ...);
- [PrintfFormat]
- public void append_printf (string! format, ...);
-
- public string str;
- public long len;
- public long allocated_len;
+ // will be removed in Vala 0.3.2
+ public class String {
}
-
+
/* Pointer Arrays */
[CCode (free_function = "g_ptr_array_free")]
public static class Signal {
public static void query (uint signal_id, out SignalQuery query);
- public static uint lookup (string! name, Type itype);
+ public static uint lookup (string name, Type itype);
public static weak string name (uint signal_id);
public static uint[] list_ids (Type itype);
public static void emit (pointer instance, uint signal_id, Quark detail, ...);
- public static void emit_by_name (pointer instance, string! detailed_signal, ...);
- public static ulong connect (pointer instance, string! detailed_signal, Callback! handler, pointer data);
- public static ulong connect_after (pointer instance, string! detailed_signal, Callback! handler, pointer data);
- public static ulong connect_swapped (pointer instance, string! detailed_signal, Callback! handler, pointer data);
- public static ulong connect_object (pointer instance, string! detailed_signal, Callback! handler, Object gobject, ConnectFlags flags);
- public static ulong connect_data (pointer instance, string! detailed_signal, Callback! handler, pointer data, ClosureNotify destroy_data, ConnectFlags flags);
- public static ulong connect_closure (pointer instance, string! detailed_signal, Closure! closure, bool after);
- public static ulong connect_closure_by_id (pointer instance, uint signal_id, Quark detail, Closure! closure, bool after);
+ public static void emit_by_name (pointer instance, string detailed_signal, ...);
+ public static ulong connect (pointer instance, string detailed_signal, Callback handler, pointer data);
+ public static ulong connect_after (pointer instance, string detailed_signal, Callback handler, pointer data);
+ public static ulong connect_swapped (pointer instance, string detailed_signal, Callback handler, pointer data);
+ public static ulong connect_object (pointer instance, string detailed_signal, Callback handler, Object gobject, ConnectFlags flags);
+ public static ulong connect_data (pointer instance, string detailed_signal, Callback handler, pointer data, ClosureNotify destroy_data, ConnectFlags flags);
+ public static ulong connect_closure (pointer instance, string detailed_signal, Closure closure, bool after);
+ public static ulong connect_closure_by_id (pointer instance, uint signal_id, Quark detail, Closure closure, bool after);
public static bool has_handler_pending (pointer instance, uint signal_id, Quark detail, bool may_be_blocked);
public static void stop_emission (pointer instance, uint signal_id, Quark detail);
- public static void stop_emission_by_name (pointer instance, string !detailed_signal);
- public static void override_class_closure (uint signal_id, Type instance_type, Closure! class_closure);
+ public static void stop_emission_by_name (pointer instance, string detailed_signal);
+ public static void override_class_closure (uint signal_id, Type instance_type, Closure class_closure);
[NoArrayLength]
public static void chain_from_overridden (Value[] instance_and_params, out Value return_value);
- public static ulong add_emission_hook (uint signal_id, Quark detail, SignalEmissionHook! hook_func, DestroyNotify data_destroy);
+ public static ulong add_emission_hook (uint signal_id, Quark detail, SignalEmissionHook hook_func, DestroyNotify data_destroy);
public static void remove_emission_hook (uint signal_id, ulong hook_id);
- public static bool parse_name (string !detailed_signal, Type itype, out uint signal_id, out Quark detail, bool force_detail_quark);
+ public static bool parse_name (string detailed_signal, Type itype, out uint signal_id, out Quark detail, bool force_detail_quark);
}
public static class SignalHandler {
}
public class PatternSpec {
- public PatternSpec (string! pattern);
+ public PatternSpec (string pattern);
public void free ();
- public bool equal (PatternSpec! pspec);
+ public bool equal (PatternSpec pspec);
[CCode (cname = "g_pattern_match")]
- public bool match (uint string_length, string! str, string! str_reversed);
+ public bool match (uint string_length, string str, string str_reversed);
[CCode (cname = "g_pattern_match_string")]
- public bool match_string (string! str);
+ public bool match_string (string str);
[CCode (cname = "g_pattern_match_simple")]
- public static bool match_simple (string! pattern, string! str);
+ public static bool match_simple (string pattern, string str);
}
}
*
* @param context a code context
*/
- public void parse (CodeContext! context) {
+ public void parse (CodeContext context) {
cname_type_map = new HashMap<string,Typesymbol> (str_hash, str_equal);
this.context = context;
cname_type_map = null;
}
- public override void visit_namespace (Namespace! ns) {
+ public override void visit_namespace (Namespace ns) {
ns.accept_children (this);
}
- public override void visit_class (Class! cl) {
+ public override void visit_class (Class cl) {
visit_type (cl);
}
- public override void visit_struct (Struct! st) {
+ public override void visit_struct (Struct st) {
visit_type (st);
}
- public override void visit_interface (Interface! iface) {
+ public override void visit_interface (Interface iface) {
visit_type (iface);
}
- public override void visit_enum (Enum! en) {
+ public override void visit_enum (Enum en) {
visit_type (en);
}
- public override void visit_delegate (Delegate! d) {
+ public override void visit_delegate (Delegate d) {
visit_type (d);
}
- private void visit_type (Typesymbol! t) {
+ private void visit_type (Typesymbol t) {
if (!cname_type_map.contains (t.get_cname ())) {
cname_type_map[t.get_cname ()] = t;
}
}
- public override void visit_source_file (SourceFile! source_file) {
+ public override void visit_source_file (SourceFile source_file) {
if (source_file.filename.has_suffix (".gi")) {
parse_file (source_file);
}
}
- private void parse_file (SourceFile! source_file) {
+ private void parse_file (SourceFile source_file) {
string metadata_filename = "%s.metadata".printf (source_file.filename.ndup (source_file.filename.size () - ".gi".size ()));
current_source_file = source_file;
}
}
- private string! fix_type_name (string! type_name, Namespace! ns) {
+ private string fix_type_name (string type_name, Namespace ns) {
var attributes = get_attributes (type_name);
if (attributes != null) {
foreach (string attr in attributes) {
return type_name;
}
- private string! fix_const_name (string! const_name, Namespace! ns) {
+ private string fix_const_name (string const_name, Namespace ns) {
if (const_name.has_prefix (ns.name.up () + "_")) {
return const_name.offset (ns.name.len () + 1);
} else if (ns.name == "GLib" && const_name.has_prefix ("G_")) {
return const_name;
}
- private Namespace parse_module (IdlModule! module) {
+ private Namespace parse_module (IdlModule module) {
Symbol sym = context.root.scope.lookup (module.name);
Namespace ns;
if (sym is Namespace) {
return ns;
}
- private Delegate parse_delegate (IdlNodeFunction! f_node) {
+ private Delegate parse_delegate (IdlNodeFunction f_node) {
weak IdlNode node = (IdlNode) f_node;
var cb = new Delegate (node.name, parse_param (f_node.result), current_source_reference);
return cb;
}
- private bool is_reference_type (string! cname) {
+ private bool is_reference_type (string cname) {
var st_attributes = get_attributes (cname);
if (st_attributes != null) {
foreach (string attr in st_attributes) {
return true;
}
- private void parse_struct (IdlNodeStruct! st_node, Namespace! ns, IdlModule! module) {
+ private void parse_struct (IdlNodeStruct st_node, Namespace ns, IdlModule module) {
weak IdlNode node = (IdlNode) st_node;
if (st_node.deprecated) {
}
}
- private void parse_union (IdlNodeUnion! un_node, Namespace! ns, IdlModule! module) {
+ private void parse_union (IdlNodeUnion un_node, Namespace ns, IdlModule module) {
weak IdlNode node = (IdlNode) un_node;
if (un_node.deprecated) {
}
}
- private void parse_boxed (IdlNodeBoxed! boxed_node, Namespace! ns, IdlModule! module) {
+ private void parse_boxed (IdlNodeBoxed boxed_node, Namespace ns, IdlModule module) {
weak IdlNode node = (IdlNode) boxed_node;
string name = fix_type_name (node.name, ns);
}
}
- private Typesymbol parse_enum (IdlNodeEnum! en_node) {
+ private Typesymbol parse_enum (IdlNodeEnum en_node) {
weak IdlNode node = (IdlNode) en_node;
var en = new Enum (node.name, current_source_reference);
return en;
}
- private void parse_object (IdlNodeInterface! node, Namespace! ns, IdlModule! module) {
+ private void parse_object (IdlNodeInterface node, Namespace ns, IdlModule module) {
string name = fix_type_name (((IdlNode) node).name, ns);
string base_class = null;
current_type_symbol_set = null;
}
- private void parse_interface (IdlNodeInterface! node, Namespace! ns, IdlModule! module) {
+ private void parse_interface (IdlNodeInterface node, Namespace ns, IdlModule module) {
string name = fix_type_name (node.gtype_name, ns);
var iface = ns.scope.lookup (name) as Interface;
current_data_type = null;
}
- private UnresolvedType parse_type (IdlNodeType! type_node) {
+ private UnresolvedType parse_type (IdlNodeType type_node) {
var type = new UnresolvedType ();
if (type_node.tag == TypeTag.VOID) {
if (type_node.is_pointer) {
return type;
}
- private bool is_simple_type (string! type_name) {
+ private bool is_simple_type (string type_name) {
var st = cname_type_map[type_name] as Struct;
if (st != null && st.is_simple_type ()) {
return true;
return false;
}
- private void parse_type_string (UnresolvedType! type, string! n) {
+ private void parse_type_string (UnresolvedType type, string n) {
var dt = cname_type_map[n];
if (dt != null) {
UnresolvedSymbol parent_symbol = null;
}
}
- private UnresolvedType parse_param (IdlNodeParam! param) {
+ private UnresolvedType parse_param (IdlNodeParam param) {
var type = parse_type (param.type);
// disable for now as null_ok not yet correctly set
return false;
}
- private Method parse_function (IdlNodeFunction! f, bool is_interface = false) {
+ private Method parse_function (IdlNodeFunction f, bool is_interface = false) {
weak IdlNode node = (IdlNode) f;
if (f.deprecated) {
return create_method (node.name, f.symbol, f.result, f.parameters, f.is_constructor, is_interface);
}
- private Method parse_virtual (IdlNodeVFunc! v, IdlNodeFunction? func, bool is_interface = false) {
+ private Method parse_virtual (IdlNodeVFunc v, IdlNodeFunction? func, bool is_interface = false) {
weak IdlNode node = (IdlNode) v;
string symbol = "%s%s".printf (current_data_type.get_lower_case_cprefix(), node.name);
return m;
}
- private string! fix_prop_name (string name) {
- var str = new String ();
+ private string fix_prop_name (string name) {
+ var str = new StringBuilder ();
string i = name;
return str.str;
}
- private Property parse_property (IdlNodeProperty! prop_node) {
+ private Property parse_property (IdlNodeProperty prop_node) {
weak IdlNode node = (IdlNode) prop_node;
if (prop_node.deprecated) {
return prop;
}
- private Constant parse_constant (IdlNodeConstant! const_node) {
+ private Constant parse_constant (IdlNodeConstant const_node) {
weak IdlNode node = (IdlNode) const_node;
var type = parse_type (const_node.type);
return c;
}
- private Field parse_field (IdlNodeField! field_node) {
+ private Field parse_field (IdlNodeField field_node) {
weak IdlNode node = (IdlNode) field_node;
var type = parse_type (field_node.type);
}
[NoArrayLength]
- private string[] get_attributes (string! codenode) {
+ private string[] get_attributes (string codenode) {
var attributes = codenode_attributes_map.get (codenode);
if (attributes == null) {
return attributes.split (" ");
}
- private string eval (string! s) {
+ private string eval (string s) {
return s.offset (1).ndup (s.size () - 2);
}
- private Signal parse_signal (IdlNodeSignal! sig_node) {
+ private Signal parse_signal (IdlNodeSignal sig_node) {
weak IdlNode node = (IdlNode) sig_node;
if (sig_node.deprecated || sig_node.result == null) {
using GLib;
class Vala.VAPICheck : Object {
- public VAPICheck (string! gidlname, construct CodeContext! context = new CodeContext ()) {
+ public VAPICheck (string gidlname, construct CodeContext context = new CodeContext ()) {
gidl = new SourceFile (context, gidlname);
metadata = new SourceFile (context, gidlname.substring (0, gidlname.len () - 5) + ".metadata");
}
- public CodeContext! context { get; construct; }
- public SourceFile! gidl { get; construct; }
- public SourceFile! metadata { get; construct; }
+ public CodeContext context { get; construct; }
+ public SourceFile gidl { get; construct; }
+ public SourceFile metadata { get; construct; }
private Gee.List<string> _scope;
private Gee.Set<string> _symbols;
}
}
- private void add_symbol (string! name, string separator = null) {
+ private void add_symbol (string name, string separator = null) {
if (null != separator) {
string fullname = get_scope () + separator + name;
}
}
- private string! get_scope () {
+ private string get_scope () {
return _scope[_scope.size - 1];
}
- private void enter_scope (string! name) {
+ private void enter_scope (string name) {
_scope.add (name);
add_symbol (name);
}
_scope.remove_at (_scope.size - 1);
}
- private void parse_members (string !name, List<IdlNode> members) {
+ private void parse_members (string name, List<IdlNode> members) {
enter_scope (name);
foreach (weak IdlNode node in members) {
}
}
- private bool add_package (string! pkg) {
+ private bool add_package (string pkg) {
if (context.has_package (pkg)) {
// ignore multiple occurences of the same package
return true;