Welcome to the national Day, domestic open source programming language RPP 1.87 released!

Source: Internet
Author: User

Updated as follows:

1. Support for Super macros

2. Fix bugs


Https://github.com/roundsheep/rpp


Super macros can define the grammar arbitrarily, restricting your imagination only:


void Main () {==> 2 3 <==┏━━━━━┓┃1     2  ┃┃3     4  ┃  ┗━━━━━┛}mac$ ==> _word _word <=={PUTSL (rstr ($) +rstr ($))}mac$┏━━━━━┓┃_word _word┃┃_word _WORD┃┗━━━━━┛{PUTSL (RSTR ($) + '--' +rstr ($) + '--' +rstr ($) + '--' +rstr ($))}



The following is a BF interpreter implemented with RPP:


/*BF interpreter, below is a bf version of Hello world:++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++ ++++.. +++.>++.<<+++++++++++++++.>.+++.------.--------. >+.>.*/void Main () {code=getslrbuf<int> Data (30000) Rf.memset (data.begin,0,data.size) pd=0for pc=0;pc<code.count;pc++switch code[pc]case ' >pd++case ' <pd--case ' +data[pd]++case '-data[pd]--case '. puts (Rstr.format ('%c ', DATA[PD]) case ', data[pd]=rf.getchcase ' [if data[pd]==0pc=find< + + > (Pc,code, ' [, ']) continue//here also available Continuedcase ']if data[pd]!=0pc=find<--> (PC, Code, '], ' [) continue}int find<t> (int pc,rstr& code,int left,int right) {count=0for i=pc;; I Tif code[i]==leftcount++elif code[i]==rightcount--if Count==0return i}


Welcome to the national Day, domestic open source programming language RPP 1.87 released!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.