xtc.type
Class FunctionT

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.type.Type
          extended by xtc.type.DerivedT
              extended by xtc.type.FunctionOrMethodT
                  extended by xtc.type.FunctionT
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable

public class FunctionT
extends FunctionOrMethodT

A function type. Note that a C function with an old-style declarator must be annotated with the Constants.ATT_STYLE_OLD attribute. An old-style definition must also be annotated with the Constants.ATT_DEFINED attribute.

Version:
$Revision: 1.31 $
Author:
Robert Grimm

Nested Class Summary
 
Nested classes/interfaces inherited from class xtc.type.Type
Type.Tag
 
Field Summary
 
Fields inherited from class xtc.type.FunctionOrMethodT
exceptions, name, parameters, result, varargs
 
Constructor Summary
FunctionT(Type result)
          Create a new function type.
FunctionT(Type result, java.util.List<Type> parameters, boolean varargs)
          Create a new function type.
FunctionT(Type template, Type result, java.util.List<Type> parameters, boolean varargs)
          Create a new function type.
 
Method Summary
 FunctionT copy()
          Create a deep copy of this type.
 boolean isFunction()
          Determine whether this type is a function.
 Type.Tag tag()
          Get this type's tag.
 FunctionT toFunction()
          Get this type as a function.
 
Methods inherited from class xtc.type.FunctionOrMethodT
equals, getExceptions, getName, getParameters, getResult, hashCode, isVarArgs, seal, setExceptions, setParameters, setResult, write
 
Methods inherited from class xtc.type.DerivedT
isDerived
 
Methods inherited from class xtc.type.Type
addAttribute, annotate, attribute, attribute, attribute, attributes, cast, checkNotSealed, constant, constant, copy, deannotate, getAttribute, getAttribute, getConstant, getConstant, getLanguage, getLanguage, getLocation, getLocation, getScope, getScope, getShape, getShape, hasAlias, hasAnnotated, hasAttribute, hasAttribute, hasAttribute, hasAttribute, hasAttributes, hasConstant, hasConstant, hasEnum, hasEnumerator, hasError, hasInstantiated, hasLanguage, hasLanguage, hasLocation, hasLocation, hasParameterized, hasScope, hasScope, hasShape, hasShape, hasStructOrUnion, hasTag, hasTagged, hasVariable, hasWTag, isAlias, isAnnotated, isArray, isBoolean, isClass, isConcrete, isEnum, isEnumerator, isError, isFloat, isInstantiated, isInteger, isInterface, isInternal, isInternalParameter, isLabel, isMethod, isNamedParameter, isNumber, isPackage, isParameter, isParameterized, isPointer, isSealed, isStruct, isTuple, isUnion, isUnit, isVariable, isVariant, isVoid, isWildcard, isWrapped, language, locate, locate, mark, properties, removeAttribute, removeProperty, resolve, resolve, scope, seal, setLocation, setLocation, setProperty, shape, shape, toAlias, toAnnotated, toArray, toBoolean, toClass, toEnum, toEnumerator, toFloat, toInstantiated, toInteger, toInterface, toInternal, toInternalParameter, toLabel, toMethod, toNamedParameter, toNumber, toPackage, toParameter, toParameterized, toPointer, toStruct, toStructOrUnion, toTagged, toTuple, toUnion, toUnit, toVariable, toVariant, toVoid, toWildcard, toWrapped, trace, wtag
 
Methods inherited from class xtc.tree.Node
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getNode, getProperty, getString, getStringProperty, getTokenText, hasName, hasProperty, hasTraversal, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, remove, set, size, strip, toAnnotation, toList, toString, toToken
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FunctionT

public FunctionT(Type result)
Create a new function type.

Parameters:
result - The result type.

FunctionT

public FunctionT(Type result,
                 java.util.List<Type> parameters,
                 boolean varargs)
Create a new function type.

Parameters:
result - The result type.
parameters - The list of parameter types.
varargs - The flag for accepting a variable number of arguments.

FunctionT

public FunctionT(Type template,
                 Type result,
                 java.util.List<Type> parameters,
                 boolean varargs)
Create a new function type.

Parameters:
template - The type whose annotations to copy.
result - The result type.
parameters - The list of parameter types.
varargs - The flag for accepting a variable number of arguments.
Method Detail

copy

public FunctionT copy()
Description copied from class: Type
Create a deep copy of this type. The resulting type is not sealed.

Specified by:
copy in class Type
Returns:
A deep copy of this type.

tag

public Type.Tag tag()
Description copied from class: Type
Get this type's tag. Invocations to this method are forwarded across wrapped types.

Specified by:
tag in class Type
Returns:
This type's tag.
See Also:
Type.wtag()

isFunction

public boolean isFunction()
Description copied from class: Type
Determine whether this type is a function.

Overrides:
isFunction in class Type
Returns:
true if this type is a function.

toFunction

public FunctionT toFunction()
Description copied from class: Type
Get this type as a function.

Overrides:
toFunction in class Type
Returns:
This type has a function.


Copyright © 2012. All Rights Reserved.