ANTLRv4 StackOverflowError异常

时间:2013-02-28 18:30:47

标签: antlr4

我正在尝试为非常大的语法构建解析器。它是基于COBOL的,所以它有大量的令牌和规则。如果语法是干净的,它会给我一个'StackOverflowError'。我可以减少规则的数量,它将完成没有错误。但是一旦达到某一点,我就会得到以下警告和堆栈跟踪:

warning(125): CoolParser.g4:347:5: implicit definition of token 'DIR_COMPILER' in parser
warning(125): CoolParser.g4:389:19: implicit definition of token 'PIC_STRING' in parser
warning(125): CoolParser.g4:455:5: implicit definition of token 'STRING_VAL' in parser
warning(125): CoolParser.g4:2:13: implicit definition of token 'PART_STRING' in parser
warning(125): CoolParser.g4:651:5: implicit definition of token 'PARAGRAPH_NAME' in parser
warning(125): CoolParser.g4:888:5: implicit definition of token 'KW_STANDARD_1' in parser
warning(125): CoolParser.g4:889:5: implicit definition of token 'KW_STANDARD_2' in parser
warning(125): CoolParser.g4:1523:5: implicit definition of token 'NUMBER' in parser
warning(125): CoolParser.g4:2575:5: implicit definition of token 'COOL_CONSTANT' in parser
Exception in thread "main" java.lang.StackOverflowError
    at java.util.HashSet.add(Unknown Source)
    at org.antlr.v4.runtime.atn.LL1Analyzer._LOOK(LL1Analyzer.java:111)
    at org.antlr.v4.runtime.atn.LL1Analyzer._LOOK(LL1Analyzer.java:150)
    at org.antlr.v4.runtime.atn.LL1Analyzer._LOOK(LL1Analyzer.java:150)
    at org.antlr.v4.runtime.atn.LL1Analyzer._LOOK(LL1Analyzer.java:139)

0 个答案:

没有答案