Daily update on 20250328-131548 by Nitload Youmu. Additional Message : IF branch can be full functionally compiled. Next will be CASE_OF branch
Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
@@ -54,6 +54,8 @@ namespace StgSharp
|
||||
"c", new ExpIntNode( new Token( "c", 0, 0, TokenFlag.Number ), 1, false ) );
|
||||
LocalVariables.Add(
|
||||
"d", new ExpIntNode( new Token( "d", 0, 0, TokenFlag.Number ), 1, false ) );
|
||||
LocalVariables.Add(
|
||||
"e", new ExpIntNode( new Token( "e", 0, 0, TokenFlag.Number ), 1, false ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -119,21 +121,33 @@ namespace StgSharp
|
||||
internal static partial class Program
|
||||
{
|
||||
|
||||
private const string code = """
|
||||
a := ( b * E + d * 2 ) * d;
|
||||
(**)
|
||||
a := b + (c + d) - a;
|
||||
IF a = b THEN
|
||||
a := a * e;
|
||||
ELSE
|
||||
a := c * e;
|
||||
END_IF
|
||||
(**)
|
||||
""";
|
||||
|
||||
public static void ExpLinearExpressionTest()
|
||||
{
|
||||
ExpressCompile.InitCompile();
|
||||
ScriptSourceTransmitter transmitter = new ScriptSourceTransmitter( "END", 0 );
|
||||
|
||||
//Console.WriteLine( @$"a := ( b * E + d * 2 ) * d;" );
|
||||
transmitter.WriteLine( @$"a := ( b * E + d * 2 ) * d;" );
|
||||
|
||||
transmitter.WriteLine( @"a := b + (c + d) * a;" );
|
||||
foreach( string line in code.Split(
|
||||
Environment.NewLine, StringSplitOptions.RemoveEmptyEntries ) ) {
|
||||
transmitter.WriteLine( line );
|
||||
}
|
||||
transmitter.EndWriting();
|
||||
ExpSourceReader reader = new ExpSourceReader( transmitter );
|
||||
/**/
|
||||
ExpTestFuncSource func = new ExpTestFuncSource( "test", transmitter );
|
||||
TestSchema testSchema = new TestSchema( func );
|
||||
ExpNodeGenerator generator = new ExpNodeGenerator( testSchema, func );
|
||||
ExpSyntaxAnalyzer generator = new ExpSyntaxAnalyzer( testSchema, func );
|
||||
/**/
|
||||
|
||||
while( reader.TryReadToken( out Token t ) )
|
||||
|
||||
Reference in New Issue
Block a user