Matt S Trout > Rakudo-Star-2012.08_001 > rakudo-star/parrot/docs/book/draft/ch11_directive_reference.pod


Annotate this POD


Directive Reference ^

This is a summary of PIR directives. Directives are preprocessed by the Parrot interpreter. Since PIR and PASM run on the same interpreter, many of the directives listed here are also valid in PASM code.


  .arg R<VAL>

pass a value to a subroutine according to PCC.


  .const R<TYPE>R<NAME> = R<VALUE>

Define a named constant.


  .macro_const R<NAME>R<VALUE>

Define a named macro that expands to a given value. Macros are called as directives, i.e. .NAME (PASM code only).



Define a block of PASM code. Always paired with .eom.



End a subroutine. Always paired with .sub.



End a macro definition. Always paired with .macro.



End a block of PASM code. Always paired with .emit.


  .flatten_arg R<PArray>

Flatten the passed array PMC and provide args for PCC calls.


  .globalconst R<TYPE>R<NAME> = R<VALUE>

Define a named, file visible constant.


  .include " R<FILENAME> "

Include the contents of an external file by inserting it in place.


  .invocant R<OBJ>

Set the invocant for a method call.


  .local R<TYPE>R<NAME>

Define a local named variable.


  .macro R<NAME> (R<PARAMS>)

Define a named macro with a list of parameters. The macro is called as .NAME(arg1,arg2,...). Always paired with .endm.


  .namespace R< [ "namespace" ] >

Define a namespace.


  .param R<DEST>
  .param R<TYPE>R<NAME>

Define a subroutine parameter.


Start a call sequence. Always paired with .end_call


Start a return sequence. Always paired with .end_return


Start a return of a coroutine sequence. Always paired with .end_yield


  .call R<SUB>
  .call R<SUB>, R<RETCONT>

Create a subroutine call.


  .pcc_sub R<_LABEL>

Create a symbol entry for subroutine at the _LABEL. This directive is for PASM code only.


  .result R<DEST>

Get a return value according to PCC.


  .return R<VAL>

Return a value to the calling subroutine according to PCC.


  .sub R<NAME>

Define a subroutine. Always paired with .end. Names begin with "_" by convention.


  .sym R<TYPE> R<NAME>

Same as .local.

syntax highlighting: