Antlr interest
   6 tags on

1 answer

Antlr3 next available tokens when parsing incomplete statement

I an trying to implement simple auto complete for a command line client for SQL. I am using antlr for generating a parser in the rest of the application and I wanted to reuse the grammar to use ...

2 answers

Antlr: Simplest way to recognize dates and numbers?

What is the simplest (shortest, fewest rules, and no warnings) way to parse both valid dates and numbers in the same grammar? My problem is that a lexer rule to match a valid month (1-12) will match ...

2 answers | 4 hours ago by noah on Stack Overflow
2 answers

Code Editor with intellisense for ANTLR4

Looking for sample for building ANTLR4 grammar based Code Editor with intellisense. SharpDevelop provides all Code Editor features, however if we need to provide the intellisense and Code Completion ...

1 answer

Skipping unmatched input in Antlr

Is there a way to specify in a grammar that I want to skip all input that doesnt match any of the rules (that would otherwise throw a recognition error)?

1 answers | yesterday by darenn on Stack Overflow
0 answers

antlr: grammars not equivalent?

I have the following ANTL3 grammar (relevant portion only): from_list : from_list_elt (COMMA from_list_elt)* ; I need for some reasons that are better left unexplained to rewrite is as ...

2 answers

What is the purpose of Antlr package in Visual Studio 2013 ASP.NET project?

The ASP.NET (web forms) project template in Visual Studio 2013 includes several packages. I'm trying to figure out which ones are essential (may need to create a separate question for this). The post ...

1 answer

ANTLR dynamic scopes shareable between lexer and parser?

I'm writing a little language into which I will incorporate XML literals in this fashion: X ?= <element attr='blah'>text<another attr='blah /> more text</element>; I'm working ...

1 answers | 2 days ago by Andrew Matthews on Stack Overflow
0 answers

Buffer string in Scala + ANTLR4

I have this parser for my rule "MuAtt" ( Mutable Atttribute ): public static class MuAttContext extends ParserRuleContext { public Object in; public Object out; public ...

1 answer

Generating ANTLR4 grammar files with package declaration in gradle

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; } program : ...

1 answers | 2 days ago by Balage1551 on Stack Overflow
1 answer

mincaml grammar in antlr4

