PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
pavenovak
Forum Newbie
Posts: 5 Joined: Fri Jan 31, 2003 10:16 am
Post
by pavenovak » Fri Jan 31, 2003 10:16 am
Hi,
is somewhere PHP grammar specification available?
Something like the example below (this is from C# specs).
Thanks,
Pavel.
---------------------------------------
literal:
boolean-literal
integer-literal
real-literal
character-literal
string-literal
null-literal
boolean-literal:
true
false
integer-literal:
decimal-integer-literal
hexadecimal-integer-literal
decimal-integer-literal:
decimal-digits integer-type-suffixopt
decimal-digits:
decimal-digit
decimal-digits decimal-digit
decimal-digit: one of
0 1 2 3 4 5 6 7 8 9
skehoe
Forum Commoner
Posts: 59 Joined: Sun Dec 22, 2002 5:57 am
Location: Denver
Post
by skehoe » Fri Jan 31, 2003 3:42 pm
pavenovak
Forum Newbie
Posts: 5 Joined: Fri Jan 31, 2003 10:16 am
Post
by pavenovak » Fri Jan 31, 2003 5:12 pm
And are you sure that I can find it there? I know that there is a documentation for PHP but it's written like a story and I cannot see some formal specification...
evilcoder
Forum Contributor
Posts: 345 Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia
Post
by evilcoder » Fri Jan 31, 2003 5:35 pm
what exactly are you after, i might be able to help. I'm not sure what you mean by PHP grammer?
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Jan 31, 2003 7:52 pm
never found a bnf or similar for php, but zend uses a bison/yacc scanner to parse scripts. If you're really enthusiastic you might take a look at it
pavenovak
Forum Newbie
Posts: 5 Joined: Fri Jan 31, 2003 10:16 am
Post
by pavenovak » Mon Feb 24, 2003 10:08 am
OK, thanks. In PHP source in files Zend/zend_language_parser.y and Zend/zend_language_scanner.l is exactly that I need.
Pavel.
BDKR
DevNet Resident
Posts: 1207 Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:
Post
by BDKR » Mon Feb 24, 2003 10:23 am
HI Pavel,
Can I ask why you're interested in the parser stuff. I've taken a look or three at the stuff and it's tough to chew on. Anyways, I was interested in messing around with the engine a bit and
that seemed like the place to start.
Cheers,
BDKR