A polymorphic invocation of a method

The form of the invocation (name, arguments, etc.) are specific

Introduced properties

private var _callsite: nullable CallSite

nitc :: ASendExpr :: _callsite

The property invoked by the send.
private var _is_safe: Bool

nitc :: ASendExpr :: _is_safe

Is self a safe call (with x?.foo)?
private var _n_expr: AExpr

nitc :: ASendExpr :: _n_expr

The receiver of the method invocation
fun callsite: nullable CallSite

nitc :: ASendExpr :: callsite

The property invoked by the send.
protected fun callsite=(callsite: nullable CallSite)

nitc :: ASendExpr :: callsite=

The property invoked by the send.
init init_asendexpr(n_expr: nullable AExpr)

nitc :: ASendExpr :: init_asendexpr

fun is_safe: Bool

nitc :: ASendExpr :: is_safe

Is self a safe call (with x?.foo)?
protected fun is_safe=(is_safe: Bool)

nitc :: ASendExpr :: is_safe=

Is self a safe call (with x?.foo)?
fun n_expr: AExpr

nitc :: ASendExpr :: n_expr

The receiver of the method invocation
fun n_expr=(n_expr: AExpr)

nitc :: ASendExpr :: n_expr=

The receiver of the method invocation
private abstract fun property_name: String

nitc :: ASendExpr :: property_name

The name of the property
private fun property_node: ANode

nitc :: ASendExpr :: property_node

The node identifying the name (id, operator, etc) for messages.
fun raw_arguments: Array[AExpr]

nitc :: ASendExpr :: raw_arguments

An array of all arguments (excluding self)

Redefined properties

redef type SELF: ASendExpr

nitc $ ASendExpr :: SELF

Type of this instance, automatically specialized in every class
redef fun bad_expr_message(child: AExpr): nullable String

nitc :: typing $ ASendExpr :: bad_expr_message

An additional information message to explain the role of a child expression.
redef fun decorate_tag(v: HtmlightVisitor, res: HTMLTag, token: Token): nullable HInfoBox

nitc :: htmlight $ ASendExpr :: decorate_tag

Add aditionnal information on a child-token and return an additionnal HInfoBox on it
redef fun dump_info(v: ASTDump): String

nitc :: typing $ ASendExpr :: dump_info

Information to display on a node
redef fun expr(v: JavaCompilerVisitor): nullable RuntimeVariable

nitc :: java_compiler $ ASendExpr :: expr

Try to compile self as an expression
redef fun expr(v: NaiveInterpreter): nullable Instance

nitc :: naive_interpreter $ ASendExpr :: expr

Evaluate the node as a possible expression.
redef fun expr(v: AbstractCompilerVisitor): nullable RuntimeVariable

nitc :: abstract_compiler $ ASendExpr :: expr

Try to compile self as an expression
redef fun generate_basic_blocks(ssa: SSA, old_block: BasicBlock): BasicBlock

nitc :: ssa $ ASendExpr :: generate_basic_blocks

Generate recursively basic block for this expression
redef fun is_inlinable: Bool

nitc :: pretty $ ASendExpr :: is_inlinable

Is self printable in one line?
redef fun n_expr=(node: AExpr)

nitc :: parser_prod $ ASendExpr :: n_expr=

The receiver of the method invocation
redef fun replace_child(old_child: ANode, new_child: nullable ANode)

nitc :: parser_prod $ ASendExpr :: replace_child

Replace a child with an other node in the AST
redef fun visit_all(v: Visitor)

nitc :: parser_prod $ ASendExpr :: visit_all

Visit all nodes in order.

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _after_flow_context: nullable FlowContext

nitc :: AExpr :: _after_flow_context

The flow after the full evaluation of the expression/statement
private var _callsite: nullable CallSite

nitc :: ASendExpr :: _callsite

The property invoked by the send.
private var _comprehension: nullable AArrayExpr

nitc :: AExpr :: _comprehension

Is non-null if self is a leaf of a comprehension array construction.
private var _first_location: nullable Location

nitc :: Prod :: _first_location

Location on the first token after the start of a production
private var _first_token: nullable Token

nitc :: Prod :: _first_token

The first token of the production in the AST
private var _force_block: Bool

nitc :: ANode :: _force_block

