How do you write a C# application that can parse simple JavaScript - where to start?

Hi,

A vague question, but I'm wondering how you would go about parsing a scripting language in managed code. I'm sure it's not simple, but have no idea where I'd start.

Say I wanted a C# windows forms application that was able to accept user input in the form of Javascript such as:

function showMessage( var message )
{
       alert('Hello!');
}

or maybe something more complex.

If I wanted to design something myself (and not use a library or engine) that could parse this script and replicate it in managed code - how is this done? (regardless of whether it's a good idea or not)

Obvioulsly there's plenty of programs out there that do this such as web browsers...

Can anybody give me any advice.
LVL 2
CognizeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tiagosalgadoCommented:
In other words, you want to create a interpreter/compiler ?
0
CognizeAuthor Commented:
Yes, more an interpreter I guess?
0
tiagosalgadoCommented:
I never done something similar, but i guess you need to define what king of functions your app will support.
If you want to support ALL javascript functions you're done :)
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

CognizeAuthor Commented:
What do you mean I'm done? Is there support in .NET?
0
tiagosalgadoCommented:
I'm mean that you're going to have a hard work.
You want to do that for what propose?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CognizeAuthor Commented:
Just for interest really.

I just want an idea of how a developer might go about such a task.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Theory

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.