icyphy / ptII

Ptolemy II is an open-source software framework supporting experimentation with actor-oriented design.
https://ptolemy.eecs.berkeley.edu/ptolemyII
Other
99 stars 43 forks source link

JavaCC 4.1 and 4.2 fail because of ReInit() problems #182

Open cxbrooks opened 15 years ago

cxbrooks commented 15 years ago

Note: the issue was created automatically with bugzilla2github tool

Original bug ID: BZ#286 From: @cxbrooks Reported version: 7.1.devel CC: pt-dev@chess.eecs.berkeley.edu

cxbrooks commented 15 years ago

JavaCC-4.1 and 4.2 fail Tests in data/expr/test/FileParameter.tcl fails with: java.lang.Error: ERROR: Second call to the constructor of a static SimpleCharStream. You must either use ReInit() or set the JavaCC option STATIC to false during the generation of this class. at ptolemy.data.expr.SimpleCharStream.(SimpleCharStream.java:283) at ptolemy.data.expr.SimpleCharStream.(SimpleCharStream.java:300) at ptolemy.data.expr.PtParser.(PtParser.java:2971)

However, JavaCC-4.0 does work.

I looked at this awhile ago and setting the JavaCC option STATIC did not solve the problem.

We use JavaCC in ptolemy/data/expr for PtParser.jjt and MatrixParser.jjt We also use it in moml/unit for Units.jjt

It would be nice to review this and fix it sometime.