Trait

de.fosd.typechef.typesystem

CBuiltIn

Related Doc: package typesystem

Permalink

trait CBuiltIn extends CEnv with CTypes with CDeclTyping

all compiler-specific built-in stuff

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

Type Members

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

    Permalink

    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

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

    Permalink

    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]

    Permalink
    Definition Classes
    CTypes
  5. class StructEnv extends AnyRef

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

    Permalink

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

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

    structs do not need to be defined, but they can be complete (with fields) or incomplete

    we store whether a structure with this name is complete (FeatureExpr). a redeclaration in an inner scope may reduce completeness again

    we do not distinguish between alternative structures. fields are merged in one ConditionalTypeMap entry, but by construction they cannot overlap if the structure declarations do not overlap variant-wise

    the structEnv maps a tag name to a conditional tuple (isComplete, fields, scope)

    Definition Classes
    CEnv
  7. type VarTypingContext = ConditionalVarEnv

    Permalink

    *** 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

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

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

    Permalink
    Definition Classes
    CDeclTyping

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. object EmptyEnv extends Env

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

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

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

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

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

    Permalink

    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
  10. def addJumpStatements(compoundStatement: CompoundStatement): Unit

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    CTypes
  19. final def asInstanceOf[T0]: T0

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

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

    Permalink

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

    Permalink
    Attributes
    protected
    Definition Classes
    CDeclTyping
  23. def checkVoidParameter(ctype: Conditional[CType], ctx: FeatureExpr, decl: AST): Conditional[Unit]

    Permalink
    Attributes
    protected
    Definition Classes
    CDeclTyping
  24. def checkVoidVariable(ctype: Conditional[CType], f: FeatureExpr, decl: AST): Conditional[Unit]

    Permalink
    Attributes
    protected
    Definition Classes
    CDeclTyping
  25. def checkingExternal(externalDef: ExternalDef): Unit

    Permalink

    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

    Permalink
    Definition Classes
    CDeclUseInterface
  27. def clone(): AnyRef

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

    Permalink

    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

    returns None if there is an error, Some("") if it passes and Some(msg) if there is a warning

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

    Permalink
    Definition Classes
    CDeclTyping
  30. def converse(a: CType, b: CType): CType

    Permalink

    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]

    Permalink

    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])]

    Permalink

    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

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

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

    Permalink

    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

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

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

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

    Permalink
    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])])

    Permalink

    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 getExternCondition(specifiers: List[Opt[Specifier]]): FeatureExpr

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

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

    Permalink

    under which condition is modifier extern defined?

    under which condition is modifier extern defined?

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

    Permalink

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

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

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

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

    Permalink
    Definition Classes
    CDeclTyping
  49. def hashCode(): Int

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

    Permalink
    Definition Classes
    CDeclUseInterface
  51. val initBuiltinTypedevEnv: Seq[(String, FeatureExpr, (AST, Conditional[CType]))]

    Permalink
  52. lazy val initBuiltinVarEnv: Seq[(String, FeatureExpr, AST, Conditional[CType], DeclarationKind, Int, Linkage)]

    Permalink
  53. lazy val initialEnv: Env

    Permalink
  54. def isAnonymousStruct(t: CType): Boolean

    Permalink
    Definition Classes
    CTypes
  55. def isArithmetic(t: CType): Boolean

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

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

    Permalink

    are both types char but with different signage?

    are both types char but with different signage?

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

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

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

    Permalink

    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
  61. def isFunction(t: CType): Boolean

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

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

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

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

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

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

    Permalink
    Definition Classes
    CDeclTyping
  68. def isVoid(t: CType): Boolean

    Permalink
    Definition Classes
    CTypes
  69. def isZero(t: CType): Boolean

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

    Permalink

    error reporting for type errors

    error reporting for type errors

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

    Permalink
    Definition Classes
    AnyRef
  72. def normalize(t: AType): AType

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

    Permalink

    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
  74. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  75. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  76. def opts: ICTypeSysOptions

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

    Permalink
    Definition Classes
    CDeclTyping
  78. def promote(x: CType): CType

    Permalink

    promotion is what happens internally during conversion

    promotion is what happens internally during conversion

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    CTypes
  86. def toString(): String

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

    Permalink

    invoked after typing an expression

    invoked after typing an expression

    refined by CTypeCache if desired

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

    Permalink

    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
  89. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CDeclTyping

Inherited from CDeclUseInterface

Inherited from CTypeSystemInterface

Inherited from CTypes

Inherited from COptionProvider

Inherited from CEnv

Inherited from AnyRef

Inherited from Any

Ungrouped