Daily update on 20250318-080056 by Nitload Youmu. Additional Message : Syntax analyzer reshape

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-18 08:00:57 +08:00
parent a5aef8506d
commit e3741687a7
16 changed files with 1311 additions and 96 deletions
+31
View File
@@ -175,6 +175,37 @@ namespace StgSharp.Script
_isNode.Push( false );
}
public bool TryPeekOperand( out bool isNode, out Token t, out TNode n )
{
if( OperandAheadOfDepth <= 0 ) {
t = Token.Empty;
n = TNode.Empty;
isNode = false;
return false;
}
if( _isNode.Pop() ) {
t = Token.Empty;
n = _nodeArray[ _nodeCount - 1 ];
isNode = true;
return true;
} else {
t = _tokenArray[ _tokenCount - 1 ];
n = TNode.Empty;
isNode = false;
return false;
}
}
public bool TryPeekOperator( out Token op )
{
if( OperatorAheadOfDepth > 0 ) {
op = _operatorArray[ _operatorCount - 1 ];
return true;
}
op = Token.Empty;
return false;
}
public bool TryPopOperand( out bool isNode, out Token t, out TNode n )
{
if( OperandAheadOfDepth <= 0 ) {