Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

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.
0
Cognize
Asked:
Cognize
  • 3
  • 3
1 Solution
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
CognizeAuthor Commented:
Just for interest really.

I just want an idea of how a developer might go about such a task.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now