antlr4 Questions
4
Solved
Using the Java 7 grammar https://github.com/antlr/grammars-v4/blob/master/java7/Java7.g4 I want to find methods with a specific name and then just print out that method. I see that I can use the me...
3
Solved
I'm creating my first grammar with ANTLR and ANTLRWorks 2. I have mostly finished the grammar itself (it recognizes the code written in the described language and builds correct parse trees), but I...
Clinician asked 19/4, 2013 at 10:28
2
Solved
I'll start with my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http:/...
3
Solved
I have the following dependencies in my build.gradle:
dependencies {
compile 'org.antlr:antlr4-runtime:4.5.1'
compile 'org.slf4j:slf4j-api:1.7.12'
antlr "org.antlr:antlr4:4.5.1"
testCompile gr...
Ethylethylate asked 26/10, 2016 at 16:53
5
Solved
I'm reading "The Definitive Antlr 4 Reference" and get the idea in relation to how Listeners and Visitors work. The book explains particularly well how Listeners relate to SAX parsers and makes it ...
Lights asked 21/12, 2013 at 1:37
3
Solved
I have been starting to use ANTLR and have noticed that it is pretty fickle with its lexer rules. An extremely frustrating example is the following:
grammar output;
test: FILEPATH NEWLINE TITLE ;...
2
Solved
I have seen many ANTLR grammars that use whitespace handling like this:
WS: [ \n\t\r]+ -> skip;
// or
WS: [ \n\t\r]+ -> channel(HIDDEN);
So the whitespaces are thrown away respectively sen...
Defloration asked 19/3, 2013 at 15:24
14
I'm getting an error in DataBindingMapperImpl.java for one specific data binding which results in the following error when building the project.
ANTLR Tool version 4.5.3 used for code generation d...
Emmie asked 26/3, 2020 at 10:13
4
Solved
when i try to generate the listener/visitor ... for my Grammar I get the following error : ANTLR cannot generate Javascript code as of version 4.5
Does anybody knows how to fix it? I still can ge...
Piccaninny asked 4/1, 2016 at 10:22
4
Solved
I've been searching A LOT about this and I couldn't find anything useful that REALLY helps me build an AST. I already know that ANTLR4 doesn't build AST like ANTLR3 used to do. Everyone say: "Hey, ...
Orphaorphan asked 30/4, 2015 at 14:58
3
I created a file MyLexer.g4 inside myproject/src/main/antlr/com/mypackage like:
lexer grammar MyLexer;
DIGIT : '0' .. '9' ;
...
WS : [ \t\r\n]+ -> skip ;
and then trying to write parser i...
Vaporetto asked 6/12, 2016 at 12:44
2
I have problem generating my grammar defintion with antlr v4:
grammar TagExpression;
expr : not expr
| expr and expr
| expr or expr
| '(' expr ')'
| tag
;
tag : [a-zA-Z]+ ;
and : '&' ;
or ...
2
I am trying to write parsers for juniper/srx router access control lists. Below is the grammar I am using:
grammar SRXBackend;
acl:
'security' '{' 'policies' '{' COMMENT* replaceStmt '{' policy*...
4
On page 74 of the ANTRL4 book it says that any Unicode character can be used in a grammar simply by specifying its codepoint in this manner:
'\uxxxx'
where xxxx is the hexadecimal value for the ...
7
I recently have to use parser to do a project. I download ANTLR4 and follow the steps described in the book The Definitive ANTLR4 Reference. The following are the steps I type in command line:
1....
Deaconess asked 26/4, 2014 at 19:3
0
I can't find any documentation that shows how to get ANTLR support in Visual Studio 2022. It seems like the ANTLR extension developers haven't kept up with the changes made to the Visual Studio API...
Boddie asked 28/4, 2022 at 3:12
3
I am trying to describle simple grammar with AND and OR, but fail with the following error
The following sets of rules are mutually left-recursive
The grammar is following:
expr:
NAME |
and |
...
4
Solved
I am struggling a little bit to figure out how I can use the antlr4 maven plug in to run the TestRig class?
I've read though the output of mvn antlr4:help -Ddetail=true, which is the only documen...
6
Solved
I have encountered an error when using the latest version of Webpack (5.1.0). It looks like the configuration is throwing an error because the validation schema is too restrictive. Here is my webpa...
Tide asked 14/10, 2020 at 21:46
5
Solved
Beginners question: how do I print a readable version of the parse tree to stdout?
CharStream input = CharStreams.fromFileName("testdata/test.txt");
MyLexer lexer = new MyLexer(input);
CommonToken...
Payson asked 27/4, 2018 at 14:4
3
Solved
I have a simple ANLTR grammar and accompanying Visitor. Everything works great, unless the input is invalid. If the input is invalid, the errors get swallowed and my calculator comes out with the w...
1
I am new to Scala and I am trying to parse Scala files with the use of Scala Grammar and ANTLR. Below is the code for Scala Grammar which I got from the git hub link:
https://github.com/ant...
1
I'am using ANTLR4 to generate Abstract Syntax Tree (AST) for PL/SQL codes. For some queries it works fine, but for some codes it generates an AST with only one node which is not right.
For example...
Tully asked 17/12, 2015 at 12:21
5
Solved
The default behavior when the parser doesn't know what to do is to print messages to the terminal like:
line 1:23 missing DECIMAL at '}'
This is a good message, but in the wrong place. I'd rat...
Finegrained asked 8/8, 2013 at 17:16
2
Solved
I work with antlr v4 to write a t-sql parser.
Is this warning a problem?
"rule 'sqlCommit' contains an optional block with at least one alternative that can match an empty string"
My Code:
sq...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.