示例#1
0
 public virtual bool Visit(ReservedTopLevel node)
 {
     return true;
 }
        public override bool Visit(ReservedTopLevel node)
        {
            // FROMやWHEREなどの前には必ず改行を入れる
            _invalidDeltaIndent = 0;
            if (node.ParentNodeToggleIs)
            {
                _LeftIndentSize.Pop();
                AddNewLineResultSql();
            }
            AddResultSql(node.Value);

            if(_entity.TopReservedWordAfterIndent == TopReservedWordIndentType.Invalid)
            {
                _invalidDeltaIndent = node.OriginalValue.Length;
                _invalidDeltaIndent -= _invalidDeltaIndent%4;
            }
            // 予約語のあとはインデントをひとつ下げる
            _invalidDeltaIndent += 4;

            // indentのタブ(_invalidDeltaIndent)+最大文字列数+切り上げのタブ分(4)
            int max = _invalidDeltaIndent + GetLeftMaxIndent(node.ChildNodes) + 4;
            _LeftIndentSize.Push(_entity.MaxIndenSize > max ? max : _entity.MaxIndenSize);

            _evalutionIndentSize = GetMaxEvaluationSize(node.ChildNodes) + 4;
            return base.Visit(node);
        }
示例#3
0
 public override bool Transform(ReservedTopLevel node)
 {
     node.Value = CaseFormatUtils.Convert(_entity.TopReservedWordCase, node.Value);
     return base.Transform(node);
 }
示例#4
0
 public virtual bool Transform(ReservedTopLevel node)
 {
     return true;
 }