如何开始写一个非常简单的编程语言 [英] how to start writing a very simple programming language

查看:157
本文介绍了如何开始写一个非常简单的编程语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我四处寻找创意什么我可以使用C这个夏天构建和我碰到这个职位传来:<一href=\"http://stackoverflow.com/questions/1257376/interesting-project-to-learn-c\">http://stackoverflow.com/questions/1257376/interesting-project-to-learn-c

Recently, I was going around looking for ideas on what I can build using C this summer and I came across this post: http://stackoverflow.com/questions/1257376/interesting-project-to-learn-c

实施的编程语言。这个
  不必是非常硬 - 我
  没有了语言,切不可
  命名 - 但它会迫使你学习
  很多C的如果重要组成部分
  你不想写一个词法分析器和/或
  解析器自己,你可以使用法/柔性
  和yacc /野牛,但如果你打算
  你可能要开始了
  稍小的项目。

Implement a programming language. This doesn't have to be terribly hard - I did the language that must not be named - but it will force you to learn a lot of the important parts of C. If you don't want to write a lexer and/or parser yourself, you can use lex/flex and yacc/bison, but if you plan on that you might want to start with a somewhat smaller project.

我是有点好奇关于实施一种编程语言的答案,我不知道我怎么去开始呢?我已经通过了整个K&放去; R的书,我已经做了一些练习题。我也有一点在C ++中的经验和Java如果该事项。任何提示吗?谢谢!

I was kinda intrigued about the implementing a programming language answer and I'm wondering how do I go about starting this? I've gone through the whole K&R book and I've done some of the exercises as well. I also have a bit of experience in C++ and Java if that matters. Any tips? Thanks!

推荐答案

了解有关正前pressions,语法,和良好的解析器生成。

Learn about regular expressions, grammars, and a good parser generator.

即使你最终实现自己的解析器,这些都是实施任何编程语言的基本概念。

Even if you end up implementing your own parser, these are the fundamental concepts to implementing any programming language.

这篇关于如何开始写一个非常简单的编程语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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