antlr4 Questions

1

I have a complicated gradle build system that I inherited. It works pretty well, but includes multiple plugins (java, groovy, antlr, jacoco, jetty, etc.). I could not figure out how to accomplish s...
Dorie asked 18/9, 2014 at 14:5

0

I am using antlr4ide plugin with Eclipse Luna. Every time I save the ANTLR4 grammar file Eclipse shows a dialog box "The resource is currently edited in another editor. Do you want to continue?" An...
Thremmatology asked 18/9, 2014 at 3:23

1

Solved

I wrote a grammar with antlr 4.4 like this : grammar CSV; file : row+ EOF ; row : value (Comma value)* (LineBreak | EOF) ; value : SimpleValueA | QuotedValue ; Comma : ',' ; LineBrea...
Manisa asked 14/9, 2014 at 10:44

2

Solved

My grammar has these rules expression : expression EQ conditionalOrExpression #eqExpr | expression NEQ conditionalOrExpression #neqExpr | expression LT conditionalOrExpression #ltExpr | expres...
Sycee asked 20/8, 2014 at 20:3

2

Solved

How do I write a lexer rule to match a String literal which does not end in an escaped quote? Here's my grammar: lexer grammar StringLexer; // from The Definitive ANTLR 4 Reference STRING: '"' ...
Sublease asked 3/7, 2014 at 15:36

1

Solved

I used ANTLR version 4 for creating compiler.First Phase was the Lexer part. I created "CompilerLexer.g4" file and putted lexer rules in it.It works fine. CompilerLexer.g4: lexer grammar Compil...
Et asked 19/6, 2014 at 5:15

1

Solved

I'm trying to write a code translator in Java with the help of Antlr4 and had great success with the grammar part so far. However I'm now banging my head against a wall wrapping my mind around the ...
Pietrek asked 12/6, 2014 at 13:37

3

Solved

I have a 10gb file and I need to parse it in Java, whereas the following error arises when I attempt to do this. java.lang.NegativeArraySizeException at java.util.Arrays.copyOf(Arrays.java:2894)...
Temblor asked 15/6, 2014 at 0:39

1

Solved

I am trying to define lexer rules for PostgreSQL SQL. The problem is with the operator definition and the line comments conflicting with each other. for example @--- is an operator token @- follo...
Jeanajeanbaptiste asked 12/6, 2014 at 21:19

1

Solved

I'm having a problem parsing a list of lines of format in antlr4 * this is a string * "first" this is "quoted" * this is "quoted with \" " I want to build a parse tree like (list (line * (valu...
Dinar asked 22/5, 2014 at 6:26

1

Solved

I have a grammar file BoardFile.g4 that has (relevant parts only): grammar Board; //Tokens GADGET : 'squareBumper' | 'circleBumper' | 'triangleBumper' | 'leftFlipper' | 'rightFlipper' | 'absorber...
Ramie asked 13/5, 2014 at 1:57

1

Solved

I downloaded latest release of ANTLR - 4.2.2 (antlr-4.2.2-complete.jar) When I use it to generate parsers for grammar file Java.g4 it prints me some warnings like: "Java.g4:525:16: rule 'expression...
Forepeak asked 29/4, 2014 at 8:25

3

Solved

I have a C# solution with an Antlr3 grammar file, and I'm trying to upgrade to Anltr4. It turns out the grammar was the easy part (it became better, and one third the size!). Generating the parser ...
Marlow asked 27/10, 2013 at 9:42

1

I'm going to migrate from ANTLR3 to ANTLR4, I appreciated auto-left recursion resolving, but..I did not found tree grammars, -> instructions supported. Could anyone explain what is the reason of r...
Tinsley asked 21/4, 2014 at 0:9

1

Solved

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 crea...
Lullaby asked 16/4, 2014 at 3:21

1

In a rule expr : expr '<' expr | ...; the ANTLR parser will accept expressions like 1 < 2 < 3 (and construct left-associative trees corrsponding to brackets (1 < 2) < 3. You can tel...
Heterodox asked 26/9, 2013 at 8:26

1

Solved

I'm writing a parser for a language that looks like the following: L00<<identifier>> L10<<keyword>> L250<<identifier>> <<identifier>> That is, eac...
Brachial asked 1/4, 2014 at 14:35

2

Solved

I'm trying to use ASTs with ANTLR4, with this files: Builder.java import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.CommonTokenStre...
Grudging asked 2/2, 2013 at 23:42

1

Solved

Assume there is a rule about 'type'. It is either a predefined type (referred by IDENTIFIER) or a typeDescriptor. type : IDENTIFIER | typeDescriptor ; In my program, I have got an instance of t...
Reasonable asked 25/2, 2014 at 1:27

1

Solved

I am using Antlr4 and java7 grammar (source) for modifying an input Java Source file. More specifically, I am using the TokenStreamRewriter class to modify some tokens. The following code is a samp...
Animate asked 19/2, 2014 at 18:21

1

Solved

I am trying to construct a translator that could convert PL/SQL code to Java using Antlr 4 and StringTemplate 4. I have the grammar of PL/SQl and have already build a parser for PL/SQL but i have n...
Cusk asked 12/12, 2013 at 10:35

1

I am a beginner of antlr. I was trying to use visitor in my code and following the instruction on the net. However, I found out that the visitor was not entering the method I create at all. May any...
Wuhu asked 20/10, 2013 at 1:36

1

Solved

I have the following grammar for parsing first-order logic formulas applied over graphs: grammar Graph; /*------------------------------------------------------------------ * PARSER RULES *-----...
Quartermaster asked 6/2, 2014 at 20:31

1

Solved

I was wondering whether we could build an AST using Antlr version 4. I couldn't find any reference on building it using antlr4. One SO answer says that it would be easy to use antlr4 which produces...
Wellappointed asked 22/1, 2014 at 9:20

4

Solved

I have been using ANTLR with Eclipse for some time using the ANTLRv3IDE plugin. While it is not perfect, and a bit outdated, it does its job reasonably well. Now I am looking to switch to ANTLRv4 ...
Culm asked 22/6, 2013 at 20:21

© 2022 - 2024 — McMap. All rights reserved.