dpwtr666638 2015-02-17 06:10
浏览 61
已采纳

为什么在定义更多类型时会导致yacc解析器崩溃?

I wrote a test.y file with more types. After certain limit, when I compiled the file with command, go tool yacc test

It panics,"Index out of range in yacc.go:891" When I looked at the file https://golang.org/src/cmd/yacc/yacc.go, I saw this comment in defining the constants "the following are adjustable according to memory size" Is there a reason why they have limited the number of type definition to 63(NTYPES = 63) in line 74(in the file mentioned in the link above)

  • 写回答

2条回答 默认 最新

  • dongpu9852 2015-02-19 17:51
    关注

    "It panics,"Index out of range in yacc.go:891" "

    I got into the same problem because I needed more types (non-term and term types) and what I did to remedy my situation was to change several values.

    Please see my GitHub page documenting my change.

    Or simply click on the URL below.

    https://github.com/MagnusTiberius/go/commit/d4eeb860229867c76d99e67d69bdbd7cc729ce2c

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥35 基于python的有ssl加密传输的socket聊天室
  • ¥15 数码管亮度控制器设计
  • ¥15 kafka客户端跨网段访问,看日志提示连接的还剩内网地址,且访问不通
  • ¥15 关于c语言代码的问题
  • ¥15 c51单片机控制步进电机
  • ¥20 Visual studio无法检测到设备
  • ¥30 vue 页面窗口放大或者缩小元素会变化
  • ¥15 questasim仿真报错
  • ¥15 寻找电脑攻防的导师,有问题请教一下。
  • ¥20 微信同是win11,我的电脑安装不了pageoffice,一直无法打开