de.fosd.typechef.typesystem

CDeclTyping

trait CDeclTyping extends CTypes with CEnv with CTypeSystemInterface with CDeclUseInterface

parsing types from declarations (top level declarations, parameters, etc)

handling of typedef synonyms

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CDeclTyping
  2. CDeclUseInterface
  3. CTypeSystemInterface
  4. CEnv
  5. CTypes
  6. COptionProvider
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type EnumEnv = Map[String, (FeatureExpr, Id)]

    Enum Environment: Just a set of names that are valid enums.

    Enum Environment: Just a set of names that are valid enums. No need to remember fields etc, because they are integers anyway and no further checking is done in C

    Definition Classes
    CEnv
  2. class Env extends AnyRef

    Attributes
    protected
    Definition Classes
    CEnv
  3. type LabelEnv = Map[String, FeatureExpr]

    label environment: stores which labels are reachable from a goto.

    label environment: stores which labels are reachable from a goto.

    the environment is filled upon function entry for the entire function and just stores under which condition a label is defined

    Definition Classes
    CEnv
  4. type PtrEnv = Set[String]

    Definition Classes
    CTypes
  5. class StructEnv extends AnyRef

    Definition Classes
    CEnv
  6. case class StructTag(isComplete: Boolean, fields: ConditionalTypeMap, scope: Int, id: Option[Id] = scala.None) extends Product with Serializable

    for struct and union ConditionalTypeMap represents for the fields of the struct

  7. type VarTypingContext = ConditionalVarEnv

    *** Variable-Typing context (collects all top-level and local declarations) variables with local scope overwrite variables with global scope

    *** Variable-Typing context (collects all top-level and local declarations) variables with local scope overwrite variables with global scope

    Definition Classes
    CEnv

