antlr4 Questions

3

Solved

The input content: The grammar: grammar test; p : EOF; Char : [a-z]; fragment Tab : '\t'; fragment Space : ' '; T1 : (Tab|Space)+ ->skip; T2 : '#' T1+ Char+; The matching result is thi...
Torose asked 2/8, 2017 at 1:43

2

How can I access alternate labels in ANTLR4 while generically traversing a parse tree? Or alternatively, is there any way of replicating the functionality of the ^ operator of ANTLR3, as that would...
Precondition asked 15/10, 2013 at 3:45

3

I want to keep white space when I call text attribute of token, is there any way to do it? Here is the situation: We have the following code IF L > 40 THEN; ELSE IF A = 20 THEN PUT "HELLO";...
Rumen asked 23/10, 2014 at 8:41

4

Solved

With ANTLR I parse a grammar. The ANTLR errors are indicated in a custom editor for the grammar. However I would like to disable the printing of error messages to a Java console. I've implemented ...
Noami asked 23/9, 2014 at 8:14

4

Solved

I am trying to convert ant ANTLR3 grammar to an ANTLR4 grammar, in order to use it with the antlr4-python2-runtime. This grammar is a C/C++ fuzzy parser. After converting it (basically removing tr...
Ingeborg asked 16/7, 2015 at 13:24

2

From the Definitive ANTLR4 reference I have run through the first example and it has generated the JAVA target. In the directory C:\JavaLib I have antlr-4.5-complete.jar When I attempt to compile i...
Supper asked 6/7, 2015 at 6:8

4

I want to use Antlr4 to parse some files in my C# application. I have been able to generate the parser and lexer files so far given my grammer. Now I would like to use read in the files and apply t...
Berkie asked 11/10, 2013 at 21:52

1

Since YAML has a rather complicated syntax, is it possible to write a parser for YAML mainly using ANTLR4 ? I was looking for examples, that implement the YAML like indentation parsing and the dete...
Glutenous asked 30/8, 2014 at 6:56

2

Solved

Antlr4 has a new class ParseTreeWalker. But how do I use it? I am looking for a minimal working example. My grammar file is 'gram.g4' and I want to parse a file 'program.txt' Here is my code so fa...
Luca asked 1/2, 2018 at 5:17

3

Solved

I would like to use ANTLR4 with Python 2.7 and for this I did the following: I installed the package antlr4-4.6-1 on Arch Linux with sudo pacman -S antlr4. I wrote a MyGrammar.g4 file and success...
Drone asked 11/3, 2017 at 16:33

7

Solved

I am having trouble getting Intellij to recognize the generated source code from antlr4. Any reference to the generated code appears as errors, code completion doesn't work, etc. I am using maven ...
Marchelle asked 17/9, 2014 at 23:51

1

I built an Antlr 4 filter using a grammar (not important in the context here) and the filters look something like "age > 30 AND height < 6.1". However, the question is, I'll build this filter o...
Prostatitis asked 3/6, 2020 at 6:49

5

I am building a library which contains certain parsers. These parsers are internally built with ANTLR4. Since the generated classes are all public, users of my library are able to see all the class...
Immoralist asked 22/4, 2014 at 11:19

3

Solved

I translate one language into another with ANTLR4. For example when I read numerical literals I can return an Integer or Double. @Override public Integer visitIntegerValue(Parser.IntegerValueCont...
Megan asked 13/4, 2015 at 7:23

2

Solved

I am using ANTLR4 JavaScript to create a sort of a web IDE for a custom language. It all works great, apart from the fact that errors are logged to the console and I can't figure out a way to redir...
Overwrite asked 16/5, 2015 at 13:7

5

I try to use the gradle antlr plugin, but run into several problems. I have a grammar file called wls.g4: grammar WlsScript; @header { package hu.pmi.wls.antlr.ws; } program : 'statementList...
Quietism asked 4/6, 2015 at 11:2

6

I am new to ANTLR framework. I have been working around this for a week. Now am in a situation where i need to parse the Java file and extract the data. Am using ANTLR 4 for parsing. I create the L...
Hawse asked 30/9, 2014 at 9:5

3

Solved

We are building our own query language similar to Mysql using antlr4. Except we only use where clause, in other words user does not enter select/from statements. I was able to create grammar for i...
Chromatics asked 18/2, 2020 at 11:54

6

Solved

What is the format for specifying a package in the Antlr4 maven plugin antlr4-maven-plugin? I feel like I should be able to do the following: <plugin> <groupId>com.tunnelvisionlabs&l...
Pyromagnetic asked 14/8, 2013 at 22:26

2

Solved

I have an antlr4 lexer grammar. It has many rules for words, but I also want it to create an Unknown token for any word that it can not match by other rules. I have something like this: Whitespace...
Kreindler asked 5/2, 2013 at 12:39

2

Solved

I'm currently porting over some code from the C# version of ANTLR4 to the C++ target and I'm currently running into some issues. The way I built my AST in C# was to create a base class (let's call ...
Erdmann asked 13/12, 2017 at 8:25

1

I am a newbie to Antlr and I wanted the below implementation to be done using Antlr4. I am having the below-written functions. 1. FUNCTION.add(Integer a,Integer b) 2. FUNCTION.concat(String a,Stri...
Lewd asked 21/10, 2019 at 6:8

5

I'm new to ANTLR and trying to write grammar in ANTLR4 without any prior brush with the previous version. I'm following the book 'The Definitive ANTLR 4 Reference'. I use Eclipse and installed ANTL...
Shipper asked 19/1, 2014 at 4:18

2

Currenlty I'm working on my own grammar and I would like to have specific error messages on NoViableAlternative, InputMismatch, UnwantedToken, MissingToken and LexerNoViableAltException. I already...
Racemose asked 19/9, 2019 at 12:31

2

Solved

Since Antlr4 is new version of Antlr and this is the first time I use it. I have downloaded the Antlr4 plugin from eclipse marketplace. I made new ANTLR 4 project and I got Hello.g4 Afterward I sa...
Docilla asked 5/2, 2015 at 19:16

© 2022 - 2024 — McMap. All rights reserved.