Enable processing of For Loops.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AxiomConsole</RootNamespace>
|
||||
<AssemblyName>AxiomConsole</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -22,52 +22,61 @@ namespace AxiomConsole
|
||||
// IF(A==1)THEN BREAK;
|
||||
// A=A+1;
|
||||
// }";
|
||||
String expression=@"
|
||||
A=1;
|
||||
B=1;
|
||||
C=1;
|
||||
D=1;
|
||||
WHILE(A<10)
|
||||
{
|
||||
WHILE(B<10)
|
||||
//String expression = @"
|
||||
// J=1;
|
||||
// FOR(I=1;I<10;I=I+1)
|
||||
// {
|
||||
// J=J+10;
|
||||
// break;
|
||||
// }
|
||||
// ";
|
||||
|
||||
//String expression = @"
|
||||
// J=1;
|
||||
// FOR(I=1;I<10;I=I+1)
|
||||
// {
|
||||
// J=J+10;
|
||||
// }
|
||||
// ";
|
||||
|
||||
String expression = @"
|
||||
DECLARE A,J,TOTAL;
|
||||
A=1;
|
||||
J=1;
|
||||
TOTAL=0;
|
||||
FOR(A=1;A<=10;A=A+1)
|
||||
{
|
||||
WHILE(C<10)
|
||||
FOR(J=1;J<=10;J=J+1)
|
||||
{
|
||||
WHILE(D<10)
|
||||
{
|
||||
A=A+1;
|
||||
B=B+1;
|
||||
C=C+1;
|
||||
D=D+1;
|
||||
IF(D==10)THEN BREAK;
|
||||
BREAK;
|
||||
}
|
||||
BREAK;
|
||||
TOTAL=TOTAL+1
|
||||
}
|
||||
BREAK;
|
||||
}
|
||||
BREAK;
|
||||
}";
|
||||
";
|
||||
|
||||
|
||||
CodeRunner codeRunner = new CodeRunner();
|
||||
codeRunner.Trace=true;
|
||||
//if (!codeRunner.Execute(expression))
|
||||
//{
|
||||
// Console.WriteLine("CodeRunner Failed with {0}", codeRunner.LastMessage);
|
||||
// Console.Read();
|
||||
//}
|
||||
|
||||
List<String> disassembly=codeRunner.Disassemble(expression);
|
||||
if(codeRunner.IsInError)
|
||||
{
|
||||
Console.WriteLine("CodeRunner Failed with {0}",codeRunner.LastMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(expression);
|
||||
foreach(String line in disassembly)
|
||||
{
|
||||
Console.WriteLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> disassembly = codeRunner.Disassemble(expression);
|
||||
if (codeRunner.IsInError)
|
||||
{
|
||||
Console.WriteLine("CodeRunner Failed with {0}", codeRunner.LastMessage);
|
||||
} else
|
||||
{
|
||||
Console.WriteLine(expression);
|
||||
foreach (String line in disassembly)
|
||||
{
|
||||
Console.WriteLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
Console.Read();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user