History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ANTLR-36
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Terence Parr
Reporter: Kunle Odutola
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ANTLR v3

ANTLR V3 Java runtime has a static dependency on stringtemplate.jar

Created: 10/Nov/06 02:52 PM   Updated: 03/Apr/07 01:13 PM
Component/s: Java target
Affects Version/s: 3.0b5
Fix Version/s: 3.0b7


 Description  « Hide
The RuleReturnScope class has an attribute 'Template' of type 'org.antlr.stringtemplate.StringTemplate'. This is the source of the static dependency on stringtemplate.jar.

This is an issue because StringTemplate's lexers/parsers/treeparsers are due to be rewritten in ANTLR V3. Hence the V3 runtime will depend on StringTemplate which in turn depends on the V2 runtime....

Does the 'Template' attribute in RuleReturnScope have to be typed?. None of it's other attributes are.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Terence Parr - 10/Nov/06 03:01 PM
THis is no problem unless you don't want to include stringtemplate.jar when not using ST, right?

Kunle Odutola - 10/Nov/06 03:08 PM
I believe that is the case. The circular dependency is likely to be ugly rather than fatal.

What this means is that at the moment, applications built in V3 would need to include:
- antlr-3.XX.jar
- stringtemplate.jar
- antlr-2.XXX.jar (since StringTemplate is built with ANTLR 2.x)

If they don't use StringTemplate (as many don't), that is a real pain.

Does RuleReturnScope really *need* that typed attribute?

Terence Parr - 10/Nov/06 03:11 PM
You are correct. THe dependency is odious. :( I guess we could use Object. ANTLR can generate a cast I guess for people using $a.st. Does that make sense?

Terence Parr - 30/Mar/07 04:04 PM
Removed getTree and getTemplate from rule return. Don't need them. Only added them because I needed to get result trees/st's from rule return objects in my toTemplateList() or whatever, but I've removed those methods. Don't need this stuff anymore.

Terence Parr - 30/Mar/07 04:50 PM
actually I have to leave getTree in there.

Terence Parr - 03/Apr/07 01:13 PM
and unfortunately I need getTemplate in there too, but made it return Object.