使用C#创建脚本解释器 [英] Creating a script interpreter using C#

查看:221
本文介绍了使用C#创建脚本解释器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为我工作公司的硬件和固件质量保证的一部分,我们需要对设备和固件的某些测试进行自动化。既然不是这里的每个人都知道C#,我正在寻找创建一种新的脚本

语言,这使得编写自动化测试变得更加简单。真的,我是想要将C#语言的强大功能抽象成一种更容易学习的简单语言。脚本文件将由用C#编写的脚本解释器解释。这个翻译

将完成连接设备,存储

变量,比较值,点击数据库等的后台工作,然后返回

log证明测试通过或失败。


我知道在新组中解释这个问题超出了范围。


我想知道是否有人可以指点我在.NET中创建一个新的脚本语言/脚本解释器的示例,文章,书籍,

等等?

我一直在互联网上寻找这个例子和

没有发现任何真正有用的东西。


谢谢。


-Joe

As part of our QA of hardware and firmware for the company I work for,
we need to automate some testing of devices and firmware. Since not
everybody here knows C#, I''m looking to create a new scripting
language that makes writing automated tests simpler. Really, I''m
looking to kind of abstract the power of the C# language into a
simpler language that''s easier to learn. The script files would be
interpreted by a script interpreter written in C#. This interpreter
would do the background work of connecting to the devices, storing
variables, comparing values, hitting the database, etc. and return a
log that proves pass or fail of the test.

I know that it''s beyond the scope of explaining this in a newgroup.

I''m wondering if anyone can point me to examples, articles, books,
etc. on creating a new scripting language/script interpreter in .NET?
I''ve been all over the Internet looking for examples of this and
haven''t found anything really useful.

Thank you.

-Joe

推荐答案

Joe,


你能做什么这,但老实说,为什么?

