Trying to regenerate zend_language_scanner.c - php-internals

I'm trying to add a new keyword in PHP (just learning the core), so what I did was: added a new token to zend_language_parser.y, used it in an unticket_statement, compiled PHP, but it didn't work out. It seems like I need to add that new keyword in zend_language_scanner.l (I assumed it by another definitions in this file) and regenerate zend_language_scanner.c with the help of re2c.
But here's what re2c gave me:
$ re2c -isgf Zend/zend_language_scanner.l
re2c: error: line 1004, column 6: can't find symbol
Line 1004 contains this definition:
LNUM [0-9]+
This error will pop even on unchanged zend_language_scanner.l file.
Here's re2c -v output: re2c 0.13.5
Does anybody knows how can I regenerate this scanner or what am I doing wrong?

you should try it like this:
re2c --no-generation-date --case-inverted -cbdF -o a.c zend_language_scanner.l
I have the same problem, until i found the source cmd from file Makefile.frag:
$(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/ zend_language_scanner.l)

Related

Error running make: missing separator (did you mean TAB instead of 8 spaces?)

I'm trying to get PHP phar command line tool installed on my Debian VM, how here described:
(1) download the php-src, I assume it's in /tmp/php/src
(2) make the dir /tmp/phar
(3) Save this as /tmp/php-src/ext/phar/Makefile.
(4) cd /tmp/php-src/ext/phar
(5) run sudo make
Now after step 5 I get an error:
:/tmp/php-src/ext/phar# make
Makefile:11: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
As I know, there can be two possible causes for this error message:
Tabs in the make file. I've tested the file with od -t c Makefile. The file contains no tabs (\t).
It could be a bug of make v3.81 and need a patch or an upgrade to (yet instable: "Warning: This package is from the experimental distribution.") v3.82. I've downloaded and istalled (dpkg -i make_3.82-1_amd64.deb) it, but the error is still occuring.
What causes the error? How can it be avoided?
Thx
(Answered in a comment: See Question with no answers, but issue solved in the comments (or extended in chat))
#Beta wrote:
The line should begin with a tab, not a bunch of spaces.
The OP wrote:
I've replaced all 8-spaces sequences with tabs and can execute the make script now.
I used:
cat Makefile|sed "s/ /\t/" > Makefile

remy inliner command line tool returns path.existsSync is now called `fs.existsSync`

I'm trying to use inliner command line tool locally to combine some files. But I get the following error message in the console.
path.existsSync is now called `fs.existsSync`
So i went into /usr/local/lib/node_modules/inliner/bin/inliner and changed line 65 from:
if (path.existsSync(url))
to
if (fs.existsSync(url))
but I get still the same error message. Can anybody give me a hint what is wrong and how I can fix this?
There is already a question here but that didn't fix my problem. Or am I editing the wrong file?
Cheers
:fab
I got inliner working by using the -i command
#-i, --images don't encode images - keeps files size small, but more requests
inliner -i http://fabiantheblind.info/coding.html > test2.html

Compiling user-written source code files for beginners?

everyone.. I'm not a complete noob to linux, I'm using Fedora 16, but I've always had difficulty compiling programs from the command line and I would really like to learn how to do it the right way. I've had experience with Python, Ruby, Perl, PHP, Lua, bash and other languages, recently I've getting into Fortran code and here's the problem: Every time I run the f77 command with an option and filename, I get one of the following errors:
[code]
[Eddie_Nygma#localhost ~]$ f77 -S #classicpayroll.f#
f77: no input files
[Eddie_Nygma#localhost ~]$ f77 -o #classicpayroll.f#
f77: argument to `-o' missing [/code]
I really need to get this compiled and running for my cs class, somebody please help me out, could it possibly be some sort of a a syntax error or how do I correct it?
I used fortran long ago.
In fortran, the first letter in file name shuold be A-Z or a-z.
number or # is not allowed

Windres syntax error

I am working in MinGW environment (downloaded with their installer on 12/12/2011). I am attempting to compile a resource (.rc) file using Windres. The specific command I use is
Windres -O coff About1.rc -o About1.res
Windres generates at least 100 lines of warning messages reading: "warning: null characters ignored". Following this Windres emits: "Abouty1.rc:1:syntax error".
As a matter of fact, there are no null characters in the About1.rc file. In addtition, the first line of the file is an include statement: #include "dlgresource.h". I played around and eliminated this statement and it turns out that it doesn't matter what I put there, I get the same flurry of messages and the syntax error notification.
To make things more confusing, this same .rc file compiles without any problem using MSFT's rc.exe. The resulting .res file links smoothly with the program .obj file and runs perfectly.
I have no idea what is going on. Any ideas?
Thanks,
Mark Allyn
Your .rc file is probably encoded as UTF-16.
That's what's required in general by Microsoft's [rc.exe], in order to be able to deal with international characters, but GNU [windres.exe] can only deal with ANSI encoding.
One workaround is to convert the file to ANSI on the spot (possibly losing e.g. Russian or Greek characters):
> chcp 1252
Active code page: 1252
> type my.rc | windres --output-format=COFF -o my.res
> _
You probably used VS or a similar tool to generate the file. There are some parts of the character encodings that you cannot see resulting in null characters and etc.
Generate a new .res file with the same content, don't copy/paste the content, type it in yourself.
Try:
windres About1.rc -o About1.o
and then just use the resulting .o file instead of the originally intended .res file.
I've had the same troubles than you today. I know it has passed a lot of time from your question, but I'm writting this on the hope that it can be useful for someone.
First, I obtained an object file .o compiled using Cygwin, writting:
windres -o resource.o resource.rc
By doing that, you dont need to use the .res file, but the .o one, and you can then link this object with all the others, when you compile yout program, using GNU resources:
g++ Header_files CPP_files flags ... -o program.exe recource.o -lm
For instance.

CCNetConfig command line parameter for opening a ccnet.config?

I'm trying out CCNetConfig (warning, website a little slow). Great app, one annoyance.
I can see in the documentation and even in the source code (Look at the end of the Initialize method) that I should be able to pass in a command line parameter to automatically load the configuration file.
I have tried:
-f E:\CruiseControl.Net\server\ccnet.config
-file E:\CruiseControl.Net\server\ccnet.config
-f=E:\CruiseControl.Net\server\ccnet.config
-file=E:\CruiseControl.Net\server\ccnet.config
And the same 4 switches with quotes around the file name just in case.
They all produce errors or just don't work. Has anyone had success doing this?
Thanks in advance.
Try moving it to a different path. Try the simplest thing: c:\ccnet.config.
I'm guessing it's the source of the problem because I recall CCNetConfig gave me sh!t early on when I tried to open files in paths that had spaces in them (e..g in Program Files).
According to my version of CCNet the command line flag for using a different config file is -c or --config, so the following should do it...
-c "E:\CruiseControl.Net\server\ccnet.config"
...which works for me.
I don't know why it uses a non-standard flag, but there you go.

Resources