Skip to content

自写的脚本语言(使用Java写的编译器和解释器)

Notifications You must be signed in to change notification settings

mastery001/Dolphin-Voice-Language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Dolphin Voice Language

使用Java语言参照JVM实现的一门解释型语言.

Features

  1. 函数多参数支持
  2. 无缝植入Java类特性

Examples

简单语法

Input:

var a = 1 + 3 * 4;
var b = 2;
function cc(d){
	println("d=" + d);
};
var c = function() {
  var a = 3;
  println("inner a " + a);
  println("inner b " + b);
};
c();
cc(12);
println("outer a " +  a);
println("outer b " + b);

Output:

inner a 3
inner b 2
inner c 12 , d=2
outer a 3
outer b 2

define-as语法

Input:

define java.util.ArrayList as list
define java.util.Date as date

list->add(1);
list->add("1332");

println(date->getTime());

println(list);

Output:

1489235605433
[1, 1332]

About

自写的脚本语言(使用Java写的编译器和解释器)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages