Eclipse CDT
7.0

org.eclipse.cdt.core.dom.ast
Interface IASTSimpleDeclSpecifier

All Superinterfaces:
IASTDeclSpecifier, IASTNode
All Known Subinterfaces:
ICASTSimpleDeclSpecifier, ICPPASTSimpleDeclSpecifier, IGCCASTSimpleDeclSpecifier, IGPPASTSimpleDeclSpecifier

public interface IASTSimpleDeclSpecifier
extends IASTDeclSpecifier

This represents a declaration specifier for a built-in type.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
IASTNode.CopyStyle
 
Field Summary
static ASTNodeProperty DECLTYPE_EXPRESSION
           
static int t_auto
          auto c = expression;
static int t_bool
          Represents a boolean type (bool in c++, _Bool in c)
static int t_char
          char c;
static int t_char16_t
          char16_t c;
static int t_char32_t
          char32_t c;
static int t_decltype
          decltype('c') c;
static int t_double
          double d;
static int t_float
          float f;
static int t_float128
          __float128 i;
static int t_int
          int i;
static int t_int128
          __int128 i;
static int t_last
          Deprecated. all constants must be defined in this interface
static int t_typeof
          typeof 'c' c;
static int t_unspecified
          Used for omitted declaration specifiers.
static int t_void
          void x();
static int t_wchar_t
          wchar_t c;
 
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier
sc_auto, sc_extern, sc_last, sc_mutable, sc_register, sc_static, sc_typedef, sc_unspecified
 
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAY
 
Method Summary
 IASTSimpleDeclSpecifier copy()
          Returns a mutable copy of the tree rooted at this node.
 IASTExpression getDeclTypeExpression()
          Returns the expression for simple declaration specifiers of type t_decltype or t_typeof.
 int getType()
          Returns the built-in type for the declaration.
 boolean isComplex()
          _Complex t;
 boolean isImaginary()
          _Imaginary t;
 boolean isLong()
          long int l;
 boolean isLongLong()
          long long int l;
 boolean isShort()
          short int s;
 boolean isSigned()
          signed char c;
 boolean isUnsigned()
          unsigned int u;
 void setComplex(boolean value)
          Not allowed on frozen ast.
 void setDeclTypeExpression(IASTExpression expression)
          Not allowed on frozen ast.
 void setImaginary(boolean value)
          Not allowed on frozen ast.
 void setLong(boolean value)
          Not allowed on frozen ast.
 void setLongLong(boolean value)
          Not allowed on frozen ast.
 void setShort(boolean value)
          Not allowed on frozen ast.
 void setSigned(boolean value)
          Not allowed on frozen ast.
 void setType(IBasicType.Kind kind)
          Not allowed on frozen ast.
 void setType(int type)
          Not allowed on frozen ast.
 void setUnsigned(boolean value)
          Not allowed on frozen ast.
 
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier
copy, getStorageClass, isConst, isInline, isRestrict, isVolatile, setConst, setInline, setRestrict, setStorageClass, setVolatile
 
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
accept, contains, getChildren, getContainingFilename, getFileLocation, getLeadingSyntax, getNodeLocations, getOriginalNode, getParent, getPropertyInParent, getRawSignature, getSyntax, getTrailingSyntax, getTranslationUnit, isActive, isFrozen, isPartOfTranslationUnitFile, setParent, setPropertyInParent
 

Field Detail

DECLTYPE_EXPRESSION

static final ASTNodeProperty DECLTYPE_EXPRESSION
Since:
5.2

t_unspecified

static final int t_unspecified
Used for omitted declaration specifiers. E.g. for declaration of constructors, or in plain c, where this defaults to an integer.

See Also:
Constant Field Values

t_void

static final int t_void
void x();

See Also:
Constant Field Values

t_char

static final int t_char
char c;

See Also:
Constant Field Values

t_int

static final int t_int
int i;

See Also:
Constant Field Values

t_float

static final int t_float
float f;