Force self to be rendered as a block.
private var _force_inline: Bool

nitc :: ANode :: _force_inline

Force self to be rendered as a line.
private var _implicit_cast_to: nullable MType

nitc :: AExpr :: _implicit_cast_to

If required, the following implicit cast .as(XXX)
private var _is_broken: Bool

nitc :: ANode :: _is_broken

The indication that the node did not pass some semantic verifications.
private var _is_safe: Bool

nitc :: ASendExpr :: _is_safe

Is self a safe call (with x?.foo)?
private var _is_typed: Bool

nitc :: AExpr :: _is_typed

Is the statement correctly typed?
private var _last_token: nullable Token

nitc :: Prod :: _last_token

The last token of the production in the AST
private var _location: Location

nitc :: ANode :: _location

Location is set during AST building. Once built, location can not be null.
private var _mtype: nullable MType

nitc :: AExpr :: _mtype

The static type of the expression.
private var _n_annotations: nullable AAnnotations

nitc :: Prod :: _n_annotations

All the annotations attached directly to the node
private var _n_expr: AExpr

nitc :: ASendExpr :: _n_expr

The receiver of the method invocation
private var _parent: nullable ANode

nitc :: ANode :: _parent

Parent of the node in the AST
private var _vararg_decl: Int

nitc :: AExpr :: _vararg_decl

It indicates the number of arguments collected as a vararg.
private var _variable_cache: nullable Variable

nitc :: AExpr :: _variable_cache

private fun accept_explain_assert(v: ExplainAssertVisitor)

nitc :: AExpr :: accept_explain_assert

Fill v to explain this node if the parent assert fails
fun accept_forward_analysis(v: ForwardAnalysis)

nitc :: ANode :: accept_forward_analysis

Apply the forward analysis v to self.
private abstract fun accept_pretty_printer(v: PrettyPrinterVisitor)

nitc :: ANode :: accept_pretty_printer

Start visit of self using a PrettyPrinterVisitor
fun accept_reaching_defs(v: ReachingDefsAnalysis)

nitc :: ANode :: accept_reaching_defs

Apply a ReachingDefsAnalysis to self.
fun add(expr: AExpr)

nitc :: AExpr :: add

Add expr at the end of the block
fun after_flow_context: nullable FlowContext

nitc :: AExpr :: after_flow_context

The flow after the full evaluation of the expression/statement
protected fun after_flow_context=(after_flow_context: nullable FlowContext)

nitc :: AExpr :: after_flow_context=

The flow after the full evaluation of the expression/statement
fun allocate_mtype(v: RapidTypeVisitor)

nitc :: AExpr :: allocate_mtype

Make the mtype of the expression live
fun as_id: nullable String

nitc :: AExpr :: as_id

Get self as a single identifier.
fun as_int: nullable Int

nitc :: AExpr :: as_int

Get self as an Int.
fun as_string: nullable String

nitc :: AExpr :: as_string

Get self as a String.
private fun bad_expr_message(child: AExpr): nullable String

nitc :: ANode :: bad_expr_message

An additional information message to explain the role of a child expression.
fun callsite: nullable CallSite

nitc :: ASendExpr :: callsite

The property invoked by the send.
protected fun callsite=(callsite: nullable CallSite)

nitc :: ASendExpr :: callsite=

The property invoked by the send.
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
abstract fun clone: SELF

core :: Cloneable :: clone

Duplicate self
fun collect_annotations_by_name(name: String): Array[AAnnotation]

nitc :: ANode :: collect_annotations_by_name

Do a deep search and return an array of node that are annotated
private fun collect_comments: Array[TComment]

nitc :: Prod :: collect_comments

Collect all TComment contained in the production
private abstract fun collect_length: Int

nitc :: ANode :: collect_length

Collect the length (in Char) of the node.
fun collect_text: String

nitc :: Prod :: collect_text

Join the text of all visited tokens
fun collect_tokens_by_text(text: String): Array[Token]

nitc :: ANode :: collect_tokens_by_text

Do a deep search and return an array of tokens that match a given text
fun common_parent(other: ANode): nullable ANode

nitc :: ANode :: common_parent

The most specific common parent between self and other
fun comprehension: nullable AArrayExpr

nitc :: AExpr :: comprehension

