aspose file tools
The moose likes Java in General and the fly likes CUP/LEX Parser byte limit exceeds. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "CUP/LEX Parser byte limit exceeds." Watch "CUP/LEX Parser byte limit exceeds." New topic
Author

CUP/LEX Parser byte limit exceeds.

Sanj Sharma
Ranch Hand

Joined: Feb 14, 2004
Posts: 32
Hi,

Presently i am using CUP/LEX parsers for my java application. My cup file code is increased to 5500 lines and now its crashing and not compiling giving "code too large " error because CUP/LEX uses 16-bit unicode character set whaich gives limit only 0-65535 and my parser is exceeding this limit. So i in trouble here all i wanted to know is that if i use ANTLR parser will this problem be there?? or anybody knows the solution to this problem ? Response will be greatly appriciated.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24057
    
  13

Hi,

Please don't post the same question to more than one forum; it just wastes people's time if they answer a question that's already been answered elsewhere. I deleted the other copy you put in "Advanced Java."

Your problem has nothing to do with Unicode, but rather the .class file format, which simply doesn't support methods larger than that.

I have some very large ANTLR parsers, so I suspect you wouldn't have the same problems with ANTLR. Under ANTLR, you write separate classes to deal with each production, so the resulting parser is much more modularized. Java CUP is much more old-school, with a table-driven structure like YACC.


[Jess in Action][AskingGoodQuestions]
Sanj Sharma
Ranch Hand

Joined: Feb 14, 2004
Posts: 32
Hill,

But i heard somewhere in the ANTLR disscussion forum that they also faced this problem. Do you really think antlr is the solution for this problem? how much big ANTLR file you have? see if i remove some 100 lines of code from my CUP file, i don't face any problem but after i put more code again it will give 65535 byte limit exceeded error in compiling. Please help.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: CUP/LEX Parser byte limit exceeds.
 
Similar Threads
can you convert a String into an executable line?
Implementation of SLR parser
Is this possible with regex?
Utility like generic compiler
Convert String into an expression.