Antlr interest
   6 tags on

3 answers

When do we use ANTLR

Can anyone please guide me the purpose of using ANTLR dlls in a ASP.Net, C# project. I just noticed antlr.runtime, Antlr3.Runtime, Antlr3.Utlility assemblies being referenced in some project. Will ...

3 answers | 12 hours ago by iniki on Stack Overflow
0 answers

ANTLR4 Grammar left-recursion

How can you get rid of a recursion when rule requires recursion on the left side of the expression? My grammar: grammar disindent; program: ( package_decl | native_decl | native_type ...

1 answer

Antlr and PL/I grammar

Right now we would like to have the grammar of PL/I, COBOL based on Antlr4. Is there anyone provide these grammars If not, can you please share your thought/experience on developing these grammars ...

1 answers | 21 hours ago by Hai Pham on Stack Overflow
1 answer

Identifier Lexer rule does not match '*' like its supposed to

I am in the process of finalizing a grammar for a proprietary pattern language. It borrows a few regex syntax elements (like quantifiers) but it's also a lot more complex than regex, since it has to ...

1 answers | yesterday by Max Uppenkamp on Stack Overflow
0 answers

Antlr V4 C grammar and arrays

I'm using ANTLR V4 with the standard C grammar file. I'm using C#, the basic listener example from the book and attaching to the EnterUnaryExpression event. But with this input: myArray[1][2] = ...

1 answer

Coding a Grammar with ANTLR (Mutual-Left Recursion)

I have this grammar for code in ANTLR. grammar Booleanos; //lexico AND : 'AND' || 'and' ; OR : 'OR' || 'or' ; NOT : 'NOT' || 'not'; TRUE : 'TRUE' ...

1 answers | yesterday by AFCR on Stack Overflow
1 answer

How to print all DFA states in ANTLR

everyone, I'm just starting to learn how things work. I have built my example parser for Java-like language and I would like to see how the engine makes its decisions. For example GNU Bison could ...

1 answers | 2 days ago by Anton Schmidt on Stack Overflow
0 answers

Antlr4 with Python 3 do not accept accented words

I'm trying to use Antlr4 with Python3 but the Antlr don't accept accented letters or others simbles like !. I'm using the following grammar: grammar GramaticaSintagmatica; tokens ...

1 answer

The selected wizard could not be started in eclipse for Anltr 4 .How to solve?

The selected wizard could not be started. Failed to create injector for com.github.jknack.antlr4ide.Antlr4 ExtensionFactory: com.github.jknack.antlr4ide.ui.Antlr4ExecutableExtensionFactory Failed to ...

1 answer

ANTLR4 Terminate on Lexer/Parser error Python

I want to know how can I keep the lexer or parser from running when it finds a mismatch. For Example if the lexer expected a '.' I want it not to continue with recovery mode.

0 answers

Is there an automated tool for converting Antlr4 grammars to Textmate?

I've been developing an Antlr4 grammar for a DSL. I'd really like to be able to use Visual Studio Code as an editor for that grammar. There is a tool that converts .textmate files into plugins for ...

0 answers

ml-antlr or ml-ulex adding extra backslahed to output

I've written a lexer and parser in ml-ulex and ml-antlr. (Running sml/nj) I have a the following rule in my lexer: <TRUSTED> [\"] => ( YYBEGIN INQUOTE ; Tokens.ValidText yytext ); It's ...

0 answers

antlr4: how to generate listener callback for token without a production rule?

After I investigated the grammar quoted in the article, it is clear the crux of the problem is centered on these production rules: TIMESPAN : startTime (WS THRU WS endTime)? ; startTime : TOD ; ...

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

0 answers

antlr4: Grammar ambiguity, left-recursion, both?

My grammar, shown below, does not compile. The returned error (from the antlr4 maven plugin) is: [INFO] --- antlr4-maven-plugin:4.3:antlr4 (default-cli) @ beebell --- [INFO] ANTLR 4: Processing ...

2 answers

ANTLR: Lexer rule catching what is supposed to be handled by parser rule

In my grammar I have these lexer rules: DECIMAL_NUMBER: DIGITS? DOT_SYMBOL DIGITS; // Identifiers might start with a digit, even though it is discouraged. IDENTIFIER: LETTER_WHEN_UNQUOTED+; ...

2 answers | Nov 16 at 14:49 by Mike Lischke on Stack Overflow
1 answer

How to define a balanced brace as parser rule instead of lexer rule

So I have the following grammar: BalancedBrace: : '{' (~('{' | '}') | BalancedBraces)* '}' ; It works well to parse text like this: $sect { some stuff { nested braces are fine } } ...

1 answers | Nov 16 at 7:54 by my_question on Stack Overflow
1 answer

Regular Expression that checks first Character

I need to do the following check: The first character is either an alphabetical character or _ All other characters are either alphabetic, numeric, or _ I tried: ^('A'..'Z' | '_') ('A'..'Z' | ...

1 answers | Nov 15 at 10:27 by aurora91 on Stack Overflow
0 answers

ANTLR4-check syntax errors using antlr generated parser

i am trying to write a code to show me if the grammar of an input is accepted or not , here's my code : import org.antlr.v4.runtime.*; import; import; ...

0 answers

ANTLR4-Mutually left-recursive grammar

i have the following antlr4 grammar and i get mutually left-recursive error , how can i fix it ? expr : expr_prefix term ; expr_prefix : expr_prefix term addop | () ; term : factor_prefix ...

0 answers

What happens to locals after a failure in ANTLR?

In ANTLR, you can associate local attributes with rules. For instance (taken from the Definitive ANTLR Reference): block /* List of symbols defined within this block */ locals [ ...

Nov 13 at 14:02 by Norswap on Stack Overflow
1 answer

how should i limit length of an ID token in ANTLR?

This should be fairly simple. I'm working on a lexer grammar using ANTLR, and want to limit the maximum length of variable identifiers to 32 characters. I attempted to accomplish this with this ...

1 answers | Nov 13 at 8:38 by mehdi javaheri on Stack Overflow
3 answers

xText and ANTLR

My current project is focusing on code generation from DSL ( i.e., high-level specification). More specifically, developers write high-level specifications and these specifications are parsed and ...

3 answers | Nov 13 at 7:33 by Pankesh on Stack Overflow
0 answers

linking xtext editor support with external ANTLR parser

My current project (name it IoTSuite) takes high-level specifications, parses them, and generates code in Java and Android. In this project, I have written ANTLR grammar to parse the high-level ...

0 answers

ANTLR Array Translation

I’m writing a code translator in ANTLR v4 and C#. My input can be considered to be C, except for multidimensional arrays which are defined as columns and rows and I’m outputting to C. Basically ...

0 answers

Understanding a grammar before update : what does ## mean in the rule actions?

I have inherited an Antlr-2.7.7 application, last modified in 2007(!) and need to be able to understand what it's doing before I can think of upgrading. My question is: what does the "##" represent ...

0 answers

Java function calls in xtext grammar

In my current project, I have written parser in ANTLR to parse high-level specification. I use Java function call inside grammar to instantiate the Java objects (shown below). These Java objects are ...

1 answer

Antlr failed to create lookahead

I have a grammar that is not really super clean considering the notation therefore I have to turn on backtracking for it (I know that this is not the best solution but as my grammar is being ...

1 answers | Nov 12 at 7:13 by Raven on Stack Overflow
4 answers

Is it possible to use Xtext without eclipse?

I have a DSL (implemented with ANTLR) for which I need to write a content assist/autocomplete editor. I've ported a prototype of my grammar to Xtext, and I'm quite happy with the quality of the editor ...

4 answers | Nov 11 at 8:49 by Juan Tamayo on Stack Overflow
1 answer

I am getting a left recursion error in my antlr parser grammar

I am getting the error [fatal] rule statement has non-LL(*) decision due to recursive rule invocations reachable from alts 6,7. Resolve by left-factoring or using syntactic predicates or using ...

15 30 50 per page
1 2 3