See Also:
Constant Field Values

t_double

static final int t_double
double d;

See Also:
Constant Field Values

t_bool

static final int t_bool
Represents a boolean type (bool in c++, _Bool in c)

Since:
5.2
See Also:
Constant Field Values

t_wchar_t

static final int t_wchar_t
wchar_t c;

Since:
5.2
See Also:
Constant Field Values

t_typeof

static final int t_typeof
typeof 'c' c;

Since:
5.2
See Also:
Constant Field Values

t_decltype

static final int t_decltype
decltype('c') c;

Since:
5.2
See Also:
Constant Field Values

t_auto

static final int t_auto
auto c = expression;

Since:
5.2
See Also:
Constant Field Values

t_char16_t

static final int t_char16_t
char16_t c;

Since:
5.2
See Also:
Constant Field Values

t_char32_t

static final int t_char32_t
char32_t c;

Since:
5.2
See Also:
Constant Field Values

t_int128

static final int t_int128
__int128 i;

Since:
5.5
See Also:
Constant Field Values

t_float128

static final int t_float128
__float128 i;

Since:
5.5
See Also:
Constant Field Values

t_last

@Deprecated
static final int t_last
Deprecated. all constants must be defined in this interface
See Also:
Constant Field Values
Method Detail

copy

IASTSimpleDeclSpecifier copy()
Description copied from interface: IASTNode
Returns a mutable copy of the tree rooted at this node. The following postconditions hold: copy.getParent() == null copy.getPropertyInParent() == null copy.isFrozen() == false Preprocessor nodes do not currently support being copied. Implicit name nodes are not copied, instead they can be regenerated if required. Calling this method is equivalent

Specified by:
copy in interface IASTDeclSpecifier
Specified by:
copy in interface IASTNode
Since:
5.1

getType

int getType()
Returns the built-in type for the declaration. The type is then refined by qualifiers for signed/unsigned and short/long. The type could also be unspecified which usually means int.


isSigned

boolean isSigned()
signed char c;


isUnsigned

boolean isUnsigned()
unsigned int u;


isShort

boolean isShort()
short int s;


isLong

boolean isLong()
long int l;


isLongLong

boolean isLongLong()
long long int l;

Since:
5.2

isComplex

boolean isComplex()
_Complex t;

Since:
5.2

isImaginary

boolean isImaginary()
_Imaginary t;

Since:
5.2

getDeclTypeExpression

IASTExpression getDeclTypeExpression()
Returns the expression for simple declaration specifiers of type t_decltype or t_typeof. Other simple declaration specifiers will return null.

Since:
5.2

setType

void setType(int type)
Not allowed on frozen ast.

See Also:
getType()

setType

void setType(IBasicType.Kind kind)
Not allowed on frozen ast. Sets this declaration specifier to the type based on IBasicType.Kind.

Since:
5.2

setSigned

void setSigned(boolean value)
Not allowed on frozen ast.

See Also:
isSigned()

setUnsigned

void setUnsigned(boolean value)
Not allowed on frozen ast.

See Also:
isUnsigned()

setShort

void setShort(boolean value)
Not allowed on frozen ast.

See Also:
isShort()

setLong

void setLong(boolean value)
Not allowed on frozen ast.

See Also:
isLong()

setLongLong

void setLongLong(boolean value)
Not allowed on frozen ast.

Since:
5.2
See Also:
isLongLong()

setComplex

void setComplex(boolean value)
Not allowed on frozen ast.

Since:
5.2
See Also:
isComplex()

setImaginary

void setImaginary(boolean value)
Not allowed on frozen ast.

Since:
5.2
See Also:
isImaginary()

setDeclTypeExpression

void setDeclTypeExpression(IASTExpression expression)
Not allowed on frozen ast.

Since:
5.2
See Also:
getDeclTypeExpression()

Eclipse CDT
7.0

Copyright (c) IBM Corp. and others 2004, 2012. All Rights Reserved.