Antlr interest
   6 tags on

2 answers

Grammar to parse sql statements delimited by semicolon in antlr4

I'm looking to separate sql statements that could have comments /* */ or strings 'test' or line comments --line comment (sql style) separated by semicolons. An example would be: Blah blah 'string ; ' ...

2 answers | 4 hours ago by Shak Smith on Stack Overflow
2 answers

antlr C grammar to create AST

Is there any C grammar available which generates the AST, which includes all the parser rules using "^" and "!" notations? I went through the book written by Terence Parr, to write such a grammar, ...

2 answers | 13 hours ago by Hari Krishna on Stack Overflow
1 answer

Antlr4 supports cross linking in a grammar?

I am trying to write a grammar for a state transition language using Antlr4 This system has variables (e.g., states) that are declared once and can be referenced elsewhere. My question is: does ...

1 answers | 16 hours ago by STiGMa on Stack Overflow
1 answer

JavaFX8 Background Thread still interferes with GUI

I want to write a JavaFX GUI that loads and parses a bigger file (22M) which takes about 30 seconds. However, when I start the parsing in a Task, the rest of the GUI is pretty unresponsive. It is ...

0 answers

ANTLR4 - Quoted and non-quoted strings to support at the same time

What I am trying to achieve is to develop a grammar that would parse the following two lines in the same way: 1. "Bucket 1" = "1 item placed", "3 items removed" 2. Bucket 2 = 2 items placed, 6 items ...

0 answers

ANTLR not shorted evaluation of Boolean expressions

I'm using ANTLR to create a lexer and a parser for a simple grammar. My problem is to generate bytecode for Boolean expressions like "and" and "or". Now I've done so: /** * expr -> andExpr [ or ...

1 answer

ANTLR4: Using non-ASCII characters in token rules

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

0 answers

How to integrate antlr-denter maven project with antlrworks/netbeans?

Hith I am new to netbeans, maven, and antlr. Having just got to grips with installing the jdk, netbeans and the antlrworks2 plugin (and having 'interpret parser' actually work after fixing a file ...

0 answers

Antlrworks2 Netbeans 'Interpret lexer/parser' shortcut key?

I am building a combined grammar using the AntlrWorks2 plugin for Netbeans. But every time I want to debug it I have to click Run->Interpret Parser->Finish. Is there not a shortcut key like 'F5' to ...

1 answer

When building Antlr, Visual Studio gives an error “cannot find the file specified” without naming the file

I installed the antlr parser into my project, then tried to build. The build failed with a message "The system cannot find the file specified" from the Antlr parsing project. But it doesn't tell me ...

1 answers | Jan 23 at 17:48 by William Jockusch on Stack Overflow
0 answers

drawing a AST tree with antlr and c#

i'm studying how it works ANTLR, in this guide at the end it create a parse tree like this (don't matter the ...

0 answers

ANTLR lexer for C-style comment

I'm currently working on a ANTLR lexer rule of supporting C-style comment. There has been a widely recommended rule for such a goal: C_COMMENT : '/*' (options {greedy=false;}: .)* '*/' { ...

1 answer

interact with a third party ANTLR-based recognizer

I am trying to interact, mostly, writing an interpreter, for a language, I have only an API through a dll that permits me to compile files or strings, check syntax errors, etc. What I would like is ...

1 answers | Jan 22 at 22:26 by rienafairefr on Stack Overflow
0 answers

Modifying a Grammar in ANTLR to manage expressions correctly

I´m working on a simple expression evaluator with ANTLR this is the grammar I created: expression : relationExpr (cond_op expression)? ; relationExpr: addExpr (rel_op relationExpr)? ; addExpr: ...

1 answer

Unexpected Behaviour with parsing this grammar with PEG.js

I'm new to the world of formal grammars. I tried to use ANTLR for JS but couldn't figure out how to run the parser. I'm trying to develop a grammar for a DSL on PEG.js and this is what I have ...

0 answers

How to compare against most specific rule in ANTLR4

I have a simple lisp grammar: grammar ALisp ; form : list # call | NUMBER # number | BOOLEAN # bool | SYMBOL # symbol ; list : '(' ')' | '(' 'quote' form ')' # quote ...

1 answer

Antlr not showing gui

i'm working on windows and visual studio and my goal is to try to define a grammar to recognize the parts of some phrases i followed this guide ...

1 answers | Jan 22 at 9:03 by Lorenzo on Stack Overflow
1 answer

Using ANTLR4 lexing for Code Completion in Netbeans Platform

I am using ANTLR4 to parse code in my Netbeans Platform application. I have successfully implemented syntax highlighting using ANTLR4 and Netbeans mechanisms. I have also implemented a simple code ...

1 answers | Jan 21 at 22:30 by padde on Stack Overflow
3 answers

ANTRL4: Token rule that matches any characters until it encounters XYZ

I want a token rule that gobbles up all characters until it gets to the characters XYZ. Thus, if the input is this: helloXYZ then the token rule should return this token: hello If the input is ...

0 answers

Compile ANTLR generated code with C runtime on IBM mainframe (z/OS) using Metal C

I'm looking to run a parser generated by ANTLR 3.5.2 on an IBM mainframe under zOS. I don't need to run ANTLR itself on the mainframe. But I do need to be able to run the C code that ANTLR generates ...

1 answer

Is it possible to restructure XML without XSLT with ANTLR4

I search for an option to transform xml-files. Now i had found antlr4 and I ask me it is possible to write a Parser for xml-files? What I want is to read a xml-file in my program. Than I want to ...

1 answers | Jan 21 at 18:15 by MalteF on Stack Overflow
3 answers

numerous template errors generating OracleSQL grammar using Antlr-3.5-complete.jar

The same oracle SQL grammar generates without errors using Antlr-3.3-complete.jar and compiles successfully using Netbeans/GCC or Visual Studio. Generating the grammar with Antlr-3.5-complete.jar ...

3 answers | Jan 21 at 18:06 by user2074928 on Stack Overflow
0 answers

Executing Certain Actions When Finished Visiting Children With ANTLR Visitors

I have this java method that saves on a class variable the current method I´m in @Override public Tipo visitMethodDeclaration(@NotNull DECAFParser.MethodDeclarationContext ctx) { ...

0 answers

Getting warning(24) : template error … with antlr 3.5.2 generating C code on linux

I'm getting a bunch of warnings on linux (Linux 2.6.32-358.el6.x86_64) when I run antlr3.5.2 on a simple C program. The program can be found here ...

0 answers

removing ambiguity from the miniJava grammer

It seems that our grammar have some ambiguities.But we really don't know how we can remove them. we really need someone to teach us step by step. for example in our grammar how can we remove ambiguity ...

0 answers

Is it possible to define mandatory statements in any order in ANTLR4?

Is it possible to define mandatory statements in any order in ANTLR4? If I do module_header_stmts : ( yang_version_stmt stmtsep | namespace_stmt stmtsep | prefix_stmt stmtsep )+ ; ...

0 answers

Antlr3 MySQL Parser can not parse some sql statements

I am planning to build a simple sql parser to analyze mysql statements. I use antlr3 to build this parser. here is a piece of my antlr3 file. This file works fine for some sql statement, but others ...

2 answers

Building custom Parse Trees in ANTLR v4

Question: is there a (more straightforward) way of building custom parse trees at parse time in ANTLR v4? I guess that one could traverse and rewrite the automatically built tree but I was wondering ...

2 answers | Jan 20 at 11:57 by Octavian Theodor on Stack Overflow
1 answer

ANTLRv4 TestRig unable to find my Lexer class

I'm just starting out with parsers and the like, and I'm trying to build my own little logical language for a game I've been toying with. I set up ANTLR4 on my machine and ran through the test code ...

1 answers | Jan 19 at 21:15 by Zach H on Stack Overflow
0 answers

Through ANTLRWorks how to get xml output instead of AST

Hi I'm new to this ANTLR and i am doing R&D on ANTLRWorks. I was able to create a grammar file and also through interepter i was able to pass the arguments and i was able to get the Tree ...

15 30 50 per page
1 2 3