Navigation Menu

Skip to content

Commit

Permalink
Add ExpressionOptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yata committed Jun 23, 2014
1 parent 90ecdb4 commit 918cbb5
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions new-interface/expression-builder.hpp
Expand Up @@ -5,6 +5,48 @@

namespace grnxx {

enum DivisionByZeroHandling {
// TODO:
// - 失敗する.
// - デフォルト値にする.
};

enum OverflowHandling {
// TODO:
// - 失敗する.
// - デフォルト値にする.
// - 無視する(動作は未定義になる).
// - INT64_MIN / -1 は無視すると落ちるので無視できない.
};

enum NullHandling {
// TODO
// 失敗する.
// 参照先のデフォルト値にする.
};

enum NaNHandling {
// TODO
// 失敗する.
// 参照先のデフォルト値にする.
};

struct ExpressionOptions {
// ゼロによる除算の扱い.
DivisionByZeroHandling division_by_zero_handling;

// オーバーフローの扱い.
OverflowHandling overflow_handling;

// NULL 参照の扱い.
NullHandling null_handling;

// NaN の扱い.
NaNHandling nan_handling;

ExpressionOptions();
};

// 後置記法(逆ポーランド記法)に基づいて式のオブジェクトを構築する.
class ExpressionBuilder {
public:
Expand Down

0 comments on commit 918cbb5

Please sign in to comment.