Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CPPAstLiteralExpression.getKind() returning eUnspecified for int literals and eVoid for all other literals which are not char

But, it looks like double values return a type lk_float_constant

On Fri, Dec 12, 2014 at 7:53 PM, Krishna Narasimhan <krishna.nm86@xxxxxxxxx> wrote:
Cool. Thanks. It looks like I have been comparing with the wrong Enum. 

On Fri, Dec 12, 2014 at 7:27 PM, Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx> wrote:


On Fri, Dec 12, 2014 at 9:00 AM, Krishna Narasimhan <krishna.nm86@xxxxxxxxx> wrote:
void fn2(float x) {
x = 3.0;
int y;
y = 2;
char* yy;
yy = "zzzz";
double d;
d = 3.6;
}

In the above code, when I try to call getKind of the literals,

I get 
 
Name of kind eVoid  1 (for 3.0)

The value 1 means lk_float_constant, not eVoid.
 
Type of kind org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBasicType
Name of kind eWChar  3 (for "zzz")
Type of kind org.eclipse.cdt.internal.core.dom.parser.cpp.CPPArrayType
Name of kind eUnspecified  0  (for 2)
Type of kind org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBasicType
Name of kind eVoid  1 (for 3.6)
Type of kind org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBasicType



Anybody knows what the issue is here?

Regards
       Krishna

-sergey 

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev


--
-----------------------------------------------------
I dare do all that may become a man; Who dares do more, is none - Macbeth, twelfh night!
Regards
       Krishna


--
-----------------------------------------------------
I dare do all that may become a man; Who dares do more, is none - Macbeth, twelfh night!
Regards
       Krishna

Back to the top