Package org.cakelab.blender.metac
Class CMetaModel
- java.lang.Object
-
- org.cakelab.blender.metac.CMetaModel
-
public class CMetaModel extends java.lang.Object
CMetaModel is a meta model to describe types defined in C language.For example a pointer in C is specified by its base type and its specification (e.g. base type 'int' and specification '**' makes a pointer on a pointer on integer). Another example are arrays, such as array of chars 'char[]'. Thus, a fully described type has a type signature (e.g. 'int**' or 'char[32]') and related types. The 'int**' pointer references an 'int*' pointer which references an 'int' value and the char[32] array references 'char' values, 32 of them.
This meta model represents a given type specification in a chain of types, such as: 'pointer on' → 'pointer on' → 'int' as representation for 'int**' or 'array of' → 'pointer on' -> 'char' for char*[].
-
-
Constructor Summary
Constructors Constructor Description CMetaModel(DNAModel model)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CType
getArrayType(java.lang.String typename, java.lang.String typespec)
static int
getScalarSize(java.lang.String typeName, int addressWidth)
CStruct
getStruct(int sdnaIndex)
java.util.ArrayList<CStruct>
getStructs()
CType
getType(java.lang.String typeSignature)
Retrieve a type description for a given type signature.static boolean
isScalar(java.lang.String typeName)
-
-
-
Constructor Detail
-
CMetaModel
public CMetaModel(DNAModel model)
-
-
Method Detail
-
getArrayType
public CType getArrayType(java.lang.String typename, java.lang.String typespec)
-
isScalar
public static boolean isScalar(java.lang.String typeName)
-
getScalarSize
public static int getScalarSize(java.lang.String typeName, int addressWidth)
-
getStructs
public java.util.ArrayList<CStruct> getStructs()
-
getStruct
public CStruct getStruct(int sdnaIndex)
-
getType
public CType getType(java.lang.String typeSignature)
Retrieve a type description for a given type signature.- Parameters:
typeSignature
- Signature of the type (e.g. a struct name such as "Scene" or "Mesh" or a type signature such as "int" or "int*" etc.)- Returns:
- Associated type.
-
-