Antlr interest
   6 tags on

3 answers

Catching (and keeping) all comments with ANTLR

I'm writing a grammar in ANTLR that parses Java source files into ASTs for later analysis. Unlike other parsers (like JavaDoc) I'm trying to keep all of the comments. This is difficult comments can be ...

3 answers | 6 hours ago by T Suds on Stack Overflow stackoverflow.com
2 answers

How can i see the live parse tree using Antlr4 Ide in Eclipse?

I'm new using Antlr4 but I know that exist a plugin for Eclipse. I have a simple question...After I created the g4 file how can I visualize the live parse tree in order to see the tree of an input ...

1 answer

Recognize multiple line comments within a single line with ANTLR4

I want to parse PostScript code with ANTLR4. I finished with the grammar, but one particular language extension (which was introduced by someone else) makes trouble being reconized. A short example: ...

1 answer

How to consume the minimal input with fuzzy parsing with ANTLR 4.4+

I am trying to extract condition between two keywords (IF & THEN in this example) without specifying the full grammar. The input to the parser begin with the first keyword. Input example could be ...

1 answers | yesterday by Mario on Stack Overflow stackoverflow.com
0 answers

How can I get a parser generated by ANTLR3.5 in C to work in an MVS EBCDIC environment?

We are using ANTLR 3.5.2 on linux to generate a parser in C. We have been able to compile and link the generated C parser and the ANTLR C runtime on z/OS with the LE C compiler. Of course, we'd ...

1 answer

ANTLR4 memory cleanup

Is it possible to desallocate/reset/compress the memory allocated by ANTLR? I already use ParserATNSimulator.clearDFA(), but some huge objects are still allocated (e.g., ArrayPredictionContext, ...

1 answers | yesterday by Louis on Stack Overflow stackoverflow.com
0 answers

ANTRL Grammar for parsing a text file

I'm driving crazy trying to generate a parser Grammar with ANTLR. I've got plain text file like: Diagram : VW 503 FSX 09/02/2015 12/02/2015 STP Fleet : AAAA OFF : AAA 05+44 ...

0 answers

parser won't compile with C and ANTLR3

Clang is complaining about my ANTLR3 (antlr-3.5.2-complete.jar) parser. I need C now and so I'm stuck with ANTLR3. These are the syntax errors: dwParser.c:2009:44: error: use of undeclared ...

1 answer

defining rule for identifiers in ANTLR

I'm trying to write a grammar in ANTLR, and the rules for recognizing IDs and int literals are written as follows: ID : Letter(Letter|Digit|'_')*; TOK_INTLIT : [0-9]+ ; //this is not the complete ...

1 answer

Licensing for Python ANTLR4

I know that ANTLR4 is BSD license however what license does the python runtime for ANTLR 4.5 have? There is no license file in the ANTLR 4 release package

1 answers | 2 days ago by Har on Stack Overflow stackoverflow.com
1 answer

Lexer rule conflict resolution needed

I have these lexer rules in my ANTLR3 grammar: INTEGER: DIGITS; FLOAT: DIGITS? DOT_SYMBOL DIGITS ('E' (MINUS_OPERATOR | PLUS_OPERATOR)? DIGITS)?; HEXNUMBER: ...

1 answers | 2 days ago by Mike Lischke on Stack Overflow stackoverflow.com
0 answers

Manually Install intellij plugin for Antlr4

I can't access the Intellj Server in the office, so I tried to install Antlr4 plugin for IDEA manually, here I just download the zip file from the Github repo. By clicking on the button install from ...

0 answers

antlr v 3.x interpreter not working

I set up the environment for ANTLR v 3.x in eclipse 3.5(Galileo) I wrote a simple grammar grammar XL; options { language = Java; } @header { package com.javadude.antlr3x.tutorial; } ...

0 answers

antlr visitor is returning an empty parse tree

so I'm trying to print the lexemes that are being visited during lexical analysis phase, here's the code of the method that is doing so: public void parse(String inputFile) { InputStream is = ...

1 answer

ANTLR vs parboiled

What is the difference between ANTLR and parboiled for parsing in Java? Which is easier to use for a beginner in parsing? Which is more scalable? (from simple to complex grammar) Which has better ...

0 answers

How to create a lexical analyzer in ANTLR 4 that can catch diiferent types of lexical errors

I am using ANTLR 4 to create my lexer, but I don't how to create a lexical analyzer that catches different types of lexical errors. For example: 1.If I have an unrecognized symbol like "^" the ...

1 answer

ANTLR 4 how to parse comments

I am parsing a SQL like language and I am having trouble parsing comments. The idea is to ignore them. I have these rules: NEWLINE: '\r'? '\n' -> skip WS : [ \t]+ -> skip How can I ...

1 answers | Feb 23 at 13:39 by Idob on Stack Overflow stackoverflow.com
0 answers

Antlr V4 C#/java grammars available?

Are there grammar files (.g4) that are available for C# and Java that i can use directly? If so, are they following certain standards? Thanks, Mostafa

Feb 22 at 22:35 by Hamzawey on Stack Overflow stackoverflow.com
0 answers

ANTLR Ambiguity Issue

I have this grammar. grammar MyGrammar; prog : lexeme* ; lexeme : TOK_INTLIT : [0-9]+; Identifiers : Letter (Letter | Digit | '_' )* ; fragment Letter : [a-zA-Z] ; fragment Digit : [0-9] ...

1 answer

Why am I not get getting correct column positions in that parse tree?

Say I have a string like this: var code = "Private Sub DoSomething(ByVal foo As Integer)\r\n DoSomethingElse(foo)\r\nEnd Sub"; When I feed my ANTLR-generated parser with that string, I get a ...

1 answers | Feb 22 at 18:22 by Mat's Mug on Stack Overflow stackoverflow.com
1 answer

Java AST traversal

so, I'm currently working on a DSL implementation by using ANTLR with Java. By so far, I've created my own AST hierarchy based on the ANTLR grammar. Why? Because unfortunately, ANTLR v4 doesn't ...

1 answer

Is there any REST API query standard / DSL to express complex filters in GET URL?

I am currently researching for an elegant way, for my REST API under development, to express filters for GET requests returning collections. I'd like to express queries as ...

1 answer

error parsing input in ANTLR

so I've written the following grammar in ANTLR: grammar PARVA; prog : lexeme* ; lexeme :TOK_STRLIT | TOK_INTLIT | TOK_CHARLIT | ID | LINE_COMMENT | COMMENT ...

3 answers

Is there a working C++ grammar file for ANTLR?

Are there any existing C++ grammar files for ANTLR? I'm looking to lex, not parse some C++ source code files. I've looked on the ANTLR grammar page and it looks like there is one listed created by ...

3 answers | Feb 20 at 14:40 by c14ppy on Stack Overflow stackoverflow.com
0 answers

ANTLR4: How to modify a token without tying the grammar to a particular target language?

If the input string is this: 'hello' I want the lexer to send up to the parser this token: "hello" with token type STRING. If the input string is this: "hello" I want the lexer to ...

1 answer

ANTLR4: Consuming all remaining input until EOF

Using ANTLR version 4.3 here. This grammar accepts a variety of EOF-delimited expressions, one at a time. The expressions start with key and vary in syntax thereafter. Sample accepted strings: ...

1 answers | Feb 20 at 8:19 by Ty. on Stack Overflow stackoverflow.com
2 answers

Is it possible to export ANTLR4 railroad diagrams as png? If so, how?

I want to export ANTLR4 rules in the railroad format. Please notice that this format is not the same as generated by command line option "-atn". The railroad format is generated by antlrworks, but ...

2 answers

How to make ant put a package directive in several source files?

I'm using Antlr4 to build a parser and I'm using Netbeans as an IDE and ant as a build system. Ant runs Antlr which generates a parser.java and lexer.java in the project's src/ directory. They both ...

2 answers | Feb 19 at 23:19 by MatUtter on Stack Overflow stackoverflow.com
0 answers

Determining ANTLR version to use, or converting between?

I want to take the .g files from Apache Hive and build a parser (targeting JavaScript) -- initially, as just a way to validate user-input Hive queries. The files I'm using come from ...

0 answers

ANTLR: Mismatched input for a simple grammar

I've got a grammar like this to generate a parser: grammar MyLang; init: TERMINAL; TERMINAL: '"' ~('"')* '"'; Using ANTLR4 and the grammar above to parse a simple input like "data", I've got an ...

Feb 18 at 20:03 by anhldbk on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3