-
-
Save ShimmerFairy/ffd0c5f5f42a85c02980544e552a67a5 to your computer and use it in GitHub Desktop.
Failing minimal NQP Compiler example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use NQPHLL; | |
grammar A::Grammar is HLL::Grammar { | |
token TOP { . } | |
} | |
class A::Actions is HLL::Actions { | |
method TOP($/) { | |
make QAST::Block.new( | |
QAST::Stmts.new( | |
:node($/), | |
QAST::Op.new( | |
:op('say'), | |
QAST::SVal.new( | |
:value($/.Str))))); | |
} | |
} | |
class A::Compiler is HLL::Compiler { | |
} | |
sub MAIN(*@ARGS) { | |
my $c := A::Compiler.new(); | |
$c.language('A'); | |
$c.parsegrammar(A::Grammar); | |
$c.parseactions(A::Actions); | |
$c.command_line(@ARGS, :encoding('utf8')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment