Skip to content

actar233/MyInterpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

大学时候写得解释器,最近翻了出来。传上来防止以后找不到了。

val text = """
    String hello = "你好 ";
    String name = null;
    while(name == null) {
        print("请输入你的名字: ");
        name = readLine();
    }
    println(hello + name);
""".trimIndent()

val iterator = Lexer(text).parse()
Block(iterator).execute()

output:

请输入你的名字: 张三
你好 张三

About

我大学的时候写得解释器

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages