Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8a07b84f49
Fetching contributors…

Cannot retrieve contributors at this time

file 110 lines (80 sloc) 3.916 kb

Action methods are typically used to perform transformations and other actions while parsing a source code program. Parse grammars typically use the special token {*} to indicate the point at which an action method is to be invoked. In addition, a line containing {*} may also use #= to specify a "key" that is to be passed to the action method.

NQP is a primitive language for writing subroutines and methods in Parrot using a Perl 6 syntax. It's not intended to be a full-fledged programming language, nor does it provide a runtime environment beyond the basic Parrot primitives. Compilers typically use NQP to compile "action methods" that convert a parse tree into its equivalent abstract syntax tree representation.

Parrot design documents are the specifications for Parrot's interface to its "outside world". The PDDs serve basically the same purpose for Parrot that the Synopses serve for Perl 6. (See https://github.com/parrot/parrot/tree/master/docs/pdds/).

A "parse grammar" is the set of rules and subroutines that are used to parse source code into an equivalent parse tree representation. In most computer science circles we would simply call this a "grammar", but in Parrot the term "grammar" is also used occasionally to specify other sets of transformation rules (that aren't necessarily performing parsing). Within the Rakudo compiler the terms "parse grammar" and "grammar" are pretty much interchangeable.

PAST is a set of classes used to represent the abstract semantics of a compiled program. Normally a compiler will convert source code into an equivalent PAST, and then allow the compiler toolkit to take care of the code generation. PAST is documented in PDD 26 - Parrot Abstract Syntax Tree (http://svn.parrot.org/parrot/trunk/docs/pdds/pdd26_ast.pod).

The Parrot Compiler Toolkit is a suite of components that are useful for building compilers in Parrot. It consists of a base grammar for parsers ( PCT::Grammar ), a base class for compilers ( PCT::HLLCompiler ), an abstract syntax tree representation (PAST), and a PAST compiler.

The Parse Grammar Engine is the primarily regular expression engine for Rakudo and Parrot. It's the component that handles grammars and regular expressions in Rakudo, as well as being the primary foundation for parsing Perl 6 itself.

Rakudo is the name of a Perl 6 implementation that runs on Parrot. An abbreviation of "Rakuda-do," which, when translated from Japanese, means "The Way of the Camel". In Japanese, "Rakudo" means "Paradise." For more info, see http://use.perl.org/~pmichaud/journal/35400.

STD.pm is the "standard" Perl 6 grammar definition, see https://github.com/perl6/std/. At the moment STD.pm is not really a "specification" in a proscriptive sense -- it's more of a guideline or model for Perl 6 implementations to follow. The goal is that eventually the various implementations will converge on a common grammar (that will probably look a lot like STD.pm).

Early versions of compilers for Parrot, including Rakudo, made use of the "Tree Grammar Engine" (compilers/tge) to transform parse trees into an abstract syntax tree and then into executable code. For Rakudo, this has been obsoleted in favor of using action methods and NQP for transformation into PAST.

Patrick Michaud <pmichaud@pobox.com> is the primary author and maintainer.

Copyright (C) 2007, The Perl Foundation.

Something went wrong with that request. Please try again.