What problem does it solve?
Provides concrete guidance and patterns for implementing reliable Apex parsing, listener-based analysis, and compiler-aligned validation so developers can build language-server features that match Salesforce compiler behavior.
Core Features & Use Cases
- ANTLR grammar mapping: Explains where to find BaseApexParser and BaseApexLexer rules and how parser rule names map to generated Context classes used in listeners.
- Listener and validator patterns: Describes extending BaseApexParserListener, scope tracking, entering/exiting rule handlers, and integrating with CompilerService to collect results, errors, and warnings.
- Validation workflow & error codes: Documents TIER 1 and TIER 2 validator strategies, how to consult messages_en_US.properties, and the required workflow for adding and regenerating error codes.
- Use Case: Build a validator that enforces parameter limits and reports Salesforce-consistent error codes across .cls, .trigger, and anonymous .apex files.
Quick Start
Ask the AI to parse MyClass.cls with the Apex grammar and return AST nodes, syntax errors, and suggested validator checks.