Netopya / COMP-442-Assignment-4

A top-down table driven syntactic and semantic analyzer written in C# compiling code for the Moon Machine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

COMP-442-Assignment-4

This assignment is a Moon Machine code generator with a top-down table syntactic and semantic analyzer written in C# using .NET 4.5 as a Windows Forms application. A stand-alone executable (COMP442-Assignment3.exe) is included to run the program. The solution can be opened for analysis and the running of unit tests with Visual Studio 2015. When inputting text, it is important that line endings are in the Windows CR+LF format. To input code, simply enter in code in the "Code:" textbox or open an existing text file with "Open File" button, and then click the "Compile!" button to perform lexical and syntactic analyses, and generation of the symbol table and Moon Machine code. The tokenized output will be shown in the "Lexical Analysis" tab broken into the tokens in the "Tokens:" textbox and any errors will be shown in the "Errors:" textbox. The result of lexical analysis will be shown under the "Syntax Analysis" tab with the derivation and any error message with recovery operations. The constructed symbol table will be shown in the "Symbol Table" textbox on the "Symbol Table" tab, along with any errors in the "Errors" textbox. The generated Moon Machine code will be outputted in the textbox on the "Moon Code" tab. All output is written to text files in the same directory as the executable file. Note the presence of "outputMoonCode.m" for the Moon Machine executable code. Furthermore, tests are defined as Visual Studio unit tests and can be run from the Test Explorer. See UnitTest1.cs, UnitTest2.cs, and UnitTest3.cs for a list of unit tests and their expected output. Sample input files with their associated output are available in the /SampleInputOutput/ folder. Moon Machine source code is also included in the assignment’s Visual Studio project, which can be used to compile the Moon Machine.

ezoic increase your site revenue

About

A top-down table driven syntactic and semantic analyzer written in C# compiling code for the Moon Machine.


Languages

Language:C# 60.3%Language:MATLAB 17.1%Language:C 12.5%Language:M 10.1%