7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

独自プログラミング言語を作るメモ

Posted at

必要なもの

  • BNFC

  • Java CUP runtime

    bncfコマンドが使えるようにする

    CUPはjavaコマンドで参照されるところに配置する

BNFCでBNF記法した構文から雛形を生成

文法に従って実装したい言語のcfファイルを作成する

$bnfc -m -java xxx.cf

必要なファイル群とMakefileが生成される

構文解析

$make
$echo "a:=1; print a"|Java xxx/Test
// もしくは
$cat test.xxx|Java xxx/Test

Testに構文を定義したコードを渡すと構文解析をして構文要素を表示することができる


そのうち加筆する予定

7
7
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?