Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perl6/std
(ARCHIVE) Raku standard grammar
https://github.com/perl6/std
raku
Last synced: 3 months ago
JSON representation
(ARCHIVE) Raku standard grammar
- Host: GitHub
- URL: https://github.com/perl6/std
- Owner: perl6
- Created: 2010-09-04T20:45:31.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2015-02-24T06:37:08.000Z (almost 10 years ago)
- Last Synced: 2024-09-30T17:37:08.285Z (3 months ago)
- Topics: raku
- Language: Perl6
- Homepage: https://raku.org/
- Size: 6.27 MB
- Stars: 71
- Watchers: 165
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
=head1 Perl 6 Parser Stuff in the Pugs Repo
Welcome to pugs/src/perl6. This is the home of STD.pm6, the canonical
Perl 6 grammar, which is written in Perl 6 (of course). It is also the
home of viv, a retargettable Perl 6 metacompiler which can translate
STD.pm6 into Perl 5 (and eventually other things). The metacompiler
relies on STD.pm6 to parse itself, requiring a stored bootstrap version
of the compiled STD.pm. This is also the home of Cursor, the canonical
implementation of the Perl 6 rules engine; it co-evolves with viv and
executes the actual rules. This is also the home of a collection of
minor tools used in the development of STD.pm6 and viv.=head1 Prerequisites
You'll need the following Perl bits to run stuff:
* Perl 5.10.0 or later in PATH
* YAML::XS (e.g. sudo apt-get install libyaml-libyaml-perl)
* Moose (e.g. sudo apt-get install libmoose-perl)
* File::ShareDir
=head1 Running Stuff
You can get started by using the Makefile command, C. This will convert
the Perl 6 grammar into a Perl 5 module, C. C has a fairly simple
API; just call C as a class method with the source you want to parse as
a parameter, and look at the result. Another module, C, is provided
which converts C's output into a more object-oriented form; see C's
source for an example of the latter's use. (Both methods have more options
when you need them.)The following tools are provided which leverage the power of C:
* C parses a file of Perl 6 code and reports 'ok' or 'FAILED', plus the
time taken and memory used.* C does the same, but also tests Actions.
* C parses a file, reporting what rules matched which tokens.
* C appears to be an older, non-working version of redspans.
* C uses STD to check the syntax of the Perl 6 Specification Tests.
* C is an interactive STD syntax checker.
* C is a prototype STD-based LLVM-based Perl 6 JIT compiler.
* C is a retargettable metacompiler for the static subset of Perl 6.
* C is a syntax highlighter with multiple output formats.
See the headers of the respective programs for more details, and don't hesitate
to ask around as quite a bit of this is underdocumented.=head1 Working the Makefile
To regenerate perl 5 files from perl 6 STD.pm6, STD_P5.pm6, and Cursor.pm6
changes:make
To do that, but without running the self test (bootstrap):
make fast
To remake only one file:
make STD.pmc
To update the first stage, allowing new STD.pm6 or Cursor.pm6 features to be
used while building future versions of STD.pm6 or Cursor.pm6:make reboot
To remove all generated files:
make clean
To test the ability to parse the Perl 6 test suite (this is a very effective
regression test, but B - 20-75 minutes; also, it runs in a snapshot of
the current directory, so you can continue hacking):make snaptest