Is non-null if self is a leaf of a comprehension array construction.
protected fun comprehension=(comprehension: nullable AArrayExpr)

nitc :: AExpr :: comprehension=

Is non-null if self is a leaf of a comprehension array construction.
fun debug(message: String)

nitc :: ANode :: debug

Display a message for the colored location of the node
protected fun decorate_tag(v: HtmlightVisitor, res: HTMLTag, token: Token): nullable HInfoBox

nitc :: ANode :: decorate_tag

Add aditionnal information on a child-token and return an additionnal HInfoBox on it
fun depth: Int

nitc :: ANode :: depth

Number of nodes between self and the root of the AST
fun detach

nitc :: ANode :: detach

Detach a node from its parent
fun detach_with_placeholder: AExpr

nitc :: AExpr :: detach_with_placeholder

The detach method completely remove the node in the parent.
private fun do_cloneable(v: CloneVisitor)

nitc :: ANode :: do_cloneable

fun do_typing(modelbuilder: ModelBuilder, visited_mpropdef: MPropDef)

nitc :: AExpr :: do_typing

Type the expression as if located in visited_mpropdef
fun dump_info(v: ASTDump): String

nitc :: ANode :: dump_info

Information to display on a node
fun dump_tree(display_structural: nullable Bool, display_line: nullable Bool)

nitc :: ANode :: dump_tree

Write the subtree on stdout.
private fun expr(v: AbstractCompilerVisitor): nullable RuntimeVariable

nitc :: AExpr :: expr

Try to compile self as an expression
protected fun expr(v: NaiveInterpreter): nullable Instance

nitc :: AExpr :: expr

Evaluate the node as a possible expression.
private fun expr(v: JavaCompilerVisitor): nullable RuntimeVariable

nitc :: AExpr :: expr

Try to compile self as an expression
fun fatal(v: NaiveInterpreter, message: String)

nitc :: ANode :: fatal

Aborts the program with a message
fun first_location: nullable Location

nitc :: Prod :: first_location

Location on the first token after the start of a production
protected fun first_location=(first_location: nullable Location)

nitc :: Prod :: first_location=

Location on the first token after the start of a production
fun first_token: nullable Token

nitc :: Prod :: first_token

The first token of the production in the AST
protected fun first_token=(first_token: nullable Token)

nitc :: Prod :: first_token=

The first token of the production in the AST
private fun force_block: Bool

nitc :: ANode :: force_block

Force self to be rendered as a block.
private fun force_block=(force_block: Bool)

nitc :: ANode :: force_block=

Force self to be rendered as a block.
private fun force_inline: Bool

nitc :: ANode :: force_inline

Force self to be rendered as a line.
private fun force_inline=(force_inline: Bool)

nitc :: ANode :: force_inline=

Force self to be rendered as a line.
fun generate_basic_blocks(ssa: SSA, old_block: BasicBlock): BasicBlock

nitc :: AExpr :: generate_basic_blocks

Generate recursively basic block for this expression
fun get_annotations(name: String): Array[AAnnotation]

nitc :: Prod :: get_annotations

Return all its annotations of a given name in the order of their declaration
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun get_single_annotation(name: String, modelbuilder: ModelBuilder): nullable AAnnotation

nitc :: Prod :: get_single_annotation

Try to get its single annotation with a given name
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun hot_location: Location

nitc :: ANode :: hot_location

The location of the important part of the node (identifier or whatever)
fun implicit_cast_to: nullable MType

nitc :: AExpr :: implicit_cast_to

If required, the following implicit cast .as(XXX)
protected fun implicit_cast_to=(implicit_cast_to: nullable MType)

nitc :: AExpr :: implicit_cast_to=

If required, the following implicit cast .as(XXX)
fun infobox(v: HtmlightVisitor): nullable HInfoBox

nitc :: ANode :: infobox

Return a optional infobox
init init

core :: Object :: init

init init_asendexpr(n_expr: nullable AExpr)

nitc :: ASendExpr :: init_asendexpr

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun is_block: Bool

nitc :: Prod :: is_block

Is the production contained in full block of line?
fun is_broken: Bool

nitc :: ANode :: is_broken

The indication that the node did not pass some semantic verifications.
fun is_broken=(is_broken: Bool)

nitc :: ANode :: is_broken=

The indication that the node did not pass some semantic verifications.
private fun is_inlinable: Bool

nitc :: ANode :: is_inlinable

Is self printable in one line?
private fun is_noserialize: Bool

nitc :: ANode :: is_noserialize

Is this node annotated to not be made serializable?
fun is_safe: Bool

nitc :: ASendExpr :: is_safe

Is self a safe call (with x?.foo)?
protected fun is_safe=(is_safe: Bool)

nitc :: ASendExpr :: is_safe=

Is self a safe call (with x?.foo)?
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
private fun is_serialize: Bool

nitc :: ANode :: is_serialize

Is this node annotated to be made serializable?
fun is_span: Bool

nitc :: Prod :: is_span

Is the production a part of a single line (without being a block)
fun is_structural: Bool

nitc :: ANode :: is_structural

Is self a token or a pure-structural production like AQId?
fun is_typed: Bool

nitc :: AExpr :: is_typed

Is the statement correctly typed?
protected fun is_typed=(is_typed: Bool)

nitc :: AExpr :: is_typed=

Is the statement correctly typed?
fun its_variable: nullable Variable

nitc :: AExpr :: its_variable

Return the variable read (if any)
fun last_token: nullable Token

nitc :: Prod :: last_token

The last token of the production in the AST
protected fun last_token=(last_token: nullable Token)

nitc :: Prod :: last_token=

The last token of the production in the AST
fun location: Location

nitc :: ANode :: location

Location is set during AST building. Once built, location can not be null.
fun location=(location: Location)

nitc :: ANode :: location=

Location is set during AST building. Once built, location can not be null.
protected fun make_tag(v: HtmlightVisitor): nullable HTMLTag

nitc :: ANode :: make_tag

Optionally creates a tag that encapsulate the AST element on HTML rendering
fun make_var_read: AVarExpr

nitc :: AExpr :: make_var_read

Return a new variable read that contains the value of the expression
fun mtype: nullable MType

nitc :: AExpr :: mtype

The static type of the expression.
protected fun mtype=(mtype: nullable MType)

nitc :: AExpr :: mtype=

The static type of the expression.
private fun must_be_block: Bool

nitc :: ANode :: must_be_block

Does self have to be rendered as a block?
private fun must_be_inline: Bool

nitc :: ANode :: must_be_inline

Does self have be rendered as a line?
fun n_annotations: nullable AAnnotations

nitc :: Prod :: n_annotations

All the annotations attached directly to the node
fun n_annotations=(n_annotations: nullable AAnnotations)

nitc :: Prod :: n_annotations=

All the annotations attached directly to the node
fun n_expr: AExpr

nitc :: ASendExpr :: n_expr

The receiver of the method invocation
fun n_expr=(n_expr: AExpr)

nitc :: ASendExpr :: n_expr=

The receiver of the method invocation
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
fun numbering(v: VirtualMachine, position: Int): Int

nitc :: AExpr :: numbering

Give a position to each variable declared in the node.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun parent: nullable ANode

nitc :: ANode :: parent

Parent of the node in the AST
protected fun parent=(parent: nullable ANode)

nitc :: ANode :: parent=

Parent of the node in the AST
fun parentize_tokens

nitc :: ANode :: parentize_tokens

Visit the AST and computes advanced AST attributes on Tokens and Prod
private abstract fun property_name: String

nitc :: ASendExpr :: property_name

The name of the property
private fun property_node: ANode

nitc :: ASendExpr :: property_node

The node identifying the name (id, operator, etc) for messages.
fun raw_arguments: Array[AExpr]

nitc :: ASendExpr :: raw_arguments

An array of all arguments (excluding self)
private abstract fun replace_child(old_child: ANode, new_child: nullable ANode)

nitc :: ANode :: replace_child

Replace a child with an other node in the AST
fun replace_clone

nitc :: ANode :: replace_clone

Create a new clone of self
fun replace_with(node: ANode)

nitc :: ANode :: replace_with

Replace itself with an other node in the AST
fun root: ANode

nitc :: ANode :: root

The topmost ancestor of the element
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
private fun start_token: nullable Token

nitc :: Prod :: start_token

The token where the production really start (skipping ADoc).
private fun stmt(v: AbstractCompilerVisitor)

nitc :: AExpr :: stmt

Try to compile self as a statement
private fun stmt(v: JavaCompilerVisitor)

nitc :: AExpr :: stmt

Try to compile self as a statement
protected fun stmt(v: NaiveInterpreter)

nitc :: AExpr :: stmt

Evaluate the node as a statement.
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun to_xml: HTMLTag

nitc :: Prod :: to_xml

A XML representation of the AST
fun validate

nitc :: ANode :: validate

Recursively validate a AST node.
fun vararg_decl: Int

nitc :: AExpr :: vararg_decl

It indicates the number of arguments collected as a vararg.
protected fun vararg_decl=(vararg_decl: Int)

nitc :: AExpr :: vararg_decl=

It indicates the number of arguments collected as a vararg.
private fun variable_cache: nullable Variable

nitc :: AExpr :: variable_cache

private fun variable_cache=(variable_cache: nullable Variable)

nitc :: AExpr :: variable_cache=

abstract fun visit_all(v: Visitor)

nitc :: ANode :: visit_all

Visit all nodes in order.
private fun warn_parentheses(v: SimpleMiscVisitor)

nitc :: AExpr :: warn_parentheses

Warn in case of superfluous parentheses
private abstract fun was_inline: Bool

nitc :: ANode :: was_inline

Does self was written in one line before transformation?
package_diagram nitc::ASendExpr ASendExpr nitc::AExpr AExpr nitc::ASendExpr->nitc::AExpr nitc::Prod Prod nitc::AExpr->nitc::Prod ...nitc::Prod ... ...nitc::Prod->nitc::Prod nitc::ABinopExpr ABinopExpr nitc::ABinopExpr->nitc::ASendExpr nitc::AUnaryopExpr AUnaryopExpr nitc::AUnaryopExpr->nitc::ASendExpr nitc::ACallFormExpr ACallFormExpr nitc::ACallFormExpr->nitc::ASendExpr nitc::ASendReassignFormExpr ASendReassignFormExpr nitc::ASendReassignFormExpr->nitc::ASendExpr nitc::AInitExpr AInitExpr nitc::AInitExpr->nitc::ASendExpr nitc::ABraFormExpr ABraFormExpr nitc::ABraFormExpr->nitc::ASendExpr nitc::ABinopExpr... ... nitc::ABinopExpr...->nitc::ABinopExpr nitc::AUminusExpr AUminusExpr nitc::AUminusExpr->nitc::AUnaryopExpr nitc::AUplusExpr AUplusExpr nitc::AUplusExpr->nitc::AUnaryopExpr nitc::AUtildeExpr AUtildeExpr nitc::AUtildeExpr->nitc::AUnaryopExpr nitc::AUminusExpr... ... nitc::AUminusExpr...->nitc::AUminusExpr nitc::AUplusExpr... ... nitc::AUplusExpr...->nitc::AUplusExpr nitc::AUtildeExpr... ... nitc::AUtildeExpr...->nitc::AUtildeExpr nitc::ACallExpr ACallExpr nitc::ACallExpr->nitc::ACallFormExpr nitc::ACallAssignExpr ACallAssignExpr nitc::ACallAssignExpr->nitc::ACallFormExpr nitc::ACallReassignExpr ACallReassignExpr nitc::ACallReassignExpr->nitc::ACallFormExpr nitc::ACallReassignExpr->nitc::ASendReassignFormExpr nitc::ACallrefExpr ACallrefExpr nitc::ACallrefExpr->nitc::ACallFormExpr nitc::ACallExpr... ... nitc::ACallExpr...->nitc::ACallExpr nitc::ACallAssignExpr... ... nitc::ACallAssignExpr...->nitc::ACallAssignExpr nitc::ACallReassignExpr... ... nitc::ACallReassignExpr...->nitc::ACallReassignExpr nitc::ACallrefExpr... ... nitc::ACallrefExpr...->nitc::ACallrefExpr nitc::ABraReassignExpr ABraReassignExpr nitc::ABraReassignExpr->nitc::ASendReassignFormExpr nitc::ABraReassignExpr->nitc::ABraFormExpr nitc::ABraReassignExpr... ... nitc::ABraReassignExpr...->nitc::ABraReassignExpr nitc::ABraExpr ABraExpr nitc::ABraExpr->nitc::ABraFormExpr nitc::ABraAssignExpr ABraAssignExpr nitc::ABraAssignExpr->nitc::ABraFormExpr nitc::ABraExpr... ... nitc::ABraExpr...->nitc::ABraExpr nitc::ABraAssignExpr... ... nitc::ABraAssignExpr...->nitc::ABraAssignExpr

