fix errors in interpreter. add a enumerator for tree. working on tree optimizer

This commit is contained in:
Youmu Liu
2026-02-09 18:08:49 +08:00
parent 909bf50b9d
commit 807658111c
10 changed files with 288 additions and 106 deletions
@@ -1,9 +1,9 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ISyntaxNode"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -31,11 +31,13 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.RegularAnalysis.Abstraction
{
public interface ISyntaxNode<TNode, TLabel> where TNode: ISyntaxNode<TNode, TLabel> where TLabel: unmanaged
public interface ISyntaxNode<TNode, TLabel> where TNode : ISyntaxNode<TNode, TLabel>
where TLabel : unmanaged
{
long NodeFlag { get; }
@@ -60,9 +62,21 @@ namespace StgSharp.RegularAnalysis.Abstraction
protected internal int EnumState { get; set; }
void AppendNode(TNode nextToken);
void AppendNode(
TNode nextToken
);
void PrependNode(TNode previousNode);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static virtual bool IsNullOrEmpty(
TNode node
)
{
return node is null || node.Equals(TNode.Empty);
}
void PrependNode(
TNode previousNode
);
}
}