Skip to content

Conversation

@sumittlearnbay
Copy link

No description provided.

@sumittlearnbay
Copy link
Author

Added Grammars

Grammar Description / Feature Demonstrated
Arithmetic.g4 Demonstrates operator precedence and left recursion
BooleanExpr.g4 Parses boolean logic expressions with AND/OR/NOT
CSVFlexible.g4 Handles quoted and unquoted CSV fields with escaped quotes
MiniConfig.g4 INI-style key–value configuration syntax with comments
MiniQuery.g4 Simple SQL-like query syntax (SELECT–FROM–WHERE)
JSONMini.g4 Compact JSON subset supporting nested arrays/objects
MiniMarkdown.g4 Basic Markdown subset (headings, bold text)
URLParser.g4 Extracts scheme, host, port, and path from URLs
UnitExpr.g4 Parses numeric expressions with units (e.g., 10m/s, 5kg)
ChatCommand.g4 Recognizes chatbot-style slash commands (e.g., /greet John)

Additional Files

  • GrammarCompilationTest.java
    Basic JUnit test verifying that grammars compile and produce valid parse trees.

Purpose

  • Provide example grammars for new users and test developers.
  • Demonstrate ANTLR’s flexibility across different grammar domains.
  • Add educational resources without overlapping existing examples.

Verification

Each grammar was validated using:

java -jar tool/target/antlr4-4.13.3-SNAPSHOT-complete.jar <GrammarName>.g4

@sumittlearnbay
Copy link
Author

commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant