part #2
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
// 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;
|
||||
|
||||
/// <summary>
|
||||
/// Abstract syntax tree node.
|
||||
/// </summary>
|
||||
public abstract record AstNode(
|
||||
AstNodeType Type,
|
||||
ImmutableArray<AstNode> Children,
|
||||
SourceLocation? Location);
|
||||
|
||||
/// <summary>
|
||||
/// Types of AST nodes.
|
||||
/// </summary>
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user