ANTRL4: TestRig error - antlr

I am just trying to get ANTLR to run following those instructions: http://www.antlr.org/wiki/display/ANTLR4/Getting+Started+with+ANTLR+v4
The grammar is translated into code, but when I want to call TestRig, I'm getting the error "Can't load Hello as lexer or parser".
TestRig is located in file C:\bin\grun.cmd and contains this command
java -cp .;C:\LIBS\Java\ANTLR\antlr-4.1-complete.jar
org.antlr.v4.runtime.misc.TestRig %1 %2
Is anything wrong with that?
When I try to start TestRig from the ANTLWorks IDE I'm receiving warnings like:
warning: Supported source version 'RELEASE_6' from annotation
processor
'org.netbeans.modules.openide.modules.PatchedPublicProcessor' less
than -source '1.7'
warning: Supported source version 'RELEASE_6' from
annotation processor
'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than
-source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor
'org.netbeans.modules.openide.util.NamedServiceProcessor' less than
-source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor
'org.netbeans.modules.openide.util.NbBundleProcessor' less than
-source '1.7'
and errors like:
line 1:7 token recognition error at: ' '
...........
line 1:0 missing 'hello' at 'grammar'
On Linux I'm experiencing another problem with ANTLRWorks2:
For whatever reason the menu bar doesn't work so that it's impossible to select anything from there. Anyway, clicking on an icon below the menu bar works.
What might be wrong here? Thanks for any help.

Almost a year late on this but in case others have the issue...
I am guessing you named your grammar file 'hello' instead of 'Hello' or you didn't copy the contents correctly.
https://theantlrguy.atlassian.net/wiki/display/ANTLR4/Getting+Started+with+ANTLR+v4
The warnings about 'RELEASE_6' are supposedly harmless according to this bug report.
https://netbeans.org/bugzilla/show_bug.cgi?id=210286
I am still getting these warnings in ANTLRWorks2.1. According to the final post it may be fixed in the NetBeans plugin. However, as far as I can tell this plugin has been recently broken.
I can't help you with IDE issues on Linux.

Related

How to fix compiling Friday Night Funkin by ninjamuffin 99 from source code but there is no .exe after being compiled?

I tried to compile the source code but there is no .exe https://i.stack.imgur.com/CY4jQ.png
I followed the instructions that is from github https://github.com/ninjamuffin99/Funkin and still it don't fixed it. When I tried to compile the source code in cmd after I typed in lime test windows -debug it shows this
C:/HaxeToolkit/haxe/lib/polymod/git/polymod/format/XMLMerge.hx:189: characters 10-23 : Warning : This typedef is deprecated in favor of haxe.xml.Access
C:/HaxeToolkit/haxe/lib/polymod/git/polymod/format/XMLMerge.hx:189: characters 30-43 : Warning : This typedef is deprecated in favor of haxe.xml.Access
source/PlayState.hx:299: characters 3-39 : Warning : `FlxCamera.defaultCameras` is deprecated, use `FlxG.cameras.setDefaultDrawTarget` instead
C:\Users\username\Downloads\FNF MODDING\Kade-Engine-master\Kade-Engine-master\export\debug\windows\obj>setlocal enabledelayedexpansion
Warning: Could not find Visual Studio 2017 VsDevCmd
Missing HXCPP_VARS
Error: Could not automatically setup MSVC
can you help me please?
Googling "Could not automatically setup MSVC" the most common error seems to be failing to restart your PC after installing VS.
I've found that VS has a separate shortcut for "Visual Studio Command Prompt", are you using that rather than a generic command window?

How Can I Clear A Kotlin Error in JavaFX?

I was trying to fix an error in a JavaFX program from an on-line course. In researching someone said moving a file cleared the error.
When I moved my todoItemDialog.fxml file it gave me this error even though Kotlin is not involved:
Error: Kotlin: The Kotlin standard library is not found in the module graph. Please ensure you have the 'requires kotlin.stdlib' clause in your module definition.
When I add the statement to my module-info.java tab in IntelliJ Idea is gives this error:
Module not found: kotlin.stdlib
I removed the requires statement and moved the todoItemDialog.fxml file back to it's original location but I still get the Kotlin error.
How can I clear the Kotlin error without starting over from the first line of code for this project?
I encountered this same error while running JavaFX code. Simply rebuilding the project will solve the error.
Build -> Rebuild Project

Eclipse-Kepler, Java 8 compilation issue "syntax errors on tokens"

I am using Eclipse Kepler with jdk1.8.0.
I do not face any compilation problems in import statements related to java8 or collect construct. However I get the compilation issue in:- Dish::getName...it says.. Syntax errors on tokens, delete the tokens.
Just trying to run the following code:
List<String> dishNames = menu.stream()
.map(Dish::getName)
.collect(toList());
System.out.println(dishNames);
Dish is a java object with String property name.
I have installed JDK8, added the latest JRE in eclipse Java Build Path.
Java compiler compliance.
Any hints what something silly I am missing?
I think you missed installing support of java8 in eclipse kepler.
You can follow this link for detailed instructions.
https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler

Cannot Compile StellaWare

I am trying to develop applications with Eclipse / Linux for Stellaris Launchpad (LM4F120). I am following this guide: http://kernelhacks.blogspot.de/2012/11/the-complete-tutorial-for-stellaris.html
However, I can't compile StellarisWare with make:
adc.c:1: error: bad value (cortex-m4) for -mcpu= switch
adc.c:1: error: invalid floating point option: -mfpu=fpv4-sp-d16
Obviously for compilation 'cc' instead of arm-*-gcc is used. How can I circumvent this problem?
I am using gcc-arm-none-eabi-4_7-2012q4. I did the following things for both a) the full StellarisWare Package (SW-LM3S-9453.exe) and the one for the Stellaris Launchpad (SW-EK-LM4F120XL-9453.exe):
1. Unzip: ../SW-*.zip
2. Try to compile: make
please follow the instruction in the below article
http://www.embeddedcircle.com/stellaris-lm4f120-launchpad-compiling-in-ubuntu-12-04/
do not forget to set the compiler path as per instruction 4

Antlr question: cannot get Antlr tool to compile simple file from ANTLRWorks

Here is the grammar file:
grammar fred;
test : 'fred';
Here is the batch file to launch the tool:
SET JAVA_HOME=C:\Program Files\Java\jdk1.6.0_24
SET PATH=%PATH%;%JAVA_HOME%\bin
SET ANTLR_HOME=c:/users/don/workspace/antlrAssign/lib/
java -cp %ANTLR_HOME%/antlr-3.3-complete.jar antlr.Tool fred.g
Here's the result:
ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
fred.g:1:1: unexpected token: grammar
error: Token stream error reading grammar(s):
fred.g:3:19: expecting ''', found 'r'
fred.g:1:1: rule grammar trapped:
fred.g:1:1: unexpected token: grammar
TokenStreamException: expecting ''', found 'r'
Prior postings refer to "org.antlr.Tool" but the 3.3 jar has it located as above. The idea was to create a debug version of a tree parser, and according to the documentation, you have to use the command line tool.
Has anyone seen this before? Am I nuts? It's two lines long and its dying on the first word in the file.
Of course this compiles in antlrworks.
Any help appreciated, I can't afford any more adjustments to my medications.
Follow up:
I found that if you use the Run --> Debug menu option in ANTLRWORKS it will produce a debug version of a tree parser, but in my hands the command line tool does not. The debug source produced lives in the output folder for generation. In ANTLRWORKS to get a non debug version use the Generate menu option. Using the debug version of the tree parser in eclipse, fire up the test harness and wait, then connect with ANTRWORKS via Run Remote Debug, on the treegrammar parser file. It walked through the parser for the tree and gave me a mismatched tree node error (not a parser error, which is good because I'm debugging the tree parser). So now I just need to find what other dumb thing I've done. HTH somebody besides me.
Prior postings refer to "org.antlr.Tool" but the 3.3 jar has it located as above.
The old ANTLR 2.x Tool class (antlr.Tool) is still included in the 3.x version(s) of ANTLR, but you need to use the ANTLR 3.x Tool (located: org.antlr.Tool) for your grammar since it is a 3.x grammar.