Ancestors

abstract class ANode

nitc :: ANode

Root of the AST class-hierarchy
interface Cloneable

core :: Cloneable

Something that can be cloned
interface Object

core :: Object

The root of the class hierarchy.
abstract class Prod

nitc :: Prod

Ancestor of all productions

Parents

abstract class AExpr

nitc :: AExpr

Expression and statements

Children

abstract class ABinopExpr

nitc :: ABinopExpr

A binary operation on a method
abstract class ABraFormExpr

nitc :: ABraFormExpr

Whatever looks-like a call of the brackets [] operator.
abstract class ACallFormExpr

nitc :: ACallFormExpr

Whatever looks-like a call with a standard method and any number of arguments.
class AInitExpr

nitc :: AInitExpr

A call to the init constructor.
abstract class ASendReassignFormExpr

nitc :: ASendReassignFormExpr

A complex setter call (standard or brackets)
abstract class AUnaryopExpr

nitc :: AUnaryopExpr

A unary operation on a method

Descendants

class AAmpExpr

nitc :: AAmpExpr

A & expression
class ABraAssignExpr

nitc :: ABraAssignExpr

A setter call of the bracket operator. eg x[y,z]=t
class ABraExpr

nitc :: ABraExpr

A call of the brackets operator. eg x[y,z]
class ABraReassignExpr

nitc :: ABraReassignExpr

A complex setter call of the bracket operator. eg x[y,z]+=t
class ACallAssignExpr

nitc :: ACallAssignExpr

A setter call with a standard method-name and any number of arguments. eg x.m(y)=z. OR just a simple assignment.
class ACallExpr

nitc :: ACallExpr

A call with a standard method-name and any number of arguments. eg x.m(y). OR just a simple id
class ACallReassignExpr

nitc :: ACallReassignExpr

A complex setter call with a standard method-name and any number of arguments. eg x.m(y)+=z. OR just a simple complex assignment.
class ACallrefExpr

nitc :: ACallrefExpr

A reference to a method with a captured receiver. eg. &x.foo or just &foo is self is captured.
class ACaretExpr

nitc :: ACaretExpr

A ^ expression
class AEqExpr

nitc :: AEqExpr

A == expression
class AEqFormExpr

nitc :: AEqFormExpr

A == or a != expression
class AGeExpr

nitc :: AGeExpr

A >= expression
class AGgExpr

nitc :: AGgExpr

A >> expression
class AGtExpr

nitc :: AGtExpr

A > expression
class ALeExpr

nitc :: ALeExpr

A <= expression
class ALlExpr

nitc :: ALlExpr

A << expression
class ALtExpr

nitc :: ALtExpr

A < expression
class AMinusExpr

nitc :: AMinusExpr

A - expression
class ANeExpr

nitc :: ANeExpr

A != expression
class APercentExpr

nitc :: APercentExpr

A % expression
class APipeExpr

nitc :: APipeExpr

A | expression
class APlusExpr

nitc :: APlusExpr

A + expression
class ASlashExpr

nitc :: ASlashExpr

A / expression
class AStarExpr

nitc :: AStarExpr

A * expression
class AStarshipExpr

nitc :: AStarshipExpr

A <=> expression
class AStarstarExpr

nitc :: AStarstarExpr

A ** expression
class AUminusExpr

nitc :: AUminusExpr

A unary minus expression. eg -x
class AUplusExpr

nitc :: AUplusExpr

A unary plus expression. eg +x
class AUtildeExpr

nitc :: AUtildeExpr

A unary ~ expression

Class definitions

nitc $ ASendExpr
# A polymorphic invocation of a method
# The form of the invocation (name, arguments, etc.) are specific
abstract class ASendExpr
	super AExpr
	# The receiver of the method invocation
	var n_expr: AExpr is writable, noinit
end
src/parser/parser_nodes.nit:2139,1--2145,3

