C# / .NETCompletedPale Lavender theme

MiniCompiler

A C# project about compiler construction and error diagnosis. It experiments with tokenisation, grammar-based parsing and reporting source-code problems using ANTLR tooling.

C#ANTLR
MIMiniCompiler
C#Main technology
21Tracked files*
10.cs files
1.g4 files

*File metrics count tracked files after excluding common generated build folders. The project status is an editable draft classification.

01 · What it does

What the application does

Capabilities evidenced by project documentation and source structure; some behaviours require platform configuration.

01

Lexical tokens and grammar analysis.

Lexical tokens and grammar analysis.

02

ANTLR-based parsing experiments.

ANTLR-based parsing experiments.

03

Source diagnostics and error reporting.

Source diagnostics and error reporting.

02 · Technical structure

How the system works

Technical architecture drawn from the repository and supplied documentation.

01

The project uses C#, ANTLR as its documented technical foundation.

02

The source tree and supplied README describe the primary modules; individual files and runtime behaviour may vary by platform.

Compiler stages and error classes

The MiniCompiler README describes a C#/ANTLR educational compiler that reads input.txt and performs lexical, syntactic and semantic checks.

01

Lexer and parser

Tokens are produced from input and checked against grammar rules. Parse trees provide a structured representation of valid syntax.

02

Semantic checks and control flow

The documented supported structures include globals, structures, functions and if/while/for. A semantic error differs from malformed tokenization or invalid grammar.

Documentation: GitHub repository / project specification. The content describes documented behaviour or plans; deployment readiness is not inferred.

04 · Source and design

Implementation examples and code walkthrough

Lexical error identification using ANTLR tokens

MiniCompiler/Proiect 2 -Compilator/CodeErrorCatcher.csVerified GitHub source excerpt (abridged)
public void ProcessLexicalErrors(RulesLexer lexer) {
    lexer.Reset();
    var token = lexer.NextToken();
    while (token.Type != Antlr4.Runtime.TokenConstants.EOF) {
        if (token.Type == RulesLexer.ERROR_CHAR) {
            string error = $"Eroare lexicala: Caracter necunoscut '{token.Text}' pe linia {token.Line}, coloana {token.Column}.";
            lexicalErrors.Add(error);
        }
        token = lexer.NextToken();
    }
}

ANTLR lexical error capture

C#

Unknown lexer characters are collected with line and column positions.

MiniCompiler/Proiect 2 -Compilator/CodeErrorCatcher.csSelected source excerpt
while (token.Type != Antlr4.Runtime.TokenConstants.EOF)
{
    if (token.Type == RulesLexer.ERROR_CHAR)
    {
        string error = $"Eroare lexicala: Caracter necunoscut '{token.Text}' pe linia {token.Line}, coloana {token.Column}.";
        lexicalErrors.Add(error);
    }
    token = lexer.NextToken();
}
06 · Technology

Programming languages & stack

C#
ANTLR

Technology overview: C#, ANTLR. The list reflects documented tools, dependencies and proposed components; for planned projects it does not prove implementation.

File types identified: 10 .cs, 1 .g4, 1 .cpp

07 · Reality check

Status, evidence & limitations

The project status is based on repository sources and supplied documentation. It may be updated as the project evolves. A published case study is not a certification of production readiness.
  • Features are based on the supplied README and code inventory; no end-to-end runtime certification is implied.
08 · Resources

Project resources

Explore the public repository, source code and project documentation on GitHub.