Lexical tokens and grammar analysis.
Lexical tokens and grammar analysis.
A C# project about compiler construction and error diagnosis. It experiments with tokenisation, grammar-based parsing and reporting source-code problems using ANTLR tooling.
*File metrics count tracked files after excluding common generated build folders. The project status is an editable draft classification.
Capabilities evidenced by project documentation and source structure; some behaviours require platform configuration.
Lexical tokens and grammar analysis.
ANTLR-based parsing experiments.
Source diagnostics and error reporting.
Technical architecture drawn from the repository and supplied documentation.
The project uses C#, ANTLR as its documented technical foundation.
The source tree and supplied README describe the primary modules; individual files and runtime behaviour may vary by platform.
The MiniCompiler README describes a C#/ANTLR educational compiler that reads input.txt and performs lexical, syntactic and semantic checks.
Tokens are produced from input and checked against grammar rules. Parse trees provide a structured representation of valid syntax.
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.
Lexical error identification using ANTLR tokens
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();
}
}
Unknown lexer characters are collected with line and column positions.
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();
}
Screenshots from supplied documentation and repository media. Missing visuals remain placeholders rather than invented screens.
To fill this space, add an approved screenshot with the exact filename shown below. The site currently displays a neutral placeholder.
assets/img/projects/minicompiler/screenshot-01.webp
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
Explore the public repository, source code and project documentation on GitHub.