Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
3 posts found #roslyn
Semantic Analysis and Code Generation: Type Checking, Symbol Tables and Compiling an AST to Expression Trees
Computer Science Fundamentals PART 04

Semantic Analysis and Code Generation: Type Checking, Symbol Tables and Compiling an AST to Expression Trees

Semantic analysis binds the names in a parsed tree to a symbol table and checks types, so a mistake like price = "abc" is caught before the filter touches any book. For the Bookstore filter language we write a binder with implicit conversion and constant folding, compile the verified tree to Expression<Func<Book,bool>>, run it in memory and use ToQueryString to show EF Core turning it into parameterized SQL; we also see why an input length limit is needed and what Roslyn does.

15 Nov 2026 16 min 8
Writing a Lexer: From Characters to Tokens with a Bookstore Filter Language in C#
Computer Science Fundamentals PART 02

Writing a Lexer: From Characters to Tokens with a Bookstore Filter Language in C#

A lexer is a state machine that splits characters into tokens and knows the line and column of each one. We write a single-pass C# lexer over ReadOnlySpan<char> for the Bookstore filter language: maximal munch, keyword matching that survives the Turkish culture, number parsing with InvariantCulture, error recovery that respects surrogate pairs, and clear error messages. Real output shows where a regex lexer breaks and why Roslyn keeps whitespace as trivia.

15 Nov 2026 14 min 6
Source Generators in C#: Generating Code at Compile Time with IIncrementalGenerator
Backend PART 11

Source Generators in C#: Generating Code at Compile Time with IIncrementalGenerator

Writing an incremental generator that adds code during the build: the netstandard2.0 project and Roslyn version, the pipeline and caching, seeing the generated code, and the partial and hint name pitfalls.

7 Nov 2026 9 min 40
Blog Map