de.fosd.typechef.typesystem

CExprTyping

trait CExprTyping extends CTypes with CEnv with CDeclTyping with CTypeSystemInterface with CDeclUseInterface

typing C expressions

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CExprTyping
  2. CDeclTyping
  3. CDeclUseInterface
  4. CTypeSystemInterface
  5. CEnv
  6. CTypes
  7. COptionProvider
  8. AnyRef
  9. 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

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

    Attributes
    protected
    Definition Classes
    CDeclTyping
  3. abstract def getStmtType(stmt: Statement, featureExpr: FeatureExpr, env: Env): (Conditional[CType], Env)

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
    Definition Classes
    CDeclTyping
  24. def checkStructCompletenessC(ctype: Conditional[CType], expr: FeatureExpr, env: Env, where: AST, checkedStructs: List[String] = Nil): Unit

    Attributes
    protected
    Definition Classes
    CDeclTyping
  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]

    Definition Classes
    CDeclTyping
  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

    Definition Classes
    CDeclTyping
  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
    Definition Classes
    CDeclTyping
  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
    Definition Classes
    CDeclTyping
  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
    Definition Classes
    CDeclTyping
  39. def getDeclaratorType(decl: Declarator, returnType: Conditional[CType], featureExpr: FeatureExpr, env: Env, oldStyleParameterTypes: ConditionalTypeMap = null): Conditional[CType]

    Attributes
    protected
    Definition Classes
    CDeclTyping
  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)

    Definition Classes
    CDeclTyping
  41. def getExprType(expr: Expr, featureExpr: FeatureExpr, env: Env): Conditional[CType]

    types an expression in an environment, returns a new environment for all subsequent tokens (eg in a sequence)

    types an expression in an environment, returns a new environment for all subsequent tokens (eg in a sequence)

    Definition Classes
    CExprTypingCDeclTyping
  42. def getExprTypeRec(expr: Expr, featureExpr: FeatureExpr, env: Env, recurse: Boolean = false): Conditional[CType]

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

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

    Definition Classes
    CDeclTyping
  45. def getIsExtern(list: List[Opt[Specifier]]): FeatureExpr

    under which condition is modifier extern defined?

    under which condition is modifier extern defined?

    Definition Classes
    CDeclTyping
  46. 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
    Definition Classes
    CDeclTyping
  47. def getOldStyleParameters(oldStyleParameters: List[Opt[OldParameterDeclaration]], featureExpr: FeatureExpr, env: Env): ConditionalTypeMap

    Attributes
    protected
    Definition Classes
    CDeclTyping
  48. def getSpecifierCondition(specifiers: List[Opt[Specifier]], specifier: Specifier): FeatureExpr

    Attributes
    protected
    Definition Classes
    CDeclTyping
  49. def getStaticCondition(specifiers: List[Opt[Specifier]]): FeatureExpr

    Attributes
    protected
    Definition Classes
    CDeclTyping
  50. def getTypenameType(typename: TypeName, featureExpr: FeatureExpr, env: Env): Conditional[CType]

    Definition Classes
    CDeclTyping
  51. def hashCode(): Int

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

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

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

    Definition Classes
    CTypes
  55. 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
  56. def isCompound(t: CType): Boolean

    Definition Classes
    CTypes
  57. 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
  58. def isFunction(t: CType): Boolean

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

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

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

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

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

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

    Definition Classes
    CDeclTyping
  65. def isZero(t: CType): Boolean

    Definition Classes
    CTypes
  66. 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
  67. def markSecurityRelevantFunctions(funname: String, ctype: Conditional[CType]): Conditional[CType]

    hardcoding of functions for which parameters are considered security relevant parameters of these functions are checked for integer overflows

  68. final def ne(arg0: AnyRef): Boolean

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

    Attributes
    protected
    Definition Classes
    CTypes
  70. 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
  71. final def notify(): Unit

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

    Definition Classes
    AnyRef
  73. def opts: ICTypeSysOptions

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

    Definition Classes
    CDeclTyping
  75. def promote(x: CType): CType

    promotion is what happens internally during conversion

    promotion is what happens internally during conversion

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

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

    Attributes
    protected
    Definition Classes
    CTypeSystemInterface
  78. def sizeofType(env: Env, x: AST, featureExpr: FeatureExpr): Conditional[CType]

    sizeof() has type Any->size_t.

    sizeof() has type Any->size_t. Type size_t is defined in individual header files (e.g. stddef.h) of the system though and may not be defined in all cases. here we look up the type of size_t and return an int in case it fails

  79. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Definition Classes
    CTypes
  84. def toString(): String

    Definition Classes
    AnyRef → Any
  85. 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
  86. 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
  87. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  90. def wider(t1: CType, t2: CType): CType

    returns the wider of two types for automatic widening

Inherited from CDeclTyping

Inherited from CDeclUseInterface

Inherited from CTypeSystemInterface

Inherited from CEnv

Inherited from CTypes

Inherited from COptionProvider

Inherited from AnyRef

Inherited from Any

Ungrouped