I'm trying to write an ANTLR4 grammar for a fortran-inspired DSL. I'm having difficulty with the 'ole classic ".op." operators:
if (1.and.1) then
where both "1"s should be intepreted as integer. I …
We're running a .NET application that using this version of the parser in highly parallel manner. We are parsing single lines of input at a time on a given thread on which the parser/lexer is ...
I am trying to implement an XPath 3 parser in Antlr 4. In the EBNF given in the XPath specification it makes use of - to indicate that something should be excluded, if I understand correctly, then in …
I'm working on parsing a language that will have user-defined function calls. At parse time, each of these identifiers will already be known. My goal is to tokenize each instance of a user-defined …
I am a rookie in XText and have built my own scripting language but now I want to start to be able to add stuff like namespaces and new object creation from other classes that are imported and ...
I'm trying to get started with ANTLR and C# but I'm finding it extraordinarily difficult due to the lack of documentation/tutorials. I've found a couple half-hearted tutorials for older versions, but …
table : line+;
line : NAME
',' PEAK ','
ENDYEAR ',' LENGTH NEWLINE
NEWLINE : '\r'? '\n'
NAME : ('"'(~'"')*'"')
PEAK : …
I want my Antlr4 parser to throw RecognitionException when it doesn't understand the input and when the perfectly parsed input doesn't satisfy my custom requirements. In other words, I want to find an …
So far i have searched the whole "The Definitive ANTLR 4 Reference" book as well as many sites for an answer to my question and i still can't find anything on the topic.
I am using ANTLR 4 to create …
I got stuck with my compilerproject for university and have trouble parsing the following input
with this grammar:
I am a complete ANTLR4 newbies, so please forgive my ignorance. I ran into this presentation where a very simple arithmetic expression grammar is defined. It looks like:
start : …
I am using grammar from https://github.com/antlr/grammars-v4 and trying to populate column name and value that comes in the where clause. The problem I am having is how to determine if ...
I'm working on a project in which I have to generate Abstract Syntax Tree for a given program. Here program can be in any mainstream programming languages. What should be the standard way of ...
I am trying to write a parser for a dialect of Answer Set Programming (ASP) which, in terms of grammar, looks like Prolog with some extensions.
One extension, for instance is expansion, meaning that …
I am trying to use ANTLR to extract information from a PLSQL file. I am using porcelli PLSQL grammar, using which ANTLR spits out AST on my input plsql file. I need to read the returned "CommonTree" …
Sorry for my english, I'm from Ukraine. Please tell me how to make a walker-tree on antlr. On assignment I need to implement the computation, for example a + b. Before that I just created rules for …
I am running ANTLR 4.2 and using the canonical C grammar from:
I am doing the following steps: (using batch files from the ANTLR4 book)
apparently, I wasn't able to deduce the answers to my problem from exiting posts on token recognition errors with Island Grammars here, so I hope someone can give me an advice on how to do this ...
I am using ANTLR4 and the canonical grammar for C as found here:
I am not modifying the grammar in any way. I am finding that the parsing is ...
Is there a way to pass a terminal rule as a parameter into other rules in XText? I am aware XText uses ANTLR and have looked in documentation for both, but am struggling to find a working solution.
I follow instruction "Getting Started with ANTLR v4" with simple grammar, no problem with other instruction. But I have one problem.
Except, I'm starting run
grun Expr prog -gui
But show this …
I am trying to build a static analysis tool for a demo project. We are free to choose the language to analyze. I started off by writing a Java code analyzer using ANTLR. I now want to do the same for …
My question is both a language implementation question and an ANTLR4 API question. Is there way I can modify a ParseTree and it's accompanying TokenStream?
Here is the scenario. I have a simple ...
I have a grammar with a single parser rule and I´m getting the following error:
The following sets of rules are mutually left-recursive [stableId]
Why do I get a mutually left-recursive error …
ANTLR generates java source from the grammar file. Generated source has dependency to ANTLR classes.
Can I generate 'clean' java sources using ANTLR, that do not have any antlr - dependecy?
If not, …
I have to create a c compiler. For that i am trying to use ANTLR in eclipse, I installed Antlr ide, but when i try to ANTLR package, it shows error as
Invalid ANTLR home
I'm building a grammar for parsing Quake III shaders with ANTLR4.
Here's an exemple of a shader:
deformVertexes wave sin 0 3 0 0.1
It's been many years since my (one) compiler course so forgive me if this
question is ill-posed. I am also new to ANTLR and a C, not Java, coder.
What I'd like to do is describe my problem and then …
I'm very ashamed to ask...
I wrote a grammar for the language with typecast from int to bool and vice versa.
logic_expr : expr NOT? OR | AND expr
| expr '|' expr SMALLER | LARGER