473,898 Members | 2,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parser Generator that generates JavaScript code

Hi,

Does a parser generator exist that generates JavaScript code? Most
parser generators generate C or Java code.

Thanks,
Peter

Nov 11 '06 #1
9 3630
Daz

Peter Michaux wrote:
Hi,

Does a parser generator exist that generates JavaScript code? Most
parser generators generate C or Java code.

Thanks,
Peter
What is it meant to generate the code from, exactly?

Nov 11 '06 #2

Daz wrote:
Peter Michaux wrote:
Hi,

Does a parser generator exist that generates JavaScript code? Most
parser generators generate C or Java code.

Thanks,
Peter

What is it meant to generate the code from, exactly?
A language grammer similar to that used by Yacc, JavaCC, SableCC or
Lemon.

A subset of SQL grammer is what I would like to implement in
JavaScript.

Peter

Nov 11 '06 #3
Daz

Peter Michaux wrote:
A language grammer similar to that used by Yacc, JavaCC, SableCC or
Lemon.

A subset of SQL grammer is what I would like to implement in
JavaScript.
Oh I see. Sorry I am not familiar with parser generators. I assumed you
meant something that will basically take some code, parse it, and then
display it on a webpage complete with syntax highlighting. I am
intrigued as to the the use of such parser generators, so I am going to
look into it. I will let you know if I come across anything.

All the best.

Daz.

Nov 11 '06 #4
Daz

Peter Michaux wrote:
Daz wrote:
Peter Michaux wrote:
Hi,
>
Does a parser generator exist that generates JavaScript code? Most
parser generators generate C or Java code.
>
Thanks,
Peter
What is it meant to generate the code from, exactly?

A language grammer similar to that used by Yacc, JavaCC, SableCC or
Lemon.

A subset of SQL grammer is what I would like to implement in
JavaScript.

Peter
Hello again Peter. I have just tried a Google search for what you are
looking for, and out of the hundred or so pages that were returned,
there's nothing that matches the description of what you are looking
for. I beleive it would be safe to assume that such a thing doesn't
exist, or if such a thing does exist, it's probably so little known
that it does not work correctly, or is seriously buggy. This doesn't
mean that this is definitely the case, but as you rightly said, Google
practically throws C and Java parser generators at you, but there
doesn't appear to be any that work with JavaScript. Sorry...

Daz.

Nov 11 '06 #5
VK
Peter Michaux wrote:
A subset of SQL grammer is what I would like to implement in
JavaScript.
<http://trimpath.com/project/wiki/TrimQuery>

Nov 11 '06 #6
VK wrote:
Peter Michaux wrote:
A subset of SQL grammer is what I would like to implement in
JavaScript.

<http://trimpath.com/project/wiki/TrimQuery>
I found some fundamental flaws that will break TrimQuery in
unacceptable ways. For example a user cannot store "Mr SELECT test" as
their name in the in-browser database. There could be hack work arounds
for each of these problems but I think doing it right with a tokenizer
and parser are probably more fruitful in the long run.

Peter

Nov 11 '06 #7
"VK" <sc**********@y ahoo.comwrote in news:1163278275 .629360.236530
@h54g2000cwb.go oglegroups.com:
Peter Michaux wrote:
>A subset of SQL grammer is what I would like to implement in
JavaScript.

<http://trimpath.com/project/wiki/TrimQuery>
Great zot! Trimpath extends Javascript with SQL queries! It's a
lightweight GPL open-source component that gives you the power of SQL
queries while running Javascript in a web browser. Written in Javascript.
Nov 11 '06 #8
Jim Land (NO SPAM) wrote:
"VK" <sc**********@y ahoo.comwrote in news:1163278275 .629360.236530
@h54g2000cwb.go oglegroups.com:
Peter Michaux wrote:
A subset of SQL grammer is what I would like to implement in
JavaScript.
<http://trimpath.com/project/wiki/TrimQuery>

Great zot! Trimpath extends Javascript with SQL queries! It's a
lightweight GPL open-source component that gives you the power of SQL
queries while running Javascript in a web browser. Written in Javascript.
I was just as excited when I saw it the first time. A DBMS in only 600
lines of JavaScript. I think it is too good to be true and some
investigation into the code has shown it too have problems. The idea of
a DBMS certainly could happen in a browser but is it a good idea?

A DBMS in the browser is appealing but I am conflicted about the
appropriateness of such a beast. How much thinking should a browser be
able to do? It seems like a slippery slope where the desire for a
little bit of cool DHTML could lead to way too much browser brains. For
example, in a DHTML data grid if the user can filter which rows are
visible or in which order they appear then custom code has to slowly be
written to manipulate the data. When the number of user options for
data filtering and sorting increases enough it would be better just to
write something like TrimQuery. With the innocent wish to sort a list
now download times have increased with more data and libraries to be
cached in the browser.

It looks like Gmail leaves all sorting, filtering and pagination up to
the server since the server has all the tools needed like a DBMS to
program this quickly. This also keeps individual page load times low. I
would not make sense to load 20 000 emails into my browser just so I
can search through them quickly. However when there are only 30 items
of data and only a few sort options then people want to delegate the
responsibility to the browser. Where is the line? It seems
fundamentally wrong to give the browser so much power but I don't know
how to articulate clearly when the line has been crossed. Perhaps it
is in the grey area.

There is also the problem of distrubuted data that needs to be
syncronized with the server data and what conflicts that might occur.

I think Gmail got this right.

This is primarily why I started the other thread called "The future of
applications in JavaScript?" I don't know if moving in the direction of
TrimQuery-type applications is a good idea or not. If it is a good idea
than we need more traditional software development tools like a parser
generator for developing JavaScript apps.

Peter

Nov 11 '06 #9

Peter Michaux wrote:
I don't know if moving in the direction of
TrimQuery-type applications is a good idea or not. If it is a good idea
than we need more traditional software development tools like a parser
generator for developing JavaScript apps.
It seems things are moving in the direction of providing more
storage/db functionality in the browser - see Mozilla's Database API
(embeds SQLite for extensions/chrome app use - although not webpages):
http://developer.mozilla.org/en/docs/Storage
and also WHATWG DOM storage (for webpages to access):
http://www.whatwg.org/specs/web-apps...cs-client-side

Nov 11 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
9626
by: Jean de Largentaye | last post by:
Hi, I need to parse a subset of C (a header file), and generate some unit tests for the functions listed in it. I thus need to parse the code, then rewrite function calls with wrong parameters. What I call "shaking the broken tree" :) I chose to make my UT-generator in Python 2.4. However, I am now encountering problems in choosing the right parser for the job. I struggle in choosing between the inappropriate, the out-of-date, the...
3
7383
by: Joe | last post by:
Hi, I have been working on some code that requires a high use of random numbers within. Mostly I either have to either: 1) flip a coin i.e. 0 or 1, or 2) generate a double between 0 and 1. I have utilised the following random number source code http://www.agner.org/random/ What I have found is that there is a problem with seeding. The code generates a seed based on time(0). I have found that I need to increment
2
1908
by: karthik bala guru | last post by:
Hi, I would like to have a XHTML Generator and Parser in C language from the open source community. Someone Here, kindly give me a link or the name of the tool available in the opensource world. Or atleast a XML Generator / Parser that can be easily converted to XHTML Parser Generator in C with the very minimum changes.
7
5695
by: (Jamie Andrews) | last post by:
For a research project, we're looking for a reliable parser for C that will take an ANSI C program and yield a tree representation of the program (as a Java or C++ object). Of course a grammar e.g. in jflex/jbison that will yield the same thing is fine too. We have been able to find some grammars and parsers, of unknown reliability, that don't yield a syntax tree; we want to avoid starting with a flaky parser and/or adding the syntax...
32
8899
by: Weiguang Shi | last post by:
Hi, Is there a tool that, given a struct definition, generates a function that parses binary data of this struct and a command that can be used to construct binary data according to user-specified values for the fields of this struct? Thank you. Wei
6
2748
by: Mike C# | last post by:
Hi all, Can anyone recommend a good and *easy to use* lexer and parser generator? Preferably one that was written specifically for VC++ and not mangled through 20 different platforms. I've had it up to here (funny hand gesture) with trying to compile the bullet-riddled code that GNU Flex and Bison keep spitting out for even the simplest of grammars (really funny hand gesture). Thanks
4
2123
by: Dr Nic | last post by:
ANN: JavaScript Project Generator WWW: http://newjs.rubyforge.org Generates a scaffold for a new JavaScript project, with in-built test suite (using prototypejs's wonderful unittest.js). See above url or blog post for the where's and why-for's. Hope its helpful to people. Feedback welcome on project's Google Group.
5
3643
by: George Sakkis | last post by:
Is there any package that parses regular expressions and returns an AST ? Something like: Regex('i ', Or('love', 'hate'), ' h', Or('is', 'er'), ' ', Or('cat', 'dog'), Optional('s'), ZeroOrMore(r'\s'), OneOrMore('!')) Given such a structure, I want to create a generator that can generate all strings matched by this regexp. Obviously if the regexp contains a '*' or '+' the generator is infinite, and although it can be artificially...
0
9841
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11265
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10949
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10484
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7187
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5882
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6077
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4296
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3306
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.