Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: fbb061dcce
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (34 sloc) 0.838 kB
# $Id$
=begin overview
This is the grammar for nqptap written as a sequence of Perl 6 rules.
=end overview
grammar nqptap::Grammar is PCT::Grammar;
rule TOP {
<statement>*
[ $ || <panic: 'Syntax error'> ]
{*}
}
## this <ws> rule treats # as "comment to eol"
## you may want to replace it with something appropriate
token ws {
<!ww>
[ '#' \N* \n? | \s+ ]*
}
rule statement {
'say' <expression> [ ',' <expression> ]* ';'
{*}
}
rule value {
| <integer> {*} #= integer
| <quote> {*} #= quote
}
token integer { \d+ {*} }
token quote {
[ \' <string_literal: '\'' > \' | \" <string_literal: '"' > \" ]
{*}
}
## terms
token term {
| <value> {*} #= value
}
rule expression is optable { ... }
Jump to Line
Something went wrong with that request. Please try again.