I am trying to write mincaml parser in antlr4. github( Japanese site : . here is antlr 4 code. grammar ...

1 answers | 2 days ago by Khaan on Stack Overflow
1 answer

Extraneous input error

I'm trying to match something that has the same beginning but different thing in the end as for example: '+' something+ '+' | '-' | '/' | '*' something something somethingDifferentAtTheEnd and my ...

1 answers | Jul 26 at 20:02 by darenn on Stack Overflow
1 answer

Antlr4 : how implementing if/then/else action?

in Antlr2 it was as below. Translating the rule is trivial, but for the action I didn't found how to go to the 'then' vs 'else' child. Ideas ? Parser: | "if"^ fexpr "then"! isolated_start ( "else"! ...

1 answers | Jul 26 at 0:03 by Fabrice NEYRET on Stack Overflow
1 answer

What.NET parsing technologies are available that would let me build a a custom expression evaluator?

I need to generate an IQueryable LINQ expression from a string. First examine class Foo public class Foo { public int Type { get; set; } public int Value { get; set; } public string ...

1 answers | Jul 25 at 19:45 by WhiskerBiscuit on Stack Overflow
2 answers

Partial parsing with flex/antlr

I encountered a problem while doing my student research project. I'm an electrical engineering student, but my project has somewhat to do with theoretical computer science: I need to parse a lot of ...

2 answers | Jul 24 at 3:10 by BigTarzan on Stack Overflow
1 answer

what is the best way to escape two character escape sequences in an ANTLR4 grammar?

I am trying to write an ANTLR4 parser for a templating language similar to mustache. This uses {{...}} tags interspersed in a normal text file. If the template needs to contain and emit { next to an ...

1 answers | Jul 24 at 2:31 by ldgabbay on Stack Overflow
1 answer

ANTLR 4 and StringTemplate 4 - using tree walker with templates

Disclaimer: I never used Java before last month, and I had never heard of ANTLR or StringTemplate before then either. For my internship this summer I was given a project using tools that nobody else ...

1 answers | Jul 24 at 0:48 by yblehS on Stack Overflow
1 answer

ANTLR grammar expression evaluation for token which can be available zero or 1 time

I have a combined ANTLR grammar, which shall look out for specific tokens / token combinations. Some tokes can be available zero or 1 time. I want to store a "found" or "not found" value to a hashmap ...

1 answers | Jul 23 at 10:49 by user2124486 on Stack Overflow
1 answer

ANTLR: Source to Target Language Conversion

I have fair understanding on ANTLR & grammar. Is it correct to say ANTLR can do source language to target language conversion like ASP to JSP or COBOL to JSP? if yes, could you help me to provide ...

1 answers | Jul 22 at 22:43 by user1480864 on Stack Overflow
1 answer

Conditionally adding custom code in ANTLR grammar

I am writing a grammar that needs some custom code written in its target language. It is fairly easy to add e.g. @parser::members { } The problem is that I am targeting multiple languages, and I ...

1 answers | Jul 22 at 7:36 by Krumelur on Stack Overflow
0 answers

Newbie Antlr 3 (performance issue)

Please forgive me as I am really new to ANTLR (using ANTLR3). My objective is basically parsing conditional statements for example: IF ([AGE]:[ACTUAL]) THEN Tax = [INCOME_BEFORE] * 32; ELSEIF ...

Jul 21 at 13:24 by peri on Stack Overflow
1 answer

my lexer token action is not invoked

I use antlr4 with javascript target. Here is a sample grammar: P : T ; T : [a-z]+ {console.log(this.text);} ; start: P ; When I run the generated parser, nothing is printed, although the input is ...

1 answers | Jul 21 at 12:05 by akonsu on Stack Overflow
1 answer

antlr4: need to convert sequences of symbols to characters in lexer

I am writing a parser for Wolfram Language. The language has a concept of "named characters", which are specified by a name delimited by \[, and ]. For example: \[Pi]. Suppose I want to specify a ...

1 answers | Jul 20 at 23:46 by akonsu on Stack Overflow
2 answers

How to solve error generate python3 code in ANTLR 4.4 ?

I am using ANTLR 4.4 with Python3 as target language. You can see in this page: that ANTLR 4.4 suppors Python3 but when I want to create a Python lexer & ...

2 answers | Jul 18 at 18:01 by sara on Stack Overflow
0 answers

Tab size in ANTLR4

How can I set the tab ('\t') size in AnTLR4? In AnTLR2 for instance there was the "tabSize" property. JavaLexer lex = (JavaLexer)lexer; lex.setTabSize(1); thanks

Jul 18 at 17:52 by pinker on Stack Overflow
0 answers

Java parser generator that generates standalone code

I am using antlr to generate a java parser, but the generated code has references to the antlr library. // Generated from Sentences.g by ANTLR. Needs the JAR... How to avoid this? import ...

2 answers

Can ANTLR return Lines of Code when lexing?

I am trying use ANTLR to analyse a large set of code using full Java grammar. Since ANTLR needs to open all the source files and scan them, I am wondering if it can also return lines of code. I ...

2 answers | Jul 17 at 21:50 by qinsoon on Stack Overflow
1 answer

Generate AST using ANTLR4 generated visitor

I am converting an ANTLR3 grammar to an ANTLR4 grammar, this means that I had to remove all tree rewriting rules because they now have to be implemented in code and by visiting ParseTree with a custom ...

1 answers | Jul 17 at 19:29 by Vektor88 on Stack Overflow
1 answer

does ANTLR4 build automata at some point?

as I understand the latest ANTLR4 went away from building static DFA tables for the lexer and for parser and now they do it at runtime. Is this correct? Could someone please explain in general how ...

1 answers | Jul 17 at 18:58 by akonsu on Stack Overflow
1 answer

Generate specific warning/error messages from Antlr4 Listener

I am using Antlr4 to tokenize and parse a legacy language, my end goal is to generate C# code and execute this code in a runtime environment that simulates the physical hardware that executes the ...

1 answers | Jul 17 at 18:53 by Gregg Swanson on Stack Overflow
0 answers

Slow ANTLR4 generated Parser in Python, but fast in Java

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 tree ...

15 30 50 per page
1 2 3