Implement ANTLR AST transformation with exact position mapping in links store - #319
Open
konard wants to merge 3 commits into
Open
Implement ANTLR AST transformation with exact position mapping in links store#319konard wants to merge 3 commits into
konard wants to merge 3 commits into
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #77
…ks store - Add ANTLR4 package dependency to Storage project - Create AstNode class with complete text position mapping (line, column, character positions) - Implement CSharpAstTransformer for basic C# language constructs - Integrate AST storage into FileStorage with links store backend - Add comprehensive test suite with 6 passing tests - Include usage examples and documentation - Map each AST node to exact location in source code text as required by issue #77 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
konard
marked this pull request as ready for review
September 13, 2025 14:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements ANTLR-based AST transformation functionality that transforms code into its Abstract Syntax Tree (AST) inside the links store, with each AST node mapped to its exact position in the source code text.
Key Features Implemented
Files Added/Modified
csharp/Storage/AST/AstNode.cs- Core AST node representation with position mappingcsharp/Storage/AST/CSharpAstTransformer.cs- ANTLR-based C# code transformationcsharp/Storage.Tests/- Complete test suite with 6 passing testscsharp/Storage/LocalStorage/FileStorage.cs- Added AST transformation methodscsharp/Storage/Storage.csproj- Added ANTLR4.Runtime.Standard dependencyAPI Usage
Links Store Structure
AST nodes are stored as:
AST_NODE_MARKER -> (NODE_TYPE -> (TEXT -> POSITION))Test Plan
✅ All 6 tests passing:
🤖 Generated with Claude Code
Resolves #77