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 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() ) | |
} |
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
perl6 -I. -e 'use COBOL; ...' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment