Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BNF for javascript

3,605 views
Skip to first unread message

paniz alipour

unread,
Oct 29, 2011, 10:27:42 AM10/29/11
to blind...@freelists.org, blind-pr...@freelists.org, blindpro...@freelists.org, blin...@freelists.org, blin...@freelists.org, Firefox help community
Hello My friend,

I need BNF for javascript which can pars object of javascript such as
document,...

Please help me.

Thanks

--
Paniz Alipour

Mark Blain

unread,
Oct 29, 2011, 4:47:11 PM10/29/11
to

paniz alipour

unread,
Oct 30, 2011, 12:12:03 PM10/30/11
to Firefox help community
THANK YOU MARK.

but unfortunately this grammar can not pars this expression:

var x=1;

Please if I made wrong tell me

Thanks
> _______________________________________________
> support-firefox mailing list
> support...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/support-firefox
> To unsubscribe, send an email to
> support-fir...@lists.mozilla.org?subject=unsubscribe
>



--
Paniz Alipour

John McGaw

unread,
Oct 30, 2011, 2:25:27 PM10/30/11
to
On 10/29/2011 10:27 AM, paniz alipour wrote:
> Hello My friend,
>
> I need BNF for javascript which can pars object of javascript such as
> document,...
>
> Please help me.
>
> Thanks
>

You want a BNF (Backus-Naur Form) grammar of the Javascript language which
can be used to automatically generate computer code via YACC (or something
similar) which is capable of parsing the Javascript language. Is that correct?

There are so many variations in Javascript implementations that coming up
with a proper BNF grammar and then making a bulletproof parser will be a
major undertaking (to say the least). There is an approximate BNF here
http://www.lecad.fs.uni-lj.si/documents/navodila/vrml2.0/spec/part1/javascript.html
which might give a starting point but there are a also BNFs for ECMAScript
online which to some people really is Javascript, give or take.

This brings back painful memories of compiler courses in college and the
all-nighters they generated.

paniz alipour

unread,
Oct 30, 2011, 2:50:59 PM10/30/11
to Firefox help community
Dear Jhon,

but I didn't see this:var i=1;

in the link which you sent to.and in others the grammar didn't pars this
expression.

What do you think?


On Sun, Oct 30, 2011 at 9:55 PM, John McGaw <no.w...@all.mozilla.org>wrote:

> On 10/29/2011 10:27 AM, paniz alipour wrote:
>
>> Hello My friend,
>>
>>
>> I need BNF for javascript which can pars object of javascript such as
>> document,...
>>
>> Please help me.
>>
>> Thanks
>>
>>
> You want a BNF (Backus-Naur Form) grammar of the Javascript language which
> can be used to automatically generate computer code via YACC (or something
> similar) which is capable of parsing the Javascript language. Is that
> correct?
>
> There are so many variations in Javascript implementations that coming up
> with a proper BNF grammar and then making a bulletproof parser will be a
> major undertaking (to say the least). There is an approximate BNF here
> http://www.lecad.fs.uni-lj.si/**documents/navodila/vrml2.0/**
> spec/part1/javascript.html<http://www.lecad.fs.uni-lj.si/documents/navodila/vrml2.0/spec/part1/javascript.html>which might give a starting point but there are a also BNFs for ECMAScript
> online which to some people really is Javascript, give or take.
>
> This brings back painful memories of compiler courses in college and the
> all-nighters they generated.
>
> ______________________________**_________________
> support-firefox mailing list
> support...@lists.mozilla.**org <support...@lists.mozilla.org>
> https://lists.mozilla.org/**listinfo/support-firefox<https://lists.mozilla.org/listinfo/support-firefox>
> To unsubscribe, send an email to support-firefox-request@lists.**
> mozilla.org?subject=**unsubscribe<http://support-fir...@lists.mozilla.org?subject=unsubscribe>
>



--
Paniz Alipour

John McGaw

unread,
Oct 30, 2011, 8:00:27 PM10/30/11
to
If you do not see it and you want it then add it. Simultaneously defining
and setting a variable is common in other languages and the BNF grammars
you have located online weren't sent down from heaven on stone tablets so
feel free to modify until the grammar fits your needs.

paniz alipour

unread,
Oct 31, 2011, 2:15:27 AM10/31/11
to Firefox help community
Thank you Jhon because I thought that I made wrong and it is completely
true,

Ok I will add the grammar.

Best Regards

On Mon, Oct 31, 2011 at 3:30 AM, John McGaw <no.w...@all.mozilla.org>wrote:

> On 10/30/2011 2:50 PM, paniz alipour wrote:
>
>> Dear Jhon,
>>
>> but I didn't see this:var i=1;
>>
>> in the link which you sent to.and in others the grammar didn't pars this
>> expression.
>>
>> What do you think?
>>
>>
>> On Sun, Oct 30, 2011 at 9:55 PM, John McGaw<no.w...@all.mozilla.org**
>> >wrote:
>>
>> On 10/29/2011 10:27 AM, paniz alipour wrote:
>>>
>>> Hello My friend,
>>>>
>>>>
>>>> I need BNF for javascript which can pars object of javascript such as
>>>> document,...
>>>>
>>>> Please help me.
>>>>
>>>> Thanks
>>>>
>>>>
>>>> You want a BNF (Backus-Naur Form) grammar of the Javascript language
>>> which
>>> can be used to automatically generate computer code via YACC (or
>>> something
>>> similar) which is capable of parsing the Javascript language. Is that
>>> correct?
>>>
>>> There are so many variations in Javascript implementations that coming up
>>> with a proper BNF grammar and then making a bulletproof parser will be a
>>> major undertaking (to say the least). There is an approximate BNF here
>>> http://www.lecad.fs.uni-lj.si/****documents/navodila/vrml2.0/****<http://www.lecad.fs.uni-lj.si/**documents/navodila/vrml2.0/**>
>>> spec/part1/javascript.html<htt**p://www.lecad.fs.uni-lj.si/**
>>> documents/navodila/vrml2.0/**spec/part1/javascript.html<http://www.lecad.fs.uni-lj.si/documents/navodila/vrml2.0/spec/part1/javascript.html>
>>> >**which might give a starting point but there are a also BNFs for
>>> ECMAScript
>>>
>>> online which to some people really is Javascript, give or take.
>>>
>>> This brings back painful memories of compiler courses in college and the
>>> all-nighters they generated.
>>>
>>> ______________________________****_________________
>>> support-firefox mailing list
>>> support...@lists.mozilla.****org<support-firefox@lists.**
>>> mozilla.org <support...@lists.mozilla.org>>
>>> https://lists.mozilla.org/****listinfo/support-firefox<https://lists.mozilla.org/**listinfo/support-firefox>
>>> <https**://lists.mozilla.org/listinfo/**support-firefox<https://lists.mozilla.org/listinfo/support-firefox>
>>> >
>>> To unsubscribe, send an email to support-firefox-request@lists.****
>>> mozilla.org?subject=****unsubscribe<http://mozilla.org?subject=**unsubscribe>
>>> <http://support-**firefox...@lists.mozilla.**
>>> org?subject=unsubscribe<http://support-fir...@lists.mozilla.org?subject=unsubscribe>
>>> >
>>>
>>>
>>
>>
>> If you do not see it and you want it then add it. Simultaneously
> defining and setting a variable is common in other languages and the BNF
> grammars you have located online weren't sent down from heaven on stone
> tablets so feel free to modify until the grammar fits your needs.
>
> ______________________________**_________________
> support-firefox mailing list
> support...@lists.mozilla.**org <support...@lists.mozilla.org>
> https://lists.mozilla.org/**listinfo/support-firefox<https://lists.mozilla.org/listinfo/support-firefox>
> To unsubscribe, send an email to support-firefox-request@lists.**
> mozilla.org?subject=**unsubscribe<http://support-fir...@lists.mozilla.org?subject=unsubscribe>
>



--
Paniz Alipour
0 new messages