Abstract Value Members

  1. abstract def addStructDeclarationToEnv(e: StructDeclaration, featureExpr: FeatureExpr, env: Env): Env

  2. abstract def checkEnumInitializer(initializer: Expr, fexpr: FeatureExpr, env: Env): Unit

    Attributes
    protected
  3. abstract def getExprType(expr: Expr, featureExpr: FeatureExpr, env: Env): Conditional[CType]

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object EmptyEnv extends Env

    Definition Classes
    CEnv
  7. def addAnonStructUse(id: Id, fields: ConditionalTypeMap): Unit

    Definition Classes
    CDeclUseInterface
  8. def addDecl(current: Any, featureExpr: FeatureExpr, env: Env, isDefinition: Boolean = true): Unit

    Definition Classes
    CDeclUseInterface
  9. def addDefinition(definition: AST, env: Env, feature: FeatureExpr = FeatureExprFactory.True, isFunctionDeclarator: Boolean = false): Unit

    Definition Classes
    CDeclUseInterface
  10. def addEnumUse(entry: AST, env: Env, feature: FeatureExpr): Unit

    Definition Classes
    CDeclUseInterface
  11. def addEnv(ast: AST, env: Env): Unit

    invoked before every external decl, statement and expression with the environment of that node

    invoked before every external decl, statement and expression with the environment of that node

    for example to debug the environment

    mixed in from CEnvCache

    Attributes
    protected
    Definition Classes
    CTypeSystemInterface
  12. def addJumpStatements(compoundStatement: CompoundStatement): Unit

    Definition Classes
    CDeclUseInterface
  13. def addOldStyleParameters(oldStyleParameters: List[Opt[OldParameterDeclaration]], declarator: Declarator, expr: FeatureExpr, env: Env): Unit

    Definition Classes
    CDeclUseInterface
  14. def addStructDeclUse(entry: Id, env: Env, isUnion: Boolean, feature: FeatureExpr): Unit

    Definition Classes
    CDeclUseInterface
  15. def addStructDefinition(definition: AST, env: Env, feature: FeatureExpr): Unit

    Definition Classes
    CDeclUseInterface
  16. def addStructRedeclaration(env: Env, declaration: Id, feature: FeatureExpr, isUnion: Boolean): Unit

    Definition Classes
    CDeclUseInterface
  17. def addStructUse(entry: AST, featureExpr: FeatureExpr, env: Env, structName: String, isUnion: Boolean): Unit

    Definition Classes
    CDeclUseInterface
  18. def addTypeUse(entry: AST, env: Env, feature: FeatureExpr): Unit

    Definition Classes
    CDeclUseInterface
  19. def addUse(entry: AST, feature: FeatureExpr, env: Env): Unit

    Definition Classes
    CDeclUseInterface
  20. def arrayType(t: CType): Boolean

    Definition Classes
    CTypes
  21. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  22. def assertTypeSystemConstraint(condition: Boolean, featureExpr: FeatureExpr, msg: String, where: AST): Boolean

    Attributes
    protected
    Definition Classes
    CTypeSystemInterface
  23. def checkStructCompleteness(ctype: CType, expr: FeatureExpr, env: Env, where: AST, checkedStructs: List[String] = Nil): Unit

    ensure that the type is complete in the given environment

    ensure that the type is complete in the given environment

    used for example when declaring or dereferencing a variable

    Attributes
    protected
  24. def checkStructCompletenessC(ctype: Conditional[CType], expr: FeatureExpr, env: Env, where: AST, checkedStructs: List[String] = Nil): Unit

    Attributes
    protected
  25. def checkingExternal(externalDef: ExternalDef): Unit

    invoked before checking an external declaration (for example used for progress reports)

    invoked before checking an external declaration (for example used for progress reports)

    Attributes
    protected
    Definition Classes
    CTypeSystemInterface
  26. def clearDeclUseMap(): Unit

    Definition Classes
    CDeclUseInterface
  27. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. def coerce(expectedType: CType, foundType: CType): Boolean

    determines whether types are compatible in assignements etc

    determines whether types are compatible in assignements etc

    for "a=b;" with a:type1 and b:type2

    Definition Classes
    CTypes
  29. def constructType(specifiers: List[Opt[Specifier]], featureExpr: FeatureExpr, env: Env, locationForErrorMsg: AST): Conditional[CType]

  30. def converse(a: CType, b: CType): CType

    ansi c conversion rules of two arithmetic types (if called on other types, it just returns the first type; hence the pattern if cocerce(x,y) return converse(x,y) should yield the default behavior )

    ansi c conversion rules of two arithmetic types (if called on other types, it just returns the first type; hence the pattern if cocerce(x,y) return converse(x,y) should yield the default behavior )

    default is int. if either operand has a higher priority, it is preferred over int

    according to specification: http://techpubs.sgi.com/library/manuals/0000/007-0701-150/pdf/007-0701-150.pdf

    Definition Classes
    CTypes
  31. def declType(specs: List[Opt[Specifier]], decl: Declarator, attributes: List[Opt[AttributeSpecifier]], featureExpr: FeatureExpr, env: Env, oldStyleParameterTypes: ConditionalTypeMap = null): Conditional[CType]

    oldStyleParameterTypes

    only used when resolving a function

  32. def enumDeclarations(specs: List[Opt[Specifier]], featureExpr: FeatureExpr, d: AST, env: Env): List[(String, FeatureExpr, AST, Conditional[CType], DeclarationKind, Conditional[Linkage])]

    define all fields from enum type specifiers as int values

    define all fields from enum type specifiers as int values

    enum is always interpreted as definition, not declaration. it conflicts with other definitions and other declarations.

    important: this recurses into structures!

    Attributes
    protected
  33. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  34. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  35. def filterDeadSpecifiers[T](l: List[Opt[T]], ctx: FeatureExpr): List[Opt[T]]

    filtering is a workaround for a parsing problem (see open test) that can produce False AST-subtrees in some combinations.

    filtering is a workaround for a parsing problem (see open test) that can produce False AST-subtrees in some combinations.

    remove when problem is fixed

    Attributes
    protected
  36. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  37. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  38. def getDeclarationType(specifiers: List[Opt[Specifier]], decl: Declarator, featureExpr: FeatureExpr, env: Env): Conditional[CType]

    Attributes
    protected
  39. def getDeclaratorType(decl: Declarator, returnType: Conditional[CType], featureExpr: FeatureExpr, env: Env, oldStyleParameterTypes: ConditionalTypeMap = null): Conditional[CType]

    Attributes
    protected
  40. def getDeclaredVariables(decl: Declaration, featureExpr: FeatureExpr, env: Env, checkInitializer: (Expr, Conditional[CType], FeatureExpr, Env) ⇒ Unit = noInitCheck): (Env, List[(String, FeatureExpr, AST, Conditional[CType], DeclarationKind, Conditional[Linkage])])

    get a list of all declared variables from a declaration.

    get a list of all declared variables from a declaration. also checks that declarations are wellformed (e.g., structs are complete)

  41. def getExternCondition(specifiers: List[Opt[Specifier]]): FeatureExpr

    Attributes
    protected
  42. def getFunctionType(specifiers: List[Opt[Specifier]], declarator: Declarator, oldStyleParameters: ConditionalTypeMap, featureExpr: FeatureExpr, env: Env): Conditional[CType]

  43. def getIsExtern(list: List[Opt[Specifier]]): FeatureExpr

    under which condition is modifier extern defined?

  44. def getLinkage(symbol: String, isFunctionDef: Boolean, specifiers: List[Opt[Specifier]], fexpr: FeatureExpr, env: Env, where: AST): Conditional[Linkage]

    linkage depends on previous identifiers in scope, on the scope (file level or not) and the specifiers

    linkage depends on previous identifiers in scope, on the scope (file level or not) and the specifiers

    see http://publications.gbdirect.co.uk/c_book/chapter8/declarations_and_definitions.html

    Attributes
    protected
  45. def getOldStyleParameters(oldStyleParameters: List[Opt[OldParameterDeclaration]], featureExpr: FeatureExpr, env: Env): ConditionalTypeMap

    Attributes
    protected
  46. def getSpecifierCondition(specifiers: List[Opt[Specifier]], specifier: Specifier): FeatureExpr

    Attributes
    protected
  47. def getStaticCondition(specifiers: List[Opt[Specifier]]): FeatureExpr

    Attributes
    protected
  48. def getTypenameType(typename: TypeName, featureExpr: FeatureExpr, env: Env): Conditional[CType]

  49. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  50. def init(): Unit

    Definition Classes
    CDeclUseInterface
  51. def isArithmetic(t: CType): Boolean

    Definition Classes
    CTypes
  52. def isArray(t: CType): Boolean

    Definition Classes
    CTypes
  53. def isCharSignCoercion(a: AType, b: AType): Boolean

    are both types char but with different signage?

    are both types char but with different signage?

    Attributes
    protected
    Definition Classes
    CTypes
  54. def isCompound(t: CType): Boolean

    Definition Classes
    CTypes
  55. def isForcedCoercion(expectedType: AType, foundType: AType): Boolean

    we can report as a warning if both types are number, but they are not the same width or signed

    we can report as a warning if both types are number, but they are not the same width or signed

    Definition Classes
    CTypes
  56. def isFunction(t: CType): Boolean

    Definition Classes
    CTypes
  57. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  58. def isIntegral(t: CType): Boolean

    Definition Classes
    CTypes
  59. def isPointer(t: CType): Boolean

    Definition Classes
    CTypes
  60. def isScalar(t: CType): Boolean

    Definition Classes
    CTypes
  61. def isStruct(t: CType): Boolean

    Definition Classes
    CTypes
  62. def isTypedef(specs: List[Opt[Specifier]]): Boolean

  63. def isZero(t: CType): Boolean

    Definition Classes
    CTypes
  64. def issueTypeError(severity: Severity, condition: FeatureExpr, msg: String, where: AST, severityExtra: String = ""): Unit

    error reporting for type errors

    error reporting for type errors

    Attributes
    protected
    Definition Classes
    CTypeSystemInterface
  65. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  66. def normalize(t: AType): AType

    Attributes
    protected
    Definition Classes
    CTypes
  67. def normalize(t: CType): CType

    normalize types for internal comparison in coerce (do not return this to the outside)

    normalize types for internal comparison in coerce (do not return this to the outside)

    * function -> pointer to function

    * pointer to pointer to function -> pointer to function

    * remove any CObj within the type

    * regard arrays as pointers

    * pointer to ignore equals ignore

    * CVoid in function parameters is removed

    Attributes
    protected
    Definition Classes
    CTypes
  68. final def notify(): Unit

    Definition Classes
    AnyRef
  69. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  70. def opts: ICTypeSysOptions

    Attributes
    protected
    Definition Classes
    COptionProvider
  71. def parseStructMembers(members: List[Opt[StructDeclaration]], featureExpr: FeatureExpr, initialEnv: Env): ConditionalTypeMap

  72. def promote(x: CType): CType

    promotion is what happens internally during conversion

    promotion is what happens internally during conversion

    Definition Classes
    CTypes
  73. def recognizeTypedefs(decl: Declaration, featureExpr: FeatureExpr, env: Env): Seq[(String, FeatureExpr, (AST, Conditional[CType]))]

    Attributes
    protected
  74. final def reportTypeError(featureExpr: FeatureExpr, txt: String, where: AST, severity: Severity = Severity.OtherError, severityExtra: String = ""): CUnknown

    Attributes
    protected
    Definition Classes
    CTypeSystemInterface
  75. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  76. implicit def toCType(x: CLong): AType

    Definition Classes
    CTypes
  77. implicit def toCType(x: CShort): AType

    Definition Classes
    CTypes
  78. implicit def toCType(x: CChar): AType

    Definition Classes
    CTypes
  79. implicit def toCType(x: CInt): AType

    Definition Classes
    CTypes
  80. def toString(): String

    Definition Classes
    AnyRef → Any
  81. def typedExpr(expr: Expr, ctype: Conditional[CType], featureExpr: FeatureExpr, env: Env): Unit

    invoked after typing an expression

    invoked after typing an expression

    refined by CTypeCache if desired

    Attributes
    protected
    Definition Classes
    CTypeSystemInterface
  82. def typedFunction(fun: FunctionDef, ctype: Conditional[CType], featureExpr: FeatureExpr): Unit

    invoked after typing a function definition (top level declaration, not nested function)

    invoked after typing a function definition (top level declaration, not nested function)

    Attributes
    protected
    Definition Classes
    CTypeSystemInterface
  83. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  84. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  85. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CDeclUseInterface

Inherited from CTypeSystemInterface

Inherited from CEnv

Inherited from CTypes

Inherited from COptionProvider

Inherited from AnyRef

Inherited from Any

Ungrouped