using GLib;
namespace Vala {
+ /**
+ * Represents a part of the parsed source code.
+ *
+ * Code nodes get created by the parser and are used throughout the
+ * whole compilation process.
+ */
public abstract class CodeNode {
+ /**
+ * Symbol that corresponds to this code node.
+ */
public Symbol symbol { get; set; }
+
+ /**
+ * References the location in the source file where this code
+ * node has been written.
+ */
public SourceReference source_reference { get; set; }
+
+ /**
+ * Contains all attributes that have been specified for this
+ * code node.
+ */
public List<Attribute> attributes;
+
+ /**
+ * Generated CCodeNode that corresponds to this code node.
+ */
public CCodeNode ccodenode { get; set; }
+
+ /**
+ * Specifies whether a fatal error has been detected in this
+ * code node.
+ */
public bool error { get; set; }
-
+
+ /**
+ * Visits this code node and all children with the specified
+ * CodeVisitor.
+ *
+ * @param visitor the visitor to be called while traversing
+ */
public abstract void accept (CodeVisitor! visitor);
}
}
using GLib;
namespace Vala {
+ /**
+ * Base class for all code nodes that might be used as an expression.
+ */
public abstract class Expression : CodeNode {
- /* filled by semantic analyzer, used by semantic analyzer,
- * memory manager and code generator
+ /**
+ * The static type of this expression.
+ *
+ * The semantic analyzer computes this value.
*/
public TypeReference static_type { get; set; }
- /* filled by semantic analyzer, used by lambda expressions in
- * semantic analyzer
+ /*
+ * The static type this expression is expected to have.
+ *
+ * The semantic analyzer computes this value, lambda expressions
+ * use it.
*/
public TypeReference expected_type { get; set; }
+ /**
+ * The symbol this expression refers to.
+ */
public Symbol symbol_reference { get; set; }
- /* set by memory manager, used by code generator */
+ /**
+ * Specifies that this expression transfers ownership without a
+ * receiver being present.
+ *
+ * The memory manager computes this value, the code generator
+ * uses it.
+ */
public bool ref_leaked { get; set; }
+
+ /**
+ * Specifies that this expression is expected to transfer
+ * ownership but doesn't.
+ *
+ * The memory manager computes this value, the code generator
+ * uses it.
+ */
public bool ref_missing { get; set; }
- /* set and used by code generator */
+ /**
+ * Contains all temporary variables this expression requires
+ * for execution.
+ *
+ * The code generator sets and uses them for memory management.
+ */
public List<VariableDeclarator> temp_vars;
}
}