CodeNode
Object Hierarchy:
Description:
public abstract class CodeNode
Represents a part of the parsed source code.
Code nodes get created by the parser and are used throughout the whole compilation process.
Content:
Properties:
Static methods:
Creation methods:
Methods:
- public virtual void accept (CodeVisitor visitor)
Visits this code node with the specified CodeVisitor.
- public virtual void accept_children (CodeVisitor visitor)
Visits all children of this code node with the specified CodeVisitor.
- public void add_attribute (Attribute a)
Add attribute and append key/value pairs to an existing one.
- public virtual bool check (CodeContext context)
- public bool copy_attribute_bool (CodeNode source, string attribute, string argument)
Copy the boolean value of the specified attribute argument if
available.
- public bool copy_attribute_double (CodeNode source, string attribute, string argument)
Copy the double value of the specified attribute argument if
available.
- public bool copy_attribute_integer (CodeNode source, string attribute, string argument)
Copy the integer value of the specified attribute argument if
available.
- public bool copy_attribute_string (CodeNode source, string attribute, string argument)
Copy the string value of the specified attribute argument if
available.
- public virtual void emit (CodeGenerator codegen)
- public unowned Attribute? get_attribute (string name)
Returns the specified attribute.
- public bool get_attribute_bool (string attribute, string argument, bool default_value = false)
Returns the bool value of the specified attribute argument.
- public unowned AttributeCache? get_attribute_cache (int index)
Returns the attribute cache at the specified index.
- public double get_attribute_double (string attribute, string argument, double default_value = 0)
Returns the double value of the specified attribute argument.
- public int get_attribute_integer (string attribute, string argument, int default_value = 0)
Returns the integer value of the specified attribute argument.
- public string? get_attribute_string (string attribute, string argument, string? default_value = null)
Returns the string value of the specified attribute argument.
- public virtual void get_defined_variables (Collection<Variable> collection)
- public virtual void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null)
- private unowned Attribute get_or_create_attribute (string name)
- public virtual void get_used_variables (Collection<Variable> collection)
- public bool has_attribute (string attribute)
Returns true if the specified attribute is set.
- public bool has_attribute_argument (string attribute, string argument)
Returns true if the specified attribute argument is set.
- public void remove_attribute_argument (string attribute, string argument)
Remove the specified named attribute argument
- public virtual void replace_expression (Expression old_node, Expression new_node)
- public virtual void replace_type (DataType old_type, DataType new_type)
- public void set_attribute (string name, bool value, SourceReference? source_reference = null)
Sets the specified named attribute to this code node.
- public void set_attribute_bool (string attribute, string argument, bool value, SourceReference? source_reference = null)
Sets the boolean value of the specified attribute argument.
- public void set_attribute_cache (int index, AttributeCache cache)
Sets the specified attribute cache to this code node.
- public void set_attribute_double (string attribute, string argument, double value, SourceReference? source_reference = null)
Sets the integer value of the specified attribute argument.
- public void set_attribute_integer (string attribute, string argument, int value, SourceReference? source_reference = null)
Sets the integer value of the specified attribute argument.
- public void set_attribute_string (string attribute, string argument, string? value, SourceReference? source_reference = null)
Sets the string value of the specified attribute argument.
- public virtual string to_string ()
Returns a string that represents this code node.
Fields: