// Copyright (c) StellaOps. All rights reserved.
// Licensed under BUSL-1.1. See LICENSE in the project root.
using System.Collections.Immutable;
namespace StellaOps.BinaryIndex.Decompiler;
///
/// Abstract syntax tree node.
///
public abstract record AstNode(
AstNodeType Type,
ImmutableArray Children,
SourceLocation? Location);
///
/// Types of AST nodes.
///
public enum AstNodeType
{
// Structure
Function,
Block,
Parameter,
// Control flow
If,
While,
For,
DoWhile,
Switch,
Case,
Default,
Return,
Break,
Continue,
Goto,
Label,
// Expressions
Assignment,
BinaryOp,
UnaryOp,
TernaryOp,
Call,
Cast,
Sizeof,
// Operands
Variable,
Constant,
StringLiteral,
ArrayAccess,
FieldAccess,
PointerDeref,
AddressOf,
// Declarations
VariableDecl,
TypeDef
}