nitc :: parser_prod $ ASendExpr
redef class ASendExpr
	init init_asendexpr (
		n_expr: nullable AExpr
	)
	do
		_n_expr = n_expr.as(not null)
		n_expr.parent = self
	end

	redef fun replace_child(old_child: ANode, new_child: nullable ANode)
	do
		if _n_expr == old_child then
			n_expr = new_child.as(AExpr)
			return
		end
	end

	redef fun n_expr=(node)
	do
		_n_expr = node
		node.parent = self
	end


	redef fun visit_all(v: Visitor)
	do
		v.enter_visit(_n_expr)
	end
end
src/parser/parser_prod.nit:3618,1--3646,3

nitc :: pretty $ ASendExpr
redef class ASendExpr
	redef fun is_inlinable do return true
end
src/pretty.nit:1586,1--1588,3

nitc :: typing $ ASendExpr
redef class ASendExpr
	# The property invoked by the send.
	var callsite: nullable CallSite

	# Is self a safe call (with `x?.foo`)?
	# If so and the receiver is null, then the arguments won't be evaluated
	# and the call skipped (replaced with null).
	var is_safe: Bool = false

	redef fun bad_expr_message(child)
	do
		if child == self.n_expr then
			return "to be the receiver of `{self.property_name}`"
		end
		return null
	end

	redef fun accept_typing(v)
	do
		var nrecv = self.n_expr
		var recvtype = v.visit_expr(nrecv)

		if nrecv isa ASafeExpr then
			# Has the receiver the form `x?.foo`?
			# For parsing "reasons" the `?` is in the receiver node, not the call node.
			is_safe = true
		end

		var name = self.property_name
		var node = self.property_node

		if recvtype == null then return # Forward error

		var callsite = null
		var unsafe_type = v.anchor_to(recvtype)
		var mproperty = v.try_get_mproperty_by_name2(node, unsafe_type, name)
		if mproperty == null and nrecv isa AImplicitSelfExpr then
			# Special fall-back search in `sys` when noting found in the implicit receiver.
			var sysclass = v.try_get_mclass(node, "Sys")
			if sysclass != null then
				var systype = sysclass.mclass_type
				mproperty = v.try_get_mproperty_by_name2(node, systype, name)
				if mproperty != null then
					callsite = v.build_callsite_by_name(node, systype, name, false)
					if callsite == null then return # Forward error
					# Update information, we are looking at `sys` now, not `self`
					nrecv.is_sys = true
					nrecv.its_variable = null
					nrecv.mtype = systype
					recvtype = systype
				end
			end
		end
		if callsite == null then
			# If still nothing, just exit
			callsite = v.build_callsite_by_name(node, recvtype, name, nrecv isa ASelfExpr)
			if callsite == null then return
		end

		self.callsite = callsite
		var msignature = callsite.msignature

		var args = compute_raw_arguments

		if not self isa ACallrefExpr then callsite.check_signature(v, node, args)

		if callsite.mproperty.is_init then
			var vmpropdef = v.mpropdef
			if not (vmpropdef isa MMethodDef and vmpropdef.mproperty.is_init) then
				v.error(node, "Error: an `init` can only be called from another `init`.")
			end
			if vmpropdef isa MMethodDef and vmpropdef.mproperty.is_root_init and not callsite.mproperty.is_root_init then
				v.error(node, "Error: `{vmpropdef}` cannot call a factory `{callsite.mproperty}`.")
			end
		end

		var ret = msignature.return_mtype
		if ret != null then
			if is_safe then
				# A safe receiver makes that the call is not executed and returns null
				ret = ret.as_nullable
			end
			self.mtype = ret
		else
			self.is_typed = true
		end
	end

	# The name of the property
	# Each subclass simply provide the correct name.
	private fun property_name: String is abstract

	# The node identifying the name (id, operator, etc) for messages.
	#
	# Is `self` by default
	private fun property_node: ANode do return self

	# An array of all arguments (excluding self)
	fun raw_arguments: Array[AExpr] do return compute_raw_arguments

	private fun compute_raw_arguments: Array[AExpr] is abstract

	redef fun dump_info(v) do
		var res = super
		var callsite = self.callsite
		if callsite != null then
			res += v.yellow(" call="+callsite.dump_info(v))
		end
		return res
	end
end
src/semantize/typing.nit:1950,1--2060,3

