项目作者: Schrotty

项目描述 :
A totaly useless programming language which 'compiles' to java
高级语言: Java
项目地址: git://github.com/Schrotty/Cereal.git
创建时间: 2018-09-26T17:03:12Z
项目社区:https://github.com/Schrotty/Cereal

开源协议:MIT License

下载


Cereal

A totaly useless programming language which ‘compiles’ to java.

Example

  1. common bowl myFirstCereal {
  2. important {
  3. /* NAME OF THE CEREAL */
  4. _String myName << "Herman";
  5. <!--
  6. public static void mainer(String name) {
  7. return String.format("Hello %s", name);
  8. }
  9. --!>
  10. common ingredient main(args: _String[]) => _void {
  11. print(test());
  12. }
  13. delicious ingredient test() => _String {
  14. add mySecondCereal("I love cookies!");
  15. return "mySecondCereal";
  16. }
  17. post {
  18. delicious ingredient postMessage() {
  19. print("I'm done!");
  20. }
  21. }
  22. }
  23. }
  24. bowl mySecondCereal {
  25. important {
  26. common ingredient helloThere() => _String {
  27. return "Hello there!";
  28. }
  29. }
  30. common ingredient mySecondCereal(str: _String) {
  31. print("That's not my string!");
  32. }
  33. common ingredient myName() => _String {
  34. return "myName";
  35. }
  36. }

compiles to

  1. public class myFirstCereal {
  2. static String myName="Herman";
  3. public static void main(String[] args) {
  4. System.out.println(test());
  5. }
  6. private static String test() {
  7. new mySecondCereal("I love cookies!");
  8. return "mySecondCereal";
  9. }
  10. private static void postMessage() {
  11. System.out.println("I'm done!");
  12. }
  13. }
  14. class mySecondCereal {
  15. public static String helloThere() {
  16. return "Hello there!";
  17. }
  18. public mySecondCereal(String str) {
  19. System.out.println("That's not my string!");
  20. }
  21. public String myName() {
  22. return "myName";
  23. }
  24. }

Usage

Build the project using maven and execute java -jar cereal2java.jar <cereal_source_file>

License

MIT