mirror of
https://github.com/github/codeql.git
synced 2025-12-19 10:23:15 +01:00
23 lines
644 B
C#
23 lines
644 B
C#
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
|
using System.IO;
|
|
|
|
namespace Semmle.Extraction.CSharp.Entities
|
|
{
|
|
internal class IfDirective : PreprocessorDirective<IfDirectiveTriviaSyntax>, IExpressionParentEntity
|
|
{
|
|
public IfDirective(Context cx, IfDirectiveTriviaSyntax trivia)
|
|
: base(cx, trivia)
|
|
{
|
|
}
|
|
|
|
public bool IsTopLevelParent => true;
|
|
|
|
protected override void PopulatePreprocessor(TextWriter trapFile)
|
|
{
|
|
trapFile.directive_ifs(this, trivia.BranchTaken, trivia.ConditionValue);
|
|
|
|
Expression.Create(Context, trivia.Condition, this, 0);
|
|
}
|
|
}
|
|
}
|