Have fun-Implement a Java-based Chinese programming language 2

Source: Internet
Author: User
Tags wrapper

The last one mentioned is to write Java in Chinese and not as a new language. As a Chinese language, grammar structures that require language to provide keywords are used in Chinese. The simplest thing to do is simply to replace the Java keyword with the Chinese key word. does the existing Java library need to be translated again? such as String, ArrayList, map and other classes. Not necessary, because these can only be used as a languagewrite the code, not the language itself. How to achieve it?
    1. all keywords are written in Chinese and the syntax is unchanged. Before compiling, use a script to replace all the keywords again. The disadvantage is that the source file changes are explicit, and then open, see is the Java keyword.
    2. Develop IntelliJ idea plug-in, before compiling the Chinese keyword to replace the Java keyword, open before the Java keyword replaced as a keyword. The disadvantage of this approach is that every IDE has to develop a plug-in.
    3. Javac the Java compiler, after reading the source file, replace the keyword in memory without changing the source file. Subsequent calls to Javac are passed in in-memory files after they are replaced. So as to meet the demand.
This implementation of the "Chinese programming language", can be upgraded with Java, instant upgrade. What new technology is implemented in Java that can be instantly owned. The workload is small, can be said to be a one-time workload, "revenue is quite large." you can try it if you are interested and have a busy moment. ? ?

Have fun-Implement a Java-based Chinese programming language 2

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.