Skip to main content

Questions tagged [antlr]

ANTLR, ANother Tool for Language Recognition, is a language tool that provides a framework for constructing recognizers, interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target languages.

3 votes
1 answer
283 views

ANTLR4 grammar for Conventional Commits spec

I would like to create a grammar for the Conventional Commits spec and I would love to hear any feedback for what I wrote. The spec has some ambiguities, I think, hence my usage of "island ...
Michael's user avatar
  • 133
3 votes
0 answers
132 views

Mini Scheme interpreter

Right now, I'm working on an interpreter for a subset of the Scheme programming language. It supports lambdas, let/let*/letrec, procedures, combinations, ...
TheSinisterStone's user avatar
3 votes
0 answers
65 views

ANTLR4 grammar for tags substitution

I want your criticism of the following ANTLR4 grammar intended for use in templating engine of sorts. Its task is to look through (presumably rather short) potentially multiline piece of plaintext, ...
Fedor Kotov's user avatar
5 votes
1 answer
269 views

Custom lexer/parser-based code prettifier

I'm adding rather extensive xml-doc comments to all Rubberduck inspection classes, like this: ...
Mathieu Guindon's user avatar
5 votes
1 answer
1k views

Antlr Visitor with complex result

I'm currently helping out on Rubberduck open source project, specifically on the Extract Method functionality. I wrote a purpose-built visitor to assist with ...
this's user avatar
  • 2,039
5 votes
1 answer
122 views

Grammar for a custom language called Elegance

I'm working on my own custom language called Elegance. This is my first grammar, and I'm looking for help with: Readability Expressiveness/DRY code (Can I easily reuse rules/tokens?) Edge cases (Is ...
Nathan Merrill's user avatar
3 votes
2 answers
439 views

Generate ANTLR fragments for Unicode character classes

I've been working on an ANTLR grammar that defines some tokens in terms of Unicode character categories (fileformat.info page). The Unicode Consortium makes a full data tab-separated-values ...
CAD97's user avatar
  • 1,944
9 votes
1 answer
677 views

Roman numerals with ANTLR

I've written a simple interpreter with ANTLR for evaluating Roman numerals. Here's the contents of the grammar file (Roman.g4): ...
rookie's user avatar
  • 1,233
10 votes
1 answer
619 views

Unit test code for Antlr Grammar

I'm working on a grammar for the Visual Basic for Applications (VBA) programming language. I've discovered a way to make assertions about how a parse tree should be generated by using the Antlr ...
Rossco's user avatar
  • 448
14 votes
3 answers
7k views

Hello There Calculator

The open source project I work on uses Antlr4 pretty heavily, but I don't know much about it. I thought I would use April's Community Challenge as an opportunity to learn something about grammars, ...
RubberDuck's user avatar
  • 31.2k
10 votes
1 answer
251 views

Here's my interface, so call me ...maybe

I'm inspecting VBA code to find obsolete code constructs - namely explicit Call statements, like this: Call DoSomething(42) The ...
Mathieu Guindon's user avatar
6 votes
1 answer
188 views

Code Inspection: Procedure not used

Here is yet another piece of Rubberduck code, this time the nasty ProcedureNotUsedInspection class, whose role is to identify all procedures that are never called ...
Mathieu Guindon's user avatar
11 votes
1 answer
184 views

Rubberduck's "Rename" refactoring implementation

Knowing who's using what, and where, I've implemented a "Rename" refactoring for Rubberduck. It works great - it needs further extensive testing, but the preliminary tests are very, very exciting. ...
Mathieu Guindon's user avatar
20 votes
3 answers
1k views

Who's using what where - turning code into symbols

The Rubberduck project is coming along pretty nicely, and for the next version the parsing strategy is getting yet another revision, and this time around it really feels like it's done right. Or is ...
Mathieu Guindon's user avatar
10 votes
2 answers
188 views

Inspector Rubberduck - Take Two

Release 1.1 of Rubberduck only had a handful of implemented code inspections, more as a proof of concept than anything else. For release 1.2, we now have 19 implementations of our ...
Mathieu Guindon's user avatar

15 30 50 per page