Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToDo: implement CPP14Engine #1

Open
38 of 55 tasks
RYOSKATE opened this issue Oct 5, 2018 · 0 comments
Open
38 of 55 tasks

ToDo: implement CPP14Engine #1

RYOSKATE opened this issue Oct 5, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@RYOSKATE
Copy link
Contributor

RYOSKATE commented Oct 5, 2018

文法

  • struct
    • struct型のメンバ変数
    • structのmalloc
    • structのポインタ変数
    • 未初期化フィールドの乱数初期化
  • typedef (UniVariableDecとして実装)→UniType extends UniExprを作る
    • typedef struct node* link;
    • typedef struct Point point;
  • 構造体
    • グローバル変数
    • 宣言と同時の変数宣言
      struct point { int x; int y; } p1, p2; (UniClassDecとStringがtype)→→UniType extends UniExprを作る
  • 型に応じた未初期化変数の乱数初期化(charなどは0xFF範囲)
  • 関数定義
    • ポインタが戻り値の関数定義
    • 構造体が戻り値の関数定義
    • 関数の前方宣言
  • for
    • {}がないと一気に実行されてしまう問題
    • 初期化、続行チェック、各ループ終了時の処理が空だと動かない
  • Switch文
    (CではUniSwitchにExprしか書けない(UniSwitchUnitとかにできない)、ExprStatementなど作るか)
  • enum
  • static 変数
  • union
  • 三項演算子のtrue(UMG側のMapper生成の問題)
  • ifの{}がないと一気に実行されてしまう問題
  • 多次元配列
    • 2次元配列
      • 初期化リストあり
      • 初期化リストなし
    • 3次元以上の配列
      • 初期化リストあり
        • 初期化リストに全要素がある場合
        • 初期化リストの要素が欠けている場合
      • 初期化リストなし
    • 可視化用ExecState修正
  • int a[10], p;でpもint[10]になってしまう問題
  • 変数宣言時のセパレータではない演算子としてのカンマ

プリプロセッサ

  • #define
    • #define N 100など値に置換するもの
    • #define prt(f) printf("%f\n", f)など式に置換するもの
      Mapperにプリプロセスを処理する関数を用意。
      parse前にそれを通すが基本は何もせず返す。
      C/C++Mapperは必要に応じて拡張して中身を実装する。

関数

  • stdio
    • getChar
    • sprintf
    • scanf
    • fgets
      • gets (非推奨)
  • stdlib
    • atoi
  • string
    • strcpy
    • strcat
    • strcmp
    • strlen

エラー処理

  • コンパイルエラー
  • ランタイムエラー
@RYOSKATE RYOSKATE added the enhancement New feature or request label Oct 5, 2018
@RYOSKATE RYOSKATE self-assigned this Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant