PlayWithCompiler icon indicating copy to clipboard operation
PlayWithCompiler copied to clipboard

A GeekTime course about constructing a compiler.

Results 30 PlayWithCompiler issues
Sort by recently updated
recently updated
newest added

环境:playscript-java与FirstClassFunction.play 问题描述:当解释执行FirstClassFunction.play文件时,该文件中的bar(foo);函数无法正确执行。 产生原因:解释执行bar(foo);时,解释器无法找到bar函数。其原因是进行闭包foo匹配时,由于foo调用多次从而导致返回参数类型个数不停的增加,从而导致函数匹配失败。 ```java public class Function extends Scope implements FunctionType { ... @Override public List getParamTypes() { if (paramTypes == null) { paramTypes = new LinkedList(); } //当某个函数调用多次时,paramTypes的数量会不停的增加 for...

playscript-java的项目跑不起来,是不是要安装别的东西?不懂java,求助

宫老师 您好! 买了您的《编译原理之美》跟《编译原理实战》的专栏,在这两个专栏中获益匪浅。但是在看专栏学习过程当中,遇到一些问题跟困难,也看到其他同学也有相同疑惑,希望建立一个微信交流群,方便大家在学习这两个专栏时可以相互沟通交流。

在看《编译原理之美》过程中自己花了些时间用Gradle组织了playscript-java这个项目,还包括使用层级的结构组织代码和写了一个简单的集成测试,也许对其他人有些用处。 [项目地址](https://bitbucket.org/minghu6code/ps-java/src/master/) 吐槽一下: 虽然有优秀的IDEA支持,写一个Java非SpringBoot项目还是太浪费时间(可能IDEA的团队在开发的时候,就是实在受不了Java表达能力的捉急的才开发了Kotlin)。特别是看到ASTEvaluator里面那些处理计算的代码,我真的佩服宫老师居然能花那么多时间去搬砖(这些代码我是不管统一的编码风格,直接copy了)。 做编译前端的语言关键得有一个原生的模式匹配和函数头等成员的支持,要不然写起来太累太费时间,所以我这个项目就是支持到成功运行样例的程度,没有很强的动力去拓展别的。

你好。我运行PlayScript with "-v scratch.play", 得到这个NPE(在函数调用那个例子)。 或者这个简单的例子 String script = "int b= 10; int myfunc(int a) {return a+b+3;} myfunc(2);"; Exception in thread "main" java.lang.NullPointerException at play.TypeResolver.exitFormalParameter(TypeResolver.java:96) at play.PlayScriptParser$FormalParameterContext.exitRule(PlayScriptParser.java:940) at org.antlr.v4.runtime.tree.ParseTreeWalker.exitRule(ParseTreeWalker.java:47) at...

Bumps [junit](https://github.com/junit-team/junit4) from 4.11 to 4.13.1. Release notes Sourced from junit's releases. JUnit 4.13.1 Please refer to the release notes for details. JUnit 4.13 Please refer to the release notes...

dependencies

Bumps [junit](https://github.com/junit-team/junit4) from 4.11 to 4.13.1. Release notes Sourced from junit's releases. JUnit 4.13.1 Please refer to the release notes for details. JUnit 4.13 Please refer to the release notes...

dependencies

在学习过程中遇到了一些困难,反复看了几遍文章,把评论区也翻了几遍,也看到其他同学有相同疑惑,没有答复。 接下来不知道该如何进行下去了。心中存有疑惑,找不到合适的解惑渠道。 老师能否提供一个交流群,方便同学们在里面交流。新来的同学向学过的同学请教

chore: refactored some code in SimpleParser