public void Setup()
 {
     lexer  = new PascalLexer();
     ast    = new PascalAst();
     table  = new PascalSemanticAnalyzer();
     cSharp = new PascalToCSharp();
 }
Example #2
0
        protected override async Task OnInitializedAsync()
        {
            lexer       = new PascalLexer(this);
            ast         = new PascalAst(this);
            analyzer    = new PascalSemanticAnalyzer(this);
            csharp      = new PascalToCSharp();
            con         = new ConsoleModel();
            interpreter = new PascalInterpreter(console: con);
            Examples.Add("Hello World", @"program hello;
begin
    writeln('hello world!');
end.");

            Examples.Add("Simple Program", @"program test;
begin
end.");
            Examples.Add("Math", @"program math;
var a,b,c : integer;
begin
    a := 10;
    b := 20;
    c := 30;
    writeln(a + c - b);
end.");
            //Compile();
            base.OnInitialized();
        }