daily update on 20250220 by nitload youmu, building AST generator, correct type naming
This commit is contained in:
@@ -37,37 +37,27 @@ using System.Xml.Schema;
|
||||
|
||||
namespace StgSharp.Script
|
||||
{
|
||||
public class AbstractSyntaxTree<TToken, TType>
|
||||
where TToken: IExpressionToken<TToken, TType>
|
||||
public sealed class AbstractSyntaxTree<TNode, TType>
|
||||
where TNode: IASTNode<TNode, TType>
|
||||
where TType: ITypeSource<TType>
|
||||
{
|
||||
|
||||
private bool _cacheAvailable;
|
||||
private HashSet<TToken> _allToken = new();
|
||||
private TToken _root;
|
||||
private List<TNode> _allToken = new();
|
||||
private TNode _root;
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
if( !_cacheAvailable ) {
|
||||
MakeCache();
|
||||
}
|
||||
return _allToken.Count;
|
||||
}
|
||||
get { return _allToken.Count; }
|
||||
}
|
||||
|
||||
public TToken Root => _root;
|
||||
public TNode Root => _root;
|
||||
|
||||
public bool Contains( TToken node )
|
||||
public bool Contains( TNode node )
|
||||
{
|
||||
if( !_cacheAvailable ) {
|
||||
MakeCache();
|
||||
}
|
||||
return _allToken.Contains( node );
|
||||
}
|
||||
|
||||
public virtual void MakeCache() { }
|
||||
public List<List<TNode>> SortByDepth() { }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user