Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View COBOL.pm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
 
use v6;
use QAST:from<NQP>;
 
grammar COBOL::Grammar {
token statementlist($bootint) {
.*
}
};
 
class COBOL::Actions {
method statementlist($/) {
make QAST::Op.new( :op<say>, QAST::SVal.new( :value<awesome!!> ))
}
}
 
sub EXPORT(*@a) {
%*LANG<COBOL> := COBOL::Grammar;
%*LANG<COBOL-actions> := COBOL::Actions;
$*MAIN := 'COBOL';
 
$*W.install_lexical_symbol($*W.cur_lexpad(), '%?LANG', $*W.p6ize_recursive(%*LANG));
$*W.install_lexical_symbol($*W.cur_lexpad(), '$*MAIN', $*W.p6ize_recursive($*MAIN));
 
$*W.p6ize_recursive( nqp::hash() )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.