Parrot Command-Line Options
Since Parrot is both an assembler and a
bytecode interpreter, it has options to control both behaviors. Some
options may have changed by the time you read this, especially
options related to debugging and optimization. The document
imcc/docs/running.pod should have the latest
details. Or just run parrot —help.
General Usage
parrot [options]file[arguments]
The file is either an
.imc (.pir) or
.pasm source file or a Parrot bytecode file.
Parrot creates an Array object to hold the
command-line arguments and stores it in
P5 on program start.
Assembler Options
-
-a, --pasm Assume PASM input on
stdin. When Parrot runs a source file with a.pasmextension, it parses the file as pure PASM code. This switch turns on PASM parsing (instead of the default PIR parsing) when a source file is read fromstdin.-
-c,--pbc Assume PBC file on
stdin. When Parrot runs a bytecode file with a.pbcextension, it immediately executes the file. This option tells Parrot to immediately execute a bytecode file piped in onstdin.-
-d,--debug [hexbits] Turn on debugging output. The
-dswitch takes an optional argument, which is a hex value of debug bits. (The individual bits are shown in Table 11-3.) Whenhexbitsisn’t specified, the default debugging level is 0001. Ifhexbitsis separated from the-dswitch by whitespace, it has to start with a number.Table 11-3. Debug bits
Description
Debug bit
DEBUG_PARROT
0001
DEBUG_LEXER
0002
DEBUG_PARSER
0004
DEBUG_IMC
0008
DEBUG_CFG
0010 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access