I have grammar as follows.
antlr4 gives error for this grammar.
Please help me to resolve this error
Thank you very much.
grammar test_grammar;
addressSpaceIdentifier : '_readonly'
| '_kernarg'
;
optaddressSpace : [addressSpaceIdentifier]
;
Error:
error(50): C:\test\test_grammar1.g:12:18: syntax error: 'addressSpaceIden
tifier' came as a complete surprise to me while matching alternative
This:
optaddressSpace : [addressSpaceIdentifier]
;
is invalid. If you meant to make the production addressSpaceIdentifier optional, you need to write it like this:
optaddressSpace : addressSpaceIdentifier?
;
Related
I need to change this kind of content :
"file":"\/home\/usr\/my-website.com\/data\/publication\/parameters\/21594\/1510849158.params"
into :
"file":"\/data\/publication\/parameters\/21594\/1510849158.params"
(I need to remove this string : /home\/usr\/my-website.com\ )
But the Following command has no effect, i dont know why, and syntax is a little bit complicated :
sed -i 's#/home/usr/my-website.com#/#g'
Do you have an idea ?
In my monitrc i wrote next:
check file mysite.com-access.log with path /var/log/apache2/mysite.com-access.log
if content = "\/1.[01]\" 4(\d){2}" then alert
But the systemctl status monit.service says I have an error in syntax:
extsites monit[19043]: * Starting daemon monitor monit
extsites monit[19043]: /etc/monit/monitrc:305: syntax error '\d'
extsites monit[19043]: ...fail!
Earlier I put "\/1.[01]\" [45](\d){2}", but error in syntax was in '[45]'.
What am I doing wrong? All my regex was right in https://regex101.com/.
Update:
I corrected my string as if content = "^\/1\.[01]\" [45](\d){2}" then alert
but syntax error there is still.
When I am correct, monit uses POSIX regex syntax.
So following this description: https://www.regular-expressions.info/posixbrackets.html
... you could replace \d with [:digit:]
It's not logical to me, but maybe monit doesn't get the "\d" right
Following the "content"-examples in the monit-documentation, the double quote should not be the problem
It seems we should use single quotes instead double.
Here is my nghttpx.conf file:
frontend=0.0.0.0,3000
backend=127.0.0.0,9901;;proto=h2
frontend-no-tls=yes
backend-no-tls=yes
workers=1
log-level=INFO
When I do:
sudo nghttpx
This error is thrown:
28/Nov/2017:15:33:30 +0900 PID19518 [ERROR] shrpx_config.cc:1418 backend: ';' must not be used in pattern
28/Nov/2017:15:33:30 +0900 PID19518 [FATAL] shrpx.cc:1714 Failed to load configuration from /etc/nghttpx/nghttpx.conf
What is wrong with my nghttpx config?
Reading man page of nghttpx we see that --backend option supports the following structure:
--backend=(<HOST>,<PORT>|unix:<PATH>)[;[<PATTERN>[:...]][[;<PARAM>]...]
Since you have backend=127.0.0.0,9901;<PATTERN>, everything that follows ; should be a valid <PATTERN>. Upon further reading of the manual we see that it says:
Since ";" and ":" are used as delimiter, must not contain these characters. Since ";" has special meaning in shell, the option value must be quoted.
Now, looking at your error, it says:
shrpx_config.cc:1418 backend: ';' must not be used in pattern
Which indicates that you have used ; in a pattern, which is not allowed. This agrees with the manual excerpt above.
So it seems that your issue is that you have one too many ; characters in your pattern. At the moment it is ;proto=h2, when it should be proto=h2. Try removing the redundant ; (i.e. it should read backend=127.0.0.0,9901;proto=h2) and see if that helps with the error you're getting.
I'm trying to include a Verilog file (alu.v) in my main file (cpu.v). Both files are in the same directory.
'include "alu.v"
module cpu();
...
...
endmodule
When I try to compile it, I get the following error.
cpu.v:1 syntax error
I give up
I don't see how the include statement is wrong. I'm sure my syntax is correct like shown here.
Don't be so sure! Proof you mess with something, it does not work.
The preprocessor directives in Verilog begin with a back-tick (`) not an apostrophe (').
Try:
`include "alu.v"
Instead of:
'include "alu.v"
There are already a lot of threads about Fred's Scripts on Windows, but not quite what I was looking for.
I'm using W10 Pro with the latest Cygwin and ImageMagick Display.
So here's my problem: I followed the instructions on http://im.snibgo.com/cygwin.htm as good as I can.
Now when I start Cygwin and go to cygdrive/c/users/myname/Pictures/ and type for example:
$ textcleaner sample.png out_sample.png -g
it gives me:
Unzulässiger Parameter - configure
/cygdrive/c/Scripts/textcleaner: Zeile 400: [: : Ganzzähliger Ausdruck erwartet.
Unzulässiger Parameter - configure
/cygdrive/c/Scripts/textcleaner: Zeile 417: [: : Ganzzähliger Ausdruck erwartet.
/cygdrive/c/Scripts/textcleaner: Zeile 423: [: : Ganzzähliger Ausdruck erwartet.
Unzulässiger Parameter - sample.png
--- FILE sample.png NOT READABLE OR HAS ZERO SIZE ---
and here in English (as good as I could):
undue parameter - configure
/cygdrive/c/Scripts/textcleaner: line 400: [: : integer expression expected.
undue parameter - configure
/cygdrive/c/Scripts/textcleaner: line 417: [: : integer expression expected.
/cygdrive/c/Scripts/textcleaner: line 423: [: : integer expression expected.
undue parameter - sample.png
--- FILE sample.png NOT READABLE OR HAS ZERO SIZE ---
I really don't know anything about bash, my goal is an OCR application for Windows and i expected this script to help me get better results from 'my' engine.
Can anybody help me here? Am I missing some crucial information for you? Thanks a lot in advance!
I was facing the same errors. I found out that if you open the textcleaner.sh script and replace all occurrences of convert with magick, the script starts working in Windows.
The work done by convert is handled by magick.exe which can be found in the location where you installed ImageMagick. Make sure that you have all the relevant paths added.
Hope it helps.