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


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 )

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.
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.

In other words, you want to create a interpreter/compiler ?
CognizeAuthor Commented:
Yes, more an interpreter I guess?
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 :)
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

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

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.
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.