Coder Social home page Coder Social logo

haribotelanguage's Introduction

ハリボテ言語 HL-x

川合のプログラミング言語自作のためのテキスト第三版#1 ~ 通称「10日くらいでできる!プログラミング言語自作入門」の内容の実装。

HL-1

変数の宣言、加算、減算、変数の値の表示ができる

  • freadの引数が参考資料と違っていた。マニュアルでは引数は4個。
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
// size: 個々のデータのバイト長,  nmemb: 読み込むデータの個数
  • =+などの前後にスペースを入れられない

テストコード.hl1

a=1;
b=a+2;
c=a+b;
print c;

HL-2

複数文字の変数名を使える

  • =+などの前後にスペースを入れられるように変更
  • lexerを導入し、複数文字の変数名に対応
  • 1 + 2 + 3など、3項以上の演算はできない

テストコードhl2

var1 = 10;
var1 = var1 + 2;
print var1;
var2 = var1 * 2;
print var2;

HL-3

if, goto, labelによって条件分岐ができる

参考

川合のプログラミング言語自作のためのテキスト第三版#1 ~ 通称「10日くらいでできる!プログラミング言語自作入門」

haribotelanguage's People

Contributors

takashimakazuki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.