473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Parsing own scripting language

Hi,

I've come to the conclusion that a scripting language will make a fine
solution for a feature that I want to program for an app.

I do not expect any problems parsing the script the old fashion way by
manually searching the string. However, if there are good tools - tutorials -
on the matter I would like to know about it. I've come across the Regex
functionality, I guess it could be used - but to what extent.

The language will contain some few keywords and will also contain nested
structures like loops within loops.

Can Regex help me parse such structures or do you know of any other tools?

Regards
Jesper.
Aug 25 '08 #1
3 4667
"Jesper, Denmark" <Je***********@discussions.microsoft.comwrote:
I've come to the conclusion that a scripting language will make a fine
solution for a feature that I want to program for an app.
[...]
The language will contain some few keywords and will also contain nested
structures like loops within loops.
Can Regex help me parse such structures or do you know of any other tools?
Regex is insufficient for structures with nesting, and I would suggest it is
the wrong approach to this problem anyway.

You probably want a parser generator. I found a few in Google, e.g.
http://grammatica.percederberg.net/

Eq.
Aug 25 '08 #2
On Aug 25, 3:51*pm, "Paul E Collins" <find_my_real_addr...@CL4.org>
wrote:
"Jesper, Denmark" <JesperDenm...@discussions.microsoft.comwrote:
I've come to the conclusion that a scripting language will make a fine
solution for a feature that I want to program for an app.
[...]
The language will contain some few keywords and will also contain nested
structures like loops within loops.
Can Regex help me parse such structures or do you know of any other tools?

Regex is insufficient for structures with nesting, and I would suggest itis
the wrong approach to this problem anyway.
I wholeheartedly agree. Regex-parsing any even moderately complicated
language typically results in extremely messy, brittle, non-extensible
parsing code.
You probably want a parser generator. I found a few in Google, e.g.http://grammatica.percederberg.net/
Personally, I would recommend ANTLR v3 (http://antlr.org). It supports
LL(*) grammars, which are very obvious and easy to write (even if not
quite as efficient as an LALR parser can be).
Aug 26 '08 #3
On Aug 25, 12:38*pm, Jesper, Denmark
<JesperDenm...@discussions.microsoft.comwrote:
I've come to the conclusion that a scripting language will make a fine
solution for a feature that I want to program for an app.
If so, consider not reinventing the wheel, and using one of the
existing .NET languages. Note that you can even use C# or VB.NET as a
"scripting" language - see System.CodeDom namespace, and specifically
class CodeDomProvider, which allows to compile C# and VB.NET source
code to in-memory assemblies at run-time; those assemblies can then be
accessed via reflection. Alternatively, you can use JScript.NET, which
is a "true scripting" language that comes with .NET framework out of
the box, and is easily embeddable. Then, there's also IronPython -
http://www.codeplex.com/IronPython.
Aug 26 '08 #4

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

Similar topics

6
by: Artco News | last post by:
I thought I ask the scripting guru about the following. I have a file containing records of data with the following format(first column is the label): CODE#1^DESCRIPTION^CODE#2^NOTES...
303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
4
by: The_Incubator | last post by:
As the subject suggests, I am interested in using Python as a scripting language for a game that is primarily implemented in C++, and I am also interested in using generators in those scripts... ...
41
by: Richard James | last post by:
Are we looking at the scripting world through Python colored glasses? Has Python development been sleeping while the world of scripting languages has passed us Pythonista's by? On Saturday...
33
by: Quest Master | last post by:
I am interested in developing an application where the user has an ample amount of power to customize the application to their needs, and I feel this would best be accomplished if a scripting...
1
by: Paul | last post by:
I have users who want to search 6 different large flat xml documents I can only fit 3 of these documents into memory at one time So I continually have to swap XML documents in and out of memory...
4
by: Gene Jones | last post by:
So I'm starting to do some things where I'm going to want to add scripting in the application, and I can't find a scripting language to plug in that I like. So far I've looked at LUA and L-Sharp,...
4
by: cjl | last post by:
As a learning exercise, I am trying to write a web-based version of 'drawbot' in PHP. See: http://just.letterror.com/ltrwiki/DrawBot I am interested in hearing ideas about how to approach...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.