Skip to content

Commit

Permalink
Document IncludeDeclaration EOG
Browse files Browse the repository at this point in the history
  • Loading branch information
KuechA committed Nov 5, 2024
1 parent 7bcd549 commit aac9006
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ open class EvaluationOrderGraphPass(ctx: TranslationContext) : TranslationUnitPa
protected val intermediateNodes = mutableListOf<Node>()

init {
map[IncludeDeclaration::class.java] = { doNothing() } // TODO: Documentation missing
map[IncludeDeclaration::class.java] = { handleIncludeDeclaration() }
map[TranslationUnitDeclaration::class.java] = {
handleTranslationUnitDeclaration(it as TranslationUnitDeclaration)
}
Expand Down Expand Up @@ -198,6 +198,13 @@ open class EvaluationOrderGraphPass(ctx: TranslationContext) : TranslationUnitPa
map[ThrowStatement::class.java] = { handleThrowStatement(it as ThrowStatement) }
}

/**
* See [Specification](https://fraunhofer-aisec.github.io/cpg/CPG/specs/eog/#includedeclaration)
*/
protected fun handleIncludeDeclaration() {
doNothing()
}

protected fun doNothing() {
// Nothing to do for this node type
}
Expand Down
6 changes: 5 additions & 1 deletion docs/docs/CPG/specs/eog.md
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ flowchart LR
```

## LookupScopeStatement
The expression itself is connected to the outer EOG.
The statement itself is connected to the outer EOG.

Interesting fields: /

Expand All @@ -906,3 +906,7 @@ flowchart LR
prev:::outer --EOG--> parent["LookupScopeStatement"]
parent --EOG--> next:::outer
```

## IncludeDeclaration
The `IncludeDeclaration` is not connected to the EOG.
We continue with the next statement.

0 comments on commit aac9006

Please sign in to comment.