nitc :: auto_super_init $ ASendExpr
redef class ASendExpr
	redef fun accept_auto_super_init(v)
	do
		var callsite = self.callsite
		if callsite == null then
			v.is_broken = true
			return
		end
		if callsite.mproperty.is_init then
			v.has_explicit_super_init = self
		end
	end
end
src/semantize/auto_super_init.nit:191,1--203,3

nitc :: rapid_type_analysis $ ASendExpr
redef class ASendExpr
	redef fun accept_rapid_type_visitor(v)
	do
		v.add_callsite(callsite)
	end
end
src/rapid_type_analysis.nit:700,1--705,3

nitc :: naive_interpreter $ ASendExpr
redef class ASendExpr
	redef fun expr(v)
	do
		var recv = v.expr(self.n_expr)
		if recv == null then return null

		# Safe call shortcut if recv is null
		if is_safe and recv.is_null then
			return recv
		end

		var args = v.varargize(callsite.mpropdef, callsite.signaturemap, recv, self.raw_arguments)
		if args == null then return null
		var res = v.callsite(callsite, args)
		return res
	end
end
src/interpreter/naive_interpreter.nit:2278,1--2294,3

nitc :: ssa $ ASendExpr
redef class ASendExpr
	redef fun generate_basic_blocks(ssa, old_block)
	do
		# A call does not finish the current block,
		# because we create intra-procedural basic blocks here

		ssa.propdef.object_sites.add(self)

		# Recursively goes into arguments to find variables if any
		for e in self.raw_arguments do e.generate_basic_blocks(ssa, old_block)

		return self.n_expr.generate_basic_blocks(ssa, old_block)
	end
end
src/ssa.nit:839,1--852,3

nitc :: contracts $ ASendExpr
redef class ASendExpr
	redef fun check_callsite(v)
	do
		var actual_callsite = callsite
		if actual_callsite != null then
			callsite = v.drive_method_contract(actual_callsite)
		end
	end
end
src/contracts.nit:916,1--924,3

nitc :: abstract_compiler $ ASendExpr
redef class ASendExpr
	redef fun expr(v)
	do
		var recv = v.expr(self.n_expr, null)
		if is_safe then
			v.add "if ({recv}!=NULL) \{"
		end
		var callsite = self.callsite.as(not null)
		if callsite.is_broken then return null
		var args = v.varargize(callsite.mpropdef, callsite.signaturemap, recv, self.raw_arguments)
		var res = v.compile_callsite(callsite, args)
		if is_safe then
			if res != null then
				# `callsite.mpropdef` may reference a method whose
				# return type is a primitive type in C. If it is
				# the case, we must convert the primitive type to
				# a `val*` to support nullable assignment.
				# Autobox's job is to convert primitive type to
				# nullable type, eg from `Int` to `nullable `Int`.
				# The target type reside in `self.mtype`.
				var original_res = v.autobox(res, self.mtype.as(not null))

				# Here we must create a new_var in case the original
				# type is not nullable. We can't call `autobox` to
				# convert a complex type to its nullable version.
				# eg if we have a type `A`, calling autobox like
				# `autobox(A, nullable A)` will return `A` since
				# `A` and `nullable A` have the same primitive
				# type. The nullable qualifier is only used at
				# compile time to add appropriate null checks.
				res = v.new_var(self.mtype.as(not null))
				v.add("{res} = {original_res};")
				v.add("\} else \{")
				v.add("{res} = NULL;")
			end
			v.add("\}")
		end
		return res
	end
end
src/compiler/abstract_compiler.nit:4382,1--4421,3

nitc :: htmlight $ ASendExpr
redef class ASendExpr
	redef fun decorate_tag(v, res, token)
	do
		var callsite = self.callsite
		if callsite == null then return null
		return callsite.infobox(v)
	end
end
src/htmlight.nit:901,1--908,3

nitc :: java_compiler $ ASendExpr
redef class ASendExpr
	redef fun expr(v) do
		var recv = v.expr(n_expr, null)
		var callsite = callsite.as(not null)
		var args = v.varargize(callsite.mpropdef, callsite.signaturemap, recv, raw_arguments)
		return v.compile_callsite(callsite, args)
	end
end
src/compiler/java_compiler.nit:1932,1--1939,3