53 lines
983 B
C#
53 lines
983 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using Axiom.Utils;
|
|
using Axiom.Interpreter;
|
|
using System.IO;
|
|
|
|
namespace AxiomConsole
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
|
|
// String expression=@"
|
|
// A=1;
|
|
// WHILE(A<10)
|
|
// {
|
|
// IF(A==1)THEN break;
|
|
// }";
|
|
String expression=@"
|
|
A=1;
|
|
B=1;
|
|
WHILE(A<10)
|
|
{
|
|
WHILE(B<10)
|
|
{
|
|
IF(B==1)THEN BREAK;
|
|
B=B+1;
|
|
}
|
|
IF(A==1)THEN BREAK;
|
|
A=A+1;
|
|
}";
|
|
CodeRunner codeRunner=new CodeRunner();
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
|