antlr4 Questions

2

I am having a problem while parsing some SQL typed string with ANTLR4. The parsed string is : WHERE a <> 17106 AND b BETWEEN c AND d AND e BTW(f, g) Here is a snippet of my grammar : wher...
Mesa asked 27/8, 2019 at 9:45

2

Solved

I try to learn about language parser recently and always seen the review about difference in Yacc and Antlr (about LALR and LL). It was always some concluded wording like "LALR is more powerful". B...
Unlace asked 29/8, 2019 at 5:15

3

Solved

I created my grammar using antlr4 but I want to test robustess is there an automatic tool or a good way to do that fast Thanks :)
Imbroglio asked 17/12, 2015 at 15:52

1

I want to achieve following behavior: User:class should be parsed to Object - User; Type - class, alsoUs:er:class should result Object - Us:er; Type - class. I can't make second part work, as soon ...
Camail asked 28/2, 2019 at 10:13

1

Solved

I actually have a problem with the implementation of an antlr-visitor in JavaScript. I have already created a grammar. However, I found no documentation, example or tutorial. Somehow only multi-dim...
Tympanic asked 21/2, 2019 at 21:32

2

I have this lexer rule defined in my ANTLR v3 grammar file - it maths text in double quotes. I need to convert it to ANTLR v4. ANTLR compiler throws an error 'syntax error: mismatched input '@' ex...
Belldame asked 16/10, 2014 at 13:28

5

Solved

I'd like to get started with ANTLR, but after spending a few hours reviewing the examples at the antlr.org site, I still can't get a clear understanding of the grammar to Java process. Is there so...
Bey asked 18/12, 2009 at 23:35

0

I have some doubts regarding the performance of Antlr4. I am currently using Python with Antlr4. It is terribly slow compared to Java (Verified using Antlr4 IntelliJ plugin). Since I need to work...
Dactylo asked 6/12, 2018 at 14:13

4

Solved

I have an Antlr grammar that is currently about 1200 lines. It parses the language that I want, but for at least one construct it is prohibitively slow even for smaller input files. The execution t...
Latterly asked 19/4, 2014 at 18:11

7

Solved

I have created new Gradle project, added apply plugin: 'antlr' and dependencies { antlr "org.antlr:antlr4:4.5.3" to build.gradle. Created src/main/antlr/test.g4 file with the following con...
Bus asked 7/4, 2016 at 7:33

2

Solved

I have an ANTLR 4 grammar: grammar Test; start : NonZeroDigit '.' Digit Digit? EOF ; DOT : '.' ; PLUS : '+' ; MINUS : '-' ; COLON : ':' ; COMMA : ',' ; QUOTE : '\"' ; EQUALS : '=' ; SEMICOLON ...
Evangelical asked 26/1, 2014 at 21:39

2

Solved

I am a complete ANTLR4 newbie, so please forgive my ignorance. I ran into this presentation where a very simple arithmetic expression grammar is defined. It looks like: grammar Expressions; start...
Dogooder asked 15/4, 2014 at 18:55

4

Solved

Does ANTLR4 have a sql grammar available? If so, where can I find it? There is a link from the ANTLR wiki, but the link is broken: grammar list
Johny asked 22/1, 2013 at 17:22

2

Solved

How can I get all parsing errors of Antlr in a list of strings? I use antlr as follows: ANTLRInputStream input = new ANTLRInputStream(System.in); grLexer lexer = new grLexer(input); CommonToken...
Murdocca asked 9/2, 2014 at 16:46

3

I'm using Antlr in a simple Kotlin/Gradle project, and while my Gradle build is generating Antlr sources, they are not available for importing into the project. As you can see (on the left), the c...
Jessiejessika asked 20/6, 2018 at 11:49

1

import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.tree.*; public class Test{ public static void main(String[] args) throws Exception{ ANTLRInputStream input = new ANTLRInputStream...
Appall asked 5/6, 2018 at 3:19

0

In my project I have to generate the grammar sources for more than one language (Java, Javascript and Python) using gradle. I'm using the antlr plugin, so I have the following rows in my build.gra...
Outbound asked 28/5, 2018 at 14:19

1

Solved

If I use ANTLRFileStream antlrFileStream = new ANTLRFileStream("myfile.testlang"); or ANTLRInputStream input = new ANTLRInputStream( new FileInputStream("myfile.testlang") ); Compiler shows ...
Skydive asked 26/5, 2018 at 9:33

4

I'm having issues getting going with a Python target in ANTLR4. There seems to be very few examples available and going to the corresponding Java code doesn't seem relevant. I'm using the standard...
Washbowl asked 14/5, 2015 at 23:14

1

Solved

The getText() returns the complete statement excluding the spaces between the words. One way of considering the spaces is to include them in grammar. But, is there any other way to get the complete...
Topgallant asked 21/5, 2018 at 7:14

2

How can I get rid of the default ANTLR recognition error? I want to write another message using my own error class instead of ANTLR's error. I mean is there any possibility that some ANTLR erro...
Treadle asked 14/3, 2014 at 20:33

1

Solved

I'm working on defining a grammar using ANTLR4 and Java. For Integers, I want a number that mat be preceeded by a minus sign. I know it is possible to do it like this: integer: '-' (DIGIT)* | DIGI...
Jea asked 15/2, 2018 at 14:27

2

Solved

I'm using antlr4 (4.5.3) with Javascript target, and trying to implement a visitor. Following the antlr4 book's calculator example (great book BTW) I'm trying to create a similar grammar: ... exp...
Meehan asked 21/4, 2016 at 2:23

4

Solved

I have included my comments in to a separate channel in ANTLR 4. In my case it is channel 2. This is my lexer grammar. COMMENT: '/*' .*? '*/' -> channel(2) ; I want to access this channel 2 a...
Audiovisual asked 4/9, 2013 at 6:18

2

With ANTLR 4.7 ANTLR 4.7 maven plugin Eclipse Neon 4.6.2 i am trying to use the grammar import feature of ANTLR4. see https://github.com/BITPlan/com.bitplan.antlr with the example iri gram...
Tilefish asked 22/10, 2017 at 9:15

© 2022 - 2024 — McMap. All rights reserved.