..NET有很多语言,甚至是动态/脚本语言(蟒蛇和javascript可以用于

..NET以及其他几个我确定我忘记了。


即使你不想使用.NET语言,也可以使用

Active Scripting引擎来使用VBScript或Javascript,或者为Active Scripting创建一个新的

语言。


有很多工作已经完成,并且已经完成了/>
写一个类似脚本解释器的东西并不是一项简单的任务。相反,我会分析运行时目前支持的动态/脚本语言,并使用其中一种语言。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com

" jkimbler" < jo ********* @ gmail.comwrote in message

news:ad ********************* ************* @ y5g2000h sf.googlegroups.com ...
Joe,

You could do this, but honestly, why? There are many languages for
..NET, even dynamic/scripting languages (python and javascript can be used by
..NET as well as a few others I am sure I am forgetting).

And even if you didn''t want to use a .NET language, you could use the
Active Scripting engine to use VBScript or Javascript, or create a new
language for Active Scripting.

There is a whole bunch of work out there that is done already, and
writing something like a script interpreter is not a trivial task. Instead
of getting bogged down in the details, I would analyze the dynamic/scripting
languages that the runtime currently supports, and use one of them.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jkimbler" <jo*********@gmail.comwrote in message
news:ad**********************************@y5g2000h sf.googlegroups.com...

作为我们的硬件和固件质量保证的一部分我工作的公司,

我们需要自动化一些设备和固件测试。既然不是这里的每个人都知道C#,我正在寻找创建一种新的脚本

语言,这使得编写自动化测试变得更加简单。真的,我是想要将C#语言的强大功能抽象成一种更容易学习的简单语言。脚本文件将由用C#编写的脚本解释器解释。这个翻译

将完成连接设备,存储

变量,比较值,点击数据库等的后台工作,然后返回

log证明测试通过或失败。


我知道在新组中解释这个问题超出了范围。


我想知道是否有人可以指点我在.NET中创建一个新的脚本语言/脚本解释器的示例,文章,书籍,

等等?

我一直在互联网上寻找这个例子和

没有发现任何真正有用的东西。


谢谢。


-Joe
As part of our QA of hardware and firmware for the company I work for,
we need to automate some testing of devices and firmware. Since not
everybody here knows C#, I''m looking to create a new scripting
language that makes writing automated tests simpler. Really, I''m
looking to kind of abstract the power of the C# language into a
simpler language that''s easier to learn. The script files would be
interpreted by a script interpreter written in C#. This interpreter
would do the background work of connecting to the devices, storing
variables, comparing values, hitting the database, etc. and return a
log that proves pass or fail of the test.

I know that it''s beyond the scope of explaining this in a newgroup.

I''m wondering if anyone can point me to examples, articles, books,
etc. on creating a new scripting language/script interpreter in .NET?
I''ve been all over the Internet looking for examples of this and
haven''t found anything really useful.

Thank you.

-Joe



1月11日,1:39 * pm,Nicholas Paldino [ .NET / C#MVP]"

< m ... @ spam.guard.caspershouse.comwrote:
On Jan 11, 1:39*pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:

Joe,


* *你可以做到这一点,老实说,为什么? *

.NET有很多种语言,甚至是动态/脚本语言(python和javascript可以用于

.NET以及其他一些我确信我我忘记了。


* *即使你不想使用.NET语言,你也可以使用

Active Scripting引擎来使用VBScript或Javascript,或为Active Scripting创建一个新的

语言。


* *有很多工作已经完成,和写作类似脚本解释器的
并不是一件轻而易举的事。 *相反

陷入细节,我会分析运行时目前支持的动态/脚本语言,并使用其中一种语言。


-

* * * * * - Nicholas Paldino [.NET / C#MVP]

* * * * * - m .. 。@ spam.guard.caspershouse.com


" jkimbler" < joe.kimb ... @ gmail.com写信息


新闻:ad ********************* ************* @ y5g2000h sf.googlegroups.com ...
Joe,

* * You could do this, but honestly, why? *There are many languages for
.NET, even dynamic/scripting languages (python and javascript can be used by
.NET as well as a few others I am sure I am forgetting).

* * And even if you didn''t want to use a .NET language, you could use the
Active Scripting engine to use VBScript or Javascript, or create a new
language for Active Scripting.

* * There is a whole bunch of work out there that is done already, and
writing something like a script interpreter is not a trivial task. *Instead
of getting bogged down in the details, I would analyze the dynamic/scripting
languages that the runtime currently supports, and use one of them.

--
* * * * * - Nicholas Paldino [.NET/C# MVP]
* * * * * - m...@spam.guard.caspershouse.com

"jkimbler" <joe.kimb...@gmail.comwrote in message

news:ad**********************************@y5g2000h sf.googlegroups.com...

作为我们的硬件和固件质量保证的一部分我工作的公司,

我们需要自动化一些设备和固件测试。 *由于没有

这里的每个人都知道C#,我正在寻找创建一种新的脚本

语言,这使得编写自动化测试变得更加简单。 *真的,我是b / b
想要将C#语言的强大功能抽象成一种更容易学习的简单语言。 *脚本文件将由用C#编写的脚本解释器解释为
。 *这个翻译

将完成连接设备,存储

变量,比较值,点击数据库等的后台工作并返回

log证明测试通过或失败。
As part of our QA of hardware and firmware for the company I work for,
we need to automate some testing of devices and firmware. *Since not
everybody here knows C#, I''m looking to create a new scripting
language that makes writing automated tests simpler. *Really, I''m
looking to kind of abstract the power of the C# language into a
simpler language that''s easier to learn. *The script files would be
interpreted by a script interpreter written in C#. *This interpreter
would do the background work of connecting to the devices, storing
variables, comparing values, hitting the database, etc. and return a
log that proves pass or fail of the test.


我知道它超出了在新组中解释这个范围的范围。
I know that it''s beyond the scope of explaining this in a newgroup.


我想知道是否有人可以指点我的例子,文章,书籍,

等创建一个.NET中新的脚本语言/脚本解释器?

我已经在互联网上寻找这个例子和

没有找到任何真正有用的东西。
I''m wondering if anyone can point me to examples, articles, books,
etc. on creating a new scripting language/script interpreter in .NET?
I''ve been all over the Internet looking for examples of this and
haven''t found anything really useful.


谢谢。
Thank you.


-Joe-隐藏引用的文字 -
-Joe- Hide quoted text -



- 显示引用的文字 -


- Show quoted text -



Nicholas:


在某些时候,有人真的厌倦了所有的替代品

在那里创建了TCl,因为没有任何替代方案符合他们想要做的事情。然后,在TCl之后,有人看着那个并说,

那也不适合我。他们继续创造了你所说的其他语言中的一种。


我不是说听起来像混蛋...而且认真的,谢谢

回复。不幸的是,这是我在论坛中总是看到的答案

和Usenet,并不是很有帮助。事实上,我在询问

的问题是否表明我有理由想要或需要

这样做...而且我希望能够权衡替代品,发现

这是完成分配给我的工作的最佳途径。


恭敬地,


Joe

Nicholas:

At some point, someone was really fed up with all the alternatives out
there and created TCl because none of the alternatives fit what they
wanted to do. Then, after TCl, someone looked at that and said,
"That''s not for me either." They went on to create one of the many
other languages you speak of.

I don''t mean to sound like a jerk...and seriously, thank you for the
reply. Unfortunately, this is the pad answer I always see in forums
and Usenet and isn''t very helpful. The fact that I''m asking the
question would denote that I have a reason for wanting or needing to
do it...and that I hopefully have weighed the alternatives and found
this to be the best avenue to complete the work assigned to me.

Respectfully,

Joe


jkimbler写道:
jkimbler wrote:

和Usenet并不是很有帮助。 *我问这个问题的事实是否表示我有理由想要或需要

这样做...而且我希望有权衡替代方案*并找到

这是完成分配给我的工作的最佳途径。
and Usenet and isn''t very helpful. *The fact that I''m asking the
question would denote that I have a reason for wanting or needing to
do it...and that I hopefully have weighed the alternatives* and found
this to be the best avenue to complete the work assigned to me.



公平地说,使用我的任意主观数学,大约95%的时间这是绝对不真实的海报,它可能是是你获得答案的原因

get。绝大多数时候,人们会对Nicholas的帖子做出回应,因为这些框架功能都存在,这让他们感到惊讶。

Chris。

To be fair, using my arbitrary subjective math, about 95% of the time this is
absolutely untrue of posters, and it may be the reason you get the answers you
get. The vast majority of the time people would respond to Nicholas'' post with
surprise that these framework features were present.
Chris.


这篇关于使用C#创建脚本解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