edu.vub.at.objects.grammar
Interface DefMethod


 DefMethod

The public interface to a method definition AG element. Example: def m(a, b) { a + b }

Author:
tvcutsem

Method Summary
 Expression annotationExpression()
          A method may have zero or more annotations.
 Table arguments()
          A method may have zero, one or more formal arguments.
 Begin bodyExpression()
          The body of a method may not be empty.
 Symbol selector()
          The selector must be a literal symbol.
 
Methods inherited from interface edu.vub.at.objects.AbstractGrammar
freeVariables
 
Methods inherited from interface edu.vub.at.objects.Object
super
 

Method Detail

selector

Symbol selector()
The selector must be a literal symbol. Example: `{ def m() { 5 } }.statements[1].selector == `m

Returns:
the selector of the method

arguments

Table arguments()
A method may have zero, one or more formal arguments. Slicing is allowed in the argument list. Example: `{ def m(a, @b) { b } }.statements[1].arguments == `[a, @b]

Returns:
the formal argument list

bodyExpression

Begin bodyExpression()
The body of a method may not be empty. Example: `{ def m(a, b) { a.n(); b+1 } }.statements[1].bodyExpression == `{ a.n(); b.+(1) }

Returns:
The body of the method

annotationExpression

Expression annotationExpression()
A method may have zero or more annotations. Example; `{def m() @[Getter] { x }}.statements[1].annotations == `[Getter]

Returns:
The annotations of the method