Giter Club home page Giter Club logo

aqcc's Introduction

AnQou C Compiler: aqcc

Usage

Try make selfself_test, which tells you all the things.


AnQou C Compiler の使い方

aqcc をコンパイル

  • make aqcc gcc を用い aqcc をコンパイル
  • make aqcc_self aqcc を用い aqcc_self をコンパイル (2度目のコンパイル)
  • make aqcc_selfself aqcc_self を用い aqcc をコンパイル (3度目のコンパイル)

なお、何かしらの理由で生成物を皆削除したいときは、 make clean などとしてください。

aqcc の挙動をテスト

  • make test aqcc をテスト
  • make self_test aqcc_self をテスト
  • make selfself_test aqcc_selfself をテスト
  • aqcc_selfaqcc_selfself がそれぞれ出力するオブジェクトファイルに違いがないことも確認されます.

サンプルプログラム

1段から8段までのN-Queen問題を解くサンプルが examples/nqueen 以下にあります。 トップディレクトリで make examples を実行すると、 examples/nqueen/nqueenaqcc を用い生成されます。 examples/nqueen/nqueen とすると、1段から8段までの結果が表示されます。

一般のCファイルをコンパイル

./aqcc [options] file...

options には以下のようなものを使用できます。

  • -S アセンブリファイルを出力します。
  • -c オブジェクトファイルを出力します。
  • -o out 出力ファイル名を指定できます。

program.c を以下のようにしてコンパイルし、実行できます。 aqccprogram.c などは適宜読みかえてください。

$ ./aqcc program.c -o program
$ ./program

なお、#include <stdio.h> などとはできません。 program.c の中にこのような構文が含まれている場合は、取り除いて下さい。 その代わりに、自前で puts() 関数などの プロトタイプ宣言を program.c の冒頭に加えてください。 なお、カレントディレクトリ内のファイルはインクルードできますので、 #include "aqcc.h" などとインクルードして、 aqcc.h に記されているプロトタイプ宣言を流用できます。

また、標準ライブラリのうち提供されている機能はごく僅かです。 stdlib.c を参照して下さい。

aqcc's People

Contributors

hiromi-mi avatar hsjoihs avatar ushitora-anqou avatar

Watchers

 avatar  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.