[antlr-interest] Variable visibility problem with ANTLR 3code
jimi at intersystems.com
Wed Aug 23 08:49:20 PDT 2006
From: Denis Washington [mailto:dwashington at gmx.net]
Sent: Wednesday, August 23, 2006 4:13 AM
>>> declarationStatement returns [DeclarationStatement ds]
>>> : var=varOrConstDeclaration
>>> $ds = new DeclarationStatement($var);
OK, I see what is happening now. ANTLR is seeing your $ds.setSource as a reference to an attribute of $ds as if you had done this:
Returns [ int setSource, int something else]
This is because you can reference attributes of a $ref such as $ref.text and $ref.tree etc. You will have to disambiguate this a bit.
declarationStatement returns [DeclarationStatement ds]
localDS = new DeclarationStatement($var);
$ds = localDS;
Or it is possible that the following might work (have not tried this though):
If the above does not work, then perhaps it should as a way to distinguish between label attributes and object elements of the label type.
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.5/425 - Release Date: 8/22/2006
More information about